arXiv:2411.14429cs.CVcs.AI2024-11NeurIPS被引 9

让卷积和注意力在不同粒度上协同,提升视觉模型效率与可解释性。

Revisiting the Integration of Convolution and Attention for Vision Backbone

  • 在粗粒度语义槽上用注意力,细粒度网格上用卷积,实现局部与全局特征分离处理。
  • 仅用64个语义槽的注意力即可媲美顶尖模型性能,同时计算更高效。
  • 软聚类模块在无标注情况下自动分组语义,利于模型解释与弱监督分割。

卷积(Convs)与多头自注意力(MHSAs)通常被视为构建视觉主干网络的替代方案。尽管已有工作尝试融合两者,但均在像素级精细粒度上并行使用,而此时卷积已负责局部特征提取,因此在如此细粒度下引入重型注意力机制是否必要值得质疑。这正是视觉变换器在输入分辨率增大时面临可扩展性问题的根本原因。为此,本文提出将卷积与注意力在不同粒度层级上并行使用:每层中,图像通过两个不同方式表示——细粒度规则网格和粗粒度语义槽集合。分别对二者应用卷积(网格)与多头自注意力(槽);通过一对可微分的软聚类与调度模块连接两种表示,实现局部-全局特征融合。大量实验验证所提方法(命名为GLMix)的有效性:通过轻量卷积承担细粒度特征提取,仅需在64个语义槽上使用注意力即可达到当前先进主干网络性能,且效率更高。可视化结果表明,软聚类模块在仅用ImageNet-1K分类监督下即产生有意义的语义分组,具有更好的可解释性,并可能启发新的弱监督语义分割方法。代码将在https://github.com/rayleizhu/GLMix发布。

原文摘要 · Abstract (English)

Convolutions (Convs) and multi-head self-attentions (MHSAs) are typically considered alternatives to each other for building vision backbones. Although some works try to integrate both, they apply the two operators simultaneously at the finest pixel granularity. With Convs responsible for per-pixel feature extraction already, the question is whether we still need to include the heavy MHSAs at such a fine-grained level. In fact, this is the root cause of the scalability issue w.r.t. the input resolution for vision transformers. To address this important problem, we propose in this work to use MSHAs and Convs in parallel \textbf{at different granularity levels} instead. Specifically, in each layer, we use two different ways to represent an image: a fine-grained regular grid and a coarse-grained set of semantic slots. We apply different operations to these two representations: Convs to the grid for local features, and MHSAs to the slots for global features. A pair of fully differentiable soft clustering and dispatching modules is introduced to bridge the grid and set representations, thus enabling local-global fusion. Through extensive experiments on various vision tasks, we empirically verify the potential of the proposed integration scheme, named \textit{GLMix}: by offloading the burden of fine-grained features to light-weight Convs, it is sufficient to use MHSAs in a few (e.g., 64) semantic slots to match the performance of recent state-of-the-art backbones, while being more efficient. Our visualization results also demonstrate that the soft clustering module produces a meaningful semantic grouping effect with only IN1k classification supervision, which may induce better interpretability and inspire new weakly-supervised semantic segmentation approaches. Code will be available at \url{https://github.com/rayleizhu/GLMix}.

视觉主干卷积注意力模型效率

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。