Robust Overfitting Does Matter: Test-Time Adversarial Purification with FGSM

Linyu Tang, Lei ZhangCVPR 2024 · DOI

Introduction

Deep Neural Networks (DNNs) are notoriously vulnerable to adversarial attacks—small, often imperceptible perturbations designed to cause misclassification. While Adversarial Training (AT) is a common defense, it typically struggles with two issues: a generalization gap (where models fail against unseen attack types) and a trade-off between robustness and clean-image accuracy. This paper proposes a novel approach that turns a known failure mode of AT—catastrophic overfitting—into a robust defense mechanism.

The Phenomenon of Robust Overfitting

In standard Fast Gradient Sign Method (FGSM) adversarial training, models often experience "catastrophic overfitting." During this process, the model's accuracy on FGSM-perturbed examples suddenly spikes toward 100%, while its accuracy against stronger, multi-step attacks like Projected Gradient Descent (PGD) collapses to near zero.

Catastrophic overfitting in FGSM-AT on CIFAR-10, where the model becomes highly accurate on FGSM examples but loses robustness to PGD.

While researchers typically view this as a failure to generalize, the authors of this paper embrace it. They argue that a model that has overfit to FGSM noise becomes a "specialist" capable of distinguishing between clean data and adversarial perturbations.

Test-Time Pixel-Level Adversarial Purification (TPAP)

The proposed method, Test-Time Pixel-Level Adversarial Purification (TPAP), leverages an FGSM Robust Overfitting DNN (RO-DNN) to scrub adversarial noise from inputs at inference time.

The TPAP pipeline, showing the training of the FGSM-RO-DNN and the test-time purification process.

The TPAP Pipeline

  1. Training Phase: A model is intentionally trained to achieve robust overfitting on FGSM attacks. This RO-DNN becomes highly sensitive to the specific structure of FGSM-like noise.
  2. Inference Phase (Purification):
  3. Pre-classification: An incoming test image is fed into the RO-DNN to obtain a preliminary label and calculate the loss.
  4. Purification: A single-step FGSM-like update is performed directly on the input pixels to minimize this loss. This step effectively "purifies" the image by shifting it back into the model's high-confidence robust region.
  5. Final Prediction: The purified image is re-classified by the same RO-DNN for the final output.

By using the model's own gradients to modify the input, TPAP essentially "counters changes with changelessness," using the model's fixed parameters to adapt the input data.

Experimental Evaluation

The authors evaluated TPAP on several benchmarks, including CIFAR-10, CIFAR-100, SVHN, and Tiny-ImageNet.

Key Results

  • Robust Generalization: TPAP significantly outperforms traditional AT methods (like TRADES or MART) against unseen attacks. For instance, on ResNet18, it improved defense against Spatial Transform Attacks (STA) from ~0.35% to 31.4%.
  • Clean Accuracy: Unlike many defenses that degrade performance on unperturbed data, TPAP maintains high clean accuracy. On CIFAR-10, it achieved 86.25%, surpassing PGD-AT's 84.5%.
  • Efficiency: TPAP is computationally efficient. Training is much faster than multi-step PGD-AT (e.g., 66s vs. 273s per epoch), and the test-time purification requires only a single gradient step.

Insights and Limitations

Grad-CAM visualizations reveal that FGSM-RO models focus more on global outlines rather than local textures, making them naturally more resilient to pixel-level distortions.

However, the method has limitations. It is paradoxically slightly less robust against the specific 8/255 FGSM attack it was trained on, as the purification step can sometimes push an already "perfect" FGSM image into an unfamiliar noise regime. Additionally, it struggles with extremely high-magnitude noise (e.g., $\epsilon=0.3$), where purification can destroy the image's semantic content.

Conclusion

By reframing catastrophic overfitting as a useful feature rather than a bug, TPAP provides a fast, effective, and generalizable defense against adversarial attacks. It demonstrates that "failed" models can be powerful tools for test-time purification, bridging the gap between clean accuracy and adversarial robustness.

Summary updated

BibTeX
@inproceedings{tang2024robust,
  author = {Linyu Tang and Lei Zhang},
  title = {{Robust Overfitting Does Matter: Test-Time Adversarial Purification with FGSM}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.02298},
}
Figure