Anime Face Generator using a Variational Autoencoder (VAE)
This repository contains the code and a trained model for generating anime character faces using a Variational Autoencoder (VAE). The VAE is trained on the Anime Face Dataset to learn a compressed, latent representation of the faces, which can then be sampled to generate new, unique images.
π Features
VAE Implementation: A complete implementation of a Variational Autoencoder in Python. Image Reconstruction: The model can take an existing anime face and reconstruct it. New Image Generation: Generate brand-new anime faces by sampling from a normal distribution in the latent space[cite: 25]. Latent Space Exploration: The included notebook allows for experimenting with latent space parameters to see how they affect the generated images[cite: 27, 28].
π§ Model Details
The model is a Variational Autoencoder, which consists of two main parts: an encoder and a decoder. The encoder maps an input image to a lower-dimensional latent space, and the decoder reconstructs the image from this latent representation.
The loss function is a combination of two terms:
- Reconstruction Loss: Measures how well the decoder can reconstruct the original image.
- Kullback-Leibler (KL) Divergence: This term acts as a regularizer on the latent space, pushing its distribution to be close to a standard normal distribution. [cite_start]The weight of the KL term is a critical hyperparameter that balances reconstruction quality and the structure of the latent space[cite: 18].