GAN: One of the most overpowered algorithms of 21st century.

Vaibhav Nagar
4 min readApr 10, 2022

--

WHO, WHEN, HOW AND WHY ?

One night in 2014, Ian Goodfellow went out to celebrate with several friends when they asked for his assistance with a project in which a computer could generate images on its own.

He invented an idea after thinking about it for a while. What if two neural networks were pitted against each other? His companions were suspicious, so he decided to give it a shot when he got home. Goodfellow for several hours and then tested his software. It was a success from the very first attempt.

That night, he constructed what is now known as a GAN, or “generative adversarial network.” The algorithm has attracted a great deal of interest in the field of deep learning, because of which Ian had become an AI superstar.

INTRO

GANs or Generative Adversarial Networks, are a deep learning-based approach to generative modelling.

Generative modelling is an unsupervised machine learning task that requires automatically detecting and learning the patterns in incoming data such that the model may be used to produce new fake copies which are indistinguishable from the original data.

You are most certainly already aware of the applications of GAN, as they are quite popular among youngsters.

EXAMPLES

Example 1: Generate new data: GANs are able to generate new data when there isn't enough to begin with. “This person does not exist” is a website which generates human faces that are fake, but you can’t feel it as they’re so realistic.

Example 2: Generate images from real-time painting : NVIDIA Canvas is a painting programme that use artificial intelligence to create landscape images from simple brush strokes.

Example 3: Convert real life images into art: With GAN, you get the power to teach your computer to convert your selected photograph into a dog, doodle, Simpson, and vice versa !

WORKING

GANs are made up of convolutional neural networks (CNN). Its a branch of AI which is a type of artificial neural network used in image recognition and processing that is specifically designed to process pixel data.

GAN algorithms are made up of 2 competing neural networks: a generator and a discriminator. Working of GAN is a game which involves a counterfeiter and an investigator where they compete with each other (this is described by the A in GAN which stands for adversarial, meaning opposition ). The counterfeiter is our generator and the investigator is our discriminator.

The discriminator’s job is to identify whether the given data is real or artificial. Hence its just a binary classifier which gives output as 1 for real and 0 for fake. The generator’s job is much more difficult. It uses random vectors and tries to regenerate data that looks like the input (real) data.

Its a zero-sum game, which means that there’s always a winner and always a loser. The generator makes a fake copy to fool the discriminator. If the discriminator fails to differentiate between real inputs and fake inputs made by the generator then the generator wins and makes no changes to its algorithm. Whereas since the discriminator lost, it makes changes in its algorithm on its own. This is why this GAN is called an unsupervised machine learning task.

Clearly, the generator algorithm is harder to train, as it has thousands of pixels to take care of, whereas the discriminator has to give only a final verdict of the output being real or fake.

--

--