The challenge of internal covariates: how distribution shifts hurt training—and batch normalization
Paper info
Title: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
Authors: Sergey Ioffe, Christian Szegedy
TL;DR
Training deep neural networks requires careful configuration of parameter initialization, learning rate adjustment, and regularization. Even then, a slight shift in the distribution of network layer inputs makes training difficult. This phenomenon is called internal covariate shift. The research proposes Batch Normalization, a technique that normalizes mini-batches with learnable weights and bias to mitigate it. The method achieved state-of-the-art results on ImageNet classification.
Context
Consider a two-layer neural network: . and are learnable parameters of the network, and and are transformations applied to learnable parameters. For illustration, we can rewrite as where .
The gradient learning step for , for instance, would look like:
A slight change in the distribution of affects both training and test performance. It is desirable to keep the distribution of fixed. This problem amplifies as network depth increases—neural networks magnify or shrink small differences across a batch. This internal change in distribution is referred to as internal covariate shift.
Batch normalization aims to mitigate this by normalizing batches of inputs with learnable weights and bias to reduce covariate shift. They do this by preserving the statistics of the entire training data. Due to these properties, Batch normalization also enables faster, more stable training with higher learning rates and without divergence. It also functions like a regularizer.
Main idea
Batch normalization first normalizes each scalar input feature separately with a mean of 0 and a variance of 1, computed over the training data:
where .
To preserve the expressive power of the layer before passing to the activation function, learnable parameters and are introduced; they are learned along with other model parameters:
For a mini-batch where :
At inference time, moving averages of the mini-batch means and variances are used for normalization.
Backpropagation
In the following section, I show the backpropagation step for batch normalization. Note that there are some notation errors in the derivations below.

Question
What happens if we set the batch size to 1 when using batch normalization?