Sugar record screening: research pilot

An interactive demonstration of saved held-out predictions from a small Open Food Facts pilot. Change the recorded sugar value to explore screening behavior. The browser does not train a model or predict for new ingredient lists. No API key, GPU, server, or paid inference service is used.

One objective

Develop and evaluate a model using ingredient information and food category to identify suspicious nutrient records, starting with sugar. A flag means review is needed; it does not establish a database error or printed-label inaccuracy.

Reproduce

With Python 3.11 or newer, in this directory:

python -m pip install -r requirements.txt
python train_demo.py

Open index.html in a browser. Upload the files in this directory to the root of a Hugging Face Static Space. No build command is required. The original CSV is included to reproduce this run; results.json records its SHA-256 and actual library versions. split_manifest.csv records the exact split.

Method

Limitations

Small convenience sample, mixed markets and categories, incomplete provenance, uncertain as-sold/prepared basis, unverified source values, and remaining formulation overlap. g describes package quantity, not proof of nutrition normalization. Intervals may be broad and miss decimal errors. No laboratory or package-image adjudication is included. The model has not established real-world error-detection performance. A larger focused dataset and adjudicated records are needed.

This is a new restricted-subset experiment. Its results are not a reproduction of the earlier 353-candidate smoke-test figures.

Data attribution

Contains information from Open Food Facts, made available under the Open Database License (ODbL). The included CSV and derived data are shared under ODbL; retain attribution and applicable share-alike terms. Original extract source: https://huggingface.co/datasets/openfoodfacts/product-database . No package images are bundled in this demo.