Introduction
The challenge and value in meal detection
The proposed approach
Related work
-
Analysis of event orders: Events are seen as a sequence of states that tend to happen in specific orders.
-
Analysis of glucose variation: Change points can be detected using pre-determined BG rate of change thresholds, flagging a meal.
-
Analysis of glucose signal patterns: Chunks of the BG signal that very often appear after meals can be identified as response patterns.
Methods
Data description
Event responses
Response patterns and candidates selection
Candidates classification
Preprocessing pipeline
-
Exclude non-contiguous candidates, i.e., candidates defining responses that contain one or more gaps.
Feature | Description | Unit |
---|---|---|
Blood Glucose (BG) | BG value from CGM | mg/dl |
BG derivative | Estimated derivative of the BG value | mg/dl/min |
Elapsed Hours | Amount of hours passed since 00:00 of the data point’s timestamp day | hours |
Response Min | Minimum BG value within the subsequence starting from the data point | mg/dl |
Response Minutes to Min | Number of minutes needed to go from the start of the subsequence to its minimum value | minutes |
Response Derivative to Min | BG/minutes rate from the start of the subsequence to its minimum value | |
Response Max | Maximum BG value within the subsequence starting from the data point | mg/dl |
Response Minutes to Max | Number of minutes needed to go from the start of the subsequence to its maximum value | minutes |
Response Derivative to Max | BG/minutes rate from the start of the subsequence to its maximum value | |
Meala | Flag set if response is associated with an existing logged meal | {0,1} |
Classification model selection
Experimental setup
Candidates selection parameters
-
When analyzing BG responses in CGM data, meals tend to interfere to the signal with some delay [9, 10] due to overlapping external factors (e.g., exercises, and insulin). In our data-driven strategy, such interferences are not given explicitly as inputs to the model, they are considered implicit to the response signal, and to cover that a value of \(\Delta _{response}=2\) hours was taken as a reasonable response size, a value able to keep the approach on par with previous ones [18, 26, 27, 38, 39].
-
The fact that participants could have logged their entries in the beginning of their meals, during, or after adds more uncertainty to the top of the aforementioned BG response delay. This results in an implicit error regarding the timestamp of the self-logged meal event. To take this into account, \(\delta _{margin}=1\) hour was used: a candidate is considered a positive if it is placed within \(\delta _{margin}\) from a reported meal.
-
The study performed in [15] shows that 3 response patterns are able to capture enough relevant occurrences regarding the BG signals of the OhioT1DM participants, which led to the same choice in the work here proposed (\(|P|=3\)).
Description | Parameter | Value |
---|---|---|
Response size | \(\Delta _{response}\) | 2 hours |
Success margin | \(\delta _{margin}\) | 1 hour |
Number of patterns | |P| | 3 |
Distance cutoff | \(d_{cutoff}\) | 4 |
Valley size | \(\Delta _{valley}\) | 2 hours |
Binary classifiers
Used dataset and preprocessed data
Results
Training and validation: classifiers
ID | Classifier | Meals | Predictions | FP | FN | TP | PPV | TPR | F\(_1\)-score | F\(_2\)-score |
---|---|---|---|---|---|---|---|---|---|---|
540 | Decision Tree | 23 | 9 | 4 | 18 | 5 | 0.56 | 0.22 | 0.31 | 0.25 |
544 | Random Forest | 31 | 43 | 15 | 3 | 28 | 0.65 | 0.90 | 0.76 | 0.84 |
552 | MLP | 3 | 14 | 13 | 2 | 1 | 0.07 | 0.33 | 0.12 | 0.19 |
559 | Gaussian NB | 25 | 32 | 18 | 11 | 14 | 0.44 | 0.56 | 0.49 | 0.53 |
563 | Decision Tree | 25 | 34 | 19 | 10 | 15 | 0.44 | 0.60 | 0.51 | 0.56 |
567 | Gradient Boosting | 1 | 6 | 5 | 0 | 1 | 0.17 | 1.00 | 0.29 | 0.50 |
570 | Random Forest | 29 | 40 | 19 | 8 | 21 | 0.52 | 0.72 | 0.61 | 0.67 |
575 | MLP | 46 | 53 | 17 | 10 | 36 | 0.68 | 0.78 | 0.73 | 0.76 |
584 | Decision Tree | 15 | 20 | 11 | 6 | 9 | 0.45 | 0.60 | 0.51 | 0.56 |
588 | AdaBoost | 43 | 49 | 17 | 11 | 32 | 0.65 | 0.74 | 0.70 | 0.72 |
591 | AdaBoost | 40 | 65 | 35 | 10 | 30 | 0.46 | 0.75 | 0.57 | 0.67 |
596 | Gradient Boosting | 44 | 54 | 25 | 15 | 29 | 0.54 | 0.66 | 0.59 | 0.63 |
ID:588 Meals: 43 | ||||||||
---|---|---|---|---|---|---|---|---|
Classifier | Predictions | FP | FN | TP | PPV | TPR | F\(_1\)-score | F\(_2\)-score |
AdaBoost | 49 | 17 | 11 | 32 | 0.65 | 0.74 | 0.70 | 0.72 |
Random Forest | 41 | 12 | 14 | 29 | 0.71 | 0.67 | 0.69 | 0.68 |
Gradient Boosting | 47 | 17 | 13 | 30 | 0.64 | 0.70 | 0.67 | 0.68 |
Decision Tree | 38 | 13 | 18 | 25 | 0.66 | 0.58 | 0.62 | 0.60 |
MLP | 38 | 13 | 18 | 25 | 0.66 | 0.58 | 0.62 | 0.60 |
Gaussian Naive Bayes | 36 | 15 | 22 | 21 | 0.58 | 0.49 | 0.53 | 0.50 |
ID:588 Classifier: AdaBoost | |||||||||
---|---|---|---|---|---|---|---|---|---|
Day | Meals | Predictions | FP | FN | TP | PPV | TPR | F\(_1\)-score | F\(_2\)-score |
2021-10-05 | 4 | 6 | 2 | 0 | 4 | 0.67 | 1.00 | 0.80 | 0.91 |
2021-10-06 | 4 | 6 | 2 | 0 | 4 | 0.67 | 1.00 | 0.80 | 0.91 |
2021-10-07 | 4 | 5 | 2 | 1 | 3 | 0.60 | 0.75 | 0.67 | 0.71 |
2021-10-08 | 5 | 4 | 1 | 2 | 3 | 0.75 | 0.60 | 0.67 | 0.62 |
2021-10-09 | 3 | 5 | 3 | 1 | 2 | 0.40 | 0.67 | 0.50 | 0.59 |
2021-10-10 | 3 | 2 | 1 | 2 | 1 | 0.50 | 0.33 | 0.40 | 0.36 |
2021-10-11 | 5 | 6 | 2 | 1 | 4 | 0.67 | 0.80 | 0.73 | 0.77 |
2021-10-12 | 6 | 4 | 2 | 4 | 2 | 0.50 | 0.33 | 0.40 | 0.36 |
2021-10-13 | 4 | 6 | 2 | 0 | 4 | 0.67 | 1.00 | 0.80 | 0.91 |
2021-10-14 | 5 | 5 | 0 | 0 | 5 | 1.00 | 1.00 | 1.00 | 1.00 |
Average | 4.3 | 4.9 | 1.7 | 1.1 | 3.2 | 0.64 | 0.75 | 0.68 | 0.71 |
Testing: full selection and classification
ID:588 Classifier: AdaBoost | |||||||||
---|---|---|---|---|---|---|---|---|---|
Day | Meals | Predictions | FP | FN | TP | PPV | TPR | F\(_1\)-score | F\(_2\)-score |
2021-10-15 | 5 | 4 | 3 | 4 | 1 | 0.25 | 0.20 | 0.22 | 0.21 |
2021-10-16 | 2 | 3 | 2 | 1 | 1 | 0.33 | 0.50 | 0.40 | 0.45 |
2021-10-17 | 4 | 8 | 6 | 2 | 2 | 0.25 | 0.50 | 0.33 | 0.42 |
2021-10-18 | 3 | 2 | 1 | 2 | 1 | 0.50 | 0.33 | 0.40 | 0.36 |
2021-10-19 | 4 | 7 | 3 | 0 | 4 | 0.57 | 1.00 | 0.73 | 0.87 |
2021-10-20 | 4 | 6 | 2 | 0 | 4 | 0.67 | 1.00 | 0.80 | 0.91 |
2021-10-21 | 4 | 4 | 0 | 0 | 4 | 1.00 | 1.00 | 1.00 | 1.00 |
2021-10-22 | 2 | 5 | 3 | 0 | 2 | 0.40 | 1.00 | 0.57 | 0.77 |
2021-10-23 | 2 | 3 | 1 | 0 | 2 | 0.67 | 1.00 | 0.80 | 0.91 |
2021-10-24 | 4 | 8 | 4 | 0 | 4 | 0.50 | 1.00 | 0.67 | 0.83 |
Average | 3.4 | 5.0 | 2.5 | 0.9 | 2.5 | 0.51 | 0.75 | 0.59 | 0.67 |
ID | Classifier | Meals | Predictions | FP | FN | TP | PPV | TPR | F\(_1\)-score | F\(_2\)-score |
---|---|---|---|---|---|---|---|---|---|---|
540 | Decision Tree | 20 | 9 | 8 | 19 | 1 | 0.11 | 0.05 | 0.07 | 0.06 |
544 | Random Forest | 32 | 38 | 9 | 3 | 29 | 0.76 | 0.91 | 0.83 | 0.87 |
552 | MLP | 14 | 18 | 12 | 8 | 6 | 0.33 | 0.43 | 0.38 | 0.41 |
559 | Gaussian NB | 23 | 31 | 20 | 12 | 11 | 0.35 | 0.48 | 0.41 | 0.45 |
563 | Decision Tree | 23 | 28 | 18 | 13 | 10 | 0.36 | 0.43 | 0.39 | 0.42 |
570 | Random Forest | 31 | 37 | 13 | 7 | 24 | 0.65 | 0.77 | 0.71 | 0.75 |
575 | MLP | 37 | 42 | 18 | 13 | 24 | 0.57 | 0.65 | 0.61 | 0.63 |
584 | Decision Tree | 20 | 34 | 23 | 9 | 11 | 0.32 | 0.55 | 0.41 | 0.48 |
588 | AdaBoost | 34 | 50 | 25 | 9 | 25 | 0.5 | 0.74 | 0.6 | 0.67 |
591 | AdaBoost | 37 | 64 | 38 | 11 | 26 | 0.41 | 0.7 | 0.51 | 0.61 |
596 | Gradient Boosting | 45 | 59 | 27 | 13 | 32 | 0.54 | 0.71 | 0.62 | 0.67 |