Exploiting Personalized Observation Frequency for Proportional Integral Derivative-Based Diabetes Management
Abstract
:1. Introduction
2. Background and Related Work
2.1. PID-Based Glycemic Control
2.2. Related Work
3. Materials and Methods
4. Implementation Strategy
4.1. Environment and Experiment Setup
4.2. Simulation Duration
4.3. Evaluation of Ordinary PID for Type 1 Diabetes Blood Glucose Regulation
4.4. Optimizing PID for Blood Glucose Regulation with Harrison–Benedict Meal Generation Algorithm
4.5. Optimizing PID for Blood Glucose Regulation with Insulin Feedback
4.6. Selection of Optimization Algorithm for PID with Observation Frequency Hyperparameter
4.7. Optimizing PID for Blood Glucose Regulation with Personalized Observation Frequency
5. The Evaluation of the System Using a Simulation
5.1. Episode Length
5.2. Time in Range and Risk Index
5.3. PID with Personalized Observation Frequency over 24 h Period for Each Patient
5.4. Statistical Validation of PID-OF Performance
5.5. Benchmarking PID-OF Against Transformer-Based Systems
- Time in Range: PID-OF achieved a TIR of , nearly identical to that of Trajectory-PPO () and substantially higher than that of Decision-PPO ().
- Hyperglycemia: PID-OF exhibited hyperglycemia, which was higher than that of Trajectory-PPO () but significantly lower than that of Decision-PPO (), reflecting its ability to maintain better upper glucose control compared to Decision-PPO.
- Hypoglycemia: PID-OF demonstrated superior performance in minimizing hypoglycemia, achieving the lowest rate () compared to Trajectory-PPO () and Decision-PPO ().
- Risk Index (RI): PID-OF achieved the lowest overall risk index (), outperforming both Trajectory-PPO () and Decision-PPO ().
6. Discussion of Results
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Parameters
Patient | |||
---|---|---|---|
adolescent#001 | −0.000291775 | −1.42915 | −0.01999 |
adolescent#002 | −0.000428201 | −1.43021 | −0.00987 |
adolescent#003 | −0.000187463 | −6.29647 | −0.00785 |
adolescent#004 | −0.000188523 | −1.12114 | −0.00912 |
adolescent#005 | −5.23529 | −1.76362 | −0.01109 |
adolescent#006 | −8.65727 | −2.96707 | −0.01167 |
adolescent#007 | −1.03457 | −8.77117 | −0.00846 |
adolescent#008 | −3.34156 | −8.98967 | −0.00927 |
adolescent#009 | −0.000118396 | −1.73358 | −0.00774 |
adolescent#010 | −2.237 | −5.3542 × 10−12 | −0.01215 |
adult#001 | −0.000255779 | −8.80847 | −0.01967 |
adult#002 | −0.000762343 | −1.35421 | −0.01966 |
adult#003 | −4.93202 | −1.32181 | −0.01304 |
adult#004 | −0.000187846 | −1.10494 | −0.00892 |
adult#005 | −0.000401528 | −1.12032 | −0.01999 |
adult#006 | −0.001015064 | −1.02666 | −0.02417 |
adult#007 | −0.002457841 | −9.76956 | −0.0179 |
adult#008 | −0.000164119 | −1.23146 | −0.01839 |
adult#009 | −0.0001885 | −1.64768 | −0.01997 |
adult#010 | −0.000165964 | −3.62289 | −0.01791 |
child#001 | −4.32616 | −4.99315 | −0.0012 |
child#002 | −2.43848 | −1.19047 | −0.0063 |
child#003 | −0.000114261 | −2.2317 | −0.0019 |
child#004 | −0.000122317 | −9.84608 | −0.00171 |
child#005 | −0.000144505 | −2.35487 | −0.01025 |
child#006 | −8.50475 | −4.07014 | −0.0017 |
child#007 | −6.38112 | −7.54145 | −0.00464 |
child#008 | −6.03971 | −1.14231 | −0.00226 |
child#009 | −6.68974 | −1.83219 | −0.002 |
child#010 | −8.80842 | −5.85201 | −0.00395 |
Patient | OF | |||
---|---|---|---|---|
child#001 | −0.00015 | −1.50 | −0.00084 | 27 |
child#002 | −8.69 | −1.10 | −0.00588 | 18 |
child#003 | −0.00027 | −2.81 | −0.00151 | 27 |
child#004 | −0.0001 | −8.21 | −0.00181 | 9 |
child#005 | −0.0009 | −6.29 | −0.00905 | 15 |
child#006 | −0.00034 | −3.06 | −0.00095 | 36 |
child#007 | −0.00033 | −1.73 | −0.00281 | 21 |
child#008 | −0.00025 | −1.15 | −0.00153 | 27 |
child#009 | −0.00021 | −2.13 | −0.00091 | 18 |
child#010 | −4.51 | −2.85 | −0.00231 | 9 |
adolescent#001 | −0.00068 | −1.77 | −0.01932 | 12 |
adolescent#002 | −0.00085 | −1.13 | −0.00712 | 33 |
adolescent#003 | −0.00045 | −2.38 | −0.00312 | 18 |
adolescent#004 | −0.00088 | −2.60 | −0.00583 | 27 |
adolescent#005 | −0.00013 | −1.85 | −0.00924 | 15 |
adolescent#006 | −1.48 | −6.18 | −0.01188 | 9 |
adolescent#007 | −4.06 | −1.95 | −0.00573 | 18 |
adolescent#008 | −3.37 | −1.40 | −0.01018 | 21 |
adolescent#009 | −5.97 | −2.87 | −0.00602 | 15 |
adolescent#010 | −3.61 | −1.03 | −0.01184 | 9 |
adult#001 | −0.0034 | −7.01 | −0.01492 | 60 |
adult#002 | −0.00117 | −2.71 | −0.02286 | 33 |
adult#003 | −1.22 | −3.93 | −0.00993 | 18 |
adult#004 | −0.00038 | −2.40 | −0.00355 | 15 |
adult#005 | −0.00059 | −2.23 | −0.02001 | 30 |
adult#006 | −0.00132 | −4.03 | −0.01327 | 18 |
adult#007 | −0.00012 | −1.37 | −0.00858 | 21 |
adult#008 | −0.00155 | −3.28 | −0.01366 | 45 |
adult#009 | −0.00076 | −3.63 | −0.01746 | 24 |
adult#010 | −2.97 | −3.36 | −0.01301 | 18 |
Appendix B. The Average Blood Glucose Level over a Day
References
- Attri, B.; Goyal, A.; Gupta, Y.; Tandon, N. Basal-Bolus Insulin Regimen for Hospitalised Patients with COVID-19 and Diabetes Mellitus: A Practical Approach. Diabetes Ther. 2020, 11, 2177–2194. [Google Scholar] [CrossRef] [PubMed]
- Yu, J.; Cho, J.H.; Lee, S.H. The era of continuous glucose monitoring and its expanded role in type2 diabetes. J. Diabetes Investig. 2023, 14, 841–843. [Google Scholar] [CrossRef] [PubMed]
- Berget, C.; Driscoll, K.A.; Lagges, A.; Lange, S.; DiMeglio, L.A.; Hannon, T.S.; Woerner, S.E.; Iturralde, E.; Barley, R.C.; Hanes, S.; et al. Optimizing the use of continuous glucose monitoring in young children with type 1 diabetes with an adaptive study design and multiple randomizations. Contemp. Clin. Trials 2019, 82, 60–65. [Google Scholar] [CrossRef] [PubMed]
- Åm, M.K.; Teigen, I.A.; Riaz, M.; Fougner, A.L.; Christiansen, S.C.; Carlsen, S.M. The artificial pancreas: Two alternative approaches to achieve a fully closed-loop system with optimal glucose control. J. Endocrinol. Investig. 2023. [Google Scholar] [CrossRef]
- Bothe, M.K.; Dickens, L.; Reichel, K.; Tellmann, A.; Ellger, B.; Westphal, M.; Faisal, A.A. The use of reinforcement learning algorithms to meet the challenges of an artificial pancreas. Expert Rev. Med Devices 2013, 10, 661–673. [Google Scholar] [CrossRef]
- Trevitt, S.; Simpson, S.; Wood, A. Artificial Pancreas Device Systems for the Closed-Loop Control of Type 1 Diabetes. J. Diabetes Sci. Technol. 2016, 10, 714–723. [Google Scholar] [CrossRef] [PubMed]
- Schoelwer, M.J.; DeBoer, M.D. Artificial Pancreas Technology Offers Hope for Childhood Diabetes. Curr. Nutr. Rep. 2021, 10, 47–57. [Google Scholar] [CrossRef] [PubMed]
- Huyett, L.M.; Dassau, E.; Zisser, H.C.; Doyle, F.J. Design and Evaluation of a Robust PID Controller for a Fully Implantable Artificial Pancreas. Ind. Eng. Chem. Res. 2015, 54, 10311–10321. [Google Scholar] [CrossRef]
- Palerm, C.C. Physiologic insulin delivery with insulin feedback: A control systems perspective. Comput. Methods Programs Biomed. 2011, 102, 130–137. [Google Scholar] [CrossRef]
- Ferdinando, M.D.; Pepe, P.; Gennaro, S.D.; Palumbo, P. Sampled-Data Static Output Feedback Control of the Glucose-Insulin System. IFAC-PapersOnLine 2020, 53, 3626–3631. [Google Scholar] [CrossRef]
- Borri, A.; Pola, G.; Pepe, P.; Benedetto, M.D.D.; Palumbo, P. Symbolic Control Design of an Artificial Pancreas for Type-2 Diabetes. IEEE Trans. Control Syst. Technol. 2021, 30, 2131–2146. [Google Scholar] [CrossRef]
- Viroonluecha, P. Evaluation of Blood Glucose Level Control in Type 1 Diabetic Patients Using Online and Offline Reinforcement Learning. Ph.D. Thesis, Universidad Politecnica de Cartagena, Cartagena, Spain, 2023. [Google Scholar]
- Timmons, J.G.; Boyle, J.G.; Petrie, J.R. Time in Range as a Research Outcome Measure. Diabetes Spectr. 2021, 34, 133–138. [Google Scholar] [CrossRef]
- Fox, I.; Lee, J.; Pop-Busui, R.; Wiens, J. Deep reinforcement learning for closed-loop blood glucose control. In Proceedings of the Machine Learning for Healthcare Conference, Virtual, 7–8 August 2020; pp. 508–536. [Google Scholar]
- Ngo, P.D.; Wei, S.; Holubová, A.; Muzik, J.; Godtliebsen, F. Control of Blood Glucose for Type-1 Diabetes by Using Reinforcement Learning with Feedforward Algorithm. Comput. Math. Methods Med. 2018, 2018, 1–8. [Google Scholar] [CrossRef] [PubMed]
- Nimri, R.; Grosman, B.; Roy, A.; Nir, J.; Shvalb, N.F.; Kurtz, N.; Loewenthal, N.; Gillon-Keren, M.; Muller, I.; Atlas, E.; et al. Feasibility Study of a Hybrid Closed-Loop System with Automated Insulin Correction Boluses. Diabetes Technol. & Ther. 2021, 23, 268–276. [Google Scholar] [CrossRef]
- Biester, T.; Tauschmann, M.; Chobot, A.; Kordonouri, O.; Danne, T.; Kapellen, T.; Dovc, K. The automated pancreas: A review of technologies and clinical practice. Diabetes, Obes. Metab. 2021, 24, 43–57. [Google Scholar] [CrossRef]
- Chandrasekhar, A.; Padhi, R. Optimization Techniques for Online MPC in Android Smartphones for Artificial Pancreas: A Comparison Study. IFAC-PapersOnLine 2022, 55, 561–566. [Google Scholar] [CrossRef]
- Lopez-Zazueta, C.; Stavdahl, O.; Fougner, A.L. Low-Order Nonlinear Animal Model of Glucose Dynamics for a Bihormonal Intraperitoneal Artificial Pancreas. IEEE Trans. Biomed. Eng. 2022, 69, 1273–1280. [Google Scholar] [CrossRef] [PubMed]
- Viroonluecha, P.; Egea-Lopez, E.; Santa, J. Evaluation of blood glucose level control in type 1 diabetic patients using deep reinforcement learning. PLOS ONE 2022, 17, e0274608. [Google Scholar] [CrossRef]
- Viroonluecha, P.; Egea-Lopez, E.; Santa, J. Evaluation of Offline Reinforcement Learning for Blood Glucose Level Control in Type 1 Diabetes. IEEE Access 2023, 11, 104643–104655. [Google Scholar] [CrossRef]
- Xie, J. Simglucose v0. 2.1. 2018. Available online: https://github.com/jxx123/simglucose (accessed on 27 January 2025).
- Akiba, T.; Sano, S.; Yanase, T.; Ohta, T.; Koyama, M. Optuna: A Next-generation Hyperparameter Optimization Framework. In Proceedings of the 25rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Anchorage, AK, USA, 4–8 August 2019; pp. 2623–2631. [Google Scholar]
- Fox, I.; Wiens, J. Reinforcement Learning for Blood Glucose Control: Challenges and Opportunities. In Proceedings of the Reinforcement Learning for Real Life, An ICML Workshop, Long Beach, CA, USA, 14 June 2019. [Google Scholar]
- Emerson, H.; Guy, M.; McConville, R. Offline Reinforcement Learning for Safer Blood Glucose Control in People with Type 1 Diabetes. J. Biomed. Inform. 2023, 142, 104376. [Google Scholar] [CrossRef] [PubMed]
- Clarke, W.; Kovatchev, B. Statistical Tools to Analyze Continuous Glucose Monitor Data. Diabetes Technol. & Ther. 2009, 11, S–45–S–54. [Google Scholar] [CrossRef]
- Bergenstal, R. Understanding Continuous Glucose Monitoring Data. ADA Clin. Compend. 2018, 1, 20–23. [Google Scholar] [CrossRef]
- Bergstra, J.; Bardenet, R.; Bengio, Y.; Kégl, B. Algorithms for hyper-parameter optimization. Adv. Neural Inf. Process. Syst. 2011, 24, 2546–2554. [Google Scholar]
- Hansen, N. The CMA evolution strategy: A comparing review. Towards a New Evolutionary Computation: Advances in the Estimation of Distribution Algorithms; Springer: Berlin/Heidelberg, Germany, 2006; pp. 75–102. [Google Scholar]
- Rasmussen, C.E.; Williams, C.K. Gaussian Processes for Machine Learning; MIT Press: Cambridge, MA, USA, 2006. [Google Scholar]
- Rong, G.; Li, K.; Su, Y.; Tong, Z.; Liu, X.; Zhang, J.; Zhang, Y.; Li, T. Comparison of Tree-Structured Parzen Estimator Optimization in Three Typical Neural Network Models for Landslide Susceptibility Assessment. Remote Sens. 2021, 13, 4694. [Google Scholar] [CrossRef]
- Boughton, C.K.; Hovorka, R. New closed-loop insulin systems. Diabetologia 2021, 64, 1007–1015. [Google Scholar] [CrossRef]
- Kaufman, F.R.; Cohen, O. A Guide to Personal Continuous Glucose Monitoring; Medtronic: Dublin, Ireland, 2012. [Google Scholar]
- Bosi, E.; Choudhary, P.; de Valk, H.W.; Lablanche, S.; Castañeda, J.; de Portu, S.; Silva, J.D.; Ré, R.; de Groot, L.V.; Shin, J.; et al. Efficacy and safety of suspend-before-low insulin pump technology in hypoglycaemia-prone adults with type 1 diabetes (SMILE): An open-label randomised controlled trial. Lancet Diabetes Endocrinol. 2019, 7, 462–472. [Google Scholar] [CrossRef]
- Garg, S.K.; Weinzimer, S.A.; Tamborlane, W.V.; Buckingham, B.A.; Bode, B.W.; Bailey, T.S.; Brazg, R.L.; Ilany, J.; Slover, R.H.; Anderson, S.M.; et al. Glucose Outcomes with the In-Home Use of a Hybrid Closed-Loop Insulin Delivery System in Adolescents and Adults with Type 1 Diabetes. Diabetes Technol. Ther. 2017, 19, 155–163. [Google Scholar] [CrossRef] [PubMed]
- Forlenza, G.P.; Pinhas-Hamiel, O.; Liljenquist, D.R.; Shulman, D.I.; Bailey, T.S.; Bode, B.W.; Wood, M.A.; Buckingham, B.A.; Kaiserman, K.B.; Shin, J.; et al. Safety Evaluation of the MiniMed 670G System in Children 7–13 Years of Age with Type 1 Diabetes. Diabetes Technol. Ther. 2019, 21, 11–19. [Google Scholar] [CrossRef]
Algorithm | Kp Range | Ki Range | Kd Range | IF | Eug | Hyper | Hypo |
---|---|---|---|---|---|---|---|
CMA-ES | Stopped before reaching 5 days | ||||||
TPE | −1.00 | −1.00 | −1.00 | Yes | 0.6981 | 0.2706 | 0.0313 |
GP | 0.6664 | 0.3028 | 0.0309 | ||||
CMA-ES | Stopped before reaching 5 days | ||||||
TPE | −5.00 | −1.00 | −1.00 | No | 0.7008 | 0.2777 | 0.0215 |
GP | 0.7004 | 0.2464 | 0.0532 | ||||
CMA-ES | 0.5970 | 0.4030 | 0.0000 | ||||
TPE | −5.00 | −1.00 | −1.00 | Yes | 0.7138 | 0.2782 | 0.0081 |
GP | 0.6959 | 0.2929 | 0.0112 | ||||
CMA-ES | 0.4119 | 0.5881 | 0.0000 | ||||
TPE | −1.00 | −1.00 | −1.00 | No | 0.6485 | 0.3430 | 0.0085 |
GP | 0.6377 | 0.3623 | 0.0000 |
Method | Group | Avg. EP Length | Confidence Interval |
---|---|---|---|
PID | adolescents | 100 | - |
adults | 100 | - | |
children | 95.76 | ±0.47 | |
PID-Har | adolescents | 100 | - |
adults | 100 | - | |
children | 100 | - | |
PID-IF | adolescents | 100 | - |
adults | 100 | - | |
children | 100 | - | |
PID-OF | adolescents | 100 | - |
adults | 100 | - | |
children | 100 | - |
Metric | T-Statistic | p-Value |
---|---|---|
Euglycemia | −13.45 | |
Hyperglycemia | 14.81 | |
Hypoglycemia | 1.81 | 0.071 |
Risk Index (RI) | 12.66 | |
High Blood Glycemic Index (HBGI) | 13.02 | |
Low Blood Glycemic Index (LBGI) | 4.36 | |
Magni Risk Index (MRI) | 8.14 | |
Daily Insulin Dose | −3.33 | |
BGMin | 12.45 | |
BGMax | 9.78 |
Method | Euglycemia (%) | Hyperglycemia (%) | Hypoglycemia (%) | Risk Index |
---|---|---|---|---|
Trajectory-PPO | ||||
Decision-PPO | ||||
PID-OF |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Viroonluecha, P.; Egea-Lopez, E.; Santa, J. Exploiting Personalized Observation Frequency for Proportional Integral Derivative-Based Diabetes Management. Electronics 2025, 14, 560. https://doi.org/10.3390/electronics14030560
Viroonluecha P, Egea-Lopez E, Santa J. Exploiting Personalized Observation Frequency for Proportional Integral Derivative-Based Diabetes Management. Electronics. 2025; 14(3):560. https://doi.org/10.3390/electronics14030560
Chicago/Turabian StyleViroonluecha, Phuwadol, Esteban Egea-Lopez, and Jose Santa. 2025. "Exploiting Personalized Observation Frequency for Proportional Integral Derivative-Based Diabetes Management" Electronics 14, no. 3: 560. https://doi.org/10.3390/electronics14030560
APA StyleViroonluecha, P., Egea-Lopez, E., & Santa, J. (2025). Exploiting Personalized Observation Frequency for Proportional Integral Derivative-Based Diabetes Management. Electronics, 14(3), 560. https://doi.org/10.3390/electronics14030560