Type 1 diabetes noninvasive hypoglycemia identification method based on intelligent wearable device
By applying a gradient-enhancing decision tree and LightGBM algorithm to the low blood sugar recognition system on smart wearable devices, combined with multi-source physiological indicators for feature extraction and classification marking, the problems of invasive, non-reusable and expensive in blood sugar monitoring in type 1 diabetes patients are solved, and non-invasive, accurate and individualized low blood sugar recognition is achieved.
Patent Information
- Application Number
- CN202411851090.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art has problems such as invasive, non-reusable and expensive in blood sugar monitoring in patients with type 1 diabetes, and the accuracy of non-invasive hypoglycemia recognition technology has not yet met the needs of clinical application.
The gradient-enhancing decision tree hypoglycemia recognition system based on intelligent wearable devices is adopted, and the model is trained through the LightGBM algorithm, and feature extraction and classification marking are combined with multi-source physiological indicators to achieve accurate identification of hypoglycemia, and individualized optimization is carried out through the correction module.
It achieves non-invasive, accurate and individualized hypoglycemia recognition, solves the invasive, non-reusable and expensive problems of CGM in blood sugar monitoring, and ensures the long-term accuracy of the model.
Smart Images

Figure CN119694586A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of blood sugar recognition, and in particular to a non-invasive hypoglycemia recognition method for type 1 diabetes based on an intelligent wearable device. Background Art
[0002] Type 1 diabetes is a type of diabetes in which pancreatic β cells are destroyed by autoimmune diseases, resulting in absolute insulin deficiency. Patients need to rely on exogenous insulin to control blood sugar throughout their lives. This group of people is at high risk of hypoglycemia, which often endangers the health of patients. Therefore, it is of great significance to develop a method that can conveniently, accurately and non-invasively identify the occurrence of hypoglycemia.
[0003] The application of continuous glucose monitoring (CGM) technology can continuously monitor the glucose level in the body and detect hypoglycemia events, and has become a common clinical method. However, it has defects such as non-reusability, high price, and invasiveness, which hinders the blood sugar management of patients with type 1 diabetes. Therefore, the development of personalized non-invasive blood sugar monitoring methods is of great significance to solving the blood sugar monitoring dilemma of patients with type 1 diabetes.
[0004] Although previous studies have attempted to develop non-invasive blood glucose monitoring methods, their accuracy has not yet met the requirements of clinical applications. Current non-invasive blood glucose detection and identification technologies include electrochemical methods, optical methods (near infrared, mid-infrared and far infrared) and metabolic thermal integration methods that have emerged in recent years. However, these methods have problems such as inaccurate blood glucose measurement, skin irritation, long calibration process, long warm-up time, low flexibility, and low safety, such as reverse iontophoresis technology, bioimpedance spectroscopy technology, spectral absorption technology, acoustic spectroscopy technology, Raman spectroscopy technology, etc.
[0005] Blood sugar levels are closely related to a variety of physiological indicators and life activities. Central hypothalamic clock-related genes and their feedback loops form regular biological rhythms through the endocrine and nervous systems. Similar feedback regulation mechanisms suggest that there may be a coupling relationship between blood sugar levels and heart rhythm, heart rate, blood oxygen, body temperature, exercise, and sleep regulation, which lays a physiological theoretical basis for identifying the occurrence of hypoglycemia by monitoring physiological indicators, and opens up new ideas for further exploring non-invasive hypoglycemia identification in patients with type 1 diabetes. Summary of the invention
[0006] The purpose of the present invention is to provide a non-invasive hypoglycemia identification method for type 1 diabetes based on smart wearable devices. The hypoglycemia identification system constructed based on the gradient boosting decision tree solves the problems of CGM being invasive, non-reusable and expensive in blood glucose monitoring; the hypoglycemia identification system includes a training module and a correction module. In the training module, the LightGB M algorithm is used to train the model. After multiple iterations, new decision trees are continuously constructed and prediction values are updated until the prediction error is small enough to achieve accurate identification of hypoglycemia; a dynamic hypoglycemia probability map is drawn according to the predicted probability output by the model, and the overall situation of individual hypoglycemia and intra-day and inter-day variations are analyzed to guide the identification and early warning of hypoglycemia in type 1 diabetes patients in clinical scenarios; the present invention further optimizes the algorithm individually in the correction module according to the real-time feedback of fingertip blood glucose levels to ensure the long-term accuracy of the model in actual application.
[0007] To achieve the above object, the present invention provides a method for non-invasive hypoglycemia identification in type 1 diabetes based on a smart wearable device, comprising the following steps:
[0008] Step S1: Based on the data acquisition and preprocessing module, multi-source physiological indicators and blood glucose data of patients with type 1 diabetes are collected, and feature extraction and classification marking of the collected multi-source physiological indicators and blood glucose data are performed;
[0009] Step S2: In a training module based on the LightGBM algorithm, a classification model is built by using the LightGBM algorithm, and an objective function is constructed according to multi-source physiological indicators of patients with type 1 diabetes;
[0010] Step S3, based on the forward addition principle of the LightGBM algorithm, further simplify the objective function;
[0011] Step S4: Based on the objective function minimization model, combined with leaf node splitting and information gain, find the optimal solution of the objective function to obtain the scoring function and feature partitioning criteria;
[0012] Step S5, in the above iterative process, the LightGBM classification model uses the histogram algorithm, unilateral gradient sampling and mutually exclusive feature bundling methods to speed up training and reduce memory, thereby optimizing training efficiency;
[0013] Step S6: Draw a dynamic hypoglycemia probability map based on the hypoglycemia occurrence probability output by the model, visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, and guide individualized hypoglycemia identification and early warning;
[0014] Step S7: In the actual application process of the model, a correction module is introduced to continuously optimize the algorithm individually according to the feedback of fingertip blood glucose level to ensure the long-term accuracy of the model in the actual application process.
[0015] Preferably, in step S1, based on the data acquisition and preprocessing module, multi-source physiological indicators and blood glucose data of patients with type 1 diabetes are collected, and feature extraction and classification marking are performed on the collected multi-source physiological indicators and blood glucose data. The specific process is as follows:
[0016] Step S11, clean the collected multi-source physiological indicators, delete abnormal values and duplicate values; perform interpolation filling according to the time index, and limit the number of continuous fillings according to the sampling frequency of the physiological indicators; extract features from the data within the time window;
[0017] Step S12: clean the collected blood glucose data and delete abnormal values; perform interpolation and filling according to the time index to obtain the blood glucose value per minute; mark hypoglycemia events as positive labels and normal or high blood glucose as negative labels;
[0018] Step S13: using the multi-source physiological indicator features as the input of the classification model and the classification labels as the output of the classification model; using the data collected continuously for 14 days in the first round as the training set and the data collected continuously for 14 days in the second round as the test set;
[0019] Step S14: Perform RobustScaler standardization on the multi-source physiological index features input in the training set to scale them to a range with 0 as the center and IQR as the width. The standardization process is as follows:
[0020]
[0021] Among them, X train-scaled The data after standardization for the training set; X train is the training set; median is the median; IQR is the interquartile range;
[0022] Subsequently, the same median and IQR were applied to the test set as follows:
[0023]
[0024] Among them, X test-scaled The data after standardization for the test set; X test For the test set.
[0025] Preferably, in step S2, in a training module based on the LightGBM algorithm, a classification model is built by the LightGBM algorithm, and an objective function is constructed according to the multi-source physiological indicators of type 1 diabetes patients after RobustScaler standardization. The specific process is as follows:
[0026] Step S21, the multi-source physiological index characteristics of type 1 diabetes patients after RobustScaler standardization are as follows:
[0027] X={x1,x2,...,x t ,...x N};
[0028] Among them, x t is the multi-source physiological index feature corresponding to the current time t, N is the total number of samples, t = 1, 2, ..., N;
[0029] Step S22: Create a dataset D for the current problem, as shown below:
[0030] D={(x i ,y i )},(|D|=n,x i ∈R m ,y i ∈R);
[0031] Among them, x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; n is the total number of samples in the data set D, R represents the real number set; x i ∈R m Represents x i It includes m physiological index characteristics, namely x i The dimension of y is m; i ∈R represents y i It includes 1 tag type data, namely y i The dimension of is 1;
[0032] Step S23, minimize the loss function of the training set, that is, minimize the empirical risk, as shown below:
[0033]
[0034] Where F is the hypothesis space, which is a complete set of hypotheses for all possible situations that may meet the goal when the attributes and possible values of the attributes are known; x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; L represents the loss; f represents the mapping effect of the model on the sample data, then f(x i ) represents the decision tree for the feature vector x i Map the predicted values obtained;
[0035] Step S24, introduce the regularization coefficient to reduce the complexity of the LightGBM classification model, that is, minimize the structural risk, as shown below:
[0036]
[0037] Among them, λ is the L2 regularization coefficient; J(f) is the complexity of the model;
[0038] Step S25: construct an objective function, i.e., a loss function, and construct an optimal model by minimizing the loss function. The objective function is as follows:
[0039]
[0040] in, is the loss function; is the regularization term.
[0041] Preferably, in step S3, based on the forward addition principle of the LightGBM algorithm, the objective function is further simplified, and the specific process is as follows:
[0042] Step S31, the prediction value of the t-th decision tree for the i-th sample is as follows:
[0043]
[0044] in, represents the predicted value output by the first t-1 decision trees; f t (x i ) represents the predicted value output by the tth decision tree;
[0045] Similarly, split the regularization term Since the structures of the first t-1 trees have been determined, the sum of the complexity of the first t-1 trees can be expressed by a constant, so the objective function is simplified as follows:
[0046]
[0047] Step S32: Use Taylor's formula to convert the loss function into Expanded, the objective function is as follows:
[0048]
[0049] in, is the first-order derivative, is the second-order derivative;
[0050] Step S33: When the tree model is fixed, the loss function value of the first t-1 trees is a fixed constant, so the objective function can be simplified as follows:
[0051]
[0052] Preferably, in step S4, based on the objective function minimization model, combined with leaf node splitting and information gain, the optimal solution of the objective function is found to obtain the scoring function and feature partitioning criterion. The specific process is as follows:
[0053] Step S41: define the complexity of each tree as follows:
[0054]
[0055] Where T is the number of leaf nodes, ||ω|| is the modulus of the leaf node vector, γ is the difficulty of node segmentation, and λ is the L2 regularization coefficient;
[0056] Then the objective function is as follows:
[0057]
[0058] Step S42: define sample x i The prediction results As shown below:
[0059]
[0060] Where F = {f(x) = ω q(X)}(q:R m →T,ω∈R T ), represents the set of decision trees; q represents the tree structure of samples mapped to corresponding leaf nodes, T represents the number of leaf nodes, ω represents the weight of leaf nodes, f(x0=ω q(x) Represents the predicted value of the sample at each leaf node; f k represents the kth decision tree, corresponding to an independent tree structure q and leaf node weight ω, f k (x i ) represents the k-th decision tree for the feature vector x i Map the predicted values obtained;
[0061] Therefore, the objective function is further transformed into:
[0062]
[0063] Step S43: Definition I j ={i|q(x i )=j} is the set of leaf nodes, then the objective function is further transformed into:
[0064]
[0065] Step S44: Then the objective function is simplified to:
[0066]
[0067] Taking the derivative of the above equation and setting it equal to 0, we get Substituting into the above formula, we get the final objective function, also called the scoring function, as shown below:
[0068]
[0069] Step S45: During the model training process, each time a leaf node is split, it is necessary to calculate whether it brings gain to the objective function, that is, information gain Gain, as shown below:
[0070]
[0071] Among them, G L is the sum of the gradients of the left cotyledon, H L is the sum of the second-order derivatives of the left cotyledon, G R is the sum of the gradients of the right cotyledon, H R It is the sum of the second-order derivatives of the right cotyledon; the first part is the score of the new left cotyledon, that is, the objective function of the left cotyledon after the feature splitting of the node; the second part is the score of the new right cotyledon, that is, the objective function of the right cotyledon after the feature splitting of the node; the third part is the score of the original leaf, that is, the objective function of the node before the feature splitting; the fourth part is the regularization coefficient of the newly added leaf; the LightGBM classification model is divided based on the node with the largest Gain.
[0072] Preferably, in step S5, the LightGBM classification model uses a histogram algorithm, unilateral gradient sampling, and mutually exclusive feature bundling methods to speed up training and reduce memory, and optimize training efficiency, specifically including:
[0073] Step S51, applying a histogram algorithm to reduce the number of splitting points;
[0074] Step S52, applying unilateral gradient sampling to reduce the number of samples;
[0075] Step S53: Apply mutually exclusive feature bundling to reduce the number of features.
[0076] Preferably, in step S6, a dynamic hypoglycemia probability map is drawn according to the hypoglycemia occurrence probability output by the model to visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, so as to guide individualized hypoglycemia identification and early warning. The specific process is as follows:
[0077] S61. Apply the classification model built based on the LightGBM algorithm to the test set. The feature vector x in the test set i Mapping to obtain the probability of hypoglycemia y prob , as shown below:
[0078] y prob =f(x i );
[0079] Among them, x i is a feature vector containing time features, f(x i ) represents the decision tree for the feature vector x i Map the predicted values obtained; draw a scatter plot with the probability of hypoglycemia as the ordinate and the time as the abscissa;
[0080] S62, applying UnivariateSpline to perform smooth spline fitting on the scatter plot; UnivariateSpline calls the spline interpolation function to obtain a smooth curve while being as close to the original data as possible;
[0081] The data is fitted by calling the cubic spline function, the objective function is constructed, and a smooth curve is obtained by minimizing the objective function. The objective function is as follows:
[0082]
[0083] Among them, (y i -S(x i )) 2 is the error between the data point and the smooth curve; is the second-order derivative integral of the smoothed curve, which is used to control the smoothness of the curve; λ is the smoothing parameter, which controls the smoothness of the fit. A larger λ will produce a smoother curve, but may deviate from the data points;
[0084] S63. Construct a cubic spline interpolation function. The test set has n+1 data points in total, which can be divided into n intervals [(x0,x1),(x1,x2),…,(x n-1 ,x n )], where x0 = a, x n =b, cubic spline interpolation must meet the following conditions:
[0085] (1) In each segment interval (x i-1 ,x i ), interpolation function S i (x) is always a cubic polynomial;
[0086] (2) Satisfy the interpolation condition, that is, S(x i )=y i , i=0,1,…,n;
[0087] (3) The curve is smooth, that is, S(x), S”(x), and S'(x) are continuous;
[0088] S64, deriving a cubic spline interpolation function in each interval according to the function condition;
[0089] According to condition (1), let the interval (x i-1 ,x i ) is as follows:
[0090] S i (x) = a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3 ;
[0091] According to condition (2), the left endpoint of each segment of the function is equal to its function value, as shown below:
[0092] S i (x i )=a i +b i (x i -x i )+c i (x i -x i 0 2 +d i (x i -x i 0 3 ;
[0093] but
[0094] a i =y i ;
[0095] According to condition (2), the right endpoint of each segment of the function is equal to its function value, as shown below:
[0096] S i (x i+1 )=a i +b i (x i+1 -x i )+c i (x i+1 -x i ) 2 +d i (x i+1 -x i ) 3 ;
[0097] Let h i =xi+1 -x i ,but
[0098] a i +b i h i +c i h i 2 +d i h i 3 =y i+1 ;
[0099] According to condition (3), except for the first and last endpoints, the left and right first-order derivatives of the middle n-1 endpoints are equal, that is, S' i (x i+1 )=S' i+1 (x i+1 ), we can get:
[0100] b i +2c i (x i+1 -x i )+3d i (x i+1 -x i ) 2
[0101] =b i+1 +2c i+1 (x i+1 -x i+1 )+3d i+1 (x i+1 -x i+1 ) 2 ;
[0102] Substitute h i =x i+1 -x i ,but
[0103] b i +2c i h i +3d i h i 2 =b i+1 ;
[0104] According to condition (3), except for the first and last endpoints, the left and right second-order derivatives of the middle n-1 endpoints are equal, that is, S" i (x i+1 )=S” i+1 (x i+1 ), we can get:
[0105] 2c i +6di (x i+1 -x i )=2c i+1 +6d i+1 (x i+1 -x i+1 );
[0106] Substitute h i =x i+1 -x i ,but
[0107] 2c i +6d i h i =2c i+1 ;
[0108] "Order S" i (x i )=m i , then according to S” i (x i )=2c i +6d i (x i -x i ), we can get:
[0109]
[0110] S64, cubic spline interpolation function under natural boundary conditions, S"0(x0) = m0 = 0, S" n (x n )=m n =0, the m of each interval can be solved according to the following matrix i , that is, S" i (x i ):
[0111]
[0112] Thus, the cubic spline interpolation function of each interval is solved. i ,b i ,c i ,d i , and get the interval (x i-1 ,x i ) in the interpolation function S i (x);
[0113] Based on the interpolation function S i (x), by minimizing the objective function to smoothly fit the scatter plot of hypoglycemia probability, a dynamic hypoglycemia probability map is obtained.
[0114] Preferably, in step S7, during the actual application of the model, a correction module is introduced to continuously optimize the algorithm individually according to the feedback of fingertip blood glucose level, so as to ensure the long-term accuracy of the model during the actual application. The specific process is as follows:
[0115] Step S71: In actual application, the patient measures the fingertip blood to obtain the real blood sugar level, and feeds it back to the correction module. The feedback of the i-th sample is defined as follows:
[0116]
[0117] in, The blood glucose level of the i-th patient sample is identified by the model, y i The actual blood sugar level obtained by the patient's finger blood test at the same moment;
[0118] Step S72: After receiving the feedback, the correction module adjusts the weight of the i-th sample based on the feedback, as shown below:
[0119]
[0120] Among them, α is a constant greater than 1, which is used to amplify the weight of misclassified samples;
[0121] Step S73: adjust the sample weight ω adjusted by the correction module i Reapply it to the training module to obtain the new objective function as follows:
[0122]
[0123] The simplification of the objective function and the search for the optimal solution are the same as steps S3-S5, and a new optimal model is obtained by minimizing the new objective function.
[0124] Therefore, the present invention adopts the above-mentioned non-invasive hypoglycemia identification method for type 1 diabetes based on smart wearable devices, and the beneficial effects are as follows:
[0125] (1) A hypoglycemia recognition and classification system is built based on gradient boosting decision trees. By combining multiple decision trees into a powerful model, a LightGBM algorithm based on multi-source physiological indicators is constructed to learn and integrate the characteristics of hypoglycemia in multi-source physiological indicators, thereby constructing a non-invasive and personalized hypoglycemia recognition model, solving the problems of CGM in blood glucose monitoring, which is invasive, non-reusable and expensive.
[0126] (2) Based on the training module of the LightGBM algorithm, the processed feature data is trained using the LightGBM algorithm. After multiple iterations, new decision trees are continuously constructed and prediction values are updated until the prediction error is small enough to achieve accurate prediction of blood glucose.
[0127] (3) Draw dynamic hypoglycemia probability maps for different individuals to visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, and guide individualized hypoglycemia prevention and identification;
[0128] (4) In the actual application of the model, a correction module is introduced to optimize the algorithm in real time according to the actual blood glucose level feedback to ensure the long-term accuracy of the model.
[0129] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] Figure 1 This is a flow chart of the method for non-invasive hypoglycemia identification for type 1 diabetes based on smart wearable devices of the present invention;
[0131] Figure 2 : is the ROC curve of 6 subjects in the embodiment of the present invention;
[0132] Figure 3 The visualization results of the confusion matrix of 6 subjects in the embodiment of the present invention are shown;
[0133] Figure 4 A visual explanation of the contribution of multi-source physiological indicators of subject ID006 to the predicted outcome in an embodiment of the present invention;
[0134] Figure 5 This is a dynamic hypoglycemia probability map of subject ID006 in an embodiment of the present invention. DETAILED DESCRIPTION
[0135] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0136] The intelligent wearable device of the present invention is composed of a data acquisition module, a data preprocessing module, a training module based on the LightGBM algorithm, and a correction module.
[0137] like Figure 1 As shown, the present invention provides a non-invasive hypoglycemia identification method for type 1 diabetes based on a smart wearable device, comprising the following steps:
[0138] Step S1: Based on the data collection and preprocessing module, multi-source physiological indicators and blood glucose data of patients with type 1 diabetes are collected, and feature extraction and classification marking are performed on the collected multi-source physiological indicators and blood glucose data.
[0139] Step S11, clean the data of the multi-source physiological indicators that have been collected, delete abnormal values and duplicate values; perform interpolation filling according to the time index, and limit the number of continuous fillings by the sampling frequency of the physiological indicators; extract features of the data within the time window, set the time window to 5 minutes for RRI frequency domain analysis, and set the time window to 1 minute for other physiological indicators, as shown in Table 1.
[0140] Table 1. Extracted multi-source physiological index features
[0141]
[0142] Step S12: clean the collected blood glucose data and delete abnormal values; perform interpolation and filling according to the time index to obtain the blood glucose value per minute; mark hypoglycemia events as positive labels and normal or high blood glucose as negative labels;
[0143] Step S13: using the multi-source physiological indicator features as the input of the classification model and the classification labels as the output of the classification model; using the data collected continuously for 14 days in the first round as the training set and the data collected continuously for 14 days in the second round as the test set;
[0144] Step S14: Perform Robust Scaler standardization processing on the multi-source physiological index features input in the training set to scale them to a range with 0 as the center and IQR as the width. The standardization processing is as follows:
[0145]
[0146] Among them, X train-scaled The data after standardization for the training set; X train is the training set; median is the median; IQR is the interquartile range.
[0147] Subsequently, the same median and IQR were applied to the test set as follows:
[0148]
[0149] Among them, X test-scaled The data after standardization for the test set; X test For the test set.
[0150] Step S2: In the training module based on the LightGBM algorithm, a classification model is built using the LightGBM algorithm, and an objective function is constructed based on the multi-source physiological indicators of type 1 diabetes patients after RobustScaler standardization.
[0151] Step S21, the multi-source physiological index characteristics of type 1 diabetes patients after RobustScaler standardization are as follows:
[0152] X={x1,x2,...,x t ,...x N};
[0153] Among them, x t is the multi-source physiological index feature corresponding to the current time t, N is the total number of samples, t=1, 2, ..., N.
[0154] Step S22: Create a dataset D for the current problem, as shown below:
[0155] D={(x i ,y i )},(|D|=n,x i ∈R m ,y i ∈R);
[0156] Among them, x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; n is the total number of samples in the data set D, R represents the real number set; x i ∈R m Represents x i It includes m physiological index characteristics, namely x i The dimension of y is m; i ∈R represents y i It includes 1 tag type data, namely y i The dimension of is 1.
[0157] Step S23, minimize the loss function of the training set, that is, minimize the empirical risk, as shown below:
[0158]
[0159] Where F is the hypothesis space, which is a complete set of hypotheses for all possible situations that may meet the goal when the attributes and possible values of the attributes are known; x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; L represents the loss; f represents the mapping effect of the model on the sample data, then f(x i ) represents the decision tree for the feature vector x i Map the predicted values.
[0160] Step S24, introduce the regularization coefficient to reduce the complexity of the LightGBM classification model, that is, minimize the structural risk, as shown below:
[0161]
[0162] Among them, λ is the L2 regularization coefficient; J(f) is the complexity of the model.
[0163] Step S25: construct an objective function, i.e., a loss function, and construct an optimal model by minimizing the loss function. The objective function is as follows:
[0164]
[0165] in, is the loss function; is the regularization term.
[0166] Step S3: Combined with the above problem model, based on the forward addition principle of the LightGBM algorithm, the objective function is further simplified.
[0167] Step S31, the prediction value of the t-th decision tree for the i-th sample is as follows:
[0168]
[0169] in, represents the predicted value output by the first t-1 decision trees; f t (x i ) represents the predicted value output by the tth decision tree.
[0170] Similarly, split the regularization term Since the structures of the first t-1 trees have been determined, the sum of the complexity of the first t-1 trees can be expressed by a constant, so the objective function is simplified as follows:
[0171]
[0172] Step S32: Use Taylor's formula to calculate the loss function Expanded, the objective function is as follows:
[0173]
[0174] in, is the first-order derivative, is the second-order derivative.
[0175] Step S33: When the tree model is fixed, the loss function value of the first t-1 trees is a fixed constant, so the objective function can be simplified as follows:
[0176]
[0177] Step S4: Based on the objective function minimization model, combined with leaf node splitting and information gain, find the optimal solution of the objective function to obtain the scoring function and feature partitioning criteria.
[0178] Step S41: define the complexity of each tree as follows:
[0179]
[0180] Among them, T is the number of leaf nodes, ||ω|| is the modulus of the leaf node vector, γ is the difficulty of node segmentation, and λ is the L2 regularization coefficient;
[0181] Then the objective function is as follows:
[0182]
[0183] Step S42: define sample x i The prediction results As shown below:
[0184]
[0185] Where F = {f(x) = ω q(X)}(q:R m →T,ω∈R T ), represents the set of decision trees; q represents the tree structure of samples mapped to corresponding leaf nodes, T represents the number of leaf nodes, ω represents the weight of leaf nodes, f(x)=ω q(x) Represents the predicted value of the sample at each leaf node; f k represents the kth decision tree, corresponding to an independent tree structure q and leaf node weight ω, f k (x i ) represents the k-th decision tree for the feature vector x i Map the predicted values.
[0186] Therefore, the objective function is further transformed into:
[0187]
[0188] Step S43: Definition I j ={i|q(x i )=j} is the set of leaf nodes, then the objective function is further transformed into:
[0189]
[0190] Step S44: Then the objective function is simplified to:
[0191]
[0192] Taking the derivative of the above equation and setting it equal to 0, we get Substituting into the above formula, we get the final objective function, also called the scoring function, as shown below:
[0193]
[0194] Step S45: During the model training process, each time a leaf node is split, it is necessary to calculate whether it brings gain to the objective function, that is, information gain Gain, as shown below:
[0195]
[0196] Among them, G L is the sum of the gradients of the left cotyledon, H L is the sum of the second-order derivatives of the left cotyledon, G R is the sum of the gradients of the right cotyledon, H R It is the sum of the second-order derivatives of the right cotyledon. The first part is the score of the new left cotyledon, that is, the objective function of the left cotyledon after the node performs feature splitting; the second part is the score of the new right cotyledon, that is, the objective function of the right cotyledon after the node performs feature splitting; the third part is the score of the original leaf, that is, the objective function of the node before feature splitting; the fourth part is the regularization coefficient of the newly added leaf. The LightGBM classification model is divided based on the node with the largest Gain.
[0197] Step S5. In the above iterative process, the LightGBM classification model uses histogram algorithm, unilateral gradient sampling and mutually exclusive feature bundling methods to speed up training and reduce memory, thereby optimizing training efficiency.
[0198] Step S51, apply the histogram algorithm to reduce the number of splitting points: first, discretize the continuous floating-point eigenvalues into k integers, and construct a histogram with a width of k; then, when traversing the data, accumulate statistics in the histogram based on the discretized values as indexes. After traversing the data once, the histogram accumulates the required statistics; finally, traverse and find the optimal splitting point based on the discrete values of the histogram.
[0199] Step S52, applying unilateral gradient sampling to reduce the number of samples: Samples with different gradients play different roles in calculating the score of the tree structure. Samples with large gradients contribute more to the score, and samples with small gradients have smaller training errors. The unilateral gradient sampling method only samples samples with gradients less than a certain threshold, retaining samples with larger gradients, thereby reducing the number of samples.
[0200] Step S53, apply mutually exclusive feature bundling to reduce the number of features: high-dimensional features are often sparse. In a sparse feature space, many features are mutually exclusive. Re-encoding and bundling the values of these features into a new feature reduces the number of features for constructing the histogram, thereby reducing the computational complexity.
[0201] Step S6: Draw a dynamic hypoglycemia probability map based on the hypoglycemia occurrence probability output by the model to visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, so as to guide individualized hypoglycemia identification and early warning.
[0202] S61. Apply the classification model built based on the LightGBM algorithm to the test set. The feature vector x in the test set i Mapping to obtain the probability of hypoglycemia y prob , as shown below:
[0203] y prob =f(x i );
[0204] Among them, x i is a feature vector containing time features, f(x i ) represents the decision tree for the feature vector x i Map the obtained predicted values; draw a scatter plot with the probability of hypoglycemia as the ordinate and the time ("HH:MM") as the abscissa.
[0205] S62. Apply UnivariateSpline to fit the scatter plot with a smooth spline. UnivariateSpline uses the spline interpolation function to obtain a smooth curve while being as close to the original data as possible.
[0206] The data is fitted by calling the cubic spline function, the objective function is constructed, and a smooth curve is obtained by minimizing the objective function. The objective function is as follows:
[0207]
[0208] Among them, (y i -S(x i )) 2 is the error between the data point and the smooth curve; is the second-order derivative integral of the smoothed curve, which is used to control the smoothness of the curve; λ is the smoothing parameter, which controls the smoothness of the fit. A larger λ will produce a smoother curve, but may deviate from the data points.
[0209] S63. Construct a cubic spline interpolation function. The test set has n+1 data points in total, which can be divided into n intervals [(x0,x1),(x1,x2),…,(x n-1,x n )], where x0 = a, x n =b, cubic spline interpolation must meet the following conditions:
[0210] (1) In each segment interval (x i-1 ,x i ), interpolation function S i (x) is always a cubic polynomial;
[0211] (2) Satisfy the interpolation condition, that is, S(x i )=y i , i=0,1,…,n;
[0212] (3) The curve is smooth, that is, S(x), S'(x), and S”(x) are continuous.
[0213] S63. Derive the cubic spline interpolation function in each interval according to the function condition.
[0214] According to condition (1), let the interval (x i-1 ,x i ) is as follows:
[0215] S i (x) = a i +b i (xx i )+c i (xx i ) 2 +d i (xx i ) 3 ;
[0216] According to condition (2), the left endpoint of each segment of the function is equal to its function value, as shown below:
[0217] S i (x i )=a i +b i (x i -x i )+c i (x i -x i ) 2 +d i (x i -x i ) 3 ;
[0218] but
[0219] a i =y i ;
[0220] According to condition (2), the right endpoint of each segment of the function is equal to its function value, as shown below:
[0221] S i (x i+1 )=a i +b i (x i+1 -x i )+c i (x i+1 -x i ) 2 +d i (x i+1 -x i ) 3 ;
[0222] Let h i =x i+1 -x i ,but
[0223] a i +b i h i +c i h i 2 +d i h i 3 =y i+1 ;
[0224] According to condition (3), except for the first and last endpoints, the left and right first-order derivatives of the middle n-1 endpoints are equal, that is, S' i (x i+1 )=S' i+1 (x i+1 ), we can get:
[0225] b i +2c i (x i+1 -x i )+3d i (x i+1 -x i ) 2 =b i+1 +2c i+1 (x i+1 -x i+1 )+3d i+1 (x i+1 -x i+1 ) 2 ;
[0226] Substitute h i =x i+1 -x i ,but
[0227] b i +2c i h i +3d i h i 2 =b i+1 ;
[0228] According to condition (3), except for the first and last endpoints, the left and right second-order derivatives of the middle n-1 endpoints are equal, that is, S" i (x i+1 )=S” i+1 (x i+1 ), we can get:
[0229] 2c i +6d i (x i+1 -x i )=2c i+1 +6d i+1 (x i+1 -x i+1 );
[0230] Substitute h i =x i+1 -x i ,but
[0231] 2c i +6d i h i =2c i+1 ;
[0232] "Order S" i (x i )=m i , then according to S” i (x i )=2c i +6d i (x i -x i ), we can get:
[0233]
[0234] S64, cubic spline interpolation function under natural boundary conditions, S"0(x0a) = m0 = 0, S" n n(x n )=m n =0, the m of each interval can be solved according to the following matrix i , that is, S" i (x i ):
[0235]
[0236] Thus, the cubic spline interpolation function of each interval is solved. i ,b i ,c i ,d i , and get the interval (x i-1 ,x i ) in the interpolation function S i (x);
[0237] Based on the interpolation function S i (x), by minimizing the objective function to smoothly fit the scatter plot of hypoglycemia probability, a dynamic hypoglycemia probability map is obtained.
[0238] Step S7: In the actual application process of the model, a correction module is introduced to continuously optimize the algorithm individually according to the feedback of fingertip blood glucose level to ensure the long-term accuracy of the model in the actual application process.
[0239] Step S71: In actual application, the patient can measure the fingertip blood to obtain the real blood sugar level and feed it back to the correction module. The feedback of the i-th sample is defined as follows:
[0240]
[0241] in, The blood glucose level of the i-th patient sample is identified by the model, y i It is the actual blood sugar level obtained by the patient's self-measurement of blood at the same moment.
[0242] Step S72: After receiving the feedback, the correction module adjusts the weight of the i-th sample based on the feedback, as shown below:
[0243]
[0244] Among them, α is a constant greater than 1, which is used to amplify the weight of misclassified samples.
[0245] Step S73: adjust the sample weight ω adjusted by the correction module i Reapply it to the training module to obtain the new objective function as follows:
[0246]
[0247] The simplification of the objective function and the search for the optimal solution are the same as steps S3-S5, and a new optimal model is obtained by minimizing the new objective function.
[0248] Example
[0249] Based on the data acquisition module, the data used in this embodiment comes from patients who visited the outpatient department of a university people's hospital. Each patient wears a smart bracelet (Huawei Watch D) and CGM (Silicon Dynamic) under the guidance of an outpatient doctor in the endocrinology department, and downloads the corresponding software to upload physiological indicator data and blood sugar data. After wearing it for 14 consecutive days, the CGM fails, and the patient returns to the hospital, wears the smart bracelet and CGM again, and repeats the previous round of operations. A total of 28 days of continuous data are collected from each patient.
[0250] Multi-source physiological indicator data is sampled by the smart bracelet. The device uses sensors to measure the wearer's heart rate, RR-interval (RRI), blood oxygen, body temperature, sleep, and exercise data. Blood glucose data is sampled by the CGM device. The device uses subcutaneous electrodes to measure the wearer's blood glucose concentration through glucose oxidase and works at a sampling frequency of once every 5 minutes for 14 days.
[0251] Based on the data preprocessing module, the collected multi-source physiological indicators are cleaned up to delete abnormal values and duplicate values; interpolation filling is performed according to the time index, and the number of continuous fillings is limited by the sampling frequency of the physiological indicators; feature extraction is performed on the data within the time window, and the time window is set to 5 minutes for RRI frequency domain analysis, and the time window is set to 1 minute for other physiological indicators, as shown in Table 2.
[0252] Table 2 Extracted physiological index characteristics
[0253]
[0254] The collected blood glucose data are interpolated and filled according to the time index to obtain the blood glucose value every minute. Blood glucose <3.9mmol / L and lasting ≥15 minutes is marked as hypoglycemia and mapped to 1 in the classification label; the rest of the blood glucose levels are marked as normal / hyperglycemia and mapped to 0 in the classification label.
[0255] Each subject has about 720 sets of daily data since they started wearing CGM and smart bracelets, for a total of about 20,160 sets of data. The above data sets are divided, using the first round of 14 days of continuous data collection as the training set, and the second round of 14 days of continuous data collection as the test set.
[0256] After deleting samples with missing features, the multi-source physiological indicator features input in the training set were normalized by RobustScaler to scale them to a range centered at 0 and with an IQR as the width, and the same normalization parameters were applied to the test set.
[0257] In the training module based on the LightGBM algorithm, the LightGBM classification algorithm is used for training on the training set. During the training process, LightGBM uses the gradient boosting algorithm to minimize the loss function and uses regularization techniques to prevent overfitting.
[0258] Use the trained model for the test set. At the beginning of the iteration, LightGBM uses the mode of the training data as the initial prediction value; in each iteration, LightGBM builds a new decision tree, which fits the residual of the prediction results of all previous trees and the true value of the training sample in a greedy manner. Each time a new decision tree is added, LightGB M will update the prediction value of each training sample. The new prediction value is the original prediction value plus the prediction result of the new tree; LightGBM will repeatedly build decision trees and update prediction values until the prediction error is small enough. In the above iterative process, the LightGBM classification model uses histogram algorithm, unilateral gradient sampling and mutually exclusive feature bundling to speed up training and reduce memory, thereby optimizing training efficiency.
[0259] After training, the trained LightGBM classification model is used to predict the test set, and the predicted result is the blood glucose level category to which each sample belongs. The ROC curve and confusion matrix are used to evaluate the performance of the model; the SHAP diagram is used to explain the contribution of multi-source physiological indicator characteristics to the predicted outcome. A dynamic hypoglycemia probability map is drawn based on the probability of hypoglycemia output by the model to visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, guiding individualized hypoglycemia prevention and identification.
[0260] In the actual application of the model, a correction module is introduced. Patients can feed back the measured blood glucose level of their fingertip blood to the model. The correction module optimizes the algorithm in real time based on the actual value and the model's predicted value to ensure the long-term accuracy of the model.
[0261] like Figure 2 and Figure 3 As shown in the figure, individualized hypoglycemia recognition models were constructed for 6 subjects, and the trained models were applied to the test set, and the AUCs of the test set were 79.8%, 83.5%, 76.1%, 77.8%, 78.9%, and 85.0%, respectively, with an average AUC of 80.2%. The ROC curve and confusion matrix were plotted to visualize the prediction results of the test set, the SHAP graph was plotted to visualize the contribution of features to the predicted outcomes, and the dynamic hypoglycemia probability map was plotted to visualize the overall situation of individual hypoglycemia and intra-day and inter-day variations.
[0262] Take subject ID006 as an example. Figure 4As shown in the figure, red represents a large contribution of the feature to the outcome, while blue represents the opposite; SHAP value > 0 represents that the feature has a positive effect on the outcome of hypoglycemia, and SHAP value < 0 represents that the feature has a negative effect on the outcome of hypoglycemia. Figure 5 As shown, the horizontal axis is time and the vertical axis is the predicted probability of hypoglycemia.
[0263] Experiments have proved that the non-invasive blood glucose identification method proposed in the present invention builds a model based on the LightGBM algorithm, which realizes the binary classification of normal / high blood glucose and hypoglycemia events, thereby achieving a higher accuracy in the non-invasive and individualized identification and early warning of hypoglycemia events in people with type 1 diabetes.
[0264] Therefore, the present invention adopts the above-mentioned non-invasive hypoglycemia identification method for type 1 diabetes based on smart wearable devices, and a hypoglycemia identification and classification system constructed based on a gradient boosting decision tree, which solves the problems of CGM being invasive, non-reusable and expensive in blood glucose monitoring; the LightGBM algorithm is used to train the model, and after multiple iterations, new decision trees are continuously constructed and prediction values are updated until the prediction error is small enough to achieve accurate identification of hypoglycemia.
[0265] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A non-invasive hypoglycemia identification method for type 1 diabetes based on smart wearable devices, characterized in that: The following steps are involved: Step S1: Based on the data acquisition and preprocessing module, multi-source physiological indicators and blood glucose data of patients with type 1 diabetes are collected, and feature extraction and classification marking of the collected multi-source physiological indicators and blood glucose data are performed; Step S2: In a training module based on the LightGBM algorithm, a classification model is built by using the LightGBM algorithm, and an objective function is constructed according to multi-source physiological indicators of patients with type 1 diabetes; Step S3, based on the forward addition principle of the LightGBM algorithm, further simplify the objective function; Step S4: Based on the objective function minimization model, combined with leaf node splitting and information gain, find the optimal solution of the objective function to obtain the scoring function and feature partitioning criteria; Step S5, in the above iterative process, the LightGBM classification model uses the histogram algorithm, unilateral gradient sampling and mutually exclusive feature bundling methods to speed up training and reduce memory, thereby optimizing training efficiency; Step S6: Draw a dynamic hypoglycemia probability map based on the hypoglycemia occurrence probability output by the model, visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, and guide individualized hypoglycemia identification and early warning; Step S7: In the actual application process of the model, a correction module is introduced to continuously optimize the algorithm individually according to the feedback of fingertip blood glucose level to ensure the long-term accuracy of the model in the actual application process.
2. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S1, based on the data acquisition and preprocessing module, multi-source physiological indicators and blood glucose data of patients with type 1 diabetes are collected, and feature extraction and classification marking are performed on the collected multi-source physiological indicators and blood glucose data. The specific process is as follows: Step S11, clean the collected multi-source physiological indicators, delete abnormal values and duplicate values; perform interpolation filling according to the time index, and limit the number of continuous fillings according to the sampling frequency of the physiological indicators; extract features from the data within the time window; Step S12: clean the collected blood glucose data and delete abnormal values; perform interpolation and filling according to the time index to obtain the blood glucose value per minute; mark hypoglycemia events as positive labels and normal or high blood glucose as negative labels; Step S13: using the multi-source physiological indicator features as the input of the classification model and the classification labels as the output of the classification model; using the data collected continuously for 14 days in the first round as the training set and the data collected continuously for 14 days in the second round as the test set; Step S14: Perform RobustScaler standardization on the multi-source physiological index features input in the training set to scale them to a range with 0 as the center and IQR as the width. The standardization process is as follows: Among them, X train-scaled The data after standardization for the training set; X train is the training set; median is the median; IQR is the interquartile range; Subsequently, the same median and IQR were applied to the test set as follows: Among them, X test-scaled The data after standardization for the test set; X test For the test set.
3. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S2, in the training module based on the LightGBM algorithm, a classification model is built by the LightGBM algorithm, and an objective function is constructed according to the multi-source physiological indicators of type 1 diabetes patients after RobustScaler standardization. The specific process is as follows: Step S21, the multi-source physiological index characteristics of type 1 diabetes patients after RobustScaler standardization are as follows: X={x1,x2,…,x t ,…x N }; Among them, x t is the multi-source physiological index feature corresponding to the current time t, N is the total number of samples, t = 1, 2, ..., N; Step S22: Create a dataset D for the current problem, as shown below: D={(x i ,y i )},(|D|=n,x i ∈R m ,y i ∈R); Among them, x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; n is the total number of samples in the data set D, R represents the real number set; x i ∈R m Represents x i It includes m physiological index characteristics, namely x i The dimension of y is m; i ∈R represents y i It includes 1 tag type data, namely y i The dimension of is 1; Step S23, minimize the loss function of the training set, that is, minimize the empirical risk, as shown below: Where F is the hypothesis space, which is a complete set of hypotheses for all possible situations that may meet the goal when the attributes and possible values of the attributes are known; x i represents the i-th sample in the total number of samples N, y i represents the category label of the i-th sample; L represents the loss; f represents the mapping effect of the model on the sample data, then f(x i ) represents the decision tree for the feature vector x i Map the predicted values obtained; Step S24, introduce the regularization coefficient to reduce the complexity of the LightGBM classification model, that is, minimize the structural risk, as shown below: Among them, λ is the L2 regularization coefficient; J(f) is the complexity of the model; Step S25: construct an objective function, i.e., a loss function, and construct an optimal model by minimizing the loss function. The objective function is as follows: in, is the loss function; is the regularization term.
4. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S3, based on the forward addition principle of the LightGBM algorithm, the objective function is further simplified. The specific process is as follows: Step S31, the prediction value of the t-th decision tree for the i-th sample is as follows: in, represents the predicted value output by the first t-1 decision trees; f t (x i ) represents the predicted value output by the tth decision tree; Similarly, split the regularization term Since the structures of the first t-1 trees have been determined, the sum of the complexity of the first t-1 trees can be expressed by a constant, so the objective function is simplified as follows: Step S32: Use Taylor's formula to convert the loss function into Expanded, the objective function is as follows: in, is the first-order derivative, is the second-order derivative; Step S33: When the tree model is fixed, the loss function value of the first t-1 trees is a fixed constant, so the objective function can be simplified as follows:
5. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable device according to claim 1, characterized in that: In step S4, based on the objective function minimization model, combined with leaf node splitting and information gain, the optimal solution of the objective function is found to obtain the scoring function and feature partitioning criteria. The specific process is as follows: Step S41: define the complexity of each tree as follows: Where T is the number of leaf nodes, ||ω|| is the modulus of the leaf node vector, γ is the difficulty of node segmentation, and λ is the L2 regularization coefficient; Then the objective function is as follows: Step S42: define sample x i The prediction results As shown below: Where F = {f(x) = ω q(X) }(q:R m →T,ω∈R T ), represents the set of decision trees; q represents the tree structure of samples mapped to corresponding leaf nodes, T represents the number of leaf nodes, ω represents the weight of leaf nodes, f(x)=ω q(x) Represents the predicted value of the sample at each leaf node; f k represents the kth decision tree, corresponding to an independent tree structure q and leaf node weight ω, f k (x i ) represents the k-th decision tree for the feature vector x i Map the predicted values obtained; Therefore, the objective function is further transformed into: Step S43: Definition I j ={i|q(x i )=j} is the set of leaf nodes, then the objective function is further transformed into: Step S44: Then the objective function is simplified to: Taking the derivative of the above equation and setting it equal to 0, we get Substituting into the above formula, we get the final objective function, also called the scoring function, as shown below: Step S45: During the model training process, each time a leaf node is split, it is necessary to calculate whether it brings gain to the objective function, that is, information gain Gain, as shown below: Among them, G L is the sum of the gradients of the left cotyledon, H L is the sum of the second-order derivatives of the left cotyledon, G R is the sum of the gradients of the right cotyledon, H R It is the sum of the second-order derivatives of the right cotyledon; the first part is the score of the new left cotyledon, that is, the objective function of the left cotyledon after the feature splitting of the node; the second part is the score of the new right cotyledon, that is, the objective function of the right cotyledon after the feature splitting of the node; the third part is the score of the original leaf, that is, the objective function of the node before the feature splitting; the fourth part is the regularization coefficient of the newly added leaf; the LightGBM classification model is divided based on the node with the largest Gain.
6. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S5, the LightGBM classification model uses the histogram algorithm, unilateral gradient sampling and mutually exclusive feature bundling methods to speed up training and reduce memory, and optimize training efficiency, including: Step S51, applying a histogram algorithm to reduce the number of splitting points; Step S52, applying unilateral gradient sampling to reduce the number of samples; Step S53: Apply mutually exclusive feature bundling to reduce the number of features.
7. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S6, a dynamic hypoglycemia probability map is drawn based on the hypoglycemia occurrence probability output by the model to visualize the overall situation of hypoglycemia events in patients with type 1 diabetes and their intra-day and inter-day variations, so as to guide individualized hypoglycemia identification and early warning. The specific process is as follows: S61. Apply the classification model built based on the LightGBM algorithm to the test set. The feature vector x in the test set i Mapping to obtain the probability of hypoglycemia y prob , as shown below: y prob =f(x i ); Among them, x i is a feature vector containing time features, f(x i ) represents the decision tree for the feature vector x i Map the predicted values obtained; draw a scatter plot with the probability of hypoglycemia as the ordinate and the time as the abscissa; S62, applying UnivariateSpline to perform smooth spline fitting on the scatter plot; UnivariateSpline calls the spline interpolation function to obtain a smooth curve while being as close to the original data as possible; The data is fitted by calling the cubic spline function, the objective function is constructed, and a smooth curve is obtained by minimizing the objective function. The objective function is as follows: Among them, (y i -S(x i )) 2 is the error between the data point and the smooth curve; is the second-order derivative integral of the smoothed curve, which is used to control the smoothness of the curve; λ is the smoothing parameter, which controls the smoothness of the fit. A larger λ will produce a smoother curve, but may deviate from the data points; S63. Construct a cubic spline interpolation function. The test set has n+1 data points in total, which can be divided into n intervals [(x0,x1),(x1,x2),…,(x n-1 ,x n )], where x0 = a, x n =b, cubic spline interpolation must meet the following conditions: (1) In each segment interval (x i-1 ,x i ), interpolation function S i (x) is always a cubic polynomial; (2) The interpolation condition is satisfied, that is, S(x i )=y i , i=0,1,…,n; (3) The curve is smooth, that is, S(x), S”(x), and S'(x) are continuous; S64, deriving a cubic spline interpolation function in each interval according to the function condition; According to condition (1), let the interval (x i-1 ,x i ) is as follows: S i (x)=a i +b i (x-x i )+c i (x-x i ) 2 +d i (x-x i ) 3 ; According to condition (2), the left endpoint of each segment of the function is equal to its function value, as shown below: S i (x i )=a i +b i (x i -x i )+c i (x i -x i 0 2 +d i (x i -x i 0 3 ; but to i =and i ; According to condition (2), the right endpoint of each segment of the function is equal to its function value, as shown below: S i (x i+1 )=a i +b i (x i+1 -x i )+c i (x i+1 -x i ) 2 +d i (x i+1 -x i ) 3 ; Let h i =x i+1 -x i ,but a i +b i h i +c i h i 2 +d i h i 3 =y i+1 ; According to condition (3), except for the first and last endpoints, the left and right first-order derivatives of the middle n-1 endpoints are equal, that is, S' i (x i+1 )=S' i+1 (x i+1 ), we can get: b i +2c i (x i+1 -x i )+3d i (x i+1 -x i ) 2 =b i+1 +2c i+1 (x i+1 -x i+1 )+3d i+1 (x i+1 -x i+1 ) 2 ; Substitute h i =x i+1 -x i ,but b i +2c i h i +3d i h i 2 =b i+1 ; According to condition (3), except for the first and last endpoints, the left and right second-order derivatives of the middle n-1 endpoints are equal, that is, S" i (x i+1 )=S” i+1 (x i+1 ), we can get: 2c i +6d i (x i+1 -x i )=2c i+1 +6d i+1 (x i+1 -x i+1 ); Substitute h i =x i+1 -x i ,but 2c i +6d i h i =2c i+1 ; Order S" i (x i )=m i , then according to S” i (x i )=2c i +6d i (x i -x i ), we can get: S64, cubic spline interpolation function under natural boundary conditions, S"0(x0) = m0 = 0, S" n (x n )=m n =0, the m of each interval can be solved according to the following matrix i , that is, S" i (x i ): Thus, the cubic spline interpolation function of each interval is solved. i ,b i ,c i ,d i , and get the interval (x i-1 ,x i ) in the interpolation function S i (x); Based on the interpolation function S i (x), by minimizing the objective function to smoothly fit the scatter plot of hypoglycemia probability, a dynamic hypoglycemia probability map is obtained.
8. The method for non-invasive hypoglycemia identification in type 1 diabetes based on smart wearable devices according to claim 1, characterized in that: In step S7, in the actual application process of the model, a correction module is introduced to continuously optimize the algorithm individually according to the feedback of fingertip blood glucose level to ensure the long-term accuracy of the model in the actual application process. The specific process is as follows: Step S71: In actual application, the patient measures the fingertip blood to obtain the real blood sugar level, and feeds it back to the correction module. The feedback of the i-th sample is defined as follows: in, The blood glucose level of the i-th patient sample is identified by the model, y i The actual blood sugar level obtained by the patient's finger blood test at the same moment; Step S72: After receiving the feedback, the correction module adjusts the weight of the i-th sample based on the feedback, as shown below: Among them, α is a constant greater than 1, which is used to amplify the weight of misclassified samples; Step S73: adjust the sample weight ω adjusted by the correction module i Reapply it to the training module to obtain the new objective function as follows: The simplification of the objective function and the search for the optimal solution are the same as steps S3-S5, and a new optimal model is obtained by minimizing the new objective function.
Citation Information
Cited By
User health state management method and system based on intelligent wearable device
CN120304819A