A non-invasive method for predicting blood glucose concentration

By proposing deep triggea residual support vector regression (DTRSVR) model in the detection of non -invasive blood glucose concentration, combining triggea and regression algorithms, and improving the loss function to the three yuan comparison loss (TC LOSS), the present solution to the present There are problems with insufficient accuracy and stability in technology, and achieve more efficient and stable blood glucose concentration predictions.

CN118919080BActive Publication Date: 2025-01-28XINGTU OPTOELECTRONICS TECHNOLOGY (JILIN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411411714.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-28
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

The prior art has problems with insufficient prediction accuracy and stability in the detection of non-invasive blood glucose concentrations, especially in deeper neural network structures, where gradient disappearance problems lead to performance degradation.

Method used

Put forward a deep triggea residual support vector return (DTRSVR) model, combined with triggea neural network and regression algorithm, and improves the loss function as a three -yuan comparison loss (TC LOSS) to improve the predictive performance and stability of the model sex.

Benefits of technology

It significantly improves the accuracy and stability of non -invasive blood glucose concentration regression forecasts, reduces errors and fluctuations, provides a new idea and technical means, and provides support for the development of clinical diagnosis and drug treatment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118919080B_ABST
    Figure CN118919080B_ABST
Patent Text Reader

Abstract

The present invention is a non-invasive blood glucose concentration prediction method. The present invention relates to the technical field of non-invasive blood glucose detection. The present invention collects spectral data to obtain original spectral data, and pre-processes the collected data; divides the pre-processed data into a training set, a validation set, and a test set, and sets hyperparameters; builds a non-invasive blood glucose concentration regression prediction model, performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model; and predicts blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model. The present invention improves the performance and stability of non-invasive blood glucose concentration regression prediction, reduces errors and fluctuations, and provides a new idea and technical means for non-invasive measurement of blood glucose concentration, which helps to promote the development of clinical diagnosis, drug treatment, poison identification and other fields, and improve human health and quality of life.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of non-invasive blood sugar detection, and is a non-invasive blood sugar concentration prediction method. Background Art

[0002] Deep learning is a general term for a class of pattern analysis methods in the field of machine learning. Different from traditional shallow learning, deep learning clarifies the importance of feature learning. It transforms the original features into a new feature space through layer-by-layer feature transformation, making classification or prediction easier. In 2006, Hinton effectively solved the problem of deep neural network training difficulties through the "pre-training + fine-tuning" method, and made the practical application of deep networks possible, which marked the rise of deep learning. Due to the technical breakthrough of greedy layer-by-layer pre-training and the improvement of computer computing power, in 2010, Vinod Nair and others first proposed the Rectified Linear Unit (ReLU) activation function, which replaced the Sigmoid or tanh function to solve the problem of gradient disappearance during deep network training. In 2012, Hinton used deep neural networks for speech recognition and achieved great success, which marked the rapid development of deep learning based on neural networks. Since then, researchers have tried to deepen the deep neural network to obtain stronger representation capabilities, from AlexNet's 8 layers to VGG's 19 layers, to GoogLeNet's 22 layers, and then to the subsequent deeper Inception network. However, due to the existence of the gradient vanishing problem, the performance of deeper networks has degraded. For this reason, He et al. proposed ResNet in 2015. The gradient of ResNet can directly return to the earlier layers through shortcuts, greatly alleviating the gradient vanishing problem, and thus a deeper and more effective network structure can be constructed.

[0003] The deep twin network consists of two sub-networks with the same structure and shared parameters. It can process two different inputs at the same time and calculate the similarity or distance between them. The triplet neural network (TNN) is an extension of the deep twin network. In 2015, Schroff et al. learned a Euclidean embedding for each image based on a deep convolutional network through triplet loss (T Loss), and trained the network model so that the distance in the embedding space directly corresponds to the face similarity. The wide application of triplet neural networks in the field of face recognition has inspired more research thinking. In 2018, Yang et al. tried to apply TNN to regression problems and proposed a deep regression network embedded with triple loss. The rhythmic features were used to predict the changes in blood pressure of emergency room patients before and after triage. However, the positive and negative samples were defined after triage, and the true label value (blood pressure) of the data set was not used. If there is no clear information about before and after triage, this method will not work. In 2019, Song et al. used triplet neural networks to embed sketch and natural image domains into a common feature space. Through an end-to-end training process, they achieved inter-domain bridging, feature embedding, and distance metric learning. They also introduced a shape regression module to explore the shape similarity between sketches and natural images and further refine the feature learning process. In response to the problem of triplet construction in triplet neural networks, Cheuk et al. applied TNN to the music emotion regression prediction task in 2020 and proposed a mechanism to define positive and negative samples without explicit information about them, enabling TNN to provide meaningful low-dimensional representations for regression tasks.

[0004] The research on non-invasive blood glucose concentration measurement is of great significance. It can avoid the pain, risk and cost brought by traditional invasive detection methods such as tissue biopsy and endoscopy, and improve the convenience and comfort of patients. With the continuous increase of personal data collected, it has become possible to monitor blood glucose concentration through data-driven with the help of deep learning algorithms. Among them, near-infrared spectroscopy NIRS is the first choice for traditional non-invasive blood glucose detection research. It uses modern metrology methods to establish a regression model between blood glucose concentration and near-infrared spectrum based on the absorption and scattering characteristics of glucose molecules in the near-infrared region (wavelength 750~2500 nm), and realizes non-invasive detection of blood glucose concentration. In addition, there are other spectral technologies. In 2009, the Virkler research group preliminarily confirmed that Raman spectroscopy can achieve non-destructive blood species identification through the results of blood stain species identification of humans, cats and dogs. Subsequently, they used near-infrared excitation Raman spectroscopy combined with PLSDA to conduct a binary classification study of human and animal blood in 2014. In 2017, Kavakiotis et al. used physiological models, data-driven models and hybrid models to make personalized predictions of blood glucose levels in patients with type 1 diabetes. The study also discussed the challenges of incorporating additional factors (such as physical activity and mood) into the model and pointed out the need for machine learning technology in clinical validation.

[0005] The triplet neural network is combined with the regression algorithm and applied to non-invasive blood concentration detection. Through the powerful feature extraction ability of the triplet neural network, the features related to blood glucose concentration are automatically learned from a variety of physiological signals, reducing the complexity and cost of manual feature engineering. Then, through the prediction ability of the regression algorithm, a mathematical model of blood glucose concentration and physiological signals is established according to the extracted features to achieve accurate estimation of blood glucose concentration. Summary of the invention

[0006] The present invention establishes a deep triplet residual support vector regression machine model, improves the loss function of the triplet network, and proposes a TC Loss loss function based on ternary loss and contrast loss. The DTRSVR model under TC Loss constraint combines the optimization capabilities of the triplet neural network and the regression algorithm to improve the performance and stability of non-invasive blood glucose concentration regression prediction, reduce errors and fluctuations, and provide a new idea and technical means for non-invasive measurement of blood glucose concentration, which is helpful to promote the development of clinical diagnosis, drug treatment, poison identification and other fields, and improve human health and quality of life.

[0007] The present invention provides a non-invasive blood glucose concentration prediction method, and the present invention provides the following technical solutions:

[0008] A non-invasive blood glucose concentration prediction method, the method comprising the following steps:

[0009] Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data;

[0010] Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters;

[0011] Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model;

[0012] Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model.

[0013] Preferably, the step 1 is specifically:

[0014] Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain original spectral data;

[0015] Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering:

[0016]

[0017] in, is the spectral data after multivariate scattering processing, is the multivariate scatter correction function;

[0018] Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte:

[0019]

[0020] in, is the spectral absorbance of the analyte, and LB is the abbreviation of Lambert-Beer law, where is the absorbance, is the molar absorptivity, is the concentration, is the path length of the light;

[0021] Normalize the absorbance:

[0022]

[0023] in, is the processed absorbance data.

[0024] Preferably, the data set division in step 2 is specifically as follows:

[0025] According to the 27 concentrations and 2430 data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Five concentrations, namely 450 samples, were randomly selected from all concentrations as the test set. The spectral data values ​​corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining 22 concentrations as the validation set, and the remaining 80% of the data were used as the training set.

[0026] Preferably, the hyperparameter setting in step 2 is specifically as follows:

[0027] Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value corresponding to the anchor sample , that is, The label value of the anchor sample extracted. , when the label value is Extract positive samples within the range ,exist Extract negative samples within the range , forming a triple sample , the threshold is adjusted through data distribution and iteration results, and the cross-validation results are obtained. = 0.1 and =0.5 when the network model training effect is best:

[0028] Right now , .

[0029] Preferably, the step 3 is specifically:

[0030] Step 3.1: After dividing the triplets according to the threshold gap, use stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

[0031] In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is , and The distance between them forms a gap to guide the network to learn discriminative samples;

[0032] The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data, ;

[0033] For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are the same, the original features Through triplet residual neural network Mapping to high-dimensional feature space In the deep feature ;

[0034] Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics , add a fully connected layer after the triplet residual neural network ,Model Calculate the loss value of the training data based on the loss function, and back-propagate the gradient to update the network parameters to complete the feature extraction process;

[0035] And according to stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

[0036] Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), positive example (Positive, ) and negative examples (Negative, ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction. , and , the variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example Minimize while making the high-dimensional representation distance between the anchor point and the negative example maximize;

[0037] Combine the triplet loss function and the contrast loss function to establish the ternary contrast loss TC Loss, through , and to measure the distance between anchor points, positive examples and negative examples, and introduce The adaptive hyperparameters enhance the generalization ability of the model. The TC Loss function is expressed as follows:

[0038]

[0039]

[0040]

[0041]

[0042] in, is the absolute value of the difference between the anchor point and the positive example label value, is the absolute value of the difference between the anchor point and the negative example label value, , and They are the feature data obtained after the anchor point, positive example and negative example are processed through the shared network structure. is the cosine value between the anchor point and the positive feature data, is the cosine value between the anchor point and the negative feature data, is the marginal parameter;

[0043] Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem:

[0044]

[0045]

[0046]

[0047]

[0048] ;

[0049] Step 3.4: Use triplet residual neural network for feature extraction using stochastic gradient descent Calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

[0050]

[0051]

[0052]

[0053]

[0054]

[0055] when , then the gradient ;

[0056] when , then the gradient is:

[0057]

[0058] because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

[0059]

[0060]

[0061] Step 3.5: Order Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate for iteration .

[0062] Preferably, when the learning rate , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution , and obtain the optimal model.

[0063] Preferably, the residual blocks of the deep residual neural network ResNet-18 are , , , , the final output dimension of the model is determined by the numclass of the fully connected layer, and , for the parameter settings in the loss function, The function parameters are specified as , The initial values ​​of the parameters in the function are specified as .

[0064] A non-invasive blood glucose concentration prediction system, the system comprising:

[0065] A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data;

[0066] A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting;

[0067] A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model;

[0068] A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model.

[0069] A computer-readable storage medium stores a computer program, which is executed by a processor to implement a non-invasive blood glucose concentration prediction method.

[0070] A computer device comprises a memory and a processor, wherein the memory stores a computer program and the processor implements a non-invasive blood glucose concentration prediction method when executing the computer program.

[0071] The present invention has the following beneficial effects:

[0072] Compared with the prior art, the present invention has the following advantages:

[0073] The present invention improves the loss function of the triplet network and proposes a TCLoss loss function based on ternary loss and contrast loss. The pre-trained deep triplet residual is embedded in the support vector regression machine to construct the DTRSVR model under the TC Loss constraint, and the SGD algorithm is used for loss back propagation to adjust the parameters to complete the model training. Experimental results show that when the optimal output dimension is 16 and the hyperparameters are =0.8, the prediction performance of the DTRSVR model based on the TC Loss function is the best. The improved loss function not only improves the prediction accuracy of the model, but also significantly improves the training speed of the model, which is about 40 times faster than the triple loss. Compared with SVR, DBN-SVR, and DTRSVR under T Loss constraints, the mean square error of the DTRSVR model based on the TC Loss function is reduced by 58.43%, 79.28%, and 39.32% on average, and the determination coefficient is increased by 0.3603, 0.1945, and 0.1575 on average. This shows the generalization ability and computational advantages of the model, and provides a deep learning solution strategy for the problems that need to be overcome. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flow chart of the triplet neural network combined with the support vector regression machine of the present invention;

[0075] Figure 2 Schematic diagram for defining anchor points and positive and negative samples;

[0076] Figure 3 Pseudocode for TRSGD training algorithm for deep triplet residual network

[0077] Figure 4 It is a schematic diagram of the structure of the triplet residual neural network of the present invention;

[0078] Figure 5 Comparison of Clarke analysis of different models for the first volunteer;

[0079] Figure 6 Comparison of Clarke analysis of different models for the second volunteer. DETAILED DESCRIPTION

[0080] The present invention is described in detail below in conjunction with specific embodiments. Specific embodiment one:

[0082] according to Figures 1 to 6 As shown, the specific optimization technical solution adopted by the present invention to solve the above technical problems is: the present invention relates to a non-invasive blood glucose concentration prediction method.

[0083] The present invention provides a non-invasive blood glucose concentration prediction method, the method comprising the following steps:

[0084] Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data;

[0085] Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters;

[0086] Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model;

[0087] Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model. Specific embodiment 2:

[0089] The difference between the second embodiment of the present application and the first embodiment is that:

[0090] The step 1 is specifically as follows:

[0091] Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain original spectral data;

[0092] Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering:

[0093]

[0094] in, is the spectral data after multivariate scattering processing, is the multivariate scatter correction function;

[0095] Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte:

[0096]

[0097] in, is the spectral absorbance of the analyte, and LB is the abbreviation of Lambert-Beer law, where is the absorbance, is the molar absorptivity, is the concentration, is the path length of the light;

[0098] Normalize the absorbance:

[0099]

[0100] in, is the processed absorbance data. Specific embodiment three:

[0102] The difference between the third embodiment of the present application and the second embodiment is that:

[0103] The data set division in step 2 is specifically as follows:

[0104] According to the 27 concentrations and 2430 data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Five concentrations, namely 450 samples, were randomly selected from all concentrations as the test set. The spectral data values ​​corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining 22 concentrations as the validation set, and the remaining 80% of the data were used as the training set. Specific embodiment four:

[0106] The difference between the fourth embodiment of the present application and the third embodiment is that:

[0107] The hyperparameter settings in step 2 are specifically as follows:

[0108] Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value corresponding to the anchor sample , that is, The label value of the anchor sample extracted. , when the label value is Extract positive samples within the range ,exist Extract negative samples within the range , forming a triple sample , the threshold is adjusted through data distribution and iteration results, and the cross-validation results are obtained. = 0.1 and =0.5 when the network model training effect is best:

[0109] Right now , . Specific embodiment five:

[0111] The difference between the fifth embodiment of the present application and the fourth embodiment is that:

[0112] The step 3 is specifically as follows:

[0113] Step 3.1: After dividing the triplets according to the threshold gap, use stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

[0114] In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is , and The distance between them forms a gap to guide the network to learn discriminative samples;

[0115] The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data;

[0116] For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are the same, the original features Through triplet residual neural network Mapping to high-dimensional feature space In the deep feature ;

[0117] Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics , add a fully connected layer after the triplet residual neural network ,Model Calculate the loss value of the training data based on the loss function, and back-propagate the gradient to update the network parameters to complete the feature extraction process;

[0118] And according to stochastic gradient descent Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, then the training is terminated and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm;

[0119] Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), positive example (Positive, ) and negative examples (Negative, ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction. , and , the variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example Minimize while making the high-dimensional representation distance between the anchor point and the negative example maximize;

[0120] Combine the triplet loss function and the contrast loss function to establish the ternary contrast loss TC Loss, through , and to measure the distance between anchor points, positive examples and negative examples, and introduce The adaptive hyperparameters enhance the generalization ability of the model. The TC Loss function is expressed as follows:

[0121]

[0122]

[0123]

[0124]

[0125] in, is the absolute value of the difference between the anchor point and the positive example label value, is the absolute value of the difference between the anchor point and the negative example label value, , and They are the feature data obtained after the anchor point, positive example and negative example are processed through the shared network structure. is the cosine value between the anchor point and the positive feature data, is the cosine value between the anchor point and the negative feature data, is the marginal parameter;

[0126] Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem:

[0127]

[0128]

[0129]

[0130]

[0131] ;

[0132] Step 3.4: Use triplet residual neural network for feature extraction using stochastic gradient descent Calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

[0133]

[0134]

[0135]

[0136]

[0137]

[0138] when , then the gradient ;

[0139] when , then the gradient is:

[0140]

[0141] because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

[0142]

[0143]

[0144] Step 3.5: Order Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate for iteration . Specific embodiment six:

[0146] The difference between the sixth embodiment of the present application and the fifth embodiment is that:

[0147] When the learning rate , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution , and obtain the optimal model. Specific embodiment seven:

[0149] The difference between the seventh embodiment of the present application and the sixth embodiment is that:

[0150] The residual blocks of the deep residual neural network ResNet-18 are , , , , the final output dimension of the model is determined by the numclass of the fully connected layer, and , for the parameter settings in the loss function, The function parameters are specified as , The initial values ​​of the parameters in the function are specified as . Specific embodiment eight:

[0152] The difference between the eighth embodiment of the present application and the seventh embodiment is only that:

[0153] The present invention provides a non-invasive blood glucose concentration prediction system, the system comprising:

[0154] A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data;

[0155] A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting;

[0156] A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model;

[0157] A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model. Specific embodiment nine:

[0159] The difference between the ninth embodiment of the present invention and the eighth embodiment is that:

[0160] The present invention provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement a non-invasive blood glucose concentration prediction method. Specific embodiment ten:

[0162] The difference between the tenth embodiment of the present invention and the ninth embodiment is that:

[0163] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements a non-invasive blood glucose concentration prediction method when executing the computer program. Specific embodiment eleven:

[0165] The difference between the eleventh embodiment of the present invention and the tenth embodiment is that:

[0166] The present invention constructs a set of experimental acquisition system, which is mainly composed of a light source, a spectrometer, an optical fiber and a computer. The system is used to conduct in vivo experiments to collect spectral data and ex vivo blood data of volunteers. To ensure data quality, an oral glucose tolerance test (OGTT) is used to collect experimental data, and a near-infrared spectral imager is used to measure reflectance spectral data. Before the experiment, all volunteers need to fast for more than 10 hours to ensure the stability of the body state. In the experiment, the volunteers ingested 200 ml of glucose aqueous solution prepared by 75 grams of anhydrous glucose powder within 5 minutes. In the following 2.5 hours, the blood glucose concentration of the volunteers will experience a process of rising from a low point to a high point and then falling back, and the entire measurement process lasts for 3 hours.

[0167] In terms of technical details, the near-infrared spectroscopic imager adopts a fixed scanning mode, with a wavelength range set at 925nm to 1701nm, a spectral resolution of 5nm, and a sampling frame rate of 90Hz. The index finger of the volunteer's left hand was selected as the measurement site in the experiment. In order to control the instability of the light source caused by changes in the light source temperature, a whiteboard correction was performed before each data collection, and how the contact pressure affects the spectral signal was studied to ensure a slight and stable contact between the finger and the end face of the instrument. The experiment collected blood glucose concentrations of 10 volunteers at 27 moments in total, and recorded 90 spectral band information corresponding to the blood glucose concentration at each time point. Due to the changes in the subjects' physique and other factors, a total of 234 different blood glucose concentration values ​​were obtained, and 21,060 spectral data were generated accordingly, each containing 164 wavelength points.

[0168] The present invention performs data preprocessing. In order to reduce the influence of noise in the data, a preprocessing method of multivariate scattering correction and normalization is adopted. The scattering effect of blood will cause the optical path lengths of different wavelengths to be inconsistent, thereby affecting the change in the optical path of pulsating blood. Therefore, by introducing the multivariate scattering correction method, the scattering information and the chemical light absorption information can be effectively separated. In addition, the method further eliminates the data differences caused by physical scattering, and after MSC preprocessing, higher quality original reflection data can be obtained. Subsequently, the Lambert-Beer law is used to process these data to obtain absorbance data after preliminary preprocessing.

[0169] The scattering information and chemical light absorption information are separated by the multivariate scattering correction method, the data difference caused by physical scattering is eliminated, and the original reflection data is obtained; the data is processed using the Lambert-Beer law to obtain the absorbance data after preliminary preprocessing;

[0170] Assume that the original spectral signal value is , , , , is the total concentration, is the total number of samples at the selected concentration, is the total number of wavelengths. The original spectral signal value is corrected for multivariate scattering, and the processing formula is as follows:

[0171]

[0172] in is the spectral data after multivariate scattering processing, is the multivariate scatter correction function.

[0173] The Lamber_Beer law is used to calculate the absorbance. This theorem provides a method to directly measure the concentration of the analyte in the sample. By measuring the absorbance of the light passing through the sample, the concentration of the analyte can be easily calculated. The formula is as follows:

[0174]

[0175] Here, LB is the abbreviation of Lambert-Beer law. It is usually expressed as ,in is the absorbance, is the molar absorptivity, is the concentration, is the path length of light.

[0176] Normalize the absorbance:

[0177]

[0178] For the spectral data of the two volunteers, the 155 wavelengths in the range of 925nm~1000nm have large noise. The data in the range of 1000nm~1700nm were analyzed with reference to the dynamic spectral data quality evaluation. After multivariate scattering correction of the above raw reflection data, the Lambert-Beer law was used to calculate the absorbance and draw the corresponding spectrum diagram as shown in the figure. Figure 4 As shown. Figure 4 It can be seen that for 2430 data points at 27 concentrations for each volunteer, after using multivariate scattering correction, the data are more concentrated and the data quality is significantly improved.

[0179] The present invention divides the preprocessed data of two volunteers into a training set, a validation set and a test set. Five concentrations, i.e., 450 samples, are randomly selected from all concentrations as a test set. To verify the universality of the regression algorithm, the spectral data values ​​corresponding to these concentrations do not participate in the training generation of the model. Then, 20% of the data are randomly selected from the remaining 22 concentrations as a validation set, and the remaining 80% of the data are used as a training set.

[0180] The present invention constructs a non-invasive blood glucose concentration regression prediction algorithm framework, specifically a regression prediction algorithm framework integrating a deep triplet residual network and SVR. A deep triplet residual support vector regression machine (Triplet Residual SVR Network, DTRSVR) model is constructed through "triplet residual network pre-learning" and "support vector regression machine". The algorithm construction process is as follows Figure 1 As shown in Figure 1, first, the triplets are divided into groups according to the threshold gap. Subsequently, the triplet residual neural network is used to extract the features of the data, and the stochastic gradient descent ( ) Update the weights and train repeatedly until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output. Finally, the output feature data is transferred to the support vector regression machine for training and testing of the regression algorithm.

[0181] The present invention constructs a triplet data module. The training of the triplet neural network requires the input of anchor points, positive samples and negative samples, i.e., triplet data. The construction of the triplet is crucial to the training effect. When dealing with classification tasks, the definition of positive samples is clear, i.e., samples belonging to the same class. However, for regression tasks, new strategies need to be adopted because the data is operated in a continuous space and the label data in the regression task has an infinite number of possible values. For regression, setting absolute, discrete intervals does not work.

[0182] In the training process of the triplet neural network, three corresponding sample data are required as input. Constructing a suitable sample set helps the network learn effective features. Therefore, this section proposes a more effective method to define positive and negative samples in regression, and describes the mechanism of determining positive and negative samples without clear positive and negative sample information. Specifically, when dividing samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor point information, and the anchor point label value is defined as , and are two thresholds with different values, and the positive samples correspond to labels The scope is , the negative sample corresponds to the label The scope is . and The distance between them forms a “gap” to guide the network to learn more discriminative samples. Figure 2 A schematic diagram of the definition of positive and negative samples is shown.

[0183] The constructed triple is recorded as ,in , is the original anchor feature data; , is the original positive feature data; , is the original negative feature data.

[0184] For a given data set and ,in , is the original anchor feature data, is the corresponding label data, and the other two are similar. Through triplet residual neural network Mapping to high-dimensional feature space , we get the deep features . Further update the network parameters through "deep triplet residual neural network pre-training" Get deep features with triplet characteristics Finally, add a fully connected layer after the triplet residual neural network ,Model The loss value of the training data is calculated based on the loss function, and the gradient is back-propagated to update the network parameters to complete the feature extraction process.

[0185] The non-invasive blood glucose concentration feature extraction model was constructed. The triplet neural network (TNN) was inspired by the twin network. In the twin network, the input is a data pair consisting of two sets of data, while in the triplet neural network, the input is a triple consisting of three sets of data. , that is, the anchor point (Anchor, ), positive example (Positive, ) and negative examples (Negative, ). Among them, the positive example and the anchor point belong to similar categories, while the negative example and the anchor point belong to different categories. The triplet is input into the residual neural network ResNet-18 with a triplet structure (see Figure 4 ).

[0186] The triplet data is divided by the threshold gap and then input into the shared network Net(x) for feature extraction. , and . The variable gradient is calculated through the loss function, the network weight is updated, and the representation of data features in high-dimensional space is enhanced. The training goal of the triplet neural network is to make the high-dimensional representation distance between the anchor point and the positive example As small as possible, while making the high-dimensional representation distance between the anchor point and the negative example As big as possible.

[0187] In the training and learning of triplet residual neural networks, the design of the loss function is directly related to the model stability and its performance, and it plays a decisive role in the effect of network learning.

[0188] TC Loss Function

[0189] The contrast loss function is suitable for dealing with similarity measurement problems. Its goal is to encourage the distance between the same samples to be as small as possible and the distance between different samples to be as large as possible. The specific formula is as follows:

[0190]

[0191] in, Represents the Euclidean distance between two sample features, Used to determine whether two samples match. It means that the two samples are similar or matched; It means that the two samples are not similar or match; It is a pre-set threshold, usually indicating the boundary of similarity.

[0192] In the original triplet loss function, only the anchor feature data, positive feature data and negative feature data are used, and the label information is not used. Therefore, there is a problem of effective information waste. To address this problem, a triplet contrast loss (TC Loss) is proposed by combining the triplet loss function and the contrast loss function.

[0193] In the TC Loss function, the closer the distance between the anchor point and the positive example, The smaller the value, the smaller the angle between the data. The larger the first part The smaller it is, the farther the distance between the anchor point and the negative example is. The larger it is, the larger the angle between the data. The smaller the second part The smaller it is; we hope that the first distance calculated by the model is smaller than the second distance, and to a certain extent, the third part of the formula The bias value controls how small the model must be for the loss to be zero or less than zero. In addition, according to the triple partitioning mechanism, the distance between the anchor point and the positive example is smaller than the distance between the anchor point and the negative example. The weight coefficient of the second part is the largest, and it has the greatest overall impact on the loss function. The direct goal of model training is to minimize the loss function to adjust the model parameters, thereby achieving the effect of optimizing feature embedding. On the premise that the second part is larger than the first part, the smaller the second part is, the more conducive it is to model training. At the same time, the third part of the TC Loss function uses an adaptive function to accelerate the convergence speed of model training.

[0194] The TC Loss function enables the model to learn the ability to distinguish anchor points from negative examples during training. By adjusting the similarity of distance and angle, the anchor points are closer to the positive examples and the distance between the anchor points and the negative examples is larger. Combining TC Loss with the triplet residual neural network structure, the feature extraction part can be written as the following optimization problem:

[0195]

[0196]

[0197]

[0198]

[0199]

[0200] The non-invasive blood glucose concentration regression prediction model was constructed. Using SVR for regression, we can get:

[0201]

[0202] Introducing slack variables to handle nonlinear problems and Rewrite the above formula as:

[0203]

[0204]

[0205] To solve the optimization problem, the Lagrange multiplier method is used to transform it into its dual problem. Specifically, by introducing the Lagrange multiplier , and we get the Lagrangian function of this formula:

[0206]

[0207] make right and The partial derivative of is zero, and we can get the dual problem of SVR:

[0208]

[0209]

[0210] Selecting a nonlinear kernel function, the optimization problem has the following solution:

[0211]

[0212] in is the kernel function, It is a sample Mapped to the inner product in the feature space. Through supervised learning, the gradient is calculated and back-propagated to optimize the neural network.

[0213] The present invention uses a triplet residual neural network for feature extraction, and uses a stochastic gradient descent method ( ) Calculate the gradient of the ternary contrast loss function (TC Loss) with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function:

[0214]

[0215]

[0216]

[0217]

[0218]

[0219] like , then the gradient .

[0220] like , then the gradient is:

[0221]

[0222] because Include and , Include and , so respectively , and Find partial derivatives and update gradients:

[0223]

[0224]

[0225] In summary, the parameter training algorithm of the deep triplet residual network feature extraction model (denoted as TRSGD algorithm) can be constructed. The detailed pseudo code can be found in Figure 3 .

[0226] This paper discusses the convergence of the deep triplet residual network TRSGD algorithm. Indicates The parameters of the iteration, ,but Indicates The loss value of the iteration, Indicates The learning rate of the iteration. The proof of the convergence of the training algorithm can be expanded according to the following theorem.

[0227] If the learning rate of the TRSGD algorithm , then when the maximum number of iterations When , the loss value of the deep triplet residual network Converge to the optimal solution .

[0228] Proof: Consider the optimization problem of network structure Obviously, there is a constant and , so that

[0229]

[0230] in for about The gradient value of . Optimization problem The regret is:

[0231]

[0232] The parameters corresponding to the cross entropy loss function of the optimization problem when it takes the theoretical minimum value. Since the cross entropy loss function is a convex function, then:

[0233] We can get:

[0234]

[0235] because pass Algorithm updates and , then according to the theorem:

[0236]

[0237] but ,and .when hour, .therefore, There is an optimal solution .

[0238] In order to verify the effectiveness of the DTRSVR model based on the TC Loss function, the model prediction results were analyzed on the blood glucose spectrum dataset of two volunteers, mainly using and As an evaluation indicator. Subsequently, the model was compared with SVR, DBN-SVR and DTRSVR based on T Loss function. And the output dimension and hyperparameters were explored. The impact on the DTRSVR regression prediction results confirms that pre-training of the triplet neural network helps the supervised adjustment of the algorithm.

[0239] The training process of the model. The triplet residual network includes two layers of iterative relationships. The first layer has 30 outer iterations. When the outer iteration is updated, the algorithm will reselect the anchor point to construct the triple. The second layer of inner iteration (epochs) is embedded in the outer iteration. One outer iteration contains 10 inner iterations (epochs=10). Through multiple experimental comparisons and analyses, 128 triplets are selected for training per epoch, and the number of training batches is determined so that all training data has the possibility of participating in model training. Therefore, 30 triplets were divided and the model was trained 300 times in total to ensure that the network is trained on as many samples as possible to achieve the convergence goal. After repeated experiments and comparing the experimental results in turn, the appropriate anchor point labels were determined to optimize the experimental results.

[0240] For the DTRSVR algorithm, the dimension of the output feature matrix has a significant impact on the prediction results, so it is very necessary to determine the optimal output dimension. This paper uses the control variable method to set the output dimensions to 16, 32, 64, 128, 256, and 512 for research. This setting includes both the mapping of low-dimensional space and the mapping to higher dimensions, which is more comprehensive. In addition, the cosine marginal loss function and the triplet loss function are used for comparative analysis.

[0241] For the first volunteer selected, the experimental results are shown in Table 1. For the TC Loss function, the model effect is better when the output dimension is 16 and 512, but when the output dimension is 512, the model training time increases significantly, so the output dimension is initially determined to be 16. Comprehensive analysis of the three loss functions when the output dimension is 16 , , Value and the average time spent on each iteration ( ), it can be seen that TC Loss regression prediction has the best effect.

[0242] Table 1 DTRSVR prediction results under different loss functions (first volunteer)

[0243]

[0244] For the second volunteer, the experimental results are shown in Table 2. For the T Loss function, the model effect is better when the output dimension is 16 and 32; for the TC Loss function, the model effect is better when the output dimension is 16 and 64. The model training time increases with the increase of the output dimension, so the output dimension is initially determined to be 16. Comprehensive analysis of the three loss functions when the output dimension is 16 , , Value and the average time spent on each iteration ( ), it can be seen that TC Loss regression prediction has the best effect.

[0245] Table 2 DTRSVR prediction results under different loss functions (second volunteer)

[0246]

[0247] In order to more intuitively display the regression prediction results, the result data in Table 1 are visualized and the TLoss and TC Loss functions in different dimensions are plotted. , , The histogram of the values, as well as the trend change graph of training loss and validation loss of the model based on T Loss and TCLoss functions during 300 training cycles.

[0248] Analysis shows that when the output dimensions are 16, 32, 64, 256, and 512, the TC Loss function Obviously larger than the TLoss function . Analysis shows that when the output dimensions are 16, 32, 128, 256, and 512, the TC Loss function and Obviously smaller than the T Loss function and value.

[0249] analyze Figure 5 It can be seen that with the increase in the number of training times, the training loss value of the model based on the T Loss function converges quickly, but the validation loss value fluctuates continuously in the range of 0.5 to 2.0, with almost no convergence trend. The training loss value of the model based on the TC Loss function drops rapidly from 0.35 to 0.05, and the training loss value and the validation loss value maintain the same trend of change, and converge quickly, which shows that the model training effect is good.

[0250] Further exploration of the interval hyperparameter in the TC Loss function The impact of the value on the DTRSVR prediction results. Choose the appropriate The value is a process that requires fine-tuning. Used to adjust the "safety zone" between positive and negative examples, the larger Encouraging the model to increase the distance between positive and negative examples helps improve the model’s ability to distinguish. The value will make TC Loss too sensitive to small feature changes, thus affecting the stability and convergence speed of the model. The value needs to be able to both increase the distance between positive and negative examples and provide a smoother gradient to a certain extent, which helps the model learn more stably. The experimental range selected in this section is (0.7, 7) to find the best Value. After trying many different values, this section provides 7 representative settings. Detailed analysis of =0.7, 0.8, 0.9, 1.0, 1.1 and 1.2.

[0251] For the first volunteer selected, the experimental results are shown in Table 3. =1, when =0.8, the coefficient of determination increased by 25.00%, reaching 0.8311. =1.1, the determination coefficient of the prediction results is significantly reduced. =1.2, the determination coefficient of the prediction results increased, but was still significantly lower than 0.8311.

[0252] Table 3 DTRSVR experimental results under different thresholds (first volunteer)

[0253]

[0254] For the second volunteer selected, the experimental results are shown in Table 4. =1, when =0.8, the determination coefficient increased by 15.80% and reached 0.8053.

[0255] Table 4 DTRSVR experimental results under different thresholds (second volunteer)

[0256]

[0257] For the first selected volunteer, the regression results are shown in Table 5. Compared with other models, the TC Loss ( =0.8) constraint The value is large, but its Value and The value is significantly better than other models. Compared with the results of regression prediction using only SVR, its mean square error is reduced by 0.5390 and the determination coefficient is increased by 0.4996, which is a great performance improvement. Further analysis of the performance of different loss functions under the same network structure setting shows that the determination coefficient of the DTRSVR model under TC Loss constraint is significantly higher than that of the DTRSVR model under T Loss constraint.

[0258] Table 5 Regression results analysis of different models (first volunteer)

[0259]

[0260] In order to analyze the results intuitively, the Clark grid analysis diagram of the calculation results of the four groups of models in Table 5 is given (see Figure 5 ), nearly half of the result points of the DBN-SVR model and the DTRSVR model based on T Loss fall into area B, and the result points of the DTRSVR model based on TC Loss almost all fall into area A. At the same time, the result points of the DTRSVR model based on TC Loss have obvious intervals, indicating that the blood glucose spectrum data of different concentrations are well divided, and all the result points are consistent with the straight line The intersection shows that its prediction effect is better.

[0261] For the second selected volunteer, the regression results are shown in Table 6. Compared with other models, the TC Loss ( =0.8) constraint of DTRSVR model Value and The values ​​are smaller than those of other models, and the model has the same The value is also significantly higher than other models. Compared with the results of regression prediction using only SVR, TC Loss ( =0.8), the mean square error of the DTRSVR model is reduced by 0.5392, and the determination coefficient is increased by 0.5598, which greatly improves the performance.

[0262] Table 6 Analysis of regression results of different models (second volunteer)

[0263]

[0264] In order to analyze the results intuitively, the Clark grid analysis diagram of the calculation results of the four groups of models in Table 6 is given (see Figure 6 ). Some of the result points of the DBN-SVR model fall into area B. Although the result points of the DTRSVR model under the T Loss constraint almost all fall into area A, In contrast, the result points of the DTRSVR model under the TC Loss constraint not only fall 100% into area A, but are also closely distributed on the straight line. All edges intersect with it.

[0265] In summary, the experimental results strongly support that the DTRSVR model under TC Loss constraint is an effective regression prediction model, and its performance is significantly better than SVR, DBN-SVR, and DTRSVR under T Loss constraint.

[0266] The present invention proposes a DTRSVR model based on TC Loss loss. Through experiments on non-invasive blood glucose spectrum data of 2 volunteers, it is found that the DTRSVR model under TC Loss constraint shows the highest determination coefficient in the support vector machine regression prediction task. Compared with the traditional SVR, the feature mapping ability of the DTRSVR model is significantly improved. The research results show that the triplet residual neural network has a significant impact on the prediction performance of the support vector regression machine. At the same time, by introducing label information and adaptive thresholds, the constructed TC Loss function not only significantly improves the training and convergence speed of the deep triplet residual network, but also improves the data representation ability through supervised learning.

[0267] Compared with DTRSVR under T Loss constraint, the DTRSVR model based on TC Loss loss improves the loss function on the basis of the same network structure. First, the distance between the anchor point and the positive example is changed from the square of the Euclidean distance to the product of the label difference and the cosine value, which not only considers the spatial distance between the features but also provides angle information. The cosine value can better capture the directional similarity between the features to more comprehensively reflect the relationship between the features. Secondly, the cosine value is also introduced in the distance between the anchor point and the negative example to enhance the model's ability to distinguish different samples. Finally, the threshold is changed from a fixed value to an adaptive function about the anchor point and the negative example. The adaptive function is used to adjust the distance between the anchor point and the positive and negative examples. It can be dynamically adjusted according to the similarity of different features, better adapt to the differences between samples, and deal with data imbalance problems, thereby improving the model's ability to distinguish and accelerating the convergence of model training. Experiments show that the DTRSVR model under TC Loss constraint has achieved significant accuracy improvement compared with T Loss loss, and the running speed has been significantly improved. A detailed analysis shows that the loss determination coefficient of the DTRSVR model under TC Loss constraint is increased by an average of 0.1575, or 23.83%, compared with that of T Loss.

[0268] In general, the experimental results of this paper highlight the excellent performance of DTRSVR in support vector machine regression prediction tasks under TC Loss constraints, especially the introduction of triplet neural network pre-training and the improvement of its loss function, which provides strong empirical support for the combination of deep learning and support vector machines. These findings are not only of great significance to academic research in related fields, but also provide useful guidance for model selection and performance optimization in practical applications.

[0269] The above is only a preferred implementation of a non-invasive blood glucose concentration prediction method. The protection scope of a non-invasive blood glucose concentration prediction method is not limited to the above embodiment. All technical solutions under this idea belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, several improvements and changes without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.

Claims

1. A non-invasive blood glucose concentration prediction method, characterized by: The method comprises the following steps: Step 1: Collect spectral data to obtain original spectral data, and pre-process the collected data; Step 2: Divide the preprocessed data into training set, validation set and test set, and set hyperparameters; Step 3: Build a non-invasive blood glucose concentration regression prediction model, and perform iterative calculations to obtain the optimal non-invasive blood glucose concentration regression prediction model; The step 3 is specifically as follows: Step 3.1: After dividing the triplets according to the threshold gap, the weights are updated according to the stochastic gradient descent (SGD) and the training is repeated until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as y A , Δ P and Δ N are two thresholds with different values, and the positive sample corresponds to the label y P The range is y P ∈[y A -Δ P ,y A +Δ P ], negative samples correspond to labels y N The range is y N ∈[-∞,y A -Δ N ]∪[y A +Δ N ,+∞],Δ P and Δ N The distance between them forms a gap to guide the network to learn discriminative samples; The constructed triple is denoted as [X A ,X P ,X N ],in X Ai ∈R D is the original anchor feature data; X Pj ∈R D is the original positive feature data; X Nk ∈R D is the original negative feature data; For a given data set [X A ,X P ,X N ] and [Y A ,Y P ,Y N ],in and They are the corresponding anchor points, positive and negative label data, and the original features Through the triplet residual neural network φ ResNet Mapped to the high-dimensional feature space Φ, we get the deep feature φ ResNet (X;θ); Step 3.2: Update network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics Add a fully connected layer after the triplet residual neural network The model f(·) calculates the loss value of the training data based on the loss function and back-propagates the gradient to update the network parameters to complete the feature extraction process; The weights are updated according to stochastic gradient descent (SGD) and the training is repeated until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; Step 3.3: The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triplet consisting of three sets of data [X A ,X P ,X N ], that is, anchor point (Anchor, X A ), Positive example (Positive, X P ) and negative examples (Negative, X N ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction to obtain φ ResNet (X Ai ;θ),φ ResNet (X Pj ;θ) and φ ResNet (X Nk ; θ), calculate the variable gradient through the loss function, update the network weight, and enhance the representation of data features in high-dimensional space. The training goal of the triplet neural network is to make the high-dimensional representation distance D(X A ,X P ) is minimized, while making the high-dimensional representation distance D(X A ,X N )maximize; The triplet loss function and the contrast loss function are combined to establish the ternary contrast loss TC Loss. AP , C AP and C AN To measure the distance between anchor points, positive examples and negative examples, and introduce adaptive hyperparameters containing β2 to enhance the generalization ability of the model, the TC Loss function is expressed by the following formula: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )) Among them, l AP is the absolute value of the difference between the anchor point and the positive example label value, l AN is the absolute value of the difference between the anchor point and the negative example label value, φ ResNet (X A ), φ ResNet (X P ) and φ ResNet (X N ) are the feature data obtained by processing the anchor point, positive example and negative example through the shared network structure, Cos(φ ResNet (X A ),φ ResNet (X P )) is the cosine value between the anchor point and the positive feature data, Cos(φ ResNet (X A ),φ ResNet (X N )) is the cosine value between the anchor point and the negative feature data, and β2 is the marginal parameter; Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )); Step 3.4: Use the triplet residual neural network for feature extraction, and use the stochastic gradient descent method SGD to calculate the gradient of the ternary contrast loss function TC Loss with respect to the network variables to optimize the network so that the anchor point output by the network is close to the positive feature data and the anchor point is far from the negative feature data. According to the TC Loss loss function: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )) when The gradient when Then the gradient is: because Contains φ ResNet (X A ) and φ ResNet (X P ), Contains φ ResNet (X A ) and φ ResNet (X N ), so we can calculate φ ResNet (X A ),φ ResNet (X P ) and φ ResNet (X N ) Find the partial derivative and update the gradient: in, in, Step 3.5: Let θ t represents the parameters of the tth iteration, t=1,2,...,T, then L TC (θ t ) represents the loss value of the tth iteration, η t represents the learning rate of the tth iteration; Step 4: Predict the blood glucose concentration based on the optimal non-invasive blood glucose concentration regression prediction model.

2. The method according to claim 1, characterized in that: The step 1 is specifically as follows: Step 1.1: Construct an acquisition system through a light source, a spectrometer, an optical fiber and a computer, and acquire spectral data through the acquisition system to obtain original spectral data; Step 1.2: Use multivariate scattering correction to preprocess the original spectral data. When the original spectral signal value is x i,j (k), i = 1, 2, ... N, j = 1, 2, ... M, k = 1, 2, ... P, N is the total number of concentrations, M is the total number of samples at the selected concentration, P is the total number of wavelengths, and the original spectral signal value is corrected for multivariate scattering: in, is the spectral data after multivariate scattering processing, and F is the multivariate scattering correction function; Step 1.3: Use the Lamber-Beer law to calculate the absorbance of the light passing through the sample and calculate the concentration of the analyte: Among them, A i,j (k) is the spectral absorbance of the analyte, LB is the abbreviation of Lambert-Beer's law, where A is the absorbance, ε is the molar absorptivity, c is the concentration, and l is the path length of light; Normalize the absorbance: Among them, y i,j is the processed absorbance data.

3. The method according to claim 2, characterized in that: The data set division in step 2 is specifically as follows: According to the concentration data obtained after preprocessing, the preprocessed data were divided into training set, validation set and test set. Samples were randomly selected from all concentrations as the test set. The spectral data values ​​corresponding to each concentration did not participate in the training and generation of the model. 20% of the data were randomly selected from the remaining concentrations as the validation set, and the remaining 80% of the data were used as the training set.

4. The method according to claim 3, characterized in that: The hyperparameter settings in step 2 are specifically as follows: Divide the triplets into the training set, validation set, and test set, and randomly select a concentration from the true blood glucose concentration value as the label value y corresponding to the anchor sample Ah , that is, the label value of the anchor sample extracted for the hth time, h = 1…30, when the label value is [y Ah -Δ P ,y Ah +Δ P ] to extract positive samples y within the range Ph , in [-∞,y Ah -Δ N ]∪[y Ah +Δ N ,+∞] range to extract negative samples y Nh , forming a triple sample [X A ,X P ,X N ], the threshold is adjusted through data distribution and iteration results, and the cross-validation result is obtained in Δ P =0.1 and Δ N =0.5 when the network model training effect is best: That is, y Ph ∈ [y Ah - 0.1, y Ah + 0.1], y Nh ∈ [-∞, y Ah - 0.5] ∪ [y Ah + 0.5, +∞].

5. The method according to claim 1, characterized in that: When the learning rate Then when the maximum number of iterations T→∞, the loss value L of the deep triplet residual network is TC (θ t ) converges to the optimal solution Get the optimal model.

6. The method according to claim 1, characterized in that: The residual blocks of the deep residual neural network ResNet-18 are The final output dimension of the model is determined by the numclass of the fully connected layer, where n = numclass. For the parameter setting in the loss function, L T The parameters in the function are specified as β=5, L TC The initial value of the parameter in the function is specified as β2=1.

7. A non-invasive blood glucose concentration prediction system, characterized by: The system comprises: A data acquisition module, wherein the data acquisition module acquires spectral data to obtain raw spectral data and pre-processes the acquired data; A hyperparameter setting module, wherein the hyperparameter setting module divides the preprocessed data into a training set, a validation set, and a test set, and performs hyperparameter setting; A model building module, wherein the model building module builds a non-invasive blood glucose concentration regression prediction model and performs iterative calculations to obtain an optimal non-invasive blood glucose concentration regression prediction model; After dividing the triplets according to the threshold gap, the weights are updated according to the stochastic gradient descent (SGD) and the training is repeated until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; In the training process of the triplet neural network, three corresponding sample data are required as input. When dividing the samples, fixed grouping is not used, but the threshold interval is fixed according to the anchor information, and the anchor label value is defined as y A , Δ P and Δ N are two thresholds with different values, and the positive sample corresponds to the label y P The range is y P ∈[y A -Δ P ,y A +Δ P ], negative samples correspond to labels y N The range is y N ∈[-∞,y A -Δ N ]∪[y A +Δ N ,+∞],Δ P and Δ N The distance between them forms a gap to guide the network to learn discriminative samples; The constructed triple is denoted as [X A ,X P ,X N ],in X Ai ∈R D is the original anchor feature data; X Pj ∈R D is the original positive feature data; X Nk ∈R D is the original negative feature data; For a given data set [X A ,X P ,X N ] and [Y A ,Y P ,Y N ],in and They are the corresponding anchor points, positive and negative label data, and the original features Through the triplet residual neural network φ ResNet Mapped to the high-dimensional feature space Φ, we get the deep feature φ ResNet (X;θ); Updating network parameters through deep triplet residual neural network pre-training Get deep features with triplet characteristics Add a fully connected layer after the triplet residual neural network The model f(·) calculates the loss value of the training data based on the loss function and back-propagates the gradient to update the network parameters to complete the feature extraction process; The weights are updated according to stochastic gradient descent (SGD) and the training is repeated until the loss value is small enough or the maximum training batch is reached, and the training is terminated, and the features of the blood glucose spectrum data are output; the output feature data is transferred to the support vector regression machine to train and test the regression algorithm; The constructed triplet residual neural network is used as the feature extraction module of the deep triplet residual support vector machine. In the twin network, the input is a data pair consisting of two sets of data, and in the triplet neural network, the input is a triple consisting of three sets of data [X A ,X P ,X N ], that is, anchor point (Anchor, X A ), Positive example (Positive, X P ) and negative examples (Negative, X N ); The triplet is input into the residual neural network ResNet-18 with a triplet structure. After the triplet data is divided by the threshold gap, it is input into the shared network Net(x) for feature extraction to obtain φ ResNet (X Ai ;θ),φ ResNet (X Pj ;θ) and φ ResNet (X Nk ; θ), calculate the variable gradient through the loss function, update the network weight, and enhance the representation of data features in high-dimensional space. The training goal of the triplet neural network is to make the high-dimensional representation distance D(X A ,X P ) is minimized, while making the high-dimensional representation distance D(X A ,X N )maximize; The triplet loss function and the contrast loss function are combined to establish the ternary contrast loss TC Loss. AP , C AP and C AN To measure the distance between anchor points, positive examples and negative examples, and introduce adaptive hyperparameters containing β2 to enhance the generalization ability of the model, the TC Loss function is expressed by the following formula: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )) Among them, l AP is the absolute value of the difference between the anchor point and the positive example label value, l AN is the absolute value of the difference between the anchor point and the negative example label value, φ ResNet (X A ), φ ResNet (X P ) and φ ResNet (X N ) are the feature data obtained by processing the anchor point, positive example and negative example through the shared network structure, Cos(φ ResNet (X A ),φ ResNet (X P )) is the cosine value between the anchor point and the positive feature data, Cos(φ ResNet (X A ),φ ResNet (X N )) is the cosine value between the anchor point and the negative feature data, and β2 is the marginal parameter; Combine the TC Loss function with the triplet residual neural network structure, and optimize the feature extraction part through the following problem: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )); Use the triplet residual neural network for feature extraction, and use the stochastic gradient descent method SGD to calculate the gradient of the ternary contrast loss function TC Loss about the network variables to optimize the network, so that the anchor point output by the network is close to the positive feature data, and the anchor point is far from the negative feature data. According to the TC Loss loss function: C AP =Cos(φ ResNet (X A ),f ResNet (X P )) C AN =Cos(φ ResNet (X A ),f ResNet (X N )) when The gradient when Then the gradient is: because Contains φ ResNet (X A ) and φ ResNet (X P ), Contains φ ResNet (X A ) and φ ResNet (X N ), so we can calculate φ ResNet (X A ),φ ResNet (X P ) and φ ResNet (X N ) Find the partial derivative and update the gradient: in, in, Let θ t represents the parameters of the tth iteration, t=1,2,…,T, then L TC (θ t ) represents the loss value of the tth iteration, η t represents the learning rate of the tth iteration; A prediction module predicts blood glucose concentration based on an optimal non-invasive blood glucose concentration regression prediction model.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to any one of claims 1 to 6.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Noninvasive blood glucose concentration prediction method

    CN118173264A