Attention Branch Network: Learning of Attention Mechanism for Visual Explanation

Hiroshi Fukui, Tsubasa Hirakawa, Takayoshi Yamashita, Hironobu Fujiyoshi

Deep Convolutional Neural Networks (CNNs) are often criticized as "black boxes," making it difficult to understand the reasoning behind their classifications. While visual explanation methods like Class Activation Mapping (CAM) and Grad-CAM have been developed to address this, they typically function as post-hoc diagnostic tools rather than active components of the learning process. This paper introduces the Attention Branch Network (ABN), a novel architecture that integrates visual explanation directly into the forward pass to both provide interpretability and enhance model performance.

The Interpretability-Performance Trade-off

Existing visual explanation methods face several challenges. Methods like CAM often require architectural modifications, such as removing fully connected layers, which can degrade classification accuracy. Furthermore, gradient-based methods like Grad-CAM are computationally expensive due to the required backward pass. Most importantly, these methods are passive; they explain what a trained model has learned but do not actively guide the model toward better feature representation during training.

Comparison between (a) Class Activation Mapping (CAM) and (b) the proposed Attention Branch Network (ABN).

Methodology: The Attention Branch Network

ABN addresses these issues by treating the explanation mechanism as an active attention module. The architecture consists of three primary components:

  1. Feature Extractor: A standard convolutional backbone (e.g., ResNet) that extracts basic image features.
  2. Attention Branch: This branch generates an attention map $M(x)$ using a CAM-like structure. Unlike standard CAM, this branch is trained with its own loss function ($L_{att}$), forcing it to learn which regions are most discriminative for the target class.
  3. Perception Branch: This branch performs the final classification. It receives the feature maps from the extractor, which are then modulated by the attention map from the previous branch.

To ensure that the model does not lose valuable contextual information, ABN employs a residual-style attention mechanism: $$g'(x) = (1 + M(x)) \cdot g(x)$$ This formula scales the feature map $g(x)$ by the attention map $M(x)$ while preserving the original features through the addition of 1. This ensures that while important regions are highlighted, the rest of the feature map is not entirely discarded.

Detailed overview of the ABN architecture (a) and the specific internal structures for the attention (b) and perception (c) branches across different model types.

Experimental Evaluation and Results

The researchers evaluated ABN across several benchmarks, including CIFAR-10/100, ImageNet, and fine-grained recognition tasks like CompCars.

Key Performance Gains

  • General Classification: On CIFAR-100, ABN reduced the top-1 error of a ResNet-110 from 24.14% to 22.82%. On ImageNet, it improved ResNet-152 performance to a top-1 error of 21.37% (down from 22.19%).
  • Fine-Grained Recognition: The most significant gains were seen in the CompCars dataset, where accuracy jumped from 90.2% to 97.1%, demonstrating ABN's ability to focus on subtle, discriminative features.
  • Multi-Task Learning: Using the CelebA dataset, the authors demonstrated that ABN can generate task-specific attention maps, such as focusing on the mouth for "smiling" and the forehead for "wearing hat."

Conclusion

ABN successfully bridges the gap between interpretable AI and high-performance deep learning. By making the explanation mechanism an integral part of the network's forward pass, the model learns to focus on relevant features, leading to both clearer visualizations and superior accuracy. While ABN introduces some computational overhead due to the additional branch, its ability to provide real-time, high-quality attention maps without a backward pass makes it a powerful tool for both model diagnostics and performance optimization. Future work may explore unsupervised training for the attention branch and its application in reinforcement learning environments.

Summary updated

BibTeX
@inproceedings{fukui2019attention,
  author = {Hiroshi Fukui and Tsubasa Hirakawa and Takayoshi Yamashita and Hironobu Fujiyoshi},
  title = {{Attention Branch Network: Learning of Attention Mechanism for Visual Explanation}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.01096},
}
Figure