Differentiable Learning-to-Normalize via Switchable Normalization

Ping Luo, Jiamin Ren, Zhanglin Peng

Introduction

Normalization techniques are fundamental to the success of deep neural networks, facilitating faster convergence and improved generalization. However, the choice of normalization—such as Batch Normalization (BN), Instance Normalization (IN), or Layer Normalization (LN)—is often task-dependent and sensitive to hyperparameters like batch size. For instance, while BN is the standard for ImageNet classification, it performs poorly with small minibatches and is often replaced by IN for style transfer or LN for recurrent networks. This fragmentation necessitates a more flexible, automated approach to normalization.

Switchable Normalization (SN)

The authors propose Switchable Normalization (SN), a differentiable framework that learns to combine multiple normalization statistics. Instead of committing to a single scope, SN computes the mean ($\mu$) and variance ($\sigma^2$) as a weighted average of statistics from three different scopes:

  • Instance (IN): Computes statistics per channel for each sample.
  • Layer (LN): Computes statistics across all channels for each sample.
  • Minibatch (BN): Computes statistics across the minibatch for each channel.

The integrated statistics are defined as a weighted sum of the individual scope statistics, where the importance weights are learned during training via backpropagation using a softmax function. This allows the network to adapt its normalization strategy per layer and per task.

Key Insights: Task-Specific Preferences

A significant finding of this work is that different computer vision tasks exhibit distinct preferences for normalization scopes. By visualizing the learned weights, the authors show that tasks like image style transfer rely almost exclusively on IN, whereas the "box head" in object detection architectures favors LN.

Learned importance weights of BN, IN, and LN across various computer vision tasks.

This empirical evidence supports the idea that a "one-size-fits-all" normalization strategy is suboptimal. SN effectively automates the selection process, allowing different layers within the same network to utilize different statistical scopes.

Performance and Robustness

SN demonstrates remarkable robustness to varying batch sizes, a common pain point for standard BN. In large-batch settings, SN matches or exceeds the performance of BN. However, as the batch size decreases, SN maintains high accuracy by automatically reducing the weight of the noisy BN statistics in favor of the more stable IN and LN components.

Top-1 accuracy on ImageNet with varying batch sizes (number of GPUs, samples per GPU).

On ImageNet, SN achieves 76.9% top-1 accuracy with ResNet-50, outperforming BN (76.4%) and Group Normalization (75.9%). In extreme "small batch" scenarios (e.g., 2 images per GPU), SN achieves 75.6% accuracy, whereas BN's performance collapses to 65.3%. Beyond classification, SN provides consistent gains in object detection (COCO) and semantic segmentation (ADE20K, Cityscapes), often outperforming specialized variants like Synchronized BN.

Conclusion

Switchable Normalization offers a unified, differentiable solution to the normalization selection problem. By learning to weight different statistical scopes, SN provides a robust and versatile alternative to manual selection. It eliminates the need for task-specific normalization tuning and ensures high performance across a wide range of batch sizes and architectural configurations.

Summary updated

BibTeX
@inproceedings{luo2019differentiable,
  author = {Ping Luo and Jiamin Ren and Zhanglin Peng},
  title = {{Differentiable Learning-to-Normalize via Switchable Normalization}},
  booktitle = {International Conference on Learning Representations},
  year = {2019},
  url = {https://openreview.net/forum?id=pVA_3oFJrF},
}
Figure