Are conditional GANs explicitly conditional?

Houssem-eddine Boulahbal, Adrian Voicila, Andrew I. Comport

Abstract

Conditional Generative Adversarial Networks (cGANs) are designed to generate outputs $y$ conditioned on an input $x$. However, standard training often results in "condition leakage," where the discriminator fails to verify the alignment between $x$ and $y$. We present the a contrario cGAN, a framework that introduces a mismatched data augmentation strategy and a corresponding loss term. By forcing the discriminator to reject "real-but-mismatched" pairs, we achieve explicit conditionality, leading to superior performance in image synthesis, depth prediction, and semantic segmentation.

Introduction

The promise of cGANs is the ability to map a specific input (e.g., a semantic map) to a specific output (e.g., a photorealistic image). In theory, the discriminator $D(x, y)$ should evaluate the joint probability of the pair. In practice, discriminators often become "lazy," learning to distinguish real images from generated ones based solely on the quality of $y$, while ignoring the conditioning signal $x$. This leads to models that produce high-quality but incorrectly conditioned outputs, manifesting as mode collapse or class leakage.

The A Contrario Learning Framework

To address this, we propose the a contrario cGAN. The method hinges on the concept of "learning from the contrary"—specifically, training the model to recognize what a wrong match looks like.

Methodology

  1. A Contrario Data Augmentation: We augment the training set with "false" pairs $(x, y_{wrong})$, where $y_{wrong}$ is a real image from the dataset but paired with an unrelated condition $x$.
  2. A Contrario Loss ($\mathcal{L}_{ac}$): A new loss term is added to the adversarial objective. The discriminator is tasked with classifying these mismatched pairs as "fake," alongside the standard generated outputs.
  3. Explicit Conditionality: This forces the discriminator to learn the specific relationship between $x$ and $y$. If the discriminator ignores $x$, it will fail to penalize the mismatched pairs, incurring a high loss.
The a contrario cGAN framework compared to classic cGANs. The classic discriminator (top) fails to distinguish between correctly matched and mismatched real pairs, whereas the a contrario discriminator (bottom) explicitly separates them.

Experimental Evaluation

We evaluated the a contrario approach across three distinct tasks:

  • Semantic Synthesis (Cityscapes): Integrating the a contrario loss into the SPADE architecture improved the mean Intersection over Union (mIoU) from 60.2 to 61.5 and reduced the Fréchet Inception Distance (FID) from 65.5 to 59.9.
  • Monocular Depth Prediction (NYU Depth V2): The model achieved a significant reduction in error, with the Root Mean Square Error (RMSE log) dropping from 0.3520 (baseline) to 0.3036.
  • Class-Conditional Generation (CIFAR-10): Using a pre-trained classifier, generated images from an a contrario BigGAN were correctly identified with 92.04% accuracy, compared to 86.54% for the standard version, indicating much stronger adherence to class labels.

Discussion and Conclusion

The a contrario framework demonstrates that the primary bottleneck in cGAN conditionality lies within the discriminator's objective. By making the adversarial game more rigorous, we restrict the generator's search space, leading to faster convergence and better alignment. This task-agnostic method can be seamlessly integrated into existing architectures, providing a robust solution to the "lazy discriminator" problem. Future work will explore the application of this principle to non-visual modalities such as audio and text-to-image synthesis.

Summary updated

BibTeX
@inproceedings{boulahbal2021are,
  author = {Houssem-eddine Boulahbal and Adrian Voicila and Andrew I. Comport},
  title = {{Are conditional GANs explicitly conditional?}},
  booktitle = {BMVC},
  year = {2021},
  url = {https://openreview.net/forum?id=lXLcTLdBCJ},
}
Figure