Skip to content

arka57/Handwritten-Digits-generation-using-DCGAN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Handwritten digit generation using DCGAN

A Pytorch implemetation of DCGAN on the MNIST dataset.
DCGAN or Deep Convolutional GAN are a special type of GAN architecture where discriminator and generator are both CNNs. They can be used for many generative tasks and give better results compared to vanilla GAN's.

Here developed the DCGAN from scratch and trained on MNIST dataset to generate fake handwritten digits.
The project implementation follows the paper on DCGAN

Dataset

The MNIST dataset of handwritten digits was used for the project and is available publicly MNIST-0000000001-2e09631a_09liOmx

Model Architecture

The GAN architecture is shown in the figure below. As this is DCGAN so both generator and discriminator are CNN's

754471a

Generator is a CNN with ConvTranspose operations which generates fake handwritten digits(Dimension:1X64X64) from some random noise
Discriminator is also a CNN with Convolution operations which takes a image as input(Dimension:1X64X64) and classify whether the image it received is a real one or fake generated one.
Generator and Discriminator architecture is in the below figure

dcgan_architecture

Hyperparameters

LEARNING_RATE=2e-4
BATCH_SIZE = 128
IMAGE_SIZE = 64
CHANNELS_IMG = 1(MNIST dataset image has only 1 channel)
NOISE_DIM = 100
NUM_EPOCHS = 100
FEATURES_DISC = 64
FEATURES_GEN = 64

Results

The model was trained for 30 epochs in adversarial manner and then it was abled to generate decent images,some of them are below

test_final

References

DCGAN paper:[https://arxiv.org/abs/1511.06434v1]

About

Pytorch Implementation of DCGAN on MNIST dataset to generate fake handwritten digits

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages