प्रतिबिम्बA digital twin for Type 2 Diabetes

Pratibimb mirrors each patient’s physiology from their health record and wearables, keeps the twin in sync with every CGM reading, and sees the spike two hours before it happens.

Built on open clinical standards and open-source science

HL7 FHIR R4ABDM · ABHALOINCSNOMED CTBergman minimal modelEnsemble Kalman filterLightGBMTreeSHAPParkes error gridIFCT 2017FastAPINext.jsHL7 FHIR R4ABDM · ABHALOINCSNOMED CTBergman minimal modelEnsemble Kalman filterLightGBMTreeSHAPParkes error gridIFCT 2017FastAPINext.js
The problem

Glucose moves every few minutes; clinic data arrives every few months. Indian patients also differ: insulin-deficient and “thin-fat” insulin-resistant phenotypes, carbohydrate-heavy meals, late dinners and fasting days on sulfonylureas.
11.4%
~101 M adults in India live with diabetes
15.3%
~136 M more have prediabetes
35.5%
have hypertension
39.5%
have abdominal obesity

ICMR-INDIAB-17 national survey — Anjana RM et al., Lancet Diabetes & Endocrinology 2023.

How the twin works

A compact glucose–insulin model personalised from the record, kept in sync with every reading, and asked about the next four hours.
Health record
  • Body weight84.6 kg
  • Fasting plasma glucose113 mg/dL
  • HDL cholesterol42 mg/dL
  • HbA1c8.1 %
  • LDL cholesterol (calculated)149 mg/dL
  • Serum creatinine0.49 mg/dL
  • Total cholesterol230 mg/dL
Twin priors → posteriors
  • Insulin sensitivity0.36
    ×10⁻⁴ /min per µU/mL · bar = p10–p90, tick = cohort median
  • Beta-cell responsiveness31.07
    ×10⁻² µU/mL/min per mg/dL · bar = p10–p90, tick = cohort median
  • Basal liver glucose output4.84
    mg/kg/min (model units) · bar = p10–p90, tick = cohort median
  • Dawn phenomenon3.50
    % EGP rise at ~06:00 · bar = p10–p90, tick = cohort median
What-If Lab

Swap rice for millet roti, add a walk after dinner, skip a sulfonylurea dose, or shorten last night’s sleep — on this patient, with Indian foods and their Hindi names.
A steel thali with white rice, roti, dal and vegetable curries
Aarti Agarwal · next 5 h from 19:30
Plain paratha + Mixed vegetable sabzi
Baseline
Peak
287 mg/dL
Above 180
180 min
Hypo risk
0 %

Precomputed by the engine for Aarti: “Swap rice / wheat for bajra (millet) roti at dinner”.

Photo: Zoshua Colah / Unsplash

Built for India

"resourceType": "Observation",
"code": { LOINC 4548-4 HbA1c },
"subject": ABHA 91-0000-… (synthetic),
"condition": SNOMED CT 44054006

Every synthetic patient is exported as an HL7 FHIR R4 bundle, the format of the Ayushman Bharat Digital Mission.

ABDM-ready: FHIR R4 with ABHA identifiers

सफ़ेद चावलGI 73खिचड़ीGI 60बाजरे की रोटीGI 55ज्वार की रोटीGI 57रागी मुद्देGI 68पोहाGI 70इडलीGI 69मसाला डोसाGI 68राजमाGI 24अंकुरित सलादGI 25चाय (चीनी वाली)GI 60जलेबीGI 80

Katori and roti portions, Hindi names, values from IFCT 2017 and the International GI Tables where available.

73 Indian foods with glycaemic index

  • IROD Insulin-resistant obese40%
  • SIDD Severe insulin-deficient27%
  • MARD Mild age-related19%
  • SIRD Severe insulin-resistant14%

The synthetic cohort follows Asian Indian T2D clusters, including the “thin-fat” phenotype.

INSPIRED subtypes

Fasting day
No breakfast, light lunch
Glimepiride taken
Glucose-independent insulin release
Twin warns
Hypoglycaemia risk before it happens

Fasting with a sulfonylurea is a classic hypoglycaemia trap; the twin models it.

Sulfonylurea safety

BMI 18.523 overweight25 obese
Dinners at 21:00–22:30

Asian BMI thresholds and Indian meal timing are built into the cohort and the priors.

Asian cut-offs and late dinners

Clinical scenarios

Evidence

36 held-out synthetic patients, generated by a richer simulator than the twin itself. Numbers below are read from the engine’s metrics file.
> 250 mg/dL within 2 h
Hyperglycaemia
0.94AUROC
  • Median warning80 min ahead
  • Sensitivity63%
  • Precision47%
  • Alerts per patient-day2.05
< 70 mg/dL within 1 h
Hypoglycaemia
0.99AUROC
  • Median warning35 min ahead
  • Sensitivity43%
  • Precision8%
  • Alerts per patient-day0.66
tonight, predicted at bedtime
Nocturnal hypo
0.94AUROC
  • Median warning185 min ahead
  • Sensitivity88%
  • Precision6%
  • Alerts per patient-day0.13
Forecast error at +30 / +60 / +120 min
30 / 38 / 40 mg/dL
RMSE; linear baseline 42 / 77 / 141
Parkes zones A + B
99.6% / 98.9% / 98.8%
at +30 / +60 / +120 min (Type 2 grid)
Twin sync error
9.4% MARD
the CGM sensor itself: 8.5%
Architecture

  1. 01
    Truth simulator
    240 synthetic patients × 28 days; richer than the twin
    Synthetic data
  2. 02
    EHR + wearables
    FHIR R4 bundles; CGM, HR, HRV, steps, sleep
    Two streams
  3. 03
    Twin
    Glucose–insulin ODE + 64-member EnKF, 4-h forecasts
    Physiology
  4. 04
    Risk layer
    LightGBM on twin + CGM features, TreeSHAP drivers
    Machine learning
  5. 05
    API
    FastAPI REST + WebSocket replay; static demo export
    Python
  6. 06
    Console
    Next.js clinician console, What-If Lab
    Web

The twin never sees the simulator’s hidden labels or parameters; every metric is twin-versus-truth on held-out patients.

Team Stack Underflow

Yashvardhan Thanvi
Team lead
Birla Institute of Technology (BIT Mesra), Off Campus Jaipur
Devesh Jain
Team member
Birla Institute of Technology (BIT Mesra), Off Campus Jaipur

Synthetic data, runs in the browser. No sign-in.