All Projects → Tejas-Nanaware → GAN-Anime-Characters

Tejas-Nanaware / GAN-Anime-Characters

Licence: MIT license
Applied several Generative Adversarial Networks (GAN) techniques such as: DCGAN, WGAN and StyleGAN to generate Anime Faces and Handwritten Digits.

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to GAN-Anime-Characters

coursera-gan-specialization
Programming assignments and quizzes from all courses within the GANs specialization offered by deeplearning.ai
Stars: ✭ 277 (+544.19%)
Mutual labels:  generative-adversarial-network, dcgan, wgan, stylegan
pytorch-gans
PyTorch implementation of GANs (Generative Adversarial Networks). DCGAN, Pix2Pix, CycleGAN, SRGAN
Stars: ✭ 21 (-51.16%)
Mutual labels:  generative-adversarial-network, dcgan, gan-models
Dcgan wgan wgan Gp lsgan sngan rsgan began acgan pggan tensorflow
Implementation of some different variants of GANs by tensorflow, Train the GAN in Google Cloud Colab, DCGAN, WGAN, WGAN-GP, LSGAN, SNGAN, RSGAN, RaSGAN, BEGAN, ACGAN, PGGAN, pix2pix, BigGAN
Stars: ✭ 166 (+286.05%)
Mutual labels:  generative-adversarial-network, dcgan, wgan
Awesome Gans
Awesome Generative Adversarial Networks with tensorflow
Stars: ✭ 585 (+1260.47%)
Mutual labels:  generative-adversarial-network, dcgan, wgan
Generative-Model
Repository for implementation of generative models with Tensorflow 1.x
Stars: ✭ 66 (+53.49%)
Mutual labels:  dcgan, wgan, stylegan
Generative adversarial networks 101
Keras implementations of Generative Adversarial Networks. GANs, DCGAN, CGAN, CCGAN, WGAN and LSGAN models with MNIST and CIFAR-10 datasets.
Stars: ✭ 138 (+220.93%)
Mutual labels:  generative-adversarial-network, dcgan, wgan
Anogan Tf
Unofficial Tensorflow Implementation of AnoGAN (Anomaly GAN)
Stars: ✭ 218 (+406.98%)
Mutual labels:  generative-adversarial-network, dcgan
Pytorch-Basic-GANs
Simple Pytorch implementations of most used Generative Adversarial Network (GAN) varieties.
Stars: ✭ 101 (+134.88%)
Mutual labels:  dcgan, wgan
Pytorch-conditional-GANs
Implementation of Conditional Generative Adversarial Networks in PyTorch
Stars: ✭ 91 (+111.63%)
Mutual labels:  generative-adversarial-network, dcgan
MMD-GAN
Improving MMD-GAN training with repulsive loss function
Stars: ✭ 82 (+90.7%)
Mutual labels:  generative-adversarial-network, dcgan
Tensorflow Mnist Gan Dcgan
Tensorflow implementation of Generative Adversarial Networks (GAN) and Deep Convolutional Generative Adversarial Netwokrs for MNIST dataset.
Stars: ✭ 163 (+279.07%)
Mutual labels:  generative-adversarial-network, dcgan
DCGAN-CIFAR10
A implementation of DCGAN (Deep Convolutional Generative Adversarial Networks) for CIFAR10 image
Stars: ✭ 18 (-58.14%)
Mutual labels:  generative-adversarial-network, dcgan
progressive growing of GANs
Pure tensorflow implementation of progressive growing of GANs
Stars: ✭ 31 (-27.91%)
Mutual labels:  generative-adversarial-network, wgan
Pytorch Generative Model Collections
Collection of generative models in Pytorch version.
Stars: ✭ 2,296 (+5239.53%)
Mutual labels:  generative-adversarial-network, wgan
Image generator
DCGAN image generator 🖼️.
Stars: ✭ 173 (+302.33%)
Mutual labels:  generative-adversarial-network, dcgan
DCGAN-Pytorch
A Pytorch implementation of "Deep Convolutional Generative Adversarial Networks"
Stars: ✭ 23 (-46.51%)
Mutual labels:  generative-adversarial-network, dcgan
progressive-growing-of-gans.pytorch
Unofficial PyTorch implementation of "Progressive Growing of GANs for Improved Quality, Stability, and Variation".
Stars: ✭ 51 (+18.6%)
Mutual labels:  generative-adversarial-network, wgan
keras-text-to-image
Translate text to image in Keras using GAN and Word2Vec as well as recurrent neural networks
Stars: ✭ 60 (+39.53%)
Mutual labels:  generative-adversarial-network, dcgan
Semantic image inpainting
Semantic Image Inpainting
Stars: ✭ 140 (+225.58%)
Mutual labels:  generative-adversarial-network, dcgan
hyperstyle
Official Implementation for "HyperStyle: StyleGAN Inversion with HyperNetworks for Real Image Editing" (CVPR 2022) https://arxiv.org/abs/2111.15666
Stars: ✭ 874 (+1932.56%)
Mutual labels:  generative-adversarial-network, stylegan

Introduction

Apply several algorithms of Generative Adversarial Networks that can create anime faces. In this repository, I have applied four GAN Algorithms:

  1. Deep Convolutional Generative Adversarial Networks (DCGAN).
  2. Wasserstein Generative Adversarial Networks (WGAN).
  3. StyleGAN by Nvidia Research Labs.
  4. StyleGAN2 ADA (PyTorch) by Nvidia Research Labs.

Dataset

The dataset consists of high resolution 140,000 512x512 images of anime faces which is of about 11GB and can be downloaded here.

Implementation

The algorithms for the GAN models is provided in the respective directories.
The models were trained on Nvidia K80 Tesla GPUs on XSEDE Portal except StyleGAN which was trained on Nvidia RTX 2070 since the subscription was over. StyleGAN2 ADA was trained on Nvidia RTX 3060 for about 3 days to improve the results.

The GAN Algorithm consists of two neural networks, Generator and Discriminator. Generator takes random noise as input (np.random.normal() usually) and consists of several Convolutional Transpose layers that create the fake images. Discriminator takes a combination of real and fake images and applies a simple classification problem for real and fake images.

The models are trained differently. First the generator model is trained using the noise and then the full GAN model is trained while training the discriminator. Therefore, while training the generator, the gradients are used only to update the generator. Where as, while training discriminator, the gradients update the weights for both generator and discriminator.

Observations

The model convergence while training GANs is difficult as there are two neural networks that are to be trained so it is difficult for hyperparameter optimization and it is common for either the generator or the discriminator model to collapse resulting in faulty training. While optimization is simpler for simpler dataset such as MNIST digits, the results would have been better if the model was trained for a longer duration. The primary goal for using a simpler dataset was to understand how to obtain the balance between the generator and discriminator and understand model collapses.

Out of all the algorithms, StyleGAN 2 ADA performed the best to generate anime faces. The observations are given below.

  1. StyleGAN2 ADA
    Anime Faces using StyleGAN2 ADA
  2. StyleGAN
    Anime Faces using StyleGAN
  3. DCGAN
    Anime Faces using DCGAN
  4. DCGAN for MNIST Digits
    MNIST Digits using DCGAN
  5. WGAN
    The WGAN model faces generator collapse frequently and since StyleGAN outperforms WGAN, I invested more training time for StyleGAN than WGAN.

Timelapse Videos

Since the output after every epoch looks fascinating, I created timelapse videos uploaded on YouTube.
Here are the timelapse videos to see how the generator progresses with number of epochs.

  1. StyleGAN2
    Timelapse of Anime Faces using StyleGAN
  2. StyleGAN
    Timelapse of Anime Faces using StyleGAN
  3. DCGAN
    Timelapse of Anime Faces using DCGAN
  4. DCGAN for MNIST Digits
    Timelapse of MNIST Digits using DCGAN

Comparing results for StyleGAN and StyleGAN2 ADA

StyleGAN2 ADA performes better than StyleGAN and was implemented a year after StyleGAN due to lack of resources. I tried to train StyleGAN2 ADA over Google Colab but it needed more memory so it was trained on a local computer on RTX 3060. StyleGAN2 ADA performs better and requires less training time. The results were more significant in less iterations as compared to StyleGAN. StyleGAN2 ADA was trained over 880 kimg whereas StyleGAN was trained for over 4421 kimg.

The FID50k metric was used for evaluating the models. StyleGAN achieved an FID score of 119.83 whereas StyleGAN2 ADA achieved an FID score of 14.55.

Downloads

The trained models can be downloaded using this Link.

The StyleGAN models can be downloaded using this Link.

The StyleGAN2 model can be downloaded using this Link.

Licence Information

The Licence is MIT open source for the entire directory except StyleGAN which has its own licence present in the directory.

Reference Papers

  1. Radford, A., Metz, L., & Chintala, S. (2015). Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434. DCGAN.
  2. Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein gan. arXiv preprint arXiv:1701.07875. Wasserstein GAN.
  3. Jin, Y., Zhang, J., Li, M., Tian, Y., Zhu, H., & Fang, Z. (2017). Towards the automatic anime characters creation with generative adversarial networks. arXiv preprint arXiv:1708.05509. Improved version of DCGAN.
  4. Karras, T., Laine, S., & Aila, T. (2019). A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition (pp. 4401-4410). StyleGAN.
  5. Radford, A., Metz, L., & Chintala, S. (2015). Unsupervised representation learning with deep convolutional generative adversarial networks.arXiv preprint arXiv:1511.06434. Additional paper that creates bedrooms with GAN.
  6. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., & Hochreiter, S. (2017). Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in neural information processing systems (pp. 6626-6637). Fréchet Inception Distance which is used for evaluating GANs.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].