Millimeter wave radar heart rate detection method based on improved Transform model
By improving the Transformer model and adopting PCFN and ASSA modules, the accuracy and efficiency problems of existing heart rate detection methods are solved, achieving high efficiency, high accuracy and low complexity in heart rate prediction.
Patent Information
- Application Number
- CN202510891675.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-11-11
AI Technical Summary
Existing heart rate detection methods based on the Transformer model suffer from insufficient accuracy, high computational complexity, and low training efficiency.
An improved Transformer model is constructed, employing the PCFN and ASSA modules. It enhances feature representation through attention mechanisms of partial convolution and dynamic convolution kernels, reduces the burden of redundant information processing, and introduces a gating mechanism to improve the sparsity of the model.
It significantly improves the accuracy of heart rate prediction, reduces computational complexity and training time, and enhances training efficiency.
Smart Images

Figure CN120918593A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of heart rate detection technology, and in particular to a millimeter-wave radar heart rate detection method based on an improved Transformer model. Background Technology
[0002] Heart rate monitoring technology captures changes in subcutaneous blood flow using photoelectric sensors (PPG) or collects cardiac electrical signals using electrodes (ECG). Combined with filtering algorithms to eliminate motion artifacts, it enables real-time monitoring. It is widely used in smartwatches, medical devices, and health management systems, supporting arrhythmia warnings, exercise heart rate tracking, and telemedicine, thereby improving the prevention and control of cardiovascular diseases.
[0003] The baseline Transformer model can also be used for heart rate prediction, but it suffers from insufficient accuracy.
[0004] In addition, the patent with publication number CN120078391A collects heart rate signals; constructs a first LSTM model; inputs exercise power and actual heart rate into the first LSTM model to obtain a first predicted heart rate; and constructs a second LSTM model with exercise power and the first predicted heart rate as input to output a second predicted heart rate. However, it has problems such as high model complexity, low training efficiency, and insufficient data generalization ability. Summary of the Invention
[0005] To address the shortcomings of existing methods, this invention provides a method for constructing an improved Transformer model that reduces computational complexity, shortens training time, and improves training efficiency.
[0006] The technical solution adopted in this invention is: a millimeter-wave radar heart rate detection method based on an improved Transformer model, comprising the following steps:
[0007] Step 1: Collect motion power data;
[0008] In a preferred embodiment of the present invention, the types of exercise include: running, rope skipping, and stationary cycling.
[0009] Step 2: Motion power data is input into the first convolutional layer to improve the input feature vector of the encoder of the Transformer model; the encoder of the improved Transformer model includes: a first PCFN module and a second convolutional layer; the decoder of the improved Transformer model includes: an ASSA module and a second PCFN module; the output feature vector of the decoder is input into the third convolutional layer.
[0010] In a preferred embodiment of the present invention, the PCFN module includes: a feature vector input to an LN layer, PConv, an ECA layer, and a first connection layer, followed by a Split operation; the first branch after the Split operation is input to a first Reshape layer, DWConv, and a second Reshape layer, and then multiplied with the second branch after the Split operation before being input to a second connection layer; the output of the second connection layer is multiplied with the feature vector.
[0011] In a preferred embodiment of the present invention, the convolution kernel size of PConv is 3×1.
[0012] In a preferred embodiment of the present invention, the kernel size of DWConv is 3×1.
[0013] In a preferred embodiment of the present invention, the formula for the PCFN module is:
[0014]
[0015] Where W1 and W2 represent linear projection; [,] represent channel slicing operations; R(·) and F(·) represent data dimension reshaping and data dimension flattening operations; PConv(·) and DWConv(·) represent partial convolution and depthwise convolution operations, respectively; This represents matrix multiplication.
[0016] In a preferred embodiment of the present invention, the improved Transformer model consists of several layers stacked and cascaded.
[0017] The beneficial effects of this invention are:
[0018] 1. This invention constructs a PCFN feedforward network module, adaptively enhances important channel features, and introduces a gate mechanism to reduce the processing burden of redundant information;
[0019] 2. By analyzing the data, the accuracy of heart rate prediction can be significantly improved, providing reliable support for related applications. Attached Figure Description
[0020] Figure 1 This is a block diagram of the millimeter-wave radar heart rate detection based on the improved Transformer model of the present invention;
[0021] Figure 2 This is a comparison chart of the predicted values and measured values of the model in this invention;
[0022] Figure 3 This is a comparison chart of the predicted values and the measured values of the existing Transformer model. Detailed Implementation
[0023] The present invention will be further described below with reference to the accompanying drawings and embodiments. The drawings are simplified schematic diagrams, which only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.
[0024] like Figure 1 As shown, a millimeter-wave radar heart rate detection method based on an improved Transformer model includes the following steps:
[0025] Step 1: Collect motion power data;
[0026] The motion power data can be obtained using the method described in Formula 1-11 of the patent with publication number CN120078391A;
[0027] The categories of sports include: running, skipping rope, and stationary cycling.
[0028] Step 2: Input motion power data into the first convolutional layer to improve the input feature vector of the encoder of the Transformer model;
[0029] An improved Transformer model is constructed, with the encoder consisting of a first PCFN module and a second convolutional layer; the decoder consisting of an ASSA module (Adaptive Sparse Self-Attention) and a second PCFN module; and the output feature vector of the decoder is input to a third convolutional layer.
[0030] The improved Transformer model can be set to N layers stacked and cascaded, where N is a custom parameter;
[0031] The PCFN module includes: a feature vector input normalization layer (LN), PConv, ECA layer, and a first connection layer, followed by a split operation. The first branch after the split operation is input into a first reshape layer, DWConv, and a second reshape layer, and then multiplied with the second branch after the split operation before being input into a second connection layer. The output of the second connection layer is multiplied with the feature vector.
[0032] Layer normalization: Normalizes the last dimension of the input features (input shape [B,L,3], normalization dimension dim=3);
[0033] PConv partial convolution: Input: transposed [B,3,L], convolution kernel: 3×1, only the first 2 channels are processed; parameters: in_channels=2,out_channels=2,kernel_size=3,stride=1,padding=1,groups=2;
[0034] ECA Attention Layer: Input: [B,3,L], Convolutional Kernel: 3×1; Parameters: in_channels=3,out_channels=3,kernel_size=3,padding=1,groups=3;
[0035] First connection layer: Input / output: [B,L,3]→[B,L,6]; Parameters: in_features=3,out_features=6;
[0036] DWConv: Input: Transposed [B,3,L]; Convolution kernel: 3×1; Parameters: in_channels=3, out_channels=3, kernel_size=3, padding=1, groups=3;
[0037] Second connection layer: Input / output: [B,L,3]→[B,L,3]; Parameters: in_features=3,out_features=3.
[0038] The Partial Channel Attentive Refinement Feedforward Network (PCFN) processes information at each time point separately, which plays a crucial role in improving feature representation through self-attention mechanisms. Therefore, designing an effective PCFN module to enhance features and improve the accuracy of heart rate detection is essential. When using SSA and DSA as basic components to remove redundant information from power time series, redundancy still exists in the channels. To overcome this problem, this invention constructs a PCFN module to enhance and simplify feature transformation.
[0039] Specifically, PCFN is constructed by introducing partial convolution operations to enhance the information elements in the features, followed by the introduction of an ECA attention mechanism. Through the 1D attention mechanism of dynamic convolution kernels, important channel features are adaptively enhanced, and a gating mechanism is introduced to reduce the processing burden of redundant information.
[0040] PCFN can be represented as:
[0041]
[0042] Where W1 and W2 represent linear projection; [,] represent channel slicing operations; R(·) and F(·) represent operations to reshape and flatten data dimensions, which convert sequence inputs into 2D feature maps and vice versa. These operations are crucial for introducing local features into the model architecture; PConv(·) and DWConv(·) represent partial convolution and depthwise convolution operations, respectively. This represents matrix multiplication.
[0043] Since Transformers consider all tokens within the feature map, the computation may involve many irrelevant regions. To address this, an ASSA module is employed, which introduces squared ReLU-based self-attention to filter out negative features with low query key matching scores, ensuring the sparsity of the attention mechanism (SSA). Simultaneously, considering the excessive sparsity of ReLU-based self-attention, a dense self-attention branch (DSA) is introduced, which uses a softmax layer to help preserve key information. The key challenge of using this dual-branch scheme is how to reduce noisy features and redundant information while preserving information as appropriately as possible.
[0044] The ASSA module includes:
[0045] Given a normalized feature map X, then generate a query matrix Q, a key matrix K, and a value matrix V from X:
[0046] Q = XW Q K = XW K V = XW V (2)
[0047] Among them, W Q Represents the query matrix, W K Represents the bond matrix and W V Representative value matrix.
[0048] Attention computation can be defined as:
[0049]
[0050] Where A represents the estimated attention; B represents the learnable relative positional bias; d is a constant; and f(·) is the scoring function.
[0051] Then, we re-examine the standard dense self-attention mechanism (DSA) and use the softmax function to obtain attention scores by considering all query matrices Q and key matrices K:
[0052]
[0053] Since not all query matrices are closely related to the corresponding tokens in the key matrix, utilizing all similarities for heart rate estimation is inefficient; intuitively, developing a sparse self-attention (SSA) mechanism to select relevant interactions between tokens can enhance feature aggregation; to achieve sparsity of attention, a hierarchical structure based on the squared ReLU function is a feasible solution; it removes similarities with negative fractions and propagates the most useful information forward.
[0054]
[0055] A two-branch self-attention mechanism is introduced as a fundamental component, featuring an adaptive attention score to leverage two paradigms; the attention matrix in Equation (3) can be further updated as follows:
[0056] A=(w1*SSA+w2*DSA)V (6)
[0057] Where w1 and w2 are the two normalized weights of the two branches of adaptive modulation, and * denotes multiplication; more specifically, it can be calculated in the following way:
[0058]
[0059] Here, a1 and a2 are learnable parameters initialized with 1 in both branches; this design ensures a better balance between filtering out noisy interactions in the sequence and utilizing sufficient informative features.
[0060] During the model training phase, the exercise power time series is input into the improved Transformers model for heart rate prediction.
[0061] Experimental procedure:
[0062] All methods in the experiment were performed on a single RTX 3090 graphics card. The deep learning framework used was PyTorch, version 2.2.1, and CUDA version 11.8. The initial learning rate of the network was set to 0.0005, and Adam gradient descent with a decay weight of 0.0004 was used. The number of samples selected for each training session was set to 8, and the total training epochs were set to 300. The parameter sizes were adjusted by observing the training loss and validation loss.
[0063] The collected data included exercise data from 10 participants, covering three exercise categories (running, rope skipping, and stationary cycling). Each participant had 12 minutes of radar data collected for one exercise. For each exercise, the participants collected three sets of data. The data was collected using an IWR6843 radar and transmitted to a computer for further analysis via a DAC1000 data transmitter.
[0064] Table 1. HR estimation error in multiple experiments under different motion conditions.
[0065]
[0066] Table 2 Comparison of ECA module performance in PCFN module
[0067]
[0068] like Figure 2 As shown in the figure, the heart rate prediction value and the measured value of the present invention are compared, and it can be seen that the trend is basically consistent.
[0069] like Figure 3 As shown, the existing Transformer model and the measured values show a significant difference in trends, while the comparison clearly demonstrates that the prediction accuracy of the model in this invention is significantly improved.
[0070] Based on the above-described preferred embodiments of the present invention, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the inventive concept. The technical scope of this invention is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A millimeter-wave radar heart rate detection method based on an improved Transformer model, characterized in that, Includes the following steps: Step 1: Collect motion power data; Step 2: Input motion power data into the first convolutional layer as the input feature vector of the encoder of the improved Transformer model; the encoder includes: a first PCFN module and a second convolutional layer; the decoder includes: an ASSA module and a second PCFN module; the output feature vector of the decoder is input into the third convolutional layer.
2. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 1, characterized in that, The PCFN module includes: the input feature vector passes through an LN layer, PConv, ECA layer, and a first connection layer, and then undergoes a split operation. The first branch after the split operation is input into a first reshape layer, DWConv, and a second reshape layer, and then multiplied with the second branch after the split operation. The output of the second connection layer is then multiplied with the input feature vector.
3. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 1, characterized in that, The improved Transformer model consists of several layers stacked and cascaded.
4. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 2, characterized in that, The formula for the PCFN module is: Where W1 and W2 represent linear projection; [,] represent channel slicing operations; R(·) and F(·) represent data dimension reshaping and data dimension flattening operations; PConv(·) and DWConv(·) represent partial convolution and depthwise convolution operations, respectively; This represents matrix multiplication.
5. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 2, characterized in that, The kernel size of PConv is 3×1.
6. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 2, characterized in that, The kernel size of DWConv is 3×1.
7. The millimeter-wave radar heart rate detection method based on the improved Transformer model according to claim 1, characterized in that, The categories of sports include: running, skipping rope, and stationary cycling.
8. A millimeter-wave radar heart rate detection system based on an improved Transformer model, characterized in that, include: Memory is used to store instructions that can be executed by the processor; A processor for executing instructions to implement the millimeter-wave radar heart rate detection method based on the improved Transformer model as described in any one of claims 1-7.
9. A computer-readable medium storing computer program code, characterized in that, The computer program code, when executed by a processor, implements the millimeter-wave radar heart rate detection method based on the improved Transformer model as described in any one of claims 1-7.
Citation Information
Patent Citations
Heart rate detection method based on exercise power
CN120078391A