[论文解读] Anchor DETR: Query Design for Transformer-Based Object Detection
Anchor DETR 将对象查询重组成基于锚点的查询,每个锚点有多种预测模式,相较于 DETR 能获得更高的准确性并实现更快的训练,同时提供一个内存高效的行列解耦注意力变体。
In this paper, we propose a novel query design for the transformer-based object detection. In previous transformer-based detectors, the object queries are a set of learned embeddings. However, each learned embedding does not have an explicit physical meaning and we cannot explain where it will focus on. It is difficult to optimize as the prediction slot of each object query does not have a specific mode. In other words, each object query will not focus on a specific region. To solved these problems, in our query design, object queries are based on anchor points, which are widely used in CNN-based detectors. So each object query focuses on the objects near the anchor point. Moreover, our query design can predict multiple objects at one position to solve the difficulty: "one region, multiple objects". In addition, we design an attention variant, which can reduce the memory cost while achieving similar or better performance than the standard attention in DETR. Thanks to the query design and the attention variant, the proposed detector that we called Anchor DETR, can achieve better performance and run faster than the DETR with 10$ imes$ fewer training epochs. For example, it achieves 44.2 AP with 19 FPS on the MSCOCO dataset when using the ResNet50-DC5 feature for training 50 epochs. Extensive experiments on the MSCOCO benchmark prove the effectiveness of the proposed methods. Code is available at \url{https://github.com/megvii-research/AnchorDETR}.
研究动机与目标
- 阐述为何 DETR 中学习得到的对象查询缺乏明确的空间含义且难以优化。
- 提出一种基于锚点的对象查询设计,在每个锚点具备多种预测模式,以处理“一个区域内多个对象”。
- 引入行列解耦注意力(RCDA),在降低内存使用的同时维持或提高准确性。
- 通过在 MS COCO 上的大量实验证明,Anchor DETR 在训练轮次比 DETR 少 10 倍的情况下仍优于 DETR,并且与其他 DETR 类方法相比具有竞争力。
- 提供实用洞察和消融实验,以验证各组件的有效性。
提出的方法
- 将锚点编码为对象查询,以提供显式的空间含义(Q_p = Encode(Pos_q))。
- 在每个锚点附加多种预测模式,以允许在同一位置预测多个对象(Q_f^init 扩展为 Q_f^init + Q_p,并带有模式)。
- 使用一个位置编码函数 g 来计算 Q_p 和 K_p,必要时可通过一个小型两层 MLP 进行增强。
- 引入行列解耦注意力(RCDA),将 K_f 解耦为行分量和列分量,并应用顺序的行注意力和列注意力以降低内存使用。
- 在保持与 DETR 式解码器中的跨注意力与自注意力兼容的同时,维持性能。
- 在 MS COCO 上使用 ResNet-50-DC5 特征进行训练和评估,并与 DETR 及其他 DETR 式检测器进行比较。
实验结果
研究问题
- RQ1将对象查询锚定到显式锚点是否提供更清晰的归纳偏置并相对于学习得到的嵌入提高优化效果?
- RQ2每个锚点的多种预测模式是否能有效处理同一区域内的多个对象?
- RQ3行列解耦注意力在不牺牲准确性的前提下,是否相较于标准 DETR 注意力降低了内存消耗?
- RQ4在 COCO 数据集上,Anchor DETR 在准确性和速度方面相对于 DETR 及其他 DETR 式检测器的表现如何?
- RQ5哪些消融实验能展示锚点查询、多模式预测和 RCDA 的贡献?
主要发现
- 基于锚点的查询结合多模式预测在 AP 上高于 DETR(例如在他们的实验中为 44.2 AP,相较于 DETR 基线。)
- RCDA 注意力变体在保持或提升与标准 DETR 注意力相当甚至更高的准确度的同时,显著降低内存使用,特别是在高分辨率特征时。
- 在单一 ResNet-50-DC5 特征下,50 轮训练的 Anchor DETR 在 19 FPS 下达到 44.2 AP,优于使用多级特征且训练 500 轮的 DETR 变体。
- 仅使用单个 DC5 特征时,Anchor DETR 的结果与依赖多级特征的 Deformable DETR 与 SMCA 相当,同时需要的训练轮数显著更少。
- 消融研究显示每个锚点的多重预测和锚点查询设计共同带来显著的 AP 增益(例如来自锚点查询设计的 4.9 AP 增益)。
- 锚点可以是网格或学习得到的,学习得到的点分布与网格类似地均匀,二者均具有相近的性能。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。