GAN and its Applications: Everything you need to know

Daten & Wissen / June 13, 2022
share

GAN stands for Generative Adversarial Networks that generate data samples from the statistical distribution of the data. It used a combination of two networks: generator and discriminator.

GANs are used for improving the accuracy of AI and for generating objects automatically that require human creativity. A GAN is a machine learning model where two neural networks compete with each other to become more accurate in their predictions i.e. Generator & Discriminator.

The generator works on the concept of the convolutional neural network, and the discriminator on the concept of the deconvolutional neural network. The generator produces outputs that are realistic looking and the discriminator identifies the fake ones from the real ones.

Generator

A generator network takes a random normal distribution and gives a generated sample that is similar to or close to the original distribution as output.

Discriminator

A discriminator tries to evaluate the output generated by the generator with the original sample and gives a value between 0 and 1 as output. If the value is close to 0, then the generated sample is actually fake, and if the value is close to 1 then the generated sample is considered real.

Basically, the job of the discriminator is to identify whether the generated sample is real or fake upon comparing it with the original sample. The job of the generator is to generate samples that are close to the original sample in order to fool the discriminator.

What are the different types of GAN?

DCGAN (Deep Convolutional GAN)

DCGAN uses Convolutional Neural Networks and is far better than regular GAN. CNN i.e. Convolutional Neural Networks are good for extracting important features and representations from the data making it more stable and useful for generating higher-quality images.

Conditional GAN

By adding some extra information like the label “y”, we can make GANs better

From the reference image, one can see that the generator and discriminator are both conditioned with label y. This could be any form of additional information, such as class labels or data.

Conditional GANs (cGAN) learn to produce better images by using additional information fed into the model.

Why should one use cGAN over others?

By providing additional information cGANs:

  1. Converges faster; as even random distribution has some pattern.
  2. The output of the generator can be controlled at the time of inference by giving the label.

Application of cGAN:

  1. Image-to-image translation
  2. Text-to-image synthesis
  3. Video generation

Image-to-image translation

The image-to-image translation is an application where a particular image is transformed with the properties of any other image.

Pix2Pix GAN

Pix2Pix GAN uses conditional GAN to translate one type of image to another type of image. 

Pix2Pix can be used for:

  1. Translate Day-to-night image to night-to-day and vice versa
  2. Low resolution to high resolution and vice versa
  3. Sketch-to-drawing and even sketch to a real image

CycleGAN

CycleGAN makes the use of unpaired image translation and not paired image translation. This technique takes any two pairs of images and interchanges the properties of both images. It is just an updated version of Pix2Pix GAN.

As you can see from the reference image, these techniques can be very useful. We can use it to translate a photo into a painting and vice versa.

Text-to-image synthesis

StackedGAN

Stacked Generative Adversarial Networks (StackGAN) can generate images getting only text descriptions as input.

The architecture comprises of stacked series of text and image GAN models. It has two GANs i.e. stage-1GAN and stage-2 GAN. StackGAN uses a sketch-refinement process where the first level generator i.e. Stage-1 GAN, is conditioned on the text and generates a low-resolution image. 

The second level generator i.e. Stage-2 GAN is conditioned both on the text as well as on the low-resolution image. It takes the stage-1 results and adds more detail to them.

Face inpainting

Facial inpainting is used for generating facial features for missing pixels in a face image.

This technique is used to produce a more realistic face image from an image with missing content.

Real-life applications of GANs

Some of the real-life applications of GAN are as follows:

Read more:

https://datenwissen.com/blog/ai-in-ecommerce-industry

https://datenwissen.com/blog/ai-in-logistics-for-demand-prediction

At Daten & Wissen, we explore new possibilities and implement modern technologies in day-to-day life. If you want to implement AI in your business to make it more efficient or advanced, then click on the button below and connect with us.

Tell us your technical needs… We will be happy to help you.

share

Written by

Daten & wissen

Daten & Wissen is the team of expert AI engineers to help your business to embark on a transformational journey with the adoption of this futuristic technology.

Video Analytics for Smart Cities

The government of India launched the smarter city mission in 2015. This smart city miss…Read more

July 1, 2022
R&D
Object Detection using AI - Use Cases & Applications

Object detection is basically a solution used in computer vision to locate and identify…Read more

Oct. 12, 2022
R&D
Face Recognition using Video Analytics

Face Recognition is a biometric technology used for recognizing human faces by mapping …Read more

Sept. 13, 2022
R&D