Object detection constructs a scored set of boxes; candidate generation, training assignment and duplicate handling are separate choices.
Summary
Where are candidates generated, assigned to target objects, and converted into the final prediction set? Declare box coordinates, classes, score meaning and the maximum output count. Background or no-object predictions are not additional objects.
Two-stage: Faster R-CNN (Ren et al., 2015)
Extract backbone features, generate RPN objectness/box proposals, then classify and refine selected regions. RoI pooling quantizes regions; RoIAlign samples aligned features without that coordinate quantization. Proposal and final duplicate handling belong to the specified implementation. Mask R-CNN adds a mask head; it does not change this comparison into a speed guarantee.
One-stage: YOLO (Redmon et al., 2015 onward), RetinaNet (Lin 2017)
Dense heads predict from feature locations without a separate region-classification stage. YOLO v1’s grid differs from v3’s multiscale predictions and later anchor-free or assignment variants. Name the version and head, not merely the family. RetinaNet uses focal loss to reduce easy-background dominance. Anchor-free parameterization does not imply NMS-free inference.
Set prediction: DETR (Carion et al., 2020)
Learned object queries attend to encoded image features and predict boxes/classes, including no-object. During training, one-to-one matching assigns targets to distinct slots; unmatched queries receive the specified no-object loss. Inference does not match against unavailable ground truth. Original DETR emits slots without an NMS stage, but training incentives do not mathematically forbid all duplicate predictions.
Learning objective
Training-time matching and inference-time duplicate removal are different operations
Reference drawing
Learning objective
Training-time matching and inference-time duplicate removal are different operations
Derivation
Work the assignment
| Matching cost | Target one | Target two |
|---|---|---|
| Query one | 1 | 2 |
| Query two | 2 | 100 |
Taking query one’s cheapest target first leaves total cost . Swapping assignments gives , the global minimum. Matching cost selects pairs; subsequent training losses and their weights must be defined separately. This equal-count toy omits unmatched-query costs.
Change the deployment requirement
Meet a request deadline
New task: complete an edge request within thirty milliseconds.
Picture and change: a hypothetical serial trace takes four ms preprocessing, eighteen ms model time and ten ms postprocessing.
Check: total time is 32 ms, so the model-only timing hides a miss. A compatible twelve-ms model gives 26 ms on that same assumed trace. Measure accuracy, memory and actual end-to-end tails; component percentiles cannot simply be added.
Use when: service constraints change; family labels alone do not establish FPS or quality.
Prioritize small or crowded objects
New task: one-pixel localization errors now determine usefulness.
Picture and change: shift a two-by-two box one pixel horizontally: IoU becomes .
Check: the same shift of a twenty-by-twenty box gives . Evaluate small/crowded slices and consider resolution, multiscale features and duplicate policy. Text-conditioned classes additionally need grounding checks; a vocabulary match is not localization evidence.
Use when: the object distribution or class vocabulary differs from the benchmark average.
Reconstruct the distinction
Does using no anchors remove duplicate-resolution requirements?
Reasoned answer
No. Parameterization, training assignment and inference selection are independent design axes. An anchor-free head can still use NMS.
Key shared components
Bounding box parameterization
Declare center/size versus corner coordinates, normalization, resizing and padding transforms before losses or evaluation.
IoU loss
IoU compares intersection to union; disjoint boxes have zero IoU. GIoU adds enclosure geometry; DIoU uses center distance; CIoU includes an aspect-ratio term. These are different objectives, not interchangeable names for ordinary coordinate L1 loss.
Non-Maximum Suppression (NMS)
Specify score ordering, class grouping, IoU threshold and maximum detections. Aggressive suppression can remove distinct nearby objects. See the anchor/NMS owner for exact decode and threshold arithmetic.
Anchors
Anchors provide reference geometry for offsets; anchor-free heads use other coordinate conventions. Neither alone specifies assignment or postprocessing.
Datasets and metrics
VOC, COCO, Open Images and LVIS use different classes and evaluation conventions. Use the official evaluator and state IoU thresholds, interpolation, area slices, class averaging and maximum detections. AP integrates a ranked precision-recall curve under that protocol; duplicates do not universally reduce AP in every score order.
Production considerations
FPN supplies multiscale features; test whether the small-object slice improves. Deformable DETR, DINO and related variants change computation or training; retain versioned comparisons. Open-vocabulary models add text-conditioned class support, not guaranteed grounding for arbitrary new objects.
Common pitfalls
An unspecified FPS number omits hardware, resolution, batching and postprocessing. Keep annotation policy, augmentation and class/area coverage visible when comparing detectors.
Related
- CNN architecture. Backbone.
- Vision transformers. Alternative backbone.