Proceedings of the National Academy of Sciences

Unsupervised Bayesian neural networks enable inference of complex epidemiological and macroevolutionary processes

Gabriele Marino, Ugnė Stolz, Cecilia Valenzuela Agüí, Tanja Stadler, Daniele Silvestro

Computational

Key points

From the paper's conclusion
  • Our framework substantially expands the capabilities of birth–death models, providing a powerful and flexible approach to infer complex epidemiological and macroevolutionary processes.

Abstract

Birth–death models quantify macroevolutionary and epidemiological processes, including speciation, extinction, and transmission, based on phylogenetic trees. Extensions of these models incorporate external covariates as predictors of these parameters, for instance linking traits or environmental variables with changes in these rates. However, the dependencies between predictors and model parameters are typically restricted to linear, additive effects and may thus fail to capture complex, nonlinear relationships underlying evolutionary dynamics. To address this limitation, we propose a framework that leverages unsupervised Bayesian neural networks to flexibly model functional relationships between these parameters and a broad set of predictors, including categorical traits, quantitative variables, and time series data. Based on these covariates, the network weights and thus the resulting birth–death dynamics are estimated jointly with the phylogenetic tree, obtained directly from sequence alignment data. Extensive simulations show that this approach accurately recovers predictor–parameter relationships, mitigates overfitting, and remains robust across both macroevolutionary and epidemiological contexts. Using explainable AI, we further show that our framework reliably identifies the most influential predictors and yields interpretable descriptions of their impact on the inferred rates. Finally, we apply our method in two empirical analyses: linking SARS-CoV-2 migration dynamics with travel data during its early spread in Europe, and inferring trait- and time-dependent speciation and extinction rates in the diversification of platyrrhines. Our framework substantially expands the capabilities of birth–death models, providing a powerful and flexible approach to infer complex epidemiological and macroevolutionary processes.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers