File size: 1,642 Bytes
2f564ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
model-index:
  - name: Gluformer-tiny
    results:
      - task:
          type: glucose-prediction
        metrics:
          - name: RMSE
            type: 60 minute prediction
            value: 25.36
        source:
          name: Brown2019
          url: https://www.nejm.org/doi/full/10.1056/NEJMoa1907863
---

# Model Card for Gluformer Blood Glucose Prediction Model

This model uses past continuous glucose monitor (CGM) values to predict values for the next hour.

## Model Details

### Model Description

- **Developed by:** Renat Sergazinov, Mohammadreza Armandpour, Irina Gaynanova
- **Funded by:** Texas A&M University
- **Shared by:** Nat Jeffries
- **Model type:** Time series encoder-decoder Transformer

### Model Sources

- **Repository:** [Github](https://github.com/mrsergazinov/gluformer)
- **Paper:** [Arxiv](https://arxiv.org/pdf/2209.04526)

## How to Get Started with the Model

Use the code below to get started with the model.

```
from transformers import AutoModel, AutoConfig
from datetime import timedelta, datetime

model = AutoModel.from_pretrained('njeffrie/Gluformer-tiny', trust_remote_code=True)
config = AutoConfig.from_pretrained('njeffrie/Gluformer-tiny', trust_remote_code=True)

# Dummy input and timestamp values.
input_glucose = [100.0 for _ in range(config.len_seq)]
timestamps = [datetime(2025, 7, 25, 0, 0) + timedelta(minutes=5 * i) for i in range(len(input_glucose))]
subject_id = 0

pred, log_var = model(subject_id, timestamps, input_glucose)
```

Predictions will be predicted future glucose values in 5 minute increments. Log var indicates confidence. See the paper for more details.