AI Prediction Models

Three automated agents compete on the leaderboard alongside human predictors. Each uses a different approach to forecast blood glucose 30 minutes ahead. All are scored the same way: skill = naive error − model error per prediction.

Gradient Boosting strategy1

MAE ~20 mg/dL

A gradient boosting regressor (scikit-learn, 300 estimators) trained on 90 days of historical data. It learns statistical patterns directly from past glucose trajectories without any explicit knowledge of physiology.

The model sees 13 features at prediction time: the four most recent BG readings, first and second derivatives (trend speed and acceleration), insulin on board (linear decay over 4 hours), 30-minute mean and standard deviation, deviation from that mean, time-of-day encoded as sine/cosine, and minutes since last bolus.

Top driver: the current BG reading accounts for ~69% of feature importance. Trend deviation from the 30-min mean and time-of-day together explain another ~11%. Retrain with python models/train.py as data grows.

Bergman Minimal Model strategy_bergman

MAE ~32 mg/dL

A physiological ODE model that simulates glucose-insulin dynamics using differential equations derived from endocrinology research. Unlike the data-driven models, it explicitly represents the biology.

The system models three compartments: plasma glucose, remote insulin (interstitial fluid delay), and plasma insulin. Glucose falls as insulin acts on tissues; it rises from endogenous production and carbohydrate absorption. The equations are integrated forward 30 minutes using scipy's ODE solver.

Parameters (insulin sensitivity, glucose effectiveness, absorption rate) are calibrated to Owen's historical data. The model is interpretable by design — each parameter has a direct physiological meaning. It tends to be conservative compared to the data-driven approaches.

LSTM Neural Network strategy_lstm

MAE ~27 mg/dL

A 2-layer Long Short-Term Memory network (PyTorch) that processes 60 minutes of sequential glucose history as a time series. LSTMs are designed to capture temporal dependencies — patterns that span multiple time steps — which makes them a natural fit for CGM data.

At each of the 12 time steps (one per 5-minute CGM reading), the model receives five features: BG, insulin on board, carbs on board, and time-of-day (sine/cosine encoding). The LSTM predicts the change in BG over the next 30 minutes (delta), which is added to the current reading to produce the final forecast.

Trained with early stopping (patience 12 epochs) and learning rate scheduling. Feature normalization is saved alongside the model weights so inference is consistent with training. Retrain with python models/lstm_model.py.

All models run as background agents on the server, submitting predictions every 5 minutes. Performance metrics update as new predictions mature and are scored.