A method, system and program product for reconstructing electrocardiogram signals in motion

Through IMU inertial measurement signal acquisition and feature extraction, combined with the model of the bidirectional gated cyclic network and multi-head attention mechanism layer, the problems of inconvenient wear and inaccurate monitoring of the ECG monitor equipment in the motion state are solved, and the ECG signal is realized Accurate reconstruction and efficient monitoring improve user experience.

CN118690167BActive Publication Date: 2025-01-03BEIJING ANZHEN HOSPITAL AFFILIATED TO CAPITAL MEDICAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410745003.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2025-01-03
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

The existing electrocardiogram monitoring equipment is inconvenient to wear and inaccurate monitoring in the state of exercise, which cannot meet the needs of normal activities, and has low ease of use and comfort.

Method used

IMU inertial measurement signal acquisition is adopted, and the twelve-dimensional feature vector is extracted after normalization of fixed time windows, and the trained electrocardiogram signal reconstruction model is input for feature analysis and reconstruction, using bidirectional gating recurrent network and multi-head The attention mechanism layer performs signal reconstruction.

Benefits of technology

It realizes accurate reconstruction of the ECG signal in the state of motion, suppresses motion interference, improves the accuracy and robustness of ECG signal monitoring, and does not require skin contact and wear, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690167B_ABST
    Figure CN118690167B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of electrocardiogram monitoring technology, and specifically discloses an electrocardiogram signal reconstruction method, system and program product in a motion state. By collecting IMU inertial measurement information of the user in a motion state, multi-dimensional feature extraction is performed on the IMU inertial measurement information, and the extracted multi-dimensional inertial measurement information features are reconstructed using a combination model of a bidirectional gated recurrent unit based on a self-attention mechanism and a convolutional neural network. The electrocardiogram signal during the user's motion process can be reproduced in time, and the influence caused by the motion can be effectively suppressed. The anti-interference ability is strong, and the accuracy and robustness of the electrocardiogram signal reconstruction can be improved, providing an effective way for the user to reliably monitor the electrocardiogram signal in the living state. The present invention replaces electrocardiogram signal monitoring with IMU inertial measurement, which can effectively solve the problem that the user's electrocardiogram signal monitoring has high wearing requirements and low comfort during normal activities, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electrocardiogram monitoring, and in particular relates to a method, system and program product for reconstructing electrocardiogram signals in a motion state. Background Art

[0002] ECG monitoring is a means of monitoring heart activity. Ordinary ECG can only observe short-term ECG activity, while ECG monitoring can continuously monitor heart activity, timely observe the condition, provide reliable and valuable ECG activity indicators, and guide real-time processing. Therefore, it is of great value to patients with abnormal ECG activity. At present, ECG monitoring of patients is mostly achieved by having patients wear special ECG signal acquisition equipment to collect their ECG signals. For patients, such equipment needs to be worn close to the skin and has certain requirements for wearing methods. It is inconvenient to wear and use, and from the perspective of wearing comfort, it will also cause certain troubles to patients. At the same time, such equipment will have inaccurate monitoring when used by patients in motion, and cannot meet the normal activity needs of the wearer, and is not easy to use. Summary of the invention

[0003] The purpose of the present invention is to provide a method, system and program product for reconstructing electrocardiogram signals in a moving state, so as to solve the above-mentioned problems existing in the prior art.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] In a first aspect, a method for reconstructing an electrocardiogram signal in a motion state is provided, comprising:

[0006] Collect IMU inertial measurement signals of the target user in motion;

[0007] A fixed time window is used to normalize the IMU inertial measurement signal to obtain a normalized IMU inertial measurement signal;

[0008] The signal feature extraction is performed on the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude feature, three-dimensional position feature, three-dimensional angular velocity feature and three-dimensional acceleration feature;

[0009] The twelve-dimensional feature vector is input into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion. The ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is used to input the twelve-dimensional feature vector. The bidirectional gated recurrent network layer is used to capture the twelve-dimensional feature vector in both positive and negative directions to obtain context feature information. The multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set. The connection layer is used to reconstruct the ECG signal of the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal.

[0010] In a possible design, before inputting the twelve-dimensional feature vector into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction, the method further includes:

[0011] Constructing an ECG signal reconstruction model, wherein the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence;

[0012] Acquire an ECG signal set and an IMU inertial measurement signal set of a target user, wherein the ECG signal set includes a plurality of initial ECG signal samples of the target user in a resting state, a walking state, and a moving state, and the IMU inertial measurement signal set includes a plurality of initial IMU inertial measurement signal samples of the target user in a resting state, a walking state, and a moving state, and each initial IMU inertial measurement signal sample is respectively associated with a corresponding initial ECG signal sample;

[0013] The initial IMU inertial measurement signal samples and their associated initial ECG signal samples are resampled and synchronously processed at a fixed frequency, and the initial ECG signal samples are filtered using a Butterworth filter to obtain preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples, and then the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples are normalized using a fixed time window to obtain IMU inertial measurement signal samples and ECG signal samples;

[0014] Extract signal features from IMU inertial measurement signal samples to obtain twelve-dimensional feature vector samples including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features. Associate each twelve-dimensional feature vector sample with the corresponding electrocardiogram signal sample to form a corresponding sample pair. The twelve-dimensional feature vector samples in the sample pair are used as model inputs, and the electrocardiogram signal samples in the sample pair are used as the true signal values ​​of the corresponding twelve-dimensional feature vector samples.

[0015] Use each sample pair to form a sample set, and divide the sample set into a training set and a test set;

[0016] The ECG signal reconstruction model is trained using the training set until the set training conditions are met to obtain the trained ECG signal reconstruction model. The trained ECG signal reconstruction model is tested using the test set to obtain the trained ECG signal reconstruction model after the set test accuracy conditions are met.

[0017] In a possible design, the step of training the ECG signal reconstruction model using the training set includes:

[0018] The twelve-dimensional feature vector samples in the sample pair are input into the ECG signal reconstruction model for a round of training to obtain the reconstructed predicted signal value;

[0019] Based on the predicted signal value and the corresponding true signal value, the prediction deviation between the predicted signal value and the corresponding true signal value is calculated using the error mean sum function, and the error mean sum function is:

[0020]

[0021] Among them, MSE represents the average error, m represents the data length of the input sample, and y i Characterize the predicted signal value, Characterize the true signal value;

[0022] The Adam optimizer was used to update the model parameters of the ECG signal reconstruction model in each round of training, and the learning rate was set to 0.0001.

[0023] In one possible design, the set training conditions are 1000 rounds of training, a batch size of 256, and minimum prediction deviation.

[0024] In one possible design, the bidirectional gated recurrent network layer includes a reset gate r t and update gate z t , reset gate r t Used to control the degree of forgetting historical state information, update gate z t It is used to control the extent to which historical state information is brought into the current state. The input of the bidirectional gated recurrent network layer is the input x at the current moment. t and the implicit state h at the previous moment t-1 , the output is the hidden state h at the current moment t ,and

[0025]

[0026] r t =σ(W r [Ht-1 ,x t ]+b t )

[0027] z t =σ(W z [h t-1 ,x t ]+b z )

[0028] Among them, W t and b t Reset gate r t The weight matrix and bias, W z and b z Update gate z t The weight matrix and bias of , W and b are the weight matrix and bias of the cyclic connection, σ is the setting coefficient, t is the time sequence number, represents the candidate hidden state at the current moment, and tanh represents the hyperbolic tangent function.

[0029] In one possible design, the multi-head attention mechanism layer linearly transforms its input into a query matrix Q, a key matrix K, and a value matrix V, and uses a multi-head self-attention mechanism algorithm to calculate the query matrix Q, the key matrix K, and the value matrix V to obtain the corresponding signal features. The multi-head self-attention mechanism algorithm is

[0030]

[0031] Among them, Attention(Q, K, V) represents the multi-head self-attention mechanism operator, softmax represents the softmax function, K T represents the transposed matrix of the key matrix K.

[0032] In a possible design, the IMU inertial measurement signal includes three-dimensional acceleration information and three-dimensional angular velocity information, and the signal feature extraction is performed on the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features, including:

[0033] Perform inertial navigation calculation on the three-dimensional acceleration information and three-dimensional angular velocity information contained in the normalized IMU inertial measurement signal to obtain the corresponding three-dimensional orientation attitude information and three-dimensional relative position information;

[0034] The three-dimensional orientation information, the three-dimensional relative position information, the three-dimensional acceleration information and the three-dimensional angular velocity information are used for feature extraction and combination to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features and three-dimensional acceleration features.

[0035] In a second aspect, a system for reconstructing an electrocardiogram signal in a motion state is provided, comprising a signal acquisition unit, a signal processing unit, a feature extraction unit and a signal reconstruction unit, wherein:

[0036] A signal acquisition unit, used to collect IMU inertial measurement signals of the target user in motion;

[0037] A signal processing unit, used for normalizing the IMU inertial measurement signal using a fixed time window to obtain a normalized IMU inertial measurement signal;

[0038] A feature extraction unit is used to extract signal features from the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features;

[0039] The signal reconstruction unit is used to input the twelve-dimensional feature vector into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion. The ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is used to input the twelve-dimensional feature vector. The bidirectional gated recurrent network layer is used to capture the twelve-dimensional feature vector in both positive and negative directions to obtain context feature information. The multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set. The connection layer is used to reconstruct the ECG signal of the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal.

[0040] In a third aspect, a system for reconstructing an electrocardiogram signal in motion is provided, comprising:

[0041] A memory for storing instructions;

[0042] A processor is used to read the instructions stored in the memory and execute any one of the methods described in the first aspect according to the instructions.

[0043] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored on the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes any one of the methods described in the first aspect. In addition, a computer program product is provided, and when the computer program product is executed on a computer, the computer executes any one of the methods described in the first aspect.

[0044] Beneficial effects: The present invention collects IMU inertial measurement information of the user in motion, extracts multi-dimensional features of the IMU inertial measurement information, and reconstructs the ECG signal based on the combined model of the self-attention mechanism bidirectional gated recurrent unit and convolutional neural network for the extracted multi-dimensional inertial measurement information features. It can reproduce the ECG signal of the user in motion in a timely manner and effectively suppress the influence caused by motion. It has strong anti-interference ability, can improve the accuracy and robustness of ECG signal reconstruction, and provide an effective way for users to reliably monitor ECG signals in their daily lives. The present invention replaces ECG signal monitoring with IMU inertial measurement. IMU is easy to use and does not need to be worn in contact with the skin. It can effectively solve the problem of high wearing requirements and low comfort of ECG signal monitoring during normal activities, and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1 This is a schematic diagram of the steps of the method in Example 1 of the present invention;

[0047] Figure 2 This is a schematic diagram of the structure of the central electrical signal reconstruction model in Example 1 of the present invention;

[0048] Figure 3 Schematic diagram of the structure of a single gated recurrent unit in Example 1 of the present invention;

[0049] Figure 4 Schematic diagram of the structure of the connection layer in Example 1 of the present invention;

[0050] Figure 5 Schematic diagram of the system structure in Example 3 of the present invention. DETAILED DESCRIPTION

[0051] It should be noted that the description of these embodiments is intended to help understand the present invention, but does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only intended to describe exemplary embodiments of the present invention. However, the present invention can be embodied in a number of alternative forms, and should not be construed as being limited to the embodiments set forth herein.

[0052] It should be understood that, unless otherwise clearly specified and limited, the term "connection" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the embodiments can be understood according to specific circumstances.

[0053] In the following description, certain details are provided to facilitate a complete understanding of the example embodiments. However, it will be appreciated by those of ordinary skill in the art that the example embodiments may be implemented without these certain details. For example, the system may be shown in a block diagram to avoid obscuring the example with unnecessary details. In other embodiments, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the embodiments.

[0054] Embodiment 1:

[0055] This embodiment provides a method for reconstructing an ECG signal in a motion state. Figure 1 As shown, the method comprises the following steps:

[0056] S1. Collect the IMU inertial measurement signal of the target user in motion.

[0057] In specific implementation, an inertial measurement unit (IMU) can be placed on the target user, and the IMU inertial measurement signal of the target user in motion can be collected through the inertial measurement unit (IMU). The inertial measurement unit (IMU) does not need to be worn against the skin, but only needs to be placed on the target user like a mobile phone. It can effectively solve the problem of high wearing requirements and low comfort of ECG signal monitoring in normal activities, and improve the user experience. The IMU inertial measurement signal contains three-dimensional acceleration information and three-dimensional angular velocity information, and the IMU inertial measurement signal is transmitted to the corresponding processor, and the processor performs subsequent signal processing and ECG signal reconstruction. The inertial measurement unit (IMU) is a device for measuring the three-axis attitude angle (or angular velocity) and acceleration of an object. Generally, an IMU contains three single-axis accelerometers and three single-axis gyroscopes. The accelerometer detects the acceleration signal of the object in the independent three-axis of the carrier coordinate system, and the gyroscope detects the angular velocity signal of the carrier relative to the navigation coordinate system, measures the angular velocity and acceleration of the object in three-dimensional space, and can solve the attitude of the object.

[0058] S2. Use a fixed time window to normalize the IMU inertial measurement signal to obtain a normalized IMU inertial measurement signal.

[0059] In a specific implementation, the processor may use a fixed time window to normalize the IMU inertial measurement signal, normalize the signal value of the IMU inertial measurement signal in the time series to between -1 and 1, and obtain the normalized IMU inertial measurement signal.

[0060] S3. Perform signal feature extraction on the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features.

[0061] In specific implementation, the processor can perform inertial navigation solution on the three-dimensional acceleration information and three-dimensional angular velocity information contained in the normalized IMU inertial measurement signal to obtain the corresponding three-dimensional orientation and attitude information and three-dimensional relative position information. Then, the three-dimensional orientation and attitude information, three-dimensional relative position information, three-dimensional acceleration information and three-dimensional angular velocity information are used to perform feature extraction and combination to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features and three-dimensional acceleration features.

[0062] S4. Input the twelve-dimensional feature vector into the trained ECG signal reconstruction model to perform feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion. The ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is used to input the twelve-dimensional feature vector. The bidirectional gated recurrent network layer is used to capture the twelve-dimensional feature vector in both positive and negative directions to obtain context feature information. The multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set. The connection layer is used to reconstruct the ECG signal of the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal.

[0063] In specific implementation, the processor needs to pre-build an ECG signal reconstruction model, such as Figure 2As shown, the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is a feature vector input layer, which is intended to input the IMU signal feature vector data of a fixed time window; the bidirectional gated recurrent (BiGRU) network layer is intended to capture the signal features in both positive and negative directions to obtain context feature information; the multi-head attention mechanism layer carries out multi-level information extraction on the basis of obtaining relevant information in the bidirectional gated recurrent (BiGRU) network layer, and obtains the signal features of each sampling signal point combined with other sampling signal points and its own attention; the connection layer is intended to realize the reconstruction prediction of the ECG signal through a point-by-point convolutional neural network based on the signal feature set. The bidirectional gated recurrent unit (BiGRU) network is a variant of the recurrent neural network (RNN). Using BiGRU can more fully mine data features and effectively use future information to make up for the causal relationship of the signal. The model fully combines the ability of the attention mechanism to select key information with the ability of BiGRU to capture long-term dependencies and obtain future information. Finally, the spatial mapping from the feature signal layer to the data signal layer can be realized through the point-by-point convolutional network of the connection layer.

[0064] The bidirectional gated recurrent unit has a powerful memory function and is good at processing sequence information. The internal structure of a single gated recurrent unit is as follows: Figure 3 As shown, it includes a reset gate r t and update gate z t , reset gate r t It is used to control the degree of forgetting historical state information, which helps to capture short-term dependencies in the sequence and update the gate z t It is used to control the extent to which historical state information is brought into the current state, helping to capture the long-term dependencies of the sequence. The input of the bidirectional gated recurrent network layer is the input x at the current moment. t and the implicit state h at the previous moment t-1 , the output is the hidden state h at the current moment t ,and

[0065]

[0066]

[0067] r t =σ(W r [H t-1 ,x t ]+b t )

[0068] z t =σ(W z [h t-1 ,x t ]+b z )

[0069] Among them, W r and b r Reset gate r t The weight matrix and bias, W z and b z Update gate z t The weight matrix and bias of , W and b are the weight matrix and bias of the cyclic connection, σ is the setting coefficient, t is the time sequence number, represents the candidate hidden state at the current moment, and tanh represents the hyperbolic tangent function.

[0070] The multi-head self-attention mechanism can better utilize the information between contexts, reduce the loss of sequence information, strengthen the dependence between amplitude spectra, improve the performance of signal separation, and use the multi-head self-attention mechanism to obtain global sequence information from multiple subspaces and mine the intrinsic features contained in the signal. The multi-head attention mechanism layer linearly transforms its input into the query matrix Q, key matrix K and value matrix V (query matrix Q∈R n×d , key matrix K∈R n×d , value matrix V∈R n×d , d is the number of hidden layer nodes, n is the input length), and the multi-head self-attention mechanism algorithm is used to calculate the query matrix Q, the key matrix K and the value matrix V to obtain the corresponding signal features. The multi-head self-attention mechanism algorithm is

[0071]

[0072] Among them, Attention(Q, K, V) represents the multi-head self-attention mechanism operator, softmax represents the softmax function, K T represents the transposed matrix of the key matrix K.

[0073] like Figure 4 As shown, the connection layer uses a point-by-point convolutional network to replace the fully connected layer of the traditional neural network. The ability to capture characteristic signals is achieved by performing small calculations at each specific point in the data. The number of kernels in the convolution block Conv1D (1*1 convolution) input encoding layer and the point-by-point forward layer is 250.

[0074] After constructing the ECG signal reconstruction model, it is necessary to perform deep learning on the ECG signal reconstruction model to meet the accuracy and robustness requirements of ECG signal reconstruction. The deep learning process includes:

[0075] Acquire an ECG signal set and an IMU inertial measurement signal set of the target user. The ECG signal set can be collected by an ECG monitoring device, including several initial ECG signal samples of the target user in a resting state, a walking state, and a moving state. The IMU inertial measurement signal set can be collected by an IMU, including several initial IMU inertial measurement signal samples of the target user in a resting state, a walking state, and a moving state. Each initial IMU inertial measurement signal sample is respectively associated with a corresponding initial ECG signal sample, that is, the two corresponding signal samples are associated and collected synchronously, and are synchronized in timing.

[0076] Next, the initial IMU inertial measurement signal samples and their associated initial ECG signal samples are resampled and synchronized at a fixed frequency, and the initial ECG signal samples are filtered using a Butterworth filter (ECG signals often contain various noises, such as baseline drift, power supply interference, and myoelectric noise, and the Butterworth filter can simultaneously remove high-frequency and low-frequency noises) to obtain the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples, and then the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples are normalized using a fixed time window, and the corresponding signal values ​​of the signal samples are normalized to a specified interval range to obtain the IMU inertial measurement signal samples and ECG signal samples.

[0077] The signal features of the IMU inertial measurement signal samples are extracted to obtain twelve-dimensional feature vector samples including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features (since the user's movement affects not only acceleration and angular velocity, but also the current posture orientation and relative motion amplitude, the posture estimation is performed based on the IMU six-axis data through the inertial navigation solution principle to obtain three-dimensional orientation posture information and three-dimensional relative position information, plus three-dimensional angular velocity information and three-dimensional acceleration information to form twelve-dimensional information, and extract twelve-dimensional feature vectors). Each twelve-dimensional feature vector sample is associated with the corresponding ECG signal sample to form a corresponding sample pair. The twelve-dimensional feature vector samples in the sample pair are used as the model input, and the ECG signal samples in the sample pair are used as the true signal value of the corresponding twelve-dimensional feature vector sample.

[0078] A sample set is formed using each sample pair, and the sample set is divided into a training set and a test set, such as dividing the sample set into a training set and a test set in a ratio of 7:3. The training set is then used to train the ECG signal reconstruction model, and the training can be performed using a ten-fold cross-validation method until the set training conditions are met, thereby obtaining a trained ECG signal reconstruction model. During training, the twelve-dimensional feature vector samples in the sample pair are input into the ECG signal reconstruction model for a round of training to obtain a reconstructed predicted signal value; then, based on the predicted signal value and the corresponding true signal value, the error mean sum function is used to calculate the prediction deviation between the predicted signal value and the corresponding true signal value, and the error mean sum function is:

[0079]

[0080] Among them, MSE represents the average error, m represents the data length of the input sample, and y i Characterize the predicted signal value, Represents the true signal value. The training process uses the Adam optimizer to update the model parameters of the ECG signal reconstruction model in each round of training, and sets the learning rate to 0.0001, that is, the error average and MSE reach 0.0001 as the convergence condition. The training conditions can be set to 1000 rounds of training, a batch size of 256, and minimum prediction deviation. The model parameters of the training process that meet this condition are optimal, and the model can be configured to obtain the trained ECG signal reconstruction model. Finally, the trained ECG signal reconstruction model is tested using the test set. After reaching the set test accuracy conditions, the trained ECG signal reconstruction model is obtained.

[0081] After obtaining the trained ECG signal reconstruction model, the twelve-dimensional feature vector can be input into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction in actual application to obtain the ECG signal of the target user in motion, and the ECG signal of the target user in motion can be saved and output.

[0082] The method of this embodiment collects IMU inertial measurement information of the user in motion, extracts multi-dimensional features of the IMU inertial measurement information, and reconstructs the ECG signal using a combination model of a bidirectional gated recurrent unit based on a self-attention mechanism and a convolutional neural network for the extracted multi-dimensional inertial measurement information features. It can reproduce the ECG signal of the user in motion in a timely manner and effectively suppress the impact of motion. It has strong anti-interference ability, can improve the accuracy and robustness of ECG signal reconstruction, and provide an effective way for users to reliably monitor ECG signals in their daily lives. The method of this embodiment replaces ECG signal monitoring with IMU inertial measurement. IMU is easy to use and does not need to be worn in contact with the skin. It can effectively solve the problem of high wearing requirements and low comfort of ECG signal monitoring during normal activities, and improve the user experience.

[0083] Embodiment 2:

[0084] This embodiment provides an electrocardiogram signal reconstruction system in a motion state, including a signal acquisition unit, a signal processing unit, a feature extraction unit and a signal reconstruction unit, wherein:

[0085] A signal acquisition unit, used to collect IMU inertial measurement signals of the target user in motion;

[0086] A signal processing unit, used for normalizing the IMU inertial measurement signal using a fixed time window to obtain a normalized IMU inertial measurement signal;

[0087] A feature extraction unit is used to extract signal features from the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features;

[0088] The signal reconstruction unit is used to input the twelve-dimensional feature vector into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion. The ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is used to input the twelve-dimensional feature vector. The bidirectional gated recurrent network layer is used to capture the twelve-dimensional feature vector in both positive and negative directions to obtain context feature information. The multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set. The connection layer is used to reconstruct the ECG signal of the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal.

[0089] Furthermore, the system also includes a model building unit, a sample acquisition unit, a sample processing unit and a deep learning unit, wherein:

[0090] A model building unit, used to build an ECG signal reconstruction model, wherein the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence;

[0091] A sample acquisition unit, used to acquire an ECG signal set and an IMU inertial measurement signal set of a target user, wherein the ECG signal set includes a plurality of initial ECG signal samples of the target user in a resting state, a walking state, and a moving state, and the IMU inertial measurement signal set includes a plurality of initial IMU inertial measurement signal samples of the target user in a resting state, a walking state, and a moving state, and each initial IMU inertial measurement signal sample is respectively associated with a corresponding initial ECG signal sample;

[0092] A sample processing unit is used to resample and synchronize the initial IMU inertial measurement signal samples and their associated initial ECG signal samples at a fixed frequency, and filter the initial ECG signal samples using a Butterworth filter to obtain preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples, and then use a fixed time window to normalize the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples to obtain IMU inertial measurement signal samples and ECG signal samples; extract signal features from the IMU inertial measurement signal samples to obtain twelve-dimensional feature vector samples including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features, associate each twelve-dimensional feature vector sample with a corresponding ECG signal sample to form a corresponding sample pair, use the twelve-dimensional feature vector sample in the sample pair as a model input, and use the ECG signal sample in the sample pair as the true signal value of the corresponding twelve-dimensional feature vector sample; use each sample pair to form a sample set, and segment the sample set to obtain a training set and a test set;

[0093] The deep learning unit is used to train the ECG signal reconstruction model using the training set until the set training conditions are met, thereby obtaining the trained ECG signal reconstruction model; and to test the trained ECG signal reconstruction model using the test set, thereby obtaining the trained ECG signal reconstruction model after the set test accuracy conditions are met.

[0094] Embodiment 3:

[0095] This embodiment provides a system for reconstructing electrocardiogram signals in a motion state. Figure 5 As shown, at the hardware level, it includes:

[0096] Data interface, used to establish data connection between the processor and the inertial measurement unit;

[0097] A memory for storing instructions;

[0098] The processor is used to read the instructions stored in the memory and execute the electrocardiogram signal reconstruction method in Example 1 according to the instructions.

[0099] Optionally, the system further includes an internal bus, through which the processor, the memory and the data interface can be interconnected, and the internal bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.

[0100] The memory may include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) and / or first in last out (FILO) memory, etc. The processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0101] Embodiment 4:

[0102] This embodiment provides a computer-readable storage medium, on which instructions are stored, and when the instructions are executed on a computer, the computer executes the ECG signal reconstruction method in Embodiment 1. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, etc. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0103] This embodiment further provides a computer program product, which, when running on a computer, executes the ECG signal reconstruction method in Embodiment 1. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.

[0104] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for reconstructing electrocardiogram signals in motion, characterized in that: include: Collect IMU inertial measurement signals of the target user in motion; A fixed time window is used to normalize the IMU inertial measurement signal to obtain a normalized IMU inertial measurement signal; The signal feature extraction is performed on the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude feature, three-dimensional position feature, three-dimensional angular velocity feature and three-dimensional acceleration feature; Input the twelve-dimensional feature vector into the trained ECG signal reconstruction model to perform feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion, wherein the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence, wherein the input layer is used to input the twelve-dimensional feature vector, the bidirectional gated recurrent network layer is used to perform positive and negative bidirectional capture of the twelve-dimensional feature vector to obtain context feature information, the multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set, and the connection layer is used to perform ECG signal reconstruction on the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal; Before inputting the twelve-dimensional feature vector into the trained ECG signal reconstruction model to perform feature vector analysis and ECG signal reconstruction, the method further includes: Constructing an ECG signal reconstruction model, wherein the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence; Acquire an ECG signal set and an IMU inertial measurement signal set of a target user, wherein the ECG signal set includes a plurality of initial ECG signal samples of the target user in a resting state, a walking state, and a moving state, and the IMU inertial measurement signal set includes a plurality of initial IMU inertial measurement signal samples of the target user in a resting state, a walking state, and a moving state, and each initial IMU inertial measurement signal sample is respectively associated with a corresponding initial ECG signal sample; The initial IMU inertial measurement signal samples and their associated initial ECG signal samples are resampled and synchronously processed at a fixed frequency, and the initial ECG signal samples are filtered using a Butterworth filter to obtain preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples, and then the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples are normalized using a fixed time window to obtain IMU inertial measurement signal samples and ECG signal samples; Extract signal features from IMU inertial measurement signal samples to obtain twelve-dimensional feature vector samples including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features. Associate each twelve-dimensional feature vector sample with the corresponding electrocardiogram signal sample to form a corresponding sample pair. The twelve-dimensional feature vector samples in the sample pair are used as model inputs, and the electrocardiogram signal samples in the sample pair are used as the true signal values ​​of the corresponding twelve-dimensional feature vector samples. Use each sample pair to form a sample set, and divide the sample set into a training set and a test set; The ECG signal reconstruction model is trained using the training set until the set training conditions are met to obtain the trained ECG signal reconstruction model, and the trained ECG signal reconstruction model is tested using the test set to obtain the trained ECG signal reconstruction model after the set test accuracy conditions are met; The method of training the electrocardiogram signal reconstruction model using the training set includes: The twelve-dimensional feature vector samples in the sample pair are input into the ECG signal reconstruction model for a round of training to obtain the reconstructed predicted signal value; Based on the predicted signal value and the corresponding true signal value, the prediction deviation between the predicted signal value and the corresponding true signal value is calculated using the error mean sum function, and the error mean sum function is: Among them, MSE represents the average error, m represents the data length of the input sample, and y i Characterize the predicted signal value, Characterize the true signal value; The Adam optimizer was used to update the model parameters of the ECG signal reconstruction model in each round of training, and the learning rate was set to 0.0001.

2. The method for reconstructing an electrocardiogram signal in a motion state according to claim 1, characterized in that: The training conditions are set as follows: 1000 rounds of training, a batch size of 256, and minimum prediction deviation.

3. The method for reconstructing an electrocardiogram signal in a motion state according to claim 1, characterized in that: The bidirectional gated recurrent network layer includes a reset gate r t and update gate z t , reset gate r t Used to control the degree of forgetting historical state information, update gate z t It is used to control the extent to which historical state information is brought into the current state. The input of the bidirectional gated recurrent network layer is the input x at the current moment. t and the implicit state h at the previous moment t-1 , the output is the hidden state h at the current moment t ,and r t =α(W r [h t-1 ,x t ]+b r ) z t =σ(W z [h t-1 ,x t ]+b z ) Among them, W r and b r Reset gate r t The weight matrix and bias, W z and b z Update gate z t The weight matrix and bias of , W and b are the weight matrix and bias of the cyclic connection, σ is the setting coefficient, t is the time sequence number, represents the candidate hidden state at the current moment, and tanh represents the hyperbolic tangent function.

4. The method for reconstructing an electrocardiogram signal in a motion state according to claim 1, characterized in that: The multi-head attention mechanism layer linearly transforms its input into a query matrix Q, a key matrix K and a value matrix V, and uses a multi-head self-attention mechanism algorithm to calculate the query matrix Q, the key matrix K and the value matrix V to obtain the corresponding signal features. The multi-head self-attention mechanism algorithm is Among them, Attention(Q, K, V) represents the multi-head self-attention mechanism operator, softmax represents the softmax function, K T represents the transposed matrix of the key matrix K.

5. The method for reconstructing electrocardiogram signals in motion according to claim 1, characterized in that: The IMU inertial measurement signal includes three-dimensional acceleration information and three-dimensional angular velocity information. The signal feature extraction is performed on the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features and three-dimensional acceleration features, including: Perform inertial navigation calculation on the three-dimensional acceleration information and three-dimensional angular velocity information contained in the normalized IMU inertial measurement signal to obtain the corresponding three-dimensional orientation attitude information and three-dimensional relative position information; The three-dimensional orientation information, the three-dimensional relative position information, the three-dimensional acceleration information and the three-dimensional angular velocity information are used for feature extraction and combination to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features and three-dimensional acceleration features.

6. A system for reconstructing electrocardiogram signals in motion, characterized in that: It includes a signal acquisition unit, a signal processing unit, a feature extraction unit and a signal reconstruction unit, wherein: A signal acquisition unit, used to collect IMU inertial measurement signals of the target user in motion; A signal processing unit, used for normalizing the IMU inertial measurement signal using a fixed time window to obtain a normalized IMU inertial measurement signal; A feature extraction unit is used to extract signal features from the normalized IMU inertial measurement signal to obtain a twelve-dimensional feature vector including three-dimensional attitude features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features; Signal reconstruction unit, used for: Constructing an ECG signal reconstruction model, wherein the ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence; Acquire an ECG signal set and an IMU inertial measurement signal set of a target user, wherein the ECG signal set includes a plurality of initial ECG signal samples of the target user in a resting state, a walking state, and a moving state, and the IMU inertial measurement signal set includes a plurality of initial IMU inertial measurement signal samples of the target user in a resting state, a walking state, and a moving state, and each initial IMU inertial measurement signal sample is respectively associated with a corresponding initial ECG signal sample; The initial IMU inertial measurement signal samples and their associated initial ECG signal samples are resampled and synchronously processed at a fixed frequency, and the initial ECG signal samples are filtered using a Butterworth filter to obtain preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples, and then the preprocessed initial IMU inertial measurement signal samples and initial ECG signal samples are normalized using a fixed time window to obtain IMU inertial measurement signal samples and ECG signal samples; Extract signal features from IMU inertial measurement signal samples to obtain twelve-dimensional feature vector samples including three-dimensional posture features, three-dimensional position features, three-dimensional angular velocity features, and three-dimensional acceleration features. Associate each twelve-dimensional feature vector sample with the corresponding electrocardiogram signal sample to form a corresponding sample pair. The twelve-dimensional feature vector samples in the sample pair are used as model inputs, and the electrocardiogram signal samples in the sample pair are used as the true signal values ​​of the corresponding twelve-dimensional feature vector samples. Use each sample pair to form a sample set, and divide the sample set into a training set and a test set; The ECG signal reconstruction model is trained using the training set until the set training conditions are met to obtain the trained ECG signal reconstruction model, and the trained ECG signal reconstruction model is tested using the test set to obtain the trained ECG signal reconstruction model after the set test accuracy conditions are met; the training of the ECG signal reconstruction model using the training set includes: The twelve-dimensional feature vector samples in the sample pair are input into the ECG signal reconstruction model for a round of training to obtain the reconstructed predicted signal value; Based on the predicted signal value and the corresponding true signal value, the prediction deviation between the predicted signal value and the corresponding true signal value is calculated using the error mean sum function, and the error mean sum function is: Among them, MSE represents the average error, m represents the data length of the input sample, and y i Characterize the predicted signal value, Characterize the true signal value; The Adam optimizer is used to update the model parameters of the ECG signal reconstruction model in each round of training, and the learning rate is set to 0.0001; The twelve-dimensional feature vector is input into the trained ECG signal reconstruction model for feature vector analysis and ECG signal reconstruction to obtain the ECG signal of the target user in motion. The ECG signal reconstruction model includes an input layer, a bidirectional gated recurrent network layer, a multi-head attention mechanism layer and a connection layer connected in sequence. The input layer is used to input the twelve-dimensional feature vector. The bidirectional gated recurrent network layer is used to capture the twelve-dimensional feature vector in both positive and negative directions to obtain context feature information. The multi-head attention mechanism layer is used to perform multi-level information extraction based on the self-attention mechanism on the basis of the context feature information to obtain a signal feature set. The connection layer is used to reconstruct the ECG signal of the signal feature set through a point-by-point convolutional neural network to obtain a reconstructed ECG signal.

7. A system for reconstructing electrocardiogram signals in motion, characterized in that: include: A memory for storing instructions; A processor is used to read the instructions stored in the memory and execute the electrocardiogram signal reconstruction method according to any one of claims 1 to 5 according to the instructions.

8. A computer program product, characterized in that When the computer program product is run on a computer, the electrocardiogram signal reconstruction method according to any one of claims 1 to 5 is executed.