[论文解读] A Close Look at Spatial Modeling: From Attention to Convolution
本文提出FCViT,一种全卷积视觉Transformer,通过从自注意力机制中抽象出与查询无关的全局上下文,并将其动态融合到卷积层中,实现了更少参数下的最先进性能。FCViT-S12在ImageNet-1K上达到80.9%的top-1准确率,比ResT-Lite高出3.7%,且参数量更少,超越了ConvNeXt。
Vision Transformers have shown great promise recently for many vision tasks due to the insightful architecture design and attention mechanism. By revisiting the self-attention responses in Transformers, we empirically observe two interesting issues. First, Vision Transformers present a queryirrelevant behavior at deep layers, where the attention maps exhibit nearly consistent contexts in global scope, regardless of the query patch position (also head-irrelevant). Second, the attention maps are intrinsically sparse, few tokens dominate the attention weights; introducing the knowledge from ConvNets would largely smooth the attention and enhance the performance. Motivated by above observations, we generalize self-attention formulation to abstract a queryirrelevant global context directly and further integrate the global context into convolutions. The resulting model, a Fully Convolutional Vision Transformer (i.e., FCViT), purely consists of convolutional layers and firmly inherits the merits of both attention mechanism and convolutions, including dynamic property, weight sharing, and short- and long-range feature modeling, etc. Experimental results demonstrate the effectiveness of FCViT. With less than 14M parameters, our FCViT-S12 outperforms related work ResT-Lite by 3.7% top1 accuracy on ImageNet-1K. When scaling FCViT to larger models, we still perform better than previous state-of-the-art ConvNeXt with even fewer parameters. FCViT-based models also demonstrate promising transferability to downstream tasks, like object detection, instance segmentation, and semantic segmentation. Codes and models are made available at: https://github.com/ma-xu/FCViT.
研究动机与目标
- 探究视觉Transformer中自注意力机制的局限性,特别是深层网络中稀疏且与查询无关的注意力图。
- 通过提取捕捉长距离依赖关系的全局上下文,解决注意力机制中的低效与冗余问题。
- 将该全局上下文集成到卷积层中,以增强局部特征建模能力,同时保持动态的注意力行为。
- 开发一种纯卷积架构,融合Transformer与卷积神经网络的优势,包括权重共享、动态建模和长距离特征学习能力。
- 在图像分类、目标检测、实例分割和语义分割等任务上,展示卓越的性能与迁移能力。
提出的方法
- 作者通过放松与查询相关的公式,从自注意力机制中抽象出全局上下文,从而获得对所有token都共享的、与查询无关的上下文。
- 该全局上下文通过可学习门控机制动态融合到局部卷积操作中,实现长程与局部特征的自适应融合。
- 该方法引入多组令牌-全局相似性,以保持通道组之间的多样性,防止注意力模式趋于一致。
- 该架构为全卷积结构,采用深度可分离卷积,并使用全局上下文注入模块替代注意力头。
- 模型采用标准ImageNet-1K分类预训练,随后在下游任务上使用标准检测与分割框架进行微调。
- 应用竞争性信息瓶颈机制,通过在全局上下文学习过程中过滤冗余特征,增强表征能力。
实验结果
研究问题
- RQ1为何视觉Transformer深层中的自注意力图表现出与查询无关且稀疏的行为,从而削弱其原本应具备的动态、查询特定的注意力机制?
- RQ2能否有效抽象并重用来自自注意力机制的全局上下文,以改进局部卷积特征学习?
- RQ3在用卷积层替换注意力头的同时,如何保持注意力机制所具备的动态长程建模能力?
- RQ4全卷积架构是否能在视觉基准上实现最先进性能,同时参数量少于现有最先进模型?
- RQ5所提出的全局上下文与局部卷积的融合是否能提升在目标检测与语义分割等下游任务中的迁移能力?
主要发现
- FCViT-S12在ImageNet-1K上仅用1400万参数即达到80.9%的top-1准确率,比ResT-Lite高出3.7%的准确率。
- 即使扩展到更大规模,FCViT-B24在ADE20K语义分割任务上达到45.5%的mIoU,仅使用2530万参数,较Twins-PCPVT-S高出1.2%的mIoU,且参数更少。
- 在MS COCO 2017目标检测任务中,FCViT-Tiny的mAP^box和mAP^mask分别比PoolFormer-S12高出5.0和4.0,尽管参数更少。
- 全局上下文抽象有效降低了注意力稀疏性并消除了与查询无关的问题,该结论通过ImageNet-1K上的可视化与统计分析得到验证。
- FCViT展现出强大的迁移能力,在实例分割与语义分割任务上均达到最先进性能,且相对于先前方法保持一致的性能增益。
- 多组相似性机制可防止注意力头坍塌,维持特征表示的多样性,从而增强模型容量。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。