Enhancing DETRs Variants through Improved Content Query and Similar Query Aggregation
Yingying Zhang, Chuangji Shi, Xin Guo, Jiangwei Lao, Jian Wang, Jiaotuan Wang, Jingdong Chen
TL;DR
This work targets the content-query deficiency in DETR-like detectors and introduces Self-Adaptive Content Query (SACQ), which leverages self-attention pooling over encoder features to initialize and refine content queries. It further proposes Query Aggregation (QA) to merge similar high-quality predictions, addressing instability in one-to-one Hungarian matching. Together, SACQ and QA deliver consistent improvements across six DETR variants on the COCO dataset, achieving an average AP gain exceeding 1.0. The approach is plug-and-play, does not rely on altering the positional query, and demonstrates robust gains while shedding light on the role of content priors in cross-attention for object localization. These results suggest a practical path to more accurate DETR-based detectors in real-world applications.
Abstract
The design of the query is crucial for the performance of DETR and its variants. Each query consists of two components: a content part and a positional one. Traditionally, the content query is initialized with a zero or learnable embedding, lacking essential content information and resulting in sub-optimal performance. In this paper, we introduce a novel plug-and-play module, Self-Adaptive Content Query (SACQ), to address this limitation. The SACQ module utilizes features from the transformer encoder to generate content queries via self-attention pooling. This allows candidate queries to adapt to the input image, resulting in a more comprehensive content prior and better focus on target objects. However, this improved concentration poses a challenge for the training process that utilizes the Hungarian matching, which selects only a single candidate and suppresses other similar ones. To overcome this, we propose a query aggregation strategy to cooperate with SACQ. It merges similar predicted candidates from different queries, easing the optimization. Our extensive experiments on the COCO dataset demonstrate the effectiveness of our proposed approaches across six different DETR's variants with multiple configurations, achieving an average improvement of over 1.0 AP.
