Giter Club home page Giter Club logo

kochlisgit / generative-adversarial-networks Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 3.0 39.42 MB

Generation of Human-Like handwritten digits using different GAN Architectures. The models were developed using Low-Level Tensorflow.

Python 100.00%
dc-gan gan-architectures discriminator discriminator-model handwritten-digits generative-adversarial-network python wgan-gp ac-gan info-gan stylegan stylegan2 gan-improvements tensorflow keras low-level-programming computer-vision gans

generative-adversarial-networks's Introduction

Keras-GAN

Implementation of GAN architectures for generating digits.

Generative Adversarial Network (GAN)

GAN is a machine learning model architecture, which is used to generate images, inspired by the Minimax theory. Two neural networks (The generator & The discriminator) contest with each other. The generator, tries to fool the discriminator, by generating random fake images, without having any knowledge of the target images. The goal of the discriminator is to classify whether an image is real or fake. An image is considered as real if it comes from the dataset. An image is considered as fake if it is generated.

GAN Architectures in this Repository

  1. Simple GAN
  2. DC-GAN
  3. Improved DC-GAN
  4. W-GAN
  5. AC-GAN
  6. Pix2Pix

Comparison of GAN models in MNIST Digit generation dataset:

GAN

https://arxiv.org/pdf/1406.2661.pdf

Uses Denses layers both in generator & discriminator model. There are 2 major problems of GANS:

  1. Mode Collapse: The generator learns simple features to fool the discriminator and exploits them.
  2. Blurry Images

GAN

DC-GAN

https://arxiv.org/pdf/1511.06434v2.pdf

Uses Convolutionals (CNN) neural networks. The generator uses Conv2DTranspose layers to upscale the image, while the discriminator uses Conv2D with Strides to downscale the images.

DC-GAN

Improved DC-GAN

https://arxiv.org/pdf/1801.09195.pdf

The improved model of the DC-GAN contains methods for improving the discriminator model. This makes it harder for the generator to fool the discriminator, which forces it to learn more features and improve image quality. Some of the improvements are:

  1. Adding Dropout Layers both in Generator & Discriminator. Dropout layers act as Noise, which aim to prevent mode collapsing.
  2. Adding additional Gaussian Noise to the input of discriminator.
  3. Adding Batch Normalization at the output of each layer.
  4. Replacing RELU with Leaky Relu.
  5. Replacing Sigmoid with Tanh activation function at the output of generator. Also, the dataset if normalized to values between -1 and 1.
  6. Training the discriminator some extra steps, before training the generator.
  7. Adding label smoothing in the Binary Crossentropy (BCE) loss function.
  8. Setting b1 parameter of ADAM to 0.5.

Improved DC-GAN

WGAN-GP (Gradient Penalty)

https://arxiv.org/pdf/1704.00028v3.pdf

Replaces BCE loss of Discriminator with Wasserstein loss. Also, It uses Gradient Penalty method to penalize the weights.

W-GAN

AC-GAN

https://arxiv.org/pdf/1610.09585.pdf

Adds label information to the GAN intpus. The generator takes as an input the labels (targets) of the images. The discriminator has 2 output layers: One for classifying whether images are real or fake and one for classifying the label (target) of an image.

AC-GAN

Pix2Pix Patch-GAN

https://arxiv.org/pdf/1611.07004v3.pdf

I have implemented the patch gan as in the paper with the following improvements:

  • The discriminator is trained extra steps.
  • The discriminator contains noise in its inputs.
  • Unet generator is replaced by Unet3+.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.