What Your Toilet Knows About the Next Pandemic#

Every flush is a tiny, anonymous health report. People infected with a virus shed it in their stool, urine and saliva, often before they feel unwell, and it all ends up in the same pipes. In 2020, a team at a Massachusetts treatment plant showed that SARS-CoV-2 RNA in sewage rose and fell 4 to 10 days earlier than clinically diagnosed cases.

That head start is the whole appeal of wastewater surveillance. It needs no appointment, no swab and no symptoms. It covers the people who never get tested as well as those who do.

The sewer has a problem, though: it produces a lot of noisy numbers. Rainfall dilutes samples, populations shift, and labs differ in how they measure. This is where artificial intelligence comes in. The pitch is that machine learning can turn messy pipe data into forecasts that health officials can act on. The evidence is more mixed than the pitch suggests, and that is exactly why it is worth examining closely.

Background: How Wastewater Surveillance Works#

From sewer to signal#

Wastewater-based epidemiology, the formal name for the field, is simple in outline. Technicians collect sewage at a treatment plant's inlet or from a pipe serving a smaller area such as a hospital or university. They concentrate the sample, extract genetic material, and measure how much of a target virus is present using a technique called PCR, which copies a specific stretch of genetic code until it can be counted. The result is a viral load: how much virus the catchment is shedding that week.

Because sewage reflects everyone upstream, it captures infections that clinics miss. A Mexican study of plants and university campuses noted that wastewater samples are representative of all cases within the catchment area, whether clinically reported or not.

Why the signal comes early#

Timing depends on biology. The Massachusetts team modelled wastewater viral load as a combination of past clinical cases and an average shedding curve. Their model implied an early shedding peak, probably before symptom onset and clinical diagnosis. In plain terms, people flush the most virus before they know they are ill, so sewage notices first.

What "AI" means here#

When researchers say AI in this context, they usually mean machine learning: statistical models that learn patterns from past data rather than following hand-written rules. Common examples are random forests (many simple decision trees voting together), neural networks (layers of adjustable mathematical units loosely inspired by the brain) and long short-term memory networks, or LSTMs, which are designed to remember patterns across time. One 2026 review of the field compared these families on accuracy, scalability, interpretability, computational demands and real-time feasibility.

Forecasting Hospitalisations, Not Just Detecting Virus#

Detection tells you a virus is present. Forecasting tells you what is coming. The second is far more useful to a hospital planning bed capacity.

A study from South Carolina used SARS-CoV-2 levels from six treatment plants to forecast hospitalisations 7, 14 and 21 days ahead using Poisson regression and random forests. Accuracy was highest at 14 days, where random forests reached a median percentage agreement of 91.16% across treatment plants and 78.12% across ZIP codes. The authors suggest the framework could be adapted to other infectious diseases.

Two cautions apply. The data covered April 2020 to February 2021, early in the pandemic, so the models were not tested against later variants or high population immunity. And the drop from 91% to 78% when moving from plants to ZIP codes shows that finer geography costs accuracy. (An earlier preprint version, not peer reviewed, reported the same headline figures before the Epidemics paper appeared.)

The Uncomfortable Truth About Reproducibility#

Here is where the story gets less tidy. A study that applied random forests to wastewater data from 108 sites in Scotland, Catalonia, Ohio, the Netherlands and Switzerland found wildly different results by region. "Reasonable" or better forecasts made up 0% of Catalonia's, 5% of Scotland's and 0% of Ohio's forecasts, against 55% for the Netherlands and 45% for Switzerland.

The authors identified sampling frequency and training set size as key factors, and noted that including too many unnecessary variables hurt accuracy. In other words, the model matters less than the quality and regularity of the sampling feeding it.

Share of "reasonable or better" random forest forecasts by region Bar chart: Catalonia 0 per cent, Ohio 0 per cent, Scotland 5 per cent, Switzerland 45 per cent, Netherlands 55 per cent. Random forest wastewater forecasts rated "reasonable or better" Share of forecasts per region (108 sites, five regions). Source: Vaughan et al., 2022 0% 20% 40% 60% 0% 0% 5% 45% 55% Catalonia Ohio Scotland Switzerland Netherlands Same algorithm, very different outcomes: data quality and sampling frequency drove the gap.

Figure 1. Share of random forest forecasts judged "reasonable" or better in five regions. Values from Vaughan et al., 2022.

Reading the Genome in the Pipes#

Counting virus is one thing. Reading its genetic code is another, and it is arguably where wastewater earns its keep for pandemic preparedness.

In the Netherlands, routine sequencing of wastewater caught a Delta-variant lineage during a period when Omicron BA.5 dominated. The lineage was absent from reported clinical data despite high associated viral loads, which suggests cryptic transmission.

Sewage can also expose something stranger. In Wisconsin, researchers traced an unusual lineage to a single commercial building and proposed that it reflected persistent shedding from one person, with the virus accumulating Omicron-like mutations over 13 months. A separate Michigan study found a chronic Alpha-variant derivative detected from fall 2021 through summer 2023 at a small rural plant. The authors of both studies raise the possibility of chronic infections; neither proves it.

Why does this matter for AI? Sequence data is large and messy, with mixtures of many lineages in each sample. Software that can untangle those mixtures, and flag lineages that do not match clinical records, is exactly the kind of pattern-recognition job machine learning suits. The studies above document the phenomenon; the automated flagging is the logical next step rather than something these papers demonstrate.

Beyond COVID, and Beyond Viruses#

COVID-19 built the field, but the methods are spreading. Three recent examples show both promise and limits.

Measles. In Wisconsin in February 2026, a wastewater assay detected measles genotype D8 before local health authorities had identified the case. A second case, genotype B3, went undetected because the assay could not detect an internationally circulating B3 variant. The developers released a modified assay afterwards. In Ontario, by contrast, the 2025 measles signal was positively associated with clinical cases but did not provide an early alert when resolved by epidemiological week.

Fever as a proxy. One Chinese team skipped the pathogen altogether. They measured paracetamol and ibuprofen in wastewater from several cities as an indicator of fever in the population, then used anomaly-detection models. Two methods produced thresholds that correctly classified November 2021 as non-epidemic and November 2024 as an epidemic period, consistent with hospital influenza-like illness surveillance. The authors argue this could provide early warning for unknown agents, including a so-called "Disease X". That is a hypothesis, supported by a retrospective comparison on two time points.

Aeroplanes. Researchers in Gujarat sampled aircraft wastewater at Ahmedabad airport between June 2024 and November 2025 and detected 40 viral families and 315 viral species, including influenza A subtypes. This is a proof of concept, not a working early-warning network.

sewage early warning system can ai spot the next outbreak 2

Where the Evidence Is Weakest#

Reporting means listing what is still unresolved.

First, reviews consistently flag data problems. A systematic review of modelling strategies listed temporal alignment, data preprocessing, evaluation of model performance and interpretability among the remaining hurdles, and called transferability across epidemiological and geographical settings a key concern. A Risk Analysis review of machine learning in the field echoed concerns about data quality, model interpretability and integration with existing public health infrastructure.

Second, simple can beat complex. The Mexican study found that a clustering model separated surge weeks from quiet ones with 87.9% accuracy and forecast one and two weeks ahead at 80.4% and 81.8%, but its attempt to predict the weekly average of new cases was limited, likely because of insufficient dimensionality in the database.

Third, assays can go stale. The Wisconsin measles case shows that a method can silently miss a circulating variant, and the authors stress the importance of regularly monitoring wastewater assays against available genomic data.

Finally, the best-performing hybrid approaches combine several data streams. A Korean study integrated crowdsourced search keywords, climate data and wastewater multi-omics, and reported that the combined model predicted COVID-19 cases more accurately than single-source baselines. A related study on a foodborne bacterium found that explainable AI identified wastewater abundance as the most reliable predictor of disease cases. Both suggest that sewage works best as one input among several.

Study snapshot#

StudySettingMethodHeadline resultMain caveat
Wu et al., 2021Massachusetts, 2020Convolution modelWastewater trends led clinical data by 4 to 10 daysSingle plant, early pandemic
Tabassum et al., 2026South CarolinaRandom forest, Poisson regression91.16% median agreement at 14 days (plants)Data end February 2021; lower at ZIP-code level
Vaughan et al., 2022108 sites, five regionsRandom forest0% to 55% "reasonable" forecasts by regionSampling frequency and training size matter
Armenta-Castro et al., 2025MexicoClustering, regression87.9% surge-week classificationWeak case-count regression
Pray et al., 2026Wisconsin, measlesTargeted assayDetected D8 case before local identificationAssay missed a B3 variant
Shao et al., 2026Chinese citiesAnomaly detection on drug residuesThresholds matched sentinel surveillanceTwo validation periods

So, Can AI Make Sewage a Real Early-Warning System?#

Partly, and conditionally. The core signal is real: wastewater leads clinical data by days. The genomic layer is real too, as the Dutch, Wisconsin and Michigan sequencing studies show. What is less settled is whether machine learning reliably extends that lead into forecasts that transfer from one city or country to another. The five-region comparison suggests it does not yet, at least with off-the-shelf models and uneven sampling.

For researchers and founders, the practical lesson is unglamorous. Invest in consistent sampling, keep assays aligned with current genomes, validate models in places they were not trained, and report failures alongside successes. The sewer is a generous data source. It rewards careful engineering far more than clever algorithms.

Frequently Asked Questions#

What is wastewater surveillance?

It is the testing of sewage for genetic traces of pathogens or other health markers to track disease in a community. Because wastewater reflects all people upstream, whether or not they have been tested, it can capture infections that clinical systems miss.

How far ahead can wastewater data warn us?

It depends on the disease and the setting. In Massachusetts, SARS-CoV-2 trends appeared 4 to 10 days earlier in wastewater than in clinical data. For measles in Ontario, however, the signal did not provide an early alert at weekly resolution.

What does AI actually add?

It can forecast outcomes such as hospitalisations and flag anomalies. In South Carolina, random forests reached a median agreement of 91.16% for 14-day-ahead hospitalisations at plant level. Results vary widely between regions, though.

Why do models work in some countries and fail in others?

A five-region comparison linked performance to factors such as sampling frequency and training set size. Only 0% to 5% of forecasts were reasonable in Catalonia, Scotland and Ohio, against 45% to 55% in Switzerland and the Netherlands.

Can wastewater find new or unknown diseases?

Possibly, but this is early-stage. One study used drug residues as a fever indicator to flag epidemic periods without naming a pathogen, and the authors propose it could help detect unknown agents. That claim has not been tested on a genuinely novel outbreak.

Does wastewater surveillance invade privacy?

It samples pooled sewage rather than individuals, and most studies here work at plant or neighbourhood level. Narrower sampling is possible: researchers traced one lineage to a single commercial building00372-5), which shows why governance matters as sampling gets more local.

Can an assay stop working?

Yes. A widely used measles assay could not detect a circulating B3 variant until it was modified. Assays need regular checks against up-to-date genome libraries.

Is this just for COVID-19?

No. The studies above cover measles, influenza A, foodborne bacteria and general viral diversity, including samples from aircraft wastewater.

References#

  1. Wu F, et al. SARS-CoV-2 RNA concentrations in wastewater foreshadow dynamics and clinical presentation of new COVID-19 cases. Sci Total Environ. 2021. doi:10.1016/j.scitotenv.2021.150121
  2. Tabassum N, et al. Granular insights: a wastewater-based machine learning approach for localized COVID-19 hospitalization forecasting. Epidemics. 2026;55:100907. doi:10.1016/j.epidem.2026.100907
  3. Tabassum N, et al. Granular insights (preprint version). medRxiv. 2025. doi:10.1101/2025.06.25.25330294 (not peer reviewed)
  4. Vaughan L, et al. An exploration of challenges associated with machine learning for time series forecasting of COVID-19 community spread using wastewater-based epidemiological data. Sci Total Environ. 2022. Consensus record
  5. Armenta-Castro A, et al. Interpretation of COVID-19 epidemiological trends in Mexico through wastewater surveillance using simple machine learning algorithms. Viruses. 2025. doi:10.3390/v17010109
  6. Ali M, et al. A review of AI/ML approaches in wastewater surveillance advancement. Sci Total Environ. 2026. Consensus record
  7. Wang L, et al. From wastewater to epidemiological insights: a systematic review of modeling strategies for infectious disease surveillance. Water Res. 2025. Consensus record
  8. Pagsuyoin S, et al. Coupling wastewater-based epidemiology with data-driven machine learning for managing public health risks. Risk Anal. 2025. doi:10.1111/risa.70075
  9. Shao X-T, et al. A novel fever prevalence indicator for early warning of acute respiratory infections using wastewater-based epidemiology and machine learning. Environ Res. 2026;306:125279. doi:10.1016/j.envres.2026.125279
  10. Haver A, et al. Regional reemergence of a SARS-CoV-2 Delta lineage amid an Omicron wave detected by wastewater sequencing. Sci Rep. 2023. doi:10.1038/s41598-023-44500-0
  11. Shafer MM, et al. Tracing the origin of SARS-CoV-2 omicron-like spike sequences detected in an urban sewershed. Lancet Microbe. 2024. https://tinyurl.com/yc8889fa
  12. Conway MJ, et al. Chronic shedding of a SARS-CoV-2 Alpha variant in wastewater. BMC Genomics. 2024. doi:10.1186/s12864-024-09977-7
  13. Pray I, et al. Genotype-specific detection of measles virus using wastewater surveillance, Wisconsin, February 2026. MMWR. 2026;75(27):344-348. doi:10.15585/mmwr.mm7527a1
  14. Corchis-Scott R, et al. Wastewater surveillance to track resurgent measles outbreak, Ontario, Canada, 2025. Emerg Infect Dis. 2026;32(10). doi:10.3201/eid3210.260092
  15. Shukla N, et al. Aircraft wastewater virome surveillance from domestic and international flights: a proof-of-concept study from Gujarat, India. Infect Genet Evol. 2026. doi:10.1016/j.meegid.2026.106036
  16. Oh S, Wijaya J. Predictive surveillance and diagnosis of COVID-19: an integrative machine learning and wastewater multi-omics approach. Water Res. 2025. doi:10.1016/j.watres.2025.124981
  17. Oh S, et al. Machine learning surveillance of foodborne infectious diseases using wastewater microbiome, crowdsourced, and environmental data. Water Res. 2024. Consensus record