OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Security & Safety

Defense-GAN

Defense-GAN is a Python research implementation of a generative-model method for protecting image classifiers against adversarial attacks. It accompanies an ICLR 2018 paper and includes code for training GAN models and running black-box and white-box attack experiments.

Independent OpenViST project profile, based on linked sources.

Defense-GAN — Paper-related experimentation with MNIST, Fashion-MNIST, or CelebA
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Clone the repository recursively, enter its directory, and initialize its submodules.

  2. Install the listed requirements with pip.

  3. Run the dataset download script with one of the documented dataset names.

  4. 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.
Source-based practical guide

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

  1. Provide the model configuration or output directory to the black-box script.

  2. Select the black-box model, substitute model, FGSM epsilon, and defense type.

  3. 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.
Evidence and transparency

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