[论文解读] Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice
本文在傅里叶域分析 Vision Transformer,揭示自注意力充当低通滤波器,限制深度,并引入 AttnScale 和 FeatScale 用以恢复高频信息,在多种 ViT 变体上获得一致的准确性提升。
Vision Transformer (ViT) has recently demonstrated promise in computer vision problems. However, unlike Convolutional Neural Networks (CNN), it is known that the performance of ViT saturates quickly with depth increasing, due to the observed attention collapse or patch uniformity. Despite a couple of empirical solutions, a rigorous framework studying on this scalability issue remains elusive. In this paper, we first establish a rigorous theory framework to analyze ViT features from the Fourier spectrum domain. We show that the self-attention mechanism inherently amounts to a low-pass filter, which indicates when ViT scales up its depth, excessive low-pass filtering will cause feature maps to only preserve their Direct-Current (DC) component. We then propose two straightforward yet effective techniques to mitigate the undesirable low-pass limitation. The first technique, termed AttnScale, decomposes a self-attention block into low-pass and high-pass components, then rescales and combines these two filters to produce an all-pass self-attention matrix. The second technique, termed FeatScale, re-weights feature maps on separate frequency bands to amplify the high-frequency signals. Both techniques are efficient and hyperparameter-free, while effectively overcoming relevant ViT training artifacts such as attention collapse and patch uniformity. By seamlessly plugging in our techniques to multiple ViT variants, we demonstrate that they consistently help ViTs benefit from deeper architectures, bringing up to 1.1% performance gains "for free" (e.g., with little parameter overhead). We publicly release our codes and pre-trained models at https://github.com/VITA-Group/ViT-Anti-Oversmoothing.
研究动机与目标
- 激励并理解为什么在深度增加时 ViT 会饱和或表现下降。
- 提出一个谱域框架,用于分析 ViT 的特征与自注意力。
- 提出两种高效且无超参数的技术以对抗 ViTs 的过度平滑。
- 证明在多种骨干网络上,较深的 ViT 模型可通过所提方法获得收益。
提出的方法
- 将 ViT 视为一系列自注意力块,并在傅里叶域进行分析。
- 证明自注意力充当低通滤波器,与输入令牌或查询/键矩阵无关(定理1)。
- 引入 AttnScale 将注意力分解为低频与高频分量并重新加权以实现全通行为(式7-9)。
- 引入 FeatScale 在特征图层面重新加权直流分量和高频分量,而不需要显式傅里叶变换(式10-12)。
- 论证 AttnScale 和 FeatScale 轻量、无超参数并可嵌入到各种 ViT 变体。
- 提供实证验证,显示在 DeiT、CaiT 和 Swin 骨干上均有持续的增益。
实验结果
研究问题
- RQ1为什么 ViT 的性能会随着深度增加而饱和或下降?
- RQ2在傅里叶域分析能否揭示 ViT 中基于注意力的平滑的机制?
- RQ3在注意力图或特征图中使用轻量化尺度化技术是否能缓解过度平滑并支持更深的 ViT?
- RQ4AttnScale 和 FeatScale 能否在不同 ViT 架构间可迁移且无需额外超参数?
- RQ5在将这些方法应用于标准 Vision Transformer 变体时,实际的准确性提升是多少?
主要发现
- 自注意力级联充当低通滤波器,随着深度增加高频信息被侵蚀。
- AttnScale 通过将注意力分解为低频和高频部分并对高频残差重新加权,使有效注意力变为全通滤波器。
- FeatScale 在特征图层面重加权直流分量和高频分量以保留高频信息。
- 两种方法均轻量、无超参数,且与 DeiT、CaiT、Swin 骨干兼容。
- 在 ImageNet 上的实证结果显示,在评估模型中可获得高达 1.1% 的准确性提升,且没有额外的参数开销。
- 与若干先前技术相比,AttnScale 和 FeatScale 在报告的增益上优于如 re-attention 和 LayerScale 等方法。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。