Learning Day 55: back propagation in CNN — pooling and conv layers
Published in
3 min readJun 9, 2021
Building the knowledge on top of BP in NN (Day 51)
- For a typical conv layer structure: conv layer →pooling layer →Output
- How does BP work from output to pooling layer
- How does BP work from pooling to conv layer
BP for Output → pooling layer
- Based on Day 51, the δ for NN is calculated as follow:
- But the δ to pooling layer does not involve the Σ portion. Instead, replace it with upsampling
- For average pooling, upsample the δ to match the shape of the conv layer by splitting each value evenly to nearby cells.
- In such a way, the δ won’t get increase in the process of BP
- For max pooling, we need to record which cell before pooling has the max value.
- Upsample δ and place the value to the max position based on record. Other places are filled with 0s.
BP for Output → pooling layer
- If we break down the convolution operation between the image input and filter, the calculation is actually a special type of NN layers.
- Special NN layers: not fully connected, weights are shared
- Based on Day 51, the δ for NN is calculated as follow:
- Since conv layer is not fully connected to the next layer, the W here cannot be used since this matrix multiplication uses all weights in W.
- Instead, only choose the weights that are used in the convolution operation, resulting in:
- In the above case, the matrix calculation (above) assumes the latter layer is a pooling layer. So σ’ in the equation (below) was ignored since pooling layer has no activation function