PCAAE: Principal Component Analysis Autoencoder for organising the latent space of generative networks

Chi-Hieu Pham, Saïd Ladjal, Alasdair NewsonarXiv 2020

Abstract

Autoencoders and generative models produce some of the most spectacular deep learning results to date. However, understanding and controlling the latent space of these models presents a considerable challenge. Drawing inspiration from principal component analysis and autoencoder, we propose the Principal Component Analysis Autoencoder (PCAAE). This is a novel autoencoder whose latent space verifies two properties. Firstly, the dimensions are organised in decreasing importance with respect to the data at hand. Secondly, the components of the latent space are statistically independent. We achieve this by progressively increasing the latent space during training, and with a covariance loss applied to the latent codes. The resulting autoencoder produces a latent space which separates the intrinsic attributes of the data into different components of the latent space, in a completely unsupervised manner. We also describe an extension of our approach to the case of powerful, pre-trained GANs. We show results on both synthetic examples of shapes and on a state-of-the-art GAN. For example, we are able to separate the color shade scale of hair and skin, pose of faces and the gender in the CelebA, without accessing any labels. We compare the PCAAE with other state-of-the-art approaches, in particular with respect to the ability to disentangle attributes in the latent space. We hope that this approach will contribute to better understanding of the intrinsic latent spaces of powerful deep generative models.

Introduction

Deep generative models, such as Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs), are renowned for their ability to synthesize high-fidelity images. However, their latent spaces—the low-dimensional representations from which images are generated—often suffer from entanglement. In an entangled space, a single latent dimension might simultaneously influence multiple semantic attributes, such as hair color, gender, and head pose. This lack of interpretability makes precise control over the generation process difficult.

The Principal Component Analysis Autoencoder (PCAAE) addresses this by integrating the hierarchical and independent nature of classical Principal Component Analysis (PCA) into the deep learning framework. The goal is to create a latent space where dimensions are ordered by their contribution to data variance and are statistically independent, enabling unsupervised disentanglement.

Methods

The PCAAE architecture achieves an organized latent space through two key mechanisms: progressive training and a specialized covariance loss.

Progressive Training

To impose a hierarchy of importance, the model is trained sequentially. As shown in Figure 1, the process begins by training a latent space with a single dimension ($Z_1$). Once this dimension captures the most significant variation, it is frozen. A second dimension ($Z_2$) is then added, and a new decoder is trained to reconstruct the data using both the frozen $Z_1$ and the new $Z_2$. This iterative process continues until $n$ dimensions are reached, forcing the network to prioritize the most critical features in the earlier components.

The progressive training scheme of PCAAE, where latent dimensions are added and trained sequentially.

Covariance Loss

To ensure statistical independence between dimensions, a covariance loss is added to the objective function. This penalty discourages correlation between latent components, preventing the "bleeding" of attributes across different sliders. The authors also extend this framework to pre-trained GANs by training a small PCAAE to map onto a GAN's existing latent space, reorganizing its navigation controls without retraining the entire model.

Results

The model was evaluated on synthetic datasets (ellipses) and high-dimensional real-world data (CelebA faces).

Disentanglement Performance

Quantitative analysis using the Absolute Pearson Correlation Coefficient (PCC) demonstrates that PCAAE achieves superior disentanglement compared to standard VAEs and $\beta$-VAEs. In the ellipse dataset, the first dimension ($Z_1$) correlates almost perfectly (0.97) with the area of the ellipse, while other dimensions remain independent, capturing rotation or axis ratios without overlap.

Comparison of latent space traversals for VAE, $\beta$-VAE, $\beta$-TCVAE, and PCAAE on the synthetic ellipses dataset.

Qualitative Success on CelebA

On the CelebA dataset, PCAAE successfully identifies and separates high-level attributes like head pose, hair color, and gender into distinct, ordered latent dimensions. This discovery is entirely unsupervised, requiring no human-provided labels during training. The model naturally finds "head pose" as a major source of pixel variance before more subtle features like hair thickness.

Discussion and Conclusion

The PCAAE offers a robust method for organizing latent spaces by combining progressive training with independence constraints. While the sequential training approach can be computationally intensive, it provides a clear hierarchy of features that standard models lack. Future work may explore training dimensions in "packets" to improve efficiency and integrating perceptual losses to reduce the blurriness often associated with $L_2$ reconstruction. By "re-wiring" pre-trained GANs, PCAAE serves as a versatile tool for interpreting and controlling state-of-the-art generative models.

Summary updated

BibTeX
@misc{pham2020pcaae,
  author = {Chi-Hieu Pham and Saïd Ladjal and Alasdair Newson},
  title = {{PCAAE: Principal Component Analysis Autoencoder for organising the latent space of generative networks}},
  year = {2020},
  eprint = {2006.07827},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.07827},
}
Figure