TL;DR
Modern Transformer-based object detectors ditch clumsy post-processing filters in favor of predicting objects all at once, yet they still suffer from "double vision"—multiple internal queries fighting over the exact same object. Taking inspiration from classical sequential filtering, DETRNN lines up competing object queries in single-file order and marches a Recurrent Neural Network (RNN) down the line to settle the dispute. It’s a clean, plug-and-play upgrade that stabilizes training and boosts accuracy across state-of-the-art detectors without slowing them down.
What Problem Does This Paper Address?
For decades, object detectors predicted thousands of overlapping bounding boxes and relied on a rigid, hand-tuned post-processing step called Non-Maximum Suppression (NMS) to clean up the mess: rank boxes by confidence, keep the best one, and ruthlessly delete any overlapping neighbors.
Then came DETR (Detection Transformer), which reframed detection as an end-to-end set prediction problem. Using a fixed pool of learnable "object queries" and one-to-one bipartite matching during training, DETR eliminated NMS altogether.
Except there's a catch. Inside a DETR decoder, queries talk to each other via self-attention, which is completely parallel and order-agnostic. Imagine a crowded room where everyone shouts at once to claim an object—nobody knows who called dibs first. Because there is no explicit pecking order, multiple queries often converge on the exact same object with nearly identical confidence scores. Only one gets rewarded during training while the runners-up get penalized, creating noisy gradients, sluggish convergence, and lingering duplicate predictions.
Methods
Instead of tweaking attention masks or pruning queries, the authors ask a delightfully direct question: what if we bring the sequential logic of NMS inside the learnable decoder? Because RNNs naturally process ordered streams, they are built for sequential suppression—provided the sequence actually means something.
DETRNN replaces the standard self-attention sub-layer in the final decoder stage(s) with a two-step plug-and-play module (leaving cross-attention and feed-forward networks untouched):
- Competition-Guided Query Ordering (CGQO): Taking prior predictions (from the encoder or previous decoder layer), CGQO sorts queries without throwing any away. It picks the highest-confidence query as a "pivot," then measures every other query's similarity to it—blending geometric box overlap (IoU) and semantic class-score cosine similarity. Queries exceeding a density-adaptive threshold (which tightens in crowded regions and relaxes in sparse ones) are grouped right behind the pivot. Those queries are set aside, a new top pivot is chosen from the remainder, and the cycle repeats until the unordered set becomes a structured line of "leaders followed immediately by their closest rivals."
- Bidirectional RNN Refinement: A Bidirectional RNN (instantiated primarily with modern state-space blocks like Mamba) scans forward and backward along this newly ordered sequence. Because rivals sit right next to strong candidates in the stream, the RNN can effortlessly pass suppression signals down the line to softly quiet duplicates.
Datasets
No new benchmarks are introduced; the authors evaluate on two standard, complementary detection datasets:
- MS-COCO 2017: The go-to general object detection benchmark (117K training images, 5K validation images).
- CrowdHuman: A stress-test benchmark for heavily occluded, densely packed human detection (4.4K validation images), where traditional NMS thresholds notoriously struggle.
Key Insights and Ideas
- Neither ordering nor recurrence works alone—magic happens at their intersection: Putting CGQO before standard self-attention yields zero gain (self-attention is permutation-equivariant; it doesn't care about order). Conversely, feeding unordered queries into a Bi-RNN barely moves the needle (+0.0 to +0.2 AP), and random ordering actively hurts (-0.4 AP). An RNN needs a meaningful sequence to shine.
- Architecture-agnostic recurrence: Swapping Mamba out for RWKV, xLSTM, or TTT yields nearly identical accuracy gains (48.4–48.7 AP vs. 47.6 baseline). The secret sauce isn't a specific trendy sequence model; it's framing de-duplication as ordered sequential refinement.
- Single-layer de-duplication superpower: Standard DETRs need 6 stacked decoder layers to gradually iron out duplicates. In a brutal 1-decoder stress test, baselines suffered massive duplicate penalties, whereas DETRNN jumped by +3.7 to +5.7 AP—beating the baselines even after giving them post-processing NMS.
- Less is more in stage placement: Inserting DETRNN into just the last 1 or 2 decoder layers beats putting it in all 6 layers on both speed and accuracy, as object recall largely saturates in earlier stages.
Key Results
Across four diverse ResNet-50 baselines on COCO (12-epoch 1x schedule, 900 queries), DETRNN delivers consistent AP boosts with virtually identical FLOPs and FPS:
- Def-DETR++: 47.6 $\rightarrow$ 48.7 AP (+1.1)
- DINO: 49.0 $\rightarrow$ 50.0 AP (+1.0)
- MS-DETR: 50.0 $\rightarrow$ 50.5 AP (+0.5)
- LoRA-DETR: 52.5 $\rightarrow$ 53.0 AP (+0.5), while increasing speed from 16 to 19 FPS by replacing complex query interactions.
Gains hold up under longer 2x schedules, scale to Swin-L backbones (pushing LoRA-DETRNN to 58.5 AP), and outperform specialized competition-aware decoders (EASE-DETR, Relation-DETR, DDQ) in both accuracy and throughput. On CrowdHuman, where aggressive NMS accidentally deletes true people (-0.3 AP at IoU 0.7), DETRNN cleanly adds +0.8 to +1.1 AP without touching a post-processing threshold.
Limitations and Future Work
In the main text, the authors note only that "A brief discussion of limitations is provided in Appendix P," which is not included in this 11-page main manuscript. Consequently, explicit limitations and proposed future directions are not discussed in the provided pages.
Summary updated