Spatial Variational Auto-Encoding via Matrix-Variate Normal Distributions

Zhengyang Wang, Hao Yuan, Shuiwang Ji

TL;DR

This paper introduces "Spatial Variational Auto-Encoders" (Spatial VAEs) that use matrix-variate normal (MVN) distributions to model latent representations as feature maps, explicitly capturing spatial information. This approach significantly improves image generation quality compared to standard VAEs, especially for complex datasets, by allowing richer dependencies within the latent space.

What Problem Does This Paper Address?

Traditional Variational Auto-Encoders (VAEs) represent latent variables as vectors, which are essentially 1x1 feature maps. While this works for simple tasks like digit generation, it struggles to explicitly encode spatial information in more complex image datasets. This forces the decoder to infer spatial relationships implicitly, often leading to blurry or less detailed generated images. The paper aims to address this limitation by enabling VAEs to directly model and preserve spatial information within their latent representations.

Methods

The core innovation is the use of Matrix-Variate Normal (MVN) distributions to sample latent representations. Instead of a vector, the latent variable is a feature map (e.g., $d \times d$ where $d > 1$). The encoder network outputs parameters for these MVN distributions.

  • Spatial VAEs via MVN Distributions: The latent representation is sampled from an MVN distribution, allowing for dependencies between rows and columns of the feature map.
  • Spatial VAEs via Low-Rank MVN Distributions: To further improve efficiency and model structure, the mean matrix of the MVN distribution is constructed as an outer product of two vectors. This reduces the number of parameters required by the encoder while still enforcing structural relationships in the latent space.

The paper also contrasts this with a "naïve" spatial VAE approach, which simply reshapes a standard VAE's latent vector into feature maps but doesn't fundamentally change the sampling process or introduce explicit spatial dependencies.

Datasets

  • CelebA: A dataset of 202,599 colored face images (64x64). Used for demonstrating improved face generation with more details.
  • CIFAR-10: A dataset of 60,000 color images (32x32) across 10 classes. Used to show improved generation of more detailed, less blurry images compared to standard VAEs.
  • MNIST: The handwritten digit dataset. Used for quantitative analysis via Parzen window log-likelihood estimates.

Key Insights and Ideas

  • Explicit Spatial Encoding is Crucial: The paper strongly argues that for complex image generation, explicitly encoding spatial information in the latent space is more effective than relying on powerful decoders to infer it.
  • MVN Distributions for Structured Latents: MVN distributions are a natural fit for generating structured data like feature maps, allowing for modeling of inter-dependencies within the map.
  • Low-Rank Formulation for Efficiency: The low-rank MVN approach strikes a good balance between capturing spatial information and managing model complexity (encoder output size and trainable parameters).
  • VAE as a Special Case: Standard VAEs can be seen as a special case of Spatial VAEs via MVN distributions where the feature map size is 1x1.

Key Results

  • Qualitative Improvement: Generated images from Spatial VAEs (especially the low-rank MVN version) show significantly more detail and structure compared to original VAEs across CelebA and CIFAR-10 datasets. For instance, faces generated by Spatial VAEs have more complete hair details.
  • Quantitative Performance: On the MNIST dataset, Spatial VAEs via low-rank MVN distributions achieve comparable (and in one case, slightly better) Parzen window log-likelihood estimates to the original VAEs, while offering superior visual quality.
  • Training Time: Spatial VAEs incur a slightly higher training time due to larger encoder outputs, but the low-rank MVN version significantly reduces this overhead compared to the naïve MVN approach. Generation time is largely unaffected.

Limitations and Future Work

  • Training Overhead: While the low-rank formulation mitigates it, Spatial VAEs generally require more encoder outputs than standard VAEs, potentially increasing training time.
  • Model Complexity vs. Performance: The paper suggests that the choice of $d$ (feature map size) and $N$ (number of feature maps) influences performance and complexity, implying a trade-off to be explored.
  • Future Work: The paper doesn't explicitly detail future work, but the success of the low-rank MVN formulation suggests further exploration of efficient MVN parameterizations and their application to other structured data generation tasks. The authors also note that generative model evaluation is complex, with visual quality and log-likelihood not always aligning.

Summary updated

BibTeX
@inproceedings{wang2017spatial,
  author = {Zhengyang Wang and Hao Yuan and Shuiwang Ji},
  title = {{Spatial Variational Auto-Encoding via Matrix-Variate Normal Distributions}},
  booktitle = {SDM},
  year = {2017},
  doi = {10.1137/1.9781611975673.73},
}
Figure