A method and system for removing random mixed noise in a dynamic electrocardiogram

By combining frequency domain and time domain filtering, and utilizing the zero-phase-shift IIR algorithm and multi-scale deep convolutional neural network, random mixed noise in dynamic electrocardiogram (ECG) signals is removed, solving the problem of incomplete noise removal in existing technologies and achieving accurate acquisition of ECG signal feature points.

CN117009743BActive Publication Date: 2026-03-20SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively remove random mixed noise from dynamic electrocardiogram (ECG) signals, especially high-frequency interference and baseline drift, resulting in poor ECG signal analysis performance.

Method used

A two-step method of frequency domain filtering and time domain filtering is adopted, which combines the zero-phase-shift IIR algorithm and multi-scale deep convolutional neural network. Frequency domain filtering removes noise in a specific frequency range, while time domain filtering removes residual noise through multi-scale feature extraction and signal reconstruction. Deep learning algorithm is used to learn the signal and noise feature matrices.

Benefits of technology

It effectively removes high-frequency interference and baseline drift in dynamic electrocardiogram (ECG) signals, accurately obtains the location and amplitude of characteristic points in ECG signals, and improves the accuracy of ECG signal analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117009743B_ABST
    Figure CN117009743B_ABST
Patent Text Reader

Abstract

The application provides a method and system for removing random mixed noise in dynamic electrocardiogram, and relates to the field of digital signal processing of bioelectric signals. A noise signal is used to perform noise adding processing on an original noise-free electrocardiogram signal to obtain a noise-added dynamic electrocardiogram signal, and a training data set is formed. A denoising model is trained until the distortion degree of the noise-free electrocardiogram signal output by the denoising model and the original noise-free electrocardiogram signal is minimum in amplitude and angle. The dynamic electrocardiogram signal to be denoised is input into the trained denoising model to generate and output a noise-free dynamic electrocardiogram signal. The application uses a two-step method of frequency domain filtering and time domain filtering to remove random noise or random mixed noise in the electrocardiogram signal. The frequency domain filtering effectively removes noise outside a specific frequency range, and the effective frequency band range of the dynamic electrocardiogram signal is retained. The time domain filtering uses a deep learning algorithm for denoising, learns the characteristic matrix of the useful signal and the noise, and thus obtains a reconstructed signal with less distortion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of digital signal processing of bioelectric signals, and particularly relates to a method and system for removing random mixed noise in dynamic electrocardiogram. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.

[0003] The electrocardiosignal is an important human vital sign signal, which can be obtained by measuring the potential difference on the surface of the human body through a bioelectrode to reflect the physiological or pathological state of the heart. Heart disease endangers human health at any time, so the research on the automatic analysis system of the electrocardiosignal has high clinical value.

[0004] The electrocardiosignal is a very weak signal with a relatively low frequency, which is often disturbed by various noises during acquisition, especially in long-range dynamic electrocardiosignal, which often contains electromyographic interference, electrode motion interference, power frequency interference and baseline drift, etc. Therefore, the denoising processing of the electrocardiosignal is a prerequisite for analyzing the electrocardiosignal.

[0005] At present, there are various methods for filtering and denoising the electrocardiosignal, including digital filtering technology, wavelet transform technology, smoothing filtering technology, and denoising algorithms based on machine learning and deep learning, etc. Most denoising algorithms can only eliminate one type of noise or fixed type of noise in the electrocardiogram signal, and have poor applicability. The denoising algorithm based on machine learning and deep learning tends to learn lower-order features, and the fitting effect on high-frequency features is limited, which cannot remove high-frequency noise well. Some methods also denoise the electrocardiosignal on the extracted heartbeats, or need to locate the R peak as a preprocessing step, or sacrifice memory space and inference speed to reduce reconstruction distortion, which is not suitable for real-time denoising of the electrocardiosignal, resulting in poor denoising effect and seriously hindering the applicability of the denoising method. SUMMARY

[0006] In order to overcome the shortcomings of the prior art, the present application provides a method and system for removing random mixed noise in dynamic electrocardiogram, which uses a two-step method of frequency domain filtering and time domain filtering to remove random noise or random mixed noise in the electrocardiosignal. The frequency domain filtering effectively removes the noise outside the specific frequency range, and retains the effective frequency band range of the dynamic electrocardiosignal. The time domain filtering uses a deep learning algorithm for denoising, learns the feature matrix of the useful signal and the noise, and thus obtains a reconstructed signal with less distortion.

[0007] To achieve the above object, one or more embodiments of the present application provide the following technical solutions:

[0008] The application provides a method for removing random mixed noise in dynamic electrocardiogram.

[0009] The application provides a method for removing random mixed noise in dynamic electrocardiogram.

[0010] The dynamic electrocardiogram signal to be denoised is input into the trained denoising model to generate and output a noise-free dynamic electrocardiogram signal.

[0011] The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove random mixed noise of the electrocardiogram signal, the frequency domain filtering is frequency domain denoising according to a frequency response standard of the dynamic electrocardiogram, and the time domain filtering is denoising processing through multi-scale feature extraction and signal reconstruction.

[0012] Further, the denoising model is trained based on a training data set until the noise-free electrocardiogram signal output by the denoising model and the original noise-free electrocardiogram signal are minimum in distortion degree in amplitude and angle.

[0013] Further, the construction method of the training data set is as follows:

[0014] The original noise-free electrocardiogram signal is subjected to noise adding processing by using a noise signal to obtain a noise-added dynamic electrocardiogram signal and form the training data set.

[0015] Further, the noise signal is obtained by sampling from a plurality of noise sources according to a preset sampling rate; the noise sources include baseline drift interference, motion artifact and electrode motion interference.

[0016] The original noise-free electrocardiogram signal adopts a clean and interference-free electrocardiogram signal, and the sampling rate is the same as that of the noise signal.

[0017] Further, the noise adding processing is specifically as follows:

[0018] The noise signal and the original noise-free electrocardiogram signal are subjected to windowing segmentation with the same window length and overlapping step, the obtained noise signal segments are randomly combined, and the randomly combined noise signal segments are injected into the windowed segmented original noise-free electrocardiogram signal with random amplitude to obtain the noise-added dynamic electrocardiogram signal.

[0019] Further, the frequency domain filtering transforms the noise-added dynamic electrocardiogram signal to the frequency domain according to the frequency response standard of the dynamic electrocardiogram, and removes interference in a preset range by using a zero-phase shift IIR algorithm.

[0020] The zero-phase shift IIR algorithm is zero-phase filtering based on a Butterworth IIR band-pass filter.

[0021] Further, the time domain filtering adopts a multi-scale deep convolutional neural network combined with a spatial and channel attention mechanism to learn feature information of the noise-free electrocardiogram signal and the noise signal.

[0022] The multi-scale deep convolutional neural network extracts signal features of different scales based on dilated convolution.

[0023] The spatial and channel attention mechanism focuses on important positions and channels in the signal features, multiplies the attention weights corresponding to the signal features, and concatenates to obtain the reconstructed noise-free dynamic electrocardiogram signal.

[0024] Further, a TCDAE model combining a convolutional DAE and a Transformer encoder module is further included for time domain filtering.

[0025] The specific processing procedure of the TCDAE model for the electrocardiogram signal is as follows:

[0026] The shallow features are extracted by the convolutional encoder, combined with the position embedding, and the embedded features are captured by the Transformer encoder to capture the global dependence of the electrocardiogram signal and the noise, and the decoder reconstructs a signal with the same dimension as the original signal, i.e., a noise-free dynamic electrocardiogram signal, through feature upsampling.

[0027] Further, the distortion degree in the amplitude and the angle is calculated using the self-defined AmpLoss and AngLoss loss functions, respectively.

[0028] The loss function in the amplitude is defined as:

[0029]

[0030] Wherein, x is the original noise-free electrocardiogram signal, is the reconstructed noise-free electrocardiogram signal, δ is a threshold parameter, and k is used to control the shape of the loss function in (k, k*δ).

[0031] The loss function in the angle is defined as:

[0032]

[0033] Wherein, n is the length of the signal data, i takes 1-n, x i and are the i-th point in the original noise-free electrocardiogram signal and the reconstructed noise-free electrocardiogram signal, respectively, and α controls the balance between the similarity and the difference.

[0034] The second aspect of the present application provides a system for removing random mixed noise in dynamic electrocardiogram.

[0035] The application discloses a system for removing random mixed noise in dynamic electrocardiogram, comprising a signal denoising module, which is used for inputting a dynamic electrocardiogram signal to be denoised into a trained denoising model, and generating and outputting a noise-free dynamic electrocardiogram signal.

[0036] The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove random mixed noise in the electrocardiogram signal, the frequency domain filtering is frequency domain denoising according to the frequency response standard of the dynamic electrocardiogram, and the time domain filtering is denoising processing through multi-scale feature extraction and signal reconstruction.

[0037] The third aspect of the application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the steps in the method for removing random mixed noise in dynamic electrocardiogram according to the first aspect of the application.

[0038] The fourth aspect of the application provides an electronic device, which comprises a memory, a processor and a program stored in the memory and executable on the processor, and the processor executes the program to realize the steps in the method for removing random mixed noise in dynamic electrocardiogram according to the first aspect of the application.

[0039] The above one or more technical solutions have the following beneficial effects:

[0040] The application uses a two-step method of frequency domain filtering and time domain filtering to remove random noise or random mixed noise in the electrocardiogram signal, the frequency domain filtering effectively removes noise outside a specific frequency range, and the time domain filtering uses a deep learning algorithm for denoising, learns a feature matrix of useful signals and noise, and obtains a reconstructed signal with less distortion, so that high-frequency interference including power frequency interference, baseline drift and electromyographic interference can be effectively removed, and the feature point position and amplitude of the electrocardiogram signal can be more accurately acquired.

[0041] The advantages of the additional aspects of the application will be partially given in the following description, partially become obvious from the following description, or be known by the practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0042] The drawings accompanying the specification of the application form a part of the application, the illustrative embodiments of the application and the description thereof serve to explain the application, and do not constitute an improper limitation on the application.

[0043] Figure 1 The method flowchart of the first embodiment.

[0044] Figure 2 The schematic diagram of the noise adding processing of the first embodiment.

[0045] Figure 3The structure diagram of a denoising model using a multi-scale deep convolutional neural network ADCNN for time domain filtering for the first embodiment.

[0046] Figure 4 The structure diagram of the TCDAE model for the first embodiment.

[0047] Figure 5 The system structure diagram for the second embodiment. DETAILED DESCRIPTION

[0048] It should be noted that the following detailed description is illustrative only, and is intended to provide further description in order to provide a fuller enabling teaching of the present application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.

[0049] It is to be understood that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.

[0050] Embodiment One

[0051] In one or more embodiments, a method for removing random mixed noise in dynamic electrocardiogram is disclosed, as shown in the following steps: Figure 1

[0052] Step S1: Perform noise processing on the original noise-free electrocardiogram signal with a noise signal to obtain a noise-added dynamic electrocardiogram signal, which constitutes a training data set.

[0053] In order to train the denoising model, a large amount of training data is needed. In this embodiment, the training data set is constructed by simulating the actual collected dynamic electrocardiogram signal containing noise, Figure 2 is a schematic diagram of noise processing, as shown in Figure 2 Specifically,

[0054] Select n kinds of noise sources such as baseline wander interference (BW), electromyographic interference (ME) and electrode motion interference (AM) actually collected, and collect noise signals through sampling rate R.

[0055] The noise signal adopts three kinds of noise sources of baseline wander interference (BW), electromyographic interference (ME) and electrode motion interference (AM) actually collected in the MIT-BIH noise stress test database (NSTDB), and the noise signal is collected through a preset sampling rate R. In this embodiment, the sampling rate is set to 360 Hz. ​

[0056] The original noise-free electrocardiogram signal ECGraw is a clean and interference-free electrocardiogram signal, and the sampling rate is the same as that of the noise signal. In this embodiment, the QT database in the public database is used, because the data in the database contains various QRS and ST-T morphologies, and does not contain obvious BW or other artifacts. The signal resampling rate of the QT database is set to 360 Hz.

[0057] In order to facilitate algorithm and computer parallel processing, the original electrocardiogram signal and the noise source signal are both subjected to windowing and segmentation processing, the window length is set to M seconds, and the overlapping step length is set to S; the interference is randomly combined and injected into the clean and noise-free original signal ECGraw. There are 2 n kinds of random combinations of n kinds of interference, for example, the noise sources are BW, AM and ME, and there are eight kinds of random combinations, as shown in Table 1, wherein '-' represents not containing a certain kind of noise, and '√' represents containing a certain kind of noise.

[0058] Table 1 Eight different noise combinations

[0059]

[0060] The amplitude of the noise combination is randomly selected between 0.2 and 2 times the maximum peak value of the original electrocardiogram signal, the noise combination is injected into the windowed and segmented original noise-free electrocardiogram signal, and a fixed-length noisy dynamic electrocardiogram signal is obtained and marked as ECGNoisy: wherein, represents the noisy dynamic electrocardiogram signal, x represents the original noise-free electrocardiogram signal, and S represents the overlapping step length.

[0061] The training data set is composed of each segment of the noisy dynamic electrocardiogram signal and the corresponding original noise-free electrocardiogram signal, and the training set and the test set are divided according to the preset proportion, which are used for training and testing of the denoising model.

[0062] Step S2: Based on the training data set, the denoising model is trained until the distortion degree of the noise-free electrocardiogram signal output by the denoising model and the original noise-free electrocardiogram signal is minimum in amplitude and angle.

[0063] The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove the random mixed noise of the electrocardiogram signal. The frequency domain filtering is to remove the noise in the frequency domain according to the frequency response standard of the dynamic electrocardiogram, and the time domain filtering is to remove the noise by multi-scale feature extraction and signal reconstruction. Figure 3 is the structure diagram of the denoising model using a multi-scale deep convolutional neural network ADCNN for time domain filtering, as shown in Figure 3 The denoising model includes two modules: a frequency domain filtering module and a time domain filtering module, which are described in detail below.

[0064] Frequency domain filtering module

[0065] For the noisy electrocardiogram signal ECGNoisy, according to the frequency response standard of dynamic electrocardiogram, the noisy dynamic electrocardiogram signal is transformed into the frequency domain, and the zero-phase shift IIR algorithm is used to remove the interference in the preset range, to obtain the frequency domain filtered electrocardiogram signal ECGNoisy-.

[0066] Specifically, according to the dynamic electrocardiogram standard, the frequency response range is 0.5-60Hz, ECGNoisy is transformed into the frequency domain, and since the infinite impulse response filter (IIR) has small computational overhead and time delay, the zero-phase shift IIR algorithm is used to remove the interference below 0.5Hz and above 60Hz, and the denoised signal is marked as ECGNoisy-; the specific method is as follows:

[0067] (1) Design a Butterworth IIR band-pass filter;

[0068] (2) Forward filter ECGNoisy through the Butterworth filter to obtain ECGNoisy1;

[0069] (3) Reverse the filter in step (1) to obtain ECGNoisy2;

[0070] (4) Reverse the filter in step (1) again to obtain the zero-phase filtered signal ECGNoisy-.

[0071] Time domain filtering module

[0072] The frequency domain filtered electrocardiogram signal ECGNoisy- may also contain noise and interference overlapping with the frequency band of the electrocardiogram signal, which cannot be removed by frequency domain filtering. At this time, the deep learning algorithm can better learn the characteristics of the electrocardiogram signal and the noise signal, so as to remove the residual noise signal. Since the multi-scale neural network can extract the local details and global features of the electrocardiogram signal at different scales, it has a certain robustness to noise and deformation in the signal; this embodiment selects a multi-scale deep convolutional neural network combined with spatial and channel attention mechanisms to learn the feature information of the true electrocardiogram signal and the noise signal, achieving good time domain denoising effect, and the specific processing steps are as follows:

[0073] (1) Multi-scale deep convolutional neural network ADCNN: According to the characteristics of the electrocardiogram signal, a four-channel convolutional neural network is used to extract signal features at different scales, each channel contains three layers of dilated convolution modules, and the dilution rate of each layer is designed according to the principle of mixed dilated convolution to avoid grid effect and reduce loss of electrocardiogram signal information.

[0074] According to the experimental results, the expansion coefficients of channel one are dr1=3, dr2=4, and dr3=5; the expansion coefficients of channel two are dr1=1, dr2=3, and dr3=5; the expansion coefficients of channel three are dr1=5, dr2=7, and dr3=9; and the expansion coefficients of channel four are dr1=1, dr2=2, and dr3=3. The activation function is selected as RELU, and no batch normalization processing is performed.

[0075] 2) Spatial and channel attention module: the extracted signal features are respectively input into the spatial attention module and the channel attention module, the spatial attention weight coefficient and the channel attention weight coefficient are respectively multiplied with the input signal features, the spatial attention features and the channel attention features are obtained, and the two features are concatenated to enable the model to simultaneously pay attention to important positions and channels in the convolutional neural network output features, thereby improving the perception and expression ability of the model, and the formula is represented as:

[0076] output=concat(multiply(spatialAttention,input),multiply(channalAttention,input)) wherein, concat represents concatenate, spatialAttention and channalAttention represent the spatial attention weight coefficient and the channel attention weight coefficient respectively, input represents the input signal feature, and multiply represents multiplication.

[0077] Specifically, in the spatial attention module, first, a Dense layer with a Tahn function as the activation function is used for feature transformation, then a Flatten layer is used to flatten the high-dimensional features into one dimension, and then a reshape layer is used to make the input size equal. In the channel attention module, first, a global average pooling layer is used to calculate the average value of each channel feature, then a Dense layer with a ReLU function as the activation function is used for feature transformation, and then a Dense layer with a Sigmoid function as the activation function is used for feature transformation and feature learning, and then a reshape layer is used to make the input size equal.

[0078] 3) Signal reconstruction module: based on the features output by the spatial and channel attention modules, a reconstruction algorithm is used to generate the original signal, i.e., the noise-free dynamic electrocardiogram signal.

[0079] If the previous learning algorithm changes the size of the signal, a transpose convolution with a step size greater than 1 is selected to restore the size of the original signal, and if the size of the signal is not changed, a 1*1 convolution can be selected to reconstruct the original signal.

[0080] In addition to the time domain filtering method of "multi-scale deep convolutional neural network combined with spatial and channel attention mechanism" provided above, a TCDAE model combining a denoising autoencoder with a general convolutional neural network and a Transformer encoder module is also provided to perform time domain filtering. The TCDAE model will be described in detail below.

[0081] Figure 4 is a structural diagram of the TCDAE model. As shown in Figure 4 the specific processing flow of the TCDAE model for the electrocardiogram signal is as follows: the frequency domain filtered electrocardiogram signal ECGNoisy- is input into a convolutional encoder to extract shallow and local features, combined with position embedding, the embedded features are captured through the Transformer encoder to capture the global dependence of the electrocardiogram signal and noise, and the decoder part reconstructs a signal with the same dimension as the original signal, i.e. a noise-free dynamic electrocardiogram signal, through feature upsampling. The TCDAE model uses DAE as a framework, and DAE is an architecture with an encoding-decoding structure. The encoding part can use multiple models, and here a combination of ordinary convolution + Transformer is used as the encoder part, i.e. TCDAE encoder, and the decoding part uses a convolutional network, i.e. TCDAE decoder, so the TCDAE model is composed of a TCDAE encoder and a TCDAE decoder, and the specific settings are as follows:

[0082] TCDAE encoder

[0083] After frequency domain filtering, the input noisy electrocardiogram signal is sent to a TCDAE encoder composed of a basic encoder and a Transformer encoder composed of a convolutional neural network. Table 2 is a table of specific parameters of the TCDAE model.

[0084] Table 2 Specific parameter table of TCDAE model

[0085]

[0086] The basic encoder is composed of three stacked one-dimensional convolution blocks (Conv1D), and each convolution block is composed of a convolution layer, a batch normalization layer (BN) and an activation layer. The kernel size of the convolution layer is 13x1, which can extract shallow and local feature embedding; in order to extract multi-scale short-term features of the electrocardiogram signal, three stages of stacking are used; the gradually increasing kernel number (16, 32, 64) is used to expand the channel capacity, as shown in Table 2, the span is set to 2 to reduce the resolution of the signal; BN is used to normalize the input of each block and make the network faster and more stable through re-centering and re-scaling. In addition, the exponential linear unit (ELU) is used as the activation function of all convolution blocks, which is continuous and differentiable at all points.

[0087] The base encoder block can also be seen as the input embedding of the Transformer encoder. The attention-based Transformer encoder is designed to produce a robust latent representation of the signal, whose hyperparameters are summarized in Table 2; each encoder block consists of a multi-head self-attention (MHSA) module and a feed-forward network (FFN), both of which are followed by a layer normalization (LN) and have a residual connection between them. Since the Transformer encoder does not have recursion or convolution to inject relative or absolute positional information, a positional embedding layer is added at the end of the base encoder block; the positional embedding has the same size as the output of the Conv1D_3, in this embodiment, different frequencies of sine and cosine functions are used to assign each dimension.

[0088] After the positional embedding, the shallow features are fed into the MHSA module, which has a dimension of 64, the MHSA projects the query (Q), key (K) and value (V) 4 times and concatenates them into the FFN block; in this embodiment, the dimensions of Q, K and V are all set to 64. Compared with the single-headed attention module, the multi-headed attention benefits from the parallel computation of different heads without additional computation.

[0089] To obtain the attention weights, the dot product of the query and all keys is calculated, each value is divided by and the SoftMax function is applied; then, the weights are applied to all channels with internally generated values, in this embodiment, the scaled dot-product attention function is used, which can be implemented quickly by a highly optimized matrix multiplication code.

[0090] The FFN for linear conversion of the output of the MHSA consists of two fully connected layers; the LN module is used to eliminate batch dependency and obtain the same distribution on all features to process the input from the FFN.

[0091] After the convolutional encoder and the Transformer encoder, The hidden feature representation is transformed into

[0092] TCDAE decoder

[0093] The decoder part is to decode the noise input into Four convolutional blocks (Conv1DTrans) are included to increase the dimension of the feature map; between the encoder and decoder of the TCDAE, we use a long skip connection, which has been proven to make the deep network more robust and stable in the encoder-decoder structure; each Conv1DTrans consists of a transpose convolution layer, a BN and an activation layer; the transpose convolution process creates the same connections as the regular convolution operation, but in the opposite direction; the last Con1DTrans is used as the output layer, with a filter size of 13x1 and a step of 2 to restore the signal with the same dimension as the input.

[0094] In order to train the model with backpropagation and gradient descent method, a loss function is needed to evaluate the distance between the reconstructed signal and the original noise-free signal. In this embodiment, two loss functions, AmpLoss and AngLoss, are used to quantify the distortion in amplitude and angle respectively, and a combined loss function is used to reduce the distortion of low-amplitude waves in the electrocardiogram signal.

[0095] The AmpLoss loss function combines the mean square error function and the absolute value function, which is less sensitive to outliers in the data, and is defined as follows:

[0096]

[0097] Where x is the original noise-free electrocardiogram signal, is the reconstructed noise-free electrocardiogram signal, δ is the threshold parameter, and k is used to control the shape of the loss function in (k, k*δ).

[0098] AngLoss does not depend on the size of the signal, but only on their overall angle, so in the filtering process, the low-amplitude segments such as P-wave and T-wave have the same weight as QRS-wave; its expression is:

[0099]

[0100] Where n is the length of the signal data, i takes 1-n, x i and are the i-th point in the original noise-free electrocardiogram signal and the reconstructed noise-free electrocardiogram signal respectively, and α controls the balance between similarity and difference.

[0101] In this embodiment, the weight ratio of AmpLoss and AngLoss is 1:1, and the whole training process is to minimize the distortion of and x on the training set.

[0102] Step S3: input the dynamic electrocardiogram signal to be denoised into the trained denoising model, generate and output the noise-free dynamic electrocardiogram signal.

[0103] Embodiment Two

[0104] In one or more embodiments, a system for removing random mixed noise in dynamic electrocardiogram is disclosed, as shown in the accompanying drawings, comprising a data set construction module, a model training module and a signal denoising module: Figure 5

[0105] The data set construction module is configured to: add noise to the original noise-free electrocardiogram signal with a noise signal to obtain a noisy dynamic electrocardiogram signal, which constitutes a training data set;

[0106] The model training module is configured to: based on the training data set, train the constructed denoising model until the noise-free electrocardiogram signal output by the denoising model and the original noise-free electrocardiogram signal have minimum distortion in amplitude and angle;

[0107] The signal denoising module is configured to: input the dynamic electrocardiogram signal to be denoised into the trained denoising model to generate and output a noise-free dynamic electrocardiogram signal;

[0108] The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove mixed noise in the electrocardiogram signal, the frequency domain filtering is to remove noise in the frequency domain according to the frequency response standard of the dynamic electrocardiogram, and the time domain filtering is to remove noise by multi-scale feature extraction and signal reconstruction.

[0109] Embodiment Three

[0110] The purpose of this embodiment is to provide a computer-readable storage medium.

[0111] The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for removing random mixed noise in a dynamic electrocardiogram according to Embodiment One of the present disclosure.

[0112] Embodiment Four

[0113] The purpose of this embodiment is to provide an electronic device.

[0114] The electronic device includes a memory, a processor, and a program stored on the memory and executable on the processor, and the processor executes the program to implement the steps of the method for removing random mixed noise in a dynamic electrocardiogram according to Embodiment One of the present disclosure.

[0115] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.​

Claims

1. A method for removing random mixed noise in dynamic electrocardiograms, characterized in that, include: The dynamic electrocardiogram signal to be denoised is input into the trained denoising model to generate and output a noise-free dynamic electrocardiogram signal. The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove random mixed noise from the ECG signal. The frequency domain filtering is based on the frequency response standard of dynamic ECG to perform noise reduction in the frequency domain. A TCDAE model combining a convolutional DAE and a Transformer encoder module is used for temporal filtering. The specific processing flow of the electrocardiogram signal by the TCDAE model is as follows: The frequency-domain filtered ECG signal is input into a convolutional encoder to extract shallow and local features. Combined with position embedding, the embedded features are captured by a Transformer encoder to capture the global dependency between the ECG signal and noise. The decoder reconstructs a signal with the same dimension as the original signal by feature upsampling, i.e., a noise-free dynamic ECG signal. The TCDAE model consists of a TCDAE encoder and a TCDAE decoder. The TCDAE encoder consists of a basic encoder composed of a convolutional neural network and a Transformer encoder. A position embedding layer is added at the end of the base encoder block; the size of the position embedding is the same as the output of the convolution block of the base encoder, and each dimension is assigned using sine and cosine functions of different frequencies; The TCDAE decoder includes four transposed convolutional blocks to increase the dimensionality of the feature maps; skip connections are used between the encoder and decoder of the TCDAE; each transposed convolutional block consists of a transposed convolutional layer, a batch normalization layer, and an activation layer; the transposed convolution process creates the same connections as the regular convolution operation, but in the opposite direction; the last transposed convolutional block is used as the output layer, with a 13×1 filter with a stride of 2 to recover the signal with the same dimensionality as the input.

2. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 1, characterized in that, The denoising model is trained based on the training dataset until the distortion in amplitude and angle between the noise-free ECG signal output by the denoising model and the original noise-free ECG signal is minimized.

3. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 2, characterized in that, The training dataset is constructed as follows: The original noiseless ECG signal is noise-added to obtain a noisy dynamic ECG signal, which forms the training dataset.

4. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 3, characterized in that, The noise signal is obtained by sampling from multiple noise sources according to a preset sampling rate; the noise sources include baseline drift interference, motion artifacts, and electrode motion interference. The original noise-free ECG signal uses a clean, interference-free ECG signal with the same sampling rate as the noise signal.

5. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 3, characterized in that, The noise addition process specifically includes: The noisy signal and the original noiseless ECG signal are windowed with the same window length and overlap step. The resulting noisy signal segments are randomly combined and injected into the original noiseless ECG signal after windowing with random amplitude to obtain a noisy dynamic ECG signal.

6. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 5, characterized in that, The frequency domain filtering transforms the noisy dynamic ECG signal into the frequency domain according to the frequency response standard of dynamic ECG, and uses the zero-phase-shift IIR algorithm to remove interference within a preset range. The zero-phase-shift IIR algorithm is based on a Butterworth IIR bandpass filter and performs zero-phase filtering.

7. The method for removing random mixed noise in a dynamic electrocardiogram as described in claim 1, characterized in that, The distortion in amplitude and angle is calculated using custom AmpLoss and AngLoss loss functions, respectively. The loss function in terms of magnitude is defined as: in, It is the original, noise-free ECG signal. It is a reconstructed noise-free ECG signal. The threshold parameter, k, controls the shape of the loss function in (k, k*δ); The loss function in terms of angle is defined as: Where n is the signal data length, and i takes values ​​from 1 to n. and These are the i-th points in the original noise-free ECG signal and the reconstructed noise-free ECG signal, respectively, with α controlling the balance between similarity and difference.

8. A system for removing random mixed noise in dynamic electrocardiograms, characterized in that, It includes a signal denoising module, which is used to input the dynamic ECG signal to be denoised into the trained denoising model, and generate and output a noise-free dynamic ECG signal. The denoising model uses a two-step method of frequency domain filtering and time domain filtering to remove random mixed noise from the ECG signal. The frequency domain filtering is based on the frequency response standard of dynamic ECG to perform noise reduction in the frequency domain. A TCDAE model combining a convolutional DAE and a Transformer encoder module is used for temporal filtering. The specific processing flow of the electrocardiogram signal by the TCDAE model is as follows: The frequency-domain filtered ECG signal is input into a convolutional encoder to extract shallow and local features. Combined with position embedding, the embedded features are captured by a Transformer encoder to capture the global dependency between the ECG signal and noise. The decoder reconstructs a signal with the same dimension as the original signal by feature upsampling, i.e., a noise-free dynamic ECG signal. The TCDAE model consists of a TCDAE encoder and a TCDAE decoder. The TCDAE encoder consists of a basic encoder composed of a convolutional neural network and a Transformer encoder. A position embedding layer is added at the end of the base encoder block; the size of the position embedding is the same as the output of the convolution block of the base encoder, and each dimension is assigned using sine and cosine functions of different frequencies; The TCDAE decoder includes four transposed convolutional blocks to increase the dimensionality of the feature maps; skip connections are used between the encoder and decoder of the TCDAE; each transposed convolutional block consists of a transposed convolutional layer, a batch normalization layer, and an activation layer; the transposed convolution process creates the same connections as the regular convolution operation, but in the opposite direction; the last transposed convolutional block is used as the output layer, with a 13×1 filter with a stride of 2 to recover the signal with the same dimensionality as the input.

Citation Information

Patent Citations

  • Wake-up system based on heart rate variability

    CN115192850A

  • Magnetic particle distribution model reconstruction method and system based on time-frequency spectrum signal enhancement

    CN115640506A