BAM: Bottleneck Attention Module

Jongchan Park, Sanghyun Woo, Joon-Young Lee, In So Kweon

Introduction: Beyond Depth and Width

In the pursuit of higher accuracy, deep learning research has traditionally focused on scaling networks along three dimensions: depth (layers), width (channels), and cardinality (groups). While effective, these approaches often lead to a significant increase in parameters and computational cost. The Bottleneck Attention Module (BAM) proposes an alternative: enhancing the representational power of Convolutional Neural Networks (CNNs) through efficient, general-purpose attention.

BAM is a lightweight, "plug-and-play" module designed to be integrated at the bottlenecks of any feed-forward CNN. By focusing on the most relevant features and their spatial locations, BAM achieves state-of-the-art performance gains with negligible overhead.

The BAM Architecture

BAM decomposes the attention process into two separate pathways: channel attention ("what") and spatial attention ("where"). For a given input feature map $F \in \mathbb{R}^{C \times H \times W}$, the module computes a 3D attention map $M(F)$ which is then used to scale the original features.

Detailed architecture of the Bottleneck Attention Module (BAM), illustrating the parallel channel and spatial attention branches.

1. Channel Attention Branch

This branch identifies which feature channels are most informative. It uses Global Average Pooling to aggregate spatial information into a channel vector, followed by a multi-layer perceptron (MLP) with a reduction ratio ($r$) to maintain parameter efficiency.

2. Spatial Attention Branch

This branch identifies the salient regions in the feature map. To capture a wide spatial context without a massive parameter increase, BAM utilizes a "bottleneck" structure ($1 \times 1$ convolutions) combined with dilated convolutions. Dilated convolutions allow the spatial branch to gather global context effectively, which is critical for deciding which areas of an image are salient.

The outputs of these two branches are combined via element-wise summation and passed through a sigmoid function to generate the final attention map. This map is then applied to the input feature map via a residual connection, ensuring stable training and healthy gradient flow.

Hierarchical Attention and Visual Insights

A key design choice in BAM is its placement at bottlenecks—the points in a network where feature maps are downsampled. These junctions are critical "information junctions" where feature refinement provides the most significant performance boost.

Overview of BAM integrated into a standard CNN architecture, showing how it refines feature maps and produces hierarchical attention maps.

Visualizations of the intermediate feature maps reveal that BAM acts as a hierarchical "denoiser." In the early stages of the network, the module helps ignore background textures and noise. In deeper stages, the attention maps focus intensely on the target object, effectively refining the features for the final classification or detection task. This mirrors the dual-stream processing found in the human visual system.

Experimental Results

The authors validated BAM across several backbones, including ResNet, WideResNet, and ResNeXt, using standard benchmarks like ImageNet-1K and MS COCO.

  • ImageNet Classification: Adding BAM to a ResNet-50 reduced the Top-1 error from 24.56% to 24.02%. Notably, a ResNet-50 equipped with BAM can outperform a standard ResNet-101 while using significantly fewer parameters.
  • Efficiency: The parameter overhead is minimal. For ResNet-50, BAM adds only 0.36M parameters (a ~1.5% increase) and negligible GFLOPs.
  • Object Detection: On the MS COCO dataset, BAM improved the mAP of a ResNet-101 baseline from 29.1 to 30.4, demonstrating that the refined features benefit localization-heavy tasks as much as classification.

Conclusion

BAM provides a simple yet powerful way to boost CNN performance by explicitly modeling "what" and "where" to focus. Its efficiency and plug-and-play nature make it an attractive component for modern computer vision architectures. Future work may explore its application in emerging non-convolutional architectures like Vision Transformers or its extension to temporal attention in video processing.

Summary updated

BibTeX
@inproceedings{park2018bam,
  author = {Jongchan Park and Sanghyun Woo and Joon-Young Lee and In So Kweon},
  title = {{BAM: Bottleneck Attention Module}},
  booktitle = {BMVC},
  year = {2018},
  url = {https://openreview.net/forum?id=o3EuAxUFDJu},
}
Figure