Convolutional Neural Networks

Learn how to create additional structures that a convolutional neural network can have, discover the similarities and differences between fully connected and convolutional layers.

Apart from convolutional layers, which are a CNN’s principal structure, some additional structures are used to optimize the model. Let’s take a look at these and their intended use.

Pooling layers

A pooling layer is a nontrainable layer whose primary goal is to change the size of the feature map. It’s mainly used to decrease the feature map size to reduce parameters or fit the output map to a specific target size. Although it’s possible to obtain a similar result by changing the stride of the convolutional layer, pooling is a less complex and faster operation.

Max pooling

With an n×nn \times n pooling kernel, we travel the input data and select the maximum value inside the kernel as the output.

Press + to interact
4 x 4 feature map
1 / 6
4 x 4 feature map

Average pooling

With an n×nn \times n pooling kernel, we travel the input data and calculate the average value inside the kernel as the output.

Press + to interact
4 x 4 feature map
1 / 6
4 x 4 feature map

In summary, it’s not as complex as convolution operation, and applying 2x2 pooling (a prevalent one) decreases the feature map size by half. For other pooling sizes, it’s the same with convolution to calculate the output feature map size since the travel logic is the same; only note that padding is mostly not used for pooling operations so that we can remove the +2p+2p ...

Access this course and 1400+ top-rated courses and projects.