[论文解读] Global Self-Attention Networks for Image Recognition
本文提出全局自注意力(GSA)模块,一种计算效率高的注意力机制,通过联合建模内容与空间位置,实现在深度网络中的全局、长距离特征交互。通过结合仅内容的全局注意力分支与轴向位置注意力,GSA网络在ImageNet和CIFAR-100上优于卷积神经网络及现有注意力模型,且参数更少、计算量更低。
Recently, a series of works in computer vision have shown promising results on various image and video understanding tasks using self-attention. However, due to the quadratic computational and memory complexities of self-attention, these works either apply attention only to low-resolution feature maps in later stages of a deep network or restrict the receptive field of attention in each layer to a small local region. To overcome these limitations, this work introduces a new global self-attention module, referred to as the GSA module, which is efficient enough to serve as the backbone component of a deep network. This module consists of two parallel layers: a content attention layer that attends to pixels based only on their content and a positional attention layer that attends to pixels based on their spatial locations. The output of this module is the sum of the outputs of the two layers. Based on the proposed GSA module, we introduce new standalone global attention-based deep networks that use GSA modules instead of convolutions to model pixel interactions. Due to the global extent of the proposed GSA module, a GSA network has the ability to model long-range pixel interactions throughout the network. Our experimental results show that GSA networks outperform the corresponding convolution-based networks significantly on the CIFAR-100 and ImageNet datasets while using less parameters and computations. The proposed GSA networks also outperform various existing attention-based networks on the ImageNet dataset.
研究动机与目标
- 解决标准自注意力在计算机视觉中因空间维度导致的二次方复杂度问题。
- 克服先前方法将注意力限制在局部区域或仅使用基于内容的注意力的局限性。
- 通过设计计算高效的模块,使全局注意力可作为深度网络中的主干组件。
- 将内容与空间位置信息整合到注意力机制中,以更好地建模图像结构化数据。
- 构建独立的全局注意力网络(GSA网络),以取代卷积用于像素间交互建模。
提出的方法
- 提出GSA模块,一种双分支架构,结合内容注意力与位置注意力。
- 通过类似Chen et al. (2018) 和 Shen et al. (2018) 的线性复杂度全局注意力机制实现内容注意力。
- 通过轴向公式实现位置注意力:先进行列方向注意力,再进行行方向注意力,将复杂度降低至O(N√N)。
- 通过逐元素相加融合两个分支的输出,生成最终特征表示。
- 通过在ResNet中将空间卷积全部替换为GSA模块,构建GSA网络。
- 使用标准训练协议,在ImageNet和CIFAR-100上端到端训练并评估GSA网络。
实验结果
研究问题
- RQ1能否使全局自注意力机制足够高效,以作为图像识别中深度网络的主干?
- RQ2在注意力机制中联合建模内容与空间位置是否能提升性能,优于仅基于内容的注意力?
- RQ3引入全局注意力对网络早期与后期阶段的特征学习有何影响?
- RQ4GSA网络能否在准确率、参数效率与推理速度方面均优于标准卷积网络与现有注意力模型?
- RQ5在GSA模块中,内容注意力与位置注意力的相对贡献如何?
主要发现
- GSA-ResNet-50在ImageNet上达到78.5%的top-1准确率,优于原始ResNet-50(76.9%)和ResNet-101(78.7%),且推理更快、参数更少。
- 在ResNet-50的残差块2–4中用GSA模块替换卷积后,达到与ResNet-101相同的top-1准确率,但运行时间减少30%。
- 完整GSA模块(同时包含内容与位置注意力)达到78.5%的top-1准确率;若仅使用内容注意力,准确率下降7.7%,证明位置建模的必要性。
- 仅列方向位置注意力的表现优于仅行方向,表明垂直方向交互对ImageNet分类更为关键。
- 在CIFAR-100上,GSA网络相比对应ResNet变体将top-1准确率提升2.5–2.7%,同时减少参数与计算量。
- 在ImageNet上,GSA模块将推理时间降至31.1 ms,相比ResNet-50的22.6 ms更长,但准确率更高。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。