Overview
Generative Adversarial Networks (GANs) are notoriously difficult to train. The adversarial "game" between the generator and discriminator often leads to instability, mode collapse, or diverging gradients. To address this, researchers from Google Research have introduced Consistency Regularization (CR) for GANs. This simple yet powerful technique penalizes the discriminator if its output changes when an input image is slightly augmented (e.g., shifted or flipped). Unlike previous regularization methods, CR works synergistically with spectral normalization, significantly improving image quality on benchmarks like CIFAR-10 and ImageNet while remaining computationally cheaper than gradient-based alternatives.
The Problem: Normalization vs. Regularization
To stabilize GAN training, researchers typically rely on two types of tools:
- Normalization: Techniques like Spectral Normalization (SN) constrain the weights of the discriminator to keep its function smooth.
- Regularization: Techniques like Gradient Penalties (GP) constrain how the discriminator's output changes relative to its input.
The core issue is that these two approaches often do not play well together. Previous studies found that adding gradient-based regularization to a model already using spectral normalization yields diminishing returns or even degrades performance. Furthermore, gradient penalties are computationally expensive because they require calculating "gradients of gradients" (second-order derivatives).
The Solution: Consistency Regularization
The authors borrow a concept from semi-supervised learning called Consistency Regularization. The intuition is straightforward: if you take a real image of a cat and shift it by two pixels, it is still a cat. Therefore, a robust discriminator should produce nearly identical outputs for both the original image ($x$) and its augmented version ($T(x)$).
To enforce this, the authors propose a new loss term, $L_{cr}$, which is the squared distance between the discriminator's predictions for the original and augmented images:
$$L_{cr} = \|D(x) - D(T(x))\|^2$$
This term is simply added to the standard discriminator loss. Crucially, this approach does not require complex gradient calculations; the system simply runs the discriminator twice (once for the original, once for the augmented) and penalizes the difference. In their final "CR-GAN" implementation, they apply this to real images and find that using simple augmentations like random horizontal flips and 4-pixel shifts works best.
Key Insights
- Synergy with Spectral Normalization: Unlike Gradient Penalties, which often fail to improve models already using Spectral Normalization, CR consistently boosts performance. The authors suggest this is because CR enforces a different kind of "smoothness" (semantic invariance) rather than just limiting the Lipschitz constant.
- Computational Efficiency: CR is roughly 1.7x faster than gradient-based regularization methods (like GP or DRAGAN) because it avoids the heavy lifting of second-order derivative calculations.
- It Is Not Just Data Augmentation: A key ablation study showed that simply feeding augmented data to the discriminator (without the consistency penalty) actually hurts the GAN's performance. The effectiveness lies in forcing the discriminator to learn a representation where the augmentation does not matter.
- Augmentation Selection: Not all augmentations are equal. While "Cutout" or Gaussian noise help in standard classification tasks, they can degrade GAN performance. Simple geometric shifts and flips are the most effective for maintaining the "manifold" of realistic images.
Experimental Results
The method was evaluated on three standard computer vision benchmarks: CIFAR-10 (32x32), CelebA-HQ-128 (128x128), and ImageNet-2012 (down-sampled to 128x128). The authors demonstrated state-of-the-art (SOTA) results across multiple architectures, including SNDCGAN, ResNet, and BigGAN.
- Unconditional Generation: On CIFAR-10, CR-GAN achieved a Frechet Inception Distance (FID) of 14.56, significantly beating the baseline (19.00) and other regularizers like GP (19.74).
- Conditional Generation (BigGAN):
- On CIFAR-10, CR improved the FID from 14.73 to 11.48.
- On ImageNet, CR improved the FID from 7.75 to 6.66.
- Robustness: As shown in the evaluations, the method proved highly robust across a wide range of hyperparameters and different loss functions (Hinge, Non-Saturating, and Wasserstein), consistently outperforming alternative regularization strategies.
Limitations and Future Work
While highly effective, CR-GAN has a few limitations. First, its performance is highly dependent on the choice of augmentation ($T$). If the augmentation is too aggressive or non-semantic (like heavy noise), it can lead to worse results. Second, the authors found that regularizing only the last layer of the discriminator was sufficient, noting that regularizing earlier layers sometimes harmed performance. Finding a more principled way to apply consistency across the entire network remains an open question. Finally, this paper focuses almost entirely on the discriminator; future work could explore whether enforcing similar consistency constraints on the generator could further stabilize training.
Summary updated