Abstract
We propose the Margin Adaptation for Generative Adversarial Networks (MAGANs) algorithm, a novel training procedure for GANs to improve stability and performance by using an adaptive hinge loss function. We estimate the appropriate hinge loss margin with the expected energy of the target distribution, and derive principled criteria for when to update the margin. We prove that our method converges to its global optimum under certain assumptions. Evaluated on the task of unsupervised image generation, the proposed training procedure is simple yet robust on a diverse set of data, and achieves qualitative and quantitative improvements compared to the state-of-the-art.
Introduction
Training Generative Adversarial Networks (GANs) is notoriously difficult due to the "minimax" game between the generator and discriminator. If the discriminator becomes too powerful too quickly, the generator receives vanishing or uninformative gradients, leading to training instability, mode collapse, or failure to converge. Energy-Based GANs (EBGANs) introduced an auto-encoder discriminator where "energy" is defined as reconstruction error. EBGANs utilize a hinge loss with a fixed margin $m$ to prevent the discriminator from focusing on synthetic samples once their energy exceeds a threshold. However, selecting an optimal $m$ is challenging; a margin that is too high allows the discriminator to dominate, while a margin that is too low prevents the generator from learning fine details.
Methodology
MAGAN addresses this by automating the selection and adjustment of the hinge loss margin. The discriminator is an auto-encoder where real images are expected to have low reconstruction energy and synthetic images high energy. Instead of a static margin, $m$ is updated at the end of each epoch to match the expected energy of the real data distribution. This update is triggered only when specific conditions are met, such as when the generator's performance stalls or the discriminator successfully separates real and synthetic data. By dynamically lowering the margin as the discriminator improves, MAGAN effectively "handicaps" the discriminator, ensuring the generator always has an achievable target. To initialize, the discriminator is pre-trained as a standard auto-encoder for two epochs on real data.
Key Insights
The core innovation lies in maintaining equilibrium by tying the margin to the discriminator's current performance on real data. This prevents the discriminator from wasting capacity on synthetic samples that are already easily distinguishable, forcing it to focus on harder samples and providing better gradients. Furthermore, the simultaneous decrease in real and synthetic data energies provides a reliable signal for convergence, unlike the often uninterpretable loss curves in standard GANs.
Experimental Evaluation
The authors evaluated MAGAN on three standard benchmarks: MNIST (70,000 handwritten digits), CIFAR-10 (60,000 natural images), and CelebA (over 200,000 celebrity faces).
Quantitative and Qualitative Performance
On the CIFAR-10 dataset, MAGAN achieved an Inception Score of 6.40, outperforming Wasserstein GANs (3.82) and Improved GANs (4.36). While the original EBGAN reported a score of 7.07, MAGAN is noted for its simplicity and lack of auxiliary losses.
As shown in Figure 3, MAGAN is robust against mode collapse on MNIST, producing a balanced distribution across all ten digit classes. Qualitatively, the generated digits are clear and diverse. On the CelebA dataset, MAGAN produced sharper, more diverse faces with realistic backgrounds compared to baseline models like BEGAN and EBGAN.
Discussion and Conclusion
MAGAN simplifies GAN training by replacing a sensitive hyperparameter with an adaptive mechanism. While it relies on computationally intensive auto-encoder discriminators and theoretical assumptions that may not always hold in practice, its stability and performance gains are significant. Future work may explore applying margin adaptation to non-auto-encoder GAN architectures, potentially bringing this stability to a wider range of models.
Summary updated