This repository contains the implementation of a Conditional Variational Autoencoder (CVAE) model. CVAEs are an extension of Variational Autoencoders (VAEs) that allow for the generation of data conditioned on certain attributes. This can be particularly useful for tasks where controlling the generated output is desirable, such as attribute-guided image synthesis and semi-supervised learning.
- Conditional Generation: Generate data conditioned on specific attributes.
- Customizable Architecture: Easily adjust the architecture to fit different datasets and tasks.
- Training and Evaluation Scripts: Includes scripts for training the model and evaluating its performance.
- Visualization Tools: Tools to visualize the latent space and generated samples.
- Python 3.x
- PyTorch
- NumPy
- Matplotlib
In this implementation, conditional variational autoencoder is used to generate images of MNIST dataset containing images of handwritten digits, and FashionMNIST dataset containing images of 10 different cloth categories. Model succeeds in generating images with good overall structure, but it also generates blurry images which often happens with this family of models comparing to GANs and Diffusion models. Generated images are sometimes not well structured, which is expected since generation is based on gaussian noise, but it may be possible to alleviate this issue in the future implementations.
Results on MNIST dataset, generating 50 images, 5 from each digit:
Results on FashionMNIST dataset, generating 50 images, 5 from each cloth category:
This project is licensed under the MIT License - see the LICENSE file for details.
- Kingma, D. P., & Welling, M. (2013). Auto-Encoding Variational Bayes. arXiv preprint arXiv:1312.6114.
- Sohn, K., Lee, H., & Yan, X. (2015). Learning Structured Output Representation using Deep Conditional Generative Models. Advances in Neural Information Processing Systems, 28.

