Modeling and automatic control of blood sugar using deep learning algorithms in artificial pancreas

Modeling and automatic control of blood sugar using deep learning algorithms in artificial pancreas

Kianoush Nikfar1 Mahsa Ganjali Shahi Noghani2

1) PhD student in Biomedical Engineering, Hakim Sabzevari University, Sabzevar, Iran
2) Professional Doctor of Medicine, Sabzevar University of Medical Sciences. Sabzevar. Iran

IOI Code : AAHD-AAHKBZ
Publication : National Conference on Information Technology, Nanotechnology, Artificial Intelligence and Technological Futures Studies(itnaf.ir)
Abstract :
    Type 1 diabetes is a chronic metabolic disorder in which continuous blood sugar control in patients is of vital importance. Rapid glucose fluctuations, delayed insulin absorption, and uncertainty in sensor data make classical control systems such as PID and MPC unstable in real-time conditions. In this study, a smart insulin injection system based on real-time glucose data was designed and simulated, which uses a Safe Deep Reinforcement Learning algorithm to control insulin dosage. In the prediction section, a multi-horizontal Attention-LSTM model was used to estimate the glucose trajectory in the next 15, 30, and 60 minutes, and the prediction uncertainty was estimated using the Monte Carlo Dropout method. Subsequently, the output of this model was used as the input to the injection decision module so that the Safe DDPG controller determined the optimal insulin dosage considering hard, soft, and recovery safety constraints. To evaluate the performance, the system was tested in the UVa/Padova Type 1 Diabetes Simulator environment and on data from ten virtual patients (child, adolescent, adult). The results showed that the proposed model increased the average time in target range (TIR) ​​from 68% to 87% and reduced the time in low range (TBR) from 8.7% to 2.5% compared to conventional PID, MPC, and DDPG controllers. Also, the glucose prediction error (RMSE) improved by 31% and the insulin injection rate remained stable within the safe range of ±0.15 U/min. The obtained results indicate that the combination of LSTM-based multi-horizon prediction and reinforcement learning-based safe adaptive control can improve the performance of the artificial pancreas and be an effective step towards designing fully automated and personalized insulin injection systems.

Keywords : artificial pancreas secure reinforcement learning multi horizon glucose prediction closed loop adaptive control continuous glucose monitoring (cgm) data artificial intelligence in medicine