An Introduction to Generative Adversarial Networks (GAN)

Generative Adversarial Networks are unsupervised neural networks that are able to analyse information from a dataset and produce similar new samples.

A GAN is a machine learning technique introduced by Goodfellow et al. [1], that consists of two neural networks (the generator and the discriminator) that compete with each other in a zero-sum game: when one wins, the other one loses. The generator produces samples coming from the distribution of the training data, and the discriminator must determine if this sample is real (from original training dataset) or fake (generated).

Currently, state-of-the-art generative models can produce samples that are indistinguishable from the original dataset for many tasks, such as: data augmentation, high-fidelity natural image synthesis, image to image translation, image editing, and many more.

Fig. 1  GAN model architecture [2].

The generator takes as input a random vector of fixed size and generates a sample in the problem domain. After a large-scale training, the samples correspond more and more to points that obey the training dataset distribution. The discriminator is a classical classification model that takes as input an example from the domain: it can be a real one from the training dataset or a fake one produced by the generator. The discriminator outputs a binary class label, either fake or real.

The two networks are trained together: when the generator fools the discriminator, its model parameters are not modified, while the discriminators must recompute its parameters. And when the discriminator is successful at predicting correctly real and fake samples, the generator updates its model parameters.

One problem of GANs is that they can suffer from ¨mode collapse¨, meaning that the generator is capable of producing only a subset of different samples and does not generalize well.  A careful training and fine-tuning of parameters need to be done for producing GAN optimal results. 

Author: Gabriela Ghimpeteanu, Coronis Computing.

Bibliography:

[1] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, AaronCourville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680, 2014.

[2] A Gentle Introduction to Generative Adversarial Networks (GANs), https://machinelearningmastery.com/what-are-generative-adversarial-networks-gans/