[Paper Review] Defending Against Adversarial Attacks by Leveraging an Entire GAN
This paper proposes Cowboy, a GAN-based defense that detects and cleans adversarial examples by leveraging both the generator and discriminator of a pre-trained GAN. It exploits the fact that adversarial samples lie outside the data manifold, using the discriminator to detect them and the generator to project them back onto the manifold, improving classification accuracy from 0.02% to 0.81% on the worst-case attack without modifying the classifier.
Recent work has shown that state-of-the-art models are highly vulnerable to adversarial perturbations of the input. We propose cowboy, an approach to detecting and defending against adversarial attacks by using both the discriminator and generator of a GAN trained on the same dataset. We show that the discriminator consistently scores the adversarial samples lower than the real samples across multiple attacks and datasets. We provide empirical evidence that adversarial samples lie outside of the data manifold learned by the GAN. Based on this, we propose a cleaning method which uses both the discriminator and generator of the GAN to project the samples back onto the data manifold. This cleaning procedure is independent of the classifier and type of attack and thus can be deployed in existing systems.
Motivation & Objective
- To address the vulnerability of deep neural networks to imperceptible adversarial perturbations that cause misclassification.
- To develop a defense mechanism that is agnostic to the target classifier and attack type, enabling plug-and-play deployment.
- To empirically validate that adversarial samples lie outside the data manifold learned by a GAN.
- To design a cleaning procedure that uses both generator and discriminator to project adversarial samples back onto the data manifold.
- To demonstrate generalization across multiple datasets and attack methods without retraining or modifying the classifier.
Proposed method
- Train a standard GAN on real data only, without adversarial examples during training.
- Use the trained discriminator to score input samples, with lower scores indicating higher likelihood of being adversarial.
- Apply a cleaning objective that combines reconstruction via the generator and high discriminator score, optimizing for both.
- Perform iterative optimization to project adversarial inputs toward the data manifold while maximizing discriminator confidence.
- Use the cleaned samples as pre-processing before feeding them into the original classifier.
- Ensure the method is independent of the classifier’s architecture and training process.
Experimental results
Research questions
- RQ1Do adversarial samples lie outside the data manifold learned by a GAN trained on real data?
- RQ2Can the discriminator of a GAN reliably detect adversarial samples across diverse attacks and datasets?
- RQ3Does combining the generator and discriminator in a cleaning objective improve robustness compared to using only the generator?
- RQ4How does the quality of the GAN affect detection and cleaning performance?
- RQ5Can this defense be deployed as a plug-in pre-processing step without modifying the classifier?
Key findings
- The discriminator consistently assigns lower scores to adversarial samples than to real samples across all tested attacks and datasets, confirming its ability to detect out-of-manifold inputs.
- On the SVHN dataset with the FGSM attack, classifier accuracy improved from 0.02% to 0.81% after cleaning with Cowboy, demonstrating significant robustness gains.
- Cowboy outperforms Defense-GAN, a method using only the generator, across all datasets and attacks, proving the added value of incorporating the discriminator score.
- Detection performance remains strong even with poorly trained GANs, indicating robustness to GAN training instability.
- Cleaning performance improves with better GAN training, but detection remains effective early in training, showing practical deployability.
- The method generalizes across multiple attack types—including FGSM, BIM, PGDM, MIM, and VAM—without requiring adaptation to the attack type.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.