MEmilio -- A high performance Modular EpideMIcs simuLatIOn software for multi-scale and comparative simulations of infectious disease dynamics

Julia Bicker, Carlotta Gerstein, David Kerkmann, Sascha Korf, René Schmieding, Anna Wendler, Henrik Zunker, Daniel Abele, Maximilian Betz, Khoa Nguyen, Lena Plötzke, Kilian Volmer, Agatha Schmidt, Nils Waßmuth, Patrick Lenz, Daniel Richter, Hannah Tritzschak, Ralf Hannemann-Tamas, Julian Litz, Paul Johannssen, Marielena Borges, Annika Jungklaus, Manuel Heger, Annalena Lange, Elisabeth Kluth, Kathrin Rack, Vincent Wieland, Jonas Arruda, Sebastian Binder, Margrit Klitz, Martin Siggel, Manuel Dahmen, Achim Basermann, Michael Meyer-Hermann, Jan Hasenauer, Martin J. Kühn

Abstract

Epidemic and pandemic preparedness with rapid outbreak response rely on timely, trustworthy evidence. Mathematical models are crucial for supporting timely and reliable evidence generation for public health decision-making with models spanning approaches from compartmental and metapopulation models to detailed agent-based simulations. Yet, the accompanying software ecosystem remains fragmented across model types, spatial resolutions, and computational targets, making models harder to compare, extend, and deploy at scale. Here we present MEmilio, a modular, high-performance framework for epidemic simulation that harmonizes the specification and execution of diverse dynamic epidemiological models within a unified and harmonized architecture. MEmilio couples an efficient C++ simulation core with coherent model descriptions and a user-friendly Python interface, enabling workflows that run on laptops as well as high-performance computing systems. Standardized representations of space, demography, and mobility support straightforward adaptations in resolution and population size, facilitating systematic inter-model comparisons and ensemble studies. The framework integrates readily with established tools for uncertainty quantification and parameter inference, supporting a broad range of applications from scenario exploration to calibration. Finally, strict software-engineering practices, including extensive unit and continuous integration testing, promote robustness and minimize the risk of errors as the framework evolves. By unifying implementations across modeling paradigms, MEmilio aims to lower barriers to reuse and generalize models, enable principled comparisons of implicit assumptions, and accelerate the development of novel approaches that strengthen modeling-based outbreak preparedness.

Introduction: Unifying the Fragmented World of Epidemic Modeling

The software landscape for infectious disease modeling has historically been fragmented. Researchers typically choose between three main "resolutions" depending on the scale and detail required: Population-Based Models (PBMs) for fast, aggregated dynamics; Metapopulation Models (MPMs) that link regions via mobility data; and Agent-Based Models (ABMs) for highly detailed individual interactions.

The multi-scale modeling approach of MEmilio, illustrating the refinement of resolution from population-based to agent-based models.

Historically, these models lived in separate software silos with incompatible data formats and languages. This fragmentation makes it nearly impossible to perform "apples-to-apples" comparisons or to switch between resolutions as an outbreak evolves. Furthermore, many existing tools lack the performance needed to run large-scale ensembles or national-level simulations on supercomputers. MEmilio tackles this by providing a unified, modular architecture that handles everything from a single city to an entire country.

Methods and Architecture

MEmilio employs a "best of both worlds" architecture: a high-performance C++ backend for heavy computation and a user-friendly Python frontend for workflow integration. This modular design allows for a variety of specialized packages, including epidata for data ingestion, surrogate for machine learning integration, and plot for visualization.

The modular architecture of MEmilio, featuring a C++ simulation core and a Python interface with specialized packages for data, surrogates, and visualization.

Key technical innovations include:

  • Multi-Formulation Support: Beyond standard ODEs, it supports the Linear Chain Trick (LCT) and Integro-Differential Equations (IDEs), allowing for more realistic, non-exponential stay times in disease states.
  • Hybrid Modeling: A novel temporal-hybrid approach that automatically switches from a stochastic ABM (useful for early, low-case-number outbreaks) to a deterministic PBM as the infected population grows, optimizing compute resources.
  • Surrogate Modeling: Integration of Graph Neural Networks (GNNs) to act as "surrogates" for expensive mechanistic simulations, enabling near-instantaneous results for large-scale ensemble studies.
  • Automatic Differentiation: Built-in tools for sensitivity analysis and optimal control, helping policymakers find the best balance between intervention strictness and economic cost.

Validation and Datasets

The authors validated MEmilio using several high-profile real-world scenarios, including Influenza in Germany (calibrated against Robert Koch Institute data), the 2014 Ebola outbreak in Guinea, and SARS-CoV-2 dynamics in both Germany and Spain. These simulations integrated diverse data sources, including mobility data from the German Federal Employment Agency and standard contact matrices like POLYMOD.

Key Insights: Resolution-Agnostic Specification

A core strength of MEmilio is its resolution-agnostic specification. Because the framework uses harmonized interfaces, a researcher can define a disease's progression once and then run it as a PBM, an MPM, or an ABM without rewriting the core logic. This allows for principled comparisons of implicit assumptions across different modeling paradigms.

Furthermore, the framework demonstrates the efficiency of hybridization. By switching from an ABM to a PBM mid-simulation once a disease is widespread, researchers can capture median dynamics perfectly while reducing runtime by orders of magnitude. The use of GNN surrogates further accelerates this, learning the "physics" of epidemic spread to run thousands of scenarios in seconds.

Performance and Scalability Results

Benchmarking reveals that MEmilio's C++ backend is exceptionally fast, simulating 500 days of a PBM in just $10^{-3}$ seconds. Even complex MPMs with 100 regions complete in under a second. In terms of scalability, the framework successfully simulated ABMs with up to 256 million agents, outperforming other state-of-the-art frameworks like Covasim or OpenCOVID.

Specific speedups include:

  • Hybrid Speedup: The temporal-hybrid model achieved a 99% reduction in simulation runtime compared to a pure ABM.
  • GNN Acceleration: For a 400-district model of Germany, GNN surrogates provided speedups ranging from 800x to over 32,000x compared to traditional numerical solvers.

Limitations and Future Work

While powerful, MEmilio faces ongoing challenges. Integro-differential equations (IDEs), while more realistic, are up to 15x slower than ODEs. Additionally, while GNN surrogates are fast, they remain "black boxes" that require careful validation against mechanistic models. Future work includes expanding mobility integration for IDE-based models and continuing to refine the interpretability of surrogate components. Ultimately, MEmilio argues that strict software engineering—including unit testing and CI/CD—is essential for producing reproducible, trustworthy public health evidence.

Summary updated

BibTeX
@misc{bicker2026memilio,
  author = {Julia Bicker and Carlotta Gerstein and David Kerkmann and Sascha Korf and René Schmieding and Anna Wendler and Henrik Zunker and Daniel Abele and Maximilian Betz and Khoa Nguyen and Lena Plötzke and Kilian Volmer and Agatha Schmidt and Nils Waßmuth and Patrick Lenz and Daniel Richter and Hannah Tritzschak and Ralf Hannemann-Tamas and Julian Litz and Paul Johannssen and Marielena Borges and Annika Jungklaus and Manuel Heger and Annalena Lange and Elisabeth Kluth and Kathrin Rack and Vincent Wieland and Jonas Arruda and Sebastian Binder and Margrit Klitz and Martin Siggel and Manuel Dahmen and Achim Basermann and Michael Meyer-Hermann and Jan Hasenauer and Martin J. Kühn},
  title = {{MEmilio -- A high performance Modular EpideMIcs simuLatIOn software for multi-scale and comparative simulations of infectious disease dynamics}},
  year = {2026},
  eprint = {2602.11381},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.11381},
}
Figure