Residual Attention Network for Image Classification

Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, Xiaoou Tang

Introduction

Deep convolutional neural networks (CNNs) have achieved remarkable success in image classification. While attention mechanisms have been widely adopted in sequential and localization tasks, integrating them effectively into deep feed-forward networks remains challenging. The primary obstacle is signal attenuation: repeatedly multiplying features by soft attention masks (values between 0 and 1) in a deep architecture leads to severe degradation of feature representations.

The Residual Attention Network addresses this by proposing "attention residual learning," enabling the stacking of hundreds of attention modules in an end-to-end trainable fashion without losing the optimization benefits of deep residual learning.

Methods: The Attention Module

The core building block of the architecture is the Attention Module. Each module consists of two parallel paths:

  1. Trunk Branch: Processes features using standard units such as ResNet, ResNeXt, or Inception blocks.
  2. Mask Branch: Computes attention weights using a "bottom-up top-down" structure. It downsamples the input via max pooling to capture global context and then upsamples via linear interpolation to produce a soft mask of the same dimensions as the trunk's output.

To prevent signal degradation, the authors introduce Attention Residual Learning. Instead of a simple multiplication, the output $H(x)$ is defined as: $$H(x) = (1 + M(x)) * F(x)$$ where $M(x)$ is the mask and $F(x)$ is the trunk feature. This formulation ensures that if the mask values are near zero, the module defaults to the original identity mapping $F(x)$, preserving the gradient flow necessary for training very deep networks. Furthermore, the network employs Mixed Attention, using a sigmoid activation that allows it to adaptively focus on both spatial and channel-wise features simultaneously.

Key Insights

A significant advantage of this architecture is its ability to learn Hierarchical Attention. As the network deepens, the masks adapt to different levels of abstraction. Early layers typically learn to filter out low-level background noise (e.g., masking the sky), while deeper layers focus on high-level semantic components (e.g., specific parts of an object).

Visualization of hierarchical attention masks showing low-level color features and high-level part features.

Additionally, the mask branch serves as a gradient filter during backpropagation. This makes the network robust to noisy labels, as the attention mechanism can suppress gradients from incorrectly labeled regions. The "free-form" nature of mixed attention, which is unconstrained by specific spatial or channel-wise priors, allows the model to dynamically optimize its focus across all dimensions.

Experimental Results

The authors evaluated the Residual Attention Network on ImageNet and CIFAR datasets, demonstrating state-of-the-art performance with high efficiency.

  • ImageNet Performance: The Attention-92 model achieved a 19.5% top-1 error, surpassing the much deeper ResNet-200 (20.1% top-1). Remarkably, it achieved this using only 46% of the trunk depth and 69% of the computational cost (FLOPs) of ResNet-200.
  • CIFAR Benchmarks: On CIFAR-10 and CIFAR-100, the Attention-452 model reached error rates of 3.90% and 20.45%, respectively. The Attention-236 model outperformed ResNet-1001 while using only half the parameters (5.1M vs 10.3M).
  • Robustness to Noise: In experiments with 30% corrupted labels on CIFAR-10, the Attention-92 model maintained a 5.79% error rate, significantly outperforming a comparable ResNet-164 (6.61%).

Conclusion

The Residual Attention Network successfully integrates soft attention into deep CNNs through attention residual learning. By allowing features to bypass the mask branch when necessary, the architecture enables the training of extremely deep networks that are both parameter-efficient and robust to noise. Future work may involve extending this mechanism to more complex tasks like object detection and semantic segmentation, where spatial and channel-wise attention are particularly critical.

Summary updated

BibTeX
@inproceedings{wang2017residual,
  author = {Fei Wang and Mengqing Jiang and Chen Qian and Shuo Yang and Cheng Li and Honggang Zhang and Xiaogang Wang and Xiaoou Tang},
  title = {{Residual Attention Network for Image Classification}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  doi = {10.1109/cvpr.2017.683},
}
Figure