Adversarial Lipschitz Regularization

Dávid TerjékICLR 2020

This paper introduces a novel way to stabilize the training of Generative Adversarial Networks (GANs) by rethinking how we enforce mathematical constraints on the "critic" (the part of the GAN that evaluates how realistic a generated image is).

TL;DR

The paper proposes Adversarial Lipschitz Regularization (ALR), a method that explicitly penalizes violations of the Lipschitz constraint in neural networks by searching for "adversarial" directions where the constraint is most likely to break. When applied to Wasserstein GANs (WGAN-ALP), it achieves state-of-the-art image quality on CIFAR-10 and demonstrates high stability in high-resolution image generation.

The Problem: Enforcing the Lipschitz Constraint

To train a Wasserstein GAN (WGAN) effectively, the "critic" function must be 1-Lipschitz continuous. In plain English, this means the function's output shouldn't change faster than its input; if you move a small distance in the input space, the output should only change by at most that same distance.

Enforcing this is notoriously difficult. Early methods used crude "weight clipping," while the current standard is Gradient Penalty (GP), which encourages the gradient norm to be 1. However, GP is an implicit way to enforce the constraint and relies on interpolating between real and fake data points. This often fails to catch violations in other areas of the input space and struggles when the critic uses Batch Normalization.

Previous attempts at explicit penalties (directly checking the ratio of output change to input change) were considered practically infeasible because random sampling rarely finds the specific pairs of points where the Lipschitz constant is actually violated.

Methods: Adversarial Lipschitz Regularization

The author introduces Adversarial Lipschitz Regularization (ALR), inspired by Virtual Adversarial Training (VAT). Instead of picking random pairs of points to check the Lipschitz constraint, ALR uses an adversarial approach:

  1. Find the Weak Spot: For a given input $x$, the algorithm searches for a perturbation $r_{adv}$ that maximizes the "Lipschitz quotient" (the ratio of the change in output to the change in input).
  2. Power Iteration: Since finding the exact maximum is computationally expensive, the paper uses a crude and cheap approximation via a single step of power iteration (similar to how Spectral Normalization works, but in the input space).
  3. The Penalty (ALP): Once this adversarial direction is found, the model adds a penalty term to the loss function that specifically punishes the network if the slope in that direction exceeds the target Lipschitz constant $K$.

This turns the regularization into a mini-game: the regularizer tries to find where the network is "too steep," and the network learns to flatten out those specific regions.

Key Insights

  • Sampling is Everything: The failure of previous explicit Lipschitz penalties wasn't due to the penalty itself, but the sampling strategy. By looking in adversarial directions, explicit penalties become highly effective.
  • Batch Normalization (BN) Compatibility: One of the biggest advantages is that ALR works well with Batch Normalization in the critic. Standard Gradient Penalty (GP) is theoretically invalid with BN because BN creates dependencies between samples in a batch. ALR bypasses this, allowing for more stable training with modern architectures.
  • Bridging Two Worlds: The paper highlights a deep connection between Lipschitz regularization (mathematical stability) and adversarial training (robustness). It suggests that making a network robust to small perturbations is essentially the same as enforcing a Lipschitz constraint.

Key Results

The method was evaluated on two standard benchmarks: CIFAR-10 ($32 \times 32$ RGB images) and CelebA-HQ (high-resolution $1024 \times 1024$ celebrity faces).

Table comparing Inception Score and FID of WGAN-ALP against other methods on CIFAR-10.
  • State-of-the-Art on CIFAR-10: WGAN-ALP (the version using this new penalty) achieved an Inception Score of 8.34 and a FID of 12.96, outperforming WGAN-GP, Spectral Normalization (SN-GAN), and several other competitive variants.
  • High-Res Stability: On CelebA-HQ, the method proved stable even at $1024 \times 1024$ resolution. While it didn't strictly beat the highly fine-tuned original Progressive GAN (which uses GP), it produced competitive results and demonstrated that explicit penalties are viable at scale.
Generated image samples demonstrating visual quality.
  • Smoother Gradients: Toy experiments showed that ALR produces much smoother gradient surfaces than standard Lipschitz penalties, which provides a cleaner "learning signal" for the generator.

Limitations and Future Work

  • Computational Overhead: ALR requires an extra backpropagation step per iteration to calculate the adversarial direction. While it's similar in cost to Gradient Penalty, it is significantly slower than Spectral Normalization.
  • Approximation Limits: The current method approximates the adversarial perturbation as a simple translation. More sophisticated methods for generating adversarial examples could further improve the approximation of the Lipschitz constant.
  • Hyperparameter Tuning: ALR introduces a few more knobs to turn (like the distribution of the perturbation scale $\epsilon$ and the number of power iterations $k$) compared to simpler normalization techniques.

Source code for the project is available at: https://github.com/dterjek/adversarial_lipschitz_regularization

Summary updated

BibTeX
@inproceedings{terjek2020adversarial,
  author = {Dávid Terjék},
  title = {{Adversarial Lipschitz Regularization}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure