Informer-based diabetic blood glucose prediction model

The Informer model is improved by eliminating outliers through filters, expanding the embedding layer, multi-scale convolution and deep residual network, which solves the problems of data anomaly and periodic capture in blood glucose prediction and achieves more accurate blood glucose prediction.

CN120636802APending Publication Date: 2025-09-12JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510733641.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The Informer model does not fully consider the patient's physiological characteristics and data set characteristics in predicting blood glucose in diabetic patients, which makes it difficult to capture the multi-periodic nature of blood glucose changes. In addition, continuous blood glucose monitoring equipment is interfered with by multiple factors, resulting in many data outliers, affecting the accuracy and reliability of the prediction results.

Method used

Outliers are eliminated through filters, the input length of the embedding layer is expanded to merge the features of eating and insulin injection, multi-scale convolution modules are used to extract features of different time scales, and hierarchical predictions are performed through deep residual networks. An improved loss function is designed to enhance the model's learning ability.

Benefits of technology

The model's ability to capture blood sugar changes has been improved, and the prediction accuracy and reliability have been enhanced, especially when dealing with blood sugar changes with more detailed information, which has significantly improved the prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120636802A_ABST
    Figure CN120636802A_ABST
Patent Text Reader

Abstract

The invention discloses a diabetic patient blood glucose prediction model based on Informer, which comprises the following steps: S1, the model takes a historical sequence matrix as input, and the historical sequence matrix comprises fingertip blood glucose values, continuous monitoring historical blood glucose values, feeding events and multi-dimensional characteristics of insulin; and S2, eliminating an abnormal value of the historical blood glucose value by using a filter to ensure the reliability of the input data. The invention relates to the technical field of Informer models, and has the beneficial effect that the Informer model is improved. In combination with data set characteristics and physiological characteristics, a Savitzky-Golay filter is used to eliminate abnormal values, fusion characteristics are introduced, dispersed food intake and insulin injection data and other data are integrated and expanded, multi-scale convolution is used to capture characteristics of different length periods, and an embedded layer is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of informer models, in particular to an informer-based blood glucose prediction model for diabetic patients. Background Art

[0002] In the field of blood glucose prediction for diabetic patients, the Informer model cannot effectively capture the multi-periodicity of blood glucose changes because its embedding layer does not fully consider the patient's physiological characteristics and dataset characteristics. In addition, since continuous blood glucose monitoring equipment is subject to interference from various factors, a large number of outliers exist in the dataset, which seriously affects the accuracy and reliability of blood glucose prediction results.

[0003] In pursuit of computing performance optimization, the Informer model introduces a probabilistic sparse attention mechanism, focusing only on the time points judged to be the most relevant in the input features. This may cause the model to lose some information, especially when important information happens to be in an ignored position in the sequence; the self-attention distillation layer compresses the feature matrix and cannot effectively separate features of different periods. Especially when processing data with rich detailed information such as blood sugar changes, these problems may weaken the model's learning and prediction capabilities. Summary of the Invention

[0004] The purpose of the present invention is to solve the above problems and design a blood glucose prediction model for diabetic patients based on Informer.

[0005] The technical solution of the present invention to achieve the above-mentioned purpose is to provide an Informer-based blood glucose prediction model for diabetic patients, comprising the following steps:

[0006] Step S1: The model takes the historical sequence matrix as input, which includes the multi-dimensional features of fingertip blood glucose values, continuous monitoring historical blood glucose values, eating events, and insulin;

[0007] Step S2: Using a filter to eliminate abnormal values ​​of historical blood glucose values ​​to ensure the reliability of input data;

[0008] Then, the input length of the embedding layer is expanded, and the eating and insulin injection features are merged into fusion features to enhance the correlation between features.

[0009] Step S3: The time encoding and position encoding mechanisms assign absolute time position and relative temporal dependency information to the input sequence to capture the periodicity of blood glucose changes. A multi-scale convolution module is used to achieve hierarchical extraction of short, medium, and long time scale features of blood glucose data through a combination of convolution kernels of different sizes.

[0010] Step S4: The features of the multi-scale convolution output are independently predicted through three parallel prediction modules, and the results of each module are weighted and summed to generate the final blood glucose prediction value.

[0011] The filter in step S2 performs a k-order polynomial fit on a series of data points within a fixed-length sliding window to produce smoothed data. Specifically, the filter uses the least squares method to accurately fit a high-order polynomial to the data points, and then calculates the smoothed value of each data point based on the fitting results.

[0012] The calculation process is as follows:

[0013] ;

[0014] The window length is set to , the data is , The value range is , by constructing order polynomial to fit each data point . Then calculate the residual sum of squares of the original data and the fitted data:

[0015] ;

[0016] In ensuring When the value is the smallest, the fitted value is the smoothed value. Smoothing the entire data set can be completed by sliding the window over the data set.

[0017] The blood glucose dataset contains insulin injection and diet records, specifically recording the time points and corresponding dosages of insulin injections, as well as the time and amount of each meal. The effects of insulin injection and eating on blood glucose are not immediate, but rather delayed. During certain time periods, there may be no new insulin injections or meal records, but blood glucose fluctuations are still potentially affected by previous insulin injections and diets. In addition, insulin injections for diabetic patients are often associated with mealtime behavior.

[0018] While maintaining the model input time window length, the embedding layer extends the time range of the input data, allowing the model to capture longer-term information. This improvement addresses the issue of information loss and allows the model to better capture the potential impact of insulin injections and meals on blood sugar fluctuations. The multi-head attention layer and fully connected layer then learn the insulin and meal features over the extended time period, generating a joint feature for the time period corresponding to the model input time window length. This joint feature is then combined with other features and used as the model input.

[0019] Step S3: Multi-scale convolution is used in the encoding layer, using multiple convolution kernels of different sizes to extract features from the input data at multiple scales. Large-scale convolution kernels can capture long-term dependencies in the data and learn the overall trends and cyclical changes in the data. Medium-scale convolution kernels capture short-term features related to fluctuations in a specific time period, such as blood sugar changes within a few hours after eating. Small-scale convolution kernels focus on mining local features in the data and can capture subtle fluctuations in the data, such as subtle changes in blood sugar over a short period of time.

[0020] The prediction module incorporates the concept of deep residual learning, stacking three residual modules. Each residual module generates two outputs: a prediction output and a backtracking output. The prediction output serves as the prediction value for the module at that layer, while the backtracking output represents the learned input content. Each residual module subtracts the backtracking output from its own input, and the difference serves as the input for the next residual module, achieving layer-by-layer learning. Finally, the prediction values ​​of each residual module are accumulated to obtain the prediction value of the current prediction module.

[0021] Each residual module is constructed by combining an encoding layer, a fully connected layer, and a linear layer. The encoding layer, which uses the encoding layer of the Informer model, is responsible for feature extraction and transformation, mapping the raw data into a higher-dimensional feature space to discover potential patterns in the data. The fully connected layer captures the complex nonlinear relationships between features and learns the complex patterns hidden in the data through weighted combinations of different features. The linear layer serves as the output layer, generating the final prediction and regression results.

[0022] The input sequence is divided into two parts, where Represents the blood glucose value in the input sequence, which is the target variable that the model focuses on; Represents other features in the input sequence besides blood glucose values, including eating conditions, mealtime insulin, and other data. These features can provide rich contextual information for blood glucose prediction.

[0023] When the input data enters the first residual module, the two linear layers in the module will output the predicted values ​​respectively. With backtracking value . Predicted value It is the prediction result of the future blood glucose value obtained by the current residual module based on the input data through a series of operations such as encoding, feature mapping, and linear transformation. Represents the learning result of the current module on the input blood glucose value, reflecting the degree to which the model captures the characteristics of blood glucose value at the current stage. Based on the idea of ​​residual learning, in order to enable the model to more carefully mine the potential information in the blood glucose value, the input blood glucose value Subtract the learned blood glucose value The resulting difference serves as the input for the next residual module. Each residual module outputs a corresponding predicted value, and the predictions from each module are ultimately accumulated to form the model's final prediction. This residual stacking and module-by-module learning approach enables the model to iteratively approximate the true pattern of blood sugar fluctuations, effectively improving the model's ability to learn and predict dynamic blood sugar changes.

[0024] Although other features X' in the input data can provide valuable auxiliary information for the model and help more fully understand the mechanisms of blood glucose fluctuations, the data distribution of these features is typically sparse, with a large number of missing values ​​or irregular data points. Performing backtracking on these features will introduce noise, interfere with the model's learning process, and reduce the model's prediction accuracy.

[0025] Three auxiliary tasks are added to the model:

[0026] Reconstruction loss (Lr):

[0027] The model performs reverse mapping The purpose of supervision is to enhance the learning efficiency of the current layer module and optimize the input of the next layer module, complete the step-by-step prediction to improve the prediction accuracy, so it is necessary to add an MSE Loss: To encourage the network to learn gradually, the loss of each module should be proportional to its position in the network, so MSELoss needs to be multiplied by the number of module layers. The loss Lr is the sum of the reconstruction losses of each block:

[0028] ;

[0029] Prediction loss (Lf):

[0030] In order to encourage each module to contribute to accurate prediction, the loss of each module prediction is calculated. The loss calculation method is similar to Lr, but the weight is increased by cubic value to emphasize the weight of the prediction part in the network. The loss Lf is the sum of the prediction losses of each block:

[0031] ;

[0032] Module loss (Lm):

[0033] Under the supervision of reconstruction loss and prediction loss, the model prediction effect tends to be more accurate in the first layer of modules, while the role of the following two layers of modules is weakened. To avoid this situation, the inverse of the reverse mapping of each layer of modules is used to penalize the block, and this penalty is extended by the inverse of its position in the stack. The loss Lm is the sum of the penalties of each block:

[0034] ;

[0035] Ultimately, the loss of the entire model is the weighted sum of the above three losses:

[0036] ;

[0037] in, is a hyperparameter.

[0038] An Informer-based blood glucose prediction model for diabetic patients is produced using the technical solution of the present invention, and the Informer model is improved. Combining the characteristics of the data set with physiological features, the Savitzky-Golay filter is used to eliminate outliers, fusion features are introduced, scattered data such as eating and insulin injections are integrated and expanded, multi-scale convolution is used to capture features of different length periods, and the embedding layer is optimized. Predictions are made separately based on the multi-level features learned by multi-scale convolution, and based on the principle of deep residual network, a network structure with hierarchical residual connections is designed, and the loss function is redesigned to ensure that the model fits the data set layer by layer, thereby avoiding the disadvantage that the probabilistic sparse attention mechanism may miss key information. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a flow chart of the Informer-based blood glucose prediction model for diabetic patients according to the present invention;

[0040] Figure 2 Schematic diagram of the Informer-based blood glucose prediction model for diabetic patients according to the present invention;

[0041] Figure 3 This is a heat map of the OhioT1DM dataset variables correlation of the Informer-based diabetic blood glucose prediction model described in the present invention;

[0042] Figure 4 The Clarke error network of the diabetic blood glucose prediction model based on Informer of the present invention for different patients when the prediction time is 30 minutes;

[0043] Figure 5It is the Clarke error network of different patients when the prediction time of the Informer-based diabetic blood glucose prediction model of the present invention is 60 minutes. DETAILED DESCRIPTION

[0044] The present invention will be described in detail below with reference to the accompanying drawings. Figure 1-5 As shown, a blood glucose prediction model for diabetic patients based on Informer is proposed. This patent proposes a blood glucose prediction model and method for diabetic patients based on the Informer model. Its working principle is as follows:

[0045] The model takes as input a historical sequence matrix containing multi-dimensional features such as fingertip blood glucose values, continuous monitoring history blood glucose values, meal events, and insulin (including dosed insulin injections and continuous insulin injections). First, a filter is used to eliminate outliers in the historical blood glucose values ​​to ensure the reliability of the input data. The embedding layer input length is then expanded to combine meal and insulin injection features into a fused feature, enhancing the correlation between features. Time and position encoding mechanisms are then used to assign absolute time position and relative temporal dependency information to the input sequence to capture the cyclical patterns of blood glucose changes. A multi-scale convolution module is then employed to extract hierarchical features of the blood glucose data at different time scales, including short, medium, and long, by combining convolution kernels of different sizes. Finally, three parallel prediction modules independently predict the features output by the multi-scale convolution. The results of each module are weighted and summed to generate the final blood glucose prediction value.

[0046] The functions of the embedding layer include data conversion, capturing data features, introducing location information, etc. By optimizing the embedding layer, we can enhance data processing capabilities, improve model adaptability, and enhance model performance.

[0047] Continuous blood glucose monitoring technology can perform real-time dynamic monitoring of historical blood glucose values. However, continuous blood glucose monitoring is susceptible to factors such as sensor failure, unstable connection, and external environmental interference, which can easily lead to measurement errors, causing the measured values ​​to deviate from the true blood glucose curve and increasing the complexity of blood glucose prediction. Smoothing time series data is an effective way to solve this outlier problem.

[0048] The basic principle of the Savitzky-Golay filter is to fit a k-order polynomial to a series of data points within a fixed-length sliding window to produce smoothed data. Specifically, the filter uses the least squares method to accurately fit a high-order polynomial to the data points, and then calculates the smoothed value for each data point based on the fitting result.

[0049] The calculation process is as follows:

[0050] ;

[0051] The window length is set to , the data is , The value range is , by constructing order polynomial to fit each data point . Then calculate the residual sum of squares of the original data and the fitted data:

[0052] ;

[0053] In ensuring When the value is the smallest, the fitted value is the smoothed value. Smoothing the entire data set can be completed by sliding the window over the data set.

[0054] Blood glucose datasets contain insulin injection and meal records, specifically recording the timing and dosage of insulin injections, as well as the timing and amount of each meal. The effects of insulin injections and meals on blood glucose aren't immediate, but rather delayed. During certain time periods, there may be no new insulin injections or meal records, but blood glucose fluctuations are still potentially influenced by previous insulin injections and meals. Furthermore, insulin injections in diabetic patients are often associated with mealtimes.

[0055] While maintaining the model input time window length, the embedding layer extends the time range of the input data, allowing the model to capture longer-term information. This improvement addresses the issue of information loss and allows the model to better capture the potential impact of insulin injections and meals on blood sugar fluctuations. The multi-head attention layer and fully connected layer then learn the insulin and meal features over the extended time period, generating a joint feature for the time period corresponding to the model input time window length. This joint feature is then combined with other features and used as the model input.

[0056] The Informer model uses one-dimensional convolution operations for feature extraction. Due to the limited receptive field of the convolution kernel, it can only focus on a small segment of local information in the input sequence.

[0057] After each meal, diabetic patients experience a rapid rise in blood sugar levels, followed by a gradual decline. Furthermore, the trends in blood sugar fluctuations over the same time period on different days are similar. This suggests that blood sugar fluctuations exhibit multi-layered cyclical characteristics, including long-term daily cycles and localized characteristics related to meal events.

[0058] Therefore, multi-scale convolution is used in the encoding layer, using multiple convolution kernels of different sizes to extract features from the input data at multiple scales. Large-scale convolution kernels can capture long-term dependencies in the data and learn the overall trends and cyclical changes in the data. Medium-scale convolution kernels capture short-term features related to fluctuations in a specific time period, such as blood sugar changes within a few hours after eating. Small-scale convolution kernels focus on mining local features in the data and can capture subtle fluctuations in the data, such as subtle changes in blood sugar over a short period of time. This multi-scale convolution method not only compensates for the limited receptive field of traditional convolution operations, but also strengthens the model's ability to model long-term and short-term dependencies through a multi-scale perspective.

[0059] The distillation mechanism cannot effectively separate features of different periods, and some important features may be weakened or obscured. After completing multi-scale convolution in the embedding layer, the prediction model makes separate predictions for feature maps of different period lengths, fully preserving the independence and uniqueness of features of different periods.

[0060] The prediction module incorporates the concept of deep residual learning, stacking three residual modules. Each residual module generates two outputs: a prediction output and a backtracking output. The prediction output serves as the prediction value for the module at that layer, while the backtracking output represents the learned input content. Each residual module subtracts the backtracking output from its own input, and the difference serves as the input for the next residual module, achieving layer-by-layer learning. Finally, the prediction values ​​of each residual module are accumulated to obtain the prediction value of the current prediction module.

[0061] Each residual module is constructed by combining an encoding layer, a fully connected layer, and a linear layer. The encoding layer, which uses the encoding layer of the Informer model, is responsible for feature extraction and transformation, mapping the raw data into a higher-dimensional feature space to discover potential patterns in the data. The fully connected layer captures the complex nonlinear relationships between features and learns the complex patterns hidden in the data through weighted combinations of different features. The linear layer serves as the output layer, generating the final prediction and regression results.

[0062] The input sequence is divided into two parts, where Represents the blood glucose value in the input sequence, which is the target variable that the model focuses on; Represents other features in the input sequence besides blood glucose values, including eating conditions, mealtime insulin, and other data. These features can provide rich contextual information for blood glucose prediction.

[0063] When the input data enters the first residual module, the two linear layers in the module will output the predicted values ​​respectively. With backtracking value . Predicted value It is the prediction result of the future blood glucose value obtained by the current residual module based on the input data through a series of operations such as encoding, feature mapping, and linear transformation. Represents the learning result of the current module on the input blood glucose value, reflecting the degree to which the model captures the characteristics of blood glucose value at the current stage. Based on the idea of ​​residual learning, in order to enable the model to more carefully mine the potential information in the blood glucose value, the input blood glucose value Subtract the learned blood glucose value The resulting difference serves as the input for the next residual module. Each residual module outputs a corresponding predicted value, and the predictions from each module are ultimately accumulated to form the model's final prediction. This residual stacking and module-by-module learning approach enables the model to iteratively approximate the true pattern of blood sugar fluctuations, effectively improving the model's ability to learn and predict dynamic blood sugar changes.

[0064] While other features X' in the input data can provide valuable auxiliary information for the model and help more fully understand the mechanisms of blood glucose fluctuations, the data distribution for these features is typically sparse, with numerous missing values ​​or irregular data points. Performing backtracking on these features would introduce noise, disrupting the model's learning process and reducing its prediction accuracy. Therefore, the model employs a targeted processing strategy, generating backtracked values ​​only for the input blood glucose values, while omitting backtracking for other features.

[0065] The Informer model uses mean square error as the loss function, namely MSE, and the formula is:

[0066] ;

[0067] However, the model in this patent uses different blocks for predictions at different cycles, and each block is gradually learned to make the predicted value approach the true value. A new loss function is proposed based on the characteristics of the model. In addition to the final prediction based on the training loss, additional losses are also required to improve the quality of the intermediate layers. This patent adds three auxiliary tasks to the model:

[0068] Reconstruction loss (Lr):

[0069] The model performs reverse mapping The purpose of supervision is to enhance the learning efficiency of the current layer module and optimize the input of the next layer module, complete the step-by-step prediction to improve the prediction accuracy, so it is necessary to add an MSE Loss: To encourage the network to learn gradually, the loss of each module should be proportional to its position in the network, so MSELoss needs to be multiplied by the number of module layers. The loss Lr is the sum of the reconstruction losses of each block:

[0070] ;

[0071] Prediction loss (Lf):

[0072] In order to encourage each module to contribute to accurate prediction, the loss of each module prediction is calculated. The loss calculation method is similar to Lr, but the weight is increased by cubic value to emphasize the weight of the prediction part in the network. The loss Lf is the sum of the prediction losses of each block:

[0073] ;

[0074] Module loss (Lm):

[0075] Under the supervision of reconstruction loss and prediction loss, the model prediction effect tends to be more accurate in the first layer of modules, while the role of the following two layers of modules is weakened. To avoid this situation, the inverse of the reverse mapping of each layer of modules is used to penalize the block, and this penalty is extended by the inverse of its position in the stack. The loss Lm is the sum of the penalties of each block:

[0076] ;

[0077] Ultimately, the loss of the entire model is the weighted sum of the above three losses:

[0078] ;

[0079] in, is a hyperparameter.

[0080] The characteristics of this implementation are the use of Savitzky-Golay filter, the improvement of input data structure to properly solve the problem of incomplete input time slice features, and the introduction of multi-scale convolution to comprehensively capture blood glucose feature information at different scales.

[0081] Based on the principle of deep residual network, a network structure with hierarchical residual connections is designed. Through layer-by-layer prediction, the prediction results are continuously approached to the true value; the loss function is redesigned to enhance the effect of layer-by-layer prediction of the model.

[0082] In this implementation plan, the public dataset OhioT1DM provided by Ohio University in the United States was used to collect physiological data from 6 patients with type 1 diabetes who were receiving insulin treatment for 8 consecutive weeks. A continuous blood glucose monitoring device was used to collect blood glucose values ​​every five minutes, a sports bracelet was used to record the patient's skin electricity, air temperature, skin temperature and other data, and a subcutaneous insulin injection device was used to complete insulin injection and recording. In addition, the dataset also includes fingertip blood glucose tests and activity information such as exercise duration, exercise intensity, and sleep status reported by patients themselves. Table 1 lists the main features of the dataset and their meanings, and Table 2 shows the specific data volume of the 6 patients.

[0083] Table 1. Dataset feature description

[0084]

[0085] Table 2 Number of samples reported by each patient

[0086]

[0087] To verify the accuracy of the prediction model proposed in this patent, six typical benchmark methods were selected as comparison models. All experiments were based on the OhioT1DM dataset for model training and evaluation, and RMSE and MAE were used as evaluation metrics.

[0088] The dataset covers a rich variety of features, and some features have low correlation with the target variable.

[0089] After summarizing the data of all patients, it was found that the data integrity of the bracelet records was poor, and the values ​​of many features were zero or missing. Therefore, after removing these features, the Pearson correlation coefficient was used for analysis, and the experimental results were as follows: Figure 3 As shown:

[0090] Fingerstick blood glucose values ​​(Finger_stick) and continuous glucose monitoring values ​​(glucose) show a significant positive correlation. In addition, insulin injection (basal) and temporary insulin values ​​(temp_basal) also have a significant positive correlation with glucose. Therefore, temporary insulin values ​​(temp_basal) and insulin values ​​(basal) are merged into a single feature.

[0091] Although the correlations between carbs and insulin bolus and glucose were weak, medical knowledge suggests that patients with diabetes typically take insulin injections after eating, leading to a weak correlation between the two. Therefore, these two characteristics should still be considered. Although sleep has a certain correlation with glucose, due to the significant lack of sleep data in the dataset, this study decided not to include it in the analysis.

[0092] Finally, Finger_stick, basal, carbs, blous, and glucose were selected as features for training.

[0093] Tables 3 and 4 show the prediction results of this patented prediction model on the OhioT1DM dataset, using RMSE and MAE as evaluation metrics. When predicting blood glucose levels 30 minutes ahead, the model's RMSE ranged from 15.42 to 21.02, with an average of 17.31. When predicting blood glucose levels 60 minutes ahead, the RMSE ranged from 25.75 to 32.16, with an average of 27.88.

[0094] Table 3 Prediction model test results when the prediction time is 30 minutes

[0095]

[0096] Table 4 Prediction model test results when the prediction time is 60 minutes

[0097]

[0098] The selected benchmark methods are as follows:

[0099] ARIMA: Autoregressive Moving Average (ARIMA). It is a statistical method used for forecasting and analyzing time series data. It is particularly useful when the data exhibits significant trends or seasonality.

[0100] RCN-ARMA: Combines an autoregressive moving average model with a residual compensation network. The former is used to efficiently and robustly capture time-varying blood glucose dynamics, while the latter uses a neural network to estimate the error generated by the online prediction model.

[0101] Bi-LSTM: Bidirectional Long Short-Term Memory Network. This method is based on a personalized bidirectional LSTM network and is equipped with tools to make the model output interpretable, so as to preserve the physiological meaning of the input data.

[0102] CRNN: Convolutional Recurrent Neural Network, which stacks CNN and RNN to process data with sequence structure.

[0103] MTL-CRNN: Multi-task convolutional recurrent neural network. This algorithm consists of a shared hidden layer, two dense layers, and a multi-task prediction layer composed of fully connected layers. It is designed to achieve personalized blood glucose prediction for different patients.

[0104] Recurrent Self-Attention Network (RSNET) stacks multiple self-attention layers to form an encoder, using two trainable linear transformations to connect data of different spatial dimensions. The self-attention mechanism is invariant to sequence order, uses sinusoidal position encoding to help the model learn sequence patterns, and employs parameter transfer for blood glucose prediction.

[0105] Table 5 compares the performance of the model proposed in this patent with six common benchmark models:

[0106] Table 5 Performance comparison between the patent model and the benchmark model

[0107]

[0108] The comparison results clearly show that compared to the baseline model, the patented model exhibits significant advantages in predicting blood glucose levels for both 30 and 60 minutes into the future. Specifically, when predicting blood glucose levels for 30 minutes into the future, the patented model achieved a 0.8% decrease in RMSE and a 1.1% decrease in MAE compared to the best-performing baseline model, CRNN. ​​When predicting blood glucose levels for 60 minutes into the future, the patented model achieved a 2.1% decrease in RMSE and a 10.4% decrease in MAE compared to the best-performing baseline model, CRNN.

[0109] Table 6 presents the analysis results of this patented model under 30-minute and 60-minute prediction times. In the 30-minute prediction scenario, the personalized model for patient 584 had the highest proportion of clinically safe predictions, at 99.69%; the lowest was the personalized model for patient 596, with an accuracy of 98.98%, and an average prediction accuracy of 99.29%. In the 60-minute prediction scenario, the personalized model for patient 584 still had the highest proportion of clinically safe predictions, at 99.53%; the lowest was the personalized model for patient 552, with an accuracy of 92.70%, and an average prediction accuracy of 96.89%. Figure 4 and Figure 5 Clarke EGA images of the model at 30-minute and 60-minute prediction times are shown. The above results indicate that the model proposed in this patent has good clinical accuracy and can provide a reliable reference for blood sugar management for most patients.

[0110] Table 6 Clarke error network analysis results

[0111]

[0112] The above technical solutions only reflect the preferred technical solutions of the technical solutions of the present invention. Any changes that may be made to certain parts thereof by those skilled in the art all reflect the principles of the present invention and fall within the scope of protection of the present invention.

Claims

1. An Informer-based blood glucose prediction model for diabetic patients, characterized by: The following steps are involved: Step S1: The model takes the historical sequence matrix as input, which includes the multi-dimensional features of fingertip blood glucose values, continuous monitoring historical blood glucose values, eating events, and insulin; Step S2: Using a filter to eliminate abnormal values ​​of historical blood glucose values ​​to ensure the reliability of input data; Then, the input length of the embedding layer is expanded, and the eating and insulin injection features are merged into fusion features to enhance the correlation between features. Step S3: The time encoding and position encoding mechanisms assign absolute time position and relative temporal dependency information to the input sequence to capture the periodicity of blood glucose changes. A multi-scale convolution module is used to achieve hierarchical extraction of short, medium, and long time scale features of blood glucose data through a combination of convolution kernels of different sizes. Step S4: The features of the multi-scale convolution output are independently predicted through three parallel prediction modules, and the results of each module are weighted and summed to generate the final blood glucose prediction value.

2. The Informer-based blood glucose prediction model for diabetic patients according to claim 1, characterized in that: The filter in step S2 performs k-order polynomial fitting on a series of data points within a fixed-length sliding window to obtain smoothed data. Specifically, the filter uses the least squares method to accurately fit a high-order polynomial to the data points, and then calculates the smoothed value of each data point based on the fitting results. The calculation process is as follows: ; The window length is set to , the data is , The value range is , by constructing order polynomial to fit each data point , then calculate the residual sum of squares of the original data and the fitted data: ; In ensuring In the case of minimum, the obtained fitting value is the result value after smoothing. By sliding the window on the data set in sequence, the smoothing process of the entire data set can be completed.

3. The Informer-based blood glucose prediction model for diabetic patients according to claim 1, characterized in that: The blood glucose dataset includes insulin injection and dietary records, specifically recording the time points and corresponding dosages of insulin injections, as well as the time and amount of each meal. The effects of insulin injection and eating on blood glucose are not immediate, but rather delayed. During certain time periods, there may be no new insulin injections or meal records. However, blood glucose fluctuations are still potentially affected by previous insulin injections and meals, and insulin injections for diabetic patients are often associated with mealtimes. On the premise of ensuring that the length of the model input time window remains unchanged, by extending the time range of the embedding layer input data, the model can capture longer-term information. This improvement solves the problem of information loss. The model can better capture the potential impact of insulin injection and eating on blood sugar fluctuations. Then, through the multi-head attention layer and the fully connected layer, the insulin and eating features of the extended time period are learned to generate the joint features of the time period corresponding to the length of the model input time window. Finally, the joint features are merged with other features as the model input.

4. The Informer-based blood glucose prediction model for diabetic patients according to claim 1, characterized in that: Step S3: using multi-scale convolution in the encoding layer to extract features from the input data at multiple scales using multiple convolution kernels of different sizes. Large-scale convolution kernels can capture long-term dependencies of the data and learn the overall trend and periodic changes of the data. Medium-scale convolution kernels capture short-term features that are related to fluctuations in a specific time period, such as changes in blood sugar within a few hours after eating; small-scale convolution kernels focus on mining local features of the data and can capture small fluctuations in the data, such as subtle changes in blood sugar in a short period of time.

5. The Informer-based blood glucose prediction model for diabetic patients according to claim 1, characterized in that: The prediction module incorporates the concept of deep residuals, stacking three residual modules. Each residual module produces two outputs: a prediction output and a backtracking output. The prediction output serves as the prediction value of the module at this layer, while the backtracking output represents the learned input content. Each residual module subtracts the backtracking output from its own input, and the difference serves as the input of the next residual module, thereby achieving the purpose of layer-by-layer learning. Finally, the prediction values ​​of each residual module are accumulated to obtain the prediction value of the current prediction module. Each residual module is constructed by combining an encoding layer, a fully connected layer, and a linear layer. The encoding layer uses the encoding layer of the Informer model, which is responsible for feature extraction and conversion, mapping the original data to a higher-dimensional feature space to explore potential patterns in the data. The fully connected layer can capture the complex nonlinear relationships between features and learn the complex patterns hidden in the data through weighted combinations of different features. The linear layer serves as the output layer to generate the final prediction and backtracking results. The input sequence is divided into two parts, where Represents the blood glucose value in the input sequence, which is the target variable that the model focuses on; Represents other features in the input sequence besides blood glucose values, including eating habits, mealtime insulin, and other data. These features can provide rich contextual information for blood glucose prediction; When the input data enters the first residual module, the two linear layers in the module will output the predicted values ​​respectively. With backtracking value , predicted value It is the prediction result of the future blood glucose value obtained by the current residual module based on the input data through a series of operations such as encoding, feature mapping and linear transformation. Represents the learning results of the current module on the input blood glucose value, reflecting the degree to which the model captures the characteristics of blood glucose value at the current stage. Based on the idea of ​​residual learning, in order to enable the model to more carefully mine the potential information in the blood glucose value, the input blood glucose value Subtract the learned blood glucose value The difference is used as the input of the next residual module. Each residual module outputs the corresponding predicted value. Finally, the prediction results of each module are accumulated, and the sum obtained is the final predicted value of the model. This residual stacking and module-by-module learning method enables the model to iteratively approach the actual blood sugar level change pattern, effectively improving the model's ability to learn and predict dynamic changes in blood sugar levels. For other features X' in the input data, although these features can provide valuable auxiliary information for the model and help to more comprehensively understand the mechanism of changes in blood glucose levels, since the data distribution of these features is usually sparse and contains a large number of missing values ​​or irregular data points, backtracking operations on these features will introduce noise, interfere with the model's learning process, and reduce the model's prediction accuracy.

6. The Informer-based blood glucose prediction model for diabetic patients according to claim 1, characterized in that: Three auxiliary tasks are added to the model: Reconstruction loss (Lr): The model performs reverse mapping The purpose of supervision is to enhance the learning efficiency of the current layer module and optimize the input of the next layer module, complete the step-by-step prediction to improve the prediction accuracy, so it is necessary to add an MSE Loss: To encourage the network to learn gradually, the loss of each module should be proportional to its position in the network, so MSELoss needs to be multiplied by the number of module layers, and the loss Lr is the sum of the reconstruction losses of each block: ; Prediction loss (Lf): In order to encourage each module to contribute to accurate prediction, the loss of each module prediction is calculated, using a loss calculation method similar to Lr, but using a cubic value to increase the weight to emphasize the weight of the prediction part in the network. The loss Lf is the sum of the prediction losses of each block: ; Module loss (Lm): Under the supervision of reconstruction loss and prediction loss, the model prediction effect tends to be more accurate in the first layer of modules, while the role of the following two layers of modules is weakened. To avoid this situation, the inverse ratio of the reverse mapping of each layer of modules is used to penalize the block, and this penalty is extended by the inverse ratio of its position in the stack. The loss Lm is the sum of the penalties of each block: ; Ultimately, the loss of the entire model is the weighted sum of the above three losses: ; in, is a hyperparameter.