Conditional spatial queries are recently introduced into DEtection TRansformer (DETR) to accelerate convergence. In DAB-DETR, such queries are modulated by the so-called conditional linear projection at each decoder stage, aiming to search for positions of interest such as the four extremities of the box. Each decoder stage progressively updates the box by predicting the anchor box offsets, while in cross-attention only the box center is informed as the reference point. The use of only box center, however, leaves the width and height of the previous box unknown to the current stage, which hinders accurate prediction of offsets. We argue that the explicit use of the entire box information in cross-attention matters. In this work, we propose Box Agent to condense the box into head-specific agent points. By replacing the box center with the agent point as the reference point in each head, the conditional cross-attention can search for positions from a more reasonable starting point by considering the full scope of the previous box, rather than always from the previous box center. This significantly reduces the burden of the conditional linear projection. Experimental results show that the box agent leads to not only faster convergence but also improved detection performance, e.g., our single-scale model achieves $44.2$ AP with ResNet-50 based on DAB-DETR. Our Box Agent requires minor modifications to the code and has negligible computational workload. Code is available at https://github.com/tiny-smart/box-detr.
翻译:条件空间查询最近被引入DEtection TRansformer(DETR)以加速收敛。在DAB-DETR中,此类查询通过每个解码器阶段的所谓条件线性投影进行调制,旨在搜索感兴趣位置(如边界框的四个端点)。每个解码器阶段通过预测锚框偏移逐步更新边界框,而在交叉注意力中仅将框中心作为参考点。然而,仅使用框中心会导致当前阶段无法获知前一个边界框的宽度和高度,从而阻碍了偏移的准确预测。我们认为在交叉注意力中显式使用完整的边界框信息至关重要。在这项工作中,我们提出Box Agent将边界框浓缩为头部特定的代理点。通过在每个头部中将框中心替换为代理点作为参考点,条件交叉注意力能够考虑前一个边界框的完整范围(而非始终从前一个边界框中心出发),从更合理的起点搜索位置。这显著减轻了条件线性投影的负担。实验结果表明,Box Agent不仅能实现更快的收敛,还能提升检测性能,例如,我们的单尺度模型基于DAB-DETR和ResNet-50达到了44.2 AP。我们的Box Agent仅需对代码进行微调,且计算开销可忽略不计。代码已开源至https://github.com/tiny-smart/box-detr。