Towards Understanding Dual BN In Hybrid Adversarial Training

Chenshuang Zhang, Chaoning Zhang, Kang Zhang, Axi Niu, Junmo Kim, In So Kweon

Abstract

Hybrid Adversarial Training (Hybrid-AT) typically employs Dual Batch Normalization (Dual BN) to maintain performance on both clean and adversarial samples. While conventional wisdom attributes the success of Dual BN to its ability to bridge a significant "domain gap" in normalization statistics, this work demonstrates that the statistical difference is relatively minor. Instead, the effectiveness of Dual BN stems from providing separate learnable affine parameters for the distinct tasks of accuracy and robustness. By reframing Hybrid-AT as a multi-task learning problem rather than a domain adaptation problem, we provide new insights into the mechanics of robust model training.

Introduction

Adversarial Training (AT) is a cornerstone of robust deep learning, yet training models on a mixture of clean and adversarial data—known as Hybrid-AT—often leads to a performance trade-off. To mitigate this, Dual BN has become a standard architectural choice, utilizing separate Batch Normalization layers for each data type. The prevailing theory suggested that clean and adversarial images belong to disparate statistical domains, necessitating disentangled normalization. This paper challenges that assumption, investigating whether the "domain gap" is the true driver of Dual BN's success.

Methods

The researchers deconstructed the Batch Normalization layer into its two core components: Normalization Statistics (NS), consisting of the mean $\mu$ and variance $\sigma$, and Affine Parameters (AP), consisting of the learnable weight $\gamma$ and bias $\beta$. To isolate the impact of each, several experimental setups were designed:

  1. Cross-BN: Adversarial samples were normalized using statistics derived from clean samples, and vice versa. If the domain gap were the primary issue, this setup would fail.
  2. Untwining NS and AP: The authors tested configurations where statistics were shared while affine parameters were separate, and vice versa, to identify which component drives robustness.
Diagram of different BN configurations used to untwine normalization statistics from affine parameters.

These setups, illustrated above, allow for a granular analysis of which component—the statistics or the learnable parameters—is responsible for the performance gains observed in Dual BN.

Key Insights and Ideas

  • The "Domain Gap" is an Illusion: When controlling for affine parameters, the statistical difference between clean and adversarial images is actually quite small—comparable to the difference between clean images and those with random noise.
  • Affine Parameters are the Key: The most significant finding is that high robustness can be achieved even when using mixed statistics, as long as the model utilizes two sets of affine parameters. The $\gamma$ and $\beta$ are what truly characterize the model's robustness during both training and inference.
  • From Two Domains to Two Tasks: The authors argue for reframing Hybrid-AT as a multi-task learning problem (accuracy vs. robustness) rather than a domain adaptation problem. This explains why methods like TRADES, which regularize the two tasks to work together, are so effective.

Key Results

The experimental results strongly support the multi-task hypothesis. In the Cross-Hybrid-AT experiments, using the "wrong" domain's statistics resulted in nearly identical performance to standard Dual BN (e.g., ~22.4% AutoAttack accuracy vs ~22.5%).

Clean accuracy and robustness curves over training epochs for baseline and Cross-AT methods.

As shown in the figure above, the Cross-AT approach tracks closely with the baseline Dual BN performance across different perturbation levels ($\epsilon$). Furthermore, in "untwining" tests, using two sets of AP with shared statistics maintained high robustness (~23.4% AA accuracy), while using two sets of statistics with shared AP saw a significant drop to ~10.6% AA accuracy.

Conclusion

This work deconstructs the long-held belief that Dual BN works by bridging a massive statistical domain gap. Instead, it highlights the role of affine parameters as task-specific adapters. This shift in perspective—from domain adaptation to multi-task learning—opens new avenues for designing efficient robust architectures, such as adding simple learnable adapters to non-BN architectures like Vision Transformers (ViT).

Summary updated

BibTeX
@article{zhang2024towards,
  author = {Chenshuang Zhang and Chaoning Zhang and Kang Zhang and Axi Niu and Junmo Kim and In So Kweon},
  title = {{Towards Understanding Dual BN In Hybrid Adversarial Training}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2024},
  url = {https://openreview.net/forum?id=Wv415zsrj4},
}
Figure