← All projects

AC-GAN: Class-Conditional Synthesis with an Auxiliary Classifier

Make the discriminator do two jobs: tell real from fake, and say which class the image belongs to. The generator then has to produce images that are both realistic and recognisably of the requested class.

  • Conditional generation
  • Neural Networks & Deep Learning course
  • University of Tehran · 2020
  • Keras · CIFAR-10
2 headson the discriminator: source (real/fake) and class
LS + LCsource loss plus class loss on real and generated images
10CIFAR-10 classes on demand

Where the label goes

GAN vs. cGAN vs. AC-GAN

Interactive

Switch models to see how the label y (orange) is wired in.

AC-GAN (Odena et al., 2017) gives the label to the generator only. The discriminator sees an image alone and must output both P(real) and a class distribution. Training maximises the class log-likelihood LC for both networks, while D maximises and G minimises the usual source loss LS. The class head acts like a built-in critic that rewards generated images for being recognisable.

Results by class

Pick a class

Interactive

Each column holds three samples generated for one label.

Compared with the conditional GAN from the same project, the AC-GAN's samples are more colourful and the within-class rows look more alike, which is the familiar AC-GAN trade-off: the classification loss pushes samples toward easily classified, prototypical images, at some cost to diversity. The cGAN's samples vary more but drift further from their labels.