Computer vision
Detection Matching, Suppression, and Operating Points
Learn IoU matching, assignment, duplicate removal, non-maximum suppression, score thresholds, and precision-recall trade-offs.
By the end you can
- Explain how predicted boxes are matched to ground-truth instances for training and evaluation
- Describe why duplicate candidates arise and how suppression changes outputs
- Choose thresholds using prevalence, review capacity, and error cost
- Diagnose localization, classification, duplicate, and ranking errors separately
Example
How often a second real person sits inside the suppression radius
A suppression rule has to survive real crowds, and somebody measured what that costs. CrowdHuman, a benchmark Megvii published in 2018, carries 15,000 training images with 339,565 annotated persons — 22.64 per image. Its authors then counted how often two distinct annotated people overlap each other: “Moreover, There are averagely 2.4 pairs whose IoU is greater than 0.5 in the CrowdHuman dataset.” The tables give that count as 2.40 and trace it down the threshold: 9.02 pairs per image above IoU 0.3, 4.89 above 0.4, 1.01 above 0.6.
Those pairs are the whole problem. A hard suppression rule cannot tell them from duplicates. The same count is 0.32 pairs per image in CityPersons, and 0.02 in COCOPersons and Caltech. So a rule that deletes every box overlapping the winner beyond IoU 0.5 is very nearly free on ordinary images, where 0.02 pairs per image are genuinely that close. In a crowd the same rule is deciding the fate of 2.40 real people per image, with identical geometry and identical scores in front of it.
None of that came from the class vocabulary. Candidate ranking, overlap rules and crowd geometry determined the operational count.
- Raw output: many candidate boxes with correlated scores, over a scene holding 22.64 people on average
- Suppression choice: at IoU 0.5 a CrowdHuman image contains 2.40 real pairs that look exactly like duplicates; at 0.6 it contains 1.01
- Threshold choice: decide which remaining scores are actionable
- Matching choice: PASCAL VOC assigns detections in order of decreasing confidence and pays each reference object once
- Operational effect: count, alert and review load change sharply between 0.02 overlapping pairs per image and 2.40
Visual
Evaluation needs an explicit matching protocol, and someone wrote it down
A prediction is not correct until it is paired with a reference instance under declared rules. The rules most benchmarks still run on were written down by the PASCAL VOC challenge in 2010. Detections are assigned to ground-truth objects in order of decreasing confidence. A detection counts as correct only if the overlap ratio a_o = area(Bp ∩ Bgt)/area(Bp ∪ Bgt) exceeds 0.5. What happens to the leftovers is settled with arithmetic rather than principle: “Multiple detections of the same object in an image were considered false detections e.g. 5 detections of a single object counted as 1 correct detection and 4 false detections—it was the responsibility of the participant’s system to filter multiple detections from its output.”
Five decisions are packed into that sentence and its neighbours. Order the predictions — VOC orders by decreasing confidence. Require category agreement. Measure geometric overlap, here a_o against 0.5. Enforce one-to-one matching, so that the second, third and fourth box on one object cannot be paid a second time. Then count what is left over: unmatched predictions are false positives, unmatched references are false negatives. Five boxes on one object score 1 and 4, not 5.
The rule travelled. The ImageNet Large Scale Visual Recognition Challenge paper records that “The criteria for object detection was adopted from PASCAL VOC (Everingham et al., 2010). It is designed to penalize the algorithm for missing object instances, for duplicate detections of one instance, and for false positive detections.” In both documents, filtering duplicates is explicitly the system's job and not the metric's. That is why suppression is a modelling decision that gets scored as if it were an implementation detail.
1. Sort or consider predictions
Use a score order or task-specific matching procedure.
2. Check class compatibility
Require the relevant category agreement.
3. Measure geometric overlap
Compute IoU or another localization criterion.
4. Enforce one-to-one matching
Prevent several predictions from claiming the same reference object.
5. Count unmatched items
Unmatched predictions are false positives; unmatched references are false negatives.
IoU mixes position, size, and shape approximation
Intersection over Union compares overlapping area with the union of two boxes or masks. The same coordinate shift therefore costs a tiny object far more of its area than a large one. ILSVRC put the arithmetic on the page. A detection window of 20×20 pixels that fully contains a 10×10-pixel object — roughly 5 pixels of error per side, about average human annotation error — scores IoU 100/400 = 0.25. Under the standard rule it is counted wrong. “The PASCAL VOC metric uses the threshold thr(B) = 0.5. However, for small objects even deviations of a few pixels would be unacceptable according to this threshold.” The benchmark did not keep the constant. It replaced it with a size-dependent threshold, thr(B) = min(0.5, wh/((w+10)(h+10))), a relaxation that “changes the threshold only on objects which are smaller than approximately 25 × 25 pixels, and affects 5.5% of objects in the detection validation set”.
The 0.5 was a judgement call from the beginning. Everingham and his co-authors say the 50% threshold “was set deliberately low to account for inaccuracies in bounding boxes in the ground truth data”, and they measured what the dial is worth. Reducing the overlap threshold to 10% raises measured AP on the 'car' class by around 7.5%, while AP drops steeply for thresholds above 50%. Several points of reported performance sit in a tolerance nobody trained.
IoU thresholds therefore encode a notion of acceptable localization that may not match business tolerance. Report how the detector does across thresholds and object sizes.
COCO's own protocol makes the convention explicit. Its headline AP averages over ten IoU thresholds, from 0.50 to 0.95 in steps of 0.05. The evaluation code ships those thresholds as its default, so the convention travels with the tool. Scale is broken out separately: small means an area under 32 squared pixels, medium runs to 96 squared, large is anything above. Every metric is computed allowing at most 100 detections per image. That is a workload decision hiding inside an evaluation script.
Figure
A 20×20 box fully containing a 10×10 object scores IoU 0.25: one cutoff is a convention, not a universal definition of correct localization.
Comparison
Hard NMS, soft suppression, merging, and set prediction
Post-processing choices behave differently in crowded or overlapping scenes, and each of the four has a measured cost.
Hard NMS removes lower-scoring boxes above an overlap threshold. It is simple, fast, common in dense detectors, and sensitive to score ordering. The paper that proposed Soft-NMS states the failure mode plainly: in non-maximum suppression, “if an object lies within the predefined overlap threshold, it leads to a miss”. In CrowdHuman that lands on 2.40 real pairs per image.
Soft suppression reduces scores instead of deleting candidates immediately. It preserves alternatives, at the price of tuning and computation. Soft-NMS is “an algorithm which decays the detection scores of all other objects as a continuous function of their overlap with M”, and it obtains “consistent improvements for the coco-style mAP metric on standard datasets like PASCAL VOC 2007 (1.7% for both R-FCN and Faster-RCNN) and MS-COCO (1.3% for R-FCN and 1.1% for Faster-RCNN) by just changing the NMS algorithm without any additional hyper-parameters”. It is still threshold-dependent.
Box merging or voting combines coordinates from related candidates. Where the candidates really do describe one object, that stabilizes localization. Where they do not, it blurs separate instances. Var voting, published in 2019, replaces a surviving box's coordinates with a variance-weighted average of its neighbours' after suppression: “Applying var voting with the standard NMS improves the AP by 1.4%. Applying var voting after soft-NMS still can improve the AP by 1.3%.” On MS-COCO with VGG-16 Faster R-CNN the gain is almost entirely localization. AP50 rose by only 0.1, while AP75 rose by 1.8, AP_M by 1.8 and AP_L by 1.6. Merging improves where a box sits, not whether it exists.
Set prediction trains unique object slots through one-to-one assignment, which reduces the design pressure that produces duplicates in the first place. DETR matches predictions to objects bipartitely and needs no NMS. Its authors ran a standard NMS over its outputs anyway, at each decoder layer. It helped after the first layer, where the model cannot yet inhibit double predictions. Then it stopped helping: “It hurts AP in the last layers, as it incorrectly removes true positive predictions.” The duplicate decision moved into the matching objective. It did not stop being a decision.
Hard NMS
Removes lower-scoring boxes above an overlap threshold.
- Simple and fast
- Can delete nearby true instances
- Sensitive to score ordering
- Common in dense detectors
Soft suppression
Reduces scores instead of deleting candidates immediately.
- Preserves alternative candidates
- Adds tuning and computation
- May help crowded scenes
- Still threshold-dependent
Box merging or voting
Combines coordinates from related candidates.
- Can stabilize localization
- Assumes candidates describe one object
- Can blur separate instances
- Needs calibrated grouping
Set prediction
Trains unique object slots through one-to-one assignment.
- Reduces duplicate design pressure
- May avoid standard NMS
- Still produces score decisions
- Depends on matching objective
Key idea
The best benchmark threshold may overload the real workflow
A threshold chosen for maximum F1 assumes a particular balance of precision and recall; deployment prevalence, human review capacity, latency, and missed-event cost may differ.
Simulate expected detections per image, false alerts per hour, and missed critical instances; set class-specific or context-specific operating points when justified.
And do not assume the operating point is only the score cutoff. In 2020 one team held their Paired-Box Model fixed and changed a single step. Instead of standard NMS they suppressed on the visible region of each pedestrian rather than on the full body box, a rule they call R²NMS. On CrowdHuman that took AP from 85.60 to 89.29 and Recall from 88.61 to 93.33. It moved log-average miss rate only from 44.20 to 43.35, and left visible-body MR identical at 52.70. No weights had changed, and the metrics read different score ranges. Their abstract names the bind the change is answering: “A relative low threshold of intersection over union (IoU) leads to missing highly overlapped pedestrians, while a higher one brings in plenty of false positives.”
Soft-NMS showed the same thing at smaller amplitude. Hard NMS removes every box overlapping the top-scoring one beyond a fixed threshold, so an object lying inside that overlap is simply missed. The alternative decays the scores of overlapping boxes instead of removing them. Changing only that step, with no additional hyper-parameters, moved COCO-style mAP by 1.3% for R-FCN and 1.1% for Faster-RCNN.
Choose an operating point for the workflow, not for a leaderboard.
Analogy
Combining eyewitness reports about the same event
Several reports arrive that may describe one incident or multiple nearby incidents. An analyst must group duplicates without merging distinct events.
A report is human testimony, while box overlap and scores are geometric signals. Deciding whether candidates refer to the same instance stays ambiguous in both. The difference is that in detection the ambiguity has a measured rate. In CrowdHuman, 2.40 pairs of distinct people per image sit above the very overlap at which a hard rule declares a duplicate; in COCOPersons and Caltech, 0.02 do. The analyst's judgement call is the detector's constant.
Suppression is an identity decision performed from limited geometric evidence.
Steps
Localize detection failures before changing the model
Use matched predictions to assign each error to a useful category. There is a published instrument for doing exactly that. TIDE, a toolbox released in 2020, bins every false positive and false negative into six types — classification, localization, both, duplicate detection, background, and missed ground truth. It weights each by the ΔAP an oracle that fixed only that error would recover. The categories arrive in the units of the headline metric, so a taxonomy becomes a budget.
The definitions are mechanical. A duplicate detection error is a box with IoU_max ≥ t_f against a ground truth of the correct class that a higher-scoring detection has already matched. That is the same leftover the PASCAL VOC protocol turns into a false positive, now given its own line in the accounting.
Applied across seven detectors on COCO, TIDE traced one model's profile straight back to a post-processing constant. Of FCOS: “Note that it also has the highest duplication error because it uses an NMS threshold of 0.6 instead of the usual 0.5.” The distinguishing feature of that detector's error profile is a number in its post-processing, not something it learned.
The diagnostic order follows the same logic. Separate missed references, asking whether no candidate, a low score, or suppression caused the miss. Identify duplicate outputs, measuring how many predictions cluster on one true instance. Split class errors from localization errors — TIDE keeps classification, localization and 'both' apart precisely because a correct class with poor geometry needs a different remedy than class confusion. Analyze ranking, inspecting whether correct candidates exist but sit below false positives. Then recompute operating curves across thresholds, sizes and densities before believing any fix.
1. Separate missed references
Ask whether no candidate, low score, or suppression caused the miss.
2. Identify duplicate outputs
Measure multiple predictions assigned near one true instance.
3. Split class and localization errors
A correct class with poor geometry needs a different remedy than class confusion.
4. Analyze ranking
Inspect whether correct candidates exist but appear below false positives.
5. Recompute operating curves
Evaluate proposed fixes across thresholds, sizes, and densities.
Average precision summarizes a ranking under a protocol
Average precision integrates precision-recall behavior as the score threshold changes. Its value depends on matching, IoU criteria, class averaging, interpolation, and ignored cases.
DETR shows how much a single number can hide. On COCO val it reaches 42.0 AP — exactly the score of the tuned Faster R-CNN-FPN+ baseline, at a comparable parameter count of 41M against 42M. The tie does not survive decomposition. AP_S is 20.5 for DETR against 26.6 for the baseline, and AP_L is 61.1 against 53.4. Two systems agree to the decimal on the headline figure while scoring 20.5 against 26.6 on small objects and 61.1 against 53.4 on large ones. A team that cares about small objects and a team that cares about large ones should not pick the same model here. The headline AP will not tell either of them that.
AP is excellent for standardized comparison, and its conventions travel with the evaluation code. The COCO API sets its thresholds under the header comment “[.5:.05:.95] T=10 IoU thresholds for evaluation”, which is most of why cross-paper comparison works at all. Yet it does not directly state false alarms per hour or missed hazards. Pair it with deployment-facing measures.
A metric name is incomplete without its protocol: two detectors tied at 42.0 AP scored 20.5 and 26.6 on small objects.
Example
Numbers to simulate before deployment
Operating-point analysis should translate curves into quantities that stakeholders can reason about. Every one of these has been measured somewhere, at a size worth knowing. The full var voting pipeline moved a baseline from 23.6 to 29.1 AP on MS-COCO, at an inference cost of 99 ms to 101 ms per image. About two milliseconds — and almost all of the benefit landing at tight IoU rather than loose.
- Expected true and false detections per image, clip, site, or hour — CrowdHuman's 22.64 persons per image is a different workload from an ordinary COCO scene
- Recall for critical classes, small objects, and crowded scenes — DETR and Faster R-CNN-FPN+ tie at 42.0 AP and split 20.5 against 26.6 at AP_S
- Review queue size and reviewer time under realistic prevalence
- Duplicate rate after suppression and count bias per scene — TIDE reports duplicate detection error in ΔAP, and FCOS's is the highest of the models compared because it suppresses at 0.6
- Latency added by post-processing at the chosen input resolution — var voting took inference from 99 ms to 101 ms per image
- Performance change after score calibration or class-specific thresholds, measured at the tolerance you actually need — var voting moved AP50 by 0.1 and AP75 by 1.8
Position
A detector's score belongs to the pipeline, not to the network
Between a network's output and a reported mAP sit rules that nobody trained. They decide which boxes survive, which of them count as correct, and how many are allowed at all. The number at the end belongs to that whole arrangement.
Soft-NMS changed the suppression step and nothing else. Instead of deleting boxes that overlap the top-scoring one, it decayed their scores. On MS-COCO that was worth 1.3% coco-style mAP for R-FCN and 1.1% for Faster-RCNN, with no additional hyper-parameters. No weights moved. R²NMS ran the same experiment at a larger amplitude. Holding the Paired-Box Model fixed and suppressing on the visible region instead of the full body box took CrowdHuman AP from 85.60 to 89.29 and Recall from 88.61 to 93.33, while visible-body MR stayed at 52.70 in both rows, because nothing in the model had changed. So a gap of a point — or of nearly four — between two published detectors can be a gap between two post-processing rules.
The protocol carries more of the number still. COCO's headline AP averages over ten IoU thresholds, from 0.50 to 0.95, which fixes a tolerance for what counts as well localized. No product chose that tolerance, and the choice is worth points. VOC measured AP on the 'car' class rising by around 7.5% when the overlap threshold was dropped to 10%. ILSVRC found the standard 0.5 so punishing on small objects — a 20×20 box fully containing a 10×10 one scores 0.25 — that it rewrote the threshold for the 5.5% of its validation objects smaller than about 25 × 25 pixels. Every COCO metric is computed allowing at most 100 detections per image, a workload cap living inside an evaluation script: a system built to count a crowd of 22.64 people per image is being scored under a rule that stops at a hundred. Results are broken out by size against fixed pixel areas, so the benchmark rather than the application decides what small means.
None of this makes AP a bad metric. It is a good one, and its conventions travel with the evaluation code, which is most of why comparison works at all. The claim is narrower. “This model gets X mAP” is a sentence about a pipeline, and the network is one stage of it. Suppression rule, IoU tolerance, class averaging and detection cap can each move the number with the weights held fixed. So a reported gain is not explained until it has been located in a stage. That is what TIDE does when it reports FCOS's highest duplication error and names the responsible constant as 0.6. This lesson has shown one stage supplying 1.3% mAP for R-FCN and 1.1% for Faster-RCNN, and another rewriting what correct means, all with the model untouched.
Key takeaways
- Detection evaluation requires class, geometry, score and one-to-one matching rules. PASCAL VOC fixed them in 2010, where 5 detections of one object count as 1 correct detection and 4 false ones.
- IoU thresholds hit small and large objects differently: a 20×20 window fully containing a 10×10 object scores 100/400 = 0.25, which is why ILSVRC replaced the constant with thr(B) = min(0.5, wh/((w+10)(h+10))) for the 5.5% of its validation objects under about 25 × 25 pixels.
- Suppression methods decide whether overlapping candidates are duplicates or distinct instances, and the geometry is measurable: 2.40 genuinely overlapping pairs per image above IoU 0.5 in CrowdHuman, against 0.32 in CityPersons and 0.02 in COCOPersons and Caltech.
- Operating points should reflect prevalence, error cost and workflow capacity: replacing standard NMS with R²NMS on a fixed model took CrowdHuman AP from 85.60 to 89.29 and Recall from 88.61 to 93.33 while visible-body MR stayed at 52.70.
- Average precision is protocol-dependent and should be paired with operational metrics: DETR and Faster R-CNN-FPN+ both score 42.0 AP on COCO val, yet on small objects they score 20.5 and 26.6, and on large ones 61.1 and 53.4.
- Matched-error taxonomies separate misses, duplicates, localization, class and ranking failures; TIDE weights each by the ΔAP an oracle fixing only it would recover, and traced FCOS's highest duplication error to an NMS threshold of 0.6.