# Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift

Sergey Ioffe, Christian Szegedy · arXiv · 2015-2-11

- **Problem** Layer inputs keep shifting as earlier layers train, which slows SGD and requires careful tuning of learning rates and initialization.
- **Method** Batch Normalization standardizes each activation with its mini-batch mean and variance, applies learned scale and shift parameters, and switches to population statistics at inference.
- **Results** BN-x5 reached Inception's 72.2% single-crop validation accuracy in 14 times fewer training steps.

## Why layer inputs drift during training

Stochastic gradient descent updates all parameters from gradient estimates on mini-batches, but the inputs each layer receives depend on the parameters of every layer below it. A small change in an early layer therefore gets amplified as the network gets deeper, and the later layers must keep adapting to a distribution that keeps moving. The authors call the change in the distribution of internal activations during training internal covariate shift, and they argue that reducing it should speed up training.

The effect is sharpest for saturating nonlinearities. For a sigmoid, the derivative shrinks as the magnitude of the input grows, so drifting inputs that fall into the flat region slow the gradient flow to earlier layers. The usual remedies are ReLU, careful initialization and small learning rates, whereas keeping the input distribution of each nonlinearity stable addresses the cause directly.

The proposed remedy, Batch Normalization, inserts a normalization step into the model architecture. It fixes the means and variances of layer inputs, is computed on each training mini-batch, and reduces the dependence of gradients on parameter scale. Batch Normalization also regularizes the model and can reduce the need for Dropout, and it makes saturating nonlinearities usable again by keeping units out of the saturated regime.

## Normalizing each activation over a mini-batch

Whitening all layer inputs jointly needs a covariance matrix and its inverse square root, which is costly and not everywhere differentiable. The authors simplify this by normalizing each scalar feature on its own, so that each dimension has zero mean and unit variance.

The statistics come from the current mini-batch, so each step needs only the batch mean and batch variance of each activation, not a pass over the whole training set. Because the variance is taken per dimension, a mini-batch smaller than the number of activations does not produce a singular covariance estimate.

For one activation over a mini-batch of m values, the transform subtracts the batch mean from each value, divides by the square root of the batch variance plus a small constant, and then applies the learned scale and shift. \\\[\\mu\_B=\\frac{1}{m}\\sum\_{i=1}^{m}x\_i,\\quad \\sigma\_B^2=\\frac{1}{m}\\sum\_{i=1}^{m}(x\_i-\\mu\_B)^2,\\quad \\hat x\_i=\\frac{x\_i-\\mu\_B}{\\sqrt{\\sigma\_B^2+\\epsilon}},\\quad y\_i=\\gamma\\hat x\_i+\\beta\\\] The constant \\(\\epsilon\\) is added to the mini-batch variance for numerical stability.

The scale \\(\\gamma\\) and shift \\(\\beta\\) are learned for each activation together with the network weights. Setting \\(\\gamma\\) to the square root of the variance and \\(\\beta\\) to the mean would recover the original activation, so the transform can represent the identity.

Each output depends on the other examples in the mini-batch, not only on its own input. Ignoring \\(\\epsilon\\), the normalized values have mean 0 and variance 1 when the mini-batch elements come from the same distribution.

## Backpropagation and inference

Backpropagation passes the gradient of the loss through the normalized values and through the batch mean and variance, so the statistics take part in the gradient computation. The gradients with respect to the learned parameters are the sums of the upstream gradients weighted by the normalized values, and the sum of the upstream gradients alone for the shift.

\\\[\\frac{\\partial \\ell}{\\partial \\gamma}=\\sum\_{i=1}^{m}\\frac{\\partial \\ell}{\\partial y\_i}\\,\\hat x\_i,\\qquad \\frac{\\partial \\ell}{\\partial \\beta}=\\sum\_{i=1}^{m}\\frac{\\partial \\ell}{\\partial y\_i}\\\]

At inference the output should depend only on the input, so the mini-batch statistics are replaced by population statistics. The mean is the average of the batch means over training mini-batches, and the variance is the unbiased estimate m/(m-1) times the average of the batch variances. \\\[\\hat x=\\frac{x-E\[x\]}{\\sqrt{\\mathrm{Var}\[x\]+\\epsilon}}\\\]

Once these statistics are fixed, normalization is a linear map of each activation, and it can be merged with the scale and shift into one affine transform. \\\[y=\\frac{\\gamma}{\\sqrt{\\mathrm{Var}\[x\]+\\epsilon}}\\,x+\\left(\\beta-\\frac{\\gamma\\,E\[x\]}{\\sqrt{\\mathrm{Var}\[x\]+\\epsilon}}\\right)\\\]

## Placing the transform in convolutional layers

A layer is written as an affine map followed by a nonlinearity, \\(z=g(Wu+b)\\), and the transform is inserted on the affine output \\(x=Wu+b\\), before \\(g\\). The layer input is usually the output of another nonlinearity, so its distribution keeps changing in shape, whereas \\(Wu+b\\) tends to be more symmetric and less sparse, which makes its normalized distribution more stable.

Because the mean subtraction cancels the bias, the bias \\(b\\) can be dropped, and the role of the bias passes to \\(\\beta\\). \\\[z=g(BN(Wu))\\\]

In convolutional layers the statistics are pooled over the mini-batch and all spatial positions of a feature map, so for a mini-batch of size m and maps of size p by q the effective size is m' = m p q. One pair of \\(\\gamma\\) and \\(\\beta\\) is learned per feature map rather than per activation, and at inference the same linear transform is applied to every activation in a feature map.

## Scale, gradients and regularization

For a scalar a, the authors write BN(Wu) = BN((aW)u), so the normalized output does not depend on the weight scale, and the layer Jacobian with respect to u is unchanged. The identity assumes the constant \\(\\epsilon\\) is negligible. With \\(\\epsilon\\) in the denominator, the variance scales with a squared, and that is not the same as multiplying the normalized value by a.

Large learning rates can grow the weights, and with normalization a growing scale no longer amplifies the gradient through the layer. Larger weights lead to smaller gradients, and normalization stabilizes the growth of the parameters.

The authors conjecture that normalization keeps the singular values of the layer Jacobians near 1, which is considered beneficial for training. Their argument assumes that the normalized inputs and outputs are Gaussian and uncorrelated and that the layer map is linear, and they note that none of these conditions holds exactly. \\\[JJ^T=I\\\]

A training example is normalized together with the other examples in its mini-batch, so its output varies with the batch it is in. The authors found this variation advantageous for generalization, and they report that Dropout can be removed or reduced in strength in a batch-normalized network.

## Activation distributions and accuracy on MNIST

The first experiment classifies MNIST digits from 28x28 binary images with a network of three fully-connected hidden layers of 100 sigmoid activations each. The output layer has 10 activations with cross-entropy loss, the network was trained for 50000 steps, and each mini-batch had 60 examples.

Batch Normalization is added to each hidden layer, and the comparison is between this baseline and the batch-normalized version, not a state-of-the-art MNIST model. The figure shows held-out test accuracy against training steps, and the batch-normalized network has the higher test accuracy; the paper gives no numeric accuracy for this experiment.

To look at the cause, the authors tracked one typical sigmoid input from the last hidden layer at the 15th, 50th and 85th percentiles. In the original network its mean and variance change significantly over training, while in the batch-normalized network the distribution is much more stable.

## Speeding up an Inception variant on ImageNet

The experiments use a new Inception variant trained on the 1000 classes of ImageNet, in which each 5x5 convolution is replaced by two stacked 3x3 convolutions with up to 128 filters. The network has 13.6·106 parameters and no fully-connected layers apart from the top softmax, and it is trained with SGD with momentum and a mini-batch size of 32.

Single-crop validation accuracy @1 is the metric throughout. The Inception architecture that the experiments start from is laid out in the appendix figure.

In every variant Batch Normalization is applied to the input of each nonlinearity, while the rest of the architecture is kept. The accelerated variants also raise the learning rate, remove Dropout, reduce the L2 weight regularization by a factor of 5, decay the learning rate six times faster, remove Local Response Normalization, use within-shard shuffling and reduce photometric distortions.

These changes are applied together, so the paper isolates a separate effect only for the shuffling step.

Inception needed 31.0·106 training steps to reach 72.2%. BN-Baseline needed 13.3·106 steps to reach 72.2% and reached a maximum of 72.7%, and BN-x5 needed 2.1·106 steps with a maximum of 73.0%. BN-x5 needs 14 times fewer steps than Inception to reach 72.2%.

Batch Normalization alone, in BN-Baseline, matches the accuracy of Inception in less than half the number of training steps. BN-x5-Sigmoid reached 69.8% maximum accuracy, while Inception with sigmoid nonlinearity never achieved better than 1/1000 accuracy without Batch Normalization. Within-shard shuffling of the training data gave about a 1% improvement in validation accuracy, which the authors connect to Batch Normalization acting as a regularizer.

## Ensemble results against earlier ImageNet bests

The ensemble has 6 networks, each based on BN-x30 and modified in some of the following ways: increased initial weights in the convolutional layers, Dropout with a probability of 5% or 10% instead of 40%, and non-convolutional per-activation Batch Normalization in the last hidden layers. Each network reached its maximum accuracy after about 6·106 training steps, and the ensemble prediction is the arithmetic average of the class probabilities of its constituent networks.

In the comparison table the BN-Inception single crop has 7.82% top-5 error, the BN-Inception multicrop with 144 crops has 5.82%, and the BN-Inception ensemble with 6 models has 4.9% on the 50000-image validation set.

## How it differs from the standardization layer

The authors note a similarity to the standardization layer of Gülçehre and Bengio (2013), though the two methods have different goals and perform different tasks. Batch Normalization aims at a stable distribution of activations and is applied before the nonlinearity, while the standardization layer is applied to the output of the nonlinearity, which yields sparser activations.

The authors report that they did not observe sparse nonlinearity inputs in their large-scale experiments, with or without Batch Normalization.

Batch Normalization also has a learned scale and shift that let the transform represent the identity, handles convolutional layers, gives deterministic inference that does not depend on the mini-batch, and normalizes each convolutional layer.

## Limitations

The precise effect of Batch Normalization on gradient propagation is not established, and the authors describe it as an area of further study. The singular-value argument remains a conjecture built on Gaussian, uncorrelated and linear assumptions.

The MNIST network is deliberately modest, and the authors say the architecture does not reach state-of-the-art MNIST performance. The activation evidence is one typical sigmoid activation from the last hidden layer.

The ImageNet speedups come from several changes applied together to an Inception variant, and only the shuffling step has its own reported effect of about 1%. The ensemble test error comes from the ILSVRC test server, while the 4.9% figure is on the 50000-image validation set.

Applications to Recurrent Neural Networks, domain adaptation and further theoretical analysis are left as future work.

## Paper info

- **Authors**: Sergey Ioffe, Christian Szegedy
- **Venue**: arXiv · Preprint
- **First published**: 2015-2-11
- **Added**: 2026-10-20
- **Updated**: 2015-3-2
- **Version**: v3
- **arXiv**: 1502.03167
- **Category**: cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1502.03167v3) · [PDF ↗](https://arxiv.org/pdf/1502.03167v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Sergey Ioffe, Christian Szegedy (2015). Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. arXiv:1502.03167v3. https://arxiv.org/abs/1502.03167v3

**BibTeX**

```
@misc{ioffe2015batch,
  title = {{Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift}},
  author = {Sergey Ioffe and Christian Szegedy},
  year = {2015},
  eprint = {1502.03167},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1502.03167v3}
}
```

## Other paper commentary

- [Instance Normalization: The Missing Ingredient for Fast Stylization](https://refivu.com/en/papers/d30fae5e-d1ad-4ef1-9b41-da9a7a9f25cf-instance-normalization-the-missing-ingredient-for-fast.md)
- [Group Normalization](https://refivu.com/en/papers/73ea525c-b90c-43b2-b656-bb21666ab914-group-normalization.md)
- [Layer Normalization](https://refivu.com/en/papers/2f67f179-7720-4b69-8cac-e7157bee38ae-layer-normalization.md)
- [Root Mean Square Layer Normalization](https://refivu.com/en/papers/97c61522-5940-4a28-ad7d-4126a3ce8c01-root-mean-square-layer-normalization.md)
- [Expectile Regularization for Fast and Accurate Training of Neural Optimal Transport](https://refivu.com/en/papers/eed71a11-0424-45c6-8f8e-e7d5e94053d5-expectile-regularization-for-fast-and-accurate-training-of.md)
- [Observational Scaling Laws and the Predictability of Langauge Model Performance](https://refivu.com/en/papers/97beb965-1477-4864-b69f-e363cc2d64d9-observational-scaling-laws-and-the-predictability-of.md)
- [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://refivu.com/en/papers/037751cf-a504-48c3-b08a-868e3ab40b26-bert-pre-training-of-deep-bidirectional-transformers-for.md)
- [Attention Is All You Need](https://refivu.com/en/papers/9645c9a1-cc92-404a-bc65-1ec437b1deab-attention-is-all-you-need.md)
- [FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning](https://refivu.com/en/papers/177a3817-56f7-448e-964a-a2e688dc7c81-flashattention-2-faster-attention-with-better-parallelism.md)
- [LoRA: Low-Rank Adaptation of Large Language Models](https://refivu.com/en/papers/fec4f8e4-2771-4948-a986-0295db47b321-lora-low-rank-adaptation-of-large-language-models.md)

## Terms in this paper

- [MNIST](https://refivu.com/en/terms/28b9bb66d1c6-mnist)
- [dropout](https://refivu.com/en/terms/db73f75bbdd3-dropout)
- [Stochastic Gradient Descent](https://refivu.com/en/terms/a49650824022-stochastic-gradient-descent)
- [Batch Normalization](https://refivu.com/en/terms/2b3e5f8509f6-batch-normalization)
- [ReLU](https://refivu.com/en/terms/7b22f5612f6c-relu)
- [top-5 error](https://refivu.com/en/terms/beb42c9fbaad-top-5-error)
- [covariate shift](https://refivu.com/en/terms/999984d6d515-covariate-shift)
- [Internal Covariate Shift](https://refivu.com/en/terms/fc4b6c94e2db-internal-covariate-shift)
- [mini-batch](https://refivu.com/en/terms/9f99ad29cdea-mini-batch)
- [whitening](https://refivu.com/en/terms/144b48a44636-whitening)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/bd3e1105-da91-407a-8b28-4217cd2afedf-batch-normalization-accelerating-deep-network-training-by)
