Blog Layout

GAN’s - How this Generative Network is Revolutionizing Data Generation

Jul 28, 2022

By William Huang

As the field of artificial intelligence (AI) continues to grow, machines are becoming increasingly more capable of “thinking” and “acting” like humans. As such, one such field in AI, the creation of synthetic data given an existing dataset, has seen rapid growth through a novel network - the GAN.


GAN’s, otherwise known as generative adversarial networks, is a form of unsupervised learning created by Ian Goodfellow and his colleagues in 2014. The architecture functions in a zero-sum game where two neural networks are pitted against each other. One network focuses on creating synthetic data, while the other distinguishes between the real dataset and the synthetic data. The former network is referred to as the generator and the latter as the discriminator.


The generator functions by finding the mapping from a latent space to a data distribution. The generator begins by producing a Gaussian distribution through random noise. Then, the generator upsamples the noise to create an image. After training, points in the latent space would correspond with points in the problem domain, forming a compressed model of the data distribution. 


The discriminator, a convolutional neural network, distinguishes between the training data and the synthesized data. This discriminator takes both real and created images and returns probabilities between 0 and 1, with 1 representing total similarity and 0 representing fake. Essentially, the discriminator is a feedback loop with the ground truth of the images.


However, how do these two neural nets work together to create synthetic images? The key lies in the feedback loops with the discriminator and the training images and the generator and the discriminator. During the training process, both the generator and the discriminator improve through this feedback loop. Going back to the idea of the zero-sum game, when the discriminator recognizes real or fake samples, it is rewarded while the generator is penalized through changes in the model parameters. When the discriminator is fooled, it is penalized and the model parameters are updated. In an ideal case, the generator would create perfect replicas each time and the discriminator would output a 50 percent probability. 


However, although GAN’s have been largely successful in performing generative tasks, they have key issues. One common problem is “mode collapse”, where generated images are spurious or ambiguous. The reason behind this problem is that the GAN’s fail to generalize, resulting from missing modes in the input data. Although researchers hypothesize that it stems from a weak discriminator, there is currently no clear solution as the convergence of GAN’s is an ongoing problem. Even so, GAN’s are over other generative networks like variational autoencoders or VAE’s. These models compress data like an autoencoder and construct images like GAN’s, but tend to create much blurrier and less detailed images than GAN’s


Today, GAN’s have numerous applications in multiple industries. They are successful in performing many tasks, including modeling high-dimensional data, providing multi-modal data, and accounting for missing data. As such, Goodfellow cites GAN’s as having potential to create art, translate photographs across domains, and generate high-resolution images from input data. In fact, GAN’s have already been applied in these very fields, such as Deepfake and Deepmind. A GAN-generated portrait was even sold in 2019 for $432,000. With this knowledge, I encourage you to try training your own GAN using the MNIST database (
http://yann.lecun.com/exdb/mnist/). As a brief tip, keep the generator values constant when training the discriminator.


Review Questions

  1. What are the two parts of a GAN and what are their jobs?

Answer

  1. GAN’s contain a generator and a discriminator. The generator maps data from a latent space to an image space to create synthetic images, while the discriminator compares those images with the training data.

Citations

https://machinelearningmastery.com/what-are-generative-adversarial-networks-gans/

https://wiki.pathmind.com/generative-adversarial-network-gan

https://en.wikipedia.org/wiki/Generative_adversarial_network



Share by: