Hypoglycemia early-warning method, system and terminal, and storage medium
By constructing an LSTM-TCN model for blood glucose prediction, the problem of insufficient hypoglycemia prediction performance in existing technologies is solved. This achieves efficient hypoglycemia early warning under limited features and no external parameter input, thereby reducing the risk of hypoglycemia events.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- CHANGSHA SINOCARE
- Filing Date
- 2025-12-02
- Publication Date
- 2026-06-11
AI Technical Summary
Existing hypoglycemia prediction models have insufficient predictive performance under limited features and without external parameter input, resulting in a high risk of hypoglycemia events.
The LSTM-TCN model is used for blood glucose prediction. The LSTM-TCN model is constructed by preprocessing blood glucose time series data, training the model using the training dataset, and issuing warnings based on the predicted values.
It improved the predictive performance of the hypoglycemia prediction model, reduced the risk of hypoglycemia events, optimized the model's response time to events, and increased the duration of intervention.
Smart Images

Figure CN2025139425_11062026_PF_FP_ABST
Abstract
Description
A method, system, terminal and storage medium for early warning of hypoglycemia Technical Field
[0001] This application relates to the field of blood glucose prediction technology, and in particular to a hypoglycemia early warning method, system, terminal and storage medium. Background Technology
[0002] Diabetes mellitus is a metabolic disease caused by insufficient insulin production or impaired insulin utilization, characterized by chronic hyperglycemia. While diabetic patients often emphasize the challenge of daily blood sugar control, iatrogenic hypoglycemia, frequently caused by medication during treatment, also requires attention. Studies show that hypoglycemia caused by oral hypoglycemic agents and insulin therapy accounts for 25% of emergency room hospitalizations in the elderly, and these hypoglycemias are preventable. Acute complications of hypoglycemia can cause dizziness, tremors, and other discomforts, and in severe cases, even death. Continuous glucose monitoring (CGM) systems are particularly important for controlling the risk of hypoglycemia. Their hypoglycemic event warning system allows patients to take intervention measures before hypoglycemia occurs, such as supplementing with fast-acting carbohydrates or stopping insulin injections, thus avoiding the risk.
[0003] In recent years, with the advancement of continuous glucose monitoring (CGM) technology, researchers have developed a variety of hypoglycemia prediction models based on CGM data. These models can use machine learning and deep learning methods to predict future blood glucose data over a certain period of time. Existing hypoglycemia prediction models generally adopt a single-model structure and rely on a large number of features and external parameters such as age, weight, carbohydrate intake, and insulin injection volume at the model input end. Their application level and prediction performance for hypoglycemia events still need to be improved.
[0004] Therefore, how to improve the predictive performance of hypoglycemia prediction models and reduce the risk of hypoglycemia events under the condition of limited features and no external parameter input is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a hypoglycemia early warning method that can improve the predictive performance of a hypoglycemia prediction model and reduce the risk of hypoglycemia events, even with limited features and no external parameter input. This application also provides a hypoglycemia early warning system, terminal, and storage medium, which have the same technical effects.
[0006] The first objective of this application is to provide a method for early warning of hypoglycemia.
[0007] The aforementioned objective of this application is achieved through the following technical solution:
[0008] A hypoglycemia early warning method includes:
[0009] Obtain blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data;
[0010] Construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence.
[0011] Based on the preprocessed data, a training dataset is constructed, and the LSTM-TCN model is trained using the training dataset to obtain a trained hypoglycemia prediction model.
[0012] Obtain blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict blood glucose values with a preset prediction step size based on the blood glucose time series monitoring data, thereby obtaining the blood glucose prediction value with the preset prediction step size.
[0013] Based on the blood glucose prediction value of the preset prediction step size and the preset early warning mechanism, a low blood glucose warning is issued.
[0014] Preferably, in the hypoglycemia early warning method, the preprocessing of the blood glucose time series sample data to obtain preprocessed data includes:
[0015] The blood glucose time series sample data is processed by outlier removal or interpolation using confidence intervals or n-sigma intervals to obtain the first processed data;
[0016] The first processed data is denoised using an adaptive Kalman filter algorithm to obtain the second processed data.
[0017] The second processed data is standardized using the z-score standardization method to obtain the third processed data;
[0018] The third processing data is processed using the sliding window method to obtain preprocessed data.
[0019] Preferably, in the hypoglycemia early warning method, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein:
[0020] The first LSTM layer is used to output a first temporary variable based on the preprocessed data;
[0021] The second LSTM layer is used to output the LSTM activation value based on the first temporary variable;
[0022] The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.
[0023] Preferably, in the hypoglycemia early warning method, the TCN unit is specifically used for:
[0024] The LSTM activation value is used as the input to the first TCN layer;
[0025] Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the pre-set dilation factor, convolution kernel, sliding stride and padding stride to obtain the output of the one-dimensional convolutional layer;
[0026] Based on the pre-set hyperparameters, the output of the one-dimensional convolutional layer is subjected to feature filtering and cropping to obtain a second temporary variable;
[0027] The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer;
[0028] Repeat the above steps, increasing the expansion factor and the fill step size exponentially each time, until the receptive field length of a one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step size. Then, use the current output of the TCN layer as the blood glucose prediction value of the preset prediction step size.
[0029] Preferably, in the hypoglycemia early warning method, the maximum number of TCN layers in the TCN unit is L = min(L max ,[log(T) / log(α)]), where L max α represents the preset maximum number of TCN layers, α represents the expansion factor increment, and T represents the preset input step size.
[0030] Preferably, in the hypoglycemia early warning method, the step of constructing a training dataset based on the preprocessed data and training the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model includes:
[0031] The preprocessed data is divided into a training set, a validation set, and a test set;
[0032] The LSTM-TCN model is trained using the Adam optimizer and a learning rate is set, with an early stopping mechanism employed. The parameters are then fine-tuned using the validation set to obtain a trained intermediate model.
[0033] The intermediate model is evaluated using the test set to obtain evaluation metrics.
[0034] Determine whether the evaluation index meets the preset requirements; if so, use the intermediate model as the trained hypoglycemia prediction model.
[0035] Preferably, in the hypoglycemia early warning method, the preset early warning mechanism includes one or more of the following early warning mechanisms:
[0036] When a single point in the blood glucose prediction value within the preset prediction step size is less than the predetermined low blood glucose threshold, a low blood glucose warning is triggered.
[0037] When the predicted blood glucose value is less than the predetermined hypoglycemia threshold for k consecutive time periods within the preset prediction step size, a hypoglycemia warning is triggered.
[0038] When the cumulative decrease in blood glucose over a continuous period of k time exceeds a predetermined threshold, a hypoglycemia warning is triggered.
[0039] The second objective of this application is to provide a hypoglycemia early warning system.
[0040] The second objective of this application is achieved through the following technical solution:
[0041] A hypoglycemia early warning system includes:
[0042] The processing unit is used to acquire blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data.
[0043] A construction unit is used to construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence.
[0044] The training unit is used to construct a training dataset based on the preprocessed data, and to train the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model.
[0045] The prediction unit is used to acquire blood glucose time series monitoring data and, using the hypoglycemia prediction model, predict blood glucose values with a preset prediction step size based on the blood glucose time series monitoring data, thereby obtaining the blood glucose prediction value with the preset prediction step size.
[0046] The early warning unit is used to issue a low blood sugar warning based on the blood sugar prediction value of the preset prediction step size and the preset early warning mechanism.
[0047] The third objective of this application is to provide a hypoglycemia early warning terminal.
[0048] The aforementioned objective three of this application is achieved through the following technical solution:
[0049] A hypoglycemia early warning terminal includes: a storage medium and a processor;
[0050] The storage medium stores computer-executed instructions.
[0051] The processor executes computer execution instructions stored in the storage medium to implement the hypoglycemia early warning method as described above.
[0052] The fourth objective of this application is to provide a computer-readable storage medium.
[0053] The fourth objective of this application is achieved through the following technical solution:
[0054] A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the hypoglycemia early warning method described above.
[0055] The above technical solution involves: acquiring blood glucose time series sample data and preprocessing the data to obtain preprocessed data; constructing an LSTM-TCN model that takes blood glucose time series data as input and outputs a blood glucose prediction value with a preset prediction step size; constructing a training dataset based on the preprocessed data and training the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model; acquiring blood glucose time series monitoring data and using the hypoglycemia prediction model to predict blood glucose values with a preset prediction step size based on the blood glucose time series monitoring data to obtain a blood glucose prediction value with a preset prediction step size; and issuing a hypoglycemia warning based on the blood glucose prediction value with the preset prediction step size and a preset warning mechanism. Among them, the hypoglycemia prediction model trained based on the LSTM-TCN model can predict blood glucose values for a preset step size using only blood glucose time series data, without the need for input of other user features and external parameters, and has a more ideal guiding ability in practical applications. The LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence, which integrates the long-term memory and short-term processing capabilities of LSTM and the efficient temporal feature extraction capabilities of TCN. The LSTM-TCN model combines the advantages of both, which not only improves the prediction performance of hypoglycemia events, but also optimizes the model's response time to events and increases the intervention duration.
[0056] In summary, the above technical solutions can improve the predictive performance of hypoglycemia prediction models and reduce the risk of hypoglycemia events under the condition of limited features and no external parameter input.
[0057] Furthermore, the aforementioned LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected sequentially. The TCN unit can adaptively adjust the number of layers based on data features and input dimensions. When constructing the TCN unit, the expansion factor is increased exponentially to ensure that the receptive field length of the one-dimensional convolutional layer is consistent with the preset input stride. For different preset input strides, the number of TCN unit layers can be dynamically adjusted. This construction method can gradually expand the receptive field while ensuring computational efficiency, thereby enhancing the network's ability to capture global information. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 is a flowchart illustrating a hypoglycemia early warning method provided in an embodiment of this application;
[0060] Figure 2 is a schematic diagram of the structure of the LSTM model provided in the embodiment of this application;
[0061] Figure 3 is a schematic diagram of the TCN model provided in the embodiment of this application;
[0062] Figure 4 is a schematic diagram of the structure of the LSTM-TCN model provided in the embodiment of this application;
[0063] Figure 5 shows the Clarke error raster diagrams of each model provided in the embodiments of this application, wherein Figure (a) is the Clarke error raster diagram of the LSTM-TCN model, Figure (b) is the Clarke error raster diagram of the LSTM model, Figure (c) is the Clarke error raster diagram of the RNN model, and Figure (d) is the Clarke error raster diagram of the TCN model.
[0064] Figure 6 is a schematic diagram of a hypoglycemia early warning system provided in an embodiment of this application;
[0065] Figure 7 is a schematic diagram of the structure of a hypoglycemia early warning terminal provided in an embodiment of this application. Detailed Implementation
[0066] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0067] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0068] It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0069] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" or "several" means two or more, unless otherwise explicitly specified.
[0070] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0071] It should also be noted that, in this document, terms such as “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or device that includes the aforementioned element.
[0072] The embodiments in this application are written in a progressive manner.
[0073] As shown in Figure 1, this application embodiment provides a hypoglycemia early warning method, including:
[0074] S101. Obtain blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data;
[0075] In S101, specifically, the blood glucose time series sample data can be blood glucose time series sample data D = (t) composed of blood glucose monitoring data with timestamps output at predetermined time intervals by existing invasive, non-invasive, electrochemical-based, or optical-based blood glucose monitoring devices. N ,X N ) N×2 , where t N Represents a timestamp, X N This represents continuous blood glucose monitoring values. For example, 120 diagnosed diabetic patients were selected as research subjects, including 22 patients with type 1 diabetes, 97 patients with type 2 diabetes, and 1 patient with other specific types of diabetes. Blood glucose data were continuously collected for 15 days using a CGM device. The CGM sampling frequency was 3 minutes, resulting in 7200 blood glucose values per person, totaling 864,000 blood glucose values, which served as the blood glucose time series sample data required for model training.
[0076] Furthermore, in order to improve the quality of the data, the blood glucose time series sample data also need to be preprocessed to obtain preprocessed data. The preprocessing process may include outlier handling, noise reduction, standardization, sliding window processing, etc., and this application is not limited to these.
[0077] In some embodiments, one implementation of the step of preprocessing blood glucose time series sample data to obtain preprocessed data specifically includes:
[0078] S1011. Using confidence intervals or n-sigma intervals, outlier removal or interpolation is performed on the blood glucose time series sample data to obtain the first processed data;
[0079] In S1011, specifically, a probability distribution of blood glucose time series data is constructed, and confidence intervals (e.g., 80%, 85%, 90%, 95%) or n-sigma intervals (e.g., 2-sigma, 4-sigma, 6-sigma intervals) are constructed through the probability distribution. Data that do not fall into the confidence interval or n-sigma interval are regarded as outliers. After removing or interpolating outliers, the first processed data is obtained.
[0080] S1012. An adaptive Kalman filter algorithm is used to reduce noise in the first processed data to obtain the second processed data;
[0081] In S1012, specifically considering that CGM devices are easily affected by interference when detecting blood glucose, and that the collected blood glucose data contains a lot of noise, an Adaptive Extended Kalman Filter (AEKF) algorithm is used to denoise the blood glucose time series sample data collected by the CGM device. The Adaptive Extended Kalman Filter algorithm can effectively remove high-frequency noise in the blood glucose time series sample data, and adaptively adjusts the Kalman Filter algorithm parameters according to the noise level, outlier distribution and other data characteristics of the first processed data, thereby obtaining the second processed data with more reasonable values.
[0082] S1013. The z-score standardization method is used to standardize the second-processed data to obtain the third-processed data;
[0083] In S1013, specifically, in order to reduce the impact of different CGM numerical ranges on model training, the z-score normalization method is used to normalize the second-processed data to scale the data to the range of [-1,1] to obtain the third-processed data.
[0084] S1014. The sliding window method is used to process the third processing data to obtain preprocessed data.
[0085] Specifically, in S1014, the sliding window method allows for the analysis of local regions of time series data, helping to capture short-term patterns and trends in the data. By processing the third-processed data using the sliding window method, short-term fluctuations and long-term information of the third-processed data can be captured, resulting in preprocessed data that helps the model better understand the changes in the time series.
[0086] In the above embodiments, by employing outlier handling, adaptive Kalman filtering algorithm, z-score normalization method and sliding window method to preprocess blood glucose time series sample data, the preprocessed data can be obtained, which can effectively improve data quality and is conducive to improving the effect of subsequent model training.
[0087] S102. Construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size;
[0088] In S102, specifically, LSTM (Long Short Term Memory) represents a long short-term memory network, proposed by Hochreiter and Schmidhuber in 1997, and is a variant of recurrent neural networks. By introducing memory units C and a gating mechanism, LSTM solves the problem of long-term memory dependency and the gradient vanishing or exploding problems that may occur during computation in recurrent neural networks. Its structure is shown in Figure 2. The memory units C handle long-term memory, and the hidden state h handles current and short-term information. These two variables propagate and evolve through the gating mechanism. The forget gate is based on the short-term information h from the previous time step t-1. t-1 New information x at the current time step t Filter C t-1 The old information in the middle is calculated using the following formula: f t =sig(W f ·[h t-1 ,x t ]+b f (1);
[0089] The input gate is responsible for calculating the new information absorbed and determining the new information x at the current time step. t How many need to be transferred to long-term memory unit C? t Its calculation formula is: i t =sig(W i ·[h t-1 ,x t ]+b i (2);
[0090] Subsequently, based on the outputs of the forget gate and the input gate, the network determines the current cell state C. t The update is performed using the following formula:
[0091] The output gate filters the most relevant information h for the current time step t from the updated long-term memory t. t For output, its calculation formula is: o t =sig(W o ·[h t-1 ,x t ]+b o (5); h t =o t *tanh(C t(6);
[0092] In formulas (1) to (6), sig represents the activation function Sigmoid, tanh represents the activation function tanh, and W f W i W c W o Let b represent the corresponding weight matrix. f b i b c b o This indicates the corresponding bias.
[0093] Specifically, TCN (Temporal Convolutional Networks) refers to temporal convolutional networks, introduced by Bai et al. in 2018 for processing sequences. It is a variant of one-dimensional convolutional neural networks (CNNs) specifically designed for time series prediction. The core of temporal convolutional networks is capturing the temporal dependencies in sequences through a specialized architecture. As shown in Figure 3, this architecture includes causal convolutions, dilated convolutions, and residual connections.
[0094] Causal convolution and dilated convolution are used to extract temporal features, while residual connections are used to reduce the risk of gradient vanishing during model training. Causal convolution pads the beginning of the input sequence with zeros, depending on the kernel size, to ensure that the model's output at time point t depends only on past and present inputs, not future information, thus ensuring the temporal integrity required for time series prediction. The receptive field is defined as the time step span of the input sequence that the output unit can perceive. Unlike CNNs that expand the receptive field by using larger kernels or increasing the number of model layers, dilated convolution increases the number of time steps it covers by introducing holes in the kernel. The size of the holes depends on the dilation rate; an increased dilation rate increases the receptive field. Dilated convolution allows the model to acquire broader historical information and learn long-term dependencies without increasing model computational parameters and costs. Residual connections add the input of one layer to the output of another, mitigating the gradient vanishing problem and enhancing the model's learning ability. This design not only improves the training efficiency of deep networks but also ensures the model's stability when processing long sequences.
[0095] In this step, to combine the advantages of LSTM in capturing long-term dependencies and TCN in rapidly extracting local features, the LSTM and TCN networks are pre-combined to construct an LSTM-TCN model that takes blood glucose time-series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN model consists of at least two sequentially connected LSTM layers and one TCN layer. The preset prediction step size refers to the predicted blood glucose sequence over a future period, and the preset prediction step size can be 15 minutes, 30 minutes, 60 minutes, or other preset step sizes. Based on this model structure design, the LSTM-TCN model integrates the long-term memory capability of LSTM and the efficient temporal feature extraction capability of TCN. The LSTM-TCN model combines the advantages of both, and the hypoglycemia prediction model trained on the LSTM-TCN model not only improves the prediction performance for hypoglycemia events but also optimizes the model's response time to events, increasing the intervention duration and making it more ideal for practical applications. Furthermore, the LSTM-TCN model only requires blood glucose data with timestamps as input, without the need for other features and external parameters, making it more ideal for practical applications.
[0096] In some embodiments, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein:
[0097] The first LSTM layer is used to output the first temporary variable based on the preprocessed data;
[0098] The second LSTM layer is used to output the LSTM activation value based on the first temporary variable;
[0099] The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.
[0100] Specifically, the first LSTM layer, using preprocessed data as input, performs calculations according to the calculation process in step S102 to obtain the most effective information h at the current time step t. t The first temporary variable is used as the output; the second LSTM layer takes the first temporary variable as input and performs calculations according to the calculation process in step S102 to obtain the most effective information h at the current time step t. t , which serves as the output LSTM activation value.
[0101] The TCN unit comprises at least one TCN layer connected in sequence. Each TCN layer extracts time series features through multiple convolutional kernels and pooling operations. It mainly consists of dilated causal convolutional layers, residual modules, pooling layers, and fully connected layers. The TCN unit is used to extract features from the LSTM activation values of the data sequence, and then the blood glucose prediction value with a preset prediction step size is obtained by passing the Sigmoid activation function.
[0102] Specifically, the TCN unit is used for:
[0103] Use the LSTM activation values as input to the first TCN layer;
[0104] Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the pre-set dilation factor, convolution kernel, sliding stride and padding stride to obtain the output of the one-dimensional convolutional layer;
[0105] Based on pre-defined hyperparameters, feature filtering and cropping are performed on the output of the one-dimensional convolutional layer to obtain a second temporary variable;
[0106] The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer;
[0107] Repeat the above steps, increasing the inflation factor and padding step size exponentially each time, until the receptive field length of a one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step size. Then, use the current output of the TCN layer as the blood glucose prediction value of the preset prediction step size.
[0108] It should be noted that when the TCN unit consists of only one TCN layer, the above process can be re-executed using that TCN layer. This involves repeatedly processing the data using at least one TCN layer, based on the TCN layer's input and pre-defined dilation factor, convolution kernel, sliding stride, and padding stride, to obtain the output of that TCN layer. The output of the TCN layer in the previous round of calculation is used as the input for the TCN layer in the next round of calculation, until the receptive field length of the one-dimensional convolutional layer of that TCN layer matches the preset input stride. At this point, the current output of the TCN layer is used as the blood glucose level for the preset prediction stride. Predicted value; When the TCN unit includes multiple TCN layers, the output of the previous TCN layer is used as the input of the next TCN layer. The multiple TCN layers execute the above process sequentially and cyclically, that is, repeatedly execute the process of using at least one TCN layer, based on the input of the TCN layer and the preset dilation factor, convolution kernel, sliding stride and padding stride, to finally obtain the output of the TCN layer, until the receptive field length of the one-dimensional convolutional layer of a certain TCN layer in the multiple TCN layers is consistent with the preset input stride, and then the current output of the TCN layer is used as the blood glucose prediction value of the preset prediction stride.
[0109] In this embodiment, the number of layers can be adaptively adjusted based on data features and input dimensions through TCN units. When constructing TCN units, the expansion factor is increased exponentially to ensure that the receptive field length of the one-dimensional convolutional layer matches the preset input stride. For different preset input strides, the number of TCN unit layers can be dynamically adjusted. This construction method can gradually expand the receptive field while maintaining computational efficiency, enhancing the network's ability to capture global information. Specifically, the adaptive adjustment of the number of TCN layers is performed as follows:
[0110] For the l-th TCN layer, its receptive field length R l =R l-1 +(k l -1)·d l-1 , where R l R is the receptive field length of the l-th TCN layer. l-1 It is the receptive field length of the (l-1)th TCN layer, k l d is the kernel size of the l-th TCN layer. l-1 It is the expansion factor of the (l-1)th TCN layer; based on the above formula for calculating the receptive field length and the preset input step size T, the maximum value of dynamically adjusting the number of TCN layers in the TCN unit can be L = min(L max ,[log(T) / log(α)]), where L max This indicates the preset maximum number of TCN layers, and α represents the expansion factor increment. In some embodiments, the expansion factor increases exponentially, and generally the expansion factor increment α is selected as 2.
[0111] In other embodiments, the LSTM-TCN model includes an input layer, a first LSTM layer, a second LSTM layer, a first TCN layer, a second TCN layer, a third TCN layer, a Dropout layer, an MLP layer, and an output layer connected in sequence.
[0112] Specifically, as shown in Figure 4, the input layer receives blood glucose time series data as model input. The model input is an N×KT dimensional matrix, where N is the sample size, K is the number of features, and T is the input step size. The input step size can be the length of a sliding window, i.e., using continuous blood glucose data of length T to perform blood glucose prediction with a preset prediction step size. The first LSTM layer and the second LSTM layer are used to process the sequence data and extract key long-term information. Preferably, both the first LSTM layer and the second LSTM layer use LSTM layers with 64 neurons. Subsequently, this information is passed to three TCN layers, namely the first TCN layer, the second TCN layer, and the third TCN layer, to further extract the time features most important for short-term correlation. Preferably, the kernel size of the first TCN layer, the second TCN layer, and the third TCN layer are all 3, the number of filters used are 10, 32, and 64 respectively, and the dilation rates are 1, 2, and 4 respectively. Causal convolution is used to ensure that the output depends only on the current and past inputs. The Dropout layer is a structure that applies the dropout technique to the neural network. By randomly dropping a portion of neurons during training, it achieves the purpose of regularization. In addition, the Dropout layer has the advantage of reducing model complexity and helps to accelerate the model training process. Preferably, to avoid overfitting during model training, the dropout layer is set to a dropout rate of 10%. The MLP (Multi-Layer Perceptron) layer is a specific type of artificial neural network. It consists of multiple neurons and is used to connect the convolutional layer and the output layer. The output layer uses the sigmoid activation function to output the blood glucose prediction value with a preset prediction step size.
[0113] S103. Based on the preprocessed data, construct a training dataset, and use the training dataset to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model.
[0114] In S103, specifically, the preprocessed data is randomly sorted as a whole and a training dataset containing a training set, a validation set, and a test set is constructed according to a set ratio for model training. For example, the first 80% is allocated as the training set, the middle 10% as the validation set, and the last 10% as the test set, which are used for subsequent model training, debugging, and evaluation, respectively. During the LSTM-TCN model training process, the Mean Absolute Error (MAE) can be used as the loss function, Adam as the optimizer, and the training adopts a mini-batch method with a batch size of 64 and 100 training iterations. To prevent overfitting, an early stopping mechanism is used to obtain a well-trained hypoglycemia prediction model. This application is not limited to this.
[0115] S104. Obtain blood glucose time series monitoring data, and use a hypoglycemia prediction model to predict blood glucose values at a preset prediction step size based on the blood glucose time series monitoring data, thereby obtaining the predicted blood glucose value at the preset prediction step size.
[0116] In S104, specifically, blood glucose time-series monitoring data of a pre-set step size can be acquired using a CGM device, and this data is input into a hypoglycemia prediction model to obtain a blood glucose prediction value at the pre-set prediction step size. Taking intervention measures 20-30 minutes before a hypoglycemic event can effectively avoid the risk of complications. Furthermore, 30 minutes represents the optimal balance between prediction error and prediction effectiveness; therefore, the prediction step size (Prediction Horizon, PH) of the hypoglycemia prediction model can preferably be set to 30 minutes. In other embodiments, the blood glucose time-series monitoring data can be preprocessed before being input into the hypoglycemia prediction model for prediction. The preprocessing process can refer to S101 above, and this application does not impose specific limitations on it.
[0117] S105. Provide a hypoglycemic warning based on the blood glucose prediction value of the preset prediction step size and the preset warning mechanism.
[0118] In S105, specifically, the preset warning mechanism may include one or more of the following warning mechanisms: (1) triggering a hypoglycemia warning when a single point within the preset prediction step length of the predicted blood glucose value is less than a predetermined hypoglycemia threshold; (2) triggering a hypoglycemia warning when the predicted blood glucose value within the preset prediction step length for k consecutive time periods is less than the predetermined hypoglycemia threshold; (3) triggering a hypoglycemia warning when the cumulative decrease in blood glucose within the preset prediction step length for k consecutive time periods exceeds a predetermined decrease threshold. The predetermined hypoglycemia threshold, k time periods, and predetermined decrease threshold can be set based on actual application needs. For example, triggering a hypoglycemia warning when the predicted blood glucose value is below 70 mg / dL for 15 consecutive minutes allows for intervention measures to be taken to effectively avoid the risk of complications.
[0119] In recent years, with the advancement of continuous glucose monitoring (CGM) technology, researchers have developed a variety of hypoglycemia prediction models based on CGM data. These models can use machine learning and deep learning methods to predict future blood glucose data over a certain period of time. Existing hypoglycemia prediction models generally adopt a single-model structure and rely on a large number of features and external parameters such as age, weight, carbohydrate intake, and insulin injection volume at the model input end. Their application level and prediction performance for hypoglycemia events still need to be improved.
[0120] The above embodiments involve: acquiring blood glucose time-series sample data and preprocessing the data to obtain preprocessed data; constructing an LSTM-TCN model that takes blood glucose time-series data as input and outputs a blood glucose prediction value with a preset prediction step size; constructing a training dataset based on the preprocessed data and training the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model; acquiring blood glucose time-series monitoring data and using the hypoglycemia prediction model to predict blood glucose values with a preset prediction step size based on the blood glucose time-series monitoring data to obtain a blood glucose prediction value with a preset prediction step size; and performing hypoglycemia prediction based on the blood glucose prediction value with the preset prediction step size and a preset early warning mechanism. The LSTM-TCN model, comprising at least two sequentially connected LSTM layers and one TCN layer, combines the long-term memory and short-term processing capabilities of LSTM with the efficient temporal feature extraction capabilities of TCN. This LSTM-TCN model integrates the advantages of both, resulting in a hypoglycemia prediction model that not only improves predictive performance for hypoglycemia events but also optimizes the model's response time, extending the intervention duration. Furthermore, this embodiment only requires timestamped blood glucose data as input, without the need for other features or external parameters, making it more suitable for practical applications. In summary, this embodiment can improve the predictive performance of the hypoglycemia prediction model and reduce the risk of hypoglycemia events even with limited features and no external parameter input.
[0121] In other embodiments of this application, one implementation of the step of constructing a training dataset based on preprocessed data, and using the training dataset to train the LSTM-TCN model to obtain a trained hypoglycemia prediction model specifically includes:
[0122] S201. Divide the preprocessed data to obtain the training set, validation set, and test set;
[0123] In S201, specifically, the preprocessed data is randomly sorted as a whole and constructed into a training dataset containing a training set, a validation set, and a test set according to a set ratio for model training. For example, the first 80% is allocated as the training set, the middle 10% as the validation set, and the last 10% as the test set, which are used for subsequent model training, debugging, and evaluation, respectively.
[0124] S202. Using the Adam optimizer, setting the learning rate, training the LSTM-TCN model with the training set, employing an early stopping mechanism, and fine-tuning the parameters with the validation set to obtain a trained intermediate model;
[0125] In S202, specifically, the mean absolute error (MAE) is selected as the loss function, the Adam optimizer is used, the learning rate is set and dynamically adjusted, training adopts a mini-batch method, the batch size is set to 64, the number of training iterations is 100, an early stopping mechanism is adopted, the LSTM-TCN model is trained using the training set based on the above mechanism, and the performance of the trained LSTM-TCN model is verified through the validation set. The hyperparameters of the model, such as learning efficiency and batch size, are adjusted. If the total validation loss value does not change or increases for several consecutive rounds, training is stopped, thus obtaining a trained intermediate model.
[0126] The early stopping mechanism stops training after 15 epochs if the loss function shows no substantial decrease, thus accelerating training while preserving the optimal weights. The Adam optimizer's update rule is as follows:
[0127] Calculate the gradient g of the loss function L(θ) with respect to the model parameters θ. t g t =L(θ) / θ (7);
[0128] Where t represents the current time step;
[0129] The gradient g based on the current model parameters θ t Calculate the gradient g respectively t First moment estimate m t and second-order moment estimate v t The calculation formula is: m t =β1m t-1 +(1-β1)g t (8);
[0130] Where β1 represents the first momentum decay rate, β2 represents the second momentum decay rate, and t-1 represents the time step before the current time step t.
[0131] For the first moment estimate m t and second-order moment estimate v t After bias correction, the corrected first-order moment estimate is obtained. and the corrected second-order moment estimate The calculation formula is:
[0132] Based on the corrected first moment estimate and the corrected second-order moment estimate Update the model parameters θ as follows:
[0133] Where, θt+1 and θ t Let represent the model parameters for the next time step and the current time step t, respectively. Let α represent the learning rate and ε represent the parameters to prevent division by zero.
[0134] By correcting for biases, the Adam optimizer can adjust the size of its parameter updates more quickly, accelerating the initial learning process and improving overall optimization efficiency.
[0135] S203. Using the test set, evaluate the performance of the intermediate model and obtain the evaluation metrics;
[0136] In S203, specifically, the test set is used to test the performance of the final model. Based on the model prediction results of the test set, evaluation metrics for the intermediate model can be calculated. These evaluation metrics include one or more of the following: recall, precision, F1 score, time gain (TG), daily false alarm rate, and Clarke Error Grid Analysis (CEG).
[0137] In a specific embodiment, a hypoglycemic event is defined as a CGM reading below 70 mg / dL for 15 consecutive minutes, and the end of a hypoglycemic event is defined as a CGM reading above 70 mg / dL for 15 consecutive minutes. Therefore, the 15th minute after the occurrence of a hypoglycemic event is designated as the identification point (h). Each time the model predicts a hypoglycemic event (p), an alert is triggered only once. To effectively evaluate the alert algorithm, all alert points are taken as (p), and their corresponding alert classification methods are as follows:
[0138] True Positive (TP): If the warning point p is triggered between half an hour and three minutes before the identification point h, it is considered a successful early warning.
[0139] Late Alarm (LA): If the warning point p coincides with the time of a hypoglycemic event, it is considered a late alarm.
[0140] False Positive (FP): If no hypoglycemic event occurs within half an hour after the warning point p is triggered, it is considered a false positive and an incorrect warning is issued.
[0141] False Negative (FN): If a hypoglycemic event is not classified as a true positive (TP) or a late alarm (LA) event, it is considered a false negative and the warning is missed.
[0142] To avoid duplicate classification, each warning point is classified only once, and in the classification order described above. According to the warning mechanism, if the CGM reading is already below the threshold, no warning is triggered. Therefore, in practical applications, alarms judged as late warnings (LA) will not be issued and should not be considered false positives (FP), but rather false negatives (FN). Since hypoglycemia events are low-probability events and involve imbalanced data, recall, precision, and F1 score are preferably selected as evaluation metrics for the hypoglycemia prediction model.
[0143] Based on the model prediction results on the test set, the recall, precision, and F1 score can be calculated according to formulas (13) to (15), specifically:
[0144] Recall measures the probability of a successful alert among all hypoglycemic events. Precision measures the probability of a correct alert among all alerts issued. The F1 score, the harmonic mean of the first two metrics, provides a more comprehensive perspective when both recall and precision are important.
[0145] In some embodiments, time gain and daily false alarm rate may be introduced as evaluation metrics to assess the practicality of the alert. Time gain measures the time interval between the alert and the hypoglycemic event, reflecting the response time provided to the patient. To assess the reliability of the alert and the patient's experience, the daily false alarm rate is introduced, measuring the average probability that a patient receives a false alarm each day during CGM use.
[0146] In other embodiments, the Clarke error grid can also be used to evaluate the model's blood glucose prediction effectiveness. Specifically, predicted blood glucose values are paired with actual blood glucose values and divided into five zones, labeled A through E, based on error, with increasing hazard. Zone A represents a clinically accurate estimate that correctly guides clinical treatment; Zone B represents a clinically acceptable estimate with a deviation exceeding 20%; Zone C represents an outcome that could lead to potentially dangerous overtreatment, such as excessive insulin injection; Zone D represents a severe hypoglycemic or hyperglycemic episode that is not identified; and Zone E represents a completely erroneous and opposite judgment, such as misdiagnosing hypoglycemia as hyperglycemia. The more values appearing in Zones A and B, and the higher the proportion, the greater the clinical applicability of the prediction.
[0147] S204. Determine whether the evaluation indicators meet the preset requirements. If so, use the intermediate model as the trained hypoglycemia prediction model.
[0148] In S204, specifically, the values of each evaluation indicator can be compared with a pre-set threshold range. If the values of each evaluation indicator are all within the pre-set threshold range, the evaluation indicator can be considered to meet the preset requirements, and then the intermediate model can be used as the trained hypoglycemia prediction model.
[0149] In this embodiment, the LSTM-TCN model is trained, validated, and tested using training, validation, and test sets, which effectively ensures the training effect of the hypoglycemia prediction model and improves its prediction performance.
[0150] In practical applications, to compare the predictive performance of the LSTM-TCN model with that of individual models, LSTM, TCN, RNN (Recurrent Neural Network) models, and LSTM-TCN models were used retrospectively to predict hypoglycemic events in 12 diabetic patients. Preferably, the LSTM-TCN model consisted of a sequentially connected input layer, two LSTM layers, three TCN layers, a Dropout layer, an MLP layer, and an output layer. According to the results in Table 1, the LSTM-TCN model outperformed the individual LSTM or TCN models in terms of evaluation metrics. The LSTM-TCN model achieved a recall of 76.20%, superior to the 74.00% of the LSTM model and the 72.04% of the TCN model, and its precision of 78.43% was also superior to other models. This indicates that compared to other individual models, the LSTM-TCN model is more accurate in predicting hypoglycemic events, reducing false negatives and the risk of unknown hypoglycemia. Meanwhile, the LSTM-TCN model achieved an F1 score of 74.64%, which is higher than that of the LSTM and TCN models, demonstrating the balance in performance between the models.
[0151] Table 1. Statistical Table of Hypoglycemia Event Prediction Performance
[0152] In terms of time gain, the LSTM-TCN model leads with an average result of 11.56 minutes, the highest among all models, providing patients with a longer intervention period. At the same time, the LSTM-TCN model retains the advantage of the TCN model's low daily false alarm rate, meaning patients may receive only two unnecessary warnings within 15 days.
[0153] Table 2 shows the proportion of CEG regions for each model with a 30-minute prediction duration.
[0154] Figure 5 and Table 2 show the CEG results of 14 patients predicted for the next 30 minutes using the above method. The A region of the LSTM-TCN model accounted for 92.12%, higher than the LSTM model (91.2%), the TCN model (91.33%), and the RNN model (91.14%). The A+B region also accounted for the highest percentage among all models, reaching 99.56%. This indicates that the LSTM-TCN model is superior to other models in clinical accuracy.
[0155] As shown in Figure 6, in another embodiment of this application, a hypoglycemia early warning system is also provided, comprising:
[0156] The processing unit 10 is used to acquire blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data.
[0157] The construction unit 11 is used to construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence.
[0158] Training unit 12 is used to construct a training dataset based on preprocessed data, and to train the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model.
[0159] Prediction unit 13 is used to acquire blood glucose time series monitoring data and use a hypoglycemia prediction model to predict blood glucose values at a preset prediction step size based on the blood glucose time series monitoring data, thereby obtaining the blood glucose prediction value at the preset prediction step size.
[0160] The early warning unit 14 is used to issue a low blood sugar warning based on the blood sugar prediction value of the preset prediction step and the preset early warning mechanism.
[0161] In other embodiments of this application, when processing unit 10 performs preprocessing on blood glucose time series sample data to obtain preprocessed data, it is specifically used for:
[0162] The blood glucose time series sample data is processed by outlier removal or interpolation using confidence intervals or n-sigma intervals to obtain the first processed data;
[0163] The first processed data is denoised using an adaptive Kalman filter algorithm to obtain the second processed data.
[0164] The z-score standardization method is used to standardize the second-processed data to obtain the third-processed data;
[0165] The sliding window method is used to process the third-stage data to obtain preprocessed data.
[0166] In other embodiments of this application, the LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein:
[0167] The first LSTM layer is used to output the first temporary variable based on the preprocessed data;
[0168] The second LSTM layer is used to output the LSTM activation value based on the first temporary variable;
[0169] The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.
[0170] In other embodiments of this application, the TCN unit is specifically used for:
[0171] Use the LSTM activation values as input to the first TCN layer;
[0172] Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the pre-set dilation factor, convolution kernel, sliding stride and padding stride to obtain the output of the one-dimensional convolutional layer;
[0173] Based on pre-defined hyperparameters, feature filtering and cropping are performed on the output of the one-dimensional convolutional layer to obtain a second temporary variable;
[0174] The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer;
[0175] Repeat the above steps, increasing the inflation factor and padding step size exponentially each time, until the receptive field length of a one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step size. Then, use the current output of the TCN layer as the blood glucose prediction value of the preset prediction step size.
[0176] In other embodiments of this application, the maximum number of TCN layers in a TCN unit is L = min(L max ,[log(T) / log(α)]), where L max This represents the preset maximum number of TCN layers, α represents the expansion factor increment, and T represents the preset input step size.
[0177] In other embodiments of this application, the training unit 12, when performing the tasks of constructing a training dataset based on preprocessed data and training the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model, is specifically used for:
[0178] The preprocessed data is divided into training set, validation set and test set;
[0179] Using the Adam optimizer, setting the learning rate, training the LSTM-TCN model with the training set, employing an early stopping mechanism, and fine-tuning the parameters with the validation set to obtain a well-trained intermediate model;
[0180] The intermediate model is evaluated using the test set to obtain evaluation metrics.
[0181] Determine whether the evaluation indicators meet the preset requirements. If so, use the intermediate model as the trained hypoglycemia prediction model.
[0182] In other embodiments of this application, the preset early warning mechanism includes one or more of the following early warning mechanisms:
[0183] When a single point within the preset prediction step size of blood glucose prediction is less than the predetermined low blood glucose threshold, a low blood glucose warning is triggered.
[0184] When the predicted blood glucose value is less than the predetermined hypoglycemia threshold for k consecutive time periods within the preset prediction step size, a hypoglycemia warning is triggered.
[0185] When the cumulative decrease in blood glucose over a continuous period of k time exceeds a predetermined threshold, a hypoglycemia warning is triggered.
[0186] As shown in Figure 7, in another embodiment of this application, a hypoglycemia early warning terminal is also provided, including: a storage medium 20 and a processor 21;
[0187] Storage medium 20 stores computer-executed instructions;
[0188] The processor 21 executes computer execution instructions stored in the storage medium 20 to implement the hypoglycemia warning method as described above.
[0189] The processor 21 may include one or more processing cores. The processor 21 executes instructions, programs, code sets, or instruction sets stored in the storage medium 20, and calls data stored in the storage medium 20 to perform various functions and process data as described in this application. The processor 21 may be at least one of a specific application-specific integrated circuit, digital signal processor, digital signal processing device, programmable logic device, field-programmable gate array, central processing unit, controller, microcontroller, and microprocessor. It is understood that, for different devices, the electronic devices used to implement the functions of the processor 21 may also be other types.
[0190] The storage medium 20 can be used to store instructions, programs, code, code sets, or instruction sets. The storage medium 20 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the aforementioned hypoglycemia warning method; the data storage area may store data involved in the aforementioned hypoglycemia warning method.
[0191] In another embodiment of this application, a computer-readable storage medium is also provided, which stores computer-executable instructions that, when executed by a processor, are used to implement the hypoglycemia warning method as described above.
[0192] The computer-readable storage medium can be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory, random access memory, or optical disc.
[0193] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for early warning of hypoglycemia, characterized in that, include: Obtain blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data; Construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN includes at least two LSTM layers and one TCN layer connected in sequence. Based on the preprocessed data, a training dataset is constructed, and the LSTM-TCN model is trained using the training dataset to obtain a trained hypoglycemia prediction model. Obtain blood glucose time series monitoring data, and use the hypoglycemia prediction model to predict blood glucose values with a preset prediction step size based on the blood glucose time series monitoring data, thereby obtaining the blood glucose prediction value with the preset prediction step size. Based on the blood glucose prediction value of the preset prediction step size and the preset early warning mechanism, a low blood glucose warning is issued.
2. The method as described in claim 1, characterized in that, The preprocessing of the blood glucose time series sample data to obtain preprocessed data includes: The blood glucose time series sample data is processed by outlier removal or interpolation using confidence intervals or n-sigma intervals to obtain the first processed data; The first processed data is denoised using an adaptive Kalman filter algorithm to obtain the second processed data. The second processed data is standardized using the z-score standardization method to obtain the third processed data; The third processing data is processed using the sliding window method to obtain preprocessed data.
3. The method as described in claim 1, characterized in that, The LSTM-TCN model includes a first LSTM layer, a second LSTM layer, and a TCN unit connected in sequence, wherein the TCN unit includes at least one TCN layer connected in sequence, wherein: The first LSTM layer is used to output a first temporary variable based on the preprocessed data; The second LSTM layer is used to output the LSTM activation value based on the first temporary variable; The TCN unit is used to output a blood glucose prediction value with a preset prediction step size based on the LSTM activation value and the Sigmoid activation function.
4. The method as described in claim 3, characterized in that, The TCN unit is specifically used for: The LSTM activation value is used as the input to the first TCN layer; Using at least one TCN layer, one-dimensional convolution is performed based on the input of the TCN layer and the pre-set dilation factor, convolution kernel, sliding stride and padding stride to obtain the output of the one-dimensional convolutional layer; Based on the pre-set hyperparameters, the output of the one-dimensional convolutional layer is subjected to feature filtering and cropping to obtain a second temporary variable; The second temporary variable is corrected using the Sigmoid activation function to obtain the output of the TCN layer; Repeat the above steps, increasing the expansion factor and the fill step size exponentially each time, until the receptive field length of a one-dimensional convolutional layer of a certain TCN layer is consistent with the preset input step size. Then, use the current output of the TCN layer as the blood glucose prediction value of the preset prediction step size.
5. The method as described in claim 4, characterized in that, The maximum number of TCN layers in the TCN unit is L = min(L max ,[log(T) / log(α)]), where L max α represents the preset maximum number of TCN layers, α represents the expansion factor increment, and T represents the preset input step size.
6. The method as described in claim 1, characterized in that, The step of constructing a training dataset based on the preprocessed data and training the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model includes: The preprocessed data is divided into a training set, a validation set, and a test set; The LSTM-TCN model is trained using the Adam optimizer with a set learning rate and the training set. An early stopping mechanism is employed, and the parameters are fine-tuned using the validation set to obtain a trained intermediate model. The intermediate model is evaluated using the test set to obtain evaluation metrics. Determine whether the evaluation index meets the preset requirements; if so, use the intermediate model as the trained hypoglycemia prediction model.
7. The method as described in claim 1, characterized in that, The preset early warning mechanism includes one or more of the following early warning mechanisms: When a single point in the blood glucose prediction value within the preset prediction step size is less than the predetermined low blood glucose threshold, a low blood glucose warning is triggered. When the predicted blood glucose value is less than the predetermined hypoglycemia threshold for k consecutive time periods within the preset prediction step size, a hypoglycemia warning is triggered. When the cumulative decrease in blood glucose over a continuous period of k time exceeds a predetermined threshold, a hypoglycemia warning is triggered.
8. A hypoglycemia early warning system, characterized in that, include: The processing unit is used to acquire blood glucose time series sample data and preprocess the blood glucose time series sample data to obtain preprocessed data. A construction unit is used to construct an LSTM-TCN model that takes blood glucose time series data as input and outputs blood glucose prediction values with a preset prediction step size. The LSTM-TCN model includes at least two LSTM layers and one TCN layer connected in sequence. The training unit is used to construct a training dataset based on the preprocessed data, and to train the LSTM-TCN model using the training dataset to obtain a trained hypoglycemia prediction model. The prediction unit is used to acquire blood glucose time series monitoring data and, using the hypoglycemia prediction model, predict blood glucose values with a preset prediction step size based on the blood glucose time series monitoring data to obtain the blood glucose prediction value with the preset prediction step size. The early warning unit is used to issue a low blood sugar warning based on the blood sugar prediction value of the preset prediction step size and the preset early warning mechanism.
9. A hypoglycemia early warning terminal, characterized in that, include: Storage media and processor; The storage medium stores computer-executed instructions. The processor executes computer execution instructions stored in the storage medium to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.