提出线性注意力架构L²ViT,实现高效全局建模且保持高精度。
The Linear Attention Resurrection in Vision Transformer
- 用线性注意力替代软最大注意力,降低计算复杂度
- 在ImageNet-1K上达84.4%准确率,384²分辨率下达87.0%
- 适合需要高效视觉建模的部署场景,如移动端或大图应用
视觉变换器(ViTs)在计算机视觉领域取得突破,但其基于软最大注意力的机制存在时间和内存上的二次复杂度,限制了其在高分辨率图像中的应用。本文重新审视注意力设计,提出一种线性注意力方法,克服了现有方法(如Swin的局部窗口注意力)牺牲全局表征的问题。实验证明,线性注意力缺乏集中注意力分布的基本特性。据此,引入局部集中模块增强线性注意力。结合增强后的线性全局注意力与局部窗口注意力,提出新架构L²ViT,兼具全局交互与局部表征能力,同时保持线性计算复杂度。大量实验表明,L²ViT性能优异:在无额外训练数据或标签条件下,ImageNet-1K上达到84.4% Top-1准确率;在ImageNet-22k上预训练并微调至384²分辨率时,准确率达87.0%。在目标检测与语义分割等下游任务中,作为主干网络表现良好。
原文摘要 · Abstract (English)
Vision Transformers (ViTs) have recently taken computer vision by storm. However, the softmax attention underlying ViTs comes with a quadratic complexity in time and memory, hindering the application of ViTs to high-resolution images. We revisit the attention design and propose a linear attention method to address the limitation, which doesn't sacrifice ViT's core advantage of capturing global representation like existing methods (e.g. local window attention of Swin). We further investigate the key difference between linear attention and softmax attention. Our empirical results suggest that linear attention lacks a fundamental property of concentrating the distribution of the attention matrix. Inspired by this observation, we introduce a local concentration module to enhance linear attention. By incorporating enhanced linear global attention and local window attention, we propose a new ViT architecture, dubbed L$^2$ViT. Notably, L$^2$ViT can effectively capture both global interactions and local representations while enjoying linear computational complexity. Extensive experiments demonstrate the strong performance of L$^2$ViT. On image classification, L$^2$ViT achieves 84.4% Top-1 accuracy on ImageNet-1K without any extra training data or label. By further pre-training on ImageNet-22k, it attains 87.0% when fine-tuned with resolution 384$^2$. For downstream tasks, L$^2$ViT delivers favorable performance as a backbone on object detection as well as semantic segmentation.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。