Skip to main content
QUICK REVIEW

[论文解读] CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification

Chun-Fu Chen, Quanfu Fan|arXiv (Cornell University)|Mar 27, 2021
Advanced Neural Network Applications被引用 22
一句话总结

CrossViT 提出了一种双分支视觉变换器,通过交叉注意力机制融合小图像块和大图像块的特征,以提升多尺度表征学习能力。其在 ImageNet1K 上相比 DeiT 提升了 2% 的准确率,仅带来适度的 FLOPs 和参数增加,展现出出色的性能与效率。

ABSTRACT

The recently developed vision transformer (ViT) has achieved promising results on image classification compared to convolutional neural networks. Inspired by this, in this paper, we study how to learn multi-scale feature representations in transformer models for image classification. To this end, we propose a dual-branch transformer to combine image patches (i.e., tokens in a transformer) of different sizes to produce stronger image features. Our approach processes small-patch and large-patch tokens with two separate branches of different computational complexity and these tokens are then fused purely by attention multiple times to complement each other. Furthermore, to reduce computation, we develop a simple yet effective token fusion module based on cross attention, which uses a single token for each branch as a query to exchange information with other branches. Our proposed cross-attention only requires linear time for both computational and memory complexity instead of quadratic time otherwise. Extensive experiments demonstrate that our approach performs better than or on par with several concurrent works on vision transformer, in addition to efficient CNN models. For example, on the ImageNet1K dataset, with some architectural changes, our approach outperforms the recent DeiT by a large margin of 2\% with a small to moderate increase in FLOPs and model parameters. Our source codes and models are available at \url{https://github.com/IBM/CrossViT}.

研究动机与目标

  • 提升视觉变换器在图像分类任务中的多尺度特征表征能力。
  • 通过高效的交叉注意力融合,在保持或提升性能的同时降低计算成本。
  • 在不增加二次方复杂度的前提下,实现小块与大块特征之间的有效交互。
  • 在 ImageNet1K 及其他基准测试中实现与当前最先进方法相当或更优的性能。
  • 提供一种轻量化、高效的架构,在准确率与计算效率之间实现良好平衡。

提出的方法

  • 模型采用双分支架构,分别处理小块和大块的 token,其计算复杂度不同。
  • 使用交叉注意力实现分支之间的特征融合,支持迭代式的跨模态信息交换。
  • 每个分支使用单个查询 token 来查询另一分支,将计算复杂度降低为线性,同时在 FLOPs 和内存上均实现线性增长。
  • 交叉注意力模块取代了特征融合中的标准自注意力机制,避免了二次方复杂度。
  • 采用标准优化方法与数据增强技术进行端到端训练。
  • 该方法应用于 ImageNet1K,并在迁移学习基准上进行评估。

实验结果

研究问题

  • RQ1双分支块特征之间的交叉注意力能否提升视觉变换器中的多尺度表征?
  • RQ2与标准自注意力相比,高效的交叉注意力融合能否在降低计算复杂度的同时保持高性能?
  • RQ3所提出的 CrossViT 在 ImageNet1K 上与当前最先进视觉变换器(如 DeiT)相比表现如何?
  • RQ4该模型能否在仅带来适度 FLOPs 和参数增加的情况下实现高准确率?
  • RQ5双分支、多尺度设计在迁移学习设置中是否具有良好的泛化能力?

主要发现

  • CrossViT 在 ImageNet1K 上相比 DeiT 提升了 2% 的 top-1 准确率,且 FLOPs 和模型参数仅增加少量至中等程度。
  • 交叉注意力融合机制实现了线性计算与内存复杂度,避免了标准自注意力的二次方开销。
  • 双分支设计有效融合了多尺度特征,其表征能力优于单尺度或简单的拼接方式。
  • 该模型在迁移学习基准上实现了具有竞争力的性能,表明其具备强大的泛化能力。
  • 该方法表明,高效的交叉注意力可作为视觉变换器特征融合中自注意力的有力替代方案。
  • 消融实验确认,双分支设计与交叉注意力融合对性能提升均至关重要。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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