[论文解读] Vision Transformer with Deformable Attention
本文提出可变形注意力变换器(Deformable Attention Transformer, DAT),一种具有新颖可变形自注意力机制的视觉变换器主干网络,通过每组查询共享的偏移量学习数据相关的键/值采样位置,实现高效且自适应的注意力机制。该方法在ImageNet、ADE20K语义分割和COCO检测任务上均达到最先进性能,相较于Swim Transformer等强基线模型,top-1准确率分别提升0.7%、1.2%和1.1%。
Transformers have recently shown superior performances on various vision tasks. The large, sometimes even global, receptive field endows Transformer models with higher representation power over their CNN counterparts. Nevertheless, simply enlarging receptive field also gives rise to several concerns. On the one hand, using dense attention e.g., in ViT, leads to excessive memory and computational cost, and features can be influenced by irrelevant parts which are beyond the region of interests. On the other hand, the sparse attention adopted in PVT or Swin Transformer is data agnostic and may limit the ability to model long range relations. To mitigate these issues, we propose a novel deformable self-attention module, where the positions of key and value pairs in self-attention are selected in a data-dependent way. This flexible scheme enables the self-attention module to focus on relevant regions and capture more informative features. On this basis, we present Deformable Attention Transformer, a general backbone model with deformable attention for both image classification and dense prediction tasks. Extensive experiments show that our models achieve consistently improved results on comprehensive benchmarks. Code is available at https://github.com/LeapLabTHU/DAT.
研究动机与目标
- 解决标准视觉变换器及Swin Transformer等稀疏注意力机制中的效率低下与注意力分布不优问题。
- 克服数据无关注意力模式可能丢弃相关特征或保留无关特征的局限性。
- 引入一种可微、高效的可变形注意力机制,能够根据输入内容自适应调整,且不引起计算复杂度的二次增长。
- 设计一种通用、无需卷积的主干模型,在图像分类与密集预测任务中持续优于现有视觉变换器。
提出的方法
- 提出一种可变形自注意力模块,通过从查询特征生成的可学习偏移量对键和值的位置进行偏移,实现数据相关的注意力机制。
- 在查询组内引入共享的、与查询无关的偏移量,降低内存与计算开销,同时保持灵活性。
- 以均匀分布的参考点作为初始采样位置,再通过基于查询特征的偏移网络对其进行变形。
- 采用轻量级偏移网络,根据查询特征为每个参考点预测位移,实现对显著区域的动态聚焦。
- 构建金字塔形主干网络——可变形注意力变换器(DAT),适用于图像分类与密集预测任务。
- 通过避免为每个查询单独学习偏移量,保持线性空间复杂度,与CNN中的可变形卷积或Transformer中先前的可变形注意力方法不同。
实验结果
研究问题
- RQ1数据相关的注意力机制是否能在保持计算效率的同时提升视觉变换器的特征表示能力?
- RQ2为键/值采样学习共享的、与查询无关的偏移量,相较于查询特定或固定模式的注意力,在性能与效率方面表现如何?
- RQ3可变形注意力在图像识别任务中,对长距离依赖关系与目标特定特征的建模能力提升程度如何?
- RQ4可变形注意力机制能否在不引入卷积组件的前提下,有效集成到纯Transformer主干网络中?
主要发现
- 在ImageNet-1K上,DAT实现82.0%的top-1准确率,相较于相似FLOPs与参数量的Swin Transformer提升0.7%。
- 在ADE20K语义分割基准上,DAT相较竞争性基线模型mIoU提升1.2%,尤其在小物体与大物体上提升显著(最高达2.1%)。
- 在COCO目标检测任务中,DAT相较Swin Transformer在box AP与mask AP上均提升1.1%,表明在检测与分割任务中均具有一致性增益。
- 采用卷积嵌入的模型(DAT-T*)在ImageNet上实现82.7%的top-1准确率,较原始DAT-T提升0.7%,较最佳基线也提升0.7%。
- 可视化结果表明,可变形注意力聚焦于前景物体与几何结构复杂的区域(如多个甜甜圈或长颈鹿),而Swin Transformer则更倾向于关注局部且不相关的补丁。
- 内存与FLOP分析显示,DAT在关键点数量相近的情况下,内存使用量仅为D-DETR的2.6倍,FLOP减少1.3倍,同时准确率更高。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。