Search⌘ K
AI Features

CGANs: How Are Labels Used?

Explore how Conditional GANs (CGANs) integrate label data into both generator and discriminator architectures to influence generated image attributes. Understand network design choices like embeddings, activations, and dropout layers that enable precise control over output images. This lesson helps you implement CGAN models with labeled image generation using PyTorch.

A relation between the latent vector and the generated images can be established by the training process of GANs, and certain manipulation of the latent vectors is reflected by the changes in the generated images. But we have no control over what part or what kinds of latent vectors would give us images with the attributes we want. To address this issue, we will use a CGANMirza, Mehdi, and Simon Osindero. "Conditional Generative Adversarial Nets." ArXiv, (2014). Accessed December 28, 2023. /abs/1411.1784. to add label information in the training process so that we can have a say in what kinds of images the model will generate.

The core idea of CGAN was to integrate the label information into both generator and discriminator networks so that the label vector would alter the distribution of latent vectors, which leads to images with different attributes.

How conditional GANs work
How conditional GANs work

Compared to the vanilla GAN model, CGAN makes a small change to the objective function to make it possible to include extra information by replacing the real data, xx, and generated data, x∗x^* ...