Introduction Generative Adversarial Networks
Introduction Generative Adversarial Networks
Generative Adversarial
Networks
Why Generative Models?
Why Generative Models?
• As the name "adversarial networks" implies both networks try to beat each
other and doing so, they are both becoming better and better.
Generative Models
• At each iteration of the training process, the weights of the generative network
are updated in order to increase the classification (error gradient ascent over
the generator's parameters)
• GANs have become the most thriving and popular method to synthesize audio
text, images, video, and 3D models in the ML community.
Applications
• Image Generation using Deep Convolution GANs
StyleGAN is used…
GAN Application: Complicated and
creative task
Single Image Resolution
Deepfakes... Privacy at stake
Image to Image Translation
Basics of GAN
It contains two different networks: a generator
network and a discriminator network
ConvNet architectures make the explicit assumption that the inputs are
images and encodes certain properties into the architecture.
• Parameter sharing:
• Consider an image size e.g. 200 X 200 X 3, would lead to neurons that have 200 X 200
X 3 = 120,000 weights.
• This full connectivity is wasteful and the huge number of parameters would quickly
lead to overfitting.
• ConvNet uses filters for feature extraction across the image, that share parameters.
DCGAN
• DCGANs were the first GAN model to learn to generate high resolution images in a single
shot.
• DCGANs are able to generate high quality images when trained on restricted domains of
images, such as images of bedrooms,
• DCGANs also clearly demonstrated that GANs learn to use their latent code in meaningful
ways, with simple arithmetic operations in latent space having clear interpretation.
DCGAN
• Task is to perform style transfer; transform a given image to match a different style.
• It is unlikely that we have lots of pairs of images in both styles (e.g. a photograph and a
van Gogh painting that matches it). So lets assume we have unpaired data, i.e.
collections of unrelated images in the two styles.
Goal of Cycle-GAN:
• To produce outputs which are plausible images of the target style, and
• To preserve the structure of the original images.
Cycle-GAN
Understanding Cycle GAN
• Imagine you learn a new word in a foreign language, and then you translate it
back to your native language to see if it still means the same thing.
• If the translation matches the original word then you’ve learned the translation
correctly.
How CycleGAN Work
• CycleGAN has two main parts: Generator and Discriminator just like
other GANs.
• The Generator’s job is to create images that look like they belong to a
certain style or category.
• The Discriminator’s job is to figure out if the image is real (from the
original style) or fake (created by the Generator).
• Generators:
CycleGAN has two generators—G and F.
• G transforms images from domain X (e.g., photos) to domain Y (e.g.,
artwork).
• F transforms images from domain Y back to domain X.
• The generator mapping functions are as follows:
• G:X→YF:Y→X G:X→YF:Y→X
• where X is the input image distribution and Y is the desired output
distribution (such as Van Gogh styles)
CycleGAN
• Discriminators:
There are two discriminators—Dₓ and Dᵧ.
• Dₓ distinguishes between real images from X and generated images from F(y).
• Dᵧ distinguishes between real images from Y and generated images from G(x)
• To further regularize the mappings the CycleGAN uses two more loss function
in addition to adversarial loss.
Segmentation
• Biomedical Applications
• Glaucoma is a group of eye conditions that damage the optic nerve, the
health of which is vital for good vision.
• Glaucoma is one of the leading causes of blindness for people over the age
of 60. It can occur at any age but is more common in older adults.
Segmentation
• The optic disc (OD) is considered as one of the main features of a retinal
fundus image.