Stochastic Whitening Batch Normalization

Shengdong Zhang, Ehsan Nezhadarya, Homa Fashandi, Jiayi Liu, Darin Graham, Mohak ShahCVPR 2021

Abstract

Stochastic Whitening Batch Normalization (SWBN) is a highly efficient, drop-in replacement for standard Batch Normalization (BN) that decorrelates neural network activations in an online fashion. Unlike traditional whitening methods that rely on computationally expensive matrix decompositions, SWBN gradually learns a whitening matrix through stochastic gradient descent. This approach effectively addresses Internal Covariate Shift (ICS) while achieving better generalization and faster training speeds than previous whitening techniques.

Introduction

Training Deep Neural Networks (DNNs) is often hindered by Internal Covariate Shift (ICS), where the distribution of a layer's inputs changes as preceding parameters are updated. While Batch Normalization (BN) has become the standard solution, it primarily addresses the mean and variance of activations, leaving them potentially highly correlated.

Research indicates that whitening—transforming activations to have unit variance and zero correlation—can further accelerate training and improve model generalization. However, traditional whitening methods are computationally intensive, often requiring Eigen-decomposition, Singular Value Decomposition (SVD), or iterative methods like Newton's method (e.g., IterNorm). These operations create significant bottlenecks, especially in deep architectures. SWBN is proposed as a solution that provides the benefits of whitening with minimal computational overhead.

Methods

The primary innovation of Stochastic Whitening Batch Normalization (SWBN) is treating whitening as an online learning problem rather than an exact calculation performed at every step.

The SWBN Layer architecture showing decoupled updates for whitening and task parameters.

Decoupled Updates and Stochastic Learning

SWBN separates the learning of whitening parameters from the standard backpropagation of the task loss. Specifically, whitening parameters are updated during the forward pass, while task parameters (scaling and shifting) are updated during the backward pass. Instead of recomputing a whitening matrix for every mini-batch, SWBN maintains an internal matrix $W$ and updates it incrementally using a small step size ($\alpha$). This "online" approach allows the model to carry information across consecutive training steps, leading to greater stability and efficiency.

Whitening Criteria

The authors introduce two distinct loss functions to optimize the whitening matrix:

  1. $C_{KL}$: Based on Kullback–Leibler divergence, assuming Gaussian distributions.
  2. $C_{Fro}$: Based on the Frobenius norm, which directly measures the distance between the current covariance and the identity matrix.

Because SWBN decouples the whitening process from the task gradient, it serves as a seamless drop-in replacement for any BN layer without requiring architectural modifications.

Experimental Evaluation

The authors evaluated SWBN across a variety of computer vision benchmarks, including CIFAR-10, CIFAR-100, and ILSVRC-2012 (ImageNet), as well as few-shot learning tasks on CIFAR-FS and mini-ImageNet. Architectures tested included VGG, ResNetV2, Wide ResNet, and ResNeXt.

Performance and Scalability

SWBN consistently outperformed standard BN across multiple metrics. For instance, on CIFAR-100 using a ResNetV2-164, SWBN-KL achieved 76.13% accuracy compared to the BN baseline of 75.56%. On large-scale tasks like ImageNet with ResNeXt-101, SWBN-KL improved Top-1 accuracy from 78.8% to 79.39%.

In terms of computational efficiency, SWBN showed a significant advantage over IterNorm. On a ResNetV2-164 model, SWBN-KL reduced the training time per epoch from 187 seconds (IterNorm) to 123 seconds. This efficiency stems from using simple update rules that reduce the leading computational complexity term by approximately five times compared to iterative methods.

Visualizing the Whitening Effect

The effectiveness of SWBN in decorrelating activations is visually evident when examining the correlation matrices of layer outputs over time.

Correlation matrices at Epoch 0 and Epoch 150 for BN, SWBN-KL, and SWBN-Fro, demonstrating the superior decorrelation achieved by SWBN.

As shown in Figure 4, while standard BN leaves significant correlations between features, both variants of SWBN successfully drive the off-diagonal elements of the correlation matrix toward zero by the end of training.

Key Insights

  • The "Slight" Whitening Effect: The authors observed that "partial" whitening—where the matrix is not perfectly solved in a single step—can actually improve generalization. The noise introduced by this gradual, stochastic estimation acts as a form of regularization.
  • Memory Efficiency: Unlike IterNorm, which requires storing multiple intermediate matrices for gradient computation during backpropagation, SWBN only needs to store a single whitening matrix $W$ per layer.

Conclusion

Stochastic Whitening Batch Normalization offers a practical and efficient alternative to standard BN and existing whitening techniques. By leveraging online stochastic updates, it provides the benefits of feature decorrelation with significantly reduced computational and memory overhead. Future work may explore adaptive step sizes or alternative whitening criteria to further enhance the stability and performance of the algorithm.

Summary updated

BibTeX
@inproceedings{zhang2021stochastic,
  author = {Shengdong Zhang and Ehsan Nezhadarya and Homa Fashandi and Jiayi Liu and Darin Graham and Mohak Shah},
  title = {{Stochastic Whitening Batch Normalization}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01083},
}
Figure