What Is Pooling on CNN, and How Does It Work?

What Is Pooling on CNN, and How Does It Work?

In Convolutional neural network pooling is used to reduce the spatial size of the convolved feature. There are mainly two types of pooling such as max pooling and average pooling. In max pooling, a window moves over the input matrix and makes the matrix with maximum values of those windows.

In average pooling, it is similar to max pooling but uses average instead of maximum value. The window moves according to the stride value. If the stride value is 2 then the window moves by 2 columns to right in the matrix after each operation. In short, the pooling technique helps to decrease the computational power required to analyze the data.
https://medium.com/technologymadeeasy/the-best-explanation-of-convolutional-neural-networks-on-the-internet-fbb8b1ad5df8#:~:text=Pooling%20Layers,building%20block%20of%20a%20CNN.&text=Its%20function%20is%20to%20progressively,on%20each%20feature%20map%20independently.

Pooling layer is the building block of CNN.The main purpose of a pooling layer is to reduce the spatial size of your image so that we need less number of pixels and hence less number of features or parameters for further computations.

Another question that comes to our mind by seeing this answers that if we reduce size or features of our image does this affect accuracy or final prediction of our model.the answer to this question is Yes it may be. if you add many pooling layers and your important features are lost your accuracy will start to decrease too.

generally we should do pooling to a limit so that we are still able to retain important feature of our imgae. by saying important features I mean to say that features or pixels which have high impact on final prediction.