Heart hit map heart rate detection method, device and system and storage medium
By using neural network adaptive aggregation and channel differential self-attention mechanism to process BCG signals, the problems of inconsistent number and non-fixed position of modal functions are solved, realizing the automation and accuracy improvement of heart rate detection, and enhancing the robustness and feature extraction capability of the model.
Patent Information
- Application Number
- CN202511111206.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-21
AI Technical Summary
In existing BCG heart rate detection methods, the number of intrinsic mode functions (IMFs) is inconsistent among samples, and the positions of IMF components that are synchronized with the ECG rhythm are not fixed, resulting in insufficient reliability and consistency of heart rate detection results. Furthermore, deep learning models have limitations in long-term dependence and global information capture.
By employing a neural network adaptive aggregation strategy and a channel differential self-attention mechanism, the BCG signal is decomposed by SVMD, and the mode functions are automatically selected and aggregated. Combined with a one-dimensional convolutional residual network and a channel differential self-attention mechanism, the accuracy and robustness of feature extraction and heart rate detection are improved.
It has achieved automation and improved accuracy in heart rate detection, reduced errors caused by human intervention, enhanced the model's ability to distinguish and robust the feature channels, and improved the reliability and consistency of heart rate detection.
Smart Images

Figure CN120983000A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of signal processing technology, and particularly relates to a heart rate detection method, device, system, and storage medium using a heart rate monitoring system. Background Technology
[0002] Cardiovascular diseases, being prevalent, deadly, and expensive circulatory system diseases, require significant attention for routine monitoring techniques. Heart rate monitoring is a crucial indicator of vital signs, as abnormal heart rhythms often foreshadow sudden cardiac death, asphyxia, or arrhythmias. Routine heart rate monitoring is vital for the early detection and treatment of heart failure. Ballistocardiography (BCG) is a non-contact method that describes the periodic body vibrations generated during the heart's pumping process. Compared to the discomfort caused by traditional electrocardiogram (ECG) electrode skin contact, BCG offers significant advantages in comfort and convenience thanks to advanced sensing technology. However, BCG signals have a low signal-to-noise ratio and are extremely sensitive to local skin movement and motion artifacts. Furthermore, BCG measurements can be affected by body movement or accidental sensor detachment, leading to reduced accuracy in heart rate detection.
[0003] Existing heart rate detection methods based on BCG are mainly divided into two categories: signal processing and deep learning. Regarding signal processing methods: In 2015, Krej et al. from the Warsaw Military Aviation Medical Research Institute in Poland applied bandpass filtering and squared enhancement to the signal, used a sliding window to locate local maxima as candidate heartbeat points, then performed three levels of correction on the candidate heartbeat points, and further introduced a genetic algorithm to globally optimize key threshold parameters to accurately locate the BCG peak point. Finally, they calculated the heart rate and heart rate variability based on the peak point. In 2021, Jikui Liu et al. from the Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, established a BCG signal quality grading mechanism based on approximate entropy. This mechanism retains high-quality signal segments and removes low signal-to-noise ratio data, separates the BCG signal from the respiratory signal through wavelet transform, constructs the heartbeat envelope curve using Hilbert transform, and finally uses a fuzzy positive and negative slope difference analysis algorithm to detect the signal peak and calculate the heart rate parameters accordingly. In 2022, Liu Bin from Shandong University used Complete Ensemble Empirical Mode Decomposition with Adaptive Noise (CCEMDAN) to decompose cardiac impact signals. He observed that the seventh-order component of the cardiac impact signal was consistent with the cardiac cycle of the cardiac impact signal. Then, he used an adaptive template matching method to extract a template of length 250 for each subject. By continuously shifting the template on the original cardiac impact signal, he obtained the correlation coefficient function curve. Then, he updated the template and applied the peak monitoring algorithm to extract the heart rate on the correlation coefficient function curve. In 2024, García-Limón et al. from the Polytechnic University of Catalonia, Spain, used a segmentation technique based on window standard deviation analysis to remove BCG signal segments severely affected by motion artifacts. After removing artifact segments, they applied Empirical Mode Decomposition (EMD) to the remaining BCG signals, selected the first-order intrinsic mode function components obtained from EMD decomposition, and post-processed these components based on continuous wavelet transform to detect the most significant J-peak. They then calculated the heart rate based on the position of the J-peak. Regarding deep learning methods: In 2022, Yaozong Mai et al. from South China Normal University first manually synchronized ECG and BCG, then evaluated and graded the quality of the BCG window signal based on the signal-to-noise ratio, optimizing the label sparsity problem by expanding the J-peak annotation range of the BCG. Based on this, they constructed a detection model integrating the multi-scale feature extraction capabilities of U-Net and the bidirectional temporal modeling capabilities of Bi-LSTM, using post-processing methods to locate the J-peak and calculate the heart rate.In 2023, Tao Zhao et al. from Wuhan University of Technology first used wavelet transform to extract the time-frequency characteristics of BCG signals. They then used Bi-LSTM and a fully connected layer to perform binary classification of sequence points, achieving J-peak binary classification detection using Bi-LSTM and the fully connected layer. Peak selection was optimized through physiological constraint thresholds to complete heart rate estimation. In 2025, ChangzheJiao et al. from Xi'an University of Electronic Science and Technology established a self-supervised heart rate detection method. This method first fuses multi-channel signals using frequency domain peak-to-average ratio weighting, estimates heart rate using Hilbert transform, and initially locates the heartbeat position through multi-level threshold detection. Based on this, a beat-by-beat heart rate error iterative optimization method is used to calibrate the inconsistency of heartbeat intervals in dynamic scenarios. Then, a signal containing a clear heartbeat position is reconstructed using a Gaussian function, and Bi-LSTM is used to achieve end-to-end heartbeat localization and heart rate prediction.
[0004] Furthermore, in terms of temporal modeling, in 2024, Tianzhu Ye et al. from Tsinghua University proposed a differential attention mechanism, which calculates the attention score as the difference between two independent softmax attention maps. This subtraction operation cancels out noise, thereby promoting the emergence of sparse attention patterns and avoiding excessive allocation of attention to irrelevant contexts.
[0005] In summary, current research on BCG heart rate detection mainly follows two paths: one involves processing the BCG signal using signal processing methods to obtain a noise-free BCG signal, then locating the peak point of the BCG signal and calculating the heart rate accordingly; the other employs deep learning models to extract features from the BCG signal and achieve heart rate estimation. Building upon this, differential attention mechanisms, as an important means to improve the model's ability to model global features, also provide new ideas and methodological references for time series modeling.
[0006] In 2022, Liu Bin from Shandong University used the CCEMDAN method to decompose cardiac impact signals. Observations revealed that the seventh-order component of the signal exhibited consistency with the cardiac cycle of the cardiac impact signal. Then, using an adaptive template matching method, a 250-byte template was extracted for each subject. The template was continuously shifted across the original cardiac impact signal to obtain a correlation coefficient function curve. The template was then updated, and a peak monitoring algorithm was applied to the correlation coefficient function curve to extract the heart rate. Also in 2022, Mai et al. from South China Normal University first manually synchronized ECG and BCG. Subsequently, they evaluated and graded the BCG window signal quality based on the signal-to-noise ratio, optimizing the label sparsity problem by expanding the J-peak annotation range of the BCG. Based on this, they constructed a detection model integrating the multi-scale feature extraction capabilities of U-Net and the bidirectional temporal modeling capabilities of Bi-LSTM, using post-processing algorithms to locate the J-peak and calculate the heart rate. In 2024, Tianzhu Ye et al. from Tsinghua University proposed a differential attention mechanism, which calculates the attention score as the difference between two independent softmax attention maps. This subtraction operation cancels out noise, thereby promoting the emergence of sparse attention patterns and avoiding excessive allocation of attention to irrelevant contexts.
[0007] Empirical Mode Decomposition (EMD) offers excellent decomposition characteristics, making it well-suited for analyzing nonlinear and non-stationary BCG signals. Current techniques for mode decomposition of BCG signals (such as EMD or CCEMAN decomposition) decompose each BCG signal into multiple levels of intrinsic mode functions (EMFs). Researchers typically visually select the EMF that best matches the ECG rhythm for heart rate analysis. However, the number of EMFs obtained after decomposition and the location of the EMF that matches the ECG rhythm are uncertain for different samples. This reliance on manual judgment to select specific EMFs not only easily introduces subjective errors and results in low processing efficiency and difficulty in automating analysis, but also ignores the differences in signal characteristics among individuals, thus limiting the reliability, consistency, and scalability of heart rate extraction results. When using deep learning models for time-series modeling of BCG signals, convolutional neural networks (CNNs) are often employed. Convolutional operations can only capture features within a local time window, which limits the model's ability to model long-term dependencies and global information. Furthermore, insufficient feature channel resolution makes it difficult to capture subtle discriminative information in the cardiac capture map. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to provide a method, device, system, and storage medium for heart rate detection using a heart rate monitoring system.
[0009] To achieve the above objectives, the present invention adopts the following technical solution:
[0010] A heart rate detection method using a heartbeat chart includes:
[0011] Acquire BCG and ECG signals;
[0012] Preprocessing of BCG and ECG signals;
[0013] A binary square wave heart rate prediction network was constructed and pre-trained based on the binary square wave sequence of ECG R peak positions generated during the ECG preprocessing stage. The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network or a temporal convolutional network and a channel difference self-attention mechanism.
[0014] The BCG heart rate prediction network is constructed based on the pre-trained binary square wave heart rate prediction network. The BCG heart rate prediction network consists of an intrinsic mode function adaptive aggregation subnetwork, an aggregated intrinsic mode function feature extraction subnetwork, and a heart rate prediction subnetwork.
[0015] Preferably, the preprocessing of BCG and ECG signals includes: sliding window cutting of data, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the ECG signal; the BCG signal is decomposed using Successive Variational Mode Decomposition (SVMD), and the obtained intrinsic mode functions are dimensionally aligned.
[0016] Preferably, the intrinsic mode function adaptive aggregation subnetwork adaptively weights and aggregates the multi-level intrinsic mode functions obtained from the decomposition of each BCG signal. The aggregated intrinsic mode function feature extraction subnetwork then extracts features from the aggregated intrinsic mode functions. During this process, pre-trained binary square wave heart rate prediction network parameters are loaded. The feature vectors extracted from the aggregated intrinsic mode functions are aligned with the feature vectors obtained from the binary square wave feature extraction subnetwork using cosine similarity. Simultaneously, these features are directly input into the heart rate prediction subnetwork to complete heart rate estimation. This heart rate prediction subnetwork shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, and no gradient updates are performed on the loaded parameters.
[0017] The present invention also provides a heart rate detection device, comprising:
[0018] The first processing module is used to acquire BCG and ECG signals;
[0019] The second processing module is used for preprocessing BCG and ECG signals;
[0020] The third processing module is used to construct and pre-train a binary square wave heart rate prediction network based on the binary square wave sequence of the R peak position generated in the ECG preprocessing stage. The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network or a temporal convolutional network and a channel difference self-attention mechanism.
[0021] The fourth processing module is used to construct the BCG heart rate prediction network based on the pre-trained binary square wave heart rate prediction network. The BCG heart rate prediction network consists of an intrinsic mode function adaptive aggregation subnetwork, an aggregated intrinsic mode function feature extraction subnetwork, and a heart rate prediction subnetwork.
[0022] Preferably, the second processing module preprocesses the BCG and ECG signals by: sliding window cutting of the data, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the ECG signal; using SVMD to decompose the BCG signal and performing dimension alignment on the obtained intrinsic mode functions.
[0023] Preferably, the intrinsic mode function adaptive aggregation subnetwork adaptively weights and aggregates the multi-level intrinsic mode functions obtained from the decomposition of each BCG signal. The aggregated intrinsic mode function feature extraction subnetwork then extracts features from the aggregated intrinsic mode functions. During this process, pre-trained binary square wave heart rate prediction network parameters are loaded. The feature vectors extracted from the aggregated intrinsic mode functions are aligned with the feature vectors obtained from the binary square wave feature extraction subnetwork using cosine similarity. Simultaneously, these features are directly input into the heart rate prediction subnetwork to complete heart rate estimation. This heart rate prediction subnetwork shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, and no gradient updates are performed on the loaded parameters.
[0024] The present invention also provides a heart rate detection system based on a heartbeat, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a heart rate detection method based on a heartbeat when executed by the processor.
[0025] The present invention also provides a storage medium storing a computer program, which executes a heart rate detection method using a heart rate map during runtime.
[0026] This invention aims to address the issues of inconsistent numbers of intrinsic mode functions (IMFs) among samples and the non-fixed positions of IMF components synchronized with ECG rhythms in existing technologies. By introducing a neural network adaptive aggregation strategy, the uniformity of IMFs and feature alignment capabilities are improved, avoiding the limitations of relying on manual selection of key IMF components. To further enhance the model's ability to distinguish feature channels and improve its robustness, this invention designs a channel differential self-attention mechanism. This mechanism can effectively improve the model's discrimination ability under different signal feature conditions, ultimately achieving more accurate and robust heart rate detection. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0028] Figure 1 This is a flowchart of the heart rate detection method according to an embodiment of the present invention;
[0029] Figure 2 This is a schematic diagram illustrating the principle of the heart rate detection method using a heartbeat chart according to the present invention.
[0030] Figure 3 A schematic diagram of the measurement process for a cardiac impact monitoring system;
[0031] Figure 4 This is a schematic diagram of the structure of a one-dimensional convolutional residual network and a channel difference self-attention mechanism.
[0032] Figure 5 This is a schematic diagram of the adaptive aggregation subnet structure of intrinsic mode functions. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0035] Example 1:
[0036] like Figure 1 , 2As shown, this embodiment of the invention provides a heart rate detection method based on heart rate measurement. The main process includes: (1) Data preprocessing: including sliding window cutting of data, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the electrocardiogram signal; using SVMD to decompose the BCG signal, and dimensional alignment of the obtained intrinsic mode functions. (2) Constructing and pre-training a binary square wave heart rate prediction network: the network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork, and is pre-trained with the binary square wave as input, and the output is the corresponding heart rate estimate. (3) BCG heart rate prediction: An adaptive aggregation subnetwork of intrinsic mode functions (IMFs) and an IMF feature extraction subnetwork are constructed. The former performs adaptive weighted aggregation of the multi-level IMFs obtained from the SVMD decomposition of each BCG signal, while the latter extracts features from the aggregated IMFs. During this process, the pre-trained binary square wave heart rate prediction network parameters from step (2) are loaded. The feature vectors extracted from the aggregated IMFs are aligned with the feature vectors obtained from the binary square wave feature extraction subnetwork through cosine similarity, and are directly input into the heart rate prediction subnetwork to complete heart rate estimation. This heart rate prediction subnetwork shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, and the loaded parameters are not updated with gradients. Specifically, the following steps are included:
[0037] Step 1: Prepare the dataset
[0038] This invention provides a mattress-based BCG signal acquisition system, comprising a pressure sensor module, an airbag control module, and a data processing unit. The sampling frequency is 125Hz. The mattress contains three independent airbags located at the head, chest, and feet. The head and foot airbags are connected via tubing, allowing an external controller to adjust the mattress firmness. The airbag below the chest, being closer to the heart, is specifically designed for BCG signal acquisition as it can more effectively capture BCG signals. Vital sign detection scenarios include... Figure 3 As shown, the analog signal acquired by the pressure sensor module is amplified and filtered, then converted from analog to digital by the 12-bit ADC of the STM32 microcontroller. Simultaneously, the ECG signal from lead I is acquired to extract the heart rate and serve as the gold standard for detection. All digital signals are ultimately transmitted to a computer via serial port for further analysis.
[0039] In this embodiment of the invention, 18 volunteers were recruited to conduct a BCG signal acquisition experiment. A multi-condition combination design was adopted: each subject had to complete three standard body positions in sequence: left lateral decubitus, supine, and right lateral decubitus. Data was collected under three preset mattress hardness conditions: soft, medium, and hard. The cumulative effective acquisition time for all body position-hardness combinations for a single subject was 3 minutes.
[0040] Step 2: Data Preprocessing
[0041] The dataset obtained in step 1 is preprocessed.
[0042] Step 2.1: Construction of Composite Observation Window
[0043] The original signal is cut into segments by a sliding window with a window length of 9s and a step length of 4s. The current window and its previous 21s of historical data are spliced together to form a 30s composite observation window. When the historical data is insufficient, it is filled with zeros.
[0044] Step 2.2: ECG signal filtering and normalization
[0045] First, a fifth-order Butterworth low-pass filter with a cutoff frequency of 20Hz is used to suppress high-frequency noise in the ECG signal. Then, median filtering is used to eliminate baseline drift, and finally, normalization is performed.
[0046] Step 2.3: R-peak detection and binary square wave generation
[0047] The Pan-Tompkins algorithm is used to locate the R peak of the ECG signal, and the heart rate baseline is determined by calculating the average RR interval. With each R peak as the center, the sampling points within the 80ms time window before and after it are marked as 1, and the rest of the area is set to 0, thus generating a binary square wave signal representing the heartbeat timing.
[0048] Step 2.4: BCG signal filtering and SVMD decomposition
[0049] The BCG signal was subjected to a 1-10Hz fifth-order Butterworth bandpass filter to eliminate baseline drift, respiratory motion interference, high-frequency noise, and normalization. Subsequently, SVMD was used to iteratively decompose the filtered signal to extract the intrinsic mode functions.
[0050] Step 2.5: Intrinsic Mode Function Dimension Alignment Processing
[0051] The maximum number of intrinsic mode functions (IMFs) in all samples is counted, and samples with insufficient IMFs are padded with zeros to reach the maximum value to unify the input dimension; at the same time, the actual number of valid IMFs for each sample is recorded.
[0052] Step 3: Construct and pre-train a binary square wave heart rate prediction network
[0053] The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network and a channel difference self-attention mechanism. Preferably, the one-dimensional convolutional residual network can be replaced by a temporal convolutional network (TCN).
[0054] Step 3.1: Construct a one-dimensional convolutional residual network
[0055] The structure of a one-dimensional convolutional residual network is as follows: Figure 4 As shown in (a), the network consists of five repeating convolutional blocks, each containing two 1x3 convolutional layers, two batch normalized layers, two ReLU activation layers, one batch normalized layer, and one 1x1 convolutional layer for residual connections.
[0056] Step 3.2: Construct a channel-differential self-attention mechanism
[0057] The structure of the channel differential self-attention mechanism is as follows: Figure 4 As shown in (b), this module employs an intra-group sharing mechanism to design a multi-head attention structure, enhancing the ability to model local differences in features and improving computational efficiency. Let the input sequence be... Where N represents the batch size, L represents the sequence length, and D is the embedding dimension. First, the query Q, key K, and value V vectors are generated through linear transformation:
[0058] Q = XW Q K = XW K V = XW V (3-1)
[0059] in D v Let d be the total dimension of the Value vector. Next, Q and K are each divided into H attention heads, each with a dimension of d = D / H. Simultaneously, V is divided into G groups (G = H / 4), each group sharing a single value vector representation, with each group having a dimension of d. v =D v / G. For the i-th head (i = 1, ..., H), its group number is The attention output of the i-th head is calculated as follows:
[0060]
[0061] in The outputs of all heads are spliced together and recombined along the head dimension to form a shape. Tensor O is then subjected to RMS normalization:
[0062] Z = RMSnorm(O) (3-3)
[0063] Then, the Z-ranking group structure Perform a differencing operation within each group to capture local feature differences within the group:
[0064]
[0065] Reorganizing all intra-group difference tensors yields Furthermore, the nonlinear interaction capability between channels is further enhanced through 1×1 convolution:
[0066] Z out =Conv1x1(Δ) (3-5)
[0067] Step 3.3: Constructing the Heart Rate Prediction Subnetwork
[0068] First, the temporal characteristics of the output of the channel differential self-attention mechanism are analyzed. Flattening from the channel dimension, converting it into a two-dimensional tensor:
[0069]
[0070] in, Where N is the sample batch size, C is the number of channels, and L is the time step. Then the flattened tensor... The input is fed into a fully connected linear layer for heart rate regression prediction.
[0071]
[0072] in This indicates the predicted heart rate estimate.
[0073] Step 3.4: Pre-training of the binary square wave heart rate prediction network
[0074] During the pre-training phase, the gold standard heart rate extracted from the electrocardiogram signal is used as the supervision signal, and the binary square wave signal is used as the network input. In order to improve the robustness and stability of regression prediction, the loss function is SmoothLoss, which is defined as follows:
[0075]
[0076] This invention employs the AdamW optimizer to pre-train the parameters of a binary square wave heart rate prediction network through backpropagation of gradients.
[0077] Step 4: BCG Heart Rate Prediction
[0078] The BCG heart rate prediction network consists of an intrinsic mode function (IMF) adaptive aggregation subnetwork, an aggregated IMF feature extraction subnetwork, and a heart rate prediction subnetwork. The structure of the aggregated IMF feature extraction subnetwork is consistent with that of the binary square wave feature extraction subnetwork. The heart rate prediction subnetwork is the same network as the one constructed in step 3.3, and its parameters are obtained through pre-training of the binary square wave heart rate prediction network. In this stage, the pre-trained parameters are loaded, and their gradients are frozen.
[0079] Step 4.1: Construct an adaptive aggregation subnet of intrinsic mode functions
[0080] The structure of the intrinsic mode function adaptive aggregation subnet is as follows: Figure 5As shown, the intrinsic mode functions are defined by the intrinsic mode array obtained from step 2.5 decomposition as follows: Where B is the batch size, N is the maximum number of IMFs, and L is the signal length, X is reshaped into... Then to Local feature extraction is performed using three layers of one-dimensional convolution, and the calculation formula is as follows:
[0081]
[0082] F (2) =MaxPool(ReLU(BN(Conv1D(F( 1 (4-2)
[0083] F (3) =AdaptiveAvgPool(ReLU(BN(Conv1D(F( 2 (4-3)
[0084] in The value of C is 64. F (3) Squeeze and reshape to F B×N×C Then, F is input into a bidirectional LSTM to capture the temporal dependencies between different IMFs. The calculation formula is as follows:
[0085] H = BiLSTM(F) (4-4)
[0086] The bidirectional LSTM hidden layer has a dimension of 32. Then H is input into the fully connected network to calculate the original weights W, using the following formula:
[0087] w=[LayerNorm(Hardswish(HW1+b1))]W2+b2 (4-5)
[0088] in W1, b1, W2, and b2 are the parameters of the fully connected layer, LayerNorm is the layer normalization function, Hardwish is the activation function, and then Squeeze is performed on the last dimension of W. Then, a dynamic mask M is generated based on the effective IMF count of each sample, calculated using the following formula:
[0089]
[0090] in ,c b Let b ∈ {1,…,B}, i ∈ {0,…,N-1} be the effective IMF count for each sample. Then, the mask is modified to obtain W', calculated using the following formula:
[0091]
[0092] Where ⊙ denotes element-wise multiplication, α = 0.5 is the temperature coefficient, and ε = 10⁻⁹ is a local minimum. Then, for... The weights w are generated by performing softmax normalization, and the calculation formula is as follows:
[0093] w = Softmax(W′) (4-8)
[0094] The IMF components are weighted and summed using the following formula:
[0095]
[0096] Where ⊙ denotes element-wise multiplication, x j It is the eigenmode function of the j-th sample.
[0097] Step 4.2: Training the BCG Heart Rate Prediction Network
[0098] The multi-level intrinsic mode functions (IMFs) obtained from SVMD decomposition are used as input to the adaptive aggregation subnet of IMFs. Adaptive weighted aggregation is performed on the multi-level IMFs obtained from the decomposition of each BCG signal. The aggregated IMFs are then input to the IMF feature extraction subnet for feature extraction. During this process, the pre-trained binary square wave heart rate prediction network parameters from step 3.4 are loaded. The feature vectors extracted from the aggregated IMFs are aligned with the feature vectors obtained from the binary square wave feature extraction subnet through cosine similarity, and are also directly input into the heart rate prediction subnet to complete heart rate estimation. This heart rate prediction subnet shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The trained parameters are then loaded, and the gradients of the loaded parameters are frozen. This invention uses the AdamW optimizer to train the parameters of the BCG heart rate prediction network through backpropagation.
[0099] The intrinsic mode function adaptive aggregation module of the present invention, such as Figure 5 As shown, orthogonal decomposition of the BCG signal using SVMD decomposition decouples the temporal components, thereby improving the identifiability of the cardiac impact signal and enhancing its quasi-periodic characteristics. Due to varying signal-to-noise ratios, the order of the characteristic mode functions (EMFs) generated after SVMD decomposition in different BCG signals is uncertain. Relying on manual selection easily introduces subjective errors and is inefficient. Therefore, this invention introduces a neural network to automatically filter and aggregate the aforementioned EMFs, effectively avoiding manual intervention and improving the adaptability and accuracy of the processing.
[0100] The channel differential self-attention mechanism of the present invention, such as Figure 4 As shown in (b), the differential multi-head attention mechanism in the Differential Transformer enhances the sparsity of the attention maps by calculating the difference between two independent Softmax attention maps, thereby improving the discriminative ability of the multi-head attention mechanism. Unlike the differential attention mechanism, the channel differential self-attention mechanism proposed in this invention introduces a difference operation on the channel dimension of the attention output, focusing more on capturing the relative changes and differences between feature channels, thereby improving the model's ability to distinguish channel features and its attention to key features.
[0101] The present invention has the following advantages:
[0102] (1) Improve the automation and accuracy of feature extraction. Existing technologies for analyzing BCG signals based on EMD or CCEMDAN often rely on manual selection of feature components related to cardiac impact from multiple modal functions, which is inefficient and susceptible to subjective interference. The intrinsic modal function adaptive aggregation module proposed in this invention automatically filters and fuses modal functions after SVMD decomposition through neural networks, significantly improving the automation and robustness of the BCG signal feature extraction process, reducing errors caused by human intervention, and improving overall recognition accuracy.
[0103] (2) Convolutional neural networks can only capture local features of time series, while multi-head attention mechanisms can capture global features of time series. Although the multi-head attention mechanism of Transformer can effectively capture global information when processing long-sequence physiological signals, its attention distribution is often not sparse enough and it is prone to focusing on irrelevant information, affecting model performance. The differential multi-head attention mechanism in Differential Transformer reduces interference from irrelevant context by introducing differential operations. In contrast, the channel differential self-attention mechanism proposed in this invention introduces differential operations on the channel dimension of attention output, focusing more on capturing the relative changes and differences between feature channels, thereby significantly improving the model's ability to identify channel features and its attention to key features.
[0104] Example 2:
[0105] This invention also provides a heart rate detection device, comprising:
[0106] The first processing module is used to acquire BCG and ECG signals;
[0107] The second processing module is used for preprocessing BCG and ECG signals;
[0108] The third processing module is used to construct and pre-train a binary square wave heart rate prediction network based on the binary square wave sequence of the R peak position generated in the ECG preprocessing stage. The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network or a temporal convolutional network and a channel difference self-attention mechanism.
[0109] The fourth processing module is used to construct the BCG heart rate prediction network based on the pre-trained binary square wave heart rate prediction network. The BCG heart rate prediction network consists of an intrinsic mode function adaptive aggregation subnetwork, an aggregated intrinsic mode function feature extraction subnetwork, and a heart rate prediction subnetwork.
[0110] As one embodiment of the present invention, the second processing module preprocesses the BCG and ECG signals by: sliding window cutting of data, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the ECG signal; using SVMD to decompose the BCG signal, and performing dimension alignment on the obtained intrinsic mode functions.
[0111] As one embodiment of the present invention, the intrinsic mode function adaptive aggregation subnetwork adaptively weights and aggregates the multi-level intrinsic mode functions obtained from the decomposition of each BCG signal. The aggregated intrinsic mode function feature extraction subnetwork extracts features from the aggregated intrinsic mode functions. During this process, pre-trained binary square wave heart rate prediction network parameters are loaded. The feature vectors extracted from the aggregated intrinsic mode functions are aligned with the feature vectors obtained from the binary square wave feature extraction subnetwork through cosine similarity. At the same time, they are directly input into the heart rate prediction subnetwork to complete heart rate estimation. The heart rate prediction subnetwork shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, and the loaded parameters are not updated with gradients.
[0112] Example 3:
[0113] This invention also provides a heart rate detection system based on a heartbeat, comprising: a memory and a processor, wherein the memory stores a computer program executed by the processor, and the computer program executes a heart rate detection method based on a heartbeat when executed by the processor.
[0114] Example 4:
[0115] This invention also provides a storage medium storing a computer program that executes a heart rate detection method using a heart rate map during runtime.
[0116] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A heart rate detection method using a heartbeat chart, characterized in that, include: Acquire BCG and ECG signals; Preprocessing of BCG and ECG signals; A binary square wave heart rate prediction network was constructed and pre-trained based on the binary square wave sequence of ECG R peak positions generated during the ECG preprocessing stage. The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network or a temporal convolutional network and a channel difference self-attention mechanism. The BCG heart rate prediction network is constructed based on the pre-trained binary square wave heart rate prediction network. The BCG heart rate prediction network consists of an intrinsic mode function adaptive aggregation subnetwork, an aggregated intrinsic mode function feature extraction subnetwork, and a heart rate prediction subnetwork.
2. The cardiac rate detection method according to claim 1, characterized in that, Preprocessing of BCG and ECG signals includes: sliding window data cutting, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the ECG signal; SVMD decomposition of BCG signal is used, and the obtained intrinsic mode functions are dimensionally aligned.
3. The cardiac rate detection method according to claim 2, characterized in that, The intrinsic mode function (IMF) adaptive aggregation subnet adaptively weights and aggregates the multi-level IMFs obtained from the decomposition of each BCG signal. The aggregated IMF feature extraction subnet then extracts features from the aggregated IMFs. During this process, pre-trained binary square wave heart rate prediction network parameters are loaded. The feature vectors extracted from the aggregated IMFs are aligned with the feature vectors obtained from the binary square wave feature extraction subnet using cosine similarity. Simultaneously, these features are directly input into the heart rate prediction subnet to complete heart rate estimation. This heart rate prediction subnet shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, but no gradient updates are performed on the loaded parameters.
4. A heart rate detection device using a heartbeat chart, characterized in that, include: The first processing module is used to acquire BCG and ECG signals; The second processing module is used for preprocessing BCG and ECG signals; The third processing module is used to construct and pre-train a binary square wave heart rate prediction network based on the binary square wave sequence of the R peak position generated in the ECG preprocessing stage. The binary square wave heart rate prediction network consists of a binary square wave feature extraction subnetwork and a heart rate prediction subnetwork. The binary square wave feature extraction subnetwork is composed of a one-dimensional convolutional residual network or a temporal convolutional network and a channel difference self-attention mechanism. The fourth processing module is used to construct the BCG heart rate prediction network based on the pre-trained binary square wave heart rate prediction network. The BCG heart rate prediction network consists of an intrinsic mode function adaptive aggregation subnetwork, an aggregated intrinsic mode function feature extraction subnetwork, and a heart rate prediction subnetwork.
5. The cardiac rate detection device as described in claim 4, characterized in that, The second processing module preprocesses the BCG and ECG signals, including: sliding window data cutting, noise removal, normalization, and obtaining the gold standard heart rate and its corresponding binary square wave based on the R peak position of the ECG signal; using SVMD to decompose the BCG signal and performing dimension alignment on the obtained intrinsic mode functions.
6. The cardiac rate detection device as described in claim 5, characterized in that, The intrinsic mode function (IMF) adaptive aggregation subnet adaptively weights and aggregates the multi-level IMFs obtained from the decomposition of each BCG signal. The aggregated IMF feature extraction subnet then extracts features from the aggregated IMFs. During this process, pre-trained binary square wave heart rate prediction network parameters are loaded. The feature vectors extracted from the aggregated IMFs are aligned with the feature vectors obtained from the binary square wave feature extraction subnet using cosine similarity. Simultaneously, these features are directly input into the heart rate prediction subnet to complete heart rate estimation. This heart rate prediction subnet shares the same structure and parameters as the binary square wave heart rate prediction network and has been pre-trained by it. The pre-trained parameters are then loaded, but no gradient updates are performed on the loaded parameters.
7. A heart rate detection system based on heart rate measurement, characterized in that, include: A memory and a processor, wherein the memory stores a computer program executed by the processor, the computer program performing the heart rate detection method as described in any one of claims 1-3 when executed by the processor.
8. A storage medium, characterized in that, The storage medium stores a computer program, which, when running, executes the heart rate detection method according to any one of claims 1-3.
Citation Information
Cited By
BCG-based non-contact real-time heart rate detection method and system
CN121313162A