liveBook · Manning

Pooling

As explained in Evolutionary Deep Learning: Genetic algorithms and neural networks

Pooling is a neural-network operation that aggregates values within local regions to reduce spatial or feature-map dimensions.

Pooling aggregates convolutional outputs and reduces their spatial size before later layers. In a CNN, this can shrink the model substantially and may improve generalization. section 7.1.1

A practical pooling workflow includes:

  • Place a MaxPooling2D layer after convolution, commonly with a (2, 2) pool and same padding. section 7.1.1
  • Inspect the model summary to compare parameter counts; adding pooling reduced the demonstrated model to roughly one-quarter its previous size. section 7.1.1
  • Change the pooling size, kernel size, or number of convolutional layers and rerun training to observe architectural effects. section 7.1.2

Pooling in a CNN

A convolutional model can place BatchNormalization and MaxPooling2D((2, 2), padding="same") between Conv2D and Flatten. The resulting model has fewer trained parameters and shows improving validation accuracy in the demonstrated experiment. section 7.1.1

Pooling in an autoencoder

An encoder can apply MaxPool2D after each convolution, progressively shrinking a 28×28 input until a final pooling layer forms the latent view. UpSampling2D then expands that representation in the decoder. section 8.1.2

Listing 7.6 EDL_7_1_Keras_CNN.ipynb: Adding pooling
model = models.Sequential()
model.add(layers.Conv2D(64, (3, 3), activation='relu', 
 padding="same", input_shape=(28, 28, 1)))              #1
model.add(layers.BatchNormalization())                    #2
model.add(layers.MaxPooling2D((2, 2), padding="same"))    #3
model.add(layers.Flatten())
model.add(layers.Dense(128, activation='relu'))
model.add(layers.Dense(10))
 
model.summary()
...
=================================================================
Total params: 1,607,946
Trainable params: 1,607,818                               #4
Non-trainable params: 128
_________________________________________________________________

Inspect the complete Keras CNN listing, including convolution, batch normalization, MaxPooling2D, flattening, dense layers, and the model summary. section 7.1.1

How Evolutionary Deep Learning: Genetic algorithms and neural networks covers it

How deep it goes
Demonstrates Keras placement, parameter effects, and architectural experiments but does not derive pooling mathematically.
Examples
Uses MaxPooling2D in a CNN and repeated MaxPool2D layers in a Fashion-MNIST convolutional autoencoder.
What it assumes
Assumes familiarity with convolutional layers and image-shaped inputs while demonstrating pooling within complete CNN and autoencoder architectures.
What you can do after
Apply pooling via Keras, inspect its parameter impact, and experiment with pool sizes and surrounding CNN layers.
How it connects
Connects pooling with convolution, batch normalization, dropout, autoencoders, latent representations, and UpSampling.

Also explained in

Compare how 8 books explain pooling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Evolutionary Deep Learning: Genetic algorithms and neural networks. The section links point to the parts of the book it draws on.