BCG signal heart rate calculation method based on fast Fourier transform and convolutional neural network

By combining fast Fourier transform and convolutional neural network, the DTW algorithm is used to remove noise, and the problem of poor BCG signal processing in the prior art is solved, and the accurate heart rate calculation of body-motor BCG signals is realized.

CN120052841AActive Publication Date: 2025-05-30LIAONING UNIVERSITY
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202510142318.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-10
Publication Date
2025-05-30
Estimated Expiration
2045-02-10

AI Technical Summary

Technical Problem

Existing BCG signal processing methods are difficult to effectively resist noise interference such as breathing, body movement, and dialogue, resulting in poor robustness in heart rate calculation.

Method used

Using a combination of fast Fourier transform and convolutional neural network, some BCG signals with excessive noise are removed through the DTW algorithm, and the heart rate calculation is performed on the qualified signal.

Benefits of technology

Accurate heart rate calculation for BCG signals with certain body movements is realized, reducing the impact of noise interference on heart rate prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120052841A_ABST
    Figure CN120052841A_ABST
Patent Text Reader

Abstract

The invention discloses a BCG signal heart rate calculation method based on fast Fourier transform and a convolutional neural network. The BCG signal heart rate calculation method comprises the following steps: 1) filtering a BCG signal to obtain a BCG signal BCGF; 2) screening the BCGF signals, calculating waveform similarity, and screening signals lower than or equal to a threshold value y; 3) performing index movement standardization on the screened BCGF signals; (4) carrying out fast Fourier transform on the BCGStandard signal obtained in the step (3); and (5) inputting the BCGStandard signal and the BCGfft obtained in the step (4) into a convolutional neural network model to obtain a heart rate value of the BCG signal. By means of the method, part of BCG signals with overlarge noise are removed, and meanwhile the heart rate of the BCG signals with certain body movement can be accurately predicted due to the participation of fast Fourier transform and the convolutional neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vital sign monitoring, and relates to a method for calculating the heart rate of BCG signals based on the fast Fourier transform and the convolutional neural network. Background Art

[0002] The ballistocardiogram (BCG) signal is a signal formed by measuring the minute changes in the body surface pressure of the human body through a sensor, and contains information such as human heart movement, breathing, and movement. It can be used as a non-contact method for monitoring heart activities.

[0003] In the current usage process, there is no suitable method for screening BCG signals, and there is no clear boundary for screening out the required signals for signals with excessive noise. At the same time, the existing BCG signal for predicting heart rate has poor robustness and is easily interfered by noises such as breathing, body movement, and conversation. Therefore, it is very necessary to develop a heart rate calculation method that can resist noises such as breathing, body movement, and conversation. Summary of the Invention

[0004] The purpose of the present invention is to provide a method for calculating the heart rate of BCG signals based on the fast Fourier transform and the convolutional neural network. This method uses the DTW algorithm to remove some BCG signals with excessive noise, and calculates the heart rate of qualified BCG signals with high accuracy through the convolutional neural network. At the same time, due to the participation of the short-time Fourier transform, the heart rate can also be accurately calculated for BCG signals with a certain amount of body movement.

[0005] The technical solution adopted by the present invention is as follows: A method for calculating the heart rate of BCG signals based on the fast Fourier transform and the convolutional neural network:

[0006] Step 1) Filter the BCG signal with a length of n to obtain the filtered BCG signal BCG_F;

[0007] BCG = {x(1), x(2), x(3), …, x(n)}

[0008] BCG_F = Filter_BCG(BCG)

[0009] The Filter_BCG function filters the BCG signal with a Butterworth filter having a bandwidth of 0.8 Hz - 25 Hz, filters out the low-frequency and high-frequency signals, and the obtained result is denoted as BCG_F;

[0010] The specific method in the above step 1) is: Signals below 0.8 Hz are regarded as low-frequency signals, and signals above 25 Hz are regarded as high-frequency signals.

[0011] Step 2) Screen the BCG_F signal, calculate the waveform similarity of the BCG_F signal, and screen the BCG_F signals less than or equal to the threshold y.

[0012] In the said step 2), the method for calculating the waveform similarity is the dynamic time warping method, and the steps are as follows:

[0013] First, divide the BCG_F signal according to the length m, calculate the dynamic time warping distance between each part of the divided BCG_F signal and the previous part of the BCG_F signal, sum up the dynamic time warping distances of all parts of the obtained BCG_F signals (except the first part of the BCG_F signal) and the previous part of the BCG_F signal, and regard the obtained sum as the dynamic time warping distance BCG_DTW for a single signal;

[0014] Screen the dynamic time warping distance BCG_DTW obtained for a single signal. If the obtained value is higher than the set value y, then no further analysis will be performed on this data, and it is considered that there is still a high noise impact after filtering this data, and the obtained heart rate value will have a high deviation.

[0015] Step 3) Perform exponential moving standardization processing on the BCG_F signals screened in step 2:

[0016] BCG_standardize = scale_BCG(BCG_F)

[0017] The scale_BCG function consists of the following 3 formulas:

[0018] EMA_current = α × value + (1 - α) × EMA_previous

[0019]

[0020] z_score = (value - EMA_current) / (EMA_sdc)

[0021] Among them, EMA_current is the mean value of the exponential moving average at the current time point, EMA_previous is the mean value of the exponential moving average at the previous time point, EMA_sdc is the standard deviation of the exponential moving average at the current time point, EMA_sdp is the standard deviation of the exponential moving average at the previous time point, α is the decay factor, value is the data value at the current time point, and the obtained z_score constitutes the BCG_standardize sequence in order, and this sequence is denoted as the BCG_standardize signal.

[0022] Step 4) Perform Fourier transform on the BCG_standardize signal obtained in Step 3:

[0023] The fft_BCG function is decomposed into the following 6 formulas. In the following formulas, e represents the base of the natural logarithm, i is the imaginary unit, and the argmax function is used to find the value of the independent variable that makes the function reach its maximum value. In the FFT formula, x(n) represents the original data sequence, N is the total number of data points, and k is the frequency index:

[0024] n = n sample_time ×f sample

[0025] where n is the total number of data points, n sample_time is the sampling time, and f sample is the sampling frequency;

[0026]

[0027] where f s (i) is the i-th sampling frequency, and n is the total number of data points;

[0028]

[0029] where here f min and f max are the minimum and maximum values of the frequency respectively, idx min and idx max are the indices of the first sampling frequencies greater than or equal to f min and f max respectively;

[0030]

[0031] where sig_fft(k) is the value of the Fourier transform of the data x(n) at the k-th frequency point, and N is the total number of data points;

[0032]

[0033] where result(k) is the value of the normalized FFT at the k-th frequency point;

[0034] The fft_BCG function calculates the FFT result of the BCG_standardize signal and outputs the normalized amplitude spectrum within the specified frequency range of the FFT result, and records the obtained normalized amplitude spectrum as BCG_fft.

[0035] Step 5) Input the BCG_standardize signal and BCG_fft into the convolutional neural network model to obtain the heart rate value of the BCG signal.

[0036] First, input the BCG_F signal into a convolutional neural network for processing. The convolutional neural network contains 14 convolutional layers. The number of output channels in the convolutional layers increases from 1 to 512 in a non - negative growth manner. The size of the feature map gradually decreases as the network deepens, and the depth of the features gradually increases. The obtained result is denoted as x3, and x3 is flattened.

[0037] Then, process it through the first fully - connected layer to obtain the result BCG_FCL. Flatten BCG_fft, then combine the flattened BCG_fft with BCG_FCL and input them into the second fully - connected layer to obtain the final heart rate value.

[0038] The beneficial effects of the present invention are as follows: Through the above - mentioned method, the present invention can remove some BCG signals with excessive noise through the DTW algorithm. At the same time, due to the participation of the fast Fourier transform and the convolutional neural network, the heart rate can also be accurately predicted for BCG signals with certain body movements. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of the present invention.

[0040] Figure 2 It is a waveform diagram of a BCG signal screened out by the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0041] In the process of specific implementation, the present invention needs to be imported into a terminal that can perform analysis (such as Raspberry Pi 4). This terminal needs to input the collected BCG signal into the present invention. Taking 15 s as the division length, for prediction, generally, a BCG signal with a time length of 15 s is stored in the memory. If the time length of the BCG signal is longer than 15 s, continuous and uninterrupted heart rate monitoring can also be carried out, and the processor processes the stored BCG signal.

[0042] The specific process of the method for calculating the heart rate of BCG signals based on the fast Fourier transform and the convolutional neural network according to the present invention is as Figure 1 shown, and the specific method includes:

[0043] Step 1: Filter the BCG signal to obtain the filtered BCG signal BCG_F:

[0044] BCG = {x(1), x(2), x(3), …, x(n)}

[0045] BCG_F = Filter_BCG(BCG) = {x_f(1), x_f(2), x_f(3), …, x_f(n)}

[0046] The Filter_BCG function filters the BCG signal using a Butterworth filter to remove low-frequency and high-frequency signals, and the resulting signal is denoted as BCG_F.

[0047] Step 2: Screen the obtained BCG_F signal and calculate the waveform similarity of the obtained BCG_F signal using the dynamic time warping method:

[0048] BCG_DTW = dtw_distance(BCG_F)

[0049] The dtw_distance function first divides the BCG_F signal according to the length m, calculates the dynamic time warping distance between each part of the divided BCG_F signal and the previous segment of the BCG_F signal, sums them up, and regards the obtained sum as the dynamic time warping distance BCG_DTW for a single signal.

[0050] The dynamic time warping algorithm can be summarized as the following steps:

[0051] Initialize the cumulative distance matrix dtw_matrix, whose size is (len_a + 1) * (len_b + 1), and set infinity on the boundaries of the matrix, except for the position (0, 0) which is set to 0.

[0052] Traverse the two sequences, calculate the local distance (here it is the Euclidean distance) between each pair of elements, and update the cumulative distance matrix.

[0053] The update rule can be expressed by the following formula: For each element a_i of the sequence series_a and each element b_j of the sequence series_b, calculate the local distance cost, where cost is the absolute value of the difference between a_i and b_j. Then, update the element (i, j) of the cumulative distance matrix dtw_matrix as:

[0054] dtw_matrix[i, j] = cost + min(dtw_matrix[i - 1, j], dtw_matrix[i, j - 1], dtw_matrix[i - 1, j - 1])

[0055] Where the min function represents finding the minimum value among them.

[0056] The final DTW distance is the element in the lower right corner of the cumulative distance matrix dtw_matrix[len_a, len_b].

[0057] The dynamic time warping distance BCG_DTW obtained for a single signal is screened. If the obtained value is higher than a specific value y, then for this data, further analysis will not be continued, but it is determined that there is still a high noise impact after filtering this data, and the obtained heart rate value may have a high deviation. Figure 2 That is, it is an example with poor BCG signal data screened out through step 2. It can be more clearly seen from the waveform diagram that there are sections of the BCG signal severely affected by noise. At the same time, the error between the heart rate value obtained by predicting through the method of the present invention and the actual heart rate value is 26, and the error is very large.

[0058] Step 3, perform exponential moving normalization on the BCG_F signal screened through step 2:

[0059] BCG_standardize = scale_BCG(BCG_F)

[0060] The scale_BCG function consists of the following 3 formulas:

[0061] EMA_current = α × value + (1 - α) × EMA_previous

[0062]

[0063] z_score = (value - EMA_current) / (EMA_sdc)

[0064] Among them, EMA_current is the mean of the exponential moving average at the current time point, EMA_previous is the mean of the exponential moving average at the previous time point, EMA_sdc is the standard deviation of the exponential moving average at the current time point, EMA_sdp is the standard deviation of the exponential moving average at the previous time point, EMA is the mean of the exponential moving average, α is the decay factor, and value is the data value at the current time point. The sequence formed by the obtained z_score in sequence is BCG_standardize, and this sequence is denoted as the BCG_standardize signal.

[0065] Step 4, perform short-time Fourier transform on the BCG_standardize signal screened through step 2:

[0066] BCG_fft = fft_BCG(BCG_F)

[0067] The fft_BCG function can be decomposed into the following six formulas. In the following formulas, e represents the base of the natural logarithm, i is the imaginary unit, and the argmax function is used to find the value of the independent variable that maximizes the function. In the FFT formula, x(n) represents the original data sequence, N is the total number of data points, and k is the frequency index:

[0068] n = n sample_time ×f sample

[0069] Among them, n is the total number of data points, n sample_time is the sampling time, and f sample is the sampling frequency;

[0070]

[0071] Among them, f s (i) is the i-th sampling frequency, and n is the total number of data points;

[0072]

[0073] Among them, here f min and f max are the minimum value 0.8 and the maximum value 2.9 of the frequency respectively, idx min and idx max are the indices of the first sampling frequencies greater than or equal to f min and f max respectively;

[0074]

[0075] Among them, sig_fft(k) is the value of the Fourier transform of the data x(n) at the k-th frequency point, and N is the total number of data points;

[0076]

[0077] Among them, result(k) is the value of the normalized FFT at the k-th frequency point.

[0078] The fft_BCG function calculates the FFT result of the BCG_standardize signal and outputs the normalized amplitude spectrum of the FFT result within the specified frequency range. The obtained normalized amplitude spectrum is denoted as BCG_fft;

[0079] Step 5: Input the BCG_standardize signal into the convolutional neural network model constructed with the BCG_fft input. First, input the BCG_F signal into the convolutional neural network for processing, and denote the result as x3. Flatten x3, then process it through the first fully connected layer to obtain the result BCG_FCL. Flatten the BCG_fft signal and denote it as x2. Then combine x2 and BCG_FCL and input them into the second fully connected layer to obtain the final heart rate value.

[0080] The convolutional neural network contains 14 convolutional layers. The output channels in the convolutional layers increase from 1 to 512 in a non - negative growth manner. The size of the feature map gradually decreases as the network deepens, while the depth (number of channels) of the features gradually increases.

[0081] Table 1: Table of related parameter settings for convolutional layers

[0082]

[0083] After these 14 convolutional layers are 2 fully connected layers, and both fully connected layers use the Mish activation function.

[0084] Table 2: Configuration table for fully connected layers

[0085]

[0086] When it is determined that the quality of the BCG signal is good in the present invention, the execution of Step 2 can be ignored.

[0087] When the heart rate prediction method of the present invention does not execute Step 2, the test data is taken from the dataset composed of the heart rates and BCG signals of 392 people collected by the inventor. In this dataset, each person contains 15 minutes of BCG signals (including certain body movements) and heart rate data in a quiet state, and 15 minutes of BCG signals (including certain body movements) and heart rate data in a conversation state. Among them, the data of the first 320 people collected are used as the training set, and the data of the last 72 people are used as the test set. The data collection processes for both are required to be the same, only with a time - order difference.

[0088] Table 3: Table of results of omitting some steps

[0089]

[0090] The heart rate MAE for the BCG signal in the quiet state (including a certain amount of body movement) in the test set is 0.901 bpm, and the person linear correlation coefficient (the person linear correlation coefficient value is the person linear correlation coefficient between the heart rate value of the present invention and the standard reference heart rate, hereinafter referred to as the person linear correlation coefficient value) reaches 0.983. For the BCG signal in the conversation state (including a certain amount of body movement), the heart rate MAE is 2.286 bpm, and the person linear correlation coefficient reaches 0.913.

[0091] Table 4: Results Table of Screening Method Changes

[0092]

[0093] Compared with the results calculated by Euclidean distance and Manhattan distance, the MAE values of the method of the present invention are reduced in the two states, and the person linear correlation coefficient values are slightly increased.

Claims

1. A BCG signal heart rate calculation method based on fast Fourier transform and convolutional neural network, characterized in that: Step 1) Filter the BCG signal of length n to obtain the filtered BCG signal BCG_F; BCG = {x(1), x(2), x(3), ..., x(n)} BCG_F=Filter_BCG(BCG) The Filter_BCG function filters the BCG signal with a Butterworth filter with a bandwidth of 0.8Hz-25Hz to remove low-frequency and high-frequency signals. The result is recorded as BCG_F; Step 2) Screening the BCG_F signal, calculating the BCG_F signal waveform similarity, and screening the BCG_F signal that is less than or equal to the threshold y; Step 3) Perform exponential moving normalization processing on the BCG_F signal screened by step 2: BCG_standardize=scale_BCG(BCG_F) The scale_BCG function consists of the following three formulas: EMA_current=α×value+(1-α)×EMA_previous z_score=(value-EMA_current) / (EMA_sdc) Among them, EMA_current is the mean of the exponential moving average at the current time point, EMA_previous is the mean of the exponential moving average at the previous time point, EMA_sdc is the standard deviation of the exponential moving average at the current time point, EMA_sdp is the standard deviation of the exponential moving average at the previous time point, α is the attenuation factor, value is the data value at the current time point, and the obtained z_score forms the BCG_standardize sequence in order, which is recorded as the BCG_standardize signal; Step 4) Perform Fourier transform on the BCG_standardize signal obtained in step 3, and the obtained normalized amplitude spectrum result is recorded as BCG_fft; Step 5) Input the BCG_standardize signal and BCG_fft into the convolutional neural network model to obtain the heart rate value of the BCG signal.

2. The method for calculating heart rate from BCG signals based on fast Fourier transform and convolutional neural network according to claim 1, characterized in that: In the step 2), the method for calculating waveform similarity is a dynamic time warping method, and the steps are: First, the BCG_F signal is divided according to the length m, and the dynamic time warping distance between each divided BCG_F signal and the previous BCG_F signal is calculated. The dynamic time warping distances of all the obtained partial BCG_F signals and the previous BCG_F signal are summed up, and the sum is regarded as the dynamic time warping distance BCG_DTW for a single signal; The dynamic time warping distance BCG_DTW obtained for a single signal is screened. If the obtained value is higher than the set value y, no further analysis will be performed on the data, and it is determined that there is still a high noise influence in the data after filtering, and the obtained heart rate value will have a high deviation.

3. The method for calculating heart rate from BCG signals based on fast Fourier transform and convolutional neural network according to claim 1, characterized in that: In the step 4), the specific steps of Fourier transform are: The fft_BCG function is broken down into the following six formulas. In the following formulas, e represents the base of the natural logarithm, i is the imaginary unit, and the argmax function is used to find the value of the independent variable that maximizes the function. In the FFT formula, x(n) represents the original data sequence, N is the total number of data points, and k is the frequency index: n=n sample_time ×f sample Where n is the total number of data points, n sample_time is the sampling time, f sample is the sampling frequency; Among them, f s (i) is the i-th sampling frequency, n is the total number of data points; Here, f min and f max are the minimum and maximum values ​​of the frequency, idx min and idx max The first one is greater than or equal to f min and f max The index of the sampling frequency; Where sig_fft(k) is the value of the Fourier transform of the data x(n) at the kth frequency point, and N is the total number of data points; Among them, result(k) is the value of the normalized FFT at the kth frequency point; The fft_BCG function calculates the FFT result of the BCG_standardize signal and outputs the normalized amplitude spectrum of the FFT result within the specified frequency range. The obtained normalized amplitude spectrum is recorded as BCG_fft.

4. The method for calculating heart rate from BCG signals based on fast Fourier transform and convolutional neural network according to claim 1, characterized in that: The specific method in the described step 5) is: First, the BCG_F signal is input into the convolutional neural network for processing. The convolutional neural network contains 14 convolutional layers. The output channels in the convolutional layers increase from 1 to 512 in a non-negative manner. The size of the feature map decreases as the network goes deeper, and the depth of the feature increases gradually. The result is recorded as x3. Flatten x3. Then the result BCG_FCL is processed by the first fully connected layer, the BCG_fft is flattened, and then the flattened BCG_fft is combined with BCG_FCL and input into the second fully connected layer to get the final heart rate value.

5. The method for calculating heart rate from BCG signals based on fast Fourier transform and convolutional neural network according to claim 1, characterized in that: The specific method in the step 1) is: 0.8 Hz and below are regarded as low-frequency signals, and 25 Hz and above are regarded as high-frequency signals.

Citation Information

Patent Citations

  • Multi-channel ballistocardiography with cepstrum smoothing and quality-based dynamic channel selection

    CN106999072A

  • Deep regression heart rate estimation method for ballistocardiogram signals

    CN110420019A

  • Heartbeat detection method based on ballistocardiogram

    CN112022134A

  • Electrocardiosignal classification method based on time-frequency domain fusion and convolutional neural network

    CN116746942A

  • Catering tray

    KR1020240081845A