DL Unit6 Gan
DL Unit6 Gan
UNIT - VI
By,
Dr. Himani Deshpande 1
UNIT – VI
RECENT TRENDS AND APPLICTAIONS
6.1
Generative Adversarial Network(GAN) : Architecture
6.2
Applications: Image Generation, DeepFake
2
Generative Adversarial Network(GAN)
3
GENERATIVE AI
¡ Generative AI models can take inputs such as text, image, audio, video, and code and
generate new content into any of the modalities mentioned.
¡ For example, it can turn text inputs into an image, turn an image into a song, or turn
video into text.
4
GAN
A generative adversarial network (GAN) has two parts: The generator learns to generate
plausible data. The generated instances become negative training examples for the
discriminator. The discriminator learns to distinguish the generator's fake data from real
5
data.
GAN
¡ The two neural networks that make up a GAN are referred to as the generator and
the discriminator.
¡ The generator is a convolutional neural network and the discriminator is a
deconvolutional neural network. The goal of the generator is to artificially
manufacture outputs that could easily be mistaken for real data. The goal of the
discriminator is to identify which of the outputs it receives have been artificially
created.
6
GAN
¡ Essentially, generative models create their own training data.
¡ While the generator is trained to produce false data, the discriminator network is
taught to distinguish between the generator's manufactured data and true examples.
¡ If the discriminator rapidly recognizes the fake data that the generator produces --
such as an image that isn't a human face -- the generator suffers a penalty.
¡ As the feedback loop between the adversarial networks continues, the generator will
begin to produce higher-quality and more believable output and the discriminator will
become better at flagging data that has been artificially created.
¡ For instance, a generative adversarial network can be trained to create realistic-
looking images of human faces that don't belong to any real person. 7
GANS
• Generative
• Learn a generative model
• Adversarial
• Trained in an adversarial setting
• Networks
• Use Deep Neural Networks
GAN
10
GAN WORKING
• The generator import indiscriminate number of data samples and return an example of data.
• This generated example of data is feeded to the discriminator with actual data.
• Now the concept of probability comes into the play here. The discriminator has the task to
provide a probability score (in between 0 and 1 where 0 signifies fake and 1 signifies valid
instance).
• So broadly speaking there are two continuous vice-versa procedure run inside the GAN under
which discriminator shares a responsive loop with the real images to explore the ground truth
(by determining which data instance is fake and which is rea). On the other hand generator
shares a responsive loop with discriminator to determine the results of discriminator without
giving any concern to the truthness. 11
GAN
12
GAN
13
GAN
14
16
17
18
19
MAGIC OF GANS…
Lotter, William, Gabriel Kreiman, and David Cox. "Unsupervised learning of visual structure using predictive generative networks." arXiv preprint arXiv:1511.06380 (2015).
MAGIC OF GANS…
Which one is Computer generated?
Ledig, Christian, et al. "Photo-realistic single image super-resolution using a generative adversarial network." arXiv preprint arXiv:1609.04802 (2016).
APPLICATIONS OF GANS…
http://people.eecs.berkeley.edu/~junyanz/projects/gvm/
23
ADVERSARIAL TRAINING
25
PROBLEMS OF AUTOENCODER
NN As close as
code Decoder
Output
possible
Realistic Fake
GRADUAL AND STEP-WISE GENERATION
NN NN NN
Generator Generator Generator
v1 v2 v3
Discri-
image minator 1/0 (real or fake)
v1
Randomly sample
a vector
D D(x)
G
z
G(z)
D(G(z))
• Why GANs?
• Sampling (or generation) is straightforward.
• Training doesn't involve Maximum Likelihood estimation.
• Robust to Overfitting since Generator never sees the training data.
• Empirically, GANs are good at capturing the modes of the distribution.
Goodfellow, Ian. "NIPS 2016 Tutorial: Generative Adversarial Networks." arXiv preprint arXiv:1701.00160 (2016).
GAN VS OTHER IMAGE HANDLING MODELS
• GAN have the capability to predict the corresponding new frame in a video.
• In the case of Image handling, it can also give a boost to the resolution of an
Image.
• If there is a necessity of Image to Image interpretation, for this purpose GAN
model can be used. It means a firmly new image can be generated from an
old image with the help of a GAN model.
• With the help of GAN model text to an image generation is also possible
which means provide the description in the form of text to the GAN model,
and it can generate a pragmatic photo of the specification.
39
PROBLEMS WITH GANS
• Training is Hard
• Non-Convergence
• Mode-Collapse
Goodfellow, Ian. "NIPS 2016 Tutorial: Generative Adversarial Networks." arXiv preprint arXiv:1701.00160 (2016).
WHY USE GANS FOR GENERATION?
42
IMAGE AND VIDEO SYNTHESIS
¡ GANs have been extensively used for image and video synthesis.
¡ They can generate realistic images of faces, objects, and even landscapes.
¡ These images can be used for various purposes, such as art, advertising, or
video game development. GANs can also be used for video synthesis,
generating new frames that follow the same pattern as the real video.
43
IMAGE GENERATION
44
FACE INPAINTING
45
Facial inpainting is used for generating facial features for missing pixels in a face image.
STYLE TRANSFER
¡ Style transfer is applying one image's style to another. GANs can perform style transfer by training a
network to generate an image with the content of one image and the style of another. This technique
has been used to generate images in the style of famous artists, such as Van Gogh or Picasso.
46
DATA AUGMENTATION
¡ GANs can also be used for image restoration, generating a high-quality version of a low-
quality image. This technique is proper when the original image is of low quality, such as in
medical or satellite imaging. GANs can also remove noise from images and enhance image
resolution.
48
DEEPFAKE
Deepfakes often transform existing source content where one person is swapped for another. They also create
entirely original content where someone is represented doing or saying something they didn't do or say.
50
¡ THANK YOU..
51