Introduction
Batch Normalization (BN) has become an indispensable component of modern deep neural networks (DNNs), facilitating faster convergence and improved stability. However, the computational cost of BN is often overlooked. This paper presents Batch Normalization Sampling, a technique that leverages statistical sampling to estimate batch statistics, significantly reducing the computational overhead of BN with minimal impact on model accuracy.
The Computational Cost of Batch Normalization
The primary bottleneck in BN arises from "reduction operations"—the calculation of means and variances across large mini-batches. On modern GPU architectures, these operations are expensive due to high memory overhead and data dependencies that hinder parallel processing.
As shown in the table within the figure above, standard BN can reduce training speed by over 30% to 40% across various models. Furthermore, standard BN becomes unreliable in "micro-batch" scenarios where memory constraints limit batch sizes, leading to poor statistical estimation and degraded performance.
Proposed Sampling Strategies
To address these issues, the authors propose treating BN as a statistical sampling problem. Instead of computing statistics over the entire batch, they estimate them using a representative subset. Three primary strategies are introduced:
- Batch Sampling (BS): Randomly selects a subset of full samples from each mini-batch.
- Feature Sampling (FS): Randomly selects small spatial patches from every feature map across all samples.
- Virtual Dataset Normalization (VDN): Uses synthetic random samples, generated from offline dataset statistics, to stabilize the normalization process.
The researchers found that Feature Sampling (FS) is particularly effective because spatial locations within an image are often highly correlated. By sampling across different spatial locations, FS provides a more accurate estimation of the true mean and variance with significantly less data. To maintain hardware efficiency, the authors use static sampling indices, updating them only once per epoch to allow for graph optimization in frameworks like TensorFlow.
Experimental Results
The proposed methods were validated on benchmarks including CIFAR-10/100 and ImageNet using ResNet and DenseNet architectures. Key findings include:
- Speedup: A total training time speedup of up to 20% on GPUs, with BN layers themselves accelerated by up to 2x.
- Accuracy: On ImageNet (ResNet-18), the "FS+VDN" strategy maintained accuracy within 0.2% of the baseline while using only a tiny fraction (1.6% to 3%) of the data for normalization.
- Micro-batch Performance: VDN outperformed Group Normalization (GN) in small batch scenarios, achieving a lower validation error on ImageNet (30.88% vs 30.96%).
Conclusion
Batch Normalization Sampling offers a practical way to reclaim the performance lost to reduction operations in DNNs. By intelligently sampling data, researchers can achieve significant training speedups without requiring specialized hardware or custom CUDA kernels. Future work may involve automated tuning of sampling ratios and further optimization for specific GPU memory architectures.
Summary updated