AugmentedPCA: A Python Package of Supervised and Adversarial Linear Factor Models

William E. Carson Iv, Austin Talbot, David CarlsonarXiv 2022

TL;DR

This paper introduces AugmentedPCA, a Python package that extends Principal Component Analysis (PCA) with supervised and adversarial objectives. This allows for learning more informative and robust latent representations, outperforming standard PCA in downstream tasks like classification and gene identification, while remaining interpretable and computationally efficient.

What Problem Does This Paper Address?

Dimensionality reduction techniques like PCA are crucial for understanding high-dimensional data, especially in fields like genomics. However, standard PCA focuses solely on capturing maximum variance, which might not align with specific downstream goals like predicting outcomes or ensuring fairness. While deep learning methods offer supervised and adversarial extensions, they often require large datasets and can be less interpretable. This paper addresses the need for linear, interpretable, and reproducible methods that can augment PCA with supervised or adversarial objectives, providing strong baselines for complex deep learning approaches.

Methods

The core contribution is the AugmentedPCA package, which implements two main linear factor models:

  • Supervised AugmentedPCA (SAPCA): Augments the standard PCA objective with a supervised loss. This encourages the learned components to be predictive of provided labels or outcomes. It's akin to a single-hidden-layer supervised autoencoder.
  • Adversarial AugmentedPCA (AAPCA): Augments PCA with an adversarial objective to enforce invariance to specific "concomitant" or nuisance variables. This is useful for tasks like domain adaptation or ensuring fairness. It's equivalent to a single-hidden-layer adversarial autoencoder.

Both SAPCA and AAPCA offer two inference strategies:

  • Local Inference: Factors are learned jointly from primary and augmenting data. This is suitable when augmenting data is available at test time.
  • Encoded Inference: Factors are learned from primary data via a linear mapping, making it suitable when augmenting data is not available at test time.

A key innovation is that these augmented objectives yield analytic solutions through eigendecompositions of augmented matrices, ensuring reproducibility and efficiency. For very high-dimensional data, a randomized approximation method is also provided to significantly reduce computational complexity.

Datasets

  • RNA-seq cancer gene expression dataset: Used to demonstrate SAPCA's utility in downstream classification and gene identification. This dataset contains deidentified RNA-seq counts from 801 tumor samples across five cancer types (breast, colon, kidney, lung, and prostate adenocarcinoma).
  • Extended Yale Face Database B: Used to demonstrate AAPCA's ability to create shadow-invariant representations. This dataset contains facial images with varying lighting conditions.

Key Insights and Ideas

  • Linear models can be powerful baselines: Even in the age of deep learning, linear models augmented with supervised or adversarial objectives can provide strong, interpretable, and reproducible results, serving as excellent benchmarks.
  • Augmenting PCA is effective: Simply adding a supervised or adversarial objective to PCA can significantly improve its performance on downstream tasks compared to standard PCA.
  • Interpretability is preserved: Unlike many deep learning methods, AugmentedPCA retains interpretable factor loadings, allowing for the identification of genes or features most relevant to the learned components.
  • Analytic solutions offer reproducibility: The ability to derive closed-form solutions through eigendecomposition ensures that the models are reproducible and less prone to training instabilities often seen in deep learning.
  • Randomized approximation for scalability: The inclusion of a randomized decomposition method makes AugmentedPCA practical for extremely high-dimensional datasets where exact eigendecomposition would be computationally prohibitive.

Key Results

  • Improved Classification Accuracy: In the cancer gene expression dataset, SAPCA achieved a test set tumor classification accuracy of 92% using just two components, significantly outperforming standard PCA (71%).
  • Enhanced Class Fidelity: SAPCA components showed much greater class separation in 2D visualizations compared to PCA.
  • Meaningful Gene Identification: SAPCA successfully identified genes implicated in specific cancer types (e.g., BRCA, LUAD), with loadings aligning with known biomarkers and biological functions.
  • Nuisance Variable Invariance: AAPCA demonstrated the ability to create representations that are invariant to lighting-induced shadows in facial images, leading to more robust identity classification.
  • Computational Efficiency: The randomized approximation method significantly reduced model fitting time for high-dimensional data compared to exact methods.

Limitations and Future Work

  • Linearity: The authors acknowledge that AugmentedPCA models are linear in nature, whereas deep learning approaches may offer superior performance on highly complex tasks. However, they argue that AugmentedPCA provides a valuable baseline and is more robust for smaller datasets.
  • Reconstruction Error: The paper suggests that including reconstruction error in the objective function, similar to some supervised autoencoder work, could further improve generalization in downstream classification tasks.
  • Further Exploration of Adversarial Objectives: While AAPCA demonstrates invariance to concomitant data, future work could explore more complex adversarial setups for fairness or domain adaptation.

Summary updated

BibTeX
@misc{iv2022augmentedpca,
  author = {William E. Carson IV and Austin Talbot and David Carlson},
  title = {{AugmentedPCA: A Python Package of Supervised and Adversarial Linear Factor Models}},
  year = {2022},
  eprint = {2201.02547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.02547},
}
Figure