Generative Adversarial Networks Explained

Subscribe to my newsletter and never miss my upcoming articles

"Generative Adversarial Networks" (or GANs for short) is a fascinating approach for training neural networks.

The name might sound complex but how it works is extremely simple!

Let's talk about it.

A GAN has 2 parts : A generator and a discriminator.

The generator generates images(in this case) and the discriminator tries to identify if the image made by the generator are real or fake. Essentially putting 2 neural networks in a fight against each other.

Let's take this example

  • We have a generator that generates images of a 10 dollar bill.
  • The discriminator tries to determine if it is fake or not.
  • For every image that it generates correctly, it receives a point and a point is deducted for every mistake it makes.

The first few images which are generated

Are very obviously fake, the discriminator easily detects the fake notes.

image.png

Now the generator makes an image

which is every so slightly "less fake" than the previous ones, the discriminator still detects that it is a fake.

image.png

Here's the interesting part,

The generator now generates images very similar to the real ones, if you notice there is only a slight defect in the image and the discriminator predicts it incorrectly.

image.png

1 point is deducted from the score.

And that is how GANs work, you can use them for all sorts of crazy things like making computer generated art like this!

image.png

No Comments Yet