Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 13

GANs(Generative

Adversarial Networks)
Dr. Nderu / Raphael
GAN

• Adversarial examples are intentionally designed inputs to cause a model


to make mistakes ( Open AI).
• GANs are generative models that create new data instances closely
resembling the training data.
• GAN has 2 parts: generator network and discriminator network.
a) The generator produces the new data instances.
b) The discriminator learns to distinguish the fakes from the actual
instances
The generator tries to fool the discriminator and the discriminator tries to
keep from being fooled.
Generative vs discriminative models

• Generative model – able to generate new data instances. Utilizes joint


probability P(X,Y)
• Discriminative model – able to discriminate/differentiate between
various data instances. Utilizes conditional probability P(X|Y)
GANs

Source: Google
Discriminator updates the weights of the generator using backpropagation
GANs - Generator

Source: Google
GANs - Generator
• Usually learns to create fakes from the discriminator’s feedback. The
process involves:
a) Using a random input – most cases, input noise
b) Transformation of the input into a data instance (noise into
meaningful output)
c) Classification by the discriminator
d) Penalization(generator loss) after failure to fool the discriminator
GANs - Discriminator

Source: Google
GANs - Discriminator
• It is a Neural network – CNN or RNN depending on the type of data in
use
• The real data is used as positive examples during training while fake is
used as negative examples.
• In discriminator training, the generator weights are constant and only
updated after by discriminator during backpropagation.
GANs –Loss functions
• Two commonly used functions are:
a) Minimax loss
b) Wasserstein loss
GANs Variations (Uses)
• Progressive GANs – the generator is used to produce low-resolution
images in the first layers while the rest of the layers add more details.
This allows high resolution images output.
• Conditional GANs – they use labeled data set allowing labeling of
generated instances.
• Image-to-Image translation GANs – uses input image mapping it to
generated output images with different properties.
• CycleGAN – they transform images of one set into images that could
belong to another set
• Text-to-Image Synthesis GANs – take text and generate images
described in the text
GANs Variations (Uses)
• Super-resolution GANs – used to add details to blurry images giving
out high-resolution images
• Face-inpainting GANs – used to complete missing (blacked out)
sections of images
• Text-to-Speech GANs – used to output speech from text
GANs uses

Source: Google
GANs Resources
• https://machinelearningmastery.com/impressive-applications-of-gene
rative-adversarial-networks/
• https://huggingface.co/spaces/keras-io/conditional-GAN
• https://keras.io/examples/generative/conditional_gan/ -
implementation
• https://deepfakesweb.com/

You might also like