Rapid Parameter Inference for Spatiotemporal Stochastic Biological Models using Neural Posterior Estimation

Read the full article See related articles

Discuss this preprint

Start a discussion What are Sciety discussions?

Listed in

This article is not in any list yet, why not save it to one of your lists.
Log in to save this article

Abstract

Parameter inference for stochastic models is essential for quantitative biology, but is hampered by intractable likelihoods. Agent-based random walk models, used widely in ecology and cell biology, exemplify this challenge, often forcing researchers to use likelihood-free methods like Approximate Bayesian Computation (ABC) that introduce biases and tuning difficulties, or else surrogate models which rely on a potentially unfaithful approximation and require an explicit, potentially erroneous, noise model. Here, we overcome these limitations using Neural Posterior Estimation (NPE), a simulation-based, machine learning inference framework that learns the full posterior distribution. Once trained, NPE provides amortized, near-instantaneous posterior estimates. We deploy this framework on a random walk model of a barrier assay experiment describing in vitro cell migration. We demonstrate our approach in two settings: first, using one-dimensional summary statistics (column counts), and second, by augmenting NPE with a novel convolutional neural network (CNN) that enables NPE to learn directly from raw two-dimensional spatial data. In both cases, NPE remains the core inference engine, with the CNN serving as a feature extraction component for spatial data. On synthetic data, our NPE pipeline proves highly effective in both settings, delivering posterior estimates at a substantially reduced computational cost per inference. When applied to 1D summary statistics, the pipeline matches or exceeds the precision of classical methods. Similarly, for 2D spatial data, NPE augmented with CNN performs inference directly on raw images with a precision comparable to that from curated summary statistics. This second capability is critical, as it moves beyond the traditional reliance on lower-dimensional data and opens up new avenues for complex models where informative summary statistics are not obvious or available. We provide an open-source implementation of our pipeline to facilitate its adoption and extension to more complex, spatially-structured biological models. This work provides a practical framework for parameter inference in spatial stochastic models that leverages machine learning to avoid the need for likelihood functions, hand-crafted summary statistics, and approximate noise models.

Article activity feed