A Spectral Perspective towards Understanding and Improving Adversarial Robustness

Binxiao Huang, Rui Lin, Chaofan Tao, Ngai WongarXiv 2023

Abstract

Deep neural networks (DNNs) are incredibly vulnerable to crafted, imperceptible adversarial perturbations. While adversarial training (AT) has proven to be an effective defense approach, the AT mechanism for robustness improvement is not fully understood. This work investigates AT from a spectral perspective, adding new insights to the design of effective defenses. In particular, we show that AT induces the deep model to focus more on the low-frequency region, which retains the shape-biased representations, to gain robustness. Further, we find that the spectrum of a white-box attack is primarily distributed in regions the model focuses on, and the perturbation attacks the spectral bands where the model is vulnerable. Based on this observation, to train a model tolerant to frequency-varying perturbation, we propose a spectral alignment regularization (SAR) such that the spectral output inferred by an attacked adversarial input stays as close as possible to its natural input counterpart. Experiments demonstrate that SAR and its weight averaging (WA) extension could significantly improve the robust accuracy by 1.14% ~ 3.87% relative to the standard AT, across multiple datasets (CIFAR-10, CIFAR-100 and Tiny ImageNet), and various attacks (PGD, C&W and Autoattack), without any extra data.

Introduction

Deep Neural Networks (DNNs) are notoriously fragile. A tiny, human-imperceptible change to an image—an adversarial perturbation—can cause a state-of-the-art model to misclassify a "stop sign" as a "speed limit sign." While Adversarial Training (AT)—the process of including attacked images in the training loop—is the most effective defense, the underlying mechanism of how it changes a model's internal logic remains poorly understood. Furthermore, there is often a "robustness-accuracy trade-off," where making a model more robust decreases its accuracy on clean, un-attacked data. This work aims to understand this mechanism through spectral analysis and use those insights to build a more effective defense.

Spectral Analysis of Adversarial Training

To understand how models process information, the researchers shifted the analysis from spatial pixels to the frequency domain using Fourier transforms. By decomposing images into different frequency bands, they could observe which features (low-frequency "shapes" vs. high-frequency "textures") the models prioritize.

Overview of frequency-domain image processing using FFT, showing high-frequency (HPF) and low-frequency (LPF) components.

As illustrated in Figure 1, images can be separated into low-frequency regions, which capture global structures, and high-frequency regions, which capture fine details. The authors discovered that robust models behave fundamentally differently in this domain compared to standard models.

Key Insights: AT as a Shape-Bias Inducer

The paper confirms that Adversarial Training naturally pushes models to ignore high-frequency noise and focus on low-frequency "shapes." This is more aligned with human vision and is a key driver of robustness.

Spectral sensitivity heatmaps for Natural, L-model, and Robust models across CIFAR-10, CIFAR-100, and Tiny ImageNet.

As shown in Figure 2, while natural models utilize a broad spectrum of frequencies, robust models concentrate their sensitivity in the low-frequency center. A major discovery is that white-box attacks are "spectral chameleons": they are not merely high-frequency noise but adaptive perturbations that detect and attack the specific frequency bands where a model is most vulnerable. This explains why simple frequency filters, like blurring, often fail as defenses.

Proposed Method: Spectral Alignment Regularization (SAR)

Based on these observations, the authors proposed Spectral Alignment Regularization (SAR). This new training objective forces the model to produce consistent spectral signatures for both clean and adversarial inputs. During training, the model calculates the Fast Fourier Transform (FFT) of its outputs and penalizes discrepancies between the natural and attacked versions. This ensures the model "sees" the same core frequency features regardless of the perturbation.

To further stabilize training and prevent "robust overfitting," they introduced SARWA, which combines SAR with Weight Averaging (averaging model weights over several training epochs).

Experimental Results

The authors validated their approach on CIFAR-10, CIFAR-100, and Tiny ImageNet benchmarks against various attacks (PGD, C&W, and AutoAttack):

  • Robustness Boost: SARWA improved robust accuracy by 1.14% to 3.87% over standard AT across different datasets.
  • Plug-and-Play Integration: SAR can be added to other defense frameworks. For example, adding SAR to the Adversarial Weight Perturbation (AWP) defense on CIFAR-10 pushed robust accuracy against PGD-20 attacks from 58.14% to 59.38%.
  • Maintaining Accuracy: Unlike many defenses that significantly reduce performance on clean images, SARWA maintains standard accuracy close to baseline levels while increasing robustness.

Conclusion

By shifting to a spectral perspective, this research provides a clearer understanding of how adversarial training improves robustness. The proposed SAR and SARWA methods offer a potent, data-efficient way to enhance model resilience. Future work may investigate if these spectral alignment principles hold true for other domains, such as Natural Language Processing or Audio processing.

Summary updated

BibTeX
@misc{huang2023spectral,
  author = {Binxiao Huang and Rui Lin and Chaofan Tao and Ngai Wong},
  title = {{A Spectral Perspective towards Understanding and Improving Adversarial Robustness}},
  year = {2023},
  eprint = {2306.14262},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.14262},
}
Figure