Abstract
Batch Normalization (BatchNorm) is effective for improving the performance and accelerating the training of deep neural networks. However, it has also shown to be a cause of adversarial vulnerability, i.e., networks without it are more robust to adversarial attacks. In this paper, we investigate how BatchNorm causes this vulnerability and proposed new normalization that is robust to adversarial attacks. We first observe that adversarial images tend to shift the distribution of BatchNorm input, and this shift makes train-time estimated population statistics inaccurate. We hypothesize that these inaccurate statistics make models with BatchNorm more vulnerable to adversarial attacks. We prove our hypothesis by replacing train-time estimated statistics with statistics calculated from the inference-time batch. We found that the adversarial vulnerability of BatchNorm disappears if we use these statistics. However, without estimated batch statistics, we can not use BatchNorm in the practice if large batches of input are not available. To mitigate this, we propose Robust Normalization (RobustNorm); an adversarially robust version of BatchNorm. We experimentally show that models trained with RobustNorm perform better in adversarial settings while retaining all the benefits of BatchNorm.
The BatchNorm Security Hole
Deep neural networks are notoriously fragile. A tiny, human-imperceptible amount of targeted noise—an adversarial attack—can cause a state-of-the-art model to misclassify an image with high confidence. Recent research has pointed an accusatory finger at Batch Normalization (BN). While BN is essential for training stability and speed, models without it seem to be naturally more robust.
The authors identify that the "devil is in the moving average." During training, BatchNorm calculates the mean and variance of each batch. During inference, it uses a running average of those statistics calculated from the clean training data. Adversarial attacks act as a targeted distribution shift; because BatchNorm expects data to look like the training set, it fails to "correct" the distribution of adversarial inputs, leading to high-confidence misclassifications.
Methods: From Hypothesis to RobustNorm
To prove that fixed population statistics are the problem, the authors performed an experiment replacing the "stale" population statistics with the statistics of the actual adversarial batch being processed at inference time. They found that simply using batch statistics at inference time causes the adversarial vulnerability of BatchNorm to almost entirely disappear. For example, on MNIST, BIM attack accuracy jumped from 7.7% to 69.3% just by switching to batch statistics—no extra training required.
Building on this insight, they propose RobustNorm (RN). Instead of using variance ($\sigma$), which can be easily skewed by outliers, they use the range ($r_B = \text{max} - \text{min}$) of the activations. They define RobustNorm as: $$y_i = \frac{x_i - \mu_B}{r_B^p}$$ where $p$ is a tunable "norm power" hyperparameter. This approach allows the network to suppress high-intensity adversarial activations more effectively than standard variance-based normalization.
Experimental Results
The authors validated RobustNorm across standard benchmarks including MNIST, CIFAR-10, CIFAR-100, and ImageNet using various architectures like ResNet and VGG.
Key findings include:
- Massive Robustness Gains: On CIFAR-10 using a ResNet20, RobustNorm increased adversarial accuracy from roughly 22% to 70% compared to standard BatchNorm.
- Maintaining Clean Accuracy: Unlike many defensive techniques that trade off performance on clean images for safety, RobustNorm retains most of the training speed and accuracy benefits of standard BatchNorm.
- Scalability to ImageNet: On the massive ImageNet dataset, RobustNorm outperformed BatchNorm across all tested attacks (FGSM, BIM, MIM, PGD) by a significant margin, with PGD accuracy improving from 4.4% to 19.0%.
Limitations and Future Work
While RobustNorm offers a significant security upgrade, it shares some limitations with standard BatchNorm. It is sensitive to batch size; performance is best when the inference batch size is reasonably large, as calculating a meaningful range or mean becomes difficult with a batch size of one. Additionally, the "norm power" ($p$) requires tuning to balance convergence speed and adversarial robustness. Future work may explore applying these range-based insights to other normalization techniques like LayerNorm or GroupNorm.
Summary updated