Adaptive Weighted Discriminator for Training Generative Adversarial Networks

Vasily Zadorozhnyy, Qiang Cheng, Qiang YeCVPR 2021

Abstract

Training Generative Adversarial Networks (GANs) is notoriously unstable, often leading to "mode collapse" where the generator produces repetitive, low-variety outputs. This paper introduces the Adaptive Weighted Discriminator (aw-loss), which dynamically adjusts the weights of "real" and "fake" losses based on their gradient directions. By ensuring that updates to the discriminator do not inadvertently degrade its ability to recognize real data, the authors achieve significantly better stability, faster convergence, and state-of-the-art results on standard image benchmarks.

Introduction

The core of a GAN is a minimax game between a Generator ($G$) and a Discriminator ($D$). Traditionally, the Discriminator’s loss is a simple, equally weighted sum: $L_D = L_{real} + L_{fake}$. However, this 50/50 split often suffers from Gradient Conflict. During training, the direction needed to improve the "real" loss ($\nabla L_r$) and the direction needed to improve the "fake" loss ($\nabla L_f$) can be at an obtuse angle (greater than 90 degrees). Summing these conflicting gradients can result in an update that improves one loss while significantly damaging the other.

When the discriminator's performance on real data drops, it "forgets" the target distribution. This sends erroneous signals to the generator, leading to training instability or mode collapse, where the generator produces a limited subset of samples that exploit the weakened discriminator.

Methods: The Adaptive Weighted Discriminator

The authors propose the aw-loss function: $L_D^{aw} = w_r L_r + w_f L_f$. Instead of fixed weights, $w_r$ and $w_f$ are calculated at every training step to resolve gradient conflicts.

Gradient Alignment and Orthogonal Updates

The algorithm examines the angle between $\nabla L_r$ and $\nabla L_f$. If the gradients conflict (angle $> 90^\circ$), weights are chosen such that the total gradient is orthogonal to one of the components. For instance, if the discriminator is struggling with real data, the update is calculated to improve $L_r$ while leaving $L_f$ unchanged to a first-order approximation.

Geometric representation of gradient alignment and orthogonal updates in the aw-loss method.

Score-Based Heuristics

The weights also depend on the discriminator's current confidence, using thresholds ($\alpha_1=0.5, \alpha_2=0.75$) to prioritize learning. If the discriminator is underperforming on real data ($s_r < \alpha_1$), it prioritizes the real loss. Conversely, if it is already very confident in real data but struggling with fakes, it shifts focus accordingly. Additionally, gradient normalization is employed to prevent exploding gradients and enable higher learning rates.

Experimental Setup

The method was evaluated on several standard computer vision benchmarks:

  • CIFAR-10/100: 32x32 color images across 10 and 100 classes, respectively.
  • STL-10: 96x96 resolution images, featuring a large unlabeled set.
  • Synthetic 2D Mixture of Gaussians: A toy dataset used to visualize the prevention of mode collapse.

Results and Discussion

The aw-loss was integrated into popular GAN architectures including SN-GAN, AutoGAN, and BigGAN.

Performance and Convergence

On CIFAR-10, aw-AutoGAN achieved an Inception Score (IS) of 9.01 (vs. 8.55 baseline) and a Frechet Inception Distance (FID) of 11.82 (vs. 12.42). As shown in the training curves, the adaptive method reaches high-quality results in significantly fewer epochs than standard training.

Training curves for IS and FID across CIFAR-10, STL-10, and CIFAR-100, showing faster convergence and improved final scores for aw-AutoGAN.

Stability and Mode Collapse

In synthetic 2D tests, standard GANs often collapsed to a few points. The aw-GAN successfully captured the entire distribution (all 8 points), demonstrating superior diversity. The method also excelled in conditional tasks; on CIFAR-100, aw-BigGAN reached an FID of 10.23, outperforming the standard BigGAN's 11.73.

Conclusion

The "real" loss acts as the anchor for GAN training. By treating training as a geometric problem of vector alignment rather than simple scalar optimization, the aw-loss provides a surgical way to update model parameters. While it introduces a small computational overhead for gradient calculations, the gains in stability and convergence speed make it a robust enhancement for adversarial training. Future work may explore its application in non-image domains such as NLP.

Summary updated

BibTeX
@inproceedings{zadorozhnyy2021adaptive,
  author = {Vasily Zadorozhnyy and Qiang Cheng and Qiang Ye},
  title = {{Adaptive Weighted Discriminator for Training Generative Adversarial Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00475},
}
Figure