[论文解读] Rethinking Local Perception in Lightweight Vision Transformer
CloFormer 是一种轻量级视觉 Transformer,采用两分支设计:一个局部 AttnConv 分支,将共享权重与上下文感知权重融合以实现高频局部特征;一个下采样全局注意力分支用于低频全局信息,在较低 FLOPs 下实现高精度。
Vision Transformers (ViTs) have been shown to be effective in various vision tasks. However, resizing them to a mobile-friendly size leads to significant performance degradation. Therefore, developing lightweight vision transformers has become a crucial area of research. This paper introduces CloFormer, a lightweight vision transformer that leverages context-aware local enhancement. CloFormer explores the relationship between globally shared weights often used in vanilla convolutional operators and token-specific context-aware weights appearing in attention, then proposes an effective and straightforward module to capture high-frequency local information. In CloFormer, we introduce AttnConv, a convolution operator in attention's style. The proposed AttnConv uses shared weights to aggregate local information and deploys carefully designed context-aware weights to enhance local features. The combination of the AttnConv and vanilla attention which uses pooling to reduce FLOPs in CloFormer enables the model to perceive high-frequency and low-frequency information. Extensive experiments were conducted in image classification, object detection, and semantic segmentation, demonstrating the superiority of CloFormer. The code is available at \url{https://github.com/qhfan/CloFormer}.
研究动机与目标
- 通过提高局部感知来激励并解决移动尺寸 ViT 的性能下降。
- 设计一个融合共享(卷积)与上下文感知(类似注意力)权重的轻量级骨干。
- 提出 AttnConv,以在保持平移等变性的同时捕捉高频局部信息。
- 将局部 AttnConv 分支与下采样全局注意力分支结合,建模高低频信息。
- 在图像分类、目标检测和语义分割中展示有效性,具有具有竞争力的 FLOPs 与参数量。
提出的方法
- 引入 AttnConv,这是一种以注意力风格的卷积算子,使用深度卷积(共享权重)来聚合局部信息,随后通过 Q、K 处理和非线性变换(包含 Tanh 与 Swish)产生上下文感知权重。
- 使用两分支 Clo 块:局部分支(AttnConv)用于高频信息,全球分支(下采样的 K 与 V)用于低频信息。
- 通过拼接局部和全局分支输出并通过最终的全连接层进行融合。
- 用 ConvFFN(GELU 之后的 DWconv)替换普通 FFN,以在整个网络中注入局部信息。
- 提供四阶段 CloFormer 变体,并逐步增大 AttnConv 的核大小(3 到 9),以捕捉从高到低频的特征。
实验结果
研究问题
- RQ1如何将共享权重与上下文感知权重结合,以在轻量级 ViT 中提升局部感知?
- RQ2在移动端约束下,双分支架構能否有效融合高频局部信息与低频全局信息?
- RQ3AttnConv 是否提供一个非线性、平移等变的局部感知机制,在轻量化设置中优于传统卷积或自注意力?
主要发现
- CloFormer-XXS 在 ImageNet-1K 上以 4.2M 参数和 0.6 GFLOPs 实现 Top-1 77.0%。
- CloFormer-XS 在 ImageNet-1K 上以 7.2M 参数和 1.1 GFLOPs 实现 Top-1 79.8%。
- CloFormer-S 在 ImageNet-1K 上以 12.3M 参数和 2.0 GFLOPs 实现 Top-1 81.6%。
- 在 COCO 目标检测中,CloFormer-XXS 相比可比轻量骨干(如 EdgeViT 变体)将 AP 提升最多 0.9。
- 在 ADE20K 语义分割中,CloFormer-XXS/XS 比 EdgeViT 变体的 mIoU 提升最高 0.7–1.0 点。
- 消融表明 AttnConv(Swish-Tanh 非线性和 DWconv 用于 Q/K)在 ImageNet、COCO、ADE20K 的对比中,优于仅共享权重或仅上下文注意力的配置。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。