Residual Attention Network for Image Classification

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

Abstract

The Residual Attention Network (RAN) introduces a scalable convolutional neural network architecture that integrates attention mechanisms through a residual learning framework. Unlike traditional attention models that may suffer from feature degradation in deep architectures, RAN employs a "residual attention" approach that allows for the training of networks hundreds of layers deep. By stacking multiple Attention Modules, the network learns to adaptively refine features across different scales. Experimental results on CIFAR and ImageNet datasets demonstrate that RAN achieves state-of-the-art performance, outperforming significantly larger models like ResNet-200 while requiring substantially less computation.

Introduction

Deep convolutional neural networks (CNNs) have traditionally advanced by increasing depth or width. However, standard architectures often process all image regions with equal weight, failing to leverage the selective focus characteristic of human vision. While attention mechanisms have been explored to address this, integrating them into ultra-deep feedforward networks has historically faced challenges such as feature degradation and increased sequential complexity.

The Residual Attention Network addresses these hurdles by making attention a fundamental component of the feedforward path. It utilizes a novel residual learning formulation for attention, ensuring that the signal remains robust even as the network depth increases.

Methodology: The Attention Module

The core building block of the RAN is the Attention Module. Each module is divided into two parallel functional branches:

  1. Trunk Branch: This branch performs standard feature extraction using a series of Residual Units. It represents the "original" feature processing path.
  2. Mask Branch: This branch employs a bottom-up top-down structure to learn a soft attention mask $M(x)$. The bottom-up path uses max-pooling to capture global context, while the top-down path upsamples the features to produce a pixel-wise mask of the same dimensions as the trunk features.
The architecture of the Residual Attention Network, showing the stacked Attention Modules and the internal structure of the Soft Mask Branch.

Attention Residual Learning

A critical innovation of this work is Attention Residual Learning. In a naive attention implementation, features $F(x)$ are simply multiplied by a mask $M(x)$ with values in $[0, 1]$. In deep networks, repeated multiplication can cause feature values to vanish, hindering gradient flow. RAN solves this by using the following formulation: $$H(x) = (1 + M(x)) \cdot F(x)$$ By adding "1" to the mask, the branch effectively acts as an identity mapper when the attention mask is zero. This prevents the degradation of important features and allows the network to be trained to extreme depths.

Hierarchical Feature Refinement

By stacking these Attention Modules, the network learns to refine features hierarchically. Early modules typically focus on low-level features and broad spatial regions (e.g., separating the sky from the ground), while deeper modules focus on high-level part-based features (e.g., identifying specific components of an object).

Visualization of the attention mechanism across different levels, showing how the network refines its focus from low-level color features to high-level object parts.

The authors found that "mixed attention"—where the mask varies across both spatial positions and feature channels—yielded the best performance, allowing the network to decide both where to look and which features to prioritize.

Experimental Results

The Residual Attention Network was evaluated on several benchmark datasets, consistently achieving superior results compared to baseline architectures.

  • CIFAR-10/100: On CIFAR-10, the network achieved a 3.90% error rate, outperforming the much deeper ResNet-1001.
  • ImageNet: The Attention-92 model achieved a 4.8% top-5 error (single crop). Notably, it outperformed ResNet-200 while utilizing 46% less depth and 69% fewer FLOPs, demonstrating significant gains in computational efficiency.

Conclusion and Future Work

The Residual Attention Network demonstrates that attention can be effectively integrated into ultra-deep CNNs through a residual learning framework. This approach not only improves classification accuracy but also enhances computational efficiency and robustness to noisy data. Future research may extend this stacked attention mechanism to other complex vision tasks such as object detection and semantic segmentation, where precise spatial localization is paramount.

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