Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Sep:180:108995.
doi: 10.1016/j.compbiomed.2024.108995. Epub 2024 Aug 9.

Learning control-ready forecasters for Blood Glucose Management

Affiliations

Learning control-ready forecasters for Blood Glucose Management

Harry Rubin-Falcone et al. Comput Biol Med. 2024 Sep.

Abstract

Type 1 diabetes (T1D) presents a significant health challenge, requiring patients to actively manage their blood glucose (BG) levels through regular bolus insulin administration. Automated control solutions based on machine learning (ML) models could reduce the need for manual patient intervention. However, the accuracy of current models falls short of what is needed. This is due in part to the fact that these models are often trained on data collected using a basal bolus (BB) strategy, which results in substantial entanglement between bolus insulin and carbohydrate intake. Under standard training approaches, this entanglement can lead to inaccurate forecasts in a control setting, ultimately resulting in poor BG management. To address this, we propose a novel algorithm for training BG forecasters that disentangles the effects of insulin and carbohydrates. By exploiting correction bolus values and leveraging the monotonic effect of insulin on BG, our method accurately captures the independent effects of insulin and carbohydrates on BG. Using an FDA-approved simulator, we evaluated our approach on 10 individuals across 30 days of data. Our approach achieved on average higher time in range compared to standard approaches (81.1% [95% confidence interval (CI) 80.3,81.9] vs 53.6% [95%CI 52.7,54.6], p<0.001), indicating that our approach is able to reliably maintain healthy BG levels in simulated individuals, while baseline approaches are not. Utilizing proxy metrics, our approach also demonstrates potential for improved control on three real world datasets, paving the way for advancements in ML-based BG management.

Keywords: Blood glucose management; Machine learning; Time series forecasting; Type 1 diabetes.

PubMed Disclaimer

Conflict of interest statement

Declaration of competing interest The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

Figures

Fig. 7.
Fig. 7.
Inverted pendulum forecast error during model-based control as a function of mean difference between the selected action and the would-be behavior policy action for baseline (left) and the proposed approach (right). The baseline forecaster fails when it selects actions dissimilar to what was observed in the training data.
Fig. 8.
Fig. 8.
Model performance for fully synthetic data in a simple regression task. Left: the proposed approach significantly outperforms baselines when applied to monotonic agent action effects but does not yield improvement in scenarios where monotonicity is violated. Right: Model performance as a function of the average magnitude of the second derivative of the agent action effect, as assessed by a family of exponential functions. The proposed approach markedly outperforms the baselines when the second derivative is of low magnitude, indicating a near-linear relationship, but performance deteriorates as the magnitude increases.
Fig. 1.
Fig. 1.
Our setting is similar to modeling treatment effects in the presence of confounding: the basal bolus strategy creates a strong correlation between bolus and carbohydrate values, making it difficult to disentangle their impacts on future BG values. Bolus values depend on three patient-specific parameters: BG target (TG), carbohydrate ratio (CR, models the expected rise in BG attributable to carbohydrate intake), and correction factor (CF, models the decrease in BG attributable to insulin). g and c denote current BG and carbohydrate values.
Fig. 2.
Fig. 2.
An example of distribution shift. During training, input variables b and c are correlated. At evaluation, this correlation is broken, and the forecaster fails to account for the change in future values attributable to b because of too strong a dependence on c.
Fig. 3.
Fig. 3.
Left: Example data adhering to the behavior policy studied, where a strong correlation between user and agent actions is present across all samples but slightly reduced when a criterion is met. Right: Example agent action impacts on a hypothetical state variable where we expect our approach to perform optimally (blue), well (orange), and poorly (green).
Fig. 4.
Fig. 4.
In our setting, the only available training data exhibits entanglement between paired action values. We aim to learn a forecaster on this data that can be directly applied to model-based control schemes. Our proposed approach encompasses two steps. In the first step, we separate the agent action’s residual effect from the effect of the portion which is fully correlated with the user action. In the second step, we employ cosine similarity in the loss term to ensure that the total agent action effect learned aligns with the residual effect identified in step 1.
Fig. 5.
Fig. 5.
Evaluation methodology for real data: We input historical BG and carbohydrate data into our forecaster alongside an array of potential boluses. The bolus that yields a forecast closest to the desired target is chosen. If the post-meal BG remains within the euglycemic range, we compute bolus agreement by measuring the difference between the patient’s bolus choice and our model’s recommendation. Conversely, if the BG veers outside of the euglycemic range we determine potential bolus improvement by assessing the fraction of model-recommended boluses that lean in the optimal direction—higher than the patient bolus when post-meal BG is hyperglycemic and lower if hypoglycemic.
Fig. 6.
Fig. 6.
Sensitivity analyses on synthetic BG data. (a) Our approach vs. baseline as the correlation between bolus and carbohydrate values varies. Our method markedly outperforms the baseline when the correlation between bolus and carbohydrate values exceeds r=0.5 and yields similar performance to the baseline at low correlation values. (b) Our approach consistently outperforms baseline when unpaired bolus and carbohydrate values are added to the training data. Evaluation for both plots utilize the counterfactual dataset.

References

    1. Gregory GA, Robinson TIG, Linklater SE, Wang F, Colagiuri S, de Beaufort C, Donaghue KC, International Diabetes Federation Diabetes Atlas Type 1 Diabetes in Adults Special Interest Group, Magliano DJ, Maniam J, Orchard TJ, Rai P, Ogle GD, Global incidence, prevalence, and mortality of type 1 diabetes in 2021 with projection to 2040: a modelling study, Lancet Diabetes Endocrinol. (2022). - PubMed
    1. Janez A, Guja C, Mitrakou A, Lalic N, Tankova T, Czupryniak L, Tabák AG, Prazny M, Martinka E, Smircic-Duvnjak L. L, Insulin therapy in adults with type 1 diabetes mellitus: a narrative review, Diabetes Ther. (2020). - PMC - PubMed
    1. Weinstock Ruth S., Patient education: Type 1 diabetes: Insulin treatment (beyond the basics), UpToDate (2023).
    1. Lee Joyce M., Rusnak Andrea, Garrity Ashley, Hirschfeld Emily, Thomas Inas H., Wichorek Michelle, Lee Jung Eun, Rioles Nicole A., Ebekozien Osagie, Corathers Sarah D., Feasibility of electronic health record assessment of 6 pediatric type 1 diabetes self-management habits and their association with glycemic outcomes, JAMA Netw. Open (ISSN: 2574–3805) 4 (10) (2021) e2131278, 10.1001/jamanetworkopen.2021.31278. - DOI - PMC - PubMed
    1. Rubin-Falcone H, Fox I, Hirschfeld E, Ang L, Pop-Busui R, Lee JM, Wiens J, Association between management of continuous subcutaneous basal insulin administration and HbA1C, J. Diabetes Sci. Technol (2022). - PMC - PubMed

Publication types