Food Safety Score Represented in Color Coded Dots
MIDS Capstone Project Summer 2026

Eatelligence: Food Safety Intelligence

Problem & Motivation

Health departments can inspect only a fraction of their food establishments each year, and the signals consumers see are often stale - a letter grade from over a year ago. Public inspection data could close both gaps, but modeling it honestly is hard: outcomes are only observed when an inspector actually visits, features leak future information easily, and failures are rare. We asked whether public data alone can answer three questions for any establishment: how risky is it, which way is it heading, and why - and put those answers in front of both residents and inspectors.

Data Source & Data Science Approach

Public data only: Chicago's Food Inspections, Business Licenses, and 311 datasets (Chicago Data Portal), NYC DOHMH inspections (NYC Open Data), and LA County environmental-health records - 93,000+ establishments in all, with census ACS data used strictly for fairness auditing, never as model input. We engineer leakage-free temporal features (every value guarded to what was knowable as of the prediction date), train calibrated, monotone-constrained XGBoost models against a 180-day fail-or-critical-violation label, add a forward-looking trend model over each establishment's last five visits (87% coverage), and translate SHAP attributions into plain language. Scores are batch-published as static JSON to AWS - the web app and the source-grounded chat agent that doesn't run inference at request time.

Evaluation

Strictly chronological splits with a pre-registered promotion gate: a change ships only if it improves both PR-AUC and precision@10% on held-out future data. In backtests, inspecting from the top of our ranked list surfaces roughly 4x more violations per visit than random inspection. Calibration is verified so scores read as real probabilities, per-city ablations document what drives each model, and a census disparate-impact audit found error rates and calibration clean across all three cities.

Key Learnings & Impact

More data isn't better signal: external datasets (building permits, weather, text embeddings) failed our gates, while careful feature engineering on the core inspection data carried the model. On tabular data with few strong features, boosted trees beat deeper architectures. And the target is harder than the model - we quantified how inspection scheduling censors the label rather than ignoring it. The impact is a working template for scarce-inspection prioritization: a deployed system showing how any city could direct limited inspection capacity to where it matters most, with the methodology fully public because, for a public-health tool, trust is the feature.

Acknowledgements

Thanks to our instructors, Joyce and Korin, for feedback that sharpened both the modeling and its honest evaluation; to the City of Chicago, NYC Open Data, and LA County for maintaining the open datasets that make this work possible; and to the Chicago Department of Public Health's pioneering 2014 inspection-prediction work, which this project builds on and extends.

Last updated: August 5, 2026