All models

BAM

A ResNet50 with BAM attention modules, which reweight features by channel and by position at each bottleneck.

Image classification · 247 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (21 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
25.9M
Operations
247
Framework
PyTorch
Recurrent
No
Published
BMVC 2018
Cited by
951 (as of 23 October 2026)
Authors
Jongchan Park, Sanghyun Woo, Joon-Young Lee, In So Kweon
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m14805
Graph hash
22caf608555312ff9a759cdbf371edda7cabb49a0f9ff41bdc075c6b03d22060
Skeleton hash
b2106bc645add13460301f10e8600f0393a90cc887fa2f03cfd9a5efbdd87452
Architecture hash
77fe7a8aedfd163c99edf2135b70bfc7919a64647898ba247704624361436224
Diagram SHA-256
d55aa4c5d6549d66411aba2ee22679b6194b8f79408ae6da4a8c2ec339e94827
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

BAM, the Bottleneck Attention Module, is a small attention module that can be integrated with any feed-forward convolutional neural network. Given a 3D feature map, it produces a 3D attention map that emphasizes important elements. The modules are placed at each bottleneck of the host network, the points where feature maps are downsampled.

The attention map is inferred along two separate pathways, channel and spatial. The channel branch pools the feature map into a channel vector and estimates attention across channels with a multi-layer perceptron that has one hidden layer. The spatial branch reduces the channel dimension and then applies two 3×3 dilated convolutions to bring in contextual information. The combined map is multiplied element-wise with the input feature map, and the result is added to the original input.

After ablations on ResNet50, the authors set the dilation value to 4 and the reduction ratio to 16. They evaluate BAM on CIFAR-100 and ImageNet-1K for image classification and on VOC 2007 and MS COCO for object detection. The official code includes ResNet50 based examples and provides a ResNet50+BAM checkpoint trained for 90 epochs.

Key idea. BAM is an attention module that infers a 3D attention map through separate channel and spatial branches and is placed at each bottleneck of a convolutional network.

  • BAM
  • Bottleneck Attention Module
  • attention module
  • channel attention
  • spatial attention
  • ResNet50+BAM
  • image classification
  • convolutional attention

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{park2018bambottleneckattentionmodule,
      title={BAM: Bottleneck Attention Module}, 
      author={Jongchan Park and Sanghyun Woo and Joon-Young Lee and In So Kweon},
      year={2018},
      eprint={1807.06514},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1807.06514}, 
}