Papers · arXiv 1502.03167
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
Summary in three lines
- 🎯 Deep network training is slowed down by internal covariate shift—the continuous shift in layer input distributions caused by parameter updates in previous layers.
- 🔧 Introduces Batch Normalization (BN), an architectural layer that standardizes mini-batch activations to zero mean and unit variance, followed by a learned affine scale and shift (γ and β).
- 📈 Matches the 72.2% validation accuracy of an Inception baseline in 14x fewer steps and reaches 4.82% top-5 error on ImageNet test data with an ensemble.
Abstract
Training Deep Neural Networks is complicated by the fact that the distribution of each layer's inputs changes during training, as the parameters of the previous layers change. This slows down the training by requiring lower learning rates and careful parameter initialization, and makes it notoriously hard to train models with saturating nonlinearities. We refer to this phenomenon as internal covariate shift, and address the problem by normalizing layer inputs. Our method draws its strength from making normalization a part of the model architecture and performing the normalization for each training mini-batch. Batch Normalization allows us to use much higher learning rates and be less careful about initialization. It also acts as a regularizer, in some cases eliminating the need for Dropout. Applied to a state-of-the-art image classification model, Batch Normalization achieves the same accuracy with 14 times fewer training steps, and beats the original model by a significant margin. Using an ensemble of batch-normalized networks, we improve upon the best published result on ImageNet classification: reaching 4.9% top-5 validation error (and 4.8% test error), exceeding the accuracy of human raters.
Reading guide
Problem and motivation
During deep network optimization with SGD, changes in earlier layer parameters alter the distribution of inputs to subsequent layers. The authors term this phenomenon Internal Covariate Shift.
Internal covariate shift creates two primary challenges:
- Sub-networks must continuously adapt to shifting activation distributions.
- Activations readily drift into the saturating regimes of nonlinearities (such as sigmoid functions), causing vanishing gradients and requiring small learning rates and meticulous parameter initialization.
While whitening (decorrelating and standardizing) layer inputs across the entire dataset could stabilize distributions, computing full covariance matrices and their inverse square roots at every parameter update is computationally prohibitive and can cause gradients to blow up if normalization is not integrated into backpropagation.
Key ideas
- Differentiable Normalization Layer: Instead of standardizing activations outside optimization, normalization is integrated directly into the model architecture, ensuring backpropagation accounts for the dependencies between layer activations and mini-batch statistics.
- Per-Dimension Normalization: Rather than full joint whitening, each scalar feature dimension is normalized independently to zero mean and unit variance.
- Restoring Representational Capacity: To ensure normalization does not destroy the expressive capability of a layer (such as forcing a sigmoid into purely linear behavior), learnable parameters (scale) and (shift) are introduced to allow the layer to recover the identity transformation if needed.
- Deterministic Inference: During training, statistics are calculated over each mini-batch . At test time, fixed population statistics (computed via running averages or across training batches) replace mini-batch statistics, ensuring deterministic single-sample inference.
- Parameter Scale Invariance: Scale transformations of layer weights satisfy , meaning larger weights lead to smaller effective gradients, preventing gradient explosion.
Method (with the key equations)
For a mini-batch corresponding to a single activation dimension:
- Compute the mini-batch mean:
- Compute the mini-batch variance:
- Normalize activations (with stability constant ):
- Scale and shift using learnable parameters and :
Application to Layers
- Placement: Applied immediately before nonlinearities: . The original layer bias is omitted because mean subtraction cancels it (its role is subsumed by ).
- Convolutional Layers: To preserve the translation equivariance property, normalization is applied per feature map rather than per spatial activation. For batch size and spatial resolution , the effective mini-batch size becomes , with a single pair of shared across each feature map.
Inference Transformation
At test time, the transformation becomes a static linear operation using population statistics and :
Results (with the most important numbers)
- MNIST with Sigmoids: Networks equipped with Batch Normalization retained stable activation distributions across training, accelerating convergence and reaching higher test accuracy compared to unnormalized networks.
- ImageNet Training Speed (Single Network):
- Unnormalized Inception reached 72.2% validation accuracy after steps.
- Baseline Batch-Normalized Inception reached 72.2% in steps.
- With a 5x higher learning rate (BN-x5), it reached 72.2% in steps—a 14-fold reduction in required training steps, ultimately peaking at 73.0%.
- With a 30x higher learning rate (BN-x30), the model reached 74.8% maximum accuracy after steps.
- Saturating Nonlinearities: While unnormalized Inception with sigmoid activations failed to train (staying near 0.1% chance accuracy), BN-x5-Sigmoid achieved 69.8% top-1 accuracy.
- ImageNet SOTA Ensemble: An ensemble of 6 batch-normalized networks achieved a top-5 validation error of 4.9% and a test error of 4.82% on the ILSVRC test server, outperforming human rater baselines.
Limitations and open questions
- Batch Size Dependency: Because normalization relies on mini-batch sample statistics, very small mini-batch sizes may degrade the quality of variance and mean estimations.
- Recurrent Networks: The paper tests feedforward and convolutional models, identifying recurrent neural networks (RNNs) as an untested open question where internal covariate shift may also be critical.
- Theoretical Underpinnings: The authors conjecture that Batch Normalization causes layer Jacobians to have singular values close to 1, but noted that precise theoretical verification of gradient behavior remains open for future analysis.
Key terms
- Internal Covariate Shift
- The change in the distribution of internal network activations during training caused by parameter updates in preceding layers.
- Batch Normalization
- A mechanism that standardizes mini-batch layer inputs to zero mean and unit variance before scaling and shifting them with learned parameters.
- Scale and Shift Parameters (γ and β)
- Learnable parameters per activation that can restore the network's expressive capacity, including the ability to represent the identity transform.
- Whitening
- A transformation of inputs to produce zero mean, unit variance, and mutually decorrelated feature dimensions.
- Batch Normalizing Transform
- The exact differentiable algorithm that computes mini-batch mean and variance, normalizes the inputs, and applies learned affine scaling and shifting.
- Population Statistics
- The aggregate expected mean and unbiased variance tracked across training mini-batches to freeze normalization parameters for deterministic inference.
- Feature Map Normalization
- Applying normalization jointly over mini-batch elements and spatial locations so all activations within a convolutional feature map share statistics and affine parameters.
Questions
Where is Batch Normalization applied relative to activations and biases?
It is applied immediately before the nonlinearity (). The bias parameter of the preceding linear transformation is omitted because mean subtraction cancels it, leaving to serve the role of bias.
How does Batch Normalization behave differently during training versus inference?
During training, mean and variance are calculated directly over the current mini-batch to standardize activations. During inference, these are replaced with fixed population statistics (unbiased moving averages across training batches), converting the layer into a static linear transform.
Why does Batch Normalization allow higher learning rates?
Normalizing activations prevents small parameter changes from escalating into saturating regimes or exploding gradients. Furthermore, the gradient backpropagated through a layer is scale-invariant with respect to weights: larger weights yield smaller proportional gradients, preventing instability.
Can Batch Normalization replace Dropout?
Yes, in many setups. Because an individual sample's normalized activation depends on the other random examples present in the mini-batch, it injects stochastic noise that serves as an effective regularizer, allowing Dropout to be reduced or removed.
The overview on this page was written by AI from the paper and may contain mistakes. Read the paper for the details.