提出新型卷积-注意力混合结构,显著降低视觉Transformer计算开销。
S2AFormer: Strip Self-Attention for Efficient Vision Transformer
- 用条带自注意力机制压缩键值维度,减少计算量
- 在多个数据集上实现更高精度与更快推理速度
- 适合部署在资源受限设备的高效视觉模型
视觉Transformer(ViT)凭借捕捉全局依赖的能力在计算机视觉中取得进展,但其计算成本随标记数呈二次增长,限制了实际效率。尽管已有方法结合卷积与自注意力以改善权衡,但自注意力固有的成对标记关联和复杂矩阵运算仍是瓶颈。为此,我们提出S2AFormer,一种新型高效视觉Transformer架构,核心为条带自注意力(SSA)。通过设计简洁有效的混合感知模块(HPB),将CNN的局部感知能力与Transformer的全局建模优势结合。SSA的关键创新在于降低$K$和$V$的空间维度,同时压缩$Q$和$K$的通道维度,大幅降低计算开销并保持精度,在多个基准测试中表现优异:ImageNet-1k图像分类、ADE20k语义分割、COCO目标检测与实例分割。结果表明,S2AFormer在GPU与非GPU环境下均实现显著精度提升与更高效率,是高效视觉Transformer的有力候选。
原文摘要 · Abstract (English)
Vision Transformer (ViT) has made significant advancements in computer vision, thanks to its token mixer's sophisticated ability to capture global dependencies between all tokens. However, the quadratic growth in computational demands as the number of tokens increases limits its practical efficiency. Although recent methods have combined the strengths of convolutions and self-attention to achieve better trade-offs, the expensive pairwise token affinity and complex matrix operations inherent in self-attention remain a bottleneck. To address this challenge, we propose S2AFormer, an efficient Vision Transformer architecture featuring novel Strip Self-Attention (SSA). We design simple yet effective Hybrid Perception Blocks (HPBs) to effectively integrate the local perception capabilities of CNNs with the global context modeling of Transformer's attention mechanisms. A key innovation of SSA lies in its reduction of the spatial dimensions of $K$ and $V$, while compressing the channel dimensions of $Q$ and $K$. This design significantly reduces computational overhead while preserving accuracy, striking an optimal balance between efficiency and effectiveness. We evaluate the robustness and efficiency of S2AFormer through extensive experiments on multiple vision benchmarks, including ImageNet-1k for image classification, ADE20k for semantic segmentation, and COCO for object detection and instance segmentation. Results demonstrate that S2AFormer achieves significant accuracy gains with superior efficiency in both GPU and non-GPU environments, making it a strong candidate for efficient vision Transformers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。