[论文解读] Do Vision Transformers See Like Convolutional Neural Networks?
该论文分析 Vision Transformers (ViTs) 与 CNNs,以理解 ViTs 如何表示视觉信息,揭示表示结构、注意力行为、跳跃连接、空间定位,以及数据规模对迁移学习的影响方面的关键差异。
Convolutional neural networks (CNNs) have so far been the de-facto model for visual data. Recent work has shown that (Vision) Transformer models (ViT) can achieve comparable or even superior performance on image classification tasks. This raises a central question: how are Vision Transformers solving these tasks? Are they acting like convolutional networks, or learning entirely different visual representations? Analyzing the internal representation structure of ViTs and CNNs on image classification benchmarks, we find striking differences between the two architectures, such as ViT having more uniform representations across all layers. We explore how these differences arise, finding crucial roles played by self-attention, which enables early aggregation of global information, and ViT residual connections, which strongly propagate features from lower to higher layers. We study the ramifications for spatial localization, demonstrating ViTs successfully preserve input spatial information, with noticeable effects from different classification methods. Finally, we study the effect of (pretraining) dataset scale on intermediate features and transfer learning, and conclude with a discussion on connections to new architectures such as the MLP-Mixer.
研究动机与目标
- 理解 ViTs 如何相对于 CNNs 表示视觉信息。
- 表征 ViTs 与 CNNs 的内部表示结构。
- 研究自注意力和跳跃连接如何塑造信息传播。
- 检查 ViTs 如何保留空间信息和定位。
- 评估数据集规模对中间表示和迁移学习的影响。
提出的方法
- 使用 Centered Kernel Alignment (CKA) 来量化 ViTs 与 CNNs 在各层内及层间的表征相似性。
- 比较 ViT 与 CNN 架构(ViT-B/32、ViT-B/16、ViT-L/16、ViT-H/14 与 ResNet-50x1、ResNet-152x2)在 JFT-300M 或 ImageNet 上训练的情况。
- 分析 ViT 自注意力头中的注意力距离,以评估局部信息与全局信息聚合。
- 通过移除跳跃连接来测试它们在表征传播中的作用。
- 通过使用 CKA 将最终层的 token 表现与输入补丁进行比较来评估空间定位,并使用线性探针来评估定位能力。
- 研究预训练数据规模对跨模型尺寸的中间表示的影响,使用线性探针。
实验结果
研究问题
- RQ1与 CNNs 相比,ViTs 是否在各层之间发展出更为均匀的表示结构?
- RQ2自注意力和跳跃连接如何影响 ViTs 与 CNNs 中的信息传播和特征表示?
- RQ3ViTs 在高层是否保留输入的空间信息,这如何影响定位任务?
- RQ4预训练数据规模如何影响 ViTs 的中间表示质量和迁移学习?
- RQ5ViTs 表征对未来架构及如目标检测等任务的意义何在?
主要发现
- ViTs 在各层表现出高度均匀的表示,与呈现清晰阶段性相似性模式的 CNNs 不同。
- ViT 的较低层同时获取局部和全局信息,而较高层依赖全局信息,这与具有固定局部感受野的 CNNs 不同。
- ViTs 中的跳跃连接在层间强烈传播表征,在较深的层中从 CLS token 向空间 token 传播发生相变。
- ViTs 在高层保留输入的空间信息,定位受基于 CLS 的分类影响;GAP 池化降低定位。
- 数据集规模(如 JFT-300M)显著提升高层/中间表示,尤其是对于更大尺寸的 ViT 模型。
- ViT 的较低层可以呈现出带局部头部的 ResNet 特征的相似性,但全局注意力头产生的表示在质的层面上不同。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。