DataFreeShield: Defending Adversarial Attacks without Training Data

Hyeyoon Lee, Kanghyun Choi, Dain Kwon, SunJong Park, Mayoore Selvarasa Jaiswal, Noseong Park, Jonghyun Choi, Jinho Lee

Abstract

Deep neural networks are notoriously vulnerable to adversarial attacks, where imperceptible perturbations to input data can cause catastrophic misclassifications. While Adversarial Training (AT) is the standard defense, it typically requires access to the original training data—a requirement often impossible to meet in privacy-sensitive domains such as medical imaging or biometrics. We present DataFreeShield, the first framework to achieve adversarial robustness in a completely data-free setting. By combining a novel Diversified Sample Synthesis (DSS) technique with a gradient refinement strategy (GradRefine), DataFreeShield generates high-variance surrogate data and optimizes for flatter loss minima to bridge the distribution gap between synthetic and real-world data. Our evaluations across medical and general benchmarks demonstrate that DataFreeShield significantly outperforms existing data-free defense baselines, establishing a new state-of-the-art for robust model hardening without data access.

1. Introduction

The vulnerability of deep learning models to adversarial examples remains a significant hurdle for deployment in safety-critical applications. Adversarial Training (AT) has emerged as the most effective defense mechanism, yet its efficacy is predicated on the availability of the original training dataset. In many real-world scenarios, however, data is proprietary, sensitive, or restricted by privacy regulations (e.g., medical data or industrial secrets).

When only pretrained model weights are available, traditional AT becomes inapplicable. This "data-free" constraint necessitates the generation of synthetic data to serve as a proxy for the original distribution. However, existing data-free methods often suffer from low sample diversity and a significant distribution gap between synthetic and real data, leading to poor generalization of robustness. DataFreeShield addresses these challenges through a two-stage pipeline designed to synthesize diverse samples and refine the training process for better generalization.

2. Methodology

DataFreeShield operates in two primary stages: synthetic data generation and robust optimization.

2.1 Diversified Sample Synthesis (DSS)

The first challenge in data-free defense is the "inversion" of a pretrained model to recover representative data. Standard model inversion techniques often produce repetitive, low-diversity images that fail to cover the full input space. DataFreeShield introduces Diversified Sample Synthesis (DSS), which utilizes dynamic synthetic loss modulation. Instead of employing static weights for the generation loss, DSS randomly samples coefficients for each batch. This stochastic approach forces the generator to explore a wider range of the data distribution, resulting in a surrogate dataset with significantly higher coverage and variety.

2.2 Adversarial Training with GradRefine

Even with diverse synthetic data, a "distribution gap" remains between the generated samples and the unseen real-world data. To mitigate this, the authors introduce GradRefine. This technique identifies consistent gradient directions across multiple mini-batches, effectively filtering out high-fluctuation parameters. By focusing on consistent gradients, the optimization process converges toward flatter minima in the loss landscape. Flatter regions are theoretically and empirically linked to better generalization, ensuring that the robustness learned on synthetic data translates effectively to real-world test sets.

2.3 Soft-Guided Loss

To further stabilize training, DataFreeShield employs a Soft-Guided Loss ($L_{DFShield}$). Rather than training against "hard" labels—which may be inaccurate for synthetic samples—the framework uses the soft probability outputs of the original (teacher) model. This approach incorporates a smoothness term to ensure the model's predictions remain stable under small perturbations, preventing the model from over-fitting to the noise inherent in synthetic generation.

3. Experimental Evaluation

The framework was rigorously evaluated across diverse domains, including eight subsets of MedMNIST-v2 (e.g., Tissue, Blood, Path, OrganC) and general benchmarks like CIFAR-10, CIFAR-100, and SVHN.

3.1 Robustness Benchmarks

DataFreeShield demonstrates a substantial lead over existing baselines in AutoAttack (AAA) accuracy, the current gold standard for robustness evaluation:

  • CIFAR-10 (WideResNet-28-10): DataFreeShield achieved 43.73% AAA, a massive improvement over the previous best baseline (AIT) at 9.47%.
  • SVHN (ResNet-20): The framework reached 47.55% AAA, whereas prior methods like DaST and DFME failed to exceed 7%.
  • Medical Imaging: On the "Blood" dataset, robust accuracy improved from 0.00% (undefended) to 19.29%, highlighting the framework's utility in sensitive domains where data sharing is prohibited.

3.2 Qualitative Analysis

Loss surface visualizations confirm the efficacy of the GradRefine strategy. 3D plots of the loss landscape reveal that DataFreeShield produces significantly smoother and flatter "valleys" compared to standard adversarial training methods. This flatness directly correlates with the model's ability to maintain robustness when faced with real-world data that differs from the synthetic training distribution.

4. Discussion and Limitations

The success of DataFreeShield underscores two critical insights: diversity in synthetic data is more important than visual fidelity, and finding flatter loss minima is essential for synthetic-to-real generalization.

Despite its performance, the method has limitations. The synthetic images generated by DSS are abstract and lack human interpretability. Furthermore, while the method does not use real data, the inversion process could potentially leak information about the training set, necessitating further study into membership inference risks. Finally, the computational cost of generating large-scale surrogate datasets and performing refined training is higher than standard AT.

5. Conclusion

DataFreeShield provides a robust solution for hardening AI models in environments where data privacy is paramount. By combining diversified synthesis with gradient refinement, it bridges the gap between data-free generation and real-world adversarial robustness, setting a new benchmark for the field.

Summary updated

BibTeX
@inproceedings{lee2024datafreeshield,
  author = {Hyeyoon Lee and Kanghyun Choi and Dain Kwon and SunJong Park and Mayoore Selvarasa Jaiswal and Noseong Park and Jonghyun Choi and Jinho Lee},
  title = {{DataFreeShield: Defending Adversarial Attacks without Training Data}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=szvKJgmubh},
}
Figure