Reconstructing Cell Lineage Trees from Phenotypic Features with Metric Learning

Da Kuang, GuanWen Qiu, Junhyong Kim

Introduction

Reconstructing the "family tree" of cells usually requires complex genetic engineering. However, a new deep learning framework called CellTreeQM aims to infer these lineages directly from abundant single-cell RNA sequencing (phenotypic) data. By framing tree reconstruction as a metric learning problem based on the mathematical "four-point condition," the model learns an embedding space optimized for phylogenetic trees. This allows researchers to uncover hidden lineage relationships even with noisy data and minimal supervision.

The Challenge: Genotype vs. Phenotype

Understanding how a single fertilized egg divides and differentiates into a complex organism requires mapping the cell lineage tree. Currently, the gold standard is prospective lineage tracing using CRISPR-Cas9 to insert mutating barcodes into a cell's DNA. However, this genetic engineering is ethically constrained (e.g., impossible in humans) and technically limited in many organisms.

Shift from Genotype to Phenotype

Meanwhile, modern single-cell technologies can easily measure the high-dimensional molecular phenotypes of cells, such as their RNA transcripts via scRNA-seq. The open question is: can we reconstruct a cell's lineage history using only its observable phenotype? This is incredibly difficult because phenotypic data is noisy, and cells that look similar (e.g., two muscle cells) might have evolved from entirely different branches of the lineage tree—a phenomenon called convergent differentiation. The authors tackle the challenge of extracting cryptic, historical lineage signals from this noisy, present-day phenotypic data.

Introducing CellTreeQM

The authors propose CellTreeQM (Cell Tree Quartet Metric), a Transformer-based deep learning model that projects high-dimensional scRNA-seq data into a lower-dimensional latent space where distances between cells accurately reflect their true lineage tree.

CellTreeQM Pipeline and Weak Supervision Settings

Key innovations of the framework include:

  • Additivity Loss via the Four-Point Condition: Instead of standard contrastive learning (like Triplet or Quadruplet loss), CellTreeQM uses a custom loss function based on a classic phylogenetic theorem. It looks at quartets (groups of four cells) and forces their pairwise distances to form a valid unrooted tree structure in the latent space.
  • Gumbel-Softmax Feature Gating: Because scRNA-seq data contains thousands of genes—many of which are irrelevant to lineage—the model uses a learnable, discrete mask to "turn off" noisy or confounding genes and focus only on heritable signals.
  • Deviation Regularization: A loss term prevents the learned embeddings from drifting too far from the original biological data, avoiding model collapse.
  • Tree Construction: Once the embedding space is learned, the classic Neighbor-Joining (NJ) algorithm builds the final tree.

Key Insights and Results

To evaluate their method, the authors introduced the Cell Lineage Reconstruction Benchmark, featuring synthetic Brownian-motion simulations, lineage-resolved C. elegans datasets, and CRISPR-barcoded mESC data.

The experiments revealed several critical insights:

  • Phenotypes do hide lineages: Despite biological noise and convergent cell states, transcriptomic data contains enough cryptic lineage information to reconstruct trees when viewed through the right geometric lens.
  • Standard metric learning falls short: Common contrastive losses fail to capture global tree topologies because they only push and pull points locally. Explicitly enforcing tree-metric properties is necessary to build a globally coherent tree.
  • Massive improvements over baselines: On the C. elegans Small dataset, direct reconstruction from raw data yields a poor Robinson-Foulds (RF) distance. CellTreeQM achieved a 69% relative improvement in RF distance over the raw data, vastly outperforming Triplet loss (17.9%) and Quadruplet loss (45.4%). Adding the Gumbel feature gate pushed this improvement even higher, to 75.7%.
  • Robust to weak supervision: You don't need a fully labeled tree to train the model. In "high-level partition" settings (knowing only broad clades), CellTreeQM successfully generalized to unknown quartets, outperforming baselines that tended to overfit to known clades.

Limitations and Future Work

The authors acknowledge that the model relies on the Neighbor-Joining (NJ) algorithm for final tree construction, which can still fail if the learned distances are too complex or noisy. Additionally, while feature gating worked perfectly in simulations to suppress noise, its impact on real data was milder, suggesting that real biological "noise" is highly correlated with actual signals.

Future work will explore replacing NJ with more robust tree-inference methods, such as Bayesian approaches or Graph Neural Networks (GNNs). The team also aims to improve the purely unsupervised version of CellTreeQM and extend the framework to handle highly heterogeneous developmental atlases with only partial annotations.

Summary updated

BibTeX
@inproceedings{kuang2025reconstructing,
  author = {Da Kuang and GuanWen Qiu and Junhyong Kim},
  title = {{Reconstructing Cell Lineage Trees from Phenotypic Features with Metric Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=JjhnSLb2wO},
}
Figure