Spectral Normalization for Generative Adversarial Networks

Takeru Miyato, Toshiki Kataoka, Masanori Koyama, Yuichi Yoshida

TL;DR

This paper introduces Spectral Normalization, a computationally efficient weight normalization technique designed to stabilize the training of Generative Adversarial Networks (GANs). By constraining the spectral norm of the discriminator's weight matrices, the authors ensure Lipschitz continuity, leading to higher-quality image generation and more robust training across various datasets.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) are notoriously difficult to train. The core of the problem lies in the "battle" between the generator and the discriminator. If the discriminator becomes too powerful or its gradients become too sharp (unbounded), the generator receives poor feedback and training stalls—a phenomenon often linked to the lack of Lipschitz continuity.

Previous attempts to solve this include:

  1. Weight Clipping: Forcing weights into a small range, which often leads to "capacity underuse" where the model ignores many useful features.
  2. Gradient Penalty (WGAN-GP): Adding a penalty to the loss function based on the gradient's norm. While effective, it is computationally expensive (requiring extra backward passes) and only regularizes the model at specific data points, rather than the entire function space.

The authors sought a method that is both computationally "light" and theoretically sound to keep the discriminator's behavior in check without sacrificing its ability to learn complex features.

Methods

The authors propose Spectral Normalization (SN). Instead of clipping weights or penalizing gradients, they normalize each weight matrix $W$ in the discriminator by its spectral norm $\sigma(W)$, which is the largest singular value of the matrix.

The Core Algorithm:

  • Normalization: Each weight matrix is replaced by $\bar{W}_{SN} = W / \sigma(W)$.
  • Lipschitz Constraint: This ensures that the Lipschitz constant of each layer is at most 1. By the composition rule, the entire discriminator network becomes Lipschitz continuous.
  • Fast Approximation: Calculating a full Singular Value Decomposition (SVD) at every training step is too slow. The authors use the power iteration method, a fast iterative algorithm that approximates the largest singular value with minimal overhead. In practice, just one iteration per update is often sufficient because the weights change slowly between steps.

Datasets

The efficacy of Spectral Normalization was tested on three major benchmarks:

  • CIFAR-10: $32 \times 32$ images of 10 classes.
  • STL-10: $48 \times 48$ images, used to test performance on more diverse and slightly higher-resolution data.
  • ImageNet (ILSVRC2012): $128 \times 128$ images across 1000 classes, representing a significant jump in complexity and scale.

Key Insights and Ideas

  • Preserving Feature Diversity: Unlike weight normalization or clipping, which tend to collapse the weight matrix toward a low-rank state (using only a few "features"), Spectral Normalization allows the matrix to maintain a high rank. This means the discriminator can use more of its "brainpower" to distinguish between real and fake images.
  • Global Regularization: SN regularizes the entire operator space of the network, not just the points near the training data. This makes the training much more stable even when the generator's output is far from the real data distribution.
  • Computational Efficiency: Because it uses power iteration, SN is significantly faster than Gradient Penalty methods. It adds almost no time to the standard GAN training loop.
  • Hyperparameter Robustness: The authors found that SN-GANs are remarkably stable across a wide range of learning rates and momentum settings, making them much easier to tune than traditional GANs.
Inception scores across various hyperparameter settings for CIFAR-10 and STL-10.

Key Results

  • State-of-the-Art Quality: SN-GANs achieved higher Inception Scores and lower Fréchet Inception Distance (FID) compared to WGAN-GP and other normalization techniques on CIFAR-10 and STL-10.
FID scores on CIFAR-10 and STL-10 comparing SN to other normalization techniques.
  • ImageNet Success: At the time of publication, this was one of the first methods to successfully generate decent $128 \times 128$ images from the full ImageNet dataset using a single pair of GANs.
  • Speed: On CIFAR-10, SN-GANs were roughly 25-30% faster than WGAN-GP while producing superior results.
  • Visual Clarity: Qualitative results showed that images generated with SN were clearer and exhibited more diverse structures compared to those generated with weight normalization, which often produced "oversimplified" outputs.

Limitations and Future Work

  • Generator Normalization: The paper focuses almost exclusively on the discriminator. While the authors use Batch Normalization for the generator, they note that the role of spectral normalization in the generator remains an open question.
  • Fixed Lipschitz Constant: The method defaults to a Lipschitz constant of 1. While this works well, the authors suggest that treating the Lipschitz constant as a tunable hyperparameter (or using a learned scalar multiplier) might yield even better results for specific tasks.
  • Theoretical Depth: While the empirical results are strong, the authors suggest further investigation into the theoretical relationship between spectral distribution and GAN convergence.

Summary updated

BibTeX
@inproceedings{miyato2018spectral,
  author = {Takeru Miyato and Toshiki Kataoka and Masanori Koyama and Yuichi Yoshida},
  title = {{Spectral Normalization for Generative Adversarial Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=B1QRgziT-},
}
Figure