Student-t Variational Autoencoder for Robust Density Estimation

Hiroshi Takahashi, Tomoharu Iwata, Yuki Yamanaka, Masanori Yamada, Satoshi YagiIJCAI 2018

Abstract

We propose a robust multivariate density estimator based on the variational autoencoder (VAE). The VAE is a powerful deep generative model used for multivariate density estimation. With the original VAE, the distribution of observed continuous variables is assumed to be a Gaussian, where its mean and variance are modeled by deep neural networks taking latent variables as their inputs. This distribution is called the decoder. However, the training of VAE often becomes unstable. One reason is that the decoder of VAE is sensitive to the error between the data point and its estimated mean when its estimated variance is almost zero. We solve this instability problem by making the decoder robust to the error using a Bayesian approach to the variance estimation: we set a prior for the variance of the Gaussian decoder, and marginalize it out analytically, which leads to proposing the Student-t VAE. Numerical experiments with various datasets show that training of the Student-t VAE is robust, and the Student-t VAE achieves high density estimation performance.

Introduction: The Zero-Variance Problem

Multivariate density estimation—learning the underlying probability distribution of continuous data—is a cornerstone of machine learning, essential for tasks ranging from anomaly detection to image synthesis. While Variational Autoencoders (VAEs) are powerful tools for this task, they suffer from a significant vulnerability known as the zero-variance problem.

In a standard "Gaussian VAE," the decoder predicts both a mean ($\mu$) and a variance ($\sigma^2$) for the data. If the training data contains clusters with very little variation—a common occurrence in sensor data or network logs—the model attempts to minimize loss by driving the predicted variance toward zero. However, as $\sigma^2 \to 0$, the Gaussian log-likelihood becomes extremely sensitive. Even a tiny error between the actual data point and the predicted mean causes the loss function to explode, leading to unstable gradients and failed training.

Figure 1: Visualization of the SMTP dataset and the training instability (loss spikes) associated with the zero-variance problem in standard VAEs.

As illustrated in Figure 1, datasets like SMTP (a) contain concentrated clusters that trigger this instability. The resulting spikes in the negative variational lower bound (b) correlate directly with instances where the decoded variance is minimized (c), making standard training unreliable.

Proposed Method: The Student-t VAE

To resolve this instability, we propose a Bayesian solution that makes the decoder more robust. Instead of the decoder directly outputting a fixed variance, we treat the inverse of the variance (the precision, $\tau$) as a random variable and place a Gamma distribution prior on it.

By mathematically integrating out the precision parameter (analytical marginalization), the resulting conditional distribution of the data given the latent variables ($p(x|z)$) transforms from a Gaussian into a Student-t distribution. This distribution is characterized by "heavy tails," meaning it assigns higher probability to points far from the mean compared to a Gaussian. This property acts as a natural buffer, preventing the "infinite loss" scenario when the predicted mean is slightly off.

Figure 2: The Student-t VAE decoder architecture, which outputs mean, precision, and degrees of freedom parameters.

As shown in Figure 2, the Student-t VAE decoder network learns to output three distinct parameters:

  1. Mean ($\mu$): The center of the distribution.
  2. Precision ($\lambda$): Related to the inverse of the scale.
  3. Degrees of Freedom ($\nu$): A parameter that controls the "heaviness" of the tails, allowing the model to adaptively decide the level of robustness required for different regions of the data space.

Experimental Results

The authors evaluated the Student-t VAE against standard Gaussian VAEs and Maximum A Posteriori (MAP) regularized versions across five diverse datasets: SMTP, Aloi, Thyroid, Cancer, and Satellite.

  • Superior Stability: On the SMTP, Aloi, and Thyroid datasets, the Gaussian VAE exhibited massive spikes in training loss. In contrast, the Student-t VAE remained perfectly stable throughout the entire training process.
  • Higher Log-Likelihood: The Student-t VAE consistently achieved higher test log-likelihoods. For instance, on the Aloi dataset (27D), the Student-t VAE reached a log-likelihood of 77.022, compared to 45.418 for the standard Gaussian VAE.
  • Noise Robustness: When synthetic noise was added to the training data, the Student-t VAE's performance remained steady, whereas the Gaussian VAE's performance plummeted as the noise ratio increased.

Conclusion

The Student-t VAE provides a mathematically principled and computationally efficient solution to the training instabilities inherent in standard VAEs. By replacing the Gaussian decoder with a marginalized Student-t distribution, the model gains robustness against low-variance clusters and outliers. This improvement leads to more stable training and significantly better density estimation performance on real-world, noisy datasets.

Summary updated

BibTeX
@inproceedings{takahashi2018student,
  author = {Hiroshi Takahashi and Tomoharu Iwata and Yuki Yamanaka and Masanori Yamada and Satoshi Yagi},
  title = {{Student-t Variational Autoencoder for Robust Density Estimation}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  url = {https://openreview.net/forum?id=rJWyTNGd-H},
}
Figure