Frequency Regularization for Improving Adversarial Robustness

Binxiao Huang, Chaofan Tao, Rui Lin, Ngai WongarXiv 2022 · DOI

Abstract

Adversarial training (AT) is the primary defense against adversarial perturbations in Deep Neural Networks (DNNs), yet it frequently results in a significant degradation of standard accuracy. This paper investigates this trade-off through a frequency-domain analysis, revealing that robust models exhibit a distinct bias toward low-frequency information. We propose Frequency Regularization (FR) to align the spectral outputs of clean and adversarial inputs, alongside Stochastic Weight Averaging (SWA) to promote kernel smoothness. Our combined approach, AT-FR-SWA, achieves state-of-the-art robustness on CIFAR-10 while mitigating the performance loss on natural images.

Introduction

Deep Neural Networks are highly susceptible to adversarial attacks—small, human-imperceptible perturbations that lead to incorrect classifications. While Adversarial Training (AT) effectively hardens models against these attacks, it introduces a "robustness-accuracy trade-off." Models trained to be robust often lose the ability to generalize to high-frequency features that are useful for standard classification but vulnerable to noise. This research explores the spectral characteristics of this phenomenon and introduces a regularization framework to bridge the gap between standard and robust performance.

The Frequency Lens on Robustness

A core finding of this work is the "Low-Frequency Bias" inherent in robust models. By applying low-pass filters to input data, we observe that robust models rely almost exclusively on low-frequency components, effectively ignoring the high-frequency details that natural models utilize for high precision.

This bias is reflected in the architecture itself. Natural models often possess "jittery" convolutional kernels that are sensitive to high-frequency noise. In contrast, robust models naturally develop smoother, more blurred kernels. This smoothness acts as a form of implicit regularization against high-frequency adversarial perturbations.

Comparison of convolutional kernels between natural and robust models, illustrating the smoothness characteristic of robust filters.

Methodology

To leverage these insights, we introduce two complementary techniques:

1. Frequency Regularization (FR)

Since adversarial noise is often concentrated in low-frequency regions to exploit the model's attention, we propose aligning the model's internal representations. FR adds a penalty term to the loss function that minimizes the distance between the Discrete Fourier Transform (DFT) of the model's outputs for clean and adversarial pairs. By forcing the model to maintain consistent spectral signatures, we reduce its sensitivity to adversarial shifts.

2. Stochastic Weight Averaging (SWA)

To further encourage the development of robust, smooth kernels, we employ SWA. By averaging model weights over the final stages of training, we achieve a temporal smoothing effect. This prevents the model from over-fitting to specific high-frequency noise patterns encountered during the adversarial generation process, leading to better generalization.

Experimental Results

We evaluated our methods on the CIFAR-10 dataset using ResNet18 and WideResNet-34-10 architectures. Our results demonstrate that the combination of FR and SWA significantly outperforms standard AT baselines.

Training curves showing standard accuracy (SA) and robust accuracy (RA) for various training configurations. The FR&SWA approach (purple) shows superior robust performance.

As shown in the training curves, the integration of Frequency Regularization and SWA leads to a marked increase in Robust Accuracy (RA) without the typical steep decline in Standard Accuracy (SA). On a WideResNet-34-10, our AT-FR-SWA method achieved a PGD-20 robust accuracy of 60.12% (up from 55.01% in standard AT) and an AutoAttack (AA) score of 54.35%, surpassing other established defenses like TRADES and MART.

Conclusion

This paper demonstrates that adversarial robustness is deeply linked to the frequency domain. By explicitly regularizing spectral outputs and promoting kernel smoothness through SWA, we can develop models that are both robust and accurate. While a gap between standard and robust performance remains, frequency-based alignment offers a promising path toward more efficient and reliable adversarial defenses. Future work will focus on scaling these methods to larger datasets like ImageNet and exploring their applicability to non-convolutional architectures.

Summary updated

BibTeX
@misc{huang2022frequency,
  author = {Binxiao Huang and Chaofan Tao and Rui Lin and Ngai Wong},
  title = {{Frequency Regularization for Improving Adversarial Robustness}},
  year = {2022},
  eprint = {2212.12732},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.12732},
}
Figure