A conditional GAN (cGAN) extends a GAN by adding auxiliary information—such as class labels, data from another modality, or text—to generation. The generator uses random noise plus the condition to produce an output matching the requested attribute, while the discriminator or critic evaluates the output together with that condition. section 5.2 section 5.2.2
Unlike an ordinary GAN, which generates varied samples without an explicit target attribute, a cGAN directs generation through labeled training data. Wasserstein distance is a separate training technique; combining it with a cGAN can improve stability but does not define conditioning. section 5.2 section 5.6
Faces with or without eyeglasses
Train on labeled human-face images, using one label for eyeglasses and another for no eyeglasses. At generation time, concatenate a random noise vector with a one-hot label such as [1, 0] or [0, 1]. The generator then produces faces directed toward the selected attribute. Weighted label averages can create transitions in which eyeglasses gradually fade away. section 5.2.2 section 5.4.2 section 5.6
A practical cGAN implementation proceeds through these pieces:
- Feed the generator a 100-dimensional noise vector and a two-value one-hot label, producing a 102-dimensional input. section 5.3.2
- Condition the critic on the image and its label so it judges both realism and attribute alignment. section 5.2.2
- Train the critic on real and generated images, then train the generator to produce convincing images with the requested label. section 5.4 section 5.4.2
- Inspect labeled samples after each epoch, monitor critic and generator losses, and save the trained generator for later use. section 5.4.2
Figure 5.4 The training process for cGANs
Use the training-process diagram to follow how noise and labels enter the generator and how labeled real or fake data reaches the critic. section 5.2.2
A convolutional cGAN generator can use transposed-convolution blocks with batch normalization and ReLU, ending with Tanh so output pixels match training data scaled from −1 to 1. After training, discard the critic and retain the generator for targeted synthesis. section 5.3.2 section 5.4.2

