Efficient DETR: Improving End-to-End Object Detector with Dense Prior

Zhuyu Yao, Jiangbo Ai, Boxun Li, Chi ZhangarXiv 2021

Abstract

Efficient DETR addresses the slow convergence and high computational cost of transformer-based object detectors. By replacing random query initialization with a "dense prior" generated by a lightweight prediction head, the model achieves state-of-the-art performance on MS COCO with only a single decoder layer and 36 training epochs. This approach significantly reduces parameter count and training time while maintaining high accuracy.

Introduction

The DEtection TRansformer (DETR) introduced a streamlined end-to-end pipeline for object detection, eliminating the need for hand-crafted components like non-maximum suppression (NMS). Despite its elegance, DETR and its variants suffer from slow convergence—often requiring 500 epochs—and a reliance on deep cascades of decoder layers (typically six) to achieve competitive accuracy. The authors identify random initialization of object queries and reference points as the primary bottleneck. Poor initial guesses necessitate multiple refinement stages, leading to inefficiency and high computational overhead.

Methodology

Efficient DETR bridges the gap between 1-layer and 6-layer decoder structures by providing high-quality initial guesses. The architecture consists of two main collaborative components:

  1. Dense Prior Generation: Instead of jumping straight to sparse queries, the model uses a lightweight, class-specific dense prediction head on the encoder's feature maps. This head predicts "objectness" scores and initial 4D bounding box offsets for every spatial location in the image.
  2. Sparse Refinement: The model selects the Top-K (typically 100) highest-scoring proposals. Crucially, it uses the 256-dimensional encoder features at those locations to initialize the object queries and the predicted box coordinates to initialize the reference points.
Comparison of standard DETR (a) with 6 decoder layers and random initialization versus Efficient DETR (b) with a single decoder layer and dense prior initialization.

By grounding the initialization in image content, the model requires only a single decoder layer to achieve competitive results. Furthermore, the encoder is streamlined to three layers, significantly reducing the parameter count and computational complexity compared to standard DETR models.

Key Insights and Results

A critical discovery of this work is the sensitivity of the decoder to layer count. While removing encoder layers has a marginal impact on performance, removing decoder layers in standard DETR typically results in a ~10 AP drop. Efficient DETR mitigates this by ensuring the decoder starts "near" the objects through dense prior initialization.

Visualization of reference point refinement from the initial stage to the 6th stage, demonstrating how dense priors provide a better starting point for object localization.

Evaluation on MS COCO 2017 shows that Efficient DETR-R50 reaches 44.2 AP in just 36 epochs, outperforming the original DETR which required 500 epochs to reach 42.0 AP. The model also demonstrates superior robustness on the CrowdHuman dataset, achieving 90.75 AP50. This suggests that the dense prior helps the model stay "locked on" to objects even in cluttered environments where global attention might struggle.

Conclusion

Efficient DETR demonstrates that high-quality initialization is critical for transformer-based detection. By integrating a dense prediction head to inform sparse queries, the model achieves a superior balance of speed and accuracy. While it re-introduces some dense logic, the resulting efficiency gains make it a compelling architecture for real-time and resource-constrained vision tasks.

Summary updated

BibTeX
@misc{yao2021efficient,
  author = {Zhuyu Yao and Jiangbo Ai and Boxun Li and Chi Zhang},
  title = {{Efficient DETR: Improving End-to-End Object Detector with Dense Prior}},
  year = {2021},
  eprint = {2104.01318},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.01318},
}
Figure