A method for denoising ECG signals based on multi-resolution attention network

Through the multi-resolution attention network denoising method, the problem of removing noise of different types and intensities in ECG signals is solved, and the analysis efficiency and diagnostic accuracy of ECG signals are improved.

CN115510897BActive Publication Date: 2025-09-26HANGZHOU PROTON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211054980.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2025-09-26
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

Existing ECG signal denoising methods are ineffective when faced with noises of different types and intensities, affecting doctors' analysis and judgment and automatic intelligent diagnosis algorithms.

Method used

An ECG signal denoising method based on a multi-resolution attention network is adopted. The denoising is performed by constructing a dataset, training a model, and applying the model. Multi-resolution feature extraction and attention mechanism are used to effectively remove noise.

Benefits of technology

It achieves efficient removal of noise of different types and intensities, improves the efficiency of ECG signal analysis, and supports doctors in more accurate diagnosis and automatic intelligent diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510897B_ABST
    Figure CN115510897B_ABST
Patent Text Reader

Abstract

A method for denoising an electrocardiogram (ECG) signal based on a multi-resolution attention network comprises the following steps: (1) selecting a clean ECG signal from a database as label data, superimposing noise signals of different types and intensities on the clean ECG signal as training sample data, uniformly resampling the label data and the training sample data to a fixed sampling rate, and dividing them into data segments of equal length, which are then merged into a training set and a test set; (2) using the data set to train an ECG signal denoising model, wherein the four modules of the model extract features using different resolutions, train N times, and save the optimal training model; (3) resampling the ECG signal to be denoised to the same sampling rate as the training set, and then dividing it into sub-segment signals, inputting them into the network model obtained in step (2), and outputting a clean ECG signal. The present invention can effectively remove noise of different types and intensities, and assist doctors in more efficiently analyzing ECG signals.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electrocardiogram (ECG) signal denoising, and in particular to an ECG signal denoising method based on a multi-resolution attention network. Background Art

[0002] With the further development of wearable devices, Holter recorders can record cardiac changes in real time. However, ECG signals are acquired non-invasively using electrodes placed on the skin around the heart, and the acquisition process is often inevitably contaminated by various noises. This noise can cause changes in ECG morphology, obscuring some important diagnostic features. This can affect doctors' analysis and judgment, and negatively impact automated intelligent diagnostic algorithms. Therefore, eliminating noise can better assist doctors in further analyzing ECG signals.

[0003] Researchers have proposed a variety of methods for denoising ECG signals. Most traditional methods rely on manually extracting features and processing parameters, such as low-pass filters, adaptive filters, moving average filters, discrete wavelet transforms, empirical mode decomposition, and non-local means. While these methods can achieve some success, they can be affected by noise of varying types and intensities. Summary of the Invention

[0004] In order to overcome the shortcomings of the existing technology, the present invention provides an ECG signal denoising method based on a multi-resolution attention network, which can effectively remove noise of different types and intensities, helping doctors to analyze ECG signals more efficiently.

[0005] The technical solution adopted by the present invention to solve its technical problem is:

[0006] A method for denoising an electrocardiogram signal based on a multi-resolution attention network, the method comprising the following steps:

[0007] (1) Constructing a dataset: Select clean ECG signals from the database as label data, superimpose noise signals of different types and intensities on the clean ECG signals as training sample data, resample the label data and training sample data to a fixed sampling rate, split them into data segments of equal length, and merge them into training and test sets;

[0008] (2) Training of denoising model: Using the dataset constructed in step (1), the ECG signal denoising model is trained. The model consists of four modules, and features are extracted using different resolutions. The model is trained N times, and the optimal training model is saved.

[0009] (3) Application of denoising model: resample the ECG signal to be denoised to the same sampling rate as the training set, then split it into sub-segment signals, input them into the network model obtained in step (2), and output a clean ECG signal;

[0010] The electrocardiogram signal denoising method of the present invention is now completed.

[0011] Furthermore, in step (1), the ECG signal is a clean, noise-free signal. Noise-free here means that there is no muscle artifact, baseline drift, or electrode motion. The steps are as follows:

[0012] (1-1) The signal is resampled to the specified sampling rate, and the ECG signal is divided into sub-segments of length 10s. The last segment less than 10s is added with zero values ​​to the length of 10s to obtain N sub-segments, denoted as SegsigC(i), where i ranges from 1 to N, which are used as clean label data;

[0013] (1-2) The noise signal is divided into 10s lengths, the noise signal is normalized, and amplified according to the amplitude of the clean signal to obtain the noise signal SegsigN with the same amplitude scale as the clean signal;

[0014] (1-3) Superimpose the ECG signal and a noise signal of a certain intensity to obtain data containing noise:

[0015] SegsigCN(i)=SegsigC(i)+α*SegsigNSegsigCN is the constructed noisy ECG data, that is, the training data set, α represents the intensity of the added noise, α=0.1~1.

[0016] Furthermore, in step (2), the noisy ECG signal is input into the network for training. The multi-resolution attention network model includes a convolution module A, a multi-resolution feature extraction branch, a connection layer, and a convolution module B, which are respectively denoted as Block 1, Block 2, Block 3, and Block 4. The process is as follows:

[0017] (2-1) The ECG signal containing noise in step (1) is input into the network model. The noise signal is first extracted through Block 1 and then input into Block 2.

[0018] The convolution module A consists of a one-dimensional convolution layer, a batch normalization layer, a ReLU activation layer, and a SE module stacked twice.

[0019] (2-2) Block 2 consists of four feature extraction branches with different resolutions and is divided into four stages as follows:

[0020] (2-2-1) Block 2 Branch 1 Stage 1 further extracts features. This stage consists of 4 residual modules A. Each branch of stages 2, 3, and 4 uses 4 residual modules B to extract features.

[0021] The residual module A sequentially stacks convolutional layer, batch normalization layer, Relu activation layer, convolutional layer, batch normalization layer, Relu activation layer, convolutional layer, batch normalization layer, SE module, Add connection layer, and Relu activation layer;

[0022] The residual module B sequentially stacks the convolution layer, batch normalization layer, Relu activation layer, convolution layer, batch normalization layer, SE module, Add connection layer, and Relu activation layer;

[0023] (2-2-2) At the end of each stage of Block2, a new branch is generated, which contains a total of 4 branches. Each new branch (high branch) is obtained by convolution operation on the previous branch (low branch). Therefore, the resolution of the high branch in the adjacent branch is half of the low branch. The four branches contain features of four resolutions, which are 1, 1 / 2, 1 / 4, and 1 / 8 times the resolution of the original signal respectively. The number of channels of the feature maps of branches 1, 2, 3, and 4 are channel 1, channel 2, channel 3, and channel 4 respectively. The number of channels can be set freely, generally an integer power of 2. The number of channels used in this invention is 32, 64, 128, and 256;

[0024] (2-2-3) After stages 2, 3, and 4, the features of different branches are integrated, including three processing methods: low branch to high branch, high branch to low branch, and same branch;

[0025] (2-2-3-1) From low branch to high branch, the number of channels and resolution are different. It is a process from high resolution to low resolution. A convolution layer with stride 2 is used.

[0026] (2-2-3-2) From high branch to low branch, the number of channels and resolution are different. It is a process from low resolution to multi-resolution, and the process of bilinear interpolation upsampling is adopted;

[0027] (2-2-3-3) No operation is performed on the same branch, and the feature fusion method uses the sum operation;

[0028] (2-3) Finally, the features of the four branches need to be spliced ​​together. Since the features extracted by the four branches have different resolutions, the low-resolution features are first upsampled to multiple resolutions through upsampling, and then the features with the same resolution are connected through Block3 and input into Block4 to obtain the output of the model.

[0029] The convolution module B includes a convolution layer, a batch normalization layer, a ReLU activation layer, and a convolution layer.

[0030] Furthermore, the loss function of the multi-resolution attention network is the mean square error:

[0031]

[0032] The optimizer used in model training was Adam. The initial learning rate was 0.001. After every five rounds of training, the learning rate was increased by 0.1, and the entire model was trained for 30 rounds. After training, the denoising model with the lowest loss was saved and obtained.

[0033] Furthermore, in step (3), the operation steps of applying the denoising model are as follows:

[0034] (3-1) Resample the ECG signal to be denoised to the same sampling rate as the training set, then split the signal into 10s sub-segments, and fill the segments less than 10s with zeros;

[0035] (3-2) Inputting the intercepted ECG signal into the network model obtained in step (2), and the model outputs the denoised ECG signal;

[0036] (3-3) The ECG signals output by the model are concatenated end to end, the zero-filled parts are truncated, and the complete denoised signal with the original sampling rate is obtained after resampling.

[0037] The beneficial effects of the present invention are: the problem of ECG signal denoising is solved based on the multi-resolution attention network method. The end-to-end model does not require manual feature extraction. The model can effectively remove noise of different types and intensities in ECG signals by fusing features of different resolutions. It is an efficient and reliable preprocessing denoising method for ECG signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 Flowchart of the ECG denoising method based on multi-resolution attention network;

[0039] Figure 2 This is a diagram of the structure based on the multi-resolution attention network;

[0040] Figure 3 Detailed module diagram for the multi-resolution attention network;

[0041] Figure 4 This is the denoising effect of the multi-resolution attention network; DETAILED DESCRIPTION

[0042] The present invention will be further described below with reference to the accompanying drawings.

[0043] Reference Figures 1 to 4 , a deep learning denoising method based on multi-resolution attention network, comprising the following steps:

[0044] (1) Constructing a dataset: Select clean ECG signals from the database as label data, superimpose noise signals of different types and intensities on the clean ECG signals as training sample data, resample the label data and training sample data to a fixed sampling rate, split them into data segments of equal length, and merge them into training and test sets;

[0045] (2) Denoising model training: The ECG signal denoising model is trained using the dataset constructed in (1). The model consists of four modules, and features are extracted using different resolutions. The model is trained N times, and the optimal training model is saved.

[0046] (3) Denoising Model Application: The ECG signal to be denoised is resampled to the same sampling rate as the training set, then segmented into 10-second sub-segments. These are input into the network model obtained in step (2) to output a clean ECG signal. This completes the ECG signal denoising method of the present invention.

[0047] Furthermore, in step (1), the ECG signal is a clean, noise-free signal. Noise-free here means that there is no muscle artifact, baseline drift, or electrode motion. The steps are as follows:

[0048] (1-1) The signal is resampled to the specified sampling rate. The fixed sampling rate sampr = 360 Hz is set. If the sampling rate is not 360 Hz, it needs to be resampled to the specified sampling rate. Then, an IIR bandpass filter is used to further process the signal. The ECG signal is divided into sub-segments of length 10 s. The last segment less than 10 s is added with zero values ​​to the length of 10 s to obtain N sub-segments, which are recorded as SegsigC(i), where i ranges from 1 to N, as clean label data.

[0049] (1-2) Resample the noise signal to the same sampling rate and divide it into 10-second segments. Then, normalize the 10-second noise signal and limit its amplitude to the range [-1, 1]. The difference between the maximum and minimum amplitudes of the clean signal in this segment is used as the multiplier for the normalized noise signal. This difference is then multiplied by the normalized signal to obtain the noise signal SegsigN, which has the same amplitude scale as the clean signal.

[0050] (1-3) Superimpose the ECG signal and a noise signal of a certain intensity to obtain the noise-containing signal SegsigCN:

[0051] SegsigCN(i)=SegsigC(i)+α*SegsigN

[0052] SegsigCN is the constructed noisy ECG data, i.e., the training dataset. α represents the intensity of the added noise, ranging from 0.1 to 1, with each increment of 0.1. Ten sets of noisy datasets with different signal-to-noise ratios were constructed.

[0053] Furthermore, in step (2), the noisy ECG signal is input into the network for training. The multi-resolution attention network model includes a convolution module A, a multi-resolution feature extraction branch, a connection layer, and a convolution module B, which are respectively denoted as Block 1, Block 2, Block 3, and Block 4. The steps are as follows:

[0054] (2-1) The ECG signal containing noise in step (1) is input into the network model. The noise signal is first extracted through Block 1 and then input into Block 2.

[0055] The convolution module A is as follows Figure 3 As shown in a. The number of convolution kernels in convolution module A is 64.

[0056] (2-2) Block 2 consists of four feature extraction branches with different resolutions and is divided into four stages, which are described as follows:

[0057] (2-2-1) Block 2 Branch 1 Stage 1 further extracts features. This stage consists of 4 residual modules A. Each branch of stages 2, 3, and 4 uses 4 residual modules B to extract features. Residual modules A and B are as follows: Figure 3 As shown in c and d;

[0058] (2-2-2) At the end of each stage of Block 2, a new branch is generated, totaling 4 branches. Each new branch (high branch) is derived from the previous branch (low branch) through a convolution operation. Therefore, the resolution of the high branch in adjacent branches is half that of the low branch. The four branches contain features at four resolutions, 1, 1 / 2, 1 / 4, and 1 / 8 times the original signal resolution, respectively. The number of channels in the feature maps of branches 1, 2, 3, and 4 is 32, 64, 128, and 256 respectively.

[0059] (2-2-3) After stages 2, 3, and 4, the features of different branches are integrated, including three processing methods: low branch to high branch, high branch to low branch, and same branch;

[0060] (2-2-3-1) From low branch to high branch, the number of channels and resolution are different. It is a process from high resolution to low resolution. A convolution layer with stride 2 is used.

[0061] (2-2-3-2) From high branch to low branch, the number of channels and resolution are different. It is a process from low resolution to multi-resolution, and the process of bilinear interpolation upsampling is adopted;

[0062] (2-2-3-3) No operation is performed on the same branch, and the feature fusion method uses the sum operation;

[0063] (2-3) Finally, the features of the four branches need to be spliced ​​together. Since the features extracted by the four branches have different resolutions, the low-resolution features are first upsampled to multiple resolutions through upsampling, and then the features with the same resolution are connected through Block3 and input to Block4. Block4 is as follows Figure 3 As shown in b, the final output of the model is obtained.

[0064] Furthermore, the loss function of the multi-resolution attention network is the mean square error:

[0065]

[0066] The optimizer used in model training was Adam. The initial learning rate was 0.001. After every five rounds of training, the learning rate was increased by 0.1, and the entire model was trained for 30 rounds. After training, the denoising model with the lowest loss was saved and obtained.

[0067] Furthermore, in step (3), the operation steps of applying the denoising model are as follows:

[0068] (3-1) Resample the ECG signal to be denoised to the same sampling rate as the training set, then split the signal into 10s sub-segments. Finally, the data that is less than 10s can be processed by padding the end of the signal with zeros.

[0069] (3-2) The intercepted ECG signals are sequentially input into the network model obtained in step (2), and the model outputs the denoised ECG signals.

[0070] (3-3) The ECG signals output by the model are concatenated end to end, and the zero-filled signals are truncated. If they have been resampled, they can be further resampled to obtain a complete denoised signal at the original sampling rate.

[0071] Based on the above method, the present invention is verified on the open source datasets CPSC2018 and MIT-BIH. The results are as follows Figure 4 The denoising results were compared with those of deep network model methods such as IBI_Tiranmisu, DeepFilter, and DeUnet. The results are shown in Tables 1 and 2:

[0072]

[0073] Table 1

[0074]

[0075] Table 2

[0076] It can be seen from Tables 1 and 2 that the method of the present invention has obvious performance advantages and achieved the best results in both CPSC2018 and MIT-BIH, indicating that the model has strong robustness.

[0077] The embodiments described above provide a detailed description of the technical solution of the present invention, which can automatically remove noise from ECG signals. The above embodiments are intended only to illustrate the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the embodiments, a person skilled in the art should understand that any combination, modification, or equivalent replacement of the technical solution of the present invention does not depart from the spirit and scope of the technical solution of the present invention and should be included in the scope of the claims of the present invention.

Claims

1. A method for denoising electrocardiogram signals based on a multi-resolution attention network, characterized in that: The method comprises the following steps: (1) Constructing a dataset: Clean ECG signals are selected from the database as label data. Noise signals of different types and intensities are superimposed on the clean ECG signals as training sample data. The label data and training sample data are uniformly resampled to a fixed sampling rate and split into data segments of equal length, which are then merged into the training set and test set. (2) Training of denoising model: The ECG signal denoising model is trained using the dataset constructed in (1). The model consists of four modules and uses different resolutions to extract features. The model is trained N times and the optimal training model is saved. (3) Application of denoising model: resample the ECG signal to be denoised to the same sampling rate as the training set, then split it into sub-segment signals, input them into the network model obtained in step (2), and output a clean ECG signal; In step (2), the multi-resolution attention network model includes a convolution module A, a multi-resolution feature extraction branch, a connection layer, and a convolution module B, which are respectively denoted as Block 1, Block 2, Block 3, and Block 4. The process is as follows: (2-1) The ECG signal containing noise in step (1) is input into the network model. The noise signal is first extracted through Block 1 and then input into Block 2. (2-2) Block2 consists of four feature extraction branches with different resolutions and is divided into four stages; (2-3) Finally, the features of the four branches need to be spliced ​​together. Since the features extracted by the four branches have different resolutions, the low-resolution features are first upsampled to multiple resolutions, and then the features with the same resolution are connected through Block 3 and input into Block 4 to obtain the output of the model; In the step (2-2), stage 1 of branch 1 further extracts features, and this stage consists of 4 residual modules A; each branch of stages 2, 3, and 4 uses 4 residual modules B to extract features, and a new branch is generated at the end of each stage, which contains a total of 4 branches. Each new branch, that is, a high branch, is obtained by the previous branch, that is, a low branch, through a convolution operation; therefore, the resolution of the high branch in the adjacent branch is half of the low branch, and the four branches contain features of four resolutions, which are 1, 1 / 2, 1 / 4, and 1 / 8 times the resolution of the original signal respectively; the number of channels of the feature maps of branches 1, 2, 3, and 4 are channel 1, channel 2, channel 3, and channel 4 respectively ; The number of channels is an integer power of 2, and the number of channels used is 32, 64, 128, and 256; after stages 2, 3, and 4, the features of different branches are fused, including three processing methods: low branch to high branch, high branch to low branch, and same branch. From low branch to high branch, the number of channels and resolution are different. It is a process from high resolution to low resolution, and a convolutional layer with stride equal to 2 is used; from high branch to low branch, the number of channels and resolution are different. It is a process from low resolution to multi-resolution, and a bilinear interpolation upsampling process is used; no operation is performed on the same branch, and the feature fusion method uses a summation operation.

2. The ECG signal denoising method based on a multi-resolution attention network according to claim 1, characterized in that: In step (1), the ECG signal is a clean, noise-free signal. Noise-free here means that there is no muscle artifact, baseline drift, or electrode motion. The steps for constructing the data set are as follows: (1-1) The signal is resampled to the specified sampling rate, and the ECG signal is divided into sub-segments of length 10s. The last segment less than 10s is added with zero values ​​to the length of 10s to obtain N sub-segments, denoted as SegsigC (i), where i ranges from 1 to N, which are used as clean label data; (1-2) Divide the noise signal into 10s lengths, normalize the noise signal, and amplify it according to the amplitude of the clean signal to obtain the noise signal SegsigN with the same amplitude scale as the clean signal; (1-3) Superimpose the ECG signal and a noise signal of a certain intensity to obtain data containing noise: SegsigCN (i)= SegsigC(i)+ α*SegsigN SegsigCN is the constructed noisy ECG data, i.e., the training dataset. α represents the intensity of the added noise, α=0.1~1.

3. The ECG signal denoising method based on a multi-resolution attention network according to claim 1, characterized in that: In step (2), the loss function of the multi-resolution attention network is the mean square error: The optimizer used in model training is Adam, with an initial learning rate of 0.

001. After every five rounds of training, the learning rate is increased by 0.

1. The entire model is trained for 30 rounds. After training is completed, the denoising model with the minimum loss is saved and obtained.

4. The ECG signal denoising method based on a multi-resolution attention network according to claim 1 or 2, characterized in that: In step (3), the operation steps of applying the denoising model are as follows: (3-1) Resample the ECG signal to be denoised to the same sampling rate as the training set, then split the signal into 10s sub-segments, and fill the segments less than 10s with zeros; (3-2) Inputting the intercepted ECG signal into the network model obtained in step (2), the model outputs the denoised ECG signal; (3-3) The ECG signals output by the model are concatenated end to end, the zero-filled parts are truncated, and the complete denoised signal with the original sampling rate is obtained after resampling.