DETR Detects Sets Without Anchors
DETR predicts a fixed set of boxes with transformers and matches them one to one, removing anchors and NMS entirely.
Why Does This Exist?
Anchors need scales, ratios, IoU thresholds, and NMS tuning per dataset. Crowded scenes break the heuristics first.
DETR drops them. It builds on object detection set framing, uses attention mechanisms globally, and leads to deformable decoders.
Think of It Like This
Assigned parking instead of first come lots
Open lots need circling plus towing of doubles. Assigned bays give each car one spot with no towing.
Queries are bays, Hungarian is the attendant. Where it stops: too few bays overflow, just as too few queries miss dense crowds.
How It Actually Works
Backbone makes maps. Encoder adds sine positions. Decoder starts learned queries, attends to memory, and outputs class plus box . Match cost is , solved by Hungarian in .
Worked example
, truths cat and dog . Predictions give costs where and . Best picks total . No duplicates remain, so NMS has nothing to do.
Watch Out For
Training 50 epochs and calling DETR broken
DETR needs about 500 epochs to settle matching. Symptom: low AP at 50 epochs blamed on code. Fix: train long or move to deformable variants before judging.
The Quick Version
- DETR predicts boxes as a set with no anchors.
- Hungarian matching pairs each truth once at .
- Fixture cost minus 1.54 picks cat and dog correctly.
- Removal of NMS helps crowded scenes most.
- Budget 500 epochs or use faster variants.