Practical overview
When it fits
Use it when you need research code to train a GAN and explore classifier-defense behavior in configured adversarial-attack experiments.
Who it is for
- Researchers reproducing experiments associated with the Defense-GAN paper.
- Developers prototyping generative-model approaches to classifier robustness.
- Teams comparing classifier behavior under documented adversarial-attack settings.
Documented uses
- Train a GAN model from a supplied configuration.
- Run black-box experiments with selected model, substitute-model, epsilon, and defense settings.
- Run white-box experiments using documented attack types and defense choices.
- Save experiment results and, optionally, reconstruction and dataset caches.
Requirements & limits
The public GitHub repository identifies its license as Apache-2.0.
- The documented workflow relies on repository configuration files and command-line scripts rather than a hosted interface.
- The README identifies MNIST, Fashion-MNIST, and CelebA as dataset download choices.
- The setup instructions mention TensorFlow 1.7’s CPU version for systems without a GPU.
- Black-box and white-box scripts expose different attack and model settings; choose the workflow according to the experiment being studied.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up the Defense-GAN research environment
Prepare the repository, dataset, and working directories for the documented training workflow.
Before you start
- A Linux environment and Python package installation via pip.
- A dataset choice from MNIST, Fashion-MNIST, or CelebA.
- TensorFlow requirements; the README specifies the CPU version of TensorFlow 1.7 when no GPU is available.
Steps
Clone the repository recursively, enter its directory, and initialize its submodules.
Install the listed requirements with pip.
Run the dataset download script with one of the documented dataset names.
Create or link the output and debug directories.
Expected outcome
The repository, selected dataset directory, and output/debug locations are prepared for the documented training command.
Guide limitations
- The instructions do not specify hardware requirements beyond the CPU TensorFlow note.
- This setup does not itself train a model or run an attack experiment.
Run a documented black-box comparison
Configure the repository’s black-box experiment script to record results for a selected model and defense setting.
Before you start
- A trained iWGAN configuration or its output directory.
- Black-box and substitute model selections from A through E.
- An FGSM epsilon value and a results directory path.
Steps
Provide the model configuration or output directory to the black-box script.
Select the black-box model, substitute model, FGSM epsilon, and defense type.
Set the results directory and run blackbox.py with the documented arguments.
Expected outcome
The script is configured to save experiment results as text files in the specified results directory.
Guide limitations
- The README describes this as an experiment workflow, not a guarantee of a particular defense result.
- Online training can take a while when the reconstruction iteration count is large.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 28 November 2026
- Original website title
- kabkabm/defensegan · Official homepage title · retained in its source language

