ASAG: Building Strong One-Decoder-Layer Sparse Detectors via Adaptive Sparse Anchor Generation

Shenghao Fu, Junkai Yan, Yipeng Gao, Xiaohua Xie, Wei-Shi Zheng

Abstract

Sparse object detectors, such as DETR and its variants, have revolutionized computer vision by eliminating hand-crafted components like Non-Maximum Suppression (NMS). However, these models typically rely on a stack of six decoder layers to achieve competitive accuracy, leading to significant computational overhead. This paper introduces Adaptive Sparse Anchor Generation (ASAG), a novel framework that enables high-performance object detection using only a single decoder layer. By employing a patch-based probing strategy and adaptive anchor generation, ASAG bridges the performance gap between 1-layer and 6-layer detectors, offering a superior speed-accuracy trade-off for real-time applications.

Introduction

Modern object detection has shifted toward "sparse" architectures that use a small set of learnable queries to identify objects. While these models are elegant and effective, their reliance on iterative refinement across multiple decoder layers makes them computationally expensive. Attempts to reduce these models to a single decoder layer have historically resulted in a sharp decline in precision.

Previous efforts to solve this involved "dense priors"—using a traditional dense detector to initialize the sparse queries. However, the authors of ASAG identified a fundamental mismatch in this approach: Feature Conflict. While dense detectors evaluate images uniformly across a grid, sparse detectors focus on specific discriminative parts of an object. Forcing a sparse detector to inherit grid-based logic creates a conflict that hampers the model's ability to converge on optimal features. ASAG addresses this by moving away from grid-based initialization in favor of a fully sparse, image-specific anchor generation pipeline.

The ASAG Framework

ASAG is built on the principle of generating dynamic, image-specific anchors that align with the sparse nature of the decoder. The framework consists of three primary innovations:

1. Patch-based Prediction

Instead of predicting objects on a rigid, uniform grid, ASAG predicts dynamic anchors on image patches. This approach provides the model with a more global receptive field from the outset. By treating patches as the basic unit of prediction, the model avoids the feature conflict inherent in grid-based methods and allows for a more flexible representation of objects across varying scales.

2. Adaptive Probing (Coarse-to-Fine Strategy)

To optimize efficiency, ASAG utilizes an adaptive "probing" mechanism. The model first examines low-resolution feature maps to identify potential object locations. If the model identifies an area that might contain an object but lacks high confidence (often the case with small objects), it selectively "probes" that specific region in a higher-resolution feature map. This ensures that high-resolution computation is only expended where necessary. In testing, approximately 40% of images did not require the highest-resolution maps, significantly reducing inference time.

3. Stabilizing Training via Query Weighting

Dynamic anchor generation can be inherently unstable during training because the anchors themselves are constantly shifting. ASAG introduces a Query Weighting method to stabilize this process. By prioritizing high-quality anchors—those with high classification scores and significant overlap with ground truth—the model ensures more consistent gradients and faster convergence.

Experimental Results

The researchers evaluated ASAG on the COCO 2017 and CrowdHuman benchmarks, comparing it against both traditional 6-layer detectors and existing 1-layer attempts.

  • Accuracy Breakthroughs: ASAG-S (the 1-layer variant) outperformed the previous state-of-the-art dense-initialized 1-layer detector, Featurized Query RCNN, by 2.6 AP on the COCO dataset.
  • Efficiency and Speed: ASAG-A (1-layer) achieved accuracy levels comparable to the 6-layer AdaMixer while running 1.25x faster (approximately 29 FPS vs. 22 FPS on an NVIDIA 3090 GPU).
  • Versatility: The ASAG generator is remarkably lightweight, adding only 0.06G FLOPs to the total computation. It demonstrated consistent improvements when integrated with various decoder architectures, including Deformable DETR and Sparse RCNN.

Discussion and Limitations

While ASAG successfully bridges the gap for 1-layer detectors, some challenges remain. There is still a slight performance margin in small object detection ($AP_s$) when compared to the most robust 6-layer models. Additionally, the Adaptive Probing mechanism relies on confidence thresholds that may require tuning for specialized domains, such as medical imaging or satellite photography, where object density and scale differ significantly from standard benchmarks.

Conclusion

ASAG demonstrates that the multi-layer decoder bottleneck in sparse detectors is not an inevitability. By resolving the feature conflict between dense and sparse representations and implementing an adaptive, patch-based probing strategy, ASAG enables efficient, high-performance detection with a single decoder layer. This work paves the way for more lightweight and deployable sparse detection models in real-world, latency-sensitive environments.

Summary updated

BibTeX
@inproceedings{fu2023asag,
  author = {Shenghao Fu and Junkai Yan and Yipeng Gao and Xiaohua Xie and Wei-Shi Zheng},
  title = {{ASAG: Building Strong One-Decoder-Layer Sparse Detectors via Adaptive Sparse Anchor Generation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
}
Figure