All Projects
Generative AI

Anime Face Generation (DCGAN)

DCGAN trained 100 epochs on Tesla T4 on 43K anime images. ConvTranspose2d stack (100→512→256→128→64→3). β₁=0.5, label smoothing, StepLR. Slerp latent interpolation for smooth transitions.

100
Training epochs
~58s (T4)
Time per epoch
200
Generated samples
100
Latent dimension
Dataset

43,102 anime face images (64×64 px)

Approach

DCGAN + slerp interpolation + 4 stability techniques (β₁=0.5, label smooth, StepLR, init)

Tech Stack
PythonPyTorchDCGANConvTranspose2dCUDA Tesla T4
Keywords
DCGANGANPyTorchGenerative AISlerpConvTranspose2dTesla T4
Deep Dive

DCGAN trained from scratch on 43,102 anime face images (64×64 px).

Architecture

Generator: z(100) → ConvTranspose2d×4 [512→256→128→64→3] → Tanh
Discriminator: Conv2d×4 [64→128→256→512] → Sigmoid

4 Training Stability Techniques

TechniqueWhy It Matters
Adam β₁=0.5 (not 0.9)Prevents momentum oscillations in adversarial training
Weight init N(0,0.02) Conv, N(1,0.02) BNAvoids discriminator lock-in at initialization
StepLR ×0.5 at epoch 50Prevents LR divergence in late training
Label smoothing Real→0.9Softens discriminator targets, prevents overconfidence

Training Results

  • 100 epochs, ~58s/epoch on Tesla T4
  • 200 generated samples
  • Avoided mode collapse and checkerboard artifacts

Slerp Interpolation

def slerp(z1, z2, t):
    omega = arccos(clip(dot(z1/||z1||, z2/||z2||), -1, 1))
    return sin((1-t)*omega)/sin(omega)*z1 + sin(t*omega)/sin(omega)*z2

Slerp respects the hyperspherical geometry of the latent space. Linear interpolation passes through low-density regions and produces muddy in-betweens. Slerp stays on the manifold.