arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.00427cs.CV
收藏

在 Vision Transformers 的每个阶段你只需要更少的注意力

You Only Need Less Attention at Each Stage in Vision Transformers

Huazhong University of Science and Technology(华中科技大学);Microsoft Research Asia(微软亚洲研究院)

Shuoxi Zhang, Hanpeng Liu, Stephen Lin, Kun He

AI总结:

针对 ViTs 自注意力计算复杂度高及注意力饱和问题,提出 LaViT 架构,每阶段仅计算少量注意力并复用其分数进行特征对齐,显著降低计算负担并在多种视觉任务中保持卓越性能。

摘要:

Vision Transformers (ViTs) 的出现标志着计算机视觉领域的重大范式转变。ViTs 通过自注意力模块捕获图像的全局信息,该模块在分块图像 token 之间执行点积计算。尽管自注意力模块使 ViTs 能够捕获长距离依赖关系,但计算复杂度随 token 数量呈二次方增长,这是 ViTs 实际应用的主要障碍。此外,深层 ViTs 中的自注意力机制也容易受到注意力饱和问题的影响。因此,我们认为没有必要在每一层都计算注意力分数,并提出 Less-Attention Vision Transformer (LaViT),它在每个阶段仅计算少量注意力操作,并通过利用先前计算的注意力分数的注意力变换来计算其他层中的后续特征对齐。这种新颖的方法可以缓解困扰传统自注意力模块的两个主要问题:沉重的计算负担和注意力饱和。我们提出的架构具有卓越的效率和易实现性,仅需要矩阵乘法,这在现代深度学习框架中得到了高度优化。此外,我们的架构在包括分类、检测和分割在内的各种视觉任务中表现出卓越的性能。

英文摘要:

The advent of Vision Transformers (ViTs) marks a substantial paradigm shift in the realm of computer vision. ViTs capture the global information of images through self-attention modules, which perform dot product computations among patchified image tokens. While self-attention modules empower ViTs to capture long-range dependencies, the computational complexity grows quadratically with the number of tokens, which is a major hindrance to the practical application of ViTs. Moreover, the self-attention mechanism in deep ViTs is also susceptible to the attention saturation issue. Accordingly, we argue against the necessity of computing the attention scores in every layer, and we propose the Less-Attention Vision Transformer (LaViT), which computes only a few attention operations at each stage and calculates the subsequent feature alignments in other layers via attention transformations that leverage the previously calculated attention scores. This novel approach can mitigate two primary issues plaguing traditional self-attention modules: the heavy computational burden and attention saturation. Our proposed architecture offers superior efficiency and ease of implementation, merely requiring matrix multiplications that are highly optimized in contemporary deep learning frameworks. Moreover, our architecture demonstrates exceptional performance across various vision tasks including classification, detection and segmentation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑