Global Attention Mechanism: Retain Information to Enhance Channel-Spatial Interactions

Yichao Liu, Zongru Shao, Nico HoffmannarXiv 2021

Abstract

A variety of attention mechanisms have been studied to improve the performance of various computer vision tasks. However, the prior methods overlooked the significance of retaining the information on both channel and spatial aspects to enhance the cross-dimension interactions. Therefore, we propose a global attention mechanism that boosts the performance of deep neural networks by reducing information reduction and magnifying the global interactive representations. We introduce 3D-permutation with multilayer-perceptron for channel attention alongside a convolutional spatial attention submodule. The evaluation of the proposed mechanism for the image classification task on CIFAR-100 and ImageNet-1K indicates that our method stably outperforms several recent attention mechanisms with both ResNet and lightweight MobileNet.

Introduction

In Convolutional Neural Networks (CNNs), attention mechanisms act as a spotlight, identifying critical features within an image or across feature channels. While established methods like Squeeze-and-Excitation (SE) and Convolutional Block Attention Module (CBAM) have significantly improved performance, they often rely on "squeezing" data through max-pooling or average-pooling. This process, while computationally efficient, leads to significant information reduction by discarding fine-grained details. Furthermore, these methods often treat channel and spatial attention as isolated components, failing to capture the complex "global" interactions where specific channels and spatial locations influence one another.

The Global Attention Mechanism (GAM)

To address these limitations, the Global Attention Mechanism (GAM) is designed to reduce information loss and amplify global interactive representations. GAM follows a sequential channel-spatial order but introduces redesigned submodules to preserve cross-dimension interactions.

The GAM architecture features a Channel Attention Submodule using 3D permutation and a Spatial Attention Submodule utilizing convolutional layers without pooling.

Channel Attention Submodule

Instead of traditional pooling, GAM utilizes 3D permutation. This operation reshapes the input tensor, allowing a two-layer Multi-Layer Perceptron (MLP) to learn dependencies across the Channel, Height, and Width dimensions simultaneously. This approach ensures that channel importance is evaluated within the context of the entire spatial layout.

Spatial Attention Submodule

To preserve spatial detail, GAM removes all pooling layers from the spatial submodule. Instead, it employs two 7x7 convolutional layers to fuse information. To manage the resulting increase in parameters, especially in deeper models like ResNet50, the authors utilize group convolutions with channel shuffle, maintaining a balance between computational cost and performance.

Experimental Results

The effectiveness of GAM was evaluated on CIFAR-100 and ImageNet-1K across various architectures, including ResNet and MobileNet V2.

Performance comparison of GAM against other attention mechanisms on ImageNet-1K across ResNet18, ResNet50, and MobileNet V2 architectures.

As shown in the results, GAM consistently outperforms baseline models and other attention mechanisms:

  • CIFAR-100 (ResNet50): GAM achieved an 18.67% Top-1 error, a substantial improvement over the 22.74% baseline and the 19.44% achieved by CBAM.
  • ImageNet-1K (ResNet18): GAM reached a 29.34% Top-1 error, surpassing the Attention Branch Network (ABN) while maintaining efficiency.
  • Lightweight Models: On MobileNet V2, GAM reduced the Top-1 error from 30.52% to 29.31%, proving that the mechanism is effective even for mobile-friendly architectures.

Conclusion and Future Work

The Global Attention Mechanism successfully enhances CNN performance by retaining information typically lost to pooling and fostering global interactions. While GAM introduces a higher parameter count—for instance, increasing ResNet50 parameters from ~23M to ~57M with group convolutions—the performance gains are significant. Future research will focus on further optimizing parameter efficiency to make GAM more accessible for massive, state-of-the-art "heavy" networks.

Summary updated

BibTeX
@misc{liu2021global,
  author = {Yichao Liu and Zongru Shao and Nico Hoffmann},
  title = {{Global Attention Mechanism: Retain Information to Enhance Channel-Spatial Interactions}},
  year = {2021},
  eprint = {2112.05561},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.05561},
}
Figure