基于傅里叶域分析的深度视觉Transformer抗过平滑技术:从理论到实践
Anti-Oversmoothing in Deep Vision Transformers via the Fourier Domain Analysis: From Theory to Practice
摘要:
视觉Transformer(ViT)最近在计算机视觉问题中表现出了希望。然而,与卷积神经网络(CNN)不同,已知由于观察到的注意力崩溃或补丁均匀性,ViT的性能随着深度的增加而快速饱和。尽管有一些经验性的解决方案,一个严格的框架研究这个可扩展性问题仍然难以捉摸。本文首先建立了一个严格的理论框架,从傅立叶谱域分析ViT特征。我们发现,自我注意力机制本质上相当于一个低通滤波器,这表明当ViT扩展其深度时,过度的低通滤波将导致特征图仅保留其直流(DC)分量。然后,我们提出了两个简单而有效的技术,以减轻不良的低通限制。第一种技术称为AttnScale,将自注意力块分解为低通和高通分量,然后重新缩放并组合这两个滤波器以产生全通自注意力矩阵。第二种技术,称为“缩放”,在不同的频带上重新加权特征图,以放大高频信号。这两种技术都是高效的,无超参数的,同时有效地克服了相关的ViT训练伪影,如注意力崩溃和补丁均匀性。通过将我们的技术无缝地插入到多个ViT变体中,我们证明了它们始终有助于ViT从更深层次的架构中受益,“免费”带来高达1.1%的性能增益(例如,具有很少的参数开销)。我们在https://github.com/VITA-Group/ViT-Anti-Oversmoothing公开发布我们的代码和预训练模型。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。