liveBook · Manning

Batch normalization

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

Batch normalization is a neural-network technique that normalizes intermediate activations using statistics computed over training batches.

Batch normalization is a neural-network layer that normalizes intermediate activations, helping convolutional models generalize and reducing memorization. section 7.1.1 section 8.1.4

For each convolutional feature map, it calculates the mean and variance, subtracts the mean, and divides by the square root of the variance. Values therefore remain centered near zero, reducing vanishing and exploding gradient problems. section 8.1.4

Adding the layer to a CNN

A Keras CNN places BatchNormalization between convolution and max pooling. A comparable autoencoder adds the layer throughout both encoder and decoder, alongside dropout; excessive use can worsen results and require manual architecture tuning. section 7.1.1 section 8.1.5

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 a runnable Keras CNN showing BatchNormalization placement, pooling, and parameter counts. section 7.1.1

Figure 8.7 The BatchNormalization process

Use the figure to inspect per-feature-map means, variances, and normalized values. section 8.1.4

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

How deep it goes
Explains feature-map statistics and the normalization equation, then demonstrates layer placement without deriving training internals.
Examples
Demonstrates Keras CNN and autoencoder architectures, feature-map normalization, training curves, parameter summaries, and a deliberately overused configuration.
What it assumes
Assumes basic neural-network layers and training while teaching normalization, gradient problems, and practical layer insertion.
What you can do after
Apply it via Keras BatchNormalization layers in CNNs and autoencoders, then inspect validation behavior and tune excessive use.
How it connects
Connects batch normalization to convolutional neural networks, autoencoders, dropout, pooling, generalization, and vanishing or exploding gradients.

Also explained in

Compare how 9 books explain batch normalization →

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.