GithubHelp home page GithubHelp logo

suryansh-sinha / animefacegenerator Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 13.63 MB

Using DCGANs to generate anime faces.

Jupyter Notebook 100.00%
dcgan dcgan-pytorch deep-convolutional-gan gan gans generative-adversarial-network pytorch pytorch-dcgan pytorch-implementation

animefacegenerator's Introduction

AnimeFaceGenerator

PyTorch implementation of the DCGAN introduced in the paper "Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks" by Radford et al. on the Anime Faces Dataset by McKinsey666.

DCGAN

DCGAN, introduced by Radford et al. in 2015, is a seminal work in the field of generative models. Its key contributions are as follows:

  1. Architecture Guidelines:
  • DCGAN replaces fully connected layers with convolutional layers in both the generator and discriminator.
  • It employs batch normalization to stabilize training.
  • Pooling layers are removed, and strided convolutions are used for downsampling.
  • ReLU activation functions are used in the generator (except for the output layer, which uses tanh).
  • LeakyReLU activation functions are employed in the discriminator.
  1. Stable Training:
  • DCGAN demonstrates that following the architectural guidelines leads to more stable training of GANs.
  • It mitigates issues like mode collapse and vanishing gradients.
  1. Image Synthesis:
  • DCGAN achieves impressive results in generating high-quality images.
  • It can synthesize realistic images from random noise vectors.
  1. Latent Space:
  • The generator learns a meaningful latent space where different directions correspond to distinct features.
  • By interpolating between points in this space, smooth transitions between generated images can be created.

The generator architecture as shown in the paper - architecture.png

Anime Faces Dataset

The Anime Face Dataset was created by Mckinsey666. This dataset has 63,632 "high-quality" anime faces.

The data has been preprocessed using torchvision.transforms by resizing, cropping and normalizing the images.

Training

I have trained the model using the hyperparameters used in the original paper. Feel free to play with the parameters in the colab notebook. I am planning to convert this notebook into individual scripts in the future!

Results

After training for 25 epochs, you can see the results in the GIF below -

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.