DETR (Detection Transformer)
End-to-End Object Detection with Transformers · Also known as: Detection Transformer, DETR
DETR (Detection Transformer) is an end-to-end framework for object detection introduced by Carion et al. in 2020 that reformulates detection as a direct set prediction problem using transformers. Unlike traditional approaches that use hand-crafted post-processing like non-maximum suppression, DETR treats object detection as a sequence-to-sequence problem where the transformer predicts all objects at once.
Read the full method
Sign in with a free account to read this section.
Method map
The neighbourhood of related methods — select a node to explore.
When to use it
DETR is particularly useful when simplicity and end-to-end trainability are priorities, as it eliminates anchor box design and non-maximum suppression. It performs well on datasets with clear object boundaries and is especially suitable for research and educational contexts where interpretability of the pipeline is valued. Traditional object detectors like Faster R-CNN may be preferred for production systems requiring maximum speed, as DETR has higher latency. DETR excels in scenarios where the number of objects is small and relatively fixed.
Strengths & limitations
- Eliminates hand-crafted components like anchor boxes and non-maximum suppression, simplifying the detection pipeline
- End-to-end differentiable training enables joint optimization of all components
- Natural formulation as set prediction enables flexible modifications for related tasks
- Transformer architecture naturally captures long-range dependencies useful for detecting occluded objects
- Inference speed is slower than optimized CNN-based detectors like Faster R-CNN due to transformer complexity
- Requires significantly more training iterations and careful hyperparameter tuning to achieve convergence
- Performance on small objects is notably worse than traditional detectors, reflecting the limited resolution of CNN backbones
Frequently asked
Why does DETR not use anchor boxes like Faster R-CNN?
Anchor boxes are a manual design choice requiring careful tuning of aspect ratios and scales. DETR reformulates detection as direct set prediction, allowing the model to learn to detect objects of any size and aspect ratio. This removes a source of hyperparameter complexity and makes the method more generalizable.
What is bipartite matching and why is it necessary?
Bipartite matching assigns each ground-truth object to exactly one prediction using the Hungarian algorithm. This ensures no duplicate detections of the same object and no wasteful training on duplicate predictions. The matching cost combines classification and localization losses.
Why is DETR slower than Faster R-CNN?
DETR processes the entire image through a transformer decoder for each of 100+ object queries. Each query must attend to all encoder features, requiring O(N²) operations. Faster R-CNN uses Region Proposal Networks that are more computationally efficient. Recent variants like Deformable DETR address this with sparse attention.
Sources
- Carion, N., Massa, F., Synnaeve, G., Usunier, N., Kirillov, A., & Zagoruyko, S. (2020). End-to-end object detection with transformers. In European Conference on Computer Vision (pp. 213-229). Springer, Cham. DOI: 10.1007/978-3-030-58452-8_13 ↗
How to cite this page
ScholarGate. (2026, June 3). End-to-End Object Detection with Transformers. ScholarGate. https://scholargate.app/en/deep-learning/detr
Which method?
Set this method beside its closest kin and read them side by side — the library lays the books on the table; the choice is yours.
- Masked AutoencodersDeep learning↔ compare
- Segment Anything ModelDeep learning↔ compare
- Swin TransformerDeep learning↔ compare
- Vision MambaDeep learning↔ compare