Conditional GAN
In the previous section, the fake images generated by the DCGAN are random. There is no control over which specific digits will be produced by the generator. There is no mechanism for how to request a particular digit from the generator. This problem can be addressed by a variation of GAN called Conditional GAN (CGAN) [4].
Using the same GAN, a condition is imposed on both the generator and discriminator inputs. The condition is in the form of a one-hot vector version of the digit. This is associated with the image to produce (generator) or classified as real or fake (discriminator). The CGAN model is shown in Figure 4.3.1.
CGAN is similar to DCGAN except for the additional one-hot vector input. For the generator, the one-hot label is concatenated with the latent vector before the Dense
layer. For the discriminator, a new Dense
layer is added. The new layer is used to process the one-hot vector and reshape it so that it is suitable for concatenation to the other input of the...