Project developed for the AILab: Computer Vision and NLP course
- Lorenzo Zanda
- Davide Vittucci
- Paolo Marchetti
- Gabriele Sepe
The goal of this project is to build a DCGAN capable of generating new Pokémon images that mimic the style, silhouettes, and color palette of the original 819 Pokémon. We chose a DCGAN over more advanced architectures (e.g. StyleGAN) because it strikes a good balance between implementation simplicity and computational cost.
A DCGAN pits two convolutional networks against each other:
- Generator (G) — turns a random latent vector into a 64×64×3 RGB image via transposed convolutions.
- Discriminator (D) — classifies images as real (from the dataset) or fake (from the Generator) via strided convolutions.
The two are trained jointly in a minimax game: G tries to fool D, D tries not to be fooled, and over time G learns to produce increasingly convincing Pokémon-like images.
- Source: Pokémon Images Dataset — all 819 Pokémon existing at the time of the project.
- Preprocessing: resize to 64×64, center crop, normalization to
[-1, 1](to match the Generator'sTanhoutput). - Augmentation: horizontal flip (
src/augment.py), which safely doubles the dataset size. Other augmentations (vertical flip, brightness jitter) were tried but discarded — they corrupted the background of generated images.
Takes a latent noise vector and upsamples it through transposed convolutions:
latent → 4×4×512 → ... → 32×32×64 → 64×64×3
Each intermediate layer uses BatchNorm + ReLU; the output layer uses only Tanh.
Downsamples a 64×64×3 image to a single real/fake score:
64×64×3 → 32×32 → 16×16 → 8×8 → 4×4 → scalar
Uses spectral normalization + LeakyReLU + Dropout at every layer, BatchNorm on the intermediate layers (skipped on the input and output layers to preserve raw low-level and final decision information respectively), and a Sigmoid on the final scalar output.
Spectral normalization, dropout, and label smoothing were introduced to counter discriminator overfitting, which otherwise caused unstable, spiky training dynamics.
repo/
├── src/
│ ├── augment.py # Dataset augmentation (horizontal flip, etc.)
│ ├── config.py # Hyperparameters & paths (LATENT_SIZE, BATCH_SIZE, LR, ...)
│ ├── dataset.py # Dataloader construction
│ ├── generate.py # Generate new Pokémon from a trained checkpoint
│ ├── init_folders.py # Creates models/ and results/ output folders
│ ├── models.py # Generator, Discriminator, weight initialization
│ ├── train.py # Train / resume-train the DCGAN
│ └── utils.py # Device selection, plotting, GIF/sample saving, seeding
├── notebooks/ # Exploratory / experiment notebooks
├── paper_eng.pdf # Full project report
├── presentation.pptx # Project presentation slides
└── main.py # Entry point
-
Install depencies:
pip install -r requirements.txt
-
Get pretrained weights
Pretrained model checkpoints (after 10,000 epochs) can be downloaded from the GitHub Releases page:
10000-generator.pth10000-discriminator.pth
Place the downloaded
.pthfiles inside themodels/directory before running generation. -
Run
main.pypython main.py
After 10,000 epochs of training the model reliably produces silhouettes and color palettes faithful to the original art style, even if fine details remain blurry.
Evolution of a generated sample over training
- Limited dataset. Only 819 base images (1,638 after horizontal-flip augmentation) is a small dataset for a GAN. Other augmentations (vertical flip, brightness) hurt output quality by altering generated backgrounds.
- Discriminator overfitting. The Discriminator tends to memorize training details rather than generalize, hurting overall GAN balance. Mitigated with spectral normalization, dropout, and label smoothing, but not fully eliminated.
- Use a larger, more diverse dataset (e.g. fan-made Pokémon art, other creature datasets).
- Explore more advanced GAN architectures (e.g. StyleGAN).
- Train for longer / with better-tuned schedules.
- DCGAN PyTorch Tutorial
- Pokémon Images Dataset (Kaggle)
- Goodfellow et al., Generative Adversarial Networks, Communications of the ACM, 2020.
- Karras et al., Progressive Growing of GANs for Improved Quality, Stability, and Variation, arXiv:1710.10196, 2017.
- Radford, Metz & Chintala, Unsupervised Representation Learning with Deep Convolutional GANs, arXiv:1511.06434, 2015.
- Sebastian Raschka — Introduction to GANs (YouTube playlist)
Pokémon® is a registered trademark of Nintendo/Game Freak/Creatures Inc. This project is an academic, non-commercial exercise in generative modeling and is not affiliated with or endorsed by the Pokémon Company.




