Skip to main content
QUICK REVIEW

[论文解读] End-to-End Object Detection with Adaptive Clustering Transformer

Minghang Zheng, Peng Gao|arXiv (Cornell University)|Nov 18, 2020
Advanced Image and Video Retrieval Techniques参考文献 47被引用 117
一句话总结

本文提出 Adaptive Clustering Transformer (ACT) 作为 DETR 编码器自注意力的即插即用替代,通过 E2LSH 的自适应聚类降低计算量,并通过 Multi-Task Knowledge Distillation (MTKD) 提高性能。

ABSTRACT

End-to-end Object Detection with Transformer (DETR)proposes to perform object detection with Transformer and achieve comparable performance with two-stage object detection like Faster-RCNN. However, DETR needs huge computational resources for training and inference due to the high-resolution spatial input. In this paper, a novel variant of transformer named Adaptive Clustering Transformer(ACT) has been proposed to reduce the computation cost for high-resolution input. ACT cluster the query features adaptively using Locality Sensitive Hashing (LSH) and ap-proximate the query-key interaction using the prototype-key interaction. ACT can reduce the quadratic O(N2) complexity inside self-attention into O(NK) where K is the number of prototypes in each layer. ACT can be a drop-in module replacing the original self-attention module without any training. ACT achieves a good balance between accuracy and computation cost (FLOPs). The code is available as supplementary for the ease of experiment replication and verification. Code is released at \url{https://github.com/gaopengcuhk/SMCA-DETR/}

研究动机与目标

  • 降低 DETR 针对高分辨率输入的高计算成本,同时保持端到端集合预测。
  • 提出 ACT 用自适应聚类替换编码器自注意力,使复杂度从平方级降低到接近线性。
  • 演示 ACT 是与 DETR 兼容的即插即用模块,无需重新训练,并探讨 MTKD 以进一步提升准确性。
  • 量化在 COCO 2017 上的 FLOPs 减少和 AP 权衡,并提供消融研究以指导实际使用。

提出的方法

  • 使用局部敏感哈希(LSH),具体为 Exact Euclidean LSH (E2LSH),在每个编码器层中自适应将查询聚类为原型。
  • 仅在原型和键之间计算注意力,然后将原型的更新广播给成员查询,将复杂度从 O(NMDk+NMDv) 降至 O(NLDK+CMDK+CMDV)。
  • 通过多轮 LSH(轮次 L)基于特征分布动态确定每层的原型数量。
  • 可选地应用 Multi-Task Knowledge Distillation (MTKD) 以对齐 ACT 与完整 DETR 的预测,实现无缝切换并提高准确性。
  • 提供训练目标 L = L_pred + L_KD 来从 ACT 蒸馏框回归到 DETR,从而实现更好收敛。
  • 在无需重新训练的情况下评估 ACT 作为 DETR 的替代,并通过 MTKD 量化改进。

实验结果

研究问题

  • RQ1在不重新训练的情况下,ACT 是否能减少 DETR 编码器自注意力计算同时保持检测性能?
  • RQ2通过 LSH 的自适应聚类对不同编码器层和对象尺寸的 AP 与 FLOPs 有何影响?
  • RQ3MTKD 是否进一步缩小 ACT 与全 DETR 之间的性能差距?
  • RQ4与 COCO 2017 上的 DETR 与 Faster R-CNN 相比,ACT 在实际 FLOPs、速度和内存方面的权衡如何?

主要发现

模型GFLOPsAPAP LAP MAP S
Backbone (ResNet50-DC5)110.7----
DETR-DC5+73.443.361.147.322.5
Faster RCNN-DC5+209.341.155.045.922.9
ACT (L=32)+58.242.661.146.821.4
ACT (L=24)+53.141.360.645.919.2
ACT (L=20)+49.439.760.344.216.9
ACT (L=16)+45.037.158.841.313.9
ACT+MTKD (L=32)+58.243.161.447.122.2
ACT+MTKD (L=24)+53.142.361.046.421.3
ACT+MTKD (L=20)+49.541.860.745.620.6
ACT+MTKD (L=16)+45.140.659.744.318.5
  • ACT 将 DETR 的 FLOPs(不含骨干网)从 73.4 Gflops 降至 58.2 Gflops,基线设置仅有 0.7% 的 AP 丢失。
  • MTKD 进一步缩小 AP 差距,在与 ACT 结合时(L=32)相对于 DETR 仅有约 0.2% 的 AP 损失。
  • ACT 的 L=32 在 AP 上达到与 DETR-DC5 相近的水平,在大/中等对象上优于 Faster RCNN-DC5,同等计算量下。
  • ACT 在真实硬件上的推理时间和内存有显著节省(例如在 GTX TITAN X 上,单张图像时间更快,峰值内存更低)。
  • 自适应聚类方法通过将语义相似的查询分组,显著减少冗余注意力,因特征冗余在更深的编码器层降低导致原型数量减少。
  • 与 K-means 聚类相比,ACT 能更好地适应每张图像的特征分布和编码器层,提供在相似 FLOPs 下更好的准确性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。