TaKeTube / MNIST-GAN

✏️ ECE417 Final Project - Handwritten Digit Images Generation using Generative Adversarial Network (GAN)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handwritten Digit Images Generation using Generative Adversarial Network (GAN)

This is the final project of ECE 417 Multimedia Processing SP21

Reference

Pytorch's DCGAN Tutorial

URL: https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html

FID evaluation

URL: https://github.com/IsChristina/pytorch-fid

Training

To train the DCGAN, please run following command in console

python dcgan.py

If it is the first running, it would download MNIST dataset into data folder.

Evaluation

To evaluate the model, please

  • Get fake images. Use loader.py to load the model which is trained and saved by dcgan.py (path to model file should be set in loader.py), then, generate fake images.

  • Get real images. Please comment parts of the codes in loader.py then uncomment other parts.

After doing these, we have two folders of real and fake images respectively. Please go to the folder eval.

There are two folders in it, one is FID, another is MISSSIM.

To run FID, please use the following command in console opened in FID folder

./fid_score.py path/to/dataset1 path/to/dataset2

To run MISSSIM, please set the proper path in eval_misssim.py then run it. If the library is not installed, please use following command to install it:

pip install pytorch_msssim

Results

More results and trained models can be seen in results folder. Here are parts of them.

50 epochs, batch size 128, one-sided smoothing (true label set to 0.9)

Animation

Compare with real image

Loss during training

D(x) & D(G(z)) during training

A Failed training (200 epochs, batch size 256)

Animation

You can see mode collapse in this process.

Loss during training

D(x) & D(G(z)) during training

About

✏️ ECE417 Final Project - Handwritten Digit Images Generation using Generative Adversarial Network (GAN)


Languages

Language:Python 100.0%