Implementation of Deep Convolutional GAN (DCGAN) using PyTorch
Trained on Kaggle Notebooks using anime faces and CelebA datasets.
- ✅ DCGAN built from scratch based on the original paper (arXiv:1511.06434v2).
- 🧱 Uses
ConvTranspose2d,BatchNorm2d, and correct weight initialization. - 🎯 Focused training on two datasets — Anime Faces and CelebA Facecards.
- 📊 Training tracked and visualized with TensorBoard.
- 🚀 Implemented and trained on Kaggle Notebooks.
| Anime Faces Dataset | CelebA Faces Dataset |
|---|---|
![]() |
![]() |
- Anime Faces Dataset
Kaggle LinkDiverse set with various artistic styles. Contains full-body characters, posters, and inconsistent framing.
The Anime Faces dataset is structured into 231 subfolders, each containing approximately 275 images.
To consolidate all images into a single folder for training, I wrote a simple script:
🔧
move_images.py— This script recursively goes through all subdirectories and moves the image files into a flat directory.You can run it before dataset preprocessing to simplify your dataloader setup.
- CelebA Face Dataset
Kaggle LinkHigh-quality, consistent, and aligned facial images—ideal for DCGAN convergence.
| Step 0 to Epoch 10 | |
|---|---|
![]() |
![]() |
| Epoch 10 to 35 | |
|---|---|
![]() |
![]() |
⚠️ Observation: Mode collapse and reduced diversity as training continued. The anime dataset has noise and non-face images which led to instability.
| Step 0 to Epoch 10 | |
|---|---|
![]() |
![]() |
| Epoch 10 to 35 | |
|---|---|
![]() |
![]() |
✅ Insight: CelebA dataset yielded clearer, more consistent face generations even after prolonged training—thanks to higher quality and alignment.
Launch TensorBoard locally:
tensorboard --logdir logs









