Method for evaluating pre-sleep hypoglycemia risk probability based on local-global features
By constructing a transfer learning method that shares spatial and local-global characteristics, the problems of large individual differences and limited sample size in the prediction of diabetes hypoglycemia risk are solved, and more accurate hypoglycemia risk assessment and early warning are achieved.
Patent Information
- Application Number
- CN202510182539.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-07-22
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art has problems with large individual differences and limited sample size in the prediction of diabetes hypoglycemia risk, and traditional feature extraction and deep learning network training methods are difficult to meet the needs.
By constructing a local-global feature evaluation method, using multi-source information domain and target domain time series data, a shared representation space is constructed, a heterogeneous adaptive model and a transfer learning method based on local-global features are adopted, and a deep learning network is optimized to identify the risk of hypoglycemia in combination with attention mechanisms and dynamic early warning rules.
It improves the performance of the hypoglycemia risk warning system, can more accurately identify the possible hypoglycemia conditions in patients, and provides better nighttime warning guarantees before going to bed.
Smart Images

Figure CN120356660A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical risk assessment, and particularly relates to a method for evaluating the risk probability of bedtime hypoglycemia based on local-global features. Background Art
[0002] Deep learning methods have achieved good results in both the prediction and classification of time series. A time series is a set of random variables sorted in chronological order, usually the result of observing a potential process at equal time intervals according to a specific sampling rate. In actual application scenarios, due to the complex and variable characteristics of diabetic patients, affected by multiple factors such as exercise and diet, blood glucose sequences show complexity. The application of deep learning methods in diabetes risk warning faces some problems. For example, there are obvious individual differences between different samples, and the degree of feature correlation of data at different times may also change, which increases the difficulty of the model in capturing associated features.
[0003] Therefore, it is of great significance to reasonably extract and select blood glucose sequence features. Currently, existing warning methods mainly use a single variable and a hypoglycemia threshold, without considering the correlation between process variables and time, and the multi-time scales of data are often ignored. In addition, due to the short time of continuous wearing of CGM (Continuous Glucose Monitoring System), the collected blood glucose data is very few, making it difficult to meet the data requirements for model establishment.
[0004] In summary, there are problems of large individual differences and limited sample size in diabetes hypoglycemia risk prediction. Therefore, traditional feature extraction and deep learning network training methods are difficult to meet the requirements. Summary of the Invention
[0005] (I) Technical Problems to be Solved
[0006] The present invention proposes a method for evaluating the risk probability of bedtime hypoglycemia based on local-global features, aiming to solve the problems of large individual differences and limited sample size existing in the existing evaluation methods for diabetes hypoglycemia risk prediction.
[0007] (II) Technical Solutions
[0008] The present invention proposes a method for evaluating the risk probability of bedtime hypoglycemia based on local-global features, and the steps are as follows:
[0009] (I) Construct a local source domain feature set X slk , a global source domain feature set X sg and a local target domain feature set X tl , a global target domain feature set X tg from the patient's multi-source information domain time series and target domain time series data to reflect the patient's blood glucose level;
[0010] (2) Find the common subspace that minimizes the distribution difference between the local source domain feature set X slk and the local target domain feature set to obtain the local objective function Global objective function Obtain the shared representation space by calculating the objective function;
[0011] (3) Map the local source domain feature set Global source domain feature set and the local target domain feature set Global target domain feature set into the shared representation space, and obtain the projected local source domain representation sample set Global source domain representation sample set and the local target domain representation sample set Global target domain representation sample set
[0012] (4) Use the transfer learning method based on local-global features to evaluate the probability of pre-bedtime hypoglycemia risk for the local source domain representation sample set Global source domain representation sample set and the local target domain representation sample set Global target domain representation sample set .
[0013] Furthermore, the heterogeneous domain adaptation model in step (2) is:
[0014]
[0015] In the formula, ε DA represents the objective function of the distribution alignment part; X s is the source domain feature; X t is the target domain feature; P s is the projection used to learn to map the source domain to a common feature space; P t is the projection used to learn to map the target domain samples to a common feature space.
[0016] Furthermore, the steps of the transfer learning method based on local-global features in step (4) are:
[0017] (1) Input the local source domain representation sample set and the local target domain representation sample set into the attention module, and obtain the attention weight g(·) according to the weight model; and obtain the domain weight loss L d ; and then obtain the classification result of the first stage and Align the data;
[0018] (2) Substitute the obtained and into the loss function model to obtain the first-stage classification loss L L ; Use the backpropagation algorithm to optimize the first-stage classification loss L L for pre-training and update the network parameters {θ f , θ y};
[0019] (3) Based on the network parameters {θ f , θ y} updated in step (2), output the adjusted weighted global source domain representation sample set and the global target domain representation sample set from the shared representation space and Then obtain the global representation weighted loss function L according to the global representation weighted loss model g ; And obtain the second-stage classification loss L according to the second-stage classification loss model G , and further obtain the second-stage classification result and
[0020] (4) Substitute the second-stage classification result and into the first-stage classification loss L L , use the backpropagation algorithm to optimize the first-stage classification loss L L to update the network parameters {θ f , θ y}, obtain the target deep learning network, and output the evaluation data to identify the possible hypoglycemia situation of the patient.
[0021] Furthermore, the weight model in step (1) is:
[0022] g(·) = σ(MLP(AvgPool(D)) + MLP(MaxPool(D)))
[0023] In the formula, g(.) is the weight; σ is the activation function; MLP(AvgPool(D)) is the result of inputting the result after average pooling into a multi-layer perceptron for processing; MLP(MaxPool(D)) is the result of inputting the result after max pooling into the multi-layer perceptron for processing.
[0024] Furthermore, the domain weight loss model in step (1) is:
[0025]
[0026] In the formula, Ld is the domain weight loss; M is the multi-source information domain; is the attention weight of the k-th local source domain; is the attention weight of the local target domain.
[0027] Furthermore, the loss function model in step (2) is:
[0028]
[0029] In the formula, M is the multi-source information domain; represents the local source domain feature set; represents the local target domain feature set; L C is the classification loss function; G y is a classifier; is the feature extractor, which maps the input data to the feature space; θ f is the parameter of the feature extractor G f ; θ y is the parameter of the classifier G y ; is the true label of the k-th sample in the source domain; N t is the number of target domain samples; is the number of source domain samples; is the feature extractor, which maps the input data to the feature space; is the true label of the sample in the target domain; λ is the hyperparameter; ε DA is the objective function of the source domain and target domain distribution alignment part; is the projection of the k-th sample in the source domain, is the projection of the sample in the target domain.
[0030] Furthermore, the global representation weighted loss model in step (3) is:
[0031]
[0032] In the formula, L g is the weighted classification loss of the global feature; n is the number of source domain global feature samples; ω i is the weight of the i-th sample; is the classifier G y 's prediction result for the i-th source domain global feature f output by the feature extractor G ; is the true label of the i-th source domain global feature; L C is the classification loss function.
[0033] Further, in step (1), the classification loss model in the second stage is as follows:
[0034]
[0035] In the formula, L G is the overall loss function; is the classification loss of the source domain global features; is the set of source domain global features; is the set of true labels of the source domain global features; is the classification loss of the target domain global features and is weighted; N t is the number of target domain samples; N s is the number of source domain samples; is the set of target domain global features; is the set of true labels of the target domain global features; is the domain adaptation loss function; λ is a hyperparameter used to balance the classification loss and the domain adaptation loss; ε DA is the objective function of the source domain and target domain distribution alignment part; is the projection of the source domain global features; is the projection of the target domain global features; L g is the overall loss function; β is a hyperparameter used to balance the weighted classification loss of the global features.
[0036] Further, the confidence interval of the evaluation method is determined by a dynamic warning rule, and the steps of the dynamic warning rule are as follows:
[0037] (1) Determine the warning probability: For the bedtime warning problem, obtain the probability value output by the warning model, indicating the probability that the sample belongs to hypoglycemia;
[0038] (2) Calculate the confidence interval: For the given warning probability p, use the Wilson confidence interval calculation method to estimate the uncertainty range of the warning probability; The calculation formula of the Wilson confidence interval is as follows:
[0039]
[0040] In the formula, CI represents the confidence interval; is the classification probability of the sample; n is the number of samples; z is the z value corresponding to the selected confidence level, which is obtained from the standard normal distribution table according to the selected confidence level.
[0041] The present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that when the processor executes the computer program, it implements the evaluation method for the probability of hypoglycemia risk before bedtime based on local-global features.
[0042] (3) Beneficial effects
[0043] First, the present invention obtains empirical features through domain-related knowledge and constructs feature sets for the source domain and the target domain. Then, in order to transfer the classification discriminant knowledge between two different feature sets, a shared representation space is constructed to align the data distributions while transferring the knowledge. To address the problem of insufficient long-sequence sample numbers, a transfer learning method based on local-global features is proposed. In the first stage, the local representation is input into the model, and a deep learning network is pre-trained to learn features. Secondly, the global representation is input into the second-stage transfer learning method, and the deep learning network is fine-tuned under the guidance of the global representation. Finally, the network parameters are adjusted according to the global representation of the target domain, thereby obtaining the target deep learning network. By introducing empirical features and transfer learning methods in model training, the method of the present invention can better learn the associations between different features and can more accurately identify the possible hypoglycemia conditions of patients during the risk probability assessment process. This comprehensive method can effectively improve the performance of the warning system and provide better protection for diabetic patients in terms of pre-bedtime and nighttime hypoglycemia warnings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 It is a schematic structural diagram of the framework of the pre-bedtime risk probability assessment method;
[0045] Figure 2 It is a schematic flow diagram of the assessment method of the present invention;
[0046] Figure 3 It is a schematic diagram of the generation process of the shared representation space;
[0047] Figure 4 It is a schematic diagram of single-source and multi-source transfer learning;
[0048] Figure 5 It is a schematic diagram of the attention mechanism structure;
[0049] Figure 6 It is a schematic diagram of the multi-source information fusion process based on channel attention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] To further elaborate on the technical means adopted by the present invention and its effects, the present invention will be further described below in conjunction with embodiments and the drawings. It can be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0051] Method for evaluating probability of nocturnal hypoglycemia risk based on local-global features. A shared representation space is designed in the transfer learning network to achieve domain adaptation, and the data distribution difference is reduced by minimizing the distribution distance. A multi-source domain information fusion method is designed to learn multi-source domain local information using channel attention, and the change of local features is considered to achieve associated information fusion. At the same time, a globally-guided domain adaptation transfer learning method is designed to learn local and global information according to two cost functions with different convergence speeds. By designing an evaluation model based on local-global features, a more reliable solution is provided for bedtime warning.
[0052] Based on a transfer network with multi-source local information fusion and global representation guidance, the present invention proposes a method for evaluating the probability of hypoglycemia risk before bedtime based on local-global features, as Figure 2 shown. This figure shows a deep learning model architecture for evaluating the risk probability before bedtime, including feature extraction of multi-source information domain and target domain, construction of a shared representation space, a deep learning network for global and local feature training, an attention mechanism, domain weight loss calculation, and optimization of the overall loss function. Specifically, the original signal data first obtains local and global features through feature extraction, and then these features are mapped into a shared representation space and input into the corresponding deep learning networks for training respectively. The attention mechanism is used to enhance the performance of important features, while the domain weight loss ensures that the contributions of data from different sources are balanced in the model. Finally, the model parameters are updated by minimizing the overall loss function to achieve good generalization ability for different data distributions. As Figure 1 shown, the specific steps are as follows:
[0053] (1) First, construct a local source domain feature set global source domain feature set and a local target domain feature set global target domain feature set from the time series of the multi-source information domain and the time series data of the target domain to reflect the blood glucose level of the patient;
[0054] In the existing transfer learning structure based on domain adaptation, the time series is a set of random variables sorted in time order, usually the result of observing a potential process at equal time intervals according to a specific sampling rate. Affected by multiple factors such as exercise and diet, the blood glucose sequence shows complexity. Therefore, it is of great significance to reasonably extract and select blood glucose sequence features. At present, the warning method mainly uses a single variable and a hypoglycemia threshold to achieve, without considering the correlation between process variables and time, and the multi-time scales of data are often ignored.
[0055] To solve the problem that in the transfer learning structure based on domain adaptation, the warning method mainly uses a single variable and a hypoglycemia threshold, without considering the correlation between process variables and time, and the multi-time scales of data are often ignored. The present invention extracts features from data of multiple time scales, and reflects short-term blood glucose fluctuations through local features of short time scales (local source domain feature set X slk and local target domain feature set X tl ), and reflects the long-term trend of the blood glucose sequence through global features of long time scales (global source domain feature set X sg and global target domain feature set X tg ), and ensures the integrity of information by considering the comprehensive effects of data of different scales.
[0056] (2) Find a common subspace that minimizes the distribution difference between the local source domain feature set X slk and the local target domain feature set X tl through a heterogeneous domain adaptation model, and obtain the local objective function ε DA (X slk ,X tl ,P slk ,P tl ), the global objective function ε DA (X sg ,X tg ,P sg ,P tg ), and obtain a shared representation space by calculating the objective function;
[0057] In the existing domain adaptation transfer structure based on the shared representation space, although key information in the data can be extracted, there is a situation of insufficient data in practice. Since the continuous wearing time of the CGM (Continuous Glucose Monitoring System) is short, the collected blood glucose data is very few, making it difficult to meet the data requirements for establishing a model. However, there may be a data reserve of other similar objects, from which relevant information can be obtained to alleviate the existing situation of insufficient data. Traditional machine learning assumes that the training data and the test data come from the same feature space and have the same data distribution. However, in real scenarios, this assumption often does not hold because there may be huge differences between different domains. In this case, directly applying the knowledge learned in one domain to another domain often leads to the phenomenon of negative transfer, that is, the performance decreases. The transfer learning method uses the information of the source domain data to improve the learning effect of the target domain, can reduce the domain difference during the transfer process, thereby improving the performance and generalization ability of the model, and reducing the impact of insufficient data on the model.
[0058] The present invention utilizes transfer learning to improve the learning process in the target domain by extracting knowledge from other similar domains, thereby solving the problems of insufficient data and differences between different domains. Sample-based transfer methods mainly rely on instance weight strategies and directly apply instances from the source domain to the target domain. Feature-based methods transform the original features to create new feature representations, thus achieving knowledge transfer. Model-based transfer methods transfer knowledge at the model or parameter level by fine-tuning the model in the source domain or initializing the model in the target domain.
[0059] The model-based transfer learning method finds the shared parameter information between the source domain and the target domain to achieve transfer. This method usually involves pre-training a model on the source domain and applying this model to the target domain, and then fine-tuning the model according to the feedback from the target domain to improve performance. Fine-tuning is carried out because there are not enough samples to train the network from scratch for this task, which will lead to model overfitting. In practical scenarios, there is a certain degree of correlation between the blood glucose sequence data of different clinical datasets. Therefore, the dataset with sufficient data can be used as the source domain, and the model can be transferred to the target domain with insufficient data through the method of transfer learning, so as to achieve early warning of hypoglycemic events. However, due to the differences between individuals or the changes in the data collection environment, directly applying the source domain model to the target domain often results in poor performance. Specifically, the source domain feature X s (local source domain feature set and global source domain feature set ) and the target domain feature X t (local target domain feature set and global target domain feature set ) are heterogeneous feature sets with independent feature dimensions and divergent data distributions. In this case, the data distributions between the two domains are not exactly the same, and the discriminant information for classification cannot be directly transferred between different feature sets. To solve this problem, this section constructs a heterogeneous domain adaptation model to learn the shared representation of different feature sets. By learning a shared feature representation between the source domain and the target domain, the data in different domains are mapped into the same space, so as to achieve the transfer and migration of information.
[0060] The present invention maps the blood glucose sequence features of the source domain and the target domain into the same space by learning a shared feature representation, so that the local features and global features reduce the distribution distance under the shared representation, and can be better aligned and compared. In this way, the knowledge of the source domain can be fully utilized to help improve the classification performance of the target domain, thereby realizing the knowledge transfer between heterogeneous domains. The heterogeneous domain adaptation model is:
[0061]
[0062] In the formula, ε DAThe objective function representing the distribution alignment part, X s is the source domain feature (local source domain feature set or global source domain feature set ), X t is the target domain feature (local target domain feature set or global target domain feature set ), P s is the projection for learning to map the source domain to a common feature space, P t is the projection for learning to map the target domain samples to a common feature space.
[0063] To find a common subspace that minimizes the distribution difference between the source dataset and the target dataset, the distribution distance is effectively measured by the Maximum Mean Discrepancy (MMD).
[0064] The calculation of the projected feature space is as follows:
[0065]
[0066] In the formula, is the i-th sample in the source dataset, n s is the number of samples contained in the source dataset, is the transpose of the projection matrix of the source domain, and i is the number corresponding to the i-th sample in the source dataset, is the j-th sample in the target dataset, n t is the number of samples contained in the target dataset, P t T is the transpose of the projection matrix of the target domain, and j is the number corresponding to the j-th sample in the target dataset.
[0067] Combine P s and P t into a variable P, and integrate the two sample sets X s and X t into a matrix X.
[0068]
[0069] Therefore, ε DA can be simplified as:
[0070] ε DA = tr(P T XMX T P)(5)
[0071] where tr represents the trace of the matrix, and M is the MMD matrix, which is calculated as follows:
[0072]
[0073] By aligning the data distributions, a shared representation space is constructed. The schematic diagram of the generation process of the shared representation space is as shown in Figure 3 . This method can make the source domain and the target domain exhibit more similar distribution characteristics in this space, thereby improving the generalization ability and adaptability of the model, and enhancing the performance of the model on the target domain. This method can not only effectively reduce the differences between the source domain and the target domain, but also better utilize the knowledge of the source domain to guide the learning on the target domain, improving the performance and effectiveness of the overall model.
[0074] (III) Map the local source domain feature set the global source domain feature set and the local target domain feature set the global target domain feature set into the shared representation space, and obtain the projected local source domain representation sample set the global source domain representation sample set and the local target domain representation sample set the global target domain representation sample set
[0075] (IV) Use the transfer learning method based on local-global features to evaluate the probability of pre-bedtime hypoglycemia risk for the local source domain representation sample set the global source domain representation sample set and the local target domain representation sample set the global target domain representation sample set . The transfer learning method based on local-global features is as follows:
[0076] (1) Input the local source domain representation sample set
[0077] and the local target domain representation sample set into the attention module, and obtain the attention weight g(·) according to the weight model; and obtain the domain weight loss L according to the domain weight loss model; and then obtain the classification results in the first stage d ; and and achieve data alignment;
[0078] In the domain adaptation network, the design of the weighted loss function is an essential technique for solving the problems of sample imbalance or different importance degrees of different samples. By adjusting the sample loss, the domain adaptation network can pay more attention to the learning of important samples or minority-class samples, thereby improving the performance of the model on these key samples. However, in practical applications, there may be differences in the data volumes of the source domain and the target domain, which will lead to different degrees of attention of the model to the two domains during the learning process, and thus affect the performance and generalization ability of the model.
[0079] To solve the above problems, the present invention designs a weighted loss function for the domain adaptation network to ensure that the model can fully focus on the feature representations of the two domains and better learn transferable representations. The evaluation model transfers knowledge through a shared representation space during the training process, learns transferable representations, and ensures that the learned representations can be used for the target task. At the same time, to avoid different degrees of attention of the network to the source domain and the target domain during the learning process, this problem is solved by adding a weighted loss coefficient α. The influence of misleading data in the source representation is reduced in a weighted manner, and the generalization ability of the network is improved. The weighted loss of the transfer learning model is as follows:
[0080] L d = L C (G y (G f (X s ; θ f ); θ y ),Y s ) + αL C (G y (G f (X t ; θ f ); θ y ),Y t ) + λL DA (7)
[0081] Where Y s is the label set corresponding to X s ; similarly, Y t is the label set corresponding to X t . G f (X s ; θ f ) and G f (X t ; θ f ) represent the mappings in the shared representation space, G y (G f (X s ; θ f ); θ y ) and G y (G f (Xt ; θ f ); θ s ) represents the mapping of the characterization classifier (the characterization classifier is responsible for learning a meaningful (ε DA minimum) representation from the shared representation space and outputting the classification result), θ f is the parameter of the feature extractor G f ; θ y is the parameter of the classifier G y ; L C represents the classification loss, which is used to evaluate the difference between the classification result and the true result. L DA represents the data alignment loss in the shared representation space. λ > 0 is the penalty coefficient for the inter-domain difference. α > 0 is the weight coefficient of the target domain, which is used to balance the difference in the number of samples between domains.
[0082] Assume that the sample size of the batch data is n, where the number of samples from the source dataset contains s the mathematical expectation of:
[0083] E(n s ) = N s n / (N s + N t ) (8)
[0084] Correspondingly, the number of samples from the target dataset contains t the mathematical expectation of:
[0085] E(n t ) = N t n / (N s + N t ) (9)
[0086] The model is expected to balance the learning of samples in the source domain and the target domain to obtain good generalization ability. When randomly selecting n b samples from the source domain and the target domain to form a batch dataset, it should satisfy:
[0087]
[0088] Substituting the above formula into L d , the weighted function that can effectively avoid data differences and domain data imbalance problems can be obtained as:
[0089]
[0090] Considering the changing situation of the associated characteristics of nocturnal hypoglycemia, it is necessary to use different feature information to capture the changing situation of the associated characteristics. To this end, considering the characteristics of the data set, the feature situations of different data sources are considered. By training and transferring the knowledge of the multi-source local information domain, the performance of the model in the target domain is improved. The differences between single-source domain transfer learning and multi-source domain transfer learning in the prior art are as Figure 4 shown.
[0091] However, the existing methods have not fully considered the individual differences of time series data, that is, the features are changing. In order to better cope with this dynamic change situation of the associated characteristics, a multi-source information fusion method based on the attention mechanism is designed, and important transferable attributes are extracted from the multi-source information domain through the attention mechanism. In order to obtain the transferable attributes in the multi-source information domain, the present invention uses channel attention to learn the channel relationship between features to obtain attention weights.
[0092] By performing attention modeling on the data in the multi-source information domain, the model gives priority to meaningful attributes while suppressing background information with weak correlation. Map the feature D∈R Cl×H×W input to the attention module, where Cl represents the number of channels, H represents the height, and W represents the width. Specifically, as Figure 5 shown, after average pooling and max pooling operations, two different representations are generated, namely the average pooling feature and the max pooling feature, and these two features are forwarded to a shared multi-layer perceptron (MLP). The network contains two fully connected layers to match the input and output dimensions to generate channel attention vectors V_1 and V_2. It should be noted that the activation size of the hidden layer is determined by R Cl / r×1×1 determined, where r represents the dimensionality reduction coefficient. Subsequently, an element-wise summation operation is performed on the two vectors, and the Sigmoid function is used to constrain the resulting output vector within the range of 0 to 1 to obtain the channel attention weight g(·):
[0093] g(·) = σ(MLP(AvgPool(D)) + MLP(MaxPool(D))) (12)
[0094] In the formula, g(·) is the weight, σ is the activation function, such as Sigmoid or ReLU, etc., used to introduce non-linear characteristics, MLP(AvgPool(D)) is the result of inputting the result after average pooling into a multi-layer perceptron (MLP) for processing, and MLP(MaxPool(D)) is the result of inputting the result after max pooling into the multi-layer perceptron (MLP) for processing.
[0095] The present invention combines the attention weights of different information domains, considers the changing characteristics of time series data, and realizes information fusion. The fusion process is as Figure 6As shown, it aims to minimize the distribution difference between the source domains (including source domain 1 and source domain 2) and the target domain through feature extraction, shared representation space construction, and attention mechanism. The specific process is as follows: First, features of blood glucose data (local features, global features, and predicted lowest blood glucose value at night) are extracted from the original signal data (multi-source information domain and target domain) through three feature channels (source domain 1, source domain 2, and target domain) respectively; then these features are mapped to a shared representation space to obtain new feature representations; next, the attention mechanism is applied to enhance the performance of important features and calculate the domain weight loss function L d to ensure balanced processing of data from different sources; finally, the model parameters are updated by optimizing the overall loss function to achieve effective learning and prediction of the data in source domain 1, source domain 2, and the target domain. In this embodiment, the OhioT1DM public dataset is used for source domain 1, and the real data of diabetic patients in Cooperative Hospital 1 is used as the dataset for source domain 2. The target domain data uses another real data of diabetic patients in Cooperative Hospital 2.
[0096] The three feature channels are respectively used to extract the local features, global features, and predicted lowest blood glucose value at night of the blood glucose data. In the feature set, the global features play a crucial role, which can reflect the patient's long-term blood glucose control situation and living habits, and help the model more accurately predict hypoglycemic events that may occur in the future. Through the global features, the model can obtain more information, which helps to better understand the overall situation of the patient, thereby improving the performance and accuracy of the model in the assessment of nocturnal hypoglycemia risk. The warning time span of the bedtime warning is 8 hours in the future, and the global features require CGM data for consecutive days. However, due to individual differences among patients and limitations in data collection, the sample data is relatively small, resulting in insufficient data in the learning stage. Although the local data is not sufficient to completely describe the global features, they still contain some key information and potential patterns. Effective training information can be extracted from them and used as the initial form of the model for the bedtime warning model to learn. In addition, to reduce the data distribution difference between different domains, a domain adaptation structure based on a shared representation space is designed. This method helps to alleviate the problems caused by insufficient data and also helps the model to converge faster and better adapt to the global information.
[0097] In addition, the associated characteristics of nocturnal hypoglycemia events are variable, with differences in data among different patients and on different nights for the same patient. To more fully consider the associated characteristics of different samples at night, it is necessary to learn relevant information from multiple data sources. Therefore, the multi-source information fusion method based on channel attention in the present invention adaptively adjusts the feature weights according to the importance of features in the current time period to ensure that the model can fully understand and utilize local information. By learning sufficient local information in the multi-source information domain and applying this information to the target domain, the problem of insufficient data is solved and the model performance is improved. On this basis, the global features are used as the guidance of the domain adaptation network, and the local and global information of the data is learned by combining two cost functions with different convergence speeds.
[0098] By processing the time series data through feature extraction and shared representation space, the multi-source information domain representation can be obtained from the k-th source domain data and the target domain data and the target domain representation Subsequently, the feature maps and are input into the attention module g(·) to obtain the corresponding attention weight vectors and Finally, the Manhattan distance is used to estimate the attention weight difference between the attention weight of the k-th local source domain and the attention weight of the local target domain The domain weight loss can be expressed as:
[0099]
[0100] where L d is the domain weight loss, M is the multi-source information domain, is the attention weight of the k-th local source domain, is the attention weight of the local target domain. k is 1 or 2.
[0101] The first-stage classification result and are obtained through the above pre-trained deep learning network to achieve data alignment.
[0102] (2) Substitute the obtained and into the loss function model to obtain the first-stage classification loss L L ; Use the backpropagation algorithm to optimize the first-stage classification loss L L for pre-training and update the network parameters {θ f , θ y};
[0103] Since local features cannot fully describe the key information in the data, it is necessary to mine global features from the input data to train the model. However, in the bedtime warning task, affected by individual patient differences, there is a problem of insufficient data in the learning stage for samples with global features. Although existing transfer learning models have achieved some results, there are still problems. If the two types of representations are input into the network at the same time, the model will produce unreasonable outputs. Considering the incompleteness when relying only on local data information and the insufficient data at night, the present invention provides a transfer learning method based on local-global features, which combines two cost functions with different convergence speeds to fully learn the data information. In the first stage, the local features of the data are used for pre-training, which not only accelerates the convergence speed of the model but also provides a good initial state for the subsequent model.
[0104] After processing through the shared representation space, given the projected multi-source information domain representation, which includes local representations and the global representation of the complete data In the first stage of the transfer method of the present invention, a pre-training model is selected for the local representation with sufficient data volume. The loss function in this stage is as follows:
[0105]
[0106] In the formula, M is the multi-source information domain, represents the local features of the samples with only local features in the multi-source information domain data, represents the local features of the target domain samples, L C is the classification loss function, which is used to evaluate the difference between the predicted value and the true label, G y is a classifier that maps features to class labels, is a feature extractor that maps the input data to the feature space, θ f is the parameter of the feature extractor G f of, θ y is the parameter of the classifier G y of, is the true label of the kth sample in the source domain, N t is the number of target domain samples, is the number of source domain samples, is a feature extractor that maps the input data to the feature space, is the true label of the sample in the target domain, λ is a hyperparameter used to balance the classification loss and the domain adaptation loss, ε DA is the objective function of the source domain and target domain distribution alignment part, which is used to measure the difference between the source domain and target domain features, is the projection of the kth sample in the source domain, is the projection of the sample in the target domain.
[0107] By taking the classification results of the first stage and into the loss function model, the classification loss L of the first stage is calculated L . Using the backpropagation algorithm to optimize this loss and update the network parameters {θ f , θ y}, thus realizing the pre-training and parameter update of the deep learning network.
[0108] (3) Based on the network parameters {θ f , θ y} updated in step (2), the globally adjusted weighted source domain representation sample set and the globally adjusted weighted target domain representation sample set are output from the shared representation space. Then, according to the global representation weighted loss model, the global representation weighted loss function L g is obtained; and according to the second-stage classification loss model, the second-stage classification loss L G is obtained, and then the second-stage classification results and
[0109] In the second stage, guided by the representation, the model performance is further optimized, and the training time and computational cost are reduced. In the second stage, the source domain data containing the global representation is used to adjust the model. In this stage, by reducing the influence of misleading data in the source domain, a deep classifier more suitable for the target domain is learned. The misclassified instances from the source domain are the instances that are least similar to the target data distribution representation, while the correctly classified instances are more similar to the target data. Therefore, a weight update mechanism is set for the target data, but for the training data in the source domain, a smaller weight is assigned to the misclassified instances by applying a fixed multiplier. While keeping the weights of the correctly classified source domain samples and target domain samples unchanged, the weights of the misclassified source domain samples are effectively reduced. Reweighting in the backpropagation process is achieved by assigning a weight related to the classification error to the source domain representation, changing the attention to the source domain representation during parameter update, and the weight is defined as:
[0110]
[0111] where refers to learning a meaningful representation from the shared representation space and outputting the classification result of the i-th globally represented source domain sample, represents the true label of the i-th source domain sample.
[0112] After calculating the weights related to the global representation classification error, it is also necessary to weight the weights with the source domain sample classification error to obtain the loss, so as to adjust the structure during the error backpropagation process and reduce the impact of adverse source domain samples on the target network.
[0113] The global representation weighted loss model is:
[0114]
[0115] In the formula, L g is the weighted classification loss of the global features, n is the number of source domain global feature samples, ω i is the weight of the i-th sample, is the classifier G y for the feature extractor G f the predicted result of the i-th source domain global feature output by , is the true label of the i-th source domain global feature, L C is the classification loss function.
[0116] The second-stage classification loss model is:
[0117]
[0118] In the formula, L G is the overall loss function, is the classification loss of the source domain global features, is the set of source domain global features, is the set of true labels of the source domain global features, is the classification loss of the target domain global features and is weighted, N t is the number of target domain samples, N s is the number of source domain samples, is the set of target domain global features, is the set of true labels of the target domain global features, is the domain adaptation loss function, λ is a hyperparameter used to balance the classification loss and the domain adaptation loss, ε DA is the objective function of the source domain and target domain distribution alignment part, used to measure the difference between the source domain and target domain features, is the projection of the source domain global features, is the projection of the target domain global features, L g is the weighted classification loss of the global features, β is a hyperparameter used to balance the weighted classification loss of the global features.
[0119] Through the above method, during the training process of the target network, attention is paid to the difficult-to-learn global representations, the weights of the source domain samples with misclassifications are reduced, which is beneficial to the learning of the target network. Therefore, the second-stage loss L guided by global representations is summarized G . Where β ∈ [0, 1] is an empirical parameter, representing the overall weight ratio of the source domain loss and the target domain loss.
[0120] The second-stage classification results are obtained through the trained deep learning network and
[0121] (4) Substitute the second-stage classification results and into the first-stage classification loss L L , and use the backpropagation algorithm to optimize the first-stage classification loss L L Update the network parameters {θ f , θ y}, obtain the target deep learning network, and output the evaluation data to identify the possible hypoglycemic conditions of the patient.
[0122] In addition, to better capture the information in the boundary region and improve the performance of the bedtime warning model, a dynamic warning rule based on the confidence interval is designed. In the calculation of the confidence interval based on the normal distribution, an interval is obtained, which is called the confidence interval. This interval represents the estimate of the statistical characteristics of the sample and the range of uncertainty of this estimate. The confidence interval provides a credibility estimate of the classification probability and allows warning decisions to be made based on the uncertainty of the probability. Through the dynamic rule based on the confidence interval, the sensitivity of the warning can be adjusted at different confidence levels, making the warning system more flexible and reliable. The specific steps of this dynamic warning rule based on the confidence interval are as follows:
[0123] (1) Determine the warning probability: For the bedtime warning problem, obtain the probability value output by the warning model, indicating the probability that the sample belongs to hypoglycemia.
[0124] (2) Calculate the confidence interval: For the given warning probability p, use the confidence interval calculation method to estimate the range of uncertainty of the warning probability. Among them, the Wilson Confidence Intervals has a better effect on small samples and is more robust in boundary cases. The calculation formula of the Wilson Confidence Interval is as follows:
[0125]
[0126] In the formula, CI represents the confidence interval, is the classification probability of the sample, n is the number of samples, and z is the z-value corresponding to the selected confidence level, which is obtained from the standard normal distribution table according to the selected confidence level. Generally, at a 95% confidence level, the value of the z-statistic is 1.96.
[0127] This model proposes a method for evaluating the diabetes risk probability based on local-global features. By constructing a shared representation space to align the data distributions, the source domain and the target domain exhibit more similar distribution characteristics in this space. A domain adaptation transfer method based on local-global features is designed. First, the multi-source local information is processed by a multi-source local information fusion method based on channel attention to capture the changes in the associated local features and pre-train the network. Then, on this basis, the global representation is used for guidance and the network is adjusted. In addition, to better adapt to different situations, a warning strategy based on the confidence interval is designed to achieve a more accurate risk probability assessment.
[0128] The embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements any of the above-mentioned methods for evaluating the risk probability of pre-bedtime hypoglycemia based on local-global features. The embodiment of the present invention also provides a computer-readable storage medium, which stores a computer program for executing any of the above-mentioned methods for evaluating the risk probability of pre-bedtime hypoglycemia based on local-global features.
[0129] Obviously, those skilled in the art should understand that the above steps of the embodiments of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Optionally, they can be implemented by program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately made into individual integrated circuit modules, or multiple modules or steps among them can be made into a single integrated circuit module to implement. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
[0130] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the embodiments of the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An evaluation method for the probability of pre-sleep hypoglycemia risk based on local-global features, characterized in that, The steps are as follows: (1) Construct a local source domain feature set from the patient's multi-source information domain time series and target domain time series data Global source domain feature set and a local target domain feature set Global target domain feature set to reflect the patient's blood glucose level; (2) Finding a common subspace with the smallest distribution difference between the local source domain feature set and the local target domain feature set to obtain the local objective function Global objective function Obtaining the shared representation space by calculating the objective function; (3) Map the local source domain feature set global source domain feature set and the local target domain feature set global target domain feature set into the shared representation space, and obtain the projected local source domain representation sample set global source domain representation sample set and the local target domain representation sample set global target domain representation sample set (4) The local source domain characterization sample set The global source domain characterization sample set and the local target domain characterization sample set The global target domain characterization sample set are used to evaluate the probability of pre-bedtime hypoglycemia risk through a transfer learning method based on local-global features.
2. The evaluation method of the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 1, wherein In step (ii), the heterogeneous domain adaptation model is as follows: where ε DA represents the objective function of the distribution alignment part; X s is the source domain feature; X t is the target domain feature; P s is a projection for learning to map the source domain to a common feature space; P t is a projection for learning to map the target domain samples to a common feature space.
3. The evaluation method of the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 1, wherein In step (iv), the steps of the transfer learning method for local-global features are as follows: (1) Input the local source domain representation sample set and the local target domain representation sample set into the attention module, and obtain the attention weight g(·) according to the weight model; and obtain the domain weight loss L according to the domain weight loss model d ; furthermore, obtain the classification result of the first stage and to achieve data alignment; (2) Bring the obtained and into the loss function model to obtain the first-stage classification loss L L ; Use the backpropagation algorithm to optimize the first-stage classification loss L L for pre-training and update the network parameters {θ f , θ y}; (3) Based on the network parameters {θ f , θ y} updated in step (2), output the adjusted weighted global source domain representation sample set and the global target domain representation sample set D tg from the shared representation space, and then obtain the global representation weighted loss function L g according to the global representation weighted loss model; and obtain the second-stage classification loss L G according to the second-stage classification loss model, and further obtain the second-stage classification result and (4) Bring the classification results of the second stage and into the classification loss L of the first stage L , and use the backpropagation algorithm to optimize the classification loss L of the first stage L to update the network parameters {θ f , θ y}, obtain the target deep learning network, and output the evaluation data to identify the possible hypoglycemia conditions of the patient.
4. The method for evaluating the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 2, wherein In step (1), the weight model is as follows: g(·) = σ(MLP(AvgPool(D)) + MLP(MaxPool(D))) In the formula, g(·) is the weight; σ is the activation function; MLP(AvgPool(D)) is the result of inputting the result after average pooling into a multi-layer perceptron for processing; MLP(MaxPool(D)) is the result of inputting the result after max pooling into the multi-layer perceptron for processing.
5. The evaluation method for the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 2, wherein In step (1), the domain weight loss model is as follows: where L d is the domain weight loss; M is the multi-source information domain; is the attention weight of the k-th local source domain; is the attention weight of the local target domain.
6. The evaluation method for the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 2, characterized in that In step (2), the loss function model is as follows: Wherein, M is a multi-source information domain; represents a local source domain feature set; represents a local target domain feature set; L C is a classification loss function; G y is a classifier; is a feature extractor that maps the input data to the feature space; θ f is the parameter of the feature extractor G f ; θ y is the parameter of the classifier G y ; is the true label of the k-th sample in the source domain; N t is the number of samples in the target domain; is the number of samples in the source domain; is the feature extractor that maps the input data to the feature space; is the true label of the sample in the target domain; λ is a hyperparameter; ε DA is the objective function for the alignment part of the source domain and the target domain distributions; is the projection of the k-th sample in the source domain, is the projection of the sample in the target domain.
7. The evaluation method of the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 2, wherein In step (3), the global representation weighted loss model is as follows: Where, L g is the weighted classification loss of the global feature; n is the number of source domain global feature samples; ω i is the weight of the i-th sample; is the classifier G y 's prediction result for the i-th source domain global feature f output by the feature extractor G ; is the true label of the i-th source domain global feature; L C is the classification loss function.
8. The evaluation method of the bedtime hypoglycemia risk probability based on local-global features according to claim 2, characterized in that In step (1), the second-stage classification loss model is as follows: where L G is the overall loss function; is the classification loss of the source domain global features; is the set of source domain global features; is the set of true labels of the source domain global features; is the classification loss of the target domain global features and is weighted; N t is the number of target domain samples; N s is the number of source domain samples; is the set of target domain global features; is the set of true labels of the target domain global features; is the domain adaptation loss function; λ is the hyperparameter used to balance the classification loss and the domain adaptation loss; ε DA is the objective function of the source domain and target domain distribution alignment part; is the projection of the source domain global features; is the projection of the target domain global features; L g is the overall loss function; β is the hyperparameter used to balance the weighted classification loss of the global features.
9. The evaluation method of the probability of pre-sleep hypoglycemia risk based on local-global features according to claim 1, wherein The confidence interval of the evaluation method is determined by the dynamic warning rule, and the steps of the dynamic warning rule are as follows: (1) Determine the warning probability: For the bedtime warning problem, obtain the probability value output by the warning model, indicating the probability that the sample belongs to hypoglycemia; (2) Calculate the confidence interval: For the given warning probability p, use the Wilson confidence interval calculation method to estimate the uncertainty range of the warning probability; the calculation formula of the Wilson confidence interval is as follows: Where CI represents the confidence interval; is the classification probability of the sample; n is the number of samples; z is the z-value corresponding to the selected confidence level, which is obtained from the standard normal distribution table according to the selected confidence level.
10. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements an evaluation method for the probability of pre-bed hypoglycemia risk based on local-global features as described in any one of claims 1-9.
Citation Information
Cited By
Method for constructing relation between electroencephalogram data and emotional state through hierarchical feature fusion
CN120713524A
