Skip to content

OpenABM-Covid19: Individual-Level Network Simulation for Epidemic Policy Analysis

By Jeff 5 views
OpenABM-Covid19 individual disease state machine showing transitions from Susceptible through Exposed, Presymptomatic, Symptomatic/Asymptomatic, Severe/Critical, to Recovered or Dead
OpenABM-Covid19 individual disease state machine showing transitions from Susceptible through Exposed, Presymptomatic, Symptomatic/Asymptomatic, Severe/Critical, to Recovered or Dead

OpenABM-Covid19 is an open-source, individual-based model developed by the Pandemic Sciences Institute at the University of Oxford and Nuffield Department of Medicine. Unlike compartmental models (SIR/SEIR), it tracks every individual in a synthetic population across a realistic contact network, enabling fine-grained analysis of non-pharmaceutical interventions (NPIs), vaccination strategies, and healthcare capacity constraints. The model was used extensively during the COVID-19 pandemic to advise UK government policy and has since been generalized for broader epidemic modeling research.

Architecture: Individual-Based Contact Networks

At its core, OpenABM-Covid19 constructs a stratified random network of contacts across three domains:

  • Household contacts — drawn from census-calibrated household size distributions
  • Occupational contacts — assigned by age-stratified employment sector (healthcare, education, retail, etc.)
  • Random community contacts — parameterized by age and interaction frequency

Each individual is assigned demographic attributes (age, sex, occupation, comorbidities) and progresses through a detailed disease state machine: Susceptible → Exposed → Presymptomatic → Symptomatic/Asymptomatic → Mild/Moderate/Severe/Critical → Recovered/Dead. Transition probabilities are age-stratified and calibrated against clinical outcome data.

The model is implemented in C with a Python API (openabm-covid19 package), making it fast enough to simulate populations of 100,000+ individuals in minutes on a standard workstation.

Key Modeling Capabilities

1. Intervention Modeling

OpenABM-Covid19 was designed specifically to evaluate NPIs. Interventions can be toggled dynamically during a simulation run:

import COVID19.model as abm

params = abm.Parameters(
    n_total=100000,
    end_time=200,
    hospital_on=True
)
model = abm.Model(params)

# Run baseline for 30 days, then apply interventions
for t in range(30):
    model.one_time_step()

# Enable household quarantine + app-based contact tracing
model.update_running_params("quarantine_household_on", 1)
model.update_running_params("app_turn_on", 1)
model.update_running_params("app_users_fraction", 0.6)

for t in range(30, 200):
    model.one_time_step()

df = model.results  # pandas DataFrame of daily outputs

This dynamic parameterization allows analysts to model phased lockdowns, school reopenings, and test-trace-isolate programs with precise timing.

2. Vaccination Module

The vaccination module supports multi-dose schedules with configurable efficacy against infection, symptomatic disease, and severe outcomes. Rollout can be prioritized by age group or occupation:

# Prioritize 70+ age group first
model.update_running_params("vaccine_on", 1)
model.update_running_params("vaccine_efficacy_infection", 0.7)
model.update_running_params("vaccine_efficacy_severe", 0.95)
model.update_running_params("vaccine_priority_age_group", 70)
model.update_running_params("vaccine_daily_doses", 500)

Waning immunity can be modeled by scheduling efficacy reductions at specified time steps, enabling booster dose analysis.

3. Healthcare Capacity Constraints

Unlike many ABMs, OpenABM-Covid19 explicitly models hospital and ICU bed capacity. When capacity is exceeded, critical patients who cannot be admitted face elevated mortality rates. This feedback loop is critical for realistic surge analysis:

params = abm.Parameters(
    n_total=100000,
    hospital_on=True,
    n_hospital_beds=500,
    n_ICU_beds=50
)

The model tracks daily hospital admissions, ICU occupancy, and deaths separately, enabling direct comparison against NHS capacity thresholds.

4. Contact Tracing and Testing

The digital contact tracing module simulates app-based exposure notification with configurable adoption rates, notification delays, and quarantine compliance. Manual contact tracing with finite tracer capacity is also supported, allowing realistic modeling of system bottlenecks under high incidence.

Calibration and Validation Workflow

OpenABM-Covid19 ships with calibration utilities that fit model parameters to observed epidemic curves using Approximate Bayesian Computation (ABC) or maximum likelihood estimation. The typical workflow:

  1. Load observed data — daily cases, hospitalizations, deaths from surveillance systems
  2. Define prior distributions — for transmission rate, asymptomatic fraction, etc.
  3. Run ABC sweeps — using the Python API in parallel across parameter samples
  4. Posterior analysis — extract credible intervals for key outputs

The model's contact network parameters have been validated against POLYMOD contact surveys for the UK, France, and Germany, and demographic parameters are configurable for other countries via CSV input files.

Ensemble Analysis and Uncertainty Quantification

Because individual-based models are stochastic, policy conclusions require ensemble runs. A typical analysis runs 50–200 replications per scenario:

import multiprocessing as mp
import pandas as pd

def run_scenario(seed, intervention_day, app_fraction):
    params = abm.Parameters(n_total=100000, end_time=200, rng_seed=seed)
    model = abm.Model(params)
    for t in range(intervention_day):
        model.one_time_step()
    model.update_running_params("app_turn_on", 1)
    model.update_running_params("app_users_fraction", app_fraction)
    for t in range(intervention_day, 200):
        model.one_time_step()
    return model.results[['time', 'total_death', 'n_hospital']]

# Run 100 replicates in parallel
with mp.Pool(8) as pool:
    results = pool.starmap(run_scenario, [(s, 30, 0.6) for s in range(100)])

ensemble = pd.concat(results).groupby('time').agg(['mean', 'quantile'])

Ensemble outputs feed directly into policy dashboards showing median trajectories with 95% credible intervals.

Strengths and Limitations

Strengths:

  • Realistic age-stratified contact networks calibrated to survey data
  • Dynamic intervention toggling mid-simulation
  • Explicit healthcare capacity modeling
  • Fast C backend with ergonomic Python API
  • Validated against real COVID-19 epidemic data

Limitations:

  • Currently parameterized primarily for COVID-19 (SARS-CoV-2); adapting to other pathogens requires significant recalibration
  • Spatial heterogeneity is limited — the model does not natively support geographic sub-regions or mobility flows between areas
  • Network structure is fixed at initialization; dynamic network rewiring is not supported

Getting Started

Install via pip and run a minimal simulation:

pip install openabm-covid19
import COVID19.model as abm

params = abm.Parameters(n_total=10000, end_time=100)
model = abm.Model(params)
model.run()
print(model.results[['time', 'total_infected', 'total_death']].tail())

Full documentation, parameter reference, and calibration examples are available at the OpenABM-Covid19 GitHub repository. The accompanying paper by Hinch et al. (2021) in PLOS Computational Biology provides methodological detail and validation results.

Epidemic curve comparison across baseline, NPI at day 30, and vaccination scenarios, with cumulative death counts per 100k population

Stratified contact network architecture showing household, occupational, and community contact layers with average degree annotations

Digital contact tracing effectiveness: app adoption rate vs effective reproduction number R_eff with 95% credible interval from 100-replicate ensemble

Further Resources

Tags: agent-based modeling epidemic simulation contact tracing COVID-19 public health policy