Conditional Generative Adversarial Nets

Mehdi Mirza, Simon OsinderoarXiv 2014

Abstract

Generative Adversarial Nets were recently introduced as a novel way to train generative models. In this work we introduce the conditional version of generative adversarial nets, which can be constructed by simply feeding the data, $y$, we wish to condition on to both the generator and discriminator. We show that this model can generate MNIST digits conditioned on class labels. We also illustrate how this model could be used to learn a multi-modal model, and provide preliminary examples of an application to image tagging in which we demonstrate how this approach can generate descriptive tags which are not part of training labels.

Introduction

The original Generative Adversarial Network (GAN) framework, while revolutionary, lacked a mechanism for directed data generation. A standard GAN maps random noise to a data distribution, but offers no control over the specific modes of data generated. Mirza and Osindero address this by introducing Conditional Generative Adversarial Nets (cGANs). By incorporating auxiliary information—such as class labels or data from other modalities—into the training process, they enable the generation of specific, targeted outputs.

Methodology: Conditioning the Adversarial Game

The core innovation of the cGAN is the inclusion of a conditional variable $y$ into both the generator and discriminator networks. In a standard GAN, the generator $G$ takes a noise vector $z$ as input, and the discriminator $D$ evaluates a data sample $x$. In the conditional version, both networks receive $y$ as an additional input.

The architecture of a Conditional GAN, showing the auxiliary information $y$ being fed into both the Generator and Discriminator.

The Objective Function

The minimax game is modified to account for the conditional probability distributions. The objective function becomes: $$\min_{G} \max_{D} V(D, G) = \mathbb{E}_{x \sim p_{data}(x)} [\log D(x|y)] + \mathbb{E}_{z \sim p_z(z)} [\log(1 - D(G(z|y)))]$$

In practice, the generator $G$ combines $z$ and $y$ into a joint hidden representation. Similarly, the discriminator $D$ receives both $x$ and $y$ to determine if the pair is a "real" sample from the dataset or a "fake" sample produced by the generator.

Experimental Setup

The authors evaluated cGANs on two primary tasks:

  1. Unimodal Generation (MNIST): Generating handwritten digits conditioned on their class labels (0-9).
  2. Multimodal Learning (MIR Flickr 25,000): Generating descriptive text tags conditioned on image features. This involved using a pre-trained convolutional model for image features and a skip-gram model for word embeddings.

Key Results and Discussion

The experiments demonstrated that conditioning is a simple yet effective way to guide the generative process.

MNIST Results

The model successfully learned to generate specific digits based on the provided label. While quantitative metrics like Parzen window log-likelihood ($132 \pm 1.8$) were slightly lower than some contemporary unconditioned models, the qualitative results were striking.

Generated MNIST digits where each row is conditioned on a different class label (0-9).

Multimodal Flexibility and Image Tagging

Traditional supervised learning often struggles with "one-to-many" problems, such as an image having multiple valid tags. cGANs naturally handle this by sampling from a conditional distribution, allowing for a variety of valid outputs for a single input. In the Flickr experiment, the model generated semantically relevant tags for images. For instance, an image of a train might result in tags like "railway" or "transportation." Notably, the model often generated accurate descriptive tags that were not present in the original user-provided labels, suggesting a capacity for semantic generalization.

Conclusion and Future Directions

This work serves as a foundational proof-of-concept for conditional generative modeling. While the initial models used simple Multi-Layer Perceptrons (MLPs), the authors noted that moving to convolutional architectures and implementing joint training would likely yield significant improvements. Despite its simplicity, the cGAN framework paved the way for modern applications like text-to-image synthesis and style transfer.

Summary updated

BibTeX
@misc{mirza2014conditional,
  author = {Mehdi Mirza and Simon Osindero},
  title = {{Conditional Generative Adversarial Nets}},
  year = {2014},
  eprint = {1411.1784},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1411.1784},
}
Figure