(ML) SENet : Squeeze-and-Excitation Networks

YEN HUNG CHENG
5 min readFeb 17, 2023

--

Squeeze-and-Excitation Networks

以下為 SENet(Squeeze-and-Excitation Networks)的架構

source

總共分為 4 個步驟

  1. Transformation
  2. Squeeze
  3. Excitation
  4. Scaling

Transformation

前一層的輸出 X 經過卷積得到 U

source
source
  • C:Channel
  • W:Width
  • H:Height
  • X:前一層的 Output
  • U:經過 Convolution 後所得到的 feature map
  • H’, W’, C’:經過 Convolution 後 feature map 的 Height、Width、dimension

Squeeze

使用 Global average pooling 將卷積後的 feature map 維度壓成 1 x 1 x C

source
source

Global average pooling

source

Excitation

學習每一個 channel 之間的關係,也就是將重要資訊 feature map 權重調大,不重要的 feature map 權重調低

source
source

公式的步驟如下

  1. FC (Fully-connected layer)
  2. ReLU
  3. FC (Fully-connected layer)
  4. Sigmoid

Scaling

讓 s 與 U 進行通道間的相乘 (channel-wise multiplication)

source
source

以上就是 SENet(Squeeze-and-Excitation Networks)內部的運作流程

Instantiations

將 SENet 插入到 Inception 和 RestNet 中

RestNet-50、SE-RestNet-50、SE-ResNeXt-50 網路架構

source
  • fc:SE Block 中的兩個 FC (Fully-connected layer) 的 Output

Error rate、FLOPS (Floating Point Operations Per Second)

source

使用 SE Block 所產生的參數計算公式:

source

r :reduction ratio(縮減比)通常會使用 16
S:refers to the number of stages(階段是指在共同空間維度的特徵圖上運行的塊的集合)
Cs:dimension of the output channels(輸出的通道數)
Ns:number of repeated blocks for stage s(當在 FC 層中使用偏置項時,引入的參數和計算成本通常可以忽略不計)

下面表格為使用不同的 reduction ratio 所產生的 params 與 error 比較,可以發現 r=16整體性能和計算量最平衡

source

Experiment

以下就是 SENet 與其它知名的 Network 進行比較,可以發現 Error rate 都表現最好,而增加的參數也不多

source
  • SENet-154:SE-ResNeXt-152,也就是在 ResNeXt-152 中加入 SE Block

SENet(Squeeze-and-Excitation Networks) 其實就是提出了通道 (channel) 間注意力機制(Attention mechanism) 的思想,並且讓這模塊能夠插入到其它網路中,用最低的成本來提升網路的效益。

--

--