Direct Adversarial Training: A New Approach for Stabilizing The Training Process of GANs

Ziqiang Li, Pengfei Xia, Rentuo Tao, Hongjing Niu, Bin Li

Abstract

Generative Adversarial Networks (GANs) are the most popular models for image generation by optimizing discriminator and generator jointly and gradually. However, instability in training process is still one of the open problems for all GAN-based algorithms. In order to stabilize training, some regularization and normalization techniques have been proposed to make discriminator meet the Lipschitz continuity constraint. In this paper, a new approach inspired by works on adversarial attack is proposed to stabilize the training process of GANs. It is found that sometimes the images generated by the generator play a role just like adversarial examples for discriminator during the training process, which might be a part of the reason of the unstable training. With this discovery, we propose to introduce a adversarial training method into the training process of GANs to improve its stabilization. We prove that this DAT can limit the Lipschitz constant of the discriminator adaptively. The advanced performance of the proposed method is verified on multiple baseline and SOTA networks, such as DCGAN, WGAN, Spectral Normalization GAN, Self-supervised GAN and Information Maximum GAN.

Introduction

Training Generative Adversarial Networks (GANs) is notoriously unstable because generators often inadvertently produce "adversarial examples" that trick the discriminator. This paper introduces Direct Adversarial Training (DAT), a method that explicitly trains the discriminator on adversarial perturbations of both real and fake data. This approach adaptively stabilizes the training process and improves image quality across multiple architectures by enforcing a dynamic Lipschitz constraint.

The Problem of Instability

The central challenge in GAN research is instability. Because GANs are structured as a two-player minimax game—where a generator ($G$) tries to fool a discriminator ($D$)—the balance is fragile. If the discriminator becomes too powerful or if the generator finds "shortcuts" to fool it, training can collapse into mode collapse or vanishing gradients.

To mitigate this, researchers often enforce a Lipschitz continuity constraint on the discriminator, ensuring its output doesn't change too wildly in response to small changes in input. While techniques like Gradient Penalty (GP) or Spectral Normalization (SN) help, they are often static constraints. The authors argue that the generator essentially acts as an adversarial attacker, finding specific perturbations that mislead the discriminator.

Direct Adversarial Training (DAT)

Inspired by defense strategies in robust classification, DAT incorporates an explicit adversarial attack step into the discriminator's training loop:

  1. Adversarial Perturbation: For every batch of real images ($x_r$) and generated fake images ($x_f$), the method calculates a small, optimized perturbation ($\delta$) for each image. This is done using a one-step Projected Gradient Descent (PGD) attack designed to move the discriminator's output toward the "wrong" answer.
  2. Training on "Hard" Examples: Instead of training the discriminator on the original clean images, it is trained on these adversarial versions ($x_{r-adv}$ and $x_{f-adv}$).
  3. Adaptive Lipschitz Constraint: The authors mathematically prove that DAT acts as an adaptive gradient penalty. When the discriminator is performing well, DAT behaves like a zero-centered gradient penalty (0-GP), smoothing the function. Crucially, if the discriminator is performing poorly (getting "tricked"), DAT encourages larger gradients to help the discriminator escape local minima or saddle points.

Key Insights

A core discovery of this work is that the generator acts as an unintentional attacker. Even standard DCGAN discriminators are highly vulnerable to adversarial attacks. The instability of GAN training is fundamentally linked to the generator's ability to produce samples that mislead the discriminator in ways similar to intentional adversarial examples.

Comparison of clean images and images with adversarial attacks for both real and fake samples. The similarity between fake samples and adversarial examples suggests that the generator's output can inadvertently mislead the discriminator.

Unlike standard Gradient Penalty, which applies a uniform constraint, DAT is adaptive. It focuses its smoothing effort exactly where the discriminator is most vulnerable at any given moment. Furthermore, DAT makes GANs much less sensitive to hyperparameter choices; for instance, a DCGAN that failed to train due to a high learning rate became stable once DAT was integrated.

Experimental Results

The effectiveness of DAT was evaluated on benchmarks including 2D synthetic data (mixtures of Gaussians), MNIST, CIFAR-10/100, STL-10, and LSUN-Bedroom.

  • Faster Convergence: On 2D synthetic data, DAT reached the true distribution significantly faster than standard DCGAN and avoided missing modes in imbalanced datasets.
  • State-of-the-Art Improvements: When added to modern architectures like Spectral Normalization GAN (SNGAN) and Self-Supervised GAN (SSGAN), DAT consistently improved performance metrics. On STL-10, adding DAT to SSGAN improved the FID from 39.84 to 35.64. On CIFAR-10, SSGAN-DAT achieved an Inception Score (IS) of 8.25 compared to 8.13 for the baseline.
  • Stability in WGAN: In Wasserstein GANs, DAT helped stabilize the Wasserstein distance, preventing the sudden spikes often seen during training.

Limitations and Future Work

While DAT stabilizes training, models still exhibit a gap between training and test FID, indicating some degree of overfitting. Additionally, the one-step PGD attack adds an extra gradient calculation per discriminator update, increasing total training time per iteration. Future research may explore the relationship between GAN overfitting and adversarial robustness to further refine these models.

Summary updated

BibTeX
@article{li2023direct,
  author = {Ziqiang Li and Pengfei Xia and Rentuo Tao and Hongjing Niu and Bin Li},
  title = {{Direct Adversarial Training: A New Approach for Stabilizing The Training Process of GANs}},
  journal = {IEEE Trans. Emerg. Top. Comput. Intell.},
  year = {2023},
  doi = {10.1109/tetci.2022.3193373},
}
Figure