Conditional generative adversarial network, or cGAN for short, is a type of GAN that involves the conditional generation of images by a generator model.
A generative adversarial network (GAN) is a Machine Learning framework used to train generative models. Read more about GANs here.
GANs rely on a generator that learns to generate new images, and a discriminator that learns to distinguish synthetic images from real images.
In cGANs, a conditional setting is applied, meaning that both the generator and discriminator are conditioned on some sort of auxiliary information (such as class labels or data) from other modalities. As a result, the ideal model can learn multi-modal mapping from inputs to outputs by being fed with different contextual information.
By providing additional information, we get two benefits:
If that was confusing, consider this example:
Suppose you train a GAN on hand-written digits (
This is where the cGANs come in as we can add an additional input layer of one-hot-encoded image labels. This additional layer guides the generator in terms of which image to produce.
The input to the additional layer can be a feature vector derived either an image that encodes the class or a set of specific characteristics we expect from the image.
cGANs are not strictly unsupervised learning algorithms because they require labeled data as input to the additional layer.