Dataset Viewer
Auto-converted to Parquet Duplicate
timestamp
stringdate
2000-01-01 00:00:00
2022-02-24 11:18:57
glucose_value
float64
40
318
subject
stringclasses
413 values
2017-11-29 15:01:51
114
S01
2017-11-29 15:06:51
111
S01
2017-11-29 15:11:51
114
S01
2017-11-29 15:16:51
118
S01
2017-11-29 15:21:51
122
S01
2017-11-29 15:26:51
126
S01
2017-11-29 15:31:51
126
S01
2017-11-29 15:36:51
127
S01
2017-11-29 15:41:51
127
S01
2017-11-29 15:46:51
125
S01
2017-11-29 15:51:51
128
S01
2017-11-29 15:56:51
129
S01
2017-11-29 16:01:51
132
S01
2017-11-29 16:06:51
135
S01
2017-11-29 16:11:51
134
S01
2017-11-29 16:16:51
132
S01
2017-11-29 16:21:51
130
S01
2017-11-29 16:26:51
125
S01
2017-11-29 16:31:51
120
S01
2017-11-29 16:36:51
117
S01
2017-11-29 16:41:51
116
S01
2017-11-29 16:46:51
117
S01
2017-11-29 16:51:51
117
S01
2017-11-29 16:56:51
119
S01
2017-11-29 17:01:51
121
S01
2017-11-29 17:06:51
123
S01
2017-11-29 17:11:51
122
S01
2017-11-29 17:16:51
122
S01
2017-11-29 17:21:51
120
S01
2017-11-29 17:26:51
117
S01
2017-11-29 17:31:51
115
S01
2017-11-29 17:36:51
113
S01
2017-11-29 17:41:51
109
S01
2017-11-29 17:46:51
105
S01
2017-11-29 17:51:51
98
S01
2017-11-29 17:56:51
94
S01
2017-11-29 18:01:51
92
S01
2017-11-29 18:06:51
89
S01
2017-11-29 18:11:51
89
S01
2017-11-29 18:16:51
89
S01
2017-11-29 18:21:51
85
S01
2017-11-29 18:26:50
85
S01
2017-11-29 18:31:50
85
S01
2017-11-29 18:36:51
86
S01
2017-11-29 18:41:50
92
S01
2017-11-29 18:46:50
90
S01
2017-11-29 18:51:50
91
S01
2017-11-29 18:56:50
93
S01
2017-11-29 19:01:50
91
S01
2017-11-29 19:06:50
92
S01
2017-11-29 19:11:51
92
S01
2017-11-29 19:16:50
87
S01
2017-11-29 19:21:50
83
S01
2017-11-29 19:26:50
82
S01
2017-11-29 19:31:50
85
S01
2017-11-29 19:36:50
88
S01
2017-11-29 19:41:50
90
S01
2017-11-29 19:46:50
93
S01
2017-11-29 19:51:50
97
S01
2017-11-29 19:56:50
100
S01
2017-11-29 20:01:50
104
S01
2017-11-29 20:06:50
106
S01
2017-11-29 20:11:50
104
S01
2017-11-29 20:16:50
105
S01
2017-11-29 20:21:50
107
S01
2017-11-29 20:26:50
104
S01
2017-11-29 20:31:50
101
S01
2017-11-29 20:36:50
101
S01
2017-11-29 20:41:50
100
S01
2017-11-29 20:46:50
100
S01
2017-11-29 20:51:50
101
S01
2017-11-29 20:56:50
97
S01
2017-11-29 21:01:50
94
S01
2017-11-29 21:06:50
93
S01
2017-11-29 21:11:50
94
S01
2017-11-29 21:16:50
95
S01
2017-11-29 21:21:50
95
S01
2017-11-29 21:26:50
96
S01
2017-11-29 21:31:50
97
S01
2017-11-29 21:36:50
97
S01
2017-11-29 21:41:50
97
S01
2017-11-29 21:46:50
97
S01
2017-11-29 21:51:50
97
S01
2017-11-29 21:56:50
98
S01
2017-11-29 22:01:50
99
S01
2017-11-29 22:06:50
100
S01
2017-11-29 22:11:50
100
S01
2017-11-29 22:16:50
100
S01
2017-11-29 22:21:50
101
S01
2017-11-29 22:26:50
101
S01
2017-11-29 22:31:50
102
S01
2017-11-29 22:36:50
100
S01
2017-11-29 22:41:50
95
S01
2017-11-29 22:46:50
94
S01
2017-11-29 22:51:50
88
S01
2017-11-29 23:01:50
88
S01
2017-11-29 23:06:50
83
S01
2017-11-29 23:11:50
82
S01
2017-11-29 23:16:50
82
S01
2017-11-29 23:21:50
81
S01
End of preview. Expand in Data Studio

CGM-JEPA Pretraining Corpus

Continuous glucose monitor (CGM) time-series corpus used for self-supervised pretraining of CGM-JEPA, X-CGM-JEPA, GluFormer, and TS2Vec encoders in the paper CGM-JEPA: Learning Consistent Continuous Glucose Monitor Representations via Predictive Self-Supervised Pretraining.

Pretraining-only corpus. For the labeled downstream-evaluation cohorts (insulin resistance and β-cell dysfunction classification), see CRUISEResearchGroup/CGM-JEPA-Downstream. For pretrained model weights, see CRUISEResearchGroup/CGM-JEPA.

Quick start

Option 1 — datasets library

from datasets import load_dataset
ds = load_dataset("CRUISEResearchGroup/CGM-JEPA-Pretraining")
# DatasetDict({
#   train: Dataset({features: ['timestamp', 'glucose_value', 'subject'],
#                   num_rows: 389365})
# })

The natural unit for SSL pretraining is a 288-step (24-hour) window per (subject, day); the code repo's data_loaders/JEPALoader performs the windowing on top of this raw flat CSV.

Option 2 — file download for the code repo's pretraining scripts

huggingface-cli download CRUISEResearchGroup/CGM-JEPA-Pretraining \
  --repo-type dataset --local-dir Dataset_Open

Then from the code repository:

# (Optional, only for X-CGM-JEPA) Precompute the Glucodensity cache once.
python -m utils.precompute_glucodensity \
  --data_path Dataset_Open/cgm_initial_cohort.csv \
  --output_path Dataset_Open/gluco_cache_stride288.pkl \
  --stride 288

# Pretrain
python -m pretrain.pretrain_x_cgm_jepa     # X-CGM-JEPA (cross-view)
python -m pretrain.pretrain_cgm_jepa       # CGM-JEPA (temporal only)
python -m pretrain.pretrain_gluformer      # GluFormer baseline
python -m pretrain.pretrain_ts2vec         # TS2Vec baseline

Files

File Size Purpose
cgm_initial_cohort.csv ~12 MB Raw CGM readings (5-min sampling) — primary pretraining input

X-CGM-JEPA additionally needs a Glucodensity cache (~54 MB) which is not shipped here; it's derived deterministically from the CSV by utils/precompute_glucodensity.py in the code repository (one-time, ~few minutes on CPU).

Schema

cgm_initial_cohort.csv

Column Type Description
timestamp datetime Reading time at 5-min resolution
glucose_value float Glucose value in mg/dL
subject str Subject identifier (S01..S22 for Stanford; colas_<subject>_<day> for Colas subject-days)
  • 413 unique subject identifiers (22 Stanford + 391 Colas subject-days = 206 unique Colas subjects across multiple days).
  • 389,365 total readings.
  • Median 288 readings per subject (= one 24-hour window at 5-min sampling); max 18,527 readings for the longest Stanford continuous-CGM record.

Cohort composition

Source Subjects Rows Share
Stanford CGM Study 22 276,757 71.1 %
Colas et al. (2019) 206 (391 subject-days) 112,608 28.9 %
Total 228 unique subjects 389,365 100 %

How this corpus was built

The corpus was assembled by scripts/preprocess_dataset.py in the code repository, from two upstream sources:

  1. Stanford CGM Study (Metwally et al. 2025, Nature Biomedical Engineering) — data distributed through the Metabolic_Subphenotype_Predictor repository under MIT license (files filtered_cgm_03222026.csv, filtered_ogtt_…csv, filtered_metabolic_tests.csv).
  2. Colas et al. (2019) — Open-access CGM time series from Detrended Fluctuation Analysis in the prediction of type 2 diabetes mellitus in patients at risk, PLOS ONE 14(12):e0225817, distributed in the paper's Supporting Information files under CC BY 4.0.

Stanford rows were smoothed onto a 5-min grid via cubic smoothing splines (scipy.interpolate.make_smoothing_spline(lam=0.35)). Sensor "Low"/"High" markers were replaced with the empirical numeric min/max. Colas daily windows were concatenated with prefixed subject IDs (colas_<subject>_<day>) to disambiguate them from Stanford subjects.

Intended use

  • Self-supervised pretraining of CGM encoders (masked-patch prediction, contrastive, autoencoding objectives).
  • Comparison of CGM representation learning methods.

License & attribution

This corpus is released under CC BY 4.0 to match the licenses of its two upstream sources:

  • Stanford CGM Study data — released through Metabolic_Subphenotype_Predictor under the MIT license, accompanying Metwally et al. 2025 (Nature Biomedical Engineering).
  • Colas et al. (2019) — CGM time series from the PLOS ONE Supporting Information files, licensed under CC BY 4.0.

When using this dataset, please cite all three sources: the Stanford CGM Study (via Metabolic_Subphenotype_Predictor), Colas et al. 2019, and our CGM-JEPA paper.

Citation

Citation block to be filled once the CGM-JEPA paper has a stable venue / arXiv link.

Code repository

https://github.com/cruiseresearchgroup/CGM-JEPA

Downloads last month
5