Reforming Generative Autoencoders via Goodness-of-Fit Hypothesis Testing

Aaron Palmer, Dipak K. Dey, Jinbo BiUAI 2018

Abstract

Generative Autoencoders (GAEs) typically rely on variational inference or adversarial training to regularize latent spaces. However, these methods often suffer from training instability, computational overhead, or a lack of statistical interpretability. This paper introduces the Hypothesis Testing Autoencoder (HTAE), which replaces the traditional discriminator network with a classical "goodness-of-fit" test—specifically the Shapiro-Wilk test. By leveraging established statistical theory, HTAE provides an objective measure of latent normality, reduces parameter count, and accelerates training while maintaining high generative quality.

1. Introduction

The primary challenge in training Generative Autoencoders (GAEs) lies in ensuring the latent "code" layer follows a prior distribution, typically a standard Gaussian. This property is essential for the model to function as a generative system, allowing users to sample from the latent space to produce novel data.

Historically, two paradigms have dominated this space: Variational Autoencoders (VAEs), which utilize Kullback-Leibler (KL) divergence, and Adversarial Autoencoders (AAEs), which employ a discriminator network to distinguish between encoded samples and the prior. While effective, VAEs are prone to producing blurry reconstructions due to the nature of the KL penalty, and AAEs are notoriously difficult to optimize, requiring a delicate balance between the generator and the discriminator. This paper proposes a third path: treating the latent distribution constraint as a statistical hypothesis testing problem.

2. The Hypothesis Testing Autoencoder (HTAE)

The authors propose the Hypothesis Testing Autoencoder (HTAE), which eliminates the need for a neural network-based critic. Instead, it utilizes the Shapiro-Wilk (SW) test, a well-established statistical tool for assessing normality.

2.1 Multivariate Shapiro-Wilk (MSW) Test

Because the standard Shapiro-Wilk test is univariate, the authors developed a multivariate generalization (MSW) suitable for high-dimensional latent spaces. The process involves:

  1. Whitening: Standardizing the latent codes using their empirical mean and covariance.
  2. Vectorization: Performing a composite test for normality across the dimensions of the whitened data.

2.2 Optimization Strategy

The HTAE training loop alternates between minimizing reconstruction error and satisfying the normality constraint. If the latent codes fail the MSW test (indicated by a low p-value), an inner optimization loop is triggered. This loop specifically updates the encoder's parameters to align the latent distribution with the target Gaussian, guided by the gradients of the test statistic.

3. Theoretical Foundations

A significant contribution of this work is the mathematical link between classical statistics and optimal transport. The authors demonstrate that the Shapiro-Wilk test asymptotically leads to the same solution as the $L_2$-Wasserstein distance. This provides a theoretical bridge between the proposed hypothesis-testing framework and modern Wasserstein-based generative models, suggesting that HTAE is not just a heuristic but a statistically grounded alternative to adversarial training.

4. Experimental Results

The HTAE was evaluated on the MNIST dataset against several baselines, including AAE, WAAE (Wasserstein AAE), and MMDAE (Maximum Mean Discrepancy AE).

4.1 Computational Efficiency

By removing the discriminator network, HTAE significantly reduces the number of trainable parameters and the time per iteration. In tests involving an 8-dimensional latent space, HTAE-MSW completed $10^5$ iterations in 548 seconds, whereas AAE and WAAE required 982 seconds and 1092 seconds, respectively. This represents nearly a 2x speedup over standard adversarial methods.

4.2 Latent Space Quality

The HTAE provides an objective "green light" for convergence via the p-value. Unlike the relative scores provided by discriminators, a p-value $> 0.05$ offers a statistically rigorous threshold for normality. Quantile-Quantile (Q-Q) plots confirmed that HTAE achieves a superior fit to the normal distribution compared to adversarial models, which often exhibit heavy tails or skewness in the latent space.

4.3 Generative Performance

Despite the simplified architecture, the generative quality of HTAE remains competitive. The reconstructed and generated digits are visually clean, often surpassing the clarity of traditional AAEs while avoiding the "blurriness" typically associated with VAEs.

5. Conclusion and Future Work

The HTAE framework offers a promising alternative to adversarial generative modeling by replacing black-box discriminators with interpretable statistical tests. It is faster, requires fewer parameters, and provides a clear metric for convergence.

Future research will focus on scaling this approach to higher-dimensional datasets such as CelebA or ImageNet. Additionally, the authors suggest exploring other "goodness-of-fit" tests (e.g., Mardia’s or Henze-Zirkler) to determine the optimal balance between computational cost and statistical power. Because the framework is distribution-agnostic, it could theoretically be adapted to any prior distribution for which a valid goodness-of-fit test exists.

Summary updated

BibTeX
@inproceedings{palmer2018reforming,
  author = {Aaron Palmer and Dipak K. Dey and Jinbo Bi},
  title = {{Reforming Generative Autoencoders via Goodness-of-Fit Hypothesis Testing}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2018},
}
Figure