Open-source · CGM representation learning · research only

Every glucose day has a shape. Give it a fingerprint.

GlucoTrace turns 24 hours of continuous glucose monitor readings into 128 numbers you can compare, search, and visualize. It's a small, readable Transformer that never fills in missing readings, and it's evaluated against tests written down before training.

288 readings · 5-min cadence · mg/dL
USA · BIG IDEAsfingerprint · 128
Spain · Colas 2019cosine 0.972
We searched 502 other public CGM days for the closest fingerprint. The closest match came from a different study, in another country. The model has no clock input, so it compares the shape of the glucose day rather than when or where it was recorded. Amber cells are positive values and blue cells are negative. Public data: BIG IDEAs participant 001 (PhysioNet, ODC-By 1.0) and Colas et al. 2019 participant 030 (PLOS ONE, CC BY 4.0).

From install to your first report

A CSV with timestamp,glucose goes in, in mg/dL or with --unit mmol/L. You get back a fingerprint, a similarity score, or a single HTML report that works offline and loads no scripts.

$ pip install glucotrace
$ glucotrace download-model
$ glucotrace encode my-day.csv            # 128-number fingerprint
$ glucotrace compare monday.csv tuesday.csv
$ glucotrace report my-day.csv --manifest corpus/manifest.json --output report.html

Built to be believed

Most health-ML demos only show their best number. GlucoTrace was built so you can check its claims yourself.

observed_mask · gap_age

Missing stays missing

Sensor gaps are tracked explicitly and never interpolated. A dropped reading can't pass for a real one.

sha-256 · participant-disjoint

No leakage by accident

Splits are made by participant and bound to checksummed manifests. The loader refuses splits that no longer match their data.

declared before training

Pre-registered tests

Thresholds, probes, and the number of candidates are fixed in writing first. Each test set is opened once.

511,372 parameters

Small enough to read

A three-layer Transformer that trains on a laptop CPU in minutes, with 109 tests and no hidden services.

Results

Measured on people the model never saw during training.

QuestionAnswer
Stable when readings go missing?YESMedian cosine 0.965 after removing 30% of readings, on new people (sealed test)
Links days from the same person?OFTENA day's closest match is the same person about half the time. Treat fingerprints as personal data
Clinically validated?NONo diagnostic, treatment, or safety claim is made
Research software only. GlucoTrace is not a medical device. Do not use it for diagnosis, treatment, insulin or medication dosing, alerts, or patient care.