<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Experiments in non-personalized future blood glucose level prediction</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Robert Bevan</string-name>
          <email>robert.e.bevan@gmail.com</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Frans Coenen</string-name>
          <email>coenen@liverpool.ac.uk</email>
        </contrib>
      </contrib-group>
      <abstract>
        <p>In this study we investigate the need for training future blood glucose level prediction models at the individual level (i.e. per patient). Specifically, we train various model classes: linear models, feed-forward neural networks, recurrent neural networks, and recurrent neural networks incorporating attention mechanisms, to predict future blood glucose levels using varying time series history lengths and data sources. We also compare methods of handling missing time series data during training. We found that relatively short history lengths provided the best results: a 30 minute history length proved optimal in our experiments. We observed long short-term memory (LSTM) networks performed better than linear and feedforward neural networks, and that including an attention mechanism in the LSTM model further improved performance, even when processing sequences with relatively short length. We observed models trained using all of the available data outperformed those trained at the individual level. We also observed models trained using all of the available data, except for the data contributed by a given patient, were as effective at predicting the patient's future blood glucose levels as models trained using all of the available data. These models also significantly outperformed models trained using the patient's data only. Finally, we found that including sequences with missing values during training produced models that were more robust to missing values.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Accurate future blood glucose level prediction systems could play
an important role in future type-I diabetes condition management
practices. Such a system could prove particularly useful in avoiding
hypo/hyper-glycemic events. Future blood glucose level prediction
is difficult - blood glucose levels are influenced by many variables,
including food consumption, physical activity, mental stress, and
fatigue. The Blood Glucose Level Prediction Challenge 2020 tasked
entrants with building systems to predict future blood glucose levels
at 30 minutes, and 60 minutes into the future. Challenge participants
were given access to the OhioT1DM dataset [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], which comprises
8 weeks worth of data collected for 12 type-I diabetes patients. The
data include periodic blood glucose level readings, administered
insulin information, various bio-metric data, and self-reported
information regarding meals and exercise.
      </p>
      <p>
        In the previous iteration of the challenge, several researchers
demonstrated both that it is possible to predict future blood glucose
levels using previous blood glucose levels only [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], and that past
blood glucose levels are the most important features for future blood
glucose level prediction [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. In this study, we aimed to extend this
research into future glucose level prediction from historical glucose
levels only. Most previous work involved training personalized
models designed to predict future blood glucose level data for a single
patient [
        <xref ref-type="bibr" rid="ref10 ref2 ref9">9, 10, 2</xref>
        ]. Others used schemes coupling pre-training using
adjacent patient’s data with a final training phase using the patient of
interest’s data only [
        <xref ref-type="bibr" rid="ref12 ref3">3, 12</xref>
        ].
      </p>
      <p>
        In this work, we investigate the possibility of building a single
model that is able to predict future blood glucose levels for all 12
patients in the OhioT1DM data set, and the effectiveness of
applying such a model to completely unseen data (i.e. blood glucose series
from an unseen patient). We also investigate the impact of history
length on future blood glucose level prediction. We experiment with
various model types: linear models, feed-forward neural networks,
and recurrent neural networks. Furthermore, inspired by advances in
leveraging long distance temporal patterns for time series prediction
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], we attempt to build a long short-term memory (LSTM) model
that is able to use information from very far in the past (up to 24
hours) by incorporating an attention mechanism. Finally, we
compare the effectiveness of two methods for handling missing data
during training.
2
2.1
      </p>
    </sec>
    <sec id="sec-2">
      <title>Method</title>
    </sec>
    <sec id="sec-3">
      <title>Datasets</title>
      <p>As stated above, one of our primary aims was to build a single model
that is able to predict future blood glucose levels for each patient in
the data set. To this end, we constructed a combined data set
containing data provided by each of the patients. Specifically, we created a
data set composed of all of the data points contributed by the six
patients included in the previous iteration of the challenge (both
training and test sets), as well as the training data points provided by the
new cohort of patients. This combined data set was split into training
and validation sets: the final 20% of the data points provided by each
patient were chosen for the validation set. The test data sets for the
6 new patients were ignored during development to avoid bias in the
result. For experiments in building patient specific models, training
and validation sets were constructed using the patient in question’s
data only (again with an 80/20 split).
2.2</p>
    </sec>
    <sec id="sec-4">
      <title>Data preprocessing</title>
      <p>Prior to model training, the data were standardized according to:</p>
      <p>Model
Feed-forward</p>
      <p>Hyper-parameters
# hidden units 2 f16; 32; 64; 128; 256; 512; 1024g
where train, and train, are the mean and standard deviation of the
training data, respectively. There is a non-negligible amount of data
missing from the training set, which needed to be considered when
preprocessing the data. We investigated two approaches to handling
missing data: discarding any training sequences with one or more
missing data points; and replacing missing values with zeros
following standardization. It was hypothesized that the second approach
may help the system learn to be robust to missing data.
2.3</p>
    </sec>
    <sec id="sec-5">
      <title>Model training</title>
      <p>We experimented with linear models, feed-forward neural networks,
and recurrent neural networks. Each model was trained to minimize
the root mean square error (RMSE):
v
u n
RM SE = tuX
i=1
y^i</p>
      <p>
        yi 2
n
(2)
where y^i is the predicted value, yi is the true value, and n is
the total number of points in the evaluation set. Various
hyperparameters were tuned when training the feed-forward and
recurrent neural networks; Table 1 provides a summary. During
development, each model was trained for 50 epochs using the Adam
optimizer ( =0.001, 1=0.9, 2=0.999) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and a batch size of 256.
The final model was trained with early stopping using the same
optimizer settings, and a batch size of 32, for a maximum period of 500
epochs with early stopping and a patience value of 30. Each model
was trained 5 times in order to get an estimate of the influence of the
random initialization and stochastic training process on the result.
      </p>
      <p>Model selection and hyper-parameter tuning were performed for
the 30 minute prediction horizon task. The best performing model
was then trained for 60 minute prediction. Experiments were
repeated for blood glucose history lengths of 30 minutes, 1 hour, 2
hours, and 24 hours.
2.4</p>
    </sec>
    <sec id="sec-6">
      <title>Improving long distance pattern learning with</title>
    </sec>
    <sec id="sec-7">
      <title>Attention</title>
      <p>It can be difficult for recurrent neural networks to learn long distance
patterns. The LSTM network was introduced to address this problem
PH=60
37.37 (0.09)
28.4 (0.14)
27.6 (0.15)
34.28 (0.18)
32.97 (0.09)
25.99 (0.12)</p>
      <p>PH=30
16.64 (0.1)
12.85 (0.11)
12.43 (0.12)
15.9 (0.12)
15.99 (0.03)
12.4 (0.04)</p>
      <p>
        PH=60
30.8 (0.13)
23.57 (0.16)
22.78 (0.16)
28.95 (0.13)
27.04 (0.07)
21.33 (0.13)
[
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Even so, LSTM networks can struggle to learn very long range
patterns. Attention mechanisms - initially introduced in the context
of neural machine translation - have been shown to improve LSTM
networks’ capacity for learning very long range patterns [
        <xref ref-type="bibr" rid="ref1 ref7">7, 1</xref>
        ].
Attention mechanisms have also been applied to time series data, and
have proven to be effective in instances where the data exhibit long
range periodicity - for example, in electricity consumption prediction
[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. We hypothesised that blood glucose level prediction using a very
long history, coupled with an attention mechanism, could lead to
improved performance, due to periodic human behaviours (e.g. eating
meals at similar times each day; walking to and from work e.t.c). In
order to test this hypothesis, we chose the best performing LSTM
configuration trained with a history length of 24 hours, without
attention, and added an attention mechanism as per [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]:
at = f (ct; ht)
score(ht; hi)
      </p>
      <p>htT W hi
ti
ct
=
=
=
=</p>
      <p>exp(score(ht; hi)
t
j=1exp(score(ht; hj ))</p>
      <p>)
X</p>
      <p>tihi
i
tanh(Wc[ct; ht])
(3)
(4)
(5)
(6)
where score(ht; hi) is an alignment model, ct is the weighted
context vector, and at is the attention vector, which is fed into the
classification layer (without an attention mechanism, the hidden state ht
is fed into the classification layer). The dimensionality of t was
chosen using the validation set - see Table 1 for details. We also
experimented with attention mechanisms in LSTM networks designed
to process shorter sequence lengths: we chose the optimal LSTM
model architecture for each history length (30 minutes, 60 minutes,
2 hours), added an attention mechanism, and re-trained the model
(again, the optimal t dimensionality was chosen using the
validation set).
2.5</p>
    </sec>
    <sec id="sec-8">
      <title>Investigating the need for personal data during training</title>
      <p>In order to investigate the need for an individual’s data when training
a model to predict their future blood glucose levels, we trained 6
different models - each with one patient’s training data excluded from</p>
      <p>Patient excluded
540
544
552
567
584
596
the training set - using the optimal LSTM architecture determined
in previous experiments. The models were then evaluated using the
test data for the patient that was excluded from the training set. We
also trained 6 patient specific models, each trained using the patient’s
training data only. We again used the optimal architecture determined
in previous experiments, but tuned the number of hidden units using
the validation set in order to avoid over-fitting due to the significantly
reduced size of the training set (compared with the set with which the
optimal architecture was chosen). Each model was trained using the
early-stopping procedure outlined in 2.3.
3</p>
    </sec>
    <sec id="sec-9">
      <title>Results and Discussion</title>
      <p>
        Our evaluation showed that recurrent models performed significantly
better than both linear and feed-forward neural network models, for
each history length we experimented with (p=0.05, corrected paired
t-test [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]). We also found that feed-forward networks generally
outperformed linear models, likely due to their ability to model
nonlinear relationships. The optimal feed-forward network contained
512 hidden units. We found no difference between LSTM and gated
recurrent unit (GRU) networks - remaining evaluations will be
performed for LSTM recurrent networks only for simplicity. Figure 1
compares the performance of the different model types as a
function of history length. For each model class we observed that
performance decreased linearly with increasing history length. The LSTM
appeared better able to deal with longer history lengths - the
performance degradation was less severe than for the other model classes.
We found a history length of 30 minutes to be optimal for each model
class. The best performing LSTM model contained a single layer
with 128 hidden units, and was trained without dropout. The test set
results for this model are listed in Table 2.
      </p>
      <p>Table 3 compares LSTM models (with the same architecture as
above) trained with the following data sources: the individual
patient’s data only, data from all of the available patients, and data
from every other patient (excluding data contributed by the patient
in question). We observed that models trained using a large amount
of data, but excluding the patient’s data, outperformed models trained
using the patient’s data only (p=0.05). We also found no significant
difference in performance between models trained using all of the
available training data (i.e. including the patient’s data) and those
tr</p>
      <p>Comparison of validation set scores for linear, feed-forward, and
LSTM neural networks as a function of history length.
ained excluding the patient’s data, highlighting the general nature of
the models. We found that including sequences with values in the
training set produced models that were more robust to missing data,
as evidenced by the improved RMSE scores listed in Table 4: RMSE
scores were significantly improved for each patient using this
approach to training (p=0.05).</p>
      <p>Incorporating an attention mechanism further improved
performance in most instances: we observed significant improvements for
history lengths of 30 minutes, 60 minutes, and 2 hours (p=0.05), but
not for history lengths of 24 hours. Figure 3 compares the regular
LSTM and LSTM with attention performance as a function of
history length. Figure 2 shows partial auto-correlation plots for 4
different patients. Interestingly, two of the patients’ blood glucose data
patient 540, and patient 544 - don’t show any significant long term
correlation, whereas the other two - patient 552, and patient 567
both exhibit significant correlation at time lags of approximately 6
and 12 hours. We observed this behaviour in half of the patients. We
Patient ID</p>
      <p>Exclude missing data</p>
      <p>Include missing data
540
544
552
567
584
596
AVG
21.45 (0.06)
16.79 (0.06)
16.27 (0.13)
21.19 (0.1)
21.16 (0.06)
16.08 (0.07)
18.82 (2.45)
also observed correlations at even greater time lags, corresponding
to multiples of 6 hours. The difference in the patients’ partial
autocorrelation plots suggests it may be sub-optimal to train an attention
mechanism using each patient’s data at once, and that training at the
patient-level may enable the model to learn very long range patterns.
Furthermore, while we were able to train an LSTM model with a
history length of 30 minutes that generalized across all patients, it
may be the case that short range blood glucose patterns are quite
general, and long range patterns are more personalized, and tuning the
history length per patient could improve prediction performance. All
of the results presented in this section can be reproduced using
publicly available code 3.
4</p>
    </sec>
    <sec id="sec-10">
      <title>Conclusion</title>
      <p>In this study we showed that it is possible to train a single LSTM
model that is able to predict future blood glucose levels for each of
the different patients whose data are included in the OhioT1DM data
set. We also demonstrated that an individual patient’s data is not
required during the training process in order for our model to
effectively predict the patient’s future blood glucose levels. Furthermore
we showed that incorporating an attention mechanism in the LSTM
improved performance, and that including sequences with missing
values during training produced models that were more robust to
missing data.
3 https://github.com/robert-bevan/bglp</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Dzmitry</given-names>
            <surname>Bahdanau</surname>
          </string-name>
          , Kyunghyun Cho, and Yoshua Bengio, '
          <article-title>Neural machine translation by jointly learning to align and translate'</article-title>
          ,
          <source>in 3rd International Conference on Learning Representations, ICLR</source>
          <year>2015</year>
          , San Diego, CA, USA, May 7-
          <issue>9</issue>
          ,
          <year>2015</year>
          ,
          <string-name>
            <given-names>Conference</given-names>
            <surname>Track</surname>
          </string-name>
          <string-name>
            <surname>Proceedings</surname>
          </string-name>
          , (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Arthur</given-names>
            <surname>Bertachi</surname>
          </string-name>
          , Lyvia Biagi, Iva´n Contreras, Ningsu Luo, and Josep Veh´ı, '
          <article-title>Prediction of blood glucose levels and nocturnal hypoglycemia using physiological models and artificial neural networks'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>85</fpage>
          -
          <lpage>90</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Jianwei</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Kezhi</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Pau</given-names>
            <surname>Herrero</surname>
          </string-name>
          , Taiyu Zhu, and Pantelis Georgiou, '
          <article-title>Dilated recurrent neural network for short-time prediction of glucose concentration'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>69</fpage>
          -
          <lpage>73</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Sepp</given-names>
            <surname>Hochreiter</surname>
          </string-name>
          and
          <article-title>Ju¨rgen Schmidhuber, 'Long short-term memory'</article-title>
          ,
          <source>Neural computation</source>
          ,
          <volume>9</volume>
          (
          <issue>8</issue>
          ),
          <fpage>1735</fpage>
          -
          <lpage>1780</lpage>
          , (
          <year>1997</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Diederik</surname>
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Kingma</surname>
          </string-name>
          and Jimmy Ba, '
          <article-title>Adam: A method for stochastic optimization'</article-title>
          ,
          <source>in 3rd International Conference on Learning Representations, ICLR</source>
          <year>2015</year>
          , San Diego, CA, USA, May 7-
          <issue>9</issue>
          ,
          <year>2015</year>
          ,
          <string-name>
            <given-names>Conference</given-names>
            <surname>Track</surname>
          </string-name>
          <string-name>
            <surname>Proceedings</surname>
          </string-name>
          , (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Guokun</given-names>
            <surname>Lai</surname>
          </string-name>
          ,
          <string-name>
            <surname>Wei-Cheng</surname>
            <given-names>Chang</given-names>
          </string-name>
          , Yiming
          <string-name>
            <surname>Yang</surname>
          </string-name>
          , and Hanxiao Liu, '
          <article-title>Modeling long- and short-term temporal patterns with deep neural networks'</article-title>
          , CoRR, abs/1703.07015, (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Thang</given-names>
            <surname>Luong</surname>
          </string-name>
          , Hieu Pham, and
          <string-name>
            <given-names>Christopher D.</given-names>
            <surname>Manning</surname>
          </string-name>
          , '
          <article-title>Effective approaches to attention-based neural machine translation'</article-title>
          ,
          <source>in Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, EMNLP</source>
          <year>2015</year>
          , Lisbon, Portugal,
          <source>September 17-21</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>1412</fpage>
          -
          <lpage>1421</lpage>
          , (
          <year>2015</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Cynthia</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Marling</surname>
          </string-name>
          and Razvan C. Bunescu, '
          <article-title>The OhioT1DM dataset for blood glucose level prediction'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>60</fpage>
          -
          <lpage>63</lpage>
          , (
          <year>2018</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>John</given-names>
            <surname>Martinsson</surname>
          </string-name>
          , Alexander Schliep, Bjorn Eliasson, Christian Meijner, Simon Persson, and Olof Mogren, '
          <article-title>Automatic blood glucose prediction with confidence using recurrent neural networks'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>64</fpage>
          -
          <lpage>68</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Cooper</surname>
            <given-names>Midroni</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peter J. Leimbigler</surname>
            , Gaurav Baruah, Maheedhar Kolla,
            <given-names>Alfred J.</given-names>
          </string-name>
          <string-name>
            <surname>Whitehead</surname>
          </string-name>
          , and Yan Fossat, '
          <article-title>Predicting glycemia in type 1 diabetes patients: Experiments with xgboost'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>79</fpage>
          -
          <lpage>84</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>C.</given-names>
            <surname>Nadeau</surname>
          </string-name>
          and
          <string-name>
            <given-names>Y.</given-names>
            <surname>Bengio</surname>
          </string-name>
          , '
          <article-title>Inference for the generalization error', Mach</article-title>
          . Learn.,
          <volume>52</volume>
          (
          <issue>3</issue>
          ),
          <fpage>239</fpage>
          -
          <lpage>281</lpage>
          , (
          <year>September 2003</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Taiyu</surname>
            <given-names>Zhu</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Kezhi</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Pau</given-names>
            <surname>Herrero</surname>
          </string-name>
          , Jianwei Chen, and Pantelis Georgiou, '
          <article-title>A deep learning algorithm for personalized blood glucose prediction'</article-title>
          ,
          <source>in Proceedings of the 3rd International Workshop on Knowledge Discovery in Healthcare Data</source>
          , pp.
          <fpage>74</fpage>
          -
          <lpage>78</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>