Abstract
The DEtection TRansformer (DETR) and its variants have significantly advanced object detection by framing it as a set prediction problem. However, many conditional spatial query mechanisms remain "scale-blind," primarily focusing on the center of predicted bounding boxes and ignoring their dimensions. We present Box-DETR, which introduces "Box Agents"—head-specific reference points that leverage box scale to improve spatial search efficiency. This architectural enhancement allows attention heads to specialize in different regions of an object, leading to faster convergence and improved Average Precision (AP) on the MS-COCO benchmark with negligible computational cost.
Introduction
Recent advancements in object detection, such as DAB-DETR, utilize conditional spatial queries to iteratively refine bounding boxes. Despite their success, these models often suffer from slow training convergence. A key reason is that the cross-attention mechanism typically uses only the center point of the previous stage's box as a reference. This forces the model to rediscover object boundaries from the center in every decoder stage, regardless of the object's actual scale. Box-DETR addresses this "scale-blindness" by enabling the model to "walk" around the entire area of a predicted box.
Methodology: The Box Agent Mechanism
The core contribution of Box-DETR is the Box Agent. Instead of a single center point for all attention heads, the model generates $n$ distinct "agent points"—one for each head.
The Walker Mechanism
For each attention head, a small Multi-Layer Perceptron (MLP) processes the decoder embedding to produce a relative offset $z$, termed a "walker." This offset is applied to the center $(c_x, c_y)$ and dimensions $(w, h)$ of the previous stage's box to define a new reference point $b$:
$$b = (c_x, c_y) + (z_x \frac{w}{2}, z_y \frac{h}{2})$$
Head Specialization
This mechanism allows individual attention heads to specialize. For instance, one head might move its reference point to the top edge of the box to search for upper boundaries, while another focuses on the left. Unlike previous methods like Width & Height (WH)-Modulated Attention, which merely reshaped the attention mask, Box Agents physically shift the starting reference point based on the box's scale.
Experimental Results
Box-DETR was evaluated on the MS-COCO 2017 dataset. The results demonstrate significant improvements in both accuracy and training efficiency.
- Detection Accuracy: Using a ResNet-50 backbone, Box-DETR achieved 44.2 AP, outperforming DAB-DETR (42.8 AP). When combined with denoising techniques (DN-Box-DETR), performance reached 45.3 AP for ResNet-50 and 52.0 AP for Swin-Large.
- Convergence Speed: The model exhibits faster learning; on a short 12-epoch schedule, it surpassed the baseline by 1.3 AP.
- Efficiency: These gains are achieved with a minimal increase in parameters (~3.6K) and negligible impact on GFLOPs.
Conclusion
Box-DETR demonstrates that treating object scale as a primary factor in spatial queries significantly enhances detector performance. By allowing attention heads to explore the full extent of a bounding box through Box Agents, the model achieves superior results and faster convergence. Future work will focus on extending this mechanism to multi-scale feature maps, which currently pose computational challenges for dense attention mechanisms.
Summary updated