Heart shock signal monitoring method, system, device and medium based on transformer structure and adversarial learning

By combining the Transformer architecture with adversarial learning, the problems of individual differences and noise influence in traditional heart rate monitoring methods are solved, achieving higher monitoring accuracy and robustness.

CN118490214BActive Publication Date: 2026-03-03XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410603520.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2026-03-03
Estimated Expiration
2044-05-15

AI Technical Summary

Technical Problem

Traditional heart rate monitoring methods are limited by inconvenient equipment and weak model robustness, making it difficult to maintain consistency among different individuals. In particular, the accuracy is low for subjects who have not participated in training, and they are easily affected by noise.

Method used

A cardiac impact signal monitoring method using Transformer structure and adversarial learning is proposed. It captures signal correlation through self-attention mechanism, introduces gradient inversion layer to reduce individual differences and improve model generalization ability, and uses adversarial learning to ignore individual-specific features.

Benefits of technology

It improves the accuracy and robustness of cardiac impact signal monitoring, reduces noise interference, and enhances the model's adaptability in the real world.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118490214B_ABST
    Figure CN118490214B_ABST
Patent Text Reader

Abstract

A method, system, device, and medium for monitoring cardiac impact signals based on Transformer architecture and adversarial learning are presented. The method involves: acquiring training and testing sample sets of cardiac impact signals; constructing a deep learning network G based on the Transformer architecture with integrated adversarial learning, which better captures key features of cardiac impact signals and long-range dependencies; iteratively training the deep learning network G constructed in step two to obtain a trained network G. * The test sample set is fed into the trained network G. * The system performs detection to obtain predicted heart rate values, which are then visually compared with heart rate labels to calculate the error between the predicted and actual heart rates. The system, equipment, and media are based on the above method for monitoring cardiac impact signals and have the ability to cope with signal changes and noise interference in the real world, effectively improving the accuracy of cardiac impact signal detection in subjects who have not participated in training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical monitoring technology, and in particular to a method, system, device and medium for monitoring cardiac impact signals based on Transformer structure and adversarial learning. Background Technology

[0002] With the increasingly fast pace of modern life and growing public awareness of health, heart rate monitoring has gradually become an indispensable part of health management. As medical technology advances, heart rate monitoring is no longer confined to hospitals or specialized medical environments but is increasingly integrated into people's daily lives. In daily life, people's focus on heart health is no longer limited to the early detection and treatment of diseases, but also emphasizes prevention and self-management. Heart rate is one of the key indicators for measuring the functioning of the cardiovascular system. By monitoring heart rhythm, individuals can better understand their own physical condition, promptly identify potential problems, and take appropriate measures to maintain health. The demand for heart rate monitoring in modern society is no longer limited to specific groups, such as patients with heart disease or the elderly, but has expanded to a wider population. More and more people realize that by monitoring their heart rate in real time, they can more proactively adjust their lifestyles, exercise habits, and cope with potential stress factors, thereby improving their overall health.

[0003] Traditional heart rate monitoring methods are often limited by equipment, requiring contact sensors or specific hardware, which can be inconvenient for users. The introduction of deep learning offers new possibilities for contactless heart rate monitoring. While traditional electrocardiograms (ECGs) are effective in diagnosing heart disease, their analysis of subtle signals hidden behind massive amounts of data is relatively limited. Deep learning technology, through powerful neural network structures, can automatically learn and extract complex features from cardiac impulse signals, thereby achieving more accurate and sensitive monitoring.

[0004] Among them, Transformer is a neural network structure with a self-attention mechanism. It was initially used in the field of natural language processing, but its excellent sequence modeling ability also makes it perform well in temporal signal processing. In the monitoring of cardiac impact signals, traditional neural network structures may be limited by the long-distance dependencies between signals. Transformer, by introducing a self-attention mechanism, can better capture the complex relationships between different parts of the signal. This mechanism makes the model more flexible in processing cardiac impact signals and is not limited by the temporal relationship of the signal. Although it can effectively monitor cardiac impact signals, there are other related difficulties in cardiac impact signal monitoring: (1) Significant individual differences: A person's cardiac impact signal is affected by many factors, including: age, body mass index (BMI), whether or not exercise, etc., and the signal value will also show differences, resulting in large fluctuations in the signal value and difficulty in maintaining consistency among different individuals. (2) Low accuracy for data not involved in training: Existing models have low accuracy for cardiac impact signals of subjects not involved in training, which reflects the problem of weak robustness and insufficient generalization ability of existing models.

[0005] The drawback of existing technologies is that traditional models have low accuracy in detecting cardiac impact signals from untrained subjects, indicating weak model robustness, low generalization ability, and susceptibility to noise. Summary of the Invention

[0006] To overcome the problems of existing technologies, this invention proposes a method, system, device, and medium for monitoring cardiac impact signals based on Transformer architecture and adversarial learning. Introducing the Transformer model architecture allows for better capture of key features in cardiac impact signals and long-range dependencies, facilitating a more comprehensive understanding of the information within the signals. The self-attention mechanism enables the model to focus on important correlations between different parts of the signal, thus better capturing temporal information. Using a signal source classification task as an introduction of adversarial learning helps the model learn more discriminative features, making it more ignoring individual differences and learning the deepest feature information. Introducing perturbations through a gradient inversion layer forces the model to learn adversarial features, reducing its sensitivity to individual-specific signals and increasing signal monitoring accuracy. Compared to existing technologies, this model effectively reduces over-reliance on noise and non-critical features, enabling it to cope with real-world signal variations and noise interference, and effectively improving the accuracy of cardiac impact signal detection for untrained subjects.

[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0008] A method for monitoring cardiac impact signals based on Transformer architecture and adversarial learning, specifically including the following steps:

[0009] Step 1: Obtain the training and test sample sets of cardiac impact signals;

[0010] Step 2: Construct a deep learning network G based on the Transformer architecture that integrates adversarial learning;

[0011] Step 3: Iteratively train the deep learning network G based on the Transformer architecture constructed in Step 2 to obtain the trained network G. * ;

[0012] Step 4: Obtain the detection results of the test sample set.

[0013] The specific method for step one is as follows:

[0014] 1.1. Using a hydraulic bed sensor to achieve f s Cardiac impact signals A were collected from M subjects at a sampling frequency of [sample frequency].

[0015] A = {A1, A2, ..., A} m ,…,A M}, (6)

[0016] Among them, f s ≥100Hz, A m A represents the cardiac impulse signal of the m-th subject, 1≤m≤M. m The length is T, where T≥60000 and M≥2;

[0017] 1.2. The peak position P of the cardiac impulse signal was collected from M subjects using a finger sensor:

[0018] P = {P1, P2, ..., P} m ,…,P M}, (7)

[0019] Among them, P m This represents the sequence of peak points of the cardiac impulse signal in the m-th subject;

[0020] 1.3. The cardiac impact signal A is preprocessed using a sliding window of length D, with a step size of step, according to the acquisition time sequence for each cardiac impact signal A. m After N sliding operations, multiple signal segment sets are obtained. Each signal segment is Z-score normalized to obtain the cardiac impact signal set X. m :

[0021] Xm ={X m1 ,X m2 ,…,X mn ,…,X mN}, (8)

[0022] Among them, X mn N represents the nth cardiac impact signal segment representing the cardiac impact signal of the mth subject, where N = (TD) / step, D represents the sliding window length, and step represents the sliding distance. This represents the nth signal segment of the m-th cardiac impulse signal after standardization, where This represents the average value of the signal segment. Represents the variance of the signal segment;

[0023] 1.4. For each cardiac impact signal segment X mn Based on the peak point P m The heartbeat value Y is calculated by sliding a window of length D in steps of step 'step', based on the number of points within the window. mn :

[0024]

[0025] Where beats_num represents the number of beat peaks in the window, and beats_window_length represents the distance between two consecutive peaks within the window;

[0026] 1.5. Divide the data of M subjects into a training sample set and a test sample set according to the number of subjects. At the same time, randomly shuffle the signal segments in the training sample set.

[0027] The specific method for step two is as follows:

[0028] Construct a feature extractor T with a Transformer architecture and an output subnetwork F. c And the adversarial learning network F for classifying signal sources a The feature extractor T is based on the Transformer architecture, consisting of an Embedding layer and an Encoder layer. The Embedding layer acts as a linear transformation layer, adjusting the feature dimension of the input vector to an appropriate size. The Encoder layer consists of four encoder layers, each containing a four-head attention mechanism and a feedforward neural network. After each attention mechanism, residual connections and layer normalization are applied sequentially to enhance model performance. The output subnetwork F... c It consists of two fully connected layers, with ReLU and Dropout layers embedded sequentially between them to improve the model's robustness; the adversarial learning network F... aIt includes three fully connected layers, each followed by a ReLU layer and a Dropout layer to enhance the network's generalization ability; in the adversarial learning network F... a A gradient inversion layer is introduced between the feature extractor T and the adversarial learning network F. a The loss is backpropagated and multiplied by the hyperparameter λ, then passed to the feature extractor T; the hyperparameter λ is negative. Tuning the hyperparameter λ ensures that the loss function of the adversarial learning network trends upward, and is used to adjust the adversarial learning network F. a The adversarial relationship between the backbone network and the feature extractor T enhances the generalization ability of the backbone network; the expression for the loss function Loss is:

[0029]

[0030] Where Loss1 represents the output subnetwork F c The norm loss function, Loss2 represents the adversarial learning network F a The cross-entropy loss function, where ∑ represents summation, x i Let y represent the i-th information segment sample. i This represents the tag value corresponding to the i-th information segment. f(x) represents the subject ID corresponding to the source of the i-th information segment. i ) represents the predicted value of the i-th information segment sample after forward propagation through the network.

[0031] The specific method for step three is as follows:

[0032] 3.1. Set the number of iterations to t, the maximum number of iterations to M, M≥500, and set hyperparameters including the learning rate init. l r, random seed, device card, gradient reversal hyperparameter λ, and the round θ at which adversarial learning begins; set the learning rate adjustment parameter.

[0033] 3.2. The training sample set x i The feature set is then fed into a deep learning network G based on the Transformer architecture for forward propagation of the feature extractor T to obtain the feature set. The obtained feature set is then fed into the output sub-network F. c The predicted value f(x) is obtained i ), calculate and record the loss value L1 using the loss function Loss1;

[0034] 3.3. Determine if the current iteration number exceeds the threshold θ. If it does, feed the feature set into the adversarial learning network F. a The loss value L2 is calculated and recorded using the loss function Loss2;

[0035] 3.4. Using stochastic gradient descent, the weights w of the feature extractor T are adjusted by the loss value L1. T Output subnetwork F c weights Update; the update formulas are as follows:

[0036]

[0037] Where η represents the gradient descent parameter, This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated output subnetwork F. c The parameters, This indicates the output subnetwork F before the update. c The parameters, Indicates the differentiation operation;

[0038] 3.5. Stochastic gradient descent is employed, with the loss value L2 applied to the weights of the adversarial learning network. Update the weights w of the feature extractor T. T The update will be performed by multiplying by the gradient reversal parameter λ; the update formulas are as follows:

[0039]

[0040] Where η represents the gradient descent parameter, This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated adversarial learning network F c The parameters, The adversarial learning network F before the update is represented. a The parameters, Indicates the differentiation operation;

[0041] 3.6. Determine if t = M holds true. If so, obtain the trained network G. * Otherwise, let t = t + 1 and execute step 3.2.

[0042] The specific method for obtaining the detection results of the test sample set in step 4 is as follows:

[0043] The test sample set is fed into the trained network G. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

[0044] A cardiac impact signal monitoring system based on Transformer architecture and adversarial learning, comprising:

[0045] The preprocessing module divides the cardiac impact signals collected in step one into a training sample set and a test sample set.

[0046] The model building module is used to build the Transformer-based deep learning network G for adversarial learning in step two.

[0047] The training module is used in step three to iteratively train the deep learning network G based on the Transformer architecture constructed in step two, so as to obtain the trained network G. * ;

[0048] The prediction module is used in step four to feed the test sample set into the network G trained in step three. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

[0049] A cardiac impact signal monitoring device based on Transformer architecture and adversarial learning, comprising:

[0050] Memory, used to store computer programs;

[0051] A processor is used to implement the cardiac impact signal monitoring method based on Transformer structure and adversarial learning described in steps one to four when executing the computer program.

[0052] A computer-readable storage medium storing a computer program that, when executed by a processor, enables cardiac impact signal monitoring based on a Transformer architecture and adversarial learning according to the method described in steps one to four.

[0053] Compared with the prior art, the present invention has the following beneficial effects:

[0054] 1. The cardiac impact signals are preprocessed by sliding windowing and standardization. Each cardiac impact signal is slid through N times according to the acquisition time sequence to obtain multiple signal segment sets. Each signal segment is standardized by Z-Score to obtain the final cardiac impact signal set. The Transformer model architecture is introduced to better capture the key features in the cardiac impact signals and capture the long-distance dependencies in the signals, which helps to understand the information in the cardiac impact signals more comprehensively.

[0055] 2. Feature extractor T and output subnetwork F of the Transformer architecture c And the adversarial learning network F for classifying signal sources aUsing the classification signal source task as an introduction to adversarial learning can help the model learn more discriminative features, making it more able to ignore the differences between individuals and learn the deepest feature information.

[0056] 3. By introducing perturbations through the gradient inversion layer, the model learns adversarial features, reducing its sensitivity to individual specific signals, thereby increasing the accuracy of signal monitoring.

[0057] In summary, compared with existing technologies, this invention can effectively reduce the model's over-reliance on noise and non-critical features, enabling it to cope with signal changes and noise interference in the real world, and effectively improve the accuracy of cardiac impact signal detection in subjects who have not participated in training. Attached Figure Description

[0058] Figure 1 This is a flowchart of the workflow of the model of the present invention.

[0059] Figure 2 This is a graph showing the heart rate detection results of the test sample in this invention. Detailed Implementation

[0060] The present invention will now be described in further detail with reference to the accompanying drawings.

[0061] A method for monitoring cardiac impact signals based on Transformer architecture and adversarial learning, specifically including the following steps:

[0062] Step 1: Obtain the training and testing sample sets of cardiac impact signals. The specific method is as follows:

[0063] 1.1. Using a hydraulic bed sensor to achieve f s Cardiac impact signals A were collected from M subjects at a sampling frequency of [sample frequency].

[0064] A = {A1, A2, ..., A} m ,…,A M}, (6)

[0065] Among them, f s ≥100Hz, A m A represents the cardiac impulse signal of the m-th subject, 1≤m≤M. m The length is T, where T≥60000 and M≥2;

[0066] In this example, f is selected s =100Hz, T=60000, M=40;

[0067] 1.2. The peak position P of the cardiac impulse signal was collected from M subjects using a finger sensor:

[0068] P = {P1, P2, ..., P}m ,…,P M}, (7)

[0069] Among them, P m This represents the sequence of peak points of the cardiac impulse signal in the m-th subject;

[0070] 1.3. The cardiac impact signal A is preprocessed using a sliding window of length D, with a step size of step, according to the acquisition time sequence for each cardiac impact signal A. m After N sliding operations, multiple signal segment sets are obtained. Each signal segment is Z-score normalized to obtain the cardiac impact signal set X. m :

[0071] X m ={X m1 ,X m2 ,…,X mn ,…,X mN}, (8)

[0072] Among them, X mn N represents the nth cardiac impact signal segment representing the cardiac impact signal of the mth subject, where N = (TD) / step, D represents the sliding window length, and step represents the sliding distance. This represents the nth signal segment of the m-th cardiac impulse signal after standardization, where This represents the average value of the signal segment. Represents the variance of the signal segment;

[0073] In this example, D = f is selected. s *60 = 6000, step = 1

[0074] 1.4. For each cardiac impact signal segment X mn Based on the peak point P m The heartbeat value Y is calculated by sliding a window of length D in steps of step 'step', based on the number of points within the window. mn :

[0075]

[0076] Where beats_num represents the number of beat peaks in the window, and beats_window_length represents the distance between two consecutive peaks within the window;

[0077] 1.5. Divide the data of M subjects into a training sample set and a test sample set according to the number of subjects. Use the data of the first 80% of subjects as the training sample set and the data of the remaining 20% ​​of subjects as the test sample set. At the same time, randomly shuffle the signal segments in the training sample set.

[0078] Step 2: Construct a deep learning network G based on the Transformer architecture for ensemble adversarial learning. The specific method is as follows:

[0079] Construct a feature extractor T with a Transformer architecture and an output subnetwork F. c And the adversarial learning network F for classifying signal sources a The feature extractor T is based on the Transformer architecture, consisting of an Embedding layer and an Encoder layer. The Embedding layer acts as a linear transformation layer, adjusting the feature dimension of the input vector to an appropriate size. The Encoder layer consists of four encoder layers, each containing a four-head attention mechanism and a feedforward neural network. After each attention mechanism, residual connections and layer normalization are applied sequentially to enhance model performance. The output subnetwork F... c It consists of two fully connected layers, with ReLU and Dropout layers embedded sequentially between them to improve the model's robustness; the adversarial learning network F... a It includes three fully connected layers, each followed by a ReLU layer and a Dropout layer to enhance the network's generalization ability; in the adversarial learning network F... a A gradient inversion layer is introduced between the feature extractor T and the adversarial learning network (ALM). This layer backpropagates the loss of the ALM and multiplies it by the hyperparameter λ before passing it to the feature extractor T. The hyperparameter λ is negative. Tuning λ ensures that the ALM's loss function trendes upwards, preventing the ALM from distinguishing data and allowing the feature extractor to learn only deep, key, high-level features while ignoring useless surface features. The matrix effect (mae) is then obtained through validation on a validation set, and the hyperparameter with the lowest mae is selected. This mae is then used to adjust the ALM's performance. a The adversarial relationship between the backbone network and the feature extractor T enhances the generalization ability of the backbone network; the expression for the loss function Loss is:

[0080]

[0081] Where Loss1 represents the output subnetwork F c The norm loss function, Loss2 represents the adversarial learning network F a The cross-entropy loss function, where ∑ represents summation, x i Let y represent the i-th information segment sample.i This represents the tag value corresponding to the i-th information segment. f(x) represents the subject ID corresponding to the source of the i-th information segment. i ) represents the predicted value of the i-th information segment sample after forward propagation through the network.

[0082] Step 3: Iteratively train the deep learning network G based on the Transformer architecture constructed in Step 2 to obtain the trained network G. * The specific method is as follows:

[0083] 3.1. Set the number of iterations to t, the maximum number of iterations to M, M≥500, and set hyperparameters including the learning rate init. l r, random seed, device card, gradient reversal hyperparameter λ, and the starting round θ of adversarial learning are used to set a learning rate adjustment strategy. After a lot of experiments, it was found that the learning rate adjustment strategy of multiplying the learning rate by 0.1 every 70 iterations has a good effect.

[0084] 3.2. The training sample set x i The feature set is then fed into a deep learning network G based on the Transformer architecture for forward propagation of the feature extractor T to obtain the feature set. The obtained feature set is then fed into the output sub-network F. c The predicted value f(x) is obtained i ), calculate and record the loss value L1 using the loss function Loss1;

[0085] 3.3. Determine if the current iteration number exceeds the threshold θ. If it does, feed the feature set into the adversarial learning network F. a The loss value L2 is calculated and recorded using the loss function Loss2;

[0086] 3.4. Using stochastic gradient descent, the weights w of the feature extractor T are adjusted by the loss value L1. T Output subnetwork F c weights Update; the update formulas are as follows:

[0087]

[0088] Where η represents the gradient descent parameter, This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated output subnetwork F. c The parameters, This indicates the output subnetwork F before the update. c The parameters, Indicates the differentiation operation;

[0089] 3.5. Stochastic gradient descent is employed, with the loss value L2 applied to the weights of the adversarial learning network. Update the weights w of the feature extractor T. T The update will be performed by multiplying by the gradient reversal parameter λ; the update formulas are as follows:

[0090]

[0091] Where η represents the gradient descent parameter, This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated adversarial learning network F c The parameters, The adversarial learning network F before the update is represented. a The parameters, Indicates the differentiation operation;

[0092] 3.6. Determine if t = M holds true. If so, obtain the trained network G. * Otherwise, let t = t + 1 and execute step 3.2.

[0093] Step 4. Obtain the detection results of the test sample set:

[0094] The test sample set is fed into the trained network G. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

[0095] The present invention and a heart rate estimation detection method based on a Transformer architecture network were used to detect cardiac impulse signals in eight subjects who did not participate in training, and the estimation errors of the two methods with respect to the actual heart rate were calculated:

[0096]

[0097] Where J is the total number of samples in the subject test set, and y j and y' j Let be the actual heart rate and the estimated heart rate of the j-th subject, respectively. |*| represents the absolute value operation. The results are shown in Table 1.

[0098] Table 1 Comparison of heart rate estimation errors between the present invention and the transformer-based algorithm.

[0099]

[0100] As can be seen from Table 1, the average heart rate estimation error of the present invention on the test set sample of 8 subjects who did not participate in the training was 0.50, while the average heart rate estimation error based on the transformer method was 0.77. This indicates that the model of the present invention has better performance, better robustness and generalization ability, and therefore has important practical significance.

Claims

1. A method for monitoring cardiac impact signals based on Transformer architecture and adversarial learning, characterized in that, Specifically, the following steps are included: Step 1: Obtain the training and test sample sets of cardiac impact signals; Step 2: Construct a deep learning network G based on the Transformer architecture for ensemble adversarial learning; specifically: construct a feature extractor T including a Transformer architecture and an output sub-network F. c And the adversarial learning network F for classifying signal sources a ; The feature extractor T is based on the Transformer architecture, including an embedding layer and an encoder layer. The embedding layer acts as a linear transformation layer, adjusting the feature dimension of the input vector to an appropriate size. The encoder layer consists of four encoder layers, each containing a four-head attention mechanism and a feedforward neural network. After each attention mechanism, residual connections and layer normalization are applied sequentially to enhance model performance. The output subnetwork F... c It consists of two fully connected layers, with ReLU and Dropout layers embedded sequentially between them to improve the model's robustness; the adversarial learning network F... a It includes three fully connected layers, each followed by a ReLU layer and a Dropout layer to enhance the network's generalization ability; in the adversarial learning network F... a A gradient inversion layer is introduced between the feature extractor T and the adversarial learning network F. a The loss is backpropagated and multiplied by the hyperparameter λ, then passed to the feature extractor T; the hyperparameter λ is negative. Tuning the hyperparameter λ ensures that the loss function of the adversarial learning network trends upward, and is used to adjust the adversarial learning network F. a The adversarial relationship between the backbone network and the feature extractor T enhances the generalization ability of the backbone network; the expression for the loss function Loss is: Where Loss1 represents the output subnetwork F c The norm loss function, Loss2 represents the adversarial learning network F a The cross-entropy loss function, where ∑ represents summation, x i Let y represent the i-th information segment sample. i This represents the tag value corresponding to the i-th information segment. f(x) represents the subject ID corresponding to the source of the i-th information segment. i ) represents the predicted value of the i-th information segment sample after forward propagation through the network; Step 3: Iteratively train the deep learning network G based on the Transformer architecture constructed in Step 2 to obtain the trained network G. * ; Step 4: Obtain the detection results of the test sample set: Feed the test sample set into the trained network G. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

2. The method for monitoring cardiac impact signals based on Transformer structure and adversarial learning according to claim 1, characterized in that, The specific method for step one is as follows: 1.

1. Using a hydraulic bed sensor to achieve f s Cardiac impact signals A were collected from M subjects at a sampling frequency of [sample frequency]. A={A1,A2,…,A m ,…,A M }, (6) Among them, f s ≥100Hz, A m A represents the cardiac impulse signal of the m-th subject, 1≤m≤M. m The length is T, where T≥60000 and M≥2; 1.

2. The peak position P of the cardiac impulse signal was collected from M subjects using a finger sensor: P={P1,P2,…,P m ,…,P M }, (7) Among them, P m This represents the sequence of peak points of the cardiac impulse signal in the m-th subject; 1.

3. The cardiac impact signal A is preprocessed using a sliding window of length D, with a step size of step, according to the acquisition time sequence for each cardiac impact signal A. m After N sliding operations, multiple signal segment sets are obtained. Each signal segment is Z-score normalized to obtain the cardiac impact signal set X. m : X m ={X m1 ,X m2 ,…,X mn ,…,X mN }, (8) Among them, X mn N represents the nth cardiac impact signal segment representing the cardiac impact signal of the mth subject, where N = (TD) / step, D represents the sliding window length, and step represents the sliding distance. This represents the nth signal segment of the m-th cardiac impulse signal after standardization, where This represents the average value of the signal segment. Represents the variance of the signal segment; 1.

4. For each cardiac impact signal segment X mn Based on the peak point P m The heartbeat value Y is calculated by sliding a window of length D in steps of step 'step', based on the number of points within the window. mn : Where beats_num represents the number of beat peaks in the window, and beats_window_length represents the distance between two consecutive peaks within the window; 1.

5. Divide the data of M subjects into a training sample set and a test sample set according to the number of subjects. At the same time, randomly shuffle the signal segments in the training sample set.

3. The method for monitoring cardiac impact signals based on Transformer structure and adversarial learning according to claim 1, characterized in that the specific method of step three is as follows: 3.

1. Set the number of iterations to t, the maximum number of iterations to M, M≥500, and set hyperparameters including the learning rate init. l r, random seed, device card, gradient reversal hyperparameter λ, and the round θ at which adversarial learning begins; set the learning rate adjustment parameter. 3.

2. The training sample set x i The feature set is then fed into a deep learning network G based on the Transformer architecture for forward propagation of the feature extractor T to obtain the feature set. The obtained feature set is then fed into the output sub-network F. c The predicted value f(x) is obtained i ), calculate and record the loss value L1 using the loss function Loss1; 3.

3. Determine if the current iteration number exceeds the threshold θ. If it does, feed the feature set into the adversarial learning network F. a The loss value L2 is calculated and recorded using the loss function Loss2; 3.

4. Using stochastic gradient descent, the weights w of the feature extractor T are adjusted by the loss value L1. T Output subnetwork F c weights Update; the update formulas are as follows: Where η represents the gradient descent parameter, This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated output subnetwork F. c The parameters, This indicates the output subnetwork F before the update. c The parameters, Indicates the differentiation operation; 3.

5. Stochastic gradient descent is employed, with the loss value L2 applied to the weights of the adversarial learning network. Update the weights w of the feature extractor T. T The update will be performed by multiplying by the gradient reversal parameter λ; the update formulas are as follows: in, η represents the gradient descent parameter. This represents the updated feature extractor T parameters. This represents the parameters of the feature extractor T before the update. This indicates the updated adversarial learning network F c The parameters, The adversarial learning network F before the update is represented. a The parameters, Indicates the differentiation operation; 3.

6. Determine if t = M holds true. If so, obtain the trained network G. * Otherwise, let t = t + 1 and execute step 3.

2.

4. The cardiac impact signal monitoring method based on Transformer structure and adversarial learning according to claim 1, characterized in that, Step 4, obtaining the detection results of the test sample set, specifically involves feeding the test sample set into the trained network G. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

5. A cardiac impact signal monitoring system based on Transformer architecture and adversarial learning, used to implement the method described in any one of claims 1 to 4, characterized in that, include: The preprocessing module divides the cardiac impact signals collected in step one into a training sample set and a test sample set. The model building module is used to build the Transformer-based deep learning network G for adversarial learning in step two. The training module is used in step three to iteratively train the deep learning network G based on the Transformer architecture constructed in step two, so as to obtain the trained network G. * ; The prediction module is used in step four to feed the test sample set into the network G trained in step three. * The system performs a test to obtain a predicted heart rate value, which is then visually compared with the heart rate label to calculate the error between the predicted value and the actual heart rate.

6. A cardiac impact signal monitoring device based on Transformer architecture and adversarial learning, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the cardiac impact signal monitoring method based on Transformer architecture and adversarial learning as described in any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it can realize cardiac impact signal monitoring based on Transformer structure and adversarial learning according to the method of any one of claims 1 to 4.

Citation Information

Patent Citations

  • Cross-modal-mapping-based heart rate estimation method for ballistocardiogram signals

    CN111887858A

  • Ballistocardiogram signal reconstruction method based on heart rate tag generation

    CN115024716A