This project implements a Deep Convolutional Generative Adversarial Network (DCGAN) using PyTorch to generate anime-style faces from random noise.
The model is trained on the Anime Faces Dataset from Kaggle.
Generated samples are saved during each training epoch to visualize model progress.
The project follows the standard DCGAN architecture introduced by Radford et al., 2015, with:
- Generator (G): Transposed convolutional layers that upsample a latent vector
zinto an image. - Discriminator (D): Convolutional layers that classify images as real or fake.
- Adversarial training: The Generator aims to fool the Discriminator, while the Discriminator learns to distinguish generated images from real ones.
The project uses the Anime Faces Dataset from Kaggle:
This dataset contains over 63,000 cropped anime faces at 64x64 resolution.
Images are preprocessed (normalized between -1 and 1) before being fed into the model.
Ensure the following dependencies are installed before running the notebook: bash torch torchvision matplotlib numpy tqdm Pillow
Run jupyter notebook in terminal and the code will pop up in the browser
The Generator progressively improves image quality as training proceeds. Below is an example of generated samples after epochs:
(Insert generated sample here, e.g., samples/epoch_20.png)
Training stability depends on careful tuning of the learning rate and beta1 values.
Discriminator loss generally oscillates, while Generator loss decreases steadily.
Increasing the number of epochs leads to sharper, more realistic faces.
Credits for the code go to jonbruner. Keeping ezgan code as the base I have built the deep convolutional generative adversarial network which can generate anime faces.