CBAM (Convolutional Block Attention Module) is a small module that applies "channel attention" and then "spatial attention" to a convolutional feature map, strengthening important features and weakening unneeded ones. It was proposed in 2018 by Woo et al. of KAIST and other institutions in the paper "CBAM: Convolutional Block Attention Module" (ECCV 2018).
A CNN feature map has three axes: channels (), height (), and width (). Each channel detects some kind of feature, so weighting channels selects what to look at. Height and width are positions in the image, so weighting positions selects where to look. CBAM builds these two sets of weights in turn and applies them to the feature map.
It is based on the SE block of SENet, which only produces per-channel weights. CBAM changes two things:
| Difference | SE block | CBAM |
|---|---|---|
| Input for channel weights | Average pooling along the spatial dimensions only | Both average pooling and max pooling |
| Position weights | None | Adds spatial attention produced by a 7 × 7 convolution |
To use the analogy of a person looking at a photo, channel attention corresponds to choosing a viewpoint, such as "focus on shape rather than color in this photo," and spatial attention corresponds to choosing a location, such as "look around the dog in the middle of the photo."
Unlike Transformer scaled dot-product attention, it does not compute relationships between tokens; it is a kind of attention that multiplies each channel and each position of the feature map by a weight between 0 and 1. In the figure at the top of the article, the left shows its position inside a ResNet residual block, and the right shows the inside of the two modules.

