Shape your Space: A Gaussian Mixture Regularization Approach to Deterministic Autoencoders

Amrutha Saseendran, Kathrin Skubch, Stefan Falkner, Margret Keuper

The Generative Modeling Trade-off

Generative modeling often forces researchers to choose between probabilistic complexity and deterministic simplicity. Variational Autoencoders (VAEs) are powerful, but their probabilistic nature makes them notoriously difficult to train. Furthermore, they typically assume a simple, uni-modal Gaussian prior. This rigid assumption often forces complex, multi-modal data into a single, unstructured "blob" in the latent space, degrading representation quality.

Conversely, Deterministic Autoencoders (RAEs) are much easier to train but offer little to no control over the latent space's structure. To generate new samples, they usually require a "post-hoc" step—fitting a density model to the latent space only after training is complete.

This paper introduces a "best of both worlds" framework: a deterministic model that is easy to train, yet actively shapes the latent space into an expressive, multi-modal distribution—specifically, a Gaussian Mixture Model (GMM)—during the training process itself.

Shaping the Space with the KS Test

The core innovation of this paper is a novel regularization scheme that abandons the standard KL-divergence. Instead, the authors employ a multivariate variant of the Kolmogorov-Smirnov (KS) test, a statistical method used to determine if a sample follows a specific reference distribution.

The proposed loss function consists of two primary components:

  1. Marginal Matching ($L_{KS}$): This term ensures that the marginal cumulative distribution functions (CDFs) of the encoded data align with the CDFs of the target GMM prior.
  2. Covariance Matching ($L_{CV}$): Because matching marginals alone cannot capture the correlations between different dimensions, this term explicitly matches the empirical covariance of the latent codes to the covariance of the GMM prior.

Crucially, this objective is deterministic and end-to-end trainable. The authors also introduce a clever heuristic to automatically estimate the weights of these loss terms, significantly reducing the need for tedious hyperparameter tuning.

Random samples, reconstructions, and interpolations across MNIST, SVHN, and CelebA datasets.

Key Insights: Beyond the "Blob"

By utilizing a GMM prior, the model allows the latent space to form multiple distinct "neighborhoods." This is a far more natural fit for datasets with inherent categories, such as different digits in MNIST or distinct molecular structures.

Because the model is forced to fit data into the modes of a GMM, it performs unsupervised clustering essentially "for free." Visually similar images naturally gravitate toward the same Gaussian component. Furthermore, unlike the Wasserstein distance which often requires numerical approximations, the KS-based loss for GMMs can be derived in closed form. This provides computational efficiency and a strong, stable gradient signal.

In tasks like molecular design, where Bayesian Optimization (BO) is used to search the latent space for optimal candidates, having a well-structured, multi-modal latent space significantly improves search efficiency and the validity of the generated molecules.

State-of-the-Art Results

The model was rigorously evaluated across several domains, including image generation (MNIST, Fashion-MNIST, SVHN, CelebA) and structured discrete data (arithmetic expressions and the ZINC250k molecular dataset).

Quantitative comparison of FID scores across various autoencoder architectures.

The proposed method (GMM-DAE) achieved state-of-the-art Fréchet Inception Distance (FID) scores—a standard metric for image quality and diversity. As shown in the quantitative results, it outperformed standard VAEs, Wasserstein AEs, and even RAEs that rely on post-hoc density estimation. On MNIST, the model achieved an impressive FID of 13.11, drastically improving upon the vanilla VAE's 27.27.

Beyond generation, the model achieved an 85.53% unsupervised clustering accuracy on MNIST, outperforming specialized clustering models like JointVAE. In chemical design tasks, the model successfully discovered molecules with higher "drug-likeness" scores while maintaining a higher fraction of valid samples compared to grammar-based VAEs.

Limitations and Future Directions

While powerful, the approach does have limitations:

  • Prior Knowledge Requirement: The user must pre-define the number of Gaussian components ($K$) in the GMM. While the model shows some robustness, an ill-chosen $K$ can lead to sub-optimal clustering or generation.
  • Higher-Order Moments: The current loss focuses strictly on marginals and covariances. It does not explicitly match higher-order statistical moments, which might be necessary for capturing extremely complex distributions.
  • Batch Size Sensitivity: The regularization can become unstable in very high-dimensional spaces if the training batch size is too small, as accurate empirical CDF estimation requires a sufficient number of samples.

Future work may focus on extending the framework to automatically learn the optimal number of modes or adapting the loss formulation to better handle datasets with extreme class imbalances.

Summary updated

BibTeX
@inproceedings{saseendran2021shape,
  author = {Amrutha Saseendran and Kathrin Skubch and Stefan Falkner and Margret Keuper},
  title = {{Shape your Space: A Gaussian Mixture Regularization Approach to Deterministic Autoencoders}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure