Abstract
Object detection has been transformed by the DEtection TRansformer (DETR), which treats detection as a set-prediction problem. Despite its success, DETR models are often criticized for slow convergence and high data dependency. This paper introduces Relation DETR, a novel architecture that incorporates an explicit position relation prior. By explicitly modeling spatial relationships between object queries and employing a dual-query contrast pipeline, Relation DETR achieves significantly faster convergence and superior accuracy across multiple benchmarks.
Introduction: The Geometric Gap in DETR
Standard DETR models rely on self-attention to capture dependencies between object queries. While flexible, self-attention lacks an inherent understanding of geometry. It must learn from scratch that certain objects, like wheels and car bodies, typically appear in specific relative spatial configurations. This "bipless" nature contributes to slow training. Furthermore, the one-to-one matching strategy used in DETR, while effective for removing duplicates, provides sparse supervision signals during early training stages, leading to "supervision starvation."
Quantifying Spatial Logic: The Macroscopic Correlation Metric
To justify the need for explicit spatial priors, the authors developed the Macroscopic Correlation (MC) metric. By calculating the Pearson correlation of bounding box coordinates across diverse datasets, they demonstrated that objects in real-world images exhibit high degrees of spatial correlation.
This statistical evidence suggests that providing a model with a "map" of these relationships can serve as a powerful inductive bias, bypassing the need for the model to rediscover basic geometry through millions of iterations.
Architecture: Bridging the Gap
Relation DETR introduces two primary components to address the limitations of standard DETR:
1. Position Relation Encoder
Instead of relying solely on learned attention weights, the Position Relation Encoder explicitly calculates geometric relationships—such as relative distance and scale—between bounding boxes. These relationships are embedded and injected into the self-attention layers as a bias. This allows the model to immediately understand the spatial context between potential object detections.
2. Contrast Relation Pipeline
To overcome supervision starvation, the authors implement a dual-query system. Matching queries follow the standard one-to-one matching protocol to ensure clean, non-duplicated final outputs. Simultaneously, Hybrid queries utilize one-to-many matching during training. This provides the model with significantly more positive feedback, accelerating the learning process without compromising the final inference quality.
Experimental Results
The researchers evaluated Relation DETR on several benchmarks, including COCO 2017, specialized crowd/street scene datasets (CSD, MSSD), and a new class-agnostic dataset, SA-Det-100k.
- Rapid Convergence: Relation DETR achieves 40% AP on COCO in just 2 epochs, a feat that took earlier models dozens or hundreds of epochs.
- State-of-the-Art Performance: With a ResNet-50 backbone, the model reached 52.1% AP on COCO, outperforming established models like DINO.
- Universal Compatibility: The Position Relation Encoder proved to be a "plug-and-play" module, providing performance boosts when integrated into other architectures like Deformable-DETR and DAB-DETR.
- Small Object Detection: The model showed marked improvements in detecting small objects, likely due to its ability to "anchor" them spatially to larger, more prominent features in the scene.
Conclusion
Relation DETR demonstrates that explicit spatial priors are a highly effective shortcut for training transformer-based detectors. By combining geometric biases with enhanced supervision strategies, the model achieves a rare balance of speed and accuracy. Future research may extend this approach to include semantic relations, further refining the model's ability to navigate complex, dense environments.
Summary updated