Inspiration

My mother has had recurring UTIs for years. Every time, the doctor prescribes an antibiotic. Every time, we assume it will work.

What her doctor cannot know — what no one in our hospital system can easily know — is which antibiotics are quietly failing right now in Kathmandu's wards. Not just for UTIs. For sepsis in the ICU. For pneumonia. For bloodstream infections in patients who have no fallback left. The bacteria causing her infections are the same family evolving in those wards. The resistance spreading there will reach her prescription eventually.

I study Chemical Engineering at IOE Pulchowk. Resistance spread is a systems dynamics problem — the same mathematics that describes reaction kinetics describes how resistant strains outcompete susceptible ones under antibiotic pressure. When I started working with hospital AMR committees in Kathmandu, I kept seeing the same failure: the data existed, the models could be built, but the pipeline between a culture result and anyone who could act on it was broken by design.

That is why I built EVO-MOE.


The Problem

When a doctor prescribes an antibiotic, they assume it works. For most of medical history, that assumption was safe. Today it increasingly is not.

Bacteria evolve. The resistant strains survive. Over decades of overuse — in hospitals, farms, and pharmacies — we have created a silent emergency. 38.5 million people will die from drug-resistant infections by 2050, most of them in the Global South, where surveillance is three months late by design.

In June 2025, a tertiary hospital in Kathmandu reported its quarterly carbapenem resistance rate for Klebsiella pneumoniae in the ICU as 58%. The report reached the national WHO GLASS focal point three months later — after manual data cleaning, deduplication, and spreadsheet entry. By then, the true resistance rate had already risen to 64%. No one knew. No system had predicted the rise.

The problem is not a lack of data. Lab reports exist in every hospital daily. The problem is that those reports are unstructured text — never automatically converted into the structured records that surveillance requires.

A lab technician in a district hospital opens 47 culture results on a Tuesday morning. She types each result into a spreadsheet, one field at a time, the way she has every Tuesday for five years. By the time that data reaches anyone who could act, the resistance has already moved to the next ward.

Every AMR surveillance system in the world — WHO GLASS, WHONET, ATLAS, EARS-Net — was built to report what happened last year. Not one forecasts what happens next year.

57 countries carry a WHO GLASS 2030 mandate. Each already collects culture data. Each spends weeks per year manually transcribing lab reports into spreadsheets. The gap between a culture result and a national GLASS upload is currently 3–6 weeks.

EVO-MOE closes it in under 2 hours.


What It Does

EVO-MOE takes a raw lab report — typed, scanned, handwritten, mixed Nepali/English — and produces a 12-month antimicrobial resistance forecast, a stewardship grade, a drift alert, and an economic burden estimate. Fully offline. On existing hospital hardware. Output conforms to WHO GLASS 2023-A, ready for national submission without reformatting.

A doctor in a Kathmandu ICU can paste in a lab report and see — before writing the next prescription — whether the antibiotic she is about to prescribe is failing in her ward, what it will cost if it does, and what the next 12 months look like if nothing changes.


How We Built It

Extraction — Gemma 4 E4B, on-device

The core is Gemma 4 E4B running locally via llama.cpp. No internet. No patient data leaving the hospital. We fine-tuned it with a LoRA adapter (rank $r=16$, $\alpha=32$) on 9,400 synthetic WHONET-format training pairs covering four real report formats: structured LIMS output, free-form ward notes, mixed Nepali/English, and handwritten transcription style.

Why synthetic training data? Real WHONET records are PHI-protected. So we built a corpus-grounded generator that reflects what Nepali hospital reports actually look like — including Nepali terms like "प्रतिरोधी" (resistant) and "संवेदनशील" (sensitive), code-switching patterns, and resistance probabilities drawn from WHO GLASS 2023 South Asia data.

Why Gemma 4 over other small models? Its baked-in medical knowledge reaches clinical-grade extraction accuracy without a massive model, and the quantized GGUF (5.3 GB, Q4_K_M) runs under 8 GB RAM on commodity hospital hardware. General models required far more fine-tuning to handle clinical abbreviations and mixed-language reports. A rules engine breaks on every new format variation. Gemma 4 handles it.

Extraction accuracy on held-out synthetic reports:

Format SIR Accuracy Organism Accuracy
Structured LIMS 94.1% 98.0%
Free-form ward note 89.2% 93.5%
Mixed Nepali/English 88.7% 91.0%
Handwritten scan 85.3% 89.0%
Overall 91.3% 94.0%

Forecasting — Bayesian SDE Pipeline

Four feature sets feed the pipeline: MIC distribution, ICU severity index, antibiotic usage pressure (DDD per 1,000 patient-days), and policy stringency index. Each is lag-optimised against historical resistance fractions up to 12 months back.

A Bayesian GLM with Laplace approximation computes the posterior over resistance trajectories:

$$p(\beta \mid \mathcal{D}) \approx \mathcal{N}(\hat{\beta},\ H^{-1})$$

where $\hat{\beta}$ is the L-BFGS-B mode and $H$ is the Hessian at the mode.

A two-strain SIS ODE captures how resistant strains spread under antibiotic pressure:

$$\frac{dR}{dt} = \beta_R S R - \gamma R + \underbrace{\tau(1-R)}_{\text{HGT/selection}}$$

Calibrated via ABC with 10,000 parameter draws, then refined with L-BFGS-B. The Van Kampen SDE ensemble propagates this forward 12 months across 500 stochastic paths:

$$dR_t = f(R_t)\,dt + \sqrt{\frac{f(R_t)}{N}}\,dW_t$$

producing honest uncertainty bands rather than a single point estimate.

Economic Burden

Every forecast outputs the cost of inaction. If meropenem fails, the escalation drug is ceftazidime-avibactam at NPR 285,000 per course — on top of 7.2 excess ICU bed-days at NPR 8,500 per day. The Cost of Resistance formula:

$$\text{CoR} = \sum_{c} \left[ \text{DRG}c \cdot \Delta\text{LOS}_c \cdot \hat{R} \cdot N_c + P{\text{fail},c} \cdot N_c \cdot \text{EscCost}_c \right]$$

EVO-MOE calculates this automatically with uncertainty intervals and stewardship ROI, so resistance stops being an abstract percentage and becomes a number a hospital administrator can act on.

Deployment

FastAPI backend, Dockerized, running on Hugging Face Spaces. The entire pipeline — extraction, forecasting, economic calculation, GLASS formatting — runs in a single CPU container with no external API dependencies.


Challenges We Ran Into

Making uncertainty honest. The most dangerous thing a forecasting system can do is be confidently wrong. Early versions produced tight confidence intervals regardless of how sparse the input data was — telling a clinician "72% resistance, we are certain" when the honest answer was "somewhere between 40% and 95%." Getting the SDE ensemble to widen appropriately when evidence is thin, and tighten only when the signal genuinely supports it, required significant tuning of the noise scaling and percentile aggregation across 500 paths. A wrong forecast here is not a UX problem. It is a patient problem.

Building training data without patient data. Fine-tuning on real lab reports was not possible — they are PHI-protected. Building a synthetic corpus that faithfully represents the variability of real Nepali hospital reports across four format types, with realistic Nepali/English code-switching and clinically accurate resistance probabilities, without overfitting to any single template, was harder than the model training itself.

On-device on constrained hardware. Running a 5.3 GB model on a free CPU container exposed every inefficiency in the pipeline. The final system caches the model locally, loads in under 30 seconds on warm start, and falls back to a rule-based extractor when inference fails — because in a district hospital in Nepal, graceful degradation is not optional.


Accomplishments That We're Proud Of

The Brier score measures calibration for the clinically meaningful binary question: will resistance exceed the treatment threshold at each forecast month? A score of 0 is perfect. A score of 0.25 is random guessing.

Model Brier Score $\downarrow$ 95% CI Coverage
Naïve persistence 0.221 61.8%
ARIMA 0.187 74.2%
Mechanistic SIS 0.163 81.4%
EVO-MOE V4 0.094 93.1%

When EVO-MOE states 70% probability of crossing the treatment threshold, it crosses 70% of the time. That is not an easy property to engineer into a stochastic model — and it is the property that makes the difference between a forecast a clinician trusts and one they ignore.

We are also proud that the entire pipeline — a fine-tuned LLM, a Bayesian forecasting engine, an economic model, and WHO GLASS formatting — runs in a single CPU container with no external dependencies, on hardware a district hospital in Nepal already owns.


What We Learned

Resistance spread is a systems dynamics problem. The same mathematics that describes competitive exclusion in chemical reactions — $\frac{dS}{dt} = -\beta SR$, selection pressure, lag effects — describes how resistant strains outcompete susceptible ones under antibiotic pressure. The hardest part was not the modelling. It was the trust layer: the uncertainty bands, the stewardship grades, the non-suppressible economic caveats that make a forecast something a clinician will act on rather than a number they dismiss.

We also learned that on-device is not a constraint. It is a design choice. A system that requires stable internet, a cloud GPU, and a data science team is not a solution for a district hospital in Nepal. It is a solution for hospitals that already have solutions.


What's Next for EVO-MOE

Pilot deployment at TUTH, Kathmandu. The immediate next step is a real-world validation study at Tribhuvan University Teaching Hospital — moving from synthetic test sets to live lab reports, measuring extraction accuracy on actual PHI-de-identified records, and calibrating the forecasting model against locally observed resistance trajectories.

Expand to the GLASS sentinel network. 57 countries carry a WHO GLASS 2030 mandate. Each is already collecting culture data and struggling with the same manual transcription bottleneck. EVO-MOE's offline-first, GLASS-compliant architecture is designed to deploy across sentinel site networks without requiring infrastructure upgrades. The goal is to give national AMR focal points their first near-real-time prospective surveillance signal.

District-level situation reports. An optional cloud component — Gemma 4 27B on RunPod serverless — can synthesise weekly PHI-free aggregate signals into natural-language situation reports for district health officers. This requires connectivity only for the synthesis step; the primary surveillance pipeline remains fully offline.

Language expansion. The current extraction model covers Nepali/English. The synthetic data pipeline can generate training pairs for any language with WHONET coverage — Hindi, Swahili, French — making the same architecture deployable across South Asia and sub-Saharan Africa without retraining from scratch.

The Global South is not losing the antibiotic resistance crisis because it lacks data. It is losing because the data it has never becomes foresight. Every AMR surveillance system reports last year. EVO-MOE reports next year — and the goal is to make that true for every sentinel hospital on the GLASS network, not just one ICU in Kathmandu.

Built With

Share this project:

Updates

Submission history