AugDETR: Improving Multi-scale Learning for Detection Transformer

Jinpeng Dong, Yutong Lin, Chen Li, Sanping Zhou, Nanning Zheng

Abstract

Detection Transformers (DETR) have significantly advanced object detection by eliminating the need for hand-crafted components. However, efficient variants like Deformable DETR often suffer from "tunnel vision" due to their sparse attention mechanisms, which limit receptive fields and degrade performance on large objects. This paper introduces AugDETR, which incorporates a Hybrid Attention Encoder (HAE) to restore global context and an Encoder-Mixing Cross-Attention (EMCA) module to adaptively aggregate multi-scale features from all encoder layers. AugDETR achieves up to +1.2 AP gains on the COCO benchmark, effectively bridging the performance gap for large object detection.

Introduction

The original Detection Transformer (DETR) revolutionized the field but faced slow convergence issues. Deformable DETR addressed this by utilizing "deformable attention," focusing on a small set of sampling points. While computationally efficient, this approach introduces a significant drawback: limited receptive fields. By focusing only on local patches, the model loses the global context necessary for understanding complex scenes or identifying large objects. Paradoxically, Deformable DETR often performs worse than the original DETR on large objects. Furthermore, most DETR-based models rely solely on the final encoder layer for predictions, neglecting valuable multi-scale information present in earlier layers.

Proposed Methodology: AugDETR

AugDETR introduces two key innovations to overcome these limitations:

1. Hybrid Attention Encoder (HAE)

To regain global context without the prohibitive cost of full self-attention, HAE employs a dual strategy:

  • Hybrid-scale: Dense (global) self-attention is applied only to the highest-level (lowest resolution) features, while sparse deformable attention is maintained for other scales.
  • Hybrid-layer: This hybrid approach is restricted to the first two encoder layers to optimize the balance between performance and training efficiency.

2. Encoder-Mixing Cross-Attention (EMCA)

Standard decoders typically interact only with the final encoder layer. EMCA enables the decoder to adaptively "mix" features from all encoder layers. Using object queries, the model learns specific weights for each layer, allowing it to aggregate the most relevant multi-scale information for each detected object.

Comparison of the standard Deformable DETR architecture (left) and the proposed AugDETR (right), highlighting the Hybrid Encoder and the mixing of encoder layers in the decoder.

Key Insights and Analysis

The development of AugDETR is driven by several critical observations regarding transformer-based detection:

  • The "Large Object" Gap: Sparse attention speeds up convergence but hinders the model's ability to perceive large-scale structures. HAE serves as a corrective mechanism, providing the necessary "big picture" context.
  • Leveraging Encoder Diversity: Different encoder layers possess distinct feature preferences and receptive field sizes. Rather than treating early layers as mere precursors, AugDETR utilizes them as active contributors to the final prediction.
  • Adaptive Feature Fusion: The mixing process in EMCA is query-dependent. This allows the model to dynamically prioritize different layers based on the specific requirements of an object query (e.g., focusing on earlier layers for finer details or later layers for semantic depth).
Visualization of feature maps from Encoder 1 and Encoder 6, demonstrating how object representations evolve and why mixing these layers provides a more robust feature set.

Experimental Results

AugDETR was evaluated on the COCO 2017 dataset across multiple state-of-the-art baselines, including DINO, AlignDETR, and DDQ, using ResNet-50 and Swin-T backbones.

  • Performance Gains: AugDETR consistently improved baseline performance. For instance, DINO + AugDETR reached 50.2 AP (+1.2 improvement), and DDQ + AugDETR achieved 51.8 AP (+1.0 improvement).
  • Large Object Performance ($AP_L$): Ablation studies confirmed that the HAE component specifically boosted large object detection by 0.8 AP, validating the importance of global context.
  • Computational Efficiency: AugDETR (248G FLOPs) proved more efficient than simply increasing sampling points in standard deformable encoders (255G FLOPs) while delivering superior results.

Conclusion

AugDETR successfully mitigates the receptive field limitations of sparse-attention transformers. By blending global and local attention and adaptively mixing encoder features, it provides a more comprehensive multi-scale representation. While the current implementation requires manual tuning to find the optimal number of hybrid layers, future work may explore automated integration of global context and extending the mixing strategy directly to the backbone features.

Summary updated

BibTeX
@inproceedings{dong2024augdetr,
  author = {Jinpeng Dong and Yutong Lin and Chen Li and Sanping Zhou and Nanning Zheng},
  title = {{AugDETR: Improving Multi-scale Learning for Detection Transformer}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72691-0\_14},
}
Figure