Detection before DETR relied on two-stage detectors like Faster R-CNN or single-stage detectors like YOLO and RetinaNet. These require hand-designed components, anchor boxes for proposal generation, non-maximum suppression for duplicate removal, and a label-assignment rule deciding which prediction is responsible for which object. Each of those three is a spatial prior, a statement made in advance about where objects sit and which prediction owns which one. DETR (Carion et al. 2020) deleted all three at once by framing detection as set prediction, a transformer encoder-decoder emitting a fixed set of predictions from learned object queries, trained by one-to-one bipartite matching against the ground truth.
The deletion is what makes the chapter, and the bill for the deletion is what organizes the rest of it. DETR trained for 500 COCO epochs where Faster R-CNN needs 36, and it lost 6.1 AP on small objects while gaining 7.7 on large ones (Carion et al. 2020). Both facts have one cause. A query carrying no spatial prior has to discover from scratch where in the image to attend, and a single stride-32 feature map cannot resolve a small object at any amount of training. So every method after DETR in this chapter puts a prior back, and the binding constraint is that none of them may put NMS back. A prior returned as a reference point, an anchor coordinate, a noised ground-truth box or an auxiliary dense head is differentiable and stays inside training, and is discarded at inference. A prior returned as greedy suppression is neither, and would surrender the one property the 500 epochs bought. Table tbl:detr-prior-ledger is that ledger, and it is the shortest route through the sections that follow.
Segmentation repeats the shape one level up. MaskFormer (Cheng et al. 2021) drops the per-pixel class prior and predicts a set of masks matched exactly the way DETR matches boxes, which is what lets semantic, instance and panoptic segmentation share one framework rather than three. Mask2Former (Cheng et al. 2022) then puts a prior of its own back, each query attends only inside the mask it predicted at the previous layer, and that is the mask-space analogue of a reference point. Underneath both sits the backbone's own prior, the hierarchical stride-4-to-32 pyramid that the Swin Transformer (Liu et al. 2021) supplies with shifted window attention and Swin V2 (Z. Liu et al. 2022) carries to 3B parameters and 1536-pixel inputs. A plain ViT gives one scale and a DETR decoder has nothing to address it with, which is why the backbone chapter and this one are not separable.
| Method | Puts back | Differentiable form | Bought |
|---|---|---|---|
| Deformable DETR (Zhu et al. 2021) | reference point, multi-scale | learned offsets around , levels C3-C6 | 50 epochs, 43.8 AP, AP 20.5 26.4 |
| Conditional DETR (Meng et al. 2021) | spatial half of cross-attention | , 300 learned reference points | 50 epochs, 40.9 AP where DETR needs 500 for 42.0 |
| DAB-DETR (S. Liu et al. 2022) | the anchor box itself | sinusoidal PE of , updated per decoder layer | 50 epochs, 42.2 AP, and queries you can plot |
| DN-DETR (Li et al. 2022) | the assignment | noised GT boxes with known targets, matcher bypassed | 50 epochs, 44.4 AP, ~4 less match switching |
| DINO (Zhang et al. 2023) | negatives, encoder-picked positions | contrastive denoising, mixed query selection | 12 epochs, 49.4 AP; 63.3 test-dev at Swin-L |
| Group DETR (Chen et al. 2023) | positive-sample density | replicated query groups, masked apart | +1.5 AP, training-only, is dataset-dependent |
| H-DETR (Jia et al. 2023) | positive-sample density | a second one-to-many head on shared decoder features | |
| Co-DETR (Zong et al. 2023) | dense assignment on the encoder | ATSS and RPN auxiliary heads, discarded at inference | 66.0 AP test-dev, ViT-L with Objects365 |
| Mask2Former (Cheng et al. 2022) | the region worth attending to | previous layer's mask as a attention bias | +4.8 PQ over unmasked cross-attention |
| RT-DETR (Zhao et al. 2024) | query quality | uncertainty-minimal selection, decoupled hybrid encoder | 53.1 AP at 108 FPS on T4, NMS-free |