Personalized Glycemic Response Model

Every person's blood glucose reacts differently to the same meal. Two athletes eating an identical plate of pasta can show dramatically different glucose excursions: one barely budging, the other spiking 60 mg/dL in under 45 minutes. This is the challenge of personalized nutrition: understanding what drives these individual differences, and whether machine learning can predict them without invasive measurements.

This page presents the model from Zignoli et al. (2024), a machine-learning approach trained on 3,296 real-world meal events from 927 healthy individuals wearing continuous glucose monitors (CGM) in uncontrolled settings.

Athlete wearing a continuous glucose monitor
Kind concession of Supersapiens.com for divulgation of scientific findings

The Dataset

The study used data collected by Supersapiens, where participants self-reported meal timing and macronutrient content via a mobile app while wearing an Abbott Libre Sense biosensor. The CGM measured interstitial glucose every minute, capturing the full post-meal glycemic profile.

Key dataset characteristics:

  • 927 individuals (666 men, 235 women), age 45.5 ± 9.4 years
  • 3,296 meal events logged in free-living conditions
  • No diabetes: all self-declared healthy
  • Self-reported macronutrients: carbohydrates (CHO), fat (FAT), protein (PRO) in grams
📝Note

The uncontrolled nature of this dataset is both a strength (real-world generalizability) and a limitation (self-reported meal data introduces noise). The study estimated the maximum attainable correlation for this approach is ~0.7, limited by intra-individual variability.


Parameterizing the Glycemic Response

Rather than predicting a single number (e.g., AUC at 120 min), the authors fitted a bell-shaped curve to the 90-minute CGM trace after each meal. This captures the full shape of the response with just three parameters (amplitude, peak time, and width):

f(t)=g(t)max(g(t))A+bf(t) = \frac{g(t)}{\max(g(t))} \cdot A + b

where

g(t)=1σ2πe(tδ)22σ2g(t) = \frac{1}{\sigma \sqrt{2\pi}} \, e^{-\frac{(t-\delta)^2}{2\sigma^2}}

The three parameters describe the glycemic response completely:

ParameterSymbolMeaningDataset median
AmplitudeAPeak rise above baseline (mg/dL)31 mg/dL
Peak delayδTime to glucose peak (min)50 min
WidthσSpread of the response (min)18 min

Gaussian model of the post-meal glycemic response

Each meal event is described by three parameters: amplitude A, peak time δ, and width σ. The curve is fitted to the 90-minute CGM trace after the meal. Example shown with A = 42 mg/dL, δ = 45 min, σ = 18 min.

The baseline bb is the average glucose in the last 5 minutes before the meal, observed from CGM. The function is fitted to each meal trace using least-squares optimization (scipy, soft L1 loss).


Predicting the Response Parameters from Features

So far we have a way to describe any glycemic response with three numbers (A, δ, σ). The next question is: can we predict those numbers for a new meal, before measuring anything?

This is where machine learning enters. The approach is the same input-output mapping covered in Module 5 on AI and machine learning models: select a set of measurable features, pass them through a trained model, and read off the predicted outputs.

Feature-to-parameter mapping: what goes in, what comes out

The ML model takes ~30 input features and predicts the three Gaussian shape parameters.

Meal

CHO, FAT, PRO (g)

Individual

Age, BMI, Sex

CGM · 24 h

Mean, SD, TIR, Skew, Glucotype…

CGM · 4 h

Mean, SD, TIR, Autocorr…

XGBoost
+ linear (A)

A

Amplitude

mg/dL

δ

Peak delay

min

σ

Width

min

The diagram above shows the full feature set. Notice that meal composition (CHO, FAT, PRO) accounts for only 3 of roughly 30 inputs. The dominant predictors turn out to be the pre-meal CGM history features: the 24-hour and 4-hour windows before eating capture the individual's current metabolic state far better than macronutrients alone. This is consistent with the low R² of macronutrient-only models and the stronger performance of the full XGBoost model.

Two models were trained, serving different purposes:

XGBoost (full feature set)

A gradient-boosted tree ensemble, one model per output (A, δ, σ), trained on all ~30 features listed above. Configuration: 200 trees, max depth 5, learning rate 0.01, subsampling 50%.

Performance on the held-out 20% test set:

OutputPearson rRMSE
Amplitude A0.4813.2 ± 9.5 mg/dL
Peak delay δ0.1712.2 ± 9.2 min
Width σ0.193.5 ± 2.6 min

Multi-linear Regression (meal features only, interpretable)

To isolate the specific contribution of meal macronutrients to amplitude A, and to power the interactive tool below, a simpler model was also fitted using only meal composition as input:

A=β0+βCHOCHO+βFATFAT+βPROPRO+βCHO×PROCHOPRO+βCHO×FATCHOFATA = \beta_0 + \beta_\text{CHO} \cdot \text{CHO} + \beta_\text{FAT} \cdot \text{FAT} + \beta_\text{PRO} \cdot \text{PRO} + \beta_{\text{CHO} \times \text{PRO}} \cdot \text{CHO} \cdot \text{PRO} + \beta_{\text{CHO} \times \text{FAT}} \cdot \text{CHO} \cdot \text{FAT}

Fitted coefficients (n = 3,926, R² = 0.14):

TermCoefficientInterpretation
Intercept+25.85Baseline amplitude at zero macronutrients
CHO+0.263+1 g CHO → +0.26 mg/dL rise (at mean FAT, PRO)
FAT−0.108+1 g FAT → −0.11 mg/dL rise (at mean CHO, PRO)
PRO−0.005Not significant (p = 0.83)
CHO × PRO−0.0014High PRO weakens the CHO-driven spike
CHO × FAT−0.0009High FAT weakens the CHO-driven spike
⚠️Warning

R² = 0.14 means macronutrients alone explain only 14% of the variance in glycemic amplitude. The remaining variance comes from individual biology, pre-meal glucose state (captured by CGM features), meal timing, exercise, stress, and other unmeasured factors.


Macronutrient Contributions to the Glycemic Response

The chart below shows how each macronutrient contributes to glycemic amplitude A (equivalent to Fig. 5 of Zignoli et al. 2024). Dots are binned means from the actual dataset with the other macronutrients' effects partialled out; the curve is a polynomial fit to those means.

Contribution of each macronutrient to glycemic amplitude A. Dots = actual dataset binned means (other macronutrients partialled out). Curves = polynomial fit to those means.

Carbohydrates (CHO)

Contribution becomes positive after ~35 g and saturates above ~70–80 g.

Fat (FAT)

Near-neutral below ~20 g; increasingly negative beyond 30 g.

Protein (PRO)

Positive at very low protein (<10 g), neutral at 10–30 g, gradually negative beyond 30 g.

Key patterns, consistent with the Shapley values reported in the paper:

  • CHO: contribution is steeply negative below ~20 g, crosses zero around 35 g, then rises rapidly up to ~70–80 g where it begins to saturate. This is exactly the non-linear S-shape the paper reports, where CHO becomes the dominant driver of the glycemic spike above 40 g.
  • FAT: near-neutral or slightly positive at very low intake (below 20 g), then increasingly negative beyond 30 g. FAT acts to blunt the glycemic response and also delays and widens the peak (δ and σ).
  • PRO: positive at very low protein (below 10 g), neutral between 10–30 g, and gradually negative at higher intakes. Like FAT, PRO moderates the CHO-driven spike primarily through the interaction terms (CHO×PRO), not through its main effect alone.

Interactive Tool

Use the tool below to explore how changing meal composition and individual characteristics affects the predicted glycemic response curve. The amplitude A uses the full multi-linear regression model; peak time δ and width σ use simplified linear approximations from meal + individual features only.

Amplitude A
34.5
mg/dL
Rise above baseline
Peak time δ
50
min
Time to glucose peak
Width σ
17.7
min
Spread of response
Peak glucose
119
mg/dL
Estimated maximum

Predicted glycemic response, 90 minutes post-meal

Shaded band = empirical 95% prediction interval (−26.5 / +37.5 mg/dL on amplitude). Asymmetric: the upper tail is wider because the model underpredicts large spikes more than it overpredicts small ones. Horizontal bracket at baseline = ±σ response width.

Meal Composition

Carbohydrates (CHO)50 g
0150
Protein (PRO)25 g
0100
Fat (FAT)20 g
0100

Total energy: 480 kcal

CHO share: 42%

Individual Characteristics

Age40 years
2075
Height175 cm
150200
Weight75 kg
40120
BMI24.5 kg/m²
Basal glucose85 mg/dL
70110
Biological sex

Amplitude A: multi-linear regression (R²=0.14, RMSE=16.7 mg/dL). Shaded band: empirical 95% prediction interval (−26.5 / +37.5 mg/dL), computed from the 2.5th and 97.5th percentiles of training residuals (n=3,926). Asymmetric because residuals are right-skewed (skewness=0.58): the model tends to underpredict large spikes. Peak time δ and width σ: simplified linear approximations; their variance is dominated by 24h pre-meal CGM features not entered here. Curve: f(t) = A · exp(−(t−δ)² / 2σ²) + baseline (Zignoli et al. 2024).


Limitations and Educational Value

The model presented here is educational more than clinical. Key limitations:

  • Self-reported macronutrients introduce substantial noise
  • No gut microbiome, exercise, or stress data: all known to modulate glycemic response
  • Intra-individual variability limits the ceiling accuracy for any model in uncontrolled settings
  • Population-level trends (CHO drives spikes, FAT blunts them) do not replace personalized CGM feedback

Despite these limitations, the model offers genuine insights:

  • Quantifies the relative roles of CHO, FAT, and PRO in shaping the glycemic response
  • Demonstrates that combining CGM history with meal data substantially improves prediction
  • Provides a framework for understanding personalized nutrition that goes beyond simple calorie counting

📚Biblio

Zignoli A., Skroce K., Lipman D.J., Zisser H.C. (2024). Personalized nutrition and machine-learning: Exploring the scope of continuous glucose monitoring in healthy individuals in uncontrolled settings. Biomedical Signal Processing and Control, 90, 105809. Read the paper →