TrajectoryNet: A Dynamic Optimal Transport Network for Modeling Cellular Dynamics

Alexander Tong, Jessie Huang, Guy Wolf, David van Dijk, Smita Krishnaswamy

TL;DR

TrajectoryNet is a novel framework that uses Neural ODEs and Continuous Normalizing Flows (CNFs) to reconstruct continuous, high-dimensional trajectories from static "snapshot" data. By linking optimal transport theory with biological priors, it allows researchers to interpolate how individual cells evolve over time, even though the measurement process itself is destructive.

What Problem Does This Paper Address?

In fields like biology, we often deal with "cross-sectional" data. Imagine trying to understand a marathon by taking a single photo of the runners at the 5-mile mark, another group at the 10-mile mark, and a third at the finish line. You have thousands of data points, but you don't know the path of any individual runner.

This is the reality of single-cell RNA sequencing (scRNA-seq). To measure a cell's gene expression, you must destroy it. Consequently, we get snapshots of populations at different time points but lose the "longitudinal" history of how one state transitions into another.

Conceptual overview of TrajectoryNet inferring continuous paths from cross-sectional snapshots.

Existing methods like static Optimal Transport (OT) try to match these populations, but they often assume cells move in straight lines (Euclidean paths), ignoring the complex, non-linear "manifold" of biological possibility.

Methods

The authors introduce TrajectoryNet, which treats the transition between cell distributions as a Dynamic Optimal Transport problem.

Key technical components include:

  • Continuous Normalizing Flows (CNF): Instead of discrete jumps, TrajectoryNet uses a Neural ODE to define a continuous velocity field $f(x, t)$. This allows the model to predict a cell's position at any arbitrary time point.
  • The Optimal Transport Link: The authors prove that a CNF with an $L_2$ penalty on the velocity field approximates the $W_2$ (Wasserstein-2) optimal transport path. This "straightens" the flows to be efficient.
  • Biological Regularizations: To make the paths realistic, they add several penalties to constrain the otherwise highly flexible CNFs:
Comparison of trajectory inference methods mapping a source distribution to an 'S' shaped target.
*   **Energy & Jacobian:** Discourages high-velocity and high-curvature paths to ensure smoothness.
  • Density/Manifold: Forces trajectories to stay within the regions where cells were actually observed, preventing "shortcuts" through biologically impossible states.
  • Velocity: Incorporates "RNA velocity" data—a short-term estimate of a cell's direction—to guide the long-term trajectory.
  • Growth: Handles "unbalanced" transport to account for cells dividing or dying.

Datasets

The model was evaluated on both synthetic and real-world biological data:

  • Artificial Manifolds: 2D "Arch," "Tree" (branching), and "Cycle" datasets designed to test if the model can follow non-linear paths and handle loops.
  • Mouse Cortex Data: A 4-timepoint dataset (E12.5 to E17.5) capturing the development of the brain's cortex.
  • Embryoid Body Data: A 5-timepoint scRNA-seq dataset (Day 0 to Day 24) showing human embryonic stem cells differentiating into various lineages.

Key Insights and Ideas

  • CNFs are Under-constrained: Standard normalizing flows just care about matching the target distribution; they don't care how they get there. TrajectoryNet imposes "physics" (optimal transport) on the path itself.
  • The Manifold Matters: Cells don't move through a vacuum. By penalizing paths that stray from observed data density, TrajectoryNet ensures that interpolated cells look like real cells.
  • Short-term vs. Long-term: The paper elegantly combines RNA velocity (which is accurate for very short intervals) with Optimal Transport (which is better for global, long-term shifts) to get the best of both worlds.
  • Continuous vs. Pairwise: Unlike previous OT methods that only match $T_1$ to $T_2$, TrajectoryNet learns a single smooth function for the entire time series, allowing for more robust interpolation between unevenly spaced samples.

Key Results

TrajectoryNet consistently outperformed static OT and other baselines in terms of Earth Mover’s Distance (EMD) on held-out timepoints.

  • Artificial Data: On the "Arch" dataset, TrajectoryNet achieved an EMD of 0.243, significantly better than static OT (0.644), which tried to cut across the arch in a straight line.
  • Mouse Cortex: The model (with density and velocity priors) achieved a mean EMD of 0.859, outperforming static OT (1.096).
  • Qualitative Success: The model successfully reconstructed the "Cycle" dataset (representing cell cycles), a task that is mathematically impossible for standard optimal transport without velocity priors.

Limitations and Future Work

  • Deterministic Nature: The current model uses a deterministic ODE. The authors note that biological systems are often stochastic (random), and future work could incorporate Stochastic Differential Equations (SDEs).
  • Growth Term Complexity: While the model handles unbalanced transport, the growth/death rates are currently trained somewhat separately. Integrating the learning of the growth term more tightly with the dynamics is a suggested next step.
  • Computational Scale: While more efficient than grid-based solvers, training Neural ODEs on very high-dimensional gene space (20k+ genes) still requires dimensionality reduction (like PCA) for practical runtimes.

Summary updated

BibTeX
@inproceedings{tong2020trajectorynet,
  author = {Alexander Tong and Jessie Huang and Guy Wolf and David van Dijk and Smita Krishnaswamy},
  title = {{TrajectoryNet: A Dynamic Optimal Transport Network for Modeling Cellular Dynamics}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=SnVZt6XuSlc},
}
Figure