A 1D-CNN blood glucose concentration prediction method based on activation function

By using the LogModulus activation function to process Raman spectral data in the 1D-CNN model, the problems of delayed prediction of blood sugar concentration and low accuracy are solved, and fast and accurate blood sugar monitoring is achieved. It is suitable for daily detection of diabetic patients and reduces calculation costs and hospital resource consumption.

CN118452912BActive Publication Date: 2025-01-10NANTONG NINGJING INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410684760.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2025-01-10
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

In the prior art, the prediction results of blood glucose concentrations are delayed and the prediction accuracy is low. Traditional venous blood collection or fingertip blood collection methods have pain and infection risks, and the reagent treatment is time-consuming, resulting in delayed analysis results.

Method used

Using the 1D-CNN method based on the LogModulus activation function, a one-dimensional convolutional neural network is constructed by acquiring and preprocessing the Raman spectral data of diabetic patients. The spectrum data is convolutional and activated by using the LogModulus activation function, and combined with the sequence expansion layer Blood glucose concentration prediction was performed with the full-connection layer.

Benefits of technology

It improves the accuracy and speed of blood sugar concentration prediction, reduces calculation costs, prevents gradient disappearance and saturation problems, and provides a fast and non-invasive blood sugar monitoring method suitable for daily testing in patients with diabetes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118452912B_ABST
    Figure CN118452912B_ABST
Patent Text Reader

Abstract

The present application discloses a 1D-CNN blood glucose concentration prediction method based on an activation function, comprising the following steps: obtaining Raman spectral data of multiple diabetic patients and preprocessing them; constructing a LogModulus activation function; constructing a one-dimensional convolutional neural network based on the LogModulus activation function; training the convolutional neural network and predicting blood glucose concentration. The present application designs a new single-parameter non-monotonic activation function LogModulus. When the negative input decreases, its activation value gradually approaches 0 to maintain sparsity. When the input value x is between ‑1 and 1, the activation function exhibits modular symmetry, produces symmetrical activation values ​​and gradients, and further reduces the computational cost of this area. When the positive input x>1, LogModulus has an unbounded activation value, which can effectively prevent gradient vanishing and saturation problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of blood glucose prediction, and specifically relates to a 1D-CNN blood glucose concentration prediction method based on an activation function. Background Art

[0002] Diabetes is a metabolic disease characterized by chronic high blood sugar levels, which can cause long-term damage to the eyes, kidneys, and heart. However, the medical community has not yet developed a drug or method that can cure diabetes. Patients mainly control their blood sugar concentrations through frequent monitoring of blood sugar levels and the corresponding amount of oral hypoglycemic drugs and insulin injections. The traditional blood sugar monitoring method of venous blood sampling or fingertip blood sampling can cause pain, infection, and other problems, and involves specific reagent preparation procedures and time-consuming reagent handling procedures, which leads to delayed analysis results. Therefore, it is of great significance to construct a fast, efficient, and non-invasive method for detecting blood sugar levels in diabetic patients.

[0003] In recent years, spectral detection technology has been widely used in component detection due to its advantages such as fast measurement speed, high accuracy and low sample requirements. Compared with other spectral technologies, Raman spectroscopy is a new type of non-invasive spectral technology. With the continuous development of deep learning, the prediction of blood glucose concentration by combining neural networks with Raman spectroscopy has become a research hotspot. Pian Feifei et al. proposed a one-dimensional shallow convolutional neural network structure combined with elastic networks for predicting blood glucose concentration by Raman spectroscopy. Its prediction accuracy is higher than that of partial least squares and support vector machines.

[0004] The performance of neural networks is affected by algorithm parameters, data, etc., especially the activation function plays an important role in improving the performance of neural networks. At present, activation functions are mainly divided into linear activation functions, nonlinear monotonic activation functions and nonlinear nonmonotonic activation functions. Commonly used activation functions include Sigmoid, Tanh, ReLU, Mish and Swish. In the study of Zhu Meng et al., a new nonmonotonic activation function PFLU was proposed. A large number of experiments showed that PFLU often works better than the most advanced nonmonotonic activation function. Karnewar et al. used the absolute value function as the activation function of the absolute artificial neural network model. However, the effect of the modulus activation function in deep learning has not been compared with other activation functions. In 2023, Valles et al. proved that the deep learning model using the modulus activation function converged better on the MNIST, CIFAR 10 and CIFAR 100 datasets. Therefore, the invention of a 1D-CNN blood glucose concentration prediction method based on a new activation function is conducive to improving the performance and computational efficiency of the neural network. The appropriate activation function can significantly improve the prediction accuracy of the 1D-CNN model, allowing more diabetic patients to detect blood glucose levels in time and take corresponding remedial measures. Summary of the invention

[0005] The present application provides a 1D-CNN blood glucose concentration prediction method based on an activation function to solve the technical problems in the prior art of delayed blood glucose concentration prediction results and low prediction accuracy.

[0006] In order to solve the above technical problems, a technical solution adopted in this application is: a 1D-CNN blood glucose concentration prediction method based on activation function, comprising the following steps:

[0007] Obtain Raman spectral data of multiple diabetic patients and perform preprocessing;

[0008] Construct LogModulus activation function;

[0009] Based on the LogModulus activation function, a one-dimensional convolutional neural network is constructed;

[0010] Train a convolutional neural network and make predictions on blood glucose concentration.

[0011] Furthermore, the method of obtaining Raman spectral data of multiple diabetic patients and performing preprocessing includes:

[0012] Collecting first spectrum data of multiple patients in four time periods every day for 30 days and first blood glucose concentration data at corresponding times;

[0013] Identify and delete abnormal values ​​in the first blood glucose concentration data by using standard deviation to obtain second blood glucose concentration data;

[0014] Performing baseline correction and denoising on the first spectral data to obtain second spectral data;

[0015] Performing vector normalization on the second blood glucose concentration data and the second spectrum data to obtain preprocessed data;

[0016] The preprocessed data is divided into training set and test set according to the preset ratio.

[0017] Further, the method of constructing the LogModulus activation function includes:

[0018] Based on formula (1), the LogModulus activation function is obtained; wherein formula (1) is:

[0019]

[0020] Among them, f(x) is the activation function, x is the input value, α is a variable between 0 and 1 and represents the regional connection coefficient.

[0021] Furthermore, based on the LogModulus activation function, a method for constructing a one-dimensional convolutional neural network includes:

[0022] Perform convolution operation on the spectral data to obtain the convolution output neuron;

[0023] Activate the convolution output neurons based on the LogModulus activation function to obtain the convolution activation value;

[0024] Based on the convolution activation value and the average pooling value, the local features in the convolution activation value are filtered to obtain the convolution pooling value;

[0025] Perform batch normalization on the convolutional pooling values ​​to obtain normalized output;

[0026] Based on the sequence expansion layer and flattening layer, the normalized output is reconstructed into a series of feature vector sequences to obtain feature data;

[0027] Construct a fully connected layer based on the weighted aggregation of feature data;

[0028] Based on the fully connected layer, obtain the output layer of the convolutional neural network.

[0029] Furthermore, the method of training a convolutional neural network and predicting blood glucose concentration includes:

[0030] The blood glucose concentration and the corresponding spectral data in the training set are input into the convolutional neural network; after each training segment, the output layer of the convolutional neural network will output the predicted value and accuracy;

[0031] Based on the loss function of the convolutional neural network, update the model parameters of the convolutional neural network;

[0032] In response to the number of training times of each training segment reaching a preset number of times, the model parameters of the training segment with the largest output accuracy are selected as the optimal model parameters of the convolutional neural network, and a second convolutional neural network that has been trained is obtained;

[0033] The blood glucose concentration and the corresponding spectral data in the test set are input into the second convolutional neural network to obtain the predicted value of the blood glucose concentration of the samples in the test set.

[0034] Further, the method for obtaining the loss function of the convolutional neural network includes:

[0035] Based on formula (2), the loss function of the convolutional neural network is obtained; wherein formula (2) is:

[0036]

[0037] in, represents the predicted value of the blood glucose concentration of the i-th sample, y i represents the true value of the blood glucose concentration of the ith sample, and N represents the total number of samples.

[0038] The beneficial effects of the present application are as follows: the present application innovates the activation function that affects the performance of the convolutional neural network and designs a new single-parameter non-monotonic activation function LogModulus. When the negative input decreases, its activation value gradually approaches 0 to maintain sparsity. When the input value x is between -1 and 1, the activation function exhibits modular symmetry, produces symmetrical activation values ​​and gradients, and further reduces the computational cost of this area. When the positive input x>1, LogModulus has an unbounded activation value, which can effectively prevent the gradient vanishing and saturation problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of an embodiment of a 1D-CNN blood glucose concentration prediction method based on an activation function of the present application;

[0040] Figure 2 yes Figure 1 A schematic flow chart of an embodiment of step S1 in FIG.

[0041] Figure 3 yes Figure 1 A schematic flow chart of an embodiment of step S3 in FIG.

[0042] Figure 4 yes Figure 1 A flowchart of an embodiment of step S3 in FIG.

[0043] Figure 5 yes Figure 1 A schematic flow chart of an embodiment of step S4 in FIG.

[0044] Figure 6 The present invention provides a comparative result of an embodiment of the 1D-CNN blood glucose concentration prediction method based on activation function and other activation functions in predicting blood glucose concentration of training sets under the 1D-CNN model.

[0045] Figure 7 The present invention provides a comparative result of an embodiment of the 1D-CNN blood glucose concentration prediction method based on activation function and other activation functions in predicting blood glucose concentration in a test set under the 1D-CNN model. DETAILED DESCRIPTION

[0046] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with specific embodiments.

[0047] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.

[0048] See also Figure 1 , Figure 1 1D-CNN blood glucose concentration prediction method based on activation function is a flowchart of an embodiment of the present invention. The method comprises the following steps:

[0049] Step S1. Acquire Raman spectral data of multiple diabetic patients and perform preprocessing.

[0050] For details, see Figure 2 , Figure 2 yes Figure 1 A flow chart of an embodiment of step S1 in FIG. 1 ; wherein step S1 comprises:

[0051] Step S11. Collect first spectral data of four time periods every day for 30 days and first blood glucose concentration data at corresponding times for multiple patients.

[0052] Specifically, diabetic patients aged between 20 and 60 years old were recruited from the Department of Endocrinology of Odense University Hospital in Denmark, and the first spectral data and the first blood glucose concentration data at the corresponding time were collected from each diabetic patient in four time periods every day for 30 days using a desktop confocal Raman spectrometer.

[0053] Step S12: Identify and delete abnormal values ​​in the first blood glucose concentration data by using the standard deviation to obtain second blood glucose concentration data.

[0054] Step S13: Perform baseline correction and denoising on the first spectral data to obtain second spectral data.

[0055] Specifically, there may be baseline drift in the spectral data, and a baseline correction of local scattered point smoothing is required; the spectral data usually contains noise, which affects the accuracy of the data. The spectral data is denoised using a wavelet denoising method to obtain the second spectral data.

[0056] Step S14: Perform vector normalization on the second blood glucose concentration data and the second spectrum data to obtain preprocessed data.

[0057] Specifically, in the spectral data, the concentration and spectral intensity of the sample may be different, so vector normalization is required to obtain preprocessed data; wherein the preprocessed data includes normalized sugar concentration data and spectral data.

[0058] Step S15: Divide the preprocessed data into a training set and a test set according to a preset ratio.

[0059] Step S2: Construct the LogModulus activation function.

[0060] Specifically, the LogModulus activation function is divided into three segments, namely (-∞, -1), [-1, 1], and (1, +∞); when the negative input x<-1, the activation function formula of this segment is constructed so that the activation value of the function is greater than 0; when -1≤x≤1, the symmetry of the modulus function is used to reduce the computational cost of this area; when the positive input x>1, a calculation formula is constructed to make this area have an unbounded activation value.

[0061] The LogModulus activation function is obtained by formula (1); wherein formula (1) is:

[0062]

[0063] Among them, f(x) is the activation function, x is the input value, a is a variable between 0 and 1 and represents the regional connection coefficient.

[0064] Step S3. Construct a one-dimensional convolutional neural network based on the LogModulus activation function.

[0065] For details, see Figure 3-4 , Figure 3 yes Figure 1 A schematic flow chart of an embodiment of step S3 in FIG. Figure 3 yes Figure 1 Flow chart of an embodiment of step S3 in FIG.

[0066] Wherein step S3 comprises:

[0067] S31. Perform convolution operation on the spectral data to obtain the convolution output neuron g ij .

[0068] Specifically, the spectral data is convolved based on formula (3); wherein formula (3) is:

[0069] g ij =k i *x j +b i (3);

[0070] Among them, k i represents the weight of the i-th convolution kernel, b i represents the deviation of the i-th convolution kernel, x j and g ij They represent the j-th local region and the j-th neuron of the ith convolution output, respectively.

[0071] S32. Activate the convolution output neuron based on the LogModulus activation function to obtain the convolution activation value.

[0072] Specifically, the LogModulus activation function is used for the convolution output neuron g ij Activate, activation function a ij As shown in formula (4):

[0073]

[0074] Among them, a ij Indicates g ij The convolution activation value of .

[0075] S33. Based on the convolution activation value and the average pooling value, filter the local features in the convolution activation value to obtain the convolution pooling value.

[0076] Specifically, an average pooling layer is introduced, and the local features extracted from the convolutional layer are filtered to remove redundancy and obtain the convolutional pooling value; wherein the average pooling layer formula (5) is as follows:

[0077]

[0078] Among them, ω represents the width of the pooling kernel, P ik Represents the convolution pooling value of the kth neuron of the ith convolution output, where the step size of the pooling operation is 3.

[0079] S34. Perform batch normalization on the convolution pooling values ​​to obtain normalized output.

[0080] Specifically, after average pooling, the convolution pooling values ​​are batch normalized using formula (6):

[0081]

[0082] Among them, μ i and σ i They represent the mean and average variance of the input under the i-th convolution kernel, respectively. ε represents a small numerical stability coefficient, which is 0.001; the parameters γ and β are used to adjust the scaling and shift of the normalized input, respectively.

[0083] S35. Based on the sequence expansion layer and the flattening layer, the normalized output is reconstructed into a series of feature vector sequences to obtain feature data.

[0084] Specifically, we construct a sequence expansion layer and a flattening layer to reconstruct the batch normalized output into a series of feature vector sequences, defined as h m (m≤N m ), where N m Indicates the dimension of the output vector of this layer.

[0085] S36. Construct a fully connected layer based on the weighted aggregation of feature data.

[0086] Specifically, a fully connected layer is constructed to perform weighted aggregation on the feature data. The fully connected layer is shown in formula (7):

[0087]

[0088] Among them, y n is the output; W mn is the weight of the fully connected layer; b n Represents the bias value of the fully connected layer; f(x) represents the LogModulus activation function.

[0089] S37. Based on the fully connected layer, obtain the output layer of the convolutional neural network.

[0090] Specifically, the output layer is a real-valued regression of a single neuron; the output value is shown in formula (8):

[0091]

[0092] Among them, α n To normalize the weights, use the softmax function for each input feature to get α n ; b represents the bias value.

[0093] Step S4: training the convolutional neural network and predicting the blood glucose concentration.

[0094] For details, see Figure 5 , Figure 5 yes Figure 1 A flow chart of an embodiment of step S4 in FIG. 1 ; wherein step S4 comprises:

[0095] Step S41. Input the blood glucose concentration and the corresponding spectral data in the training set into the convolutional neural network; after each training segment, the output layer of the convolutional neural network will output the predicted value and accuracy.

[0096] Step S42: Based on the loss function of the convolutional neural network, update the model parameters of the convolutional neural network.

[0097] Specifically, based on formula (2), the loss between the output value of the neural network and the true value is calculated; formula (2) is as follows:

[0098]

[0099] in, represents the predicted value of the blood glucose concentration of the i-th sample, y i represents the true value of the blood glucose concentration of the ith sample, and N represents the total number of samples.

[0100] According to the above loss function, the gradient is optimized and back-propagated to update the model parameters of the neural network.

[0101] Step S43. In response to the number of training times of each training segment reaching a preset number of times, the model parameters of the training segment with the highest output accuracy are selected as the optimal model parameters of the convolutional neural network, and a second convolutional neural network that has completed training is obtained.

[0102] Specifically, when the number of training times of each training segment epoch reaches a preset number, the output accuracy and model parameters of each training segment are obtained; wherein, the model parameters of the training segment with the largest output accuracy are selected as the optimal model parameters of the convolutional neural network, thereby obtaining a second convolutional neural network that has completed training.

[0103] Step S44. Input the blood glucose concentration and the corresponding spectral data in the test set into the second convolutional neural network to obtain the predicted value of the blood glucose concentration of the samples in the test set.

[0104] See also Figure 6-7 In one embodiment, in order to verify the effectiveness of the present invention, MATLAB is used for numerical simulation verification. This embodiment selects Raman spectral data of 35 diabetic patients in four time periods every day for 30 days and the blood glucose concentration at the corresponding time.

[0105] Based on the above Raman spectral data and the blood glucose concentration data at the corresponding time, the prediction performance of Log-Modulus and Mish, Swish, RELU, FPFLU, |X| activation functions were compared under the 1D-CNN model, and RMSE was selected as the evaluation index. The comparison results of the blood glucose concentration prediction of the training set and the test set are shown in the figure. Figure 6 , 7 As shown. In the training set, the convergence speed of Swish, FPFLU and Log-Modulus is faster, but the RMSE of Swish and FPFLU activation functions is significantly higher than that of Log-Modulus. In addition, the training set RMSE of the Log-Modulus activation function is lower than that of the RELU and |X| activation functions, and its prediction performance in the 1D-CNN model is the best. In the test set, the RMSE interval of the Log-Modulus activation function proposed in the present invention is significantly lower than that of the Mish, Swish, RELU, FPFLU and |X| activation functions, and its convergence speed is faster and the prediction performance is better. In summary, the 1D-CNN blood glucose concentration prediction method based on activation function proposed in the present application has good prediction performance and convergence speed, can improve the prediction accuracy of blood glucose concentration, and provide a basis for the treatment of patients.

[0106] This application predicts the blood glucose concentration of the sample based on the Raman spectral data collected, using the 1D-CNN neural network model, and innovates the activation function that affects the performance of the convolutional neural network, and designs a new single-parameter non-monotonic activation function LogModulus. When the negative input decreases, its activation value gradually approaches 0 to maintain sparsity. When the input value x is between -1 and 1, the activation function exhibits modular symmetry, produces symmetrical activation values ​​and gradients, and further reduces the computational cost of this area. When the positive input x>1, LogModulus has an unbounded activation value, which can effectively prevent the gradient from disappearing and saturating. In addition, the application can not only quickly and accurately obtain the blood glucose concentration based on the spectral data, provide technical support for diabetic patients to monitor the blood glucose concentration, but also ensure the stability of the model, which is generally applicable to the diagnosis of various diseases, provides necessary technical support for clinical medicine, and reduces the manpower and material consumption of hospitals.

[0107] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A 1D-CNN blood glucose concentration prediction method based on activation function, characterized in that: The following steps are involved: Obtain Raman spectral data of multiple diabetic patients and perform preprocessing; Construct a LogModulus activation function; wherein, based on formula (1), obtain the LogModulus activation function; wherein, formula (1) is: Among them, f(x) is the activation function, x is the input value, α is a variable between 0 and 1 and represents the regional connection coefficient; Based on the LogModulus activation function, a one-dimensional convolutional neural network is constructed; The convolutional neural network is trained to predict blood glucose concentration.

2. The method according to claim 1, characterized in that The method for obtaining Raman spectral data of multiple diabetic patients and performing preprocessing includes: Collecting first spectrum data of multiple patients in four time periods every day for 30 days and first blood glucose concentration data at corresponding times; Identifying and deleting abnormal values ​​in the first blood glucose concentration data by using standard deviation to obtain second blood glucose concentration data; Performing baseline correction and denoising on the first spectral data to obtain second spectral data; Performing vector normalization on the second blood glucose concentration data and the second spectrum data to obtain preprocessed data; The preprocessed data is divided into a training set and a test set according to a preset ratio.

3. The method according to claim 2, characterized in that The method for constructing a one-dimensional convolutional neural network based on the LogModulus activation function comprises: Performing a convolution operation on the spectral data to obtain a convolution output neuron; Activating the convolution output neuron based on the LogModulus activation function to obtain a convolution activation value; Based on the convolution activation value and the average pooling value, filtering the local features in the convolution activation value to obtain the convolution pooling value; Batch normalizing the convolutional pooling values ​​to obtain normalized outputs; Based on the sequence expansion layer and flattening layer, the normalized output is reconstructed into a series of feature vector sequences to obtain feature data; Constructing a fully connected layer based on the weighted aggregation of the feature data; Based on the fully connected layer, an output layer of the convolutional neural network is obtained.

4. The method according to claim 3, characterized in that: The method for training the convolutional neural network and predicting blood glucose concentration comprises: Inputting the blood glucose concentration and the corresponding spectral data in the training set into the convolutional neural network; wherein after each training segment, the output layer of the convolutional neural network outputs the predicted value and accuracy; Based on the loss function of the convolutional neural network, updating the model parameters of the convolutional neural network; In response to the number of training times of each of the training segments reaching a preset number of times, the model parameters of the training segment with the maximum output accuracy are selected as the optimal model parameters of the convolutional neural network, and a second convolutional neural network that has been trained is obtained; The blood glucose concentration and the corresponding spectral data in the test set are input into the second convolutional neural network to obtain the predicted value of the blood glucose concentration of the samples in the test set.

5. The method according to claim 4, characterized in that The method for obtaining the loss function of the convolutional neural network includes: Based on formula (2), the loss function of the convolutional neural network is obtained; wherein, the formula (2) is: in, represents the predicted value of the blood glucose concentration of the i-th sample, y i represents the true value of the blood glucose concentration of the ith sample, and N represents the total number of samples.

Citation Information

Patent Citations

  • Image target recognition method based on optimized convolution architecture

    CN104517122A

  • Hyperspectral image classification-oriented data adaptive activation function learning method

    CN110443296A