Generative Adversarial Networks: A Comprehensive Guide

As not many of you know, today we complete one whole year of Texplainers.

Today we will be talking about Generative Adversarial Networks (GANs).

What is a Generative Adversarial Network (GAN)?

GAN is an unsupervised Machine Learning (ML) model which has its basis on two neural networks.

You can read all about the 3 types of ML here - The 3 Types of Machine Learning.

GAN uses some deep learning algorithms to make more accurate predictions. It uses Convolutional Neural Networks or CNNs. Convolutional Neural Networks specialise in the abilities of object detection. Object detection as the name suggests is the detection and identification of the object and the enviornment around it.

You can know more about Convolutional Neural Networks (CNNs) here, which are very important in GAN. Understanding CNN is very important in understanding GAN.

Generative Adversarial Networks use a pair of neural networks that compete against each other and improve dynamically along the process. These networks are known as the generator and the discriminator. Basically the generator generates data and the discriminator checks it.

Generator and Discriminator

The generator's primary goal is to create data that is close to reality and the discriminator's objective is to distinguish real from fake. The discriminator is trained with real data sets whereas generator is fed with random data. The discriminator takes the generator's result as input and based on its training, tries to determine whether it is real or not. If the discriminator quickly classifies the output of generator as fake, the generator needs to be improved. As this cycle continues, the generator is able to create new data that is more closer to reality.

Essentially, the generator relies on indirect training by the discriminator to get better. The better you train the discriminator, the better the GAN's performance will be. 

A question you might want to ask, at this point, could be "When we know that the generator is going to generate only fake images, what is the need for a discriminator? We can just keep telling the generator its image is fake to keep improving it infinitely."

Another important function of the discriminator is telling the generator how close it is to the actual reality. The discriminator has real data as a reference point, which is something the generator has no access to.

Let's take an example of image generation:

  • The generator generates an image.
  • The discriminator then checks if the image is real.
  • If it manages to tell that the image is fake, the generator improves its standard and generates a better image. This cycle continues till the discriminator is fooled.
  • If the generator fools the discriminator, then it's time to further improve the discriminator. Or, successful near-real image generation has been achieved.

Applications of GAN

Generative Adversarial Networks are commonly used for image generation amongst other things like creating 3D objects. They are also used to enhance astronomy photos and simulate gravitational lensing for studying dark matter.

Read more about Gravitational Lensing here- Gravitational Lensing Decoded

DALL-E and Adobe Firefly are good examples of image generation software that use GANs.

Good day,

Aarav, Aniruddha and Lightspeed

References:

(1) CBSE Class 10 Facilitator Handbook (Artificial Intelligence)

(2) Techtarget

(3) Wikipedia - Array (Data Structure)

(4) Wikipedia - Generative Adversarial Network

(5) Google for Developers

(6) Forbes (Thumbnail)

1 Comments

  1. Verrry Nice Aarav.....I mean Ani and Bijli

    ReplyDelete
Previous Post Next Post