Introduction
Compositional data—non-negative measurements that sum to a constant, like relative species abundance in a microbiome or mineral proportions in geology—presents a unique challenge for machine learning. Because the parts must sum to a fixed total (e.g., 100%), they are mathematically dependent; if one component increases, others must decrease.
Standard dimensionality reduction tools like Principal Component Analysis (PCA) are designed for unconstrained Euclidean space, not the "simplex" where compositional data lives. Applying standard PCA directly often leads to impossible predictions, such as negative proportions. Traditionally, researchers bypass this by using transformations like the centered log-ratio (clr) to force the data into a Euclidean-like space before running PCA. However, this "transform-then-analyze" approach can be clunky, leads to singular covariance matrices, and often fails to capture the true underlying structure of the data.
This paper introduces a novel framework for learning low-dimensional representations directly from compositional data. By generalizing the Scaled Bregman Theorem, the authors develop CoDA-PCA and CoDA-AE, methods that respect the unique geometry of the simplex to uncover hidden structures that standard techniques miss.
Methodology: Bridging CoDA and Exponential Family PCA
The authors propose a way to learn representations directly from the original data by bridging Compositional Data Analysis (CoDA) and Exponential Family PCA.
- Scaled Bregman Theorem with Remainder: The theoretical foundation of the paper is a generalization of a recent theorem regarding Bregman divergences. The authors introduce a "remainder" term that relates the perspective transform of a divergence to the divergence of a perspective transform, providing the mathematical justification for their new loss functions.
- CoDA-PCA: Instead of minimizing standard squared error, CoDA-PCA minimizes a loss based on the KL-divergence, specifically tailored for the simplex. This is equivalent to fitting natural parameters from centered log-ratios, inherently respecting the sum-to-one constraints.
- Surrogate Loss (S-CoDA-PCA): Because the exact CoDA-PCA optimization is complex, the authors derive an upper-bound "surrogate" loss that simplifies the optimization into a more manageable form.
- CoDA-AE: The framework is extended to non-linear autoencoders. By replacing the linear projection of PCA with deep neural networks, CoDA-AE can capture highly complex, non-linear relationships in compositional datasets.
Key Insights and Results
The methods were evaluated on a synthetic "Arms" dataset (designed to test structure recovery) and two real-world microbiome datasets (HITChip Atlas and a Diet Swap Study).
Superior Structure Recovery
Standard PCA reconstructions often fall "outside" the simplex, predicting invalid negative proportions. CoDA-PCA, by design, stays within the valid data space. This geometric awareness translates to vastly improved structure recovery.
In the synthetic "arms" dataset—consisting of 20 lines extending from the center of a simplex to its vertices—standard PCA and even clr-PCA produced messy, overlapping visualizations. As shown above, only CoDA-PCA and CoDA-AE clearly recovered the distinct 20-arm star structure, proving their ability to "unmix" compositional dependencies.
Quantitative Gains on Real Data
On real microbiome data, CoDA-PCA and CoDA-AE significantly outperformed standard clr-PCA across multiple biologically relevant metrics.
While clr-PCA naturally performed better on the $L^2$-clr error (since it is explicitly designed to minimize that specific metric), the proposed CoDA methods achieved significantly lower errors in Jensen-Shannon Divergence (JSD) and Total Variation (TV) distance. Furthermore, the Autoencoder version (CoDA-AE) demonstrated better robustness against overfitting compared to standard clr-based autoencoders.
Limitations and Future Work
While promising, the framework has a few open challenges:
- Handling Zeros: Compositional data often contains zeros (e.g., a bacteria species not present in a sample), making log-ratios undefined. The authors currently handle this by adding a tiny constant ($\epsilon$) or redefining the "gauge" function, but a more integrated statistical treatment of zeros remains an open problem.
- Optimization Complexity: The loss functions are bi-convex. While successfully optimized using L-BFGS and alternating minimization, these methods are more computationally intensive than the simple Singular Value Decomposition (SVD) used in standard PCA.
Despite these limitations, the parametric neural network version (CoDA-AE) is well-suited for online learning scenarios, offering a highly promising direction for scaling compositional data analysis to massive, real-world datasets.
Summary updated