Adaptive Compression of the Latent Space in Variational Autoencoders
Gabriela Sejnova, Michal Vavrecka, Karla Stepanova
TL;DR
This paper tackles the problem of selecting the latent-space dimensionality $n_z$ in Variational Autoencoders, a major hyperparameter influencing reconstruction quality and clustering. It proposes ALD-VAE, an automated method that gradually prunes neurons to adapt $n_z$ during training, using a multi-metric stopping rule that combines reconstruction loss, Fréchet Inception Distance (FID), and Silhouette score. Across four image datasets, ALD-VAE achieves performance close to or matching a model trained with the optimal fixed $n_z$, but with significantly reduced computation compared to grid search. The approach is simple to implement, end-to-end trainable, and can alleviate manual hyperparameter tuning in practical VAE deployments, with potential applicability to other data domains beyond images.
Abstract
Variational Autoencoders (VAEs) are powerful generative models that have been widely used in various fields, including image and text generation. However, one of the known challenges in using VAEs is the model's sensitivity to its hyperparameters, such as the latent space size. This paper presents a simple extension of VAEs for automatically determining the optimal latent space size during the training process by gradually decreasing the latent size through neuron removal and observing the model performance. The proposed method is compared to traditional hyperparameter grid search and is shown to be significantly faster while still achieving the best optimal dimensionality on four image datasets. Furthermore, we show that the final performance of our method is comparable to training on the optimal latent size from scratch, and might thus serve as a convenient substitute.
