GAN - Generative Adversarial Networks

GAN - Generative Adversarial Networks

A powerful machine-learning model for the present times

Play this article


GAN is abbreviated as Generative Adversarial Networks, this is a machine learning that is most widely used right now in the world. Yeah, there are many models present out there but, these GANs work more effectively than them and give us better results. Let's talk about the older models and how they generate results and later see how GAN works and compare them.

Work of old models

Rather than saying old models, we can say other models than GAN. General models take input from the user and give it to the model. Now the model itself generates a random output and compares that with the existing data set that programmers already defined when building the model. Now, the model takes an accurate out of all the outputs and sends it to the user.

The following is the visual representation of the working of the old model:

Work of GANs

GANs are pretty advanced than the other models whose functioning we just discussed above. GAN generally have 2 separate models within it. They are:

  1. Generator

  2. Discriminator

Both these models are developed over the Convolutional neural networks (CNNs) and Recurrent neural networks (RNNs)

The basic idea of GAN is to improvise the generator and discriminator so that, the generator generates a few great context that satisfies the user.

Let's talk about these 2 things one by one:


The job of the generator is to generate the samples. It basically takes a random noise and generates the data. We can call these samples that get generated by the generator as fake samples. Now these samples get sent to the discriminator.


The job of the discriminator is to reject the fake sample generated from the generator. It just checks both, the input and the generated samples and rejects if the sample is not satisfied and vice-versa. This will keep on happening until the generator generates a nice sample that satisfies the user.

The following is the visual representation of the working of the GAN model:


  1. Why are we doing this?

    ANS. We are doing this to improve both the discriminator and the generator.

  2. Who's choosing the output?

    ANS. After many verifications of the random samples from the generator, the discriminator opts few of the best samples and gives them, out of which any staff will choose the best one.

  3. Will the model only train on a particular input itself?

    ANS. No, it's not. Both the generator and discriminator are not trained on one single input. They'll just keep on improving as time passes.

Use of GAN

Comparing GAN with other machine-learning models, we can see a clear win for GAN. Now, GAN is used for a wide range of products such as:

  1. Audio Generation

  2. Video Generation

  3. Text Generation

  4. Deep faking

  5. Fraud detection


GAN is a very powerful machine-learning model and we can do infinite good things with it as well as many bad things. We have to be careful when we will be using this tech, how are we using this and for what we are using this.

If you have reached this far, make sure you react to it and don't forget to subscribe to the newsletter, to never miss out on the newest blogs from my side.

Thank You