Deep learning processing method suitable for HRV calculation of BCG signal
By using Butterworth bandpass filtering and a deep learning neural network model, the impact of noise and interference signals in BCG signals on HRV calculation was resolved, enabling accurate identification of heartbeat patterns and accurate calculation of HRV.
Patent Information
- Application Number
- CN202410155190.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-04
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-02-04
AI Technical Summary
BCG signals are affected by noise and interference signals when calculating HRV, resulting in large errors in HRV values. Traditional methods are difficult to effectively remove interference and accurately calculate heart rate variability.
Interference signals are filtered out using a Butterworth bandpass filter. Combined with k-Means clustering and a deep learning neural network model, heartbeat patterns are accurately identified by training and correcting peak type labels, and the JJ interval is calculated to obtain HRV.
By automatically correcting clustering errors, the accuracy of peak identification is improved, reliable HRV calculation data is provided, and errors are reduced.
Smart Images

Figure CN118078237B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of BCG signal processing technology, and in particular to a deep learning processing method suitable for HRV calculation of BCG signals. Background Technology
[0002] Compared to other types of devices, monitoring users' HRV data using the BCG method reduces operational complexity and discomfort for the monitored user.
[0003] However, due to the nature of BCG signal acquisition, it inevitably mixes with many other signals, especially respiratory signals and some external interference.
[0004] Interference signals pose significant challenges to calculating HRV from BCG signals. Traditional methods for calculating HRV based on BCG signals analyze the waveform in the time or frequency domain. However, due to signal noise and other interference, the processed data in these domains cannot clearly reflect heart rate information. Therefore, the HRV values obtained using such data inevitably contain substantial errors. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a deep learning processing method suitable for HRV calculation of BCG signals.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] A deep learning processing method for calculating HRV of BCG signals includes the following steps:
[0008] Step 1, bandpass filtering:
[0009] The BCG signal was filtered using a Butterworth bandpass filter.
[0010] After being filtered by a bandpass filter, some of the interference in the original BCG signal was removed, providing a more realistic signal for subsequent signal processing.
[0011] Step 2, Heartbeat Pattern Detection:
[0012] Step 2-1: Extract all peak segments from the filtered BCG signal;
[0013] Step 2-2: Determine the optimal value of k for k-Means clustering;
[0014] The k-value represents the number of peaks in a person's heartbeat cycle. Although the number of peaks in a person's heartbeat cycle is fixed, for any signal collected from a person, it is unknown how many peaks there will be in a heartbeat cycle. It is necessary to find the correct number of peaks, which is the k-value, through hypothesis and verification.
[0015] Steps 2-3: Perform k-Means clustering on all peak segments:
[0016] The optimal value of k is used in k-Means clustering. k-Means clustering is used to cluster all peak segments to obtain the clustering result of each peak segment, and a peak type label is constructed for each peak segment.
[0017] Although the current peak type labels are not entirely accurate, the clustering results are mostly correct, which is sufficient for training the next stage of deep learning neural network models.
[0018] Step 3, train the deep learning neural network model:
[0019] Step 3-1, Construct a deep learning neural network model:
[0020] Building Model Submodule 1:
[0021] Construct one-dimensional convolutional layers Conv1-1 and Conv1-2, and construct maxpooling layers maxpool1-1 and maxpool1-2;
[0022] The output of Conv1-1 is input into maxpool1-1, the output of maxpool1-1 is input into Conv1-2, the output of Conv1-2 is input into maxpool1-2, and the output of maxpool1-2 is a 1x31 matrix V1.
[0023] Building Model Submodule 2:
[0024] Construct one-dimensional convolutional layers Conv2-1 and Conv2-2, and construct maxpooling layers maxpool2-1 and maxpool2-2;
[0025] The output of Conv2-1 is input into maxpool2-1, the output of maxpool2-1 is input into Conv2-2, the output of Conv2-2 is input into maxpool2-2, and maxpool2-2 outputs a 1x31 matrix V2.
[0026] Building Model Submodule 3:
[0027] Construct one-dimensional convolutional layers Conv3-1 and Conv3-2, and construct maxpooling layers maxpool3-1 and maxpool3-2;
[0028] The output of Conv3-1 is input into maxpool3-1, the output of maxpool3-1 is input into Conv3-2, the output of Conv3-2 is input into maxpool3-2, and Maxpool3-2 outputs a 1x25 matrix V3.
[0029] Cross V1 and V2:
[0030] V1 is input to a 31x20x31 multilayer neural network A. The output of the multilayer neural network A is input to the softmax function A1 (the softmax function is a library function in PyTorch, which maps each value to a value between 0 and 1). The output of the softmax function A1 is multiplied by V2 (the corresponding elements of the two matrices are multiplied) and then fused to obtain V4.
[0031] V2 is input to a 31x20x31 multilayer neural network B. The output of the multilayer neural network B is input to a softmax function B1. The output of the softmax function B1 is multiplied by V1 and fused to obtain V5.
[0032] Input V3, V4, and V5 into a multilayer neural network C of 87x30xk:
[0033] V3 (size 1x31), V4 (size 1x31), and V5 (size 1x25) are assembled into a 1x87 matrix V6 using the torch.cat() function in PyTorch. V6 is then input into an 87x30xk multilayer neural network C, which outputs the final peak type. This corrects the error in the peak type of the part after k-means clustering.
[0034] K-Means clustering only provides a rough distinction between peak types and is sometimes inaccurate; however, peaks of the same type should be similar regardless of their location; secondly, the temporal relationship between consecutive peak types remains stable.
[0035] This invention applies peak type labels obtained from K-Means clustering to a deep learning neural network model composed of multiple one-dimensional convolutional networks. The role of the deep learning neural network model is to identify peak types. During classification training, it automatically corrects misclassified labels with correct labels, which can more accurately correct and identify peaks, thereby improving the accuracy and reliability of the data.
[0036] Step 3-2, Train the model:
[0037] Step 3-2-1, Set the input channel data for the peak segment:
[0038] Arrange all the peak segments extracted in step 2-1 into a peak segment sequence according to time order, and let p i For any one of the wave peak segments, set p i The three input channels are: peak segment, peak segment backward subtraction data, and peak history data;
[0039] Step 3-2-2, p i The data, along with its corresponding classification labels, forms the training set and the test set, respectively. The training set is used to train the model, and the test set is used to test the model's accuracy. All data fragments are then input into the deep learning neural network model:
[0040] p i The peak segment of pi is input into model submodule 1, and the peak segment of pi is input into model submodule 2 via backward subtraction. i Peak historical data input model submodule 3;
[0041] The optimizer used is torch.optim.Adam() provided by the deep learning framework PyTorch, with a learning rate of 0.01. The loss function used is torch.nn.CrossEntropyLoss(), and the number of training iterations is set to 1000. The deep learning neural network model is trained, and the accuracy on the test set is calculated after each training round. When the accuracy of the deep learning neural network model on the test set reaches 98% or more, the current deep learning neural network model is saved, and training is complete.
[0042] Save the peak type of each peak segment output by the trained deep learning neural network model;
[0043] Step 4: Find the peak type with the most stable features:
[0044] Calculate the amplitude value of each peak, and select the peak type with the largest amplitude value as the characteristic type;
[0045] Step 5: Use a deep learning neural network model to classify peak types:
[0046] Use step 1 to filter the acquired BCG signal, use step 2-1 to extract all peak segments from the filtered BCG signal, set the input channel data for each peak segment according to step 3-3-1, input the three input channel data of all peak segments into the trained deep learning neural network model, and classify all peak segments by peak type.
[0047] Find the peaks of the waveforms belonging to the feature type in the classification results. The time interval between the peaks is the interval of the feature peaks. Record the interval of the feature peaks as the JJ interval. After obtaining the JJ interval, HRV can be calculated.
[0048] This invention first filters the original BCG signal to remove obvious interference signals, performs K-Means clustering on the low-dimensional representation of each peak segment to classify the peak types, then uses KL divergence to determine the optimal heartbeat pattern, and finally uses K-Means clustering to obtain pseudo-labels of the heartbeat pattern peak types. A deep learning neural network model is used to correct the pseudo-labels of the peak types, thereby correctly classifying signals of the same type and providing reliable signal information for calculating HRV.
[0049] Preferably, step 2-1 includes the following specific steps:
[0050] On the time axis of the BCG signal, a window of 21 points is slid. If the values of the 10 points to the left and the 10 points to the right of the center point of the 21 points are all smaller than the value of the center point, then the center point is considered to be the highest point of a wave peak. Taking the highest point of the above wave peak as the center, a signal segment lasting 1 second is taken, and an input vector of length n is formed with each peak as the center.
[0051] The input vector is represented as u = [u1, u2, ..., u...]. n The inverse difference of u can be expressed as v = [u2 - u1, u3 - u2, ..., u] n -u n-1 ].
[0052] Preferably, step 2-2 includes the following specific steps:
[0053] Let the initial value of k be 2;
[0054] Step 2-2-1: Perform k-means clustering on all peak segments to classify them into k peak types: type 0, type 1, ..., type k-1; calculate the percentage of each peak type, and represent the probability distribution of the peak proportions of type 0, type 1, ..., type k-1 as Pr(k), where Pr(k) = {pr0, pr1, ..., pr...} k-1}, save Pr(k); pr0,pr1,…,pr k-1 These represent the probabilities of type 0, type 1, ..., type k-1, respectively.
[0055] Theoretically, there are two peaks in a heartbeat cycle, and these two peaks can be divided into two peak types. The probability of each peak type is 50%, that is, the distribution proportion of each peak type is 1 / k. When k=2, the corresponding theoretical distribution is denoted as Pt(2)={pt0,pt1}.
[0056] When k=6, the probability distributions of each peak type Pr(2), Pr(3), Pr(4), Pr(5) and Pr(6) for k=2, 3, 4, 5 and 6 are obtained, and then proceed to step 2-2-3;
[0057] Step 2-2-2: Increment the value of k by 1, then return to step 2-2-1;
[0058] Step 2-2-3,
[0059] Calculate the KL divergence D using the following formula. KL (P r ||P t ):
[0060]
[0061] Among them, pt I The theoretical probability of the peak type is given by k1 = 2, 3, 4, 5, 6.
[0062] KL divergence is used to measure the similarity between two probability distributions. KL divergence is non-negative and is zero if and only if the two distributions are exactly the same. The larger the value of KL divergence, the less similar the two distributions are.
[0063] Theoretically, there are k peaks in a heartbeat cycle, and theoretically, the distribution of each peak type is 1 / k. When k = 1, the theoretical probability distribution corresponding to the k peak types is denoted as P. t (I).
[0064] Five KL divergences D were obtained. KL (P r ||P t Select all KL divergences D KL (P r ||P t The minimum value D in ) KLmin If D KLmin If <0.1, then it will be related to D. KLmin The corresponding value of k1 is taken as the optimal value of k;
[0065] When there is only one peak in a heartbeat cycle, observing the KL divergence value reveals that the calculated KL divergence value increases with the value of k as k = 2, 3, 4, 5... This is because when there is only one peak in a heartbeat cycle, and k is greater than 1, the percentage of one type in the k-means clustering result is close to 100%, while the percentages of other types are close to 0%. However, in the corresponding theoretical probability distribution, the proportion of each peak type is 1 / k. The KL divergence calculated from the actual probability distribution and the theoretical probability distribution will be very large. When it is found that the larger the value of k, the larger the KL divergence, that is, the larger the error, it can be determined that the value of k is actually equal to 1.
[0066] Therefore, if D KLmin If the value of k is greater than or equal to 0.1, and the larger the value of k is, the greater the KL divergence, then the optimal value of k is determined to be 1.
[0067] K-Means clustering eliminates the need for manual labeling of peak types, classifying peaks based on their characteristics. KL divergence is then used to compare and measure different clustering patterns to find the optimal and most accurate heartbeat pattern. This allows for more precise acquisition of heartbeat signal patterns and characteristics, providing accurate data for calculating HRV.
[0068] Traditional HRV calculation methods are based on the RR interval of heartbeat information. When using ECG signals, the RR interval signal is relatively easy to obtain. However, due to the acquisition limitations of BCG signals, the RR interval information is very weak and difficult to extract. Research has found that when signal quality is guaranteed, the JJ interval in BCG can be comparable to the RR interval in ECG. As long as the same type of peaks can be distinguished, it can be used to calculate HRV.
[0069] The pattern of the heartbeat BCG signal of the same person is relatively fixed. Within a heartbeat cycle, the number of peaks may be 1, 2, 3, 4, 5, or 6. When there are two or more peaks within a heartbeat cycle, the type of each peak is different. Therefore, it is only necessary to find the peak with the most stable characteristics within each heartbeat cycle, and then monitor the time when this type of peak appears during actual monitoring. Based on the time when this type of peak appears, the time interval of the specific peak can be calculated, and the HRV can be calculated.
[0070] Preferably, step 1 also includes the following:
[0071]
[0072] H(s) is the transfer function of the Butterworth bandpass filter;
[0073] s is a complex variable, usually represented by jω; j is the imaginary unit, ω represents the frequency, K is the gain coefficient of the Butterworth bandpass filter, and ω c It is the normalized cutoff frequency of the Butterworth bandpass filter, representing the frequency at ω. c The amplitude-frequency response of the lower Butterworth bandpass filter decreases to The cutoff value is a multiple of the filter order, where m is the filter order.
[0074] Therefore, the present invention has the following beneficial effects: it can automatically correct labels that are incorrectly classified in K-Means clustering, can more accurately correct and identify peak values, and can extract accurate JJ intervals, providing a reliable data foundation for accurate HRV calculation. Attached Figure Description
[0075] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0076] The present invention will now be further described with reference to the accompanying drawings and specific embodiments.
[0077] like Figure 1 The illustrated embodiment is a deep learning processing method for calculating HRV of BCG signals, comprising the following steps:
[0078] Step 1, bandpass filtering:
[0079]
[0080] H(s) is the transfer function of the Butterworth bandpass filter;
[0081] s is a complex variable, usually represented by jω; j is the imaginary unit, ω represents the frequency, K is the gain coefficient of the Butterworth bandpass filter, and ω c It is the normalized cutoff frequency of the Butterworth bandpass filter, representing the frequency at ω. c The amplitude-frequency response of the lower Butterworth bandpass filter decreases to The cutoff value is a multiple of the filter order, where m is the filter order.
[0082] The BCG signal was filtered using a Butterworth bandpass filter.
[0083] Step 2, Heartbeat Pattern Detection:
[0084] Step 2-1: Extract all peak segments from the filtered BCG signal;
[0085] On the time axis of the BCG signal, a window of 21 points is slid. If the values of the 10 points to the left and 10 points to the right of the center point of the 21 points are all smaller than the value of the center point, then the center point is considered to be the highest point of a peak. Taking the highest point of the above peak as the center, a signal segment lasting 1 second is taken (sampling rate 125Hz, 62 points to the left and 62 points to the right of the highest point, plus the center point, for a total of 125 points). An input vector of length 125 is formed with each peak as the center.
[0086] The input vector is represented as u = [u1, u2, ..., u...]. n The inverse difference of u can be expressed as v = [u2 - u1, u3 - u2, ..., u] n -u n-1 ], n = 125;
[0087] Step 2-2: Determine the optimal value of k for k-Means clustering;
[0088] Let the initial value of k be 2;
[0089] Step 2-2-1: Perform k-means clustering on all peak segments to classify them into k peak types: type 0, type 1, ..., type k-1; calculate the percentage of each peak type, and represent the probability distribution of the peak proportions of type 0, type 1, ..., type k-1 as Pr(k), where Pr(k) = {pr0, pr1, ..., pr...} k-1}, save Pr(k); pr0,pr1,…,pr k-1 These represent the probabilities of type 0, type 1, ..., type k-1, respectively.
[0090] When k=2, k-means clustering classifies all peak segments into type 0 and type 1.
[0091] The information of two peaks in a heartbeat cycle is not exactly the same. Therefore, there are usually several peaks in a heartbeat cycle. After k-means clustering, they will be divided into several peak types. There are a maximum of 6 peaks in a heartbeat cycle.
[0092] When k=6, the probability distributions of each peak type Pr(2), Pr(3), Pr(4), Pr(5) and Pr(6) for k=2, 3, 4, 5 and 6 are obtained, and then proceed to step 2-2-3;
[0093] Step 2-2-2: Increment the value of k by 1, then return to step 2-2-1;
[0094] Step 2-2-3,
[0095] Calculate the KL divergence D using the following formula.KL (P r ||P t ):
[0096]
[0097] Among them, pt I The theoretical probability of the peak type is given by k1 = 2, 3, 4, 5, 6.
[0098] Five KL divergences D were obtained. KL (P r ||P t Select all KL divergences D KL (P r ||P t The minimum value D in ) KLmin If D KLmin If <0.1, then it will be related to D. KLmin The corresponding value of k1 is taken as the optimal value of k;
[0099] If D KLmin If the value of k is greater than or equal to 0.1, and the larger the value of k is, the greater the KL divergence, then the optimal value of k is determined to be 1.
[0100] Once the optimal value of k is determined, we know that there are k peaks in a heartbeat cycle, and the heartbeat pattern is thus determined.
[0101] Steps 2-3: Perform k-Means clustering on all peak segments:
[0102] The optimal value of k is used in k-Means clustering. k-Means clustering is used to cluster all peak segments to obtain the clustering result of each peak segment, and a peak type label is constructed for each peak segment.
[0103] Step 3, train the deep learning neural network model:
[0104] Step 3-1, Construct a deep learning neural network model:
[0105] Building Model Submodule 1:
[0106] Construct two one-dimensional convolutional layers, Conv1-1 and Conv1-2. The kernel structure of both Conv1-1 and Conv1-2 is 1x3, the number of channels of both Conv1-1 and Conv1-2 is 1, and the padding of both Conv1-1 and Conv1-2 is 1. Construct two max pooling layers, maxpool1-1 and maxpool1-2. The max pooling kernel of both maxpool1-1 and maxpool1-2 is 1x2, and the stride of both maxpool1-1 and maxpool1-2 is 2.
[0107] The output of Conv1-1 is input into maxpool1-1, the output of maxpool1-1 is input into Conv1-2, the output of Conv1-2 is input into maxpool1-2, and the output of maxpool1-2 is a 1x31 matrix V1.
[0108] Building Model Submodule 2:
[0109] Construct two one-dimensional convolutional layers, Conv2-1 and Conv2-2. Both Conv2-1 and Conv2-2 have a 1x3 kernel structure, 1 channel, and 1 padding. Construct two max-pooling layers, maxpool2-1 and maxpool2-2. Both maxpool2-1 and maxpool2-2 have a 1x2 kernel and a stride of 2.
[0110] The output of Conv2-1 is input into maxpool2-1, the output of maxpool2-1 is input into Conv2-2, the output of Conv2-2 is input into maxpool2-2, and maxpool2-2 outputs a 1x31 matrix V2.
[0111] Building Model Submodule 3:
[0112] Construct two one-dimensional convolutional layers, Conv3-1 and Conv3-2. The kernel structure of both Conv3-1 and Conv3-2 is 1x3, the number of channels of both Conv3-1 and Conv3-2 is 4, and the padding of both Conv3-1 and Conv3-2 is 2. Construct two max pooling layers, maxpool3-1 and maxpool3-2. The max pooling kernel of both maxpool3-1 and maxpool3-2 is 1x2, and the stride of both maxpool3-1 and maxpool3-2 is 2.
[0113] The output of Conv3-1 is input into maxpool3-1, the output of maxpool3-1 is input into Conv3-2, the output of Conv3-2 is input into maxpool3-2, and Maxpool3-2 outputs a 1x25 matrix V3.
[0114] Cross V1 and V2:
[0115] V1 is input to a 31x20x31 multilayer neural network A. The output of multilayer neural network A is input to a softmax function A1. The output of softmax function A1 is multiplied with V2 and fused to obtain V4.
[0116] V2 is input to a 31x20x31 multilayer neural network B. The output of the multilayer neural network B is input to a softmax function B1. The output of the softmax function B1 is multiplied by V1 and fused to obtain V5.
[0117] Input V3, V4, and V5 into a multilayer neural network C of 87x30xk:
[0118] V3 (size 1x31), V4 (size 1x31), and V5 (size 1x25) are assembled into a 1x87 matrix V6 using the torch.cat() function of PyTorch. V6 is then input into an 87x30xk multilayer neural network C, which outputs the final peak type.
[0119] Step 3-2, Train the model:
[0120] Step 3-2-1, Set the input channel data for the peak segment:
[0121] Arrange all the peak segments extracted in step 2-1 into a peak segment sequence according to time order, and let p i For any one of the wave peak segments, set p i The three input channels are: peak segment, peak segment backward subtraction data, and peak history data;
[0122] p i Peak segment:
[0123] The peak segment contains the peak value. There are 125 points in total, including and around them;
[0124] p i Backward subtraction data:
[0125] p i Peak historical data:
[0126] Where i is the sequence number of the wave crest segment, and h represents the position of the J wave crest point;
[0127] Step 3-2-2, use p i The data, along with its corresponding classification labels, forms the training set and the test set, respectively. The training set is used to train the model, and the test set is used to test the model's accuracy. All data fragments are then input into the deep learning neural network model:
[0128] p i The peak segment of pi is input into model submodule 1, and the peak segment of pi is input into model submodule 2 via backward subtraction. i Peak historical data input model submodule 3;
[0129] The optimizer used is torch.optim.Adam() provided by the deep learning framework PyTorch, with a learning rate of 0.01. The loss function used is torch.nn.CrossEntropyLoss(), and the number of training iterations is set to 1000. The deep learning neural network model is trained, and the accuracy on the test set is calculated after each training round. When the accuracy of the deep learning neural network model on the test set reaches 98% or more, the current deep learning neural network model is saved, and training is complete.
[0130] Save the peak type of each peak segment output by the trained deep learning neural network model;
[0131] Step 4: Find the peak type with the most stable features:
[0132] Calculate the amplitude value of each peak, and select the peak type with the largest amplitude value as the characteristic type;
[0133] Step 5: Use a deep learning neural network model to classify peak types:
[0134] Use step 1 to filter the acquired BCG signal, use step 2-1 to extract all peak segments from the filtered BCG signal, set the input channel data for each peak segment according to step 3-3-1, input the three input channel data of all peak segments into the trained deep learning neural network model, and classify all peak segments by peak type.
[0135] Find the peaks of the waveforms that belong to the feature type in the classification results. The time interval between the peaks is the interval of the feature peaks, denoted as the JJ interval.
[0136] SDNN metrics for calculating HRV:
[0137] First, calculate the mean of adjacent RR intervals: MeanNN
[0138]
[0139] Where N represents the sample size, JJ i1 This represents the i1th JJ interval.
[0140] Then, calculate the standard deviation of the adjacent JJ interval using SDNN:
[0141]
[0142] SDNN represents the standard deviation NN interval, and SDNN is a measure of the variability of the JJ interval.
[0143] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A deep learning processing method suitable for HRV calculation of BCG signals, characterized in that, Includes the following steps: Step 1, bandpass filtering: The BCG signal was filtered using a Butterworth bandpass filter. Step 2, Heartbeat Pattern Detection: Step 2-1: Extract all peak segments from the filtered BCG signal; Step 2-2, determine the optimal value of k for k-Means clustering: Let the initial value of k be 2; Step 2-2-1: Perform k-means clustering on all peak segments to classify them into k peak types: type 0, type 1, ..., type k-1; calculate the percentage of each peak type, and represent the probability distribution of the peak percentages of type 0, type 1, ..., type k-1 as Pr(k). Store Pr(k); These represent the probabilities of type 0, type 1, ..., type k-1, respectively. When k=6, the probability distributions of each peak type Pr(2), Pr(3), Pr(4), Pr(5) and Pr(6) for k=2, 3, 4, 5 and 6 are obtained, and then proceed to step 2-2-3; Step 2-2-2: Increment the value of k by 1, then return to step 2-2-1; Step 2-2-3, Calculate the KL divergence using the following formula : in, The theoretical probability of the peak type is given by k1 = 2, 3, 4, 5, 6. Five KL divergences were obtained. Select all KL divergences minimum value ,if <0.1, then it will be with The corresponding value of k1 is taken as the optimal value of k; if If the value of k is greater than or equal to 0.1, and the larger the value of k is, the greater the KL divergence, then the optimal value of k is determined to be 1. Steps 2-3: Perform k-Means clustering on all peak segments: The optimal value of k is used in k-Means clustering. k-Means clustering is used to cluster all peak segments to obtain the clustering result of each peak segment, and a peak type label is constructed for each peak segment. Step 3, train the deep learning neural network model: Step 3-1, Construct a deep learning neural network model: Building Model Submodule 1: Construct one-dimensional convolutional layers Conv1-1 and Conv1-2, and construct maxpooling layers maxpool1-1 and maxpool1-2; The output of Conv1-1 is input into maxpool1-1, the output of maxpool1-1 is input into Conv1-2, the output of Conv1-2 is input into maxpool1-2, and the output of maxpool1-2 is a 1x31 matrix V1. Building Model Submodule 2: Construct one-dimensional convolutional layers Conv2-1 and Conv2-2, and construct maxpooling layers maxpool2-1 and maxpool2-2; The output of Conv2-1 is input into maxpool2-1, the output of maxpool2-1 is input into Conv2-2, the output of Conv2-2 is input into maxpool2-2, and maxpool2-2 outputs a 1x31 matrix V2. Building Model Submodule 3: Construct one-dimensional convolutional layers Conv3-1 and Conv3-2, and construct maxpooling layers maxpool3-1 and maxpool3-2; The output of Conv3-1 is input into maxpool3-1, the output of maxpool3-1 is input into Conv3-2, the output of Conv3-2 is input into maxpool3-2, and Maxpool3-2 outputs a 1x25 matrix V3. Cross V1 and V2: V1 is input to a 31x20x31 multilayer neural network A. The output of multilayer neural network A is input to a softmax function A1. The output of softmax function A1 is multiplied with V2 and fused to obtain V4. V2 is input to a 31x20x31 multilayer neural network B. The output of the multilayer neural network B is input to a softmax function B1. The output of the softmax function B1 is multiplied by V1 and fused to obtain V5. Input V3, V4, and V5 into a multilayer neural network C of 87x30xk: V3, V4, and V5 are assembled into a 1x87 matrix V6 using the torch.cat() function of PyTorch. V6 is then input into an 87x30xk multilayer neural network C, which outputs the final peak type. Step 3-2, Train the model: Step 3-2-1, Set the input channel data for the peak segment: Arrange all the peak segments extracted in step 2-1 into a peak segment sequence according to time order, and let p i For any one of the wave peak segments, set p i The three input channels are: peak segment, peak segment backward subtraction data, and peak history data; Step 3-2-2, p i The data, along with its corresponding classification labels, forms the training set and the test set, respectively. The training set is used to train the model, and the test set is used to test the model's accuracy. All data fragments are then input into the deep learning neural network model: p i The peak segment of pi is input into model submodule 1, and the peak segment of pi is input into model submodule 2 via backward subtraction. i Peak historical data input model submodule 3; The optimizer used is torch.optim.Adam() provided by the deep learning framework PyTorch, with a learning rate of 0.
01. The loss function used is torch.nn.CrossEntropyLoss(), and the number of training iterations is set to 1000. The deep learning neural network model is trained, and the accuracy on the test set is calculated after each training round. When the accuracy of the deep learning neural network model on the test set reaches 98% or more, the current deep learning neural network model is saved, and training is complete. Save the peak type of each peak segment output by the trained deep learning neural network model; Step 4: Find the peak type with the most stable features: Calculate the amplitude value of each peak, and select the peak type with the largest amplitude value as the characteristic type; Step 5: Use a deep learning neural network model to classify peak types: Use step 1 to filter the acquired BCG signal, use step 2-1 to extract all peak segments from the filtered BCG signal, set the input channel data for each peak segment according to step 3-3-1, input the three input channel data of all peak segments into the trained deep learning neural network model, and classify all peak segments by peak type.
2. The deep learning processing method for HRV calculation of BCG signals according to claim 1, characterized in that, Step 2-1 includes the following specific steps: On the time axis of the BCG signal, a window of 21 points is slid. If the values of the 10 points to the left and the 10 points to the right of the center point of the 21 points are all smaller than the value of the center point, then the center point is considered to be the highest point of a wave peak. Taking the highest point of the above wave peak as the center, a signal segment lasting 1 second is taken, and an input vector of length n is formed with each peak as the center. The input vector is represented as u = [u1, u2, ..., u...]. n The inverse difference of u can be expressed as v = [u2-u1, u3-u2, ..., u] n -u n-1 ].
3. The deep learning processing method for HRV calculation of BCG signals according to claim 1 or 2, characterized in that, Step 1 also includes the following: H(s) is the transfer function of the Butterworth bandpass filter; s is a complex variable, usually represented by jω; j is the imaginary unit, ω represents the frequency, and K is the gain coefficient of the Butterworth bandpass filter. It is the normalized cutoff frequency of the Butterworth bandpass filter, indicating that at... The amplitude-frequency response of the lower Butterworth bandpass filter drops to 1 / The cutoff value is a multiple of the filter order, where m is the filter order.
Citation Information
Patent Citations
BCG signal heart rate extraction method based on neural network
CN110801212A
Myocardial infarction recognition and classification method based on frequency domain features and deep learning
CN112633195A
