---
# System prepended metadata

title: 'CBAM: Convolutional Block Attention Module'

---

---
title: "CBAM: Convolutional Block Attention Module"

---
# CBAM: Convolutional Block Attention Module(ECCV2018)

 這篇主要結合 Spatial & Channel Domain 的 Attention
 
 ### CBAM Block
![](https://i.imgur.com/dPEHOFs.png)

### **Channel attention**
![](https://i.imgur.com/ESO2Pis.png)

![](https://i.imgur.com/vOmfa4X.png)

跟SE-Net一樣用兩個FC後cancat在一起做sigmoid取得scale
$r$一樣是16

#### 針對 Channel 的實驗

實驗證明Avg $+$ Max會比SE提出的單項pooling好

![](https://i.imgur.com/tuYm5jC.png)


### **Spatial attention**
![](https://i.imgur.com/QjWScdo.png)

將$F'$的channel(只有只對axis=[3])進行Maxpool跟Avgpool成兩個二維的Map再concat在一起做conv(7 $*$ 7)
最後sigmoid成第二個scale

#### 針對 Spatial 的實驗
![](https://i.imgur.com/XDNgJmI.png)

### Attention Module 的順序影響

![](https://i.imgur.com/crKlWxR.png)


### Classification results on ImageNet-1K

![](https://i.imgur.com/TkNo9FX.png)


### Grad-CAM visualization

![](https://i.imgur.com/ecGLzVW.jpg)

![](https://i.imgur.com/Bp0xor1.jpg)

