Work

Physics-Informed and Relational Inverse Learning for Synthetic-to-Real Microbial Dynamics

Scientific Machine LearningPhysics-Informed LearningOperator LearningGraph Neural NetworksMicrobial DynamicsPyTorch

For my MSc dissertation, I trained inverse models on synthetic microbial ecosystems and tested whether they could infer parameters that reproduce sparse, noisy real mouse microbiome data.

comparison of synthetic interaction recovery across classical, physics-informed, operator, graph, and attention-based inverse models

In my MSc dissertation, I studied whether models trained on simulated microbial communities could infer parameters that explain real biological trajectories. Simulation gives us known parameters to learn from, but the real mouse microbiome data were sparse and noisy, and their underlying parameters were unknown, so I needed to test whether what the models learned in simulation remained useful under those conditions.

The Problem

I used the generalised Lotka-Volterra model, which describes how microbial populations grow and influence one another, to model eleven microbial taxa. Working backwards from observed population abundances meant estimating growth rates, directed interactions between every pair of taxa, and antibiotic susceptibilities, giving 143 parameters in total. These values cannot be read directly from an abundance curve, and the real dataset provided only nine mice divided across three intervention protocols.

The protocols covered a mostly stable control condition, exposure to clindamycin, and clindamycin followed by a C. difficile challenge, so the dataset allowed me to compare transfer in relatively stable communities with transfer when an external intervention changed the dynamics.

What I Built

  • I generated 12,000 synthetic ecologies, with nine trajectories for each ecology, giving 108,000 trajectories with different initial conditions and intervention histories.

  • To bring the training data closer to the real setting, I reproduced the mouse study’s sparse sampling schedules and included measurement noise, outliers, detection censoring, and explicit intervention events.

  • I kept each ecology within a single training, validation, or test split, so trajectories generated from the same parameter set could not appear on both sides of an evaluation.

  • Every neural model was trained and selected using synthetic data only, and I first evaluated its predicted parameters against the known simulation values.

  • For the real mice, where there was no parameter ground truth, I used the inferred parameters to simulate new gLV trajectories and compared those curves with the observations.

  • I also withheld one intervention condition at a time, so each model had to infer the system from the remaining mice before simulating a condition it had not observed.

Models and Evaluation

Model familyWhat I compared
Classical baselineRegularised gLV regression
Supervised inverse networkParameter prediction from observed trajectories
Physics-informed inverse networkPINN with an equation-based constraint
Inverse operatorPI-DION with and without its physics residual
Quantum-classical variantHybrid quantum-classical PINN
Relational variantsGraph and attention-based decoders for species interactions

The relational decoders predict interactions through relationships between species instead of treating the full interaction matrix as a single flat output.

I trained models across multiple random seeds, selected ensembles using synthetic validation data, and used paired bootstrap intervals when comparing methods, because an average from one run would not show how stable the differences were. I also included simple baselines, such as a persistence model that assumes the microbial population does not change. That baseline was difficult to beat on the nearly static control mice, so a low trajectory error there was not enough to demonstrate useful parameter inference.

What I Found

  • Synthetic recovery: recovering the interaction matrix was the main difficulty, and graph-based relational decoders reduced its recovery error by 21–28% relative to the standard PINN, supporting the use of species-to-species structure for this task.

  • Real-data transfer: every neural method achieved a lower mean trajectory error than Ridge across the six antibiotic-exposed mice, although none had received real-data weight updates. PINN graph plus attention performed best on those mice with the full cohort available, while PI-DION graph performed best on average when an entire intervention condition was hidden.

  • Physics constraint: in the matched PI-DION comparison, adding the equation residual lowered error on antibiotic-exposed mice by 2.2%, but worsened performance on the mostly static control mice and changed synthetic parameter error by less than 0.1%, so the benefit depended on the regime.

  • Quantum-classical model: it did not improve accuracy and required roughly 34 times the training time of the matched classical PINN.

Synthetic interaction recovery across the compared inverse models. Graph-based relational decoders produced the clearest improvement in interaction recovery.

Tools and methods

AreaTools and methods
Biological modellingGeneralised Lotka-Volterra dynamics, intervention-aware synthetic data
Neural modelsPyTorch, PINNs, PI-DION, graph and attention-based decoders
Quantum variantHybrid quantum-classical PINN
EvaluationEcology-held-out splits, repeated seeds, paired bootstrap intervals, condition-held-out simulation

What I learnt

No method performed best in every setting. Graph-based interaction decoders improved recovery on synthetic systems and transferred well to perturbed real mice, while the physics constraint helped only in particular regimes, so the choice of model needed to account for the dynamics being evaluated. The project also showed a practical limitation of synthetic-to-real learning, because the model that performs best on synthetic validation data may not transfer best to real data, and real parameter labels are unavailable to guide that selection.

Working through this benchmark helped me understand why evaluation design matters alongside architecture. Keeping ecologies separate, modelling realistic distribution shifts, including simple baselines, repeating seeds, and examining individual conditions allowed me to see where transfer was useful and where a favourable average could conceal a limitation.

Start a conversation

Have something
in mind?

If you have a question about my work or something you would like to work on together, I would be glad to hear about it.

Get in touch