[Paper Review] Global Self-Attention Networks for Image Recognition
This paper proposes the Global Self-Attention (GSA) module, a computationally efficient attention mechanism that jointly models content and spatial position to enable global, long-range feature interactions in deep networks. By combining a content-only global attention branch with axial positional attention, GSA networks outperform convolutional and existing attention-based models on ImageNet and CIFAR-100 with fewer parameters and less computation.
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.
Motivation & Objective
- Address the inefficiency of standard self-attention in computer vision due to quadratic complexity with spatial dimensions.
- Overcome limitations of prior methods that restrict attention to local regions or use only content-based attention.
- Enable global attention as a backbone component in deep networks by designing a computationally efficient module.
- Integrate both content and spatial position information into attention to better model image-structured data.
- Develop standalone global attention-based networks (GSA networks) that replace convolutions for pixel interaction modeling.
Proposed method
- Propose the GSA module, a dual-branch architecture combining content attention and positional attention.
- Implement content attention using a linear-complexity global attention mechanism similar to Chen et al. (2018) and Shen et al. (2018).
- Implement positional attention via axial formulation: column-only attention followed by row-only attention, reducing complexity to O(N√N).
- Combine outputs of both branches via element-wise summation to produce the final feature representation.
- Construct GSA networks by replacing spatial convolutions in ResNet with GSA modules throughout the network.
- Train and evaluate GSA networks end-to-end on ImageNet and CIFAR-100 using standard training protocols.
Experimental results
Research questions
- RQ1Can a global self-attention mechanism be made efficient enough to serve as the backbone of a deep network in image recognition?
- RQ2Does jointly modeling content and spatial position in attention improve performance over content-only attention?
- RQ3How does the inclusion of global attention affect feature learning in early vs. late network stages?
- RQ4Can GSA networks outperform both standard convolutional networks and existing attention-based models in accuracy, parameter efficiency, and inference speed?
- RQ5What is the relative contribution of content attention versus positional attention in the GSA module?
Key findings
- GSA-ResNet-50 achieves 78.5% top-1 accuracy on ImageNet, outperforming the original ResNet-50 (76.9%) and ResNet-101 (78.7%) while being faster and using fewer parameters.
- Replacing convolutions with GSA modules in residual groups 2–4 of ResNet-50 yields the same top-1 accuracy as ResNet-101 but with 30% less runtime.
- The full GSA module with both content and positional attention achieves 78.5% top-1 accuracy, a 7.7% drop when only content attention is used, proving the necessity of positional modeling.
- Column-only positional attention performs better than row-only, suggesting vertical interactions are more critical for ImageNet classification.
- On CIFAR-100, GSA networks improve top-1 accuracy by 2.5–2.7% over corresponding ResNet variants while reducing parameters and computation.
- The GSA module reduces computational cost to 31.1 ms inference time on ImageNet, compared to 22.6 ms for ResNet-50, while achieving higher accuracy.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.