In this project I want to implement and try several approaches on generating artificial data from scratch.
As these are all Machine Learning models they learn from given data. We are using two different datasets until now. MNIST and CelebA. However, it is straightforward to extend implementation to other datasets.
Architecture details
Autoencoder architecture is fully described by a set of parameters:
- base_channels: Number of channels after first convolution
- conv_blocks_per_decrease: Convolutions in each downsizing module
- channel_increase_factor: Factor by which channels increase after each downsizing module
- encode_factor: Number of downsizing modules
- latent_dim: Dimension of encoding vector
- initial_upsample_size: Start resolution in decoder
- skip_connections: Use ResNet like skip connections in downsizing modules
- auxillary: Allow encoder to also learn class labels (makes training easier)
For a more exact description see configs folder
A model summary can be retrieved by running python -m models.Autoencoder -h
. Note: parameters in summary are currently hardcoded.
Convolutional model with linear hidden dimension
Autoencoder, that encodes to a n-dimensional linear feature vector. n is dependent on architecture parameters. Standard is 128.
Reconstructions results for standard Autoencoder (128 dimensions)
MNIST |
t-SNE representation of hidden space
To see how well the model is seperating classes, we sample from the test set and visualize their hidden represention using t-SNE. We use MNIST as we have class labels.
Variational Autoencoders (VAE)
Variational autoencoders similarily to Autoencoders trying to find a good hidden encoding for reconstruction of input data. However, they encode to a mean and variance, where the minimization of KL-divergence to a standard normal distribution is part of optimization objective. Thus artificial data can be generated by sampling from a standard normal distribution and decode these.
Reconstruction of given test samples
MNIST |
Randomly generated artificial samples