Executive Overview
Foodborne illnesses remain a persistent global public health challenge, with the World Health Organization estimating that contaminated food affects roughly 600 million people and causes approximately 420,000 deaths annually. In rapidly urbanizing regions characterized by complex, multi-tiered food supply chains, dense populations, and high-volume seasonal events—such as the Eastern Province of Saudi Arabia—the demand for rapid, predictive surveillance systems is more urgent than ever.
Conventional methods of identifying and managing foodborne outbreaks typically rely on manual reporting and delayed laboratory testing. These retrospective workflows often leave public health agencies lagging behind active transmission chains. To bridge this gap, a collaborative research team has developed and evaluated an innovative, hybrid machine learning framework designed to forecast outbreaks, analyze severity, detect structural anomalies, and map spatial risk propagation across urban networks.
Operating on a multiyear epidemiological dataset spanning 2021 to 2025 across 12 cities in the Eastern Province, this exploratory research implements an XGBoost core classifier backed by Explainable Artificial Intelligence (XAI), undercomplete autoencoders, graph-based spatial modeling, and a locally deployed Large Language Model (LLM). While researchers explicitly frame the work as a proof-of-concept rather than an operational early warning system—due to a small dataset of 61 validated records and 11 recorded outbreaks—the architecture presents a vital blueprint for next-generation, transparent public health surveillance.
Detailed Chronology and Methodological Architecture
The development of the framework progressed systematically from multi-source data ingestion to advanced analytical modeling and natural language interpretation.
Data Ingestion and Harmonization (2021–2025)
The foundational dataset derived from five annual Excel spreadsheets capturing foodborne disease records across the Eastern Province of Saudi Arabia from 2021 through 2025. Following rigorous data cleaning, automated integration via pandas pipelines, and the removal of incomplete entries, the final aggregated dataset yielded 61 records and 19 engineered features distributed across 12 metropolitan areas.

Annual breakdowns highlight consistent surveillance tracking: 12 clean records in 2021 (featuring Salmonella sp. and E. coli), 13 records in 2022 (notably Norovirus and Staphylococcus sp.), 11 records in 2023 (Salmonella sp. and Bacillus cereus), 13 records in 2024 (E. coli and Campylobacter sp.), and 12 records in 2025 (Norovirus and Listeria monocytogenes).
Feature Engineering and Target Construction
To transition unstructured epidemiological notes into machine learning-ready inputs, researchers engineered 13 core feature categories. Symptom data was extracted via case-insensitive keyword parsing, generating binary indicators for vomiting, fever, diarrhea, bloody stools, abdominal pain, nausea, and headache. Food sources were likewise transformed into binary flags (e.g., chicken, milk, mango, seafood, sauces). Demographic metrics extracted age group distributions (1–4, 5–19, and 20–49 years) and gender counts.
Two primary target variables were established:
- Outbreak Status: Binary classification where cases with more than 7 reported incidents were labeled as outbreaks ($Outbreak = 1$), isolating the upper ~18% tail of a right-skewed distribution.
- Severity Level: Outbreak intensity categorized by case volume ($ge 6$ cases designated as high severity).
Multi-Model Predictive Pipeline and Validation
To prevent data leakage during model training, the dataset was split using an 80:20 stratified approach. The Synthetic Minority Over-sampling Technique (SMOTE) was applied exclusively within training folds to combat class imbalance.
The predictive engine evaluated five distinct classifiers:

- XGBoost Classifier (Proposed Model): Selected for its robust regularization and native handling of class imbalance via
scale_pos_weight. - Random Forest Classifier ($n=100$): High sensitivity, but prone to false positives.
- Support Vector Machine (SVM with RBF Kernel): Demonstrated high cross-validation performance.
- Backpropagation Neural Network & Logistic Regression: Evaluated for baseline comparison.
Under repeated stratified cross-validation (100 total fits), the XGBoost classifier achieved a mean Area Under the Curve (AUC) of 0.64 (95% interval: [0.20, 1.00]). A stricter leave-one-year-out validation yielded a mean AUC of 0.47, highlighting the inherent instability of small-sample epidemiological forecasting and reinforcing the study’s exploratory nature.
Supporting Context and Performance Metrics
Evaluating the predictive performance on the 20% held-out test set revealed distinct operational tradeoffs among the algorithms.
Comparative Classifier Performance
| Model | Accuracy | Precision | Recall | F1-Score | AUC-ROC |
|---|---|---|---|---|---|
| XGBoost (Proposed) | 0.85 | 0.78 | 0.78 | 0.78 | 0.72 |
| Neural Network (BP) | 0.85 | 0.72 | 0.80 | 0.75 | 0.68 |
| Random Forest | 0.92 | 0.75 | 0.96 | 0.81 | 0.72 |
| SVM (RBF Kernel) | 0.85 | 0.75 | 0.96 | 0.81 | 0.75 |
| Logistic Regression | 0.77 | 0.60 | 0.70 | 0.65 | 0.72 |
While Random Forest and SVM achieved high recall scores (0.96), their lower precision (0.75) exposed a tendency toward false positives—a critical flaw in public health settings where overestimating outbreaks wastes valuable medical resources. Conversely, XGBoost delivered an evenly balanced profile (Accuracy: 0.85, Precision: 0.78, Recall: 0.78, F1: 0.78), establishing it as the most stable compromise for epidemiological deployment.
Explainable AI (XAI) and SHAP Insights
To dismantle the traditional "black box" nature of machine learning, researchers integrated SHapley Additive exPlanations (SHAP). Global feature attribution identified Hospitalizations, Fever, Headache, and Male Count as the most influential predictors driving outbreak detection.
To make these complex numerical attributions accessible to non-technical health officials, the framework incorporates a locally deployed Mistral Large Language Model via the Ollama platform. Operating under strict constraints—including a temperature of 0 to eliminate hallucinations and a predefined public health action whitelist—the LLM translates SHAP outputs into human-readable narratives outlining suspected root causes, transmission pathways, and whitelisted mitigation steps (e.g., isolating cases, tracing food sources, and enforcing sanitation).

Spatial Risk Propagation and Anomaly Detection
Moving beyond isolated city data, the framework utilizes a weighted graph-based network to model how outbreaks spread between geographically linked metropolitan zones. Dammam was modeled as a high-risk source city due to its dense population and central food distribution network. Consequently, neighboring urban centers with high connectivity weights ($W = 1.0$), such as Khobar and Dhahran, were classified as HIGH-risk zones (risk score: 28.6), while moderately connected cities like Saihat, Qatif, and West Dammam fell into the MEDIUM-risk category.
Additionally, an undercomplete autoencoder was implemented for unsupervised anomaly detection. Trained exclusively on non-outbreak patterns, the model utilized Mean Squared Error (MSE) reconstruction loss. Data points exceeding the 95th percentile error threshold ($tau = 5.40$) were successfully flagged as structural anomalies or emerging outbreak signatures.
Official Statements and Expert Perspectives
Public health authorities and study authors emphasize the necessity of balancing technological innovation with methodological realism.
"Due to the small sample size of 61 observations and 11 recorded outbreaks, this analysis is purely explorative. It demonstrates how machine learning, explainable AI, and spatial networking can be unified, rather than serving as a fully validated early-warning system," noted lead corresponding author Dr. Naof Faiz Saleem Al-Ansary.
Experts underscore that while predictive modeling offers powerful foresight, its real-world utility depends entirely on integration with established epidemiological workflows. Routine surveillance must bridge algorithmic alerts with mandatory ground-level actions, including rapid laboratory testing, environmental health inspections of implicated food premises, and stringent clinical monitoring. Furthermore, researchers noted that while regional surveillance in Saudi Arabia reflects a general post-2017 decline in overall outbreaks, persistent pathogens such as Salmonella spp. and Entamoeba spp. require targeted, data-backed interventions.

Future Outlook and Operational Integration
The successful integration of predictive modeling, SHAP explainability, graph-based spatial propagation, and local LLM translation establishes a robust conceptual foundation for future epidemiological research. However, transitioning from an exploratory proof-of-concept to an operational public health tool requires overcoming several critical hurdles.
Roadmap for Future Research
- Dataset Expansion: Future iterations must scale beyond localized regional data (Eastern Province) to incorporate multi-province, real-time prospective datasets with larger sample sizes to eliminate model instability and cross-validation variance.
- Empirical Mobility Networks: Replacing assumed geographic connectivity weights with empirical commuter data, mobile network telemetry, and wholesale food-distribution supply chain flows will significantly enhance spatial transmission accuracy.
- Stakeholder Evaluation: Rigorous human-in-the-loop evaluations involving frontline public health officers and epidemiologists are necessary to assess the practical utility, readability, and trustworthiness of LLM-generated explanatory narratives.
- Institutional Integration: Embedding the pipeline into routine weekly batch scoring workflows will allow health agencies to establish clear alert thresholds, minimizing false positives while maximizing targeted preventative interventions—such as food-handler hygiene training and swift premises sanitation.
Ultimately, this hybrid framework highlights a promising pathway for modernizing foodborne disease surveillance, proving that artificial intelligence can successfully achieve high predictive performance without sacrificing human interpretability or spatial awareness.










