Electrocardio denoising method based on frequency information enhancement
By introducing a frequency information enhancement mechanism into the ECG signal denoising method, combining time domain and frequency domain information, and using a two-stage denoising network with frequency information enhancement, the problem of neglecting frequency domain information caused by the dominance of time domain information in the existing technology is solved. , achieving more efficient noise removal and feature retention.
Patent Information
- Application Number
- CN202410732962.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-10-01
AI Technical Summary
Existing ECG signal denoising methods mainly focus on time domain information and ignore the frequency domain information of the signal, making it difficult to effectively remove noise and retain important features when processing non-stationary ECG signals.
An ECG denoising method based on frequency information enhancement is proposed, which divides the ECG signal through sliding windows, uses end-to-end frequency information to enhance the two-stage denoising network, and combines the time domain feature extraction module, frequency domain feature extraction module, and cross-domain feature extraction module. The feature fusion module and signal reconstruction module introduce discrete cosine transform and channel attention mechanism to fuse time domain and frequency domain information for denoising.
It improves the robustness and accuracy of ECG signal denoising, can more effectively retain the key features of the signal and remove noise, and enhances the generalization performance of the model.
Smart Images

Figure CN118733979A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of electrocardiogram signal processing, and in particular relates to an electrocardiogram denoising method based on frequency information enhancement. Background Art
[0002] The electrocardiogram (ECG) is the most widely used vital sign monitoring technology in modern medical equipment. Each heartbeat is composed of waves of different amplitudes, including P wave, T wave, QRS wave and U wave. The ECG is a non-invasive test that records the electrical activity of the heart and helps diagnose heart disease. An abnormal waveform indicates abnormal heart health, and various abnormalities such as arrhythmia and coronary artery obstruction can be detected based on the waveform. However, ECG signals are easily affected by different noise sources during the acquisition process, which interferes with the diagnosis results.
[0003] Interference sources that contaminate ECG signals include various types of noise. Baseline drift (BW) is a type of noise caused by changes in electrode-skin impedance, patient movement, and breathing. ECGs affected by baseline drift continue to move downward over time instead of following a constant baseline. Muscle artifact (MA) is skeletal muscle activity that can be recorded by an ECG monitor, obscuring the true signal. Motion artifact (EM) is usually caused by various body movements, such as breathing, muscle contraction, etc., which cause relative displacement between the electrode and the skin. These noises will cover the information that the ECG signal is intended to convey, destroy the waveform of the ECG signal, and affect the correct diagnosis of heart disease. Therefore, in order to make a more accurate clinical diagnosis, it is very necessary to develop an effective method for denoising ECG signals.
[0004] At present, ECG signal denoising methods can be roughly divided into two categories. One is the traditional filtering method, including empirical mode decomposition, digital filter, Kalman filter, wavelet filter and other methods, and the other is the method based on deep learning. Although the traditional filtering method is more interpretable, its effectiveness and robustness are not as good as the deep learning method. However, most of the existing deep learning ECG signal denoising methods are based on the time domain information of the signal, ignoring the frequency domain information of the signal, which may affect the performance of the model.
[0005] Due to the non-stationary nature of ECG signals, if empirical mode decomposition and wavelet transform are used, the time-frequency information in the ECG signals can be used to denoise the ECG signals.
[0006] Among them, wavelet transform (WT) is an algorithm widely used in the field of ECG signal denoising, which removes noise by decomposing the signal. By performing discrete wavelet transform on the ECG signal, the signal is decomposed into wavelet coefficients of different scales. Subsequently, soft threshold processing is used to set the wavelet coefficients less than a certain threshold to zero, thereby removing the components considered to be noise. In order to improve the robustness of the algorithm, the stationary wavelet transform is introduced. Compared with the traditional wavelet transform, the stationary wavelet transform provides a more stable basis function, which can better adapt to the non-stationary nature of the signal, and more accurately retain the key features in the ECG signal while removing noise. However, this soft threshold method may cause some important features of the ECG signal to be lost, and it is difficult to remove the residual noise in the signal.
[0007] Empirical Mode Decomposition (EMD) is an adaptive time series analysis technique, often used to process nonlinear and non-stationary signals. EMD decomposes complex signals into a series of intrinsic mode functions, each of which represents a different frequency component of the signal. By analyzing its frequency characteristics and energy distribution, the intrinsic mode functions that mainly contain noise can be identified and selectively removed and modified. However, since some noise frequencies overlap with some of the ECG signal frequency spectra, if they are treated as a whole, some useful information will be lost.
[0008] Deep learning algorithms need to be trained based on noisy data and clean data prepared in advance, and learn noise characteristics in iterative training to accurately filter out noise in ECG signals. Compared with traditional ECG signal denoising methods, they show stronger robustness. Currently, the model structures used for ECG signal denoising include denoising autoencoders, generative adversarial networks, and recurrent neural networks. The denoising autoencoder, due to its powerful nonlinear mapping function, shows better filtering capabilities than other technologies.
[0009] Although there are many different deep learning methods for ECG signal denoising, they all focus on the time domain information of the signal and cannot utilize the frequency domain information of the signal. Summary of the invention
[0010] In order to fill the gap in the prior art and enable the model to learn the frequency domain characteristics of the signal while learning the time domain characteristics, the present invention proposes an ECG denoising method based on frequency information enhancement.
[0011] The technical solution specifically adopted by the present invention to solve the technical problem is:
[0012] An ECG denoising method based on frequency information enhancement first uses a sliding window to divide the ECG signal into samples of a specified length of time step, and then divides the ECG signal into segments. Then the divided ECG signal is input into an end-to-end frequency information enhanced two-stage denoising network. First, the input signal is masked, a part of the data points are randomly masked according to a set probability, and the masked signal is discrete cosine transformed to obtain the frequency domain information of the signal;
[0013] Next, the time domain feature extraction module and the frequency domain feature extraction module are used to extract features from the time domain and frequency domain information respectively to obtain the features of the ECG signal in the time domain and frequency domain. The time domain and frequency domain features are fused through the cross-domain feature fusion module to enhance the frequency information of the features.
[0014] Finally, the fused time-frequency domain features are input into the signal reconstruction module, and the features of the first stage are obtained by using the cross-stage feature fusion module improved based on the channel attention mechanism to increase the information flow between stages; the signal reconstruction module outputs the denoised and smoothed ECG signal, thereby completing the removal of mixed noise in the ECG signal.
[0015] Furthermore, the end-to-end frequency information enhanced two-stage denoising network includes: a time domain feature extraction module, a frequency domain feature extraction module, a cross-domain feature fusion module, a cross-stage feature fusion module and a signal reconstruction module;
[0016] The time domain feature extraction module and the frequency domain feature extraction module are used as the first stage of the two-stage network to extract the features of the time domain and the frequency domain respectively, and integrate the time domain information and the frequency domain information of the ECG signal into the deep learning network model, and use the frequency domain information as a supplement to the time domain information; the cross-domain feature fusion module is used to connect the two stages of the network, and fuse the time domain features with the frequency domain features to obtain the time-frequency features of the signal; the signal reconstruction module outputs the corresponding reconstructed signal according to the input features;
[0017] The cross-stage feature fusion module uses a channel attention mechanism to fuse the features of the first stage and the second stage to improve the diversity of features.
[0018] Furthermore, the first stage includes extracting and fusing the time-frequency domain features of the ECG signal, and the second stage reconstructs the fused time-frequency domain features and outputs the denoised results;
[0019] The first stage includes three steps: (1) masking the input model signal, randomly masking a part of the data points according to probability, and performing discrete cosine transform on the masked signal to obtain frequency domain information; (2) inputting the time domain and frequency domain information into the time domain feature extraction module and the frequency domain feature extraction module respectively, wherein the time domain feature extraction module is a U-Net combined with a semi-instance normalization block, and the frequency domain feature extraction module is a residual network containing multi-scale convolution, through which the signal features in the time domain and frequency domain are extracted respectively; (3) inputting the extracted time domain and frequency domain features into the cross-domain feature fusion module to obtain the fused time-frequency domain features;
[0020] The second stage is to use the signal reconstruction module to reconstruct the time-frequency domain features obtained in the first stage. The signal reconstruction module uses cross-stage feature fusion to obtain the features from the first stage based on the features extracted in the first stage to increase the information flow between stages, and then obtains the denoised and smoothed ECG signal through the signal reconstruction module.
[0021] Furthermore, the input mask randomly masks part of the input signal, and the network repairs the masked part of the information during the training process; first, for each input sample X i ∈R L , there is a corresponding mask vector M i ∈R L , the mask vector is each position according to the input mask ratio P IM The probability of 0 is set, and the rest of the positions are set to 1; multiplying the input sample with the corresponding mask vector will obtain the masked input X Mi , as shown in formula (1);
[0022] X Mi =X i ×M i .
[0023] Furthermore, the time domain feature extraction module is composed of a half-case normalization module HIN Block, Res Block, up and down sampling, and skip connection. In the input part of the network, a convolution with a convolution kernel size of 31x1 is used to extract the initial features of the signal, and then the initial features are input into the HIN Block of the encoder stage to extract features of different scales; then the output features are downsampled using a convolution with a convolution kernel size of 4 and a step size of 2, and the number of feature channels is increased to twice the original; in the decoder part, the features are upsampled using a transposed convolution with a kernel size and a step size of 2. The upsampled features are input into the ResBlock to extract high-level features, and the features from the encoder part are fused using skip connections.
[0024] Furthermore, the frequency domain feature extraction module includes: discrete cosine transform DCT, frequency domain feature extraction network and inverse discrete cosine transform IDCT;
[0025] The frequency domain feature extraction network is a multi-scale residual convolutional neural network; first, the input is subjected to discrete cosine transform DCT to convert the signal from the time domain to the frequency domain, and the result is input into a convolution layer with a convolution kernel size of 5x1 to extract the initial features of the frequency domain signal; then the initial features are respectively input into three ResBlocks with different convolution kernel sizes, so that the model can extract frequency features of different scales, splice the frequency domain features of different scales in the channel dimension, and then use a convolution layer with a convolution kernel size of 1x1 to reduce the dimension of the spliced features; finally, the output result of the convolution layer is subjected to inverse discrete cosine transform IDCT to obtain the frequency domain feature map of the corresponding time series signal.
[0026] Furthermore, the cross-domain feature fusion module consists of a dual attention module DAM and a convolution with a kernel size of 31x1; wherein the dual attention module DAM is obtained by connecting the channel attention module CAM and the spatial attention module SAM in series; the dual attention module DAM infers the attention map along the channel and spatial dimensions of the given feature map in sequence, and then multiplies the attention map with the input feature map to achieve adaptive feature refinement; then the output feature is combined with F fre The splicing is performed in the channel dimension and the splicing result is input into the one-dimensional convolution layer to realize the fusion of time domain and frequency domain features.
[0027] Furthermore, the signal reconstruction module consists of a HIN Block, a Res Block, up and down sampling, and a skip connection; and is combined with a cross-stage feature fusion module that introduces channel attention; an improved cross-stage feature fusion module is connected between the two encoders and decoders to fuse the features from the encoder-decoder part of the first stage.
[0028] Considering that ECG signals are often interfered by multiple noises in actual scenarios, traditional filtering methods are difficult to remove the mixture of multiple noises while retaining the main information of ECG signals to the greatest extent. Current deep learning algorithms focus on the time domain information of ECG and ignore the frequency domain information. The algorithm model provided by the present invention introduces a frequency information enhancement mechanism based on the deep learning model HINet, and combines input masking, cross-stage fusion and other mechanisms to construct a two-stage network with frequency enhancement for ECG signal denoising, thereby realizing filtering of mixed noise of ECG signals.
[0029] Compared with the prior art, the present invention and its preferred embodiments have at least the following outstanding features and beneficial effects:
[0030] (1) A frequency feature extraction module is introduced into the network. The discrete cosine transform is used to extract the frequency information of the ECG signal, and the frequency domain features are extracted. The frequency domain features are used as a supplement to the time domain features, so that the features can contain richer information, filling the gap in the current research in this part of the ECG signal denoising field.
[0031] (2) A two-stage network for ECG signal denoising is proposed. In the first stage, a U-Net based on convolution and semi-instance normalization block HIN Block and a multi-scale convolution residual network are used to extract time domain and frequency domain features, and the two are fused. In the second stage, the extracted features are reconstructed, and a cross-stage feature fusion module based on the channel attention mechanism is used to achieve two-stage feature fusion.
[0032] (3) An input mask is introduced to randomly mask some data points of the input ECG signal, guiding the model to pay more attention to the information contained in the ECG signal waveform rather than overfitting the noise, thereby improving the generalization performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments:
[0034] Figure 1 The overall block diagram of the algorithm network of the embodiment of the present invention;
[0035] Figure 2 This is a flowchart of the algorithm operation of an embodiment of the present invention;
[0036] Figure 3 This is a structural diagram of a time domain feature extraction module according to an embodiment of the present invention;
[0037] Figure 4 In,(a) HINBlock network structure diagram;(b) ResBlock structure diagram;
[0038] Figure 5 This is a structural diagram of a time domain feature extraction module according to an embodiment of the present invention;
[0039] Figure 6 This is a structural diagram of a cross-domain feature fusion module according to an embodiment of the present invention;
[0040] Figure 7 This is a structural diagram of a signal reconstruction module according to an embodiment of the present invention;
[0041] Figure 8 This is a structural diagram of the improved cross-stage fusion module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the features and advantages of this patent more obvious and easy to understand, the following embodiments are specifically described in detail as follows:
[0043] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in this specification have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0045] The embodiment of the present invention first proposes a two-stage denoising network with end-to-end frequency information enhancement, such as Figure 1 As shown. It mainly includes four parts: a time domain feature extraction module, a frequency domain feature extraction module, a cross-domain feature fusion module and a signal reconstruction module, wherein the time domain and frequency domain feature extraction module is the first stage of the two-stage network, which is used to extract the features of the time domain and the frequency domain respectively, and the cross-domain feature fusion module is used to connect the two stages of the network, and fuse the time domain features with the frequency domain features to obtain the time-frequency features of the signal, and the signal reconstruction module outputs the corresponding reconstructed signal according to the input features. In addition, the present invention also introduces a cross-stage feature fusion module using a channel attention mechanism to fuse the features of the first stage and the second stage to improve the diversity of features. At the same time, the input mask technology is introduced to improve the generalization performance of the model. The present invention combines discrete cosine transform with denoising autoencoder, fuses the time domain information and frequency domain information of the ECG signal, realizes the frequency information enhancement of the network, and filters out various noises in the ECG signal under the condition of causing minimum signal distortion, which can be used as an effective tool for ECG signal denoising.
[0046] According to the characteristics of ECG signals with rich information in time domain and frequency domain, the present invention integrates the time domain information and frequency domain information of ECG signals into the deep learning network model, and uses the frequency domain information as a supplement to the time domain information to improve the denoising performance of the model. The filtering algorithm of the present invention is mainly divided into two stages. The first stage mainly includes the extraction and fusion of the time-frequency domain features of the ECG signals, and the second stage mainly reconstructs the time-frequency domain features after fusion and outputs the denoised results. The first stage includes three steps: (1) Mask the signal of the input model, randomly mask a part of the data points according to probability, and perform discrete cosine transform on the masked signal to obtain frequency domain information; (2) Input the time domain and frequency domain information into the time domain feature extraction module and the frequency domain feature extraction module respectively, where the time domain feature extraction module is a U-Net combined with a semi-instance normalization block, and the frequency domain feature extraction module is a residual network containing multi-scale convolutions, through which the signal features in the time domain and frequency domain are extracted respectively; (3) Input the extracted time domain and frequency domain features into the cross-domain feature fusion module to obtain the fused time-frequency domain features. The second stage uses the signal reconstruction module to reconstruct the time-frequency domain features obtained in the first stage. The structure of the signal reconstruction module is similar to that of the time domain feature extraction module, but cross-stage feature fusion is used to obtain the features from the first stage, increase the information flow between stages, and obtain the denoised and smoothed ECG signal through the signal reconstruction module. The implementation process of each step is as follows: Figure 2 shown.
[0047] The following is a detailed introduction to the embodiment of the present invention in steps:
[0048] (1) Input mask
[0049] The input mask randomly masks part of the input signal, and the network repairs the masked part during the training process. First, for each input sample X i ∈R L , there is a corresponding mask vector M i ∈R L , the mask vector is each position according to the input mask ratio P IM The probability of is set to 0, and the rest are set to 1. Multiplying the input sample with the corresponding mask vector yields the masked input X Mi , as shown in formula (1).
[0050] X Mi =X i ×M i (1)
[0051] (2) Time domain feature extraction module
[0052] The time domain feature extraction module is a Unet, such as Figure 3As shown. The network mainly consists of a half-case normalization module HINBlock, ResBlock, up and down sampling, and skip connections. In the input part of the network, a convolution with a convolution kernel size of 31x1 is used to extract the initial features of the signal, and then the initial features are input into the HINBlock of the encoder stage to extract features of different scales. Then, the output features are downsampled using a convolution with a convolution kernel size of 4 and a stride of 2, and the number of feature channels is doubled. Compared with traditional downsampling, downsampling using strided convolution can retain more information. In the decoder part, the features are upsampled using a transposed convolution with a kernel size and a stride of 2. The upsampled features are input into ResBlock to extract high-level features, and skip connections are used to fuse the features from the encoder part, which can reduce the problem of gradient degradation caused by the depth of the network.
[0053] The network structure of HIN Block is as follows Figure 4 As shown in (a), the input is the initial feature from the 31x1 convolution, denoted as Among them C in Represents the input feature dimension, and L represents the length of the input feature. Use convolution with a kernel size of 15x1 to further extract features and increase the dimension of the input feature to obtain the intermediate feature Similarly, C mid and L represent the dimension and length of the intermediate feature respectively. Then, the intermediate feature F mid Divide into two halves, F mid1 Perform instance normalization (IN) operation, F mid2 Do not perform any operation, retain the context information, and then convert F mid1 The results of instance normalization and F mid2 Splicing in the channel dimension, finally adding the features after two LeakyReLU and a layer of convolution Conv with a kernel size of 15x1 to the original signal after a layer of convolution Conv with a kernel size of 1x1, the output Among them C out =C mid . The network of Res Block is as follows Figure 4 As shown in (b), the structure is similar to the HIN Block, and the only difference is the presence or absence of semi-instance normalization, which is used to decode the high-dimensional features from the encoder part.
[0054] (3) Frequency domain feature extraction module
[0055] The frequency domain feature extraction module consists of three parts: discrete cosine transform DCT, frequency domain feature extraction network and inverse discrete cosine transform IDCT.
[0056] The frequency signal F is obtained based on the discrete cosine transform DCT. Using DCT to extract the frequency characteristics of the signal has the following two advantages: 1) The result obtained after performing DCT on the original signal is a sequence of the same length as the original signal. This feature makes the DCT output more suitable for combined analysis with the original signal; 2) DCT has a differentiable property and can be seamlessly integrated into the back-propagation neural network, and DCT can be implemented using element-by-element multiplication. The calculation of one-dimensional DCT is as follows:
[0057]
[0058]
[0059] Where μ(k) represents a constant normalization factor, and the output F is the number of spectrum frames corresponding to the input time series signal X.
[0060] This embodiment proposes a multi-scale residual convolutional neural network as a frequency domain feature extraction network, such as Figure 5 As shown in the figure, the input is first subjected to discrete cosine transform (DCT) to convert the signal from the time domain to the frequency domain. The result is input into a convolution layer with a convolution kernel size of 5x1 to extract the initial features of the frequency domain signal. The initial features are then input into three ResBlocks with different convolution kernel sizes, so that the model can extract frequency features of different scales, concatenate frequency domain features of different scales in the channel dimension, and then use a convolution layer with a convolution kernel size of 1x1 to reduce the dimension of the concatenated features. Finally, the output of the convolution layer is subjected to inverse discrete cosine transform (IDCT) to obtain the frequency domain feature map of the corresponding time series signal.
[0061] Discrete cosine transform DCT converts the input signal from the time domain to the frequency domain. Correspondingly, inverse discrete cosine transform IDCT is used to convert the frequency domain signal to the time domain so that the features can be aligned. The specific calculation of IDCT is shown in the following formula:
[0062]
[0063]
[0064] Where μ(t) represents a constant normalization factor. The feature map output by the frequency domain feature extraction network is transformed through inverse discrete cosine transform to obtain the frequency domain features of the aligned original signal, denoted as F fre .
[0065] (4) Cross-domain feature fusion module
[0066] The output of the network in the first stage consists of time domain features and frequency domain features. Furthermore, this embodiment proposes a cross-domain feature fusion module for fusing features from the time domain and the frequency domain, such as Figure 6 As shown in the figure, the cross-domain feature fusion module mainly consists of a dual attention module DAM and a convolution with a kernel size of 31x1. The DAM is obtained by connecting the channel attention module CAM and the spatial attention module SAM in series. The dual attention module DAM infers the attention map along the channel and spatial dimensions of the given feature map in turn, and then multiplies the attention map with the input feature map to achieve adaptive feature refinement. Then the output feature is compared with F fre Splicing is performed in the channel dimension and the splicing result is input into a one-dimensional convolutional layer to achieve the fusion of time domain and frequency domain features, so that the time domain features and the frequency domain features can complement each other.
[0067] (5) Signal reconstruction module
[0068] The signal reconstruction module is the second stage of the two-stage network proposed in this embodiment, which is used to enhance the network's ability to recover detailed waveforms. The network structure is similar to the time domain feature extraction module in the first stage, mainly consisting of HINBlock, Res Block, up and down sampling, and skip connections. However, it is worth noting that a cross-stage fusion module is introduced in this module, and channel attention is introduced on its basis, such as Figure 7 As shown in Figure 2, an improved cross-stage fusion module is used between the two encoders and decoders. Figure 8 As shown in the figure, it has the following advantages: first, it can fuse the features from the encoder-decoder part of the first stage, and use the features of the first stage as a supplement to the second stage, reducing the impact of information loss caused by up and down sampling; second, feature fusion is used between the two stages to improve the stability of the model; third, channel attention CAM is introduced in the cross-stage fusion module, so that in the process of cross-stage feature fusion, the model can pay more attention to the feature channels containing key information, thereby improving the denoising ability of the model.
[0069] Based on the above design, the process of finally obtaining the basic embodiment scheme of the present invention is as follows:
[0070] First, the ECG signal is divided into samples with a length of 512 time steps using a sliding window. Since the model proposed in the present invention integrates the conversion of frequency information and the extraction of frequency features into the model, the preliminary preparation of the data only includes dividing the ECG signal into segments. Secondly, the divided signal is input into the model. The model first performs a masking operation on the input signal, randomly masks a part of the data points according to the set probability, and performs a discrete cosine transform on the masked signal to obtain the frequency domain information of the signal; then, the time domain feature extraction module and the frequency domain feature extraction module are used to extract the time domain and frequency domain information respectively, and the features of the ECG signal in the time domain and frequency domain are obtained. The time domain and frequency domain features are fused through the cross-domain feature fusion module to enhance the frequency information of the features. Finally, the fused time-frequency domain features are input into the signal reconstruction module, and the cross-stage fusion module based on the channel attention mechanism is introduced to obtain the features of the first stage, increase the information flow between stages, and the signal reconstruction module outputs the smoothed ECG signal after denoising, thereby completing the removal of mixed noise of the ECG signal.
[0071] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0072] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0073] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.
[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0075] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0076] The above is only a preferred embodiment of the present invention, and does not limit the present invention in other forms. Any technician familiar with the profession may use the above disclosed technical content to change or modify it into an equivalent embodiment with equivalent changes. However, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
[0077] This patent is not limited to the above-mentioned optimal implementation mode. Anyone can derive other forms of ECG denoising methods based on frequency information enhancement under the inspiration of this patent. All equal changes and modifications made according to the scope of the patent application of the present invention should be covered by this patent.
Claims
1. An electrocardiogram denoising method based on frequency information enhancement, characterized in that: The divided ECG signal is input into the two-stage denoising network with end-to-end frequency information enhancement. First, the input signal is masked, a part of the data points are randomly shielded according to the set probability, and the masked signal is discrete cosine transformed to obtain the frequency domain information of the signal. Next, the time domain feature extraction module and the frequency domain feature extraction module are used to extract features from the time domain and frequency domain information respectively to obtain the features of the ECG signal in the time domain and frequency domain. The time domain and frequency domain features are fused through the cross-domain feature fusion module to enhance the frequency information of the features. Finally, the fused time-frequency domain features are input into the signal reconstruction module, and the features of the first stage are obtained by using the cross-stage feature fusion module improved based on the channel attention mechanism to increase the information flow between stages; the signal reconstruction module outputs the denoised and smoothed ECG signal, thereby completing the removal of mixed noise in the ECG signal.
2. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: Before inputting into the denoising network, the ECG signal is first divided into samples of time steps of a specified length using a sliding window to divide the ECG signal into segments.
3. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The end-to-end frequency information enhanced two-stage denoising network includes: a time domain feature extraction module, a frequency domain feature extraction module, a cross-domain feature fusion module, a cross-stage feature fusion module and a signal reconstruction module; The time domain feature extraction module and the frequency domain feature extraction module are used as the first stage of the two-stage network to extract the features of the time domain and the frequency domain respectively, and integrate the time domain information and the frequency domain information of the ECG signal into the deep learning network model, and use the frequency domain information as a supplement to the time domain information; the cross-domain feature fusion module is used to connect the two stages of the network, and fuse the time domain features with the frequency domain features to obtain the time-frequency features of the signal; the signal reconstruction module outputs the corresponding reconstructed signal according to the input features; The cross-stage feature fusion module uses a channel attention mechanism to fuse the features of the first stage and the second stage to improve the diversity of features.
4. The method for electrocardiogram denoising based on frequency information enhancement according to claim 3, characterized in that: The first stage includes extracting and fusing the time-frequency domain features of the ECG signal, and the second stage reconstructs the fused time-frequency domain features and outputs the denoised results; The first stage includes three steps: (1) masking the input model signal, randomly masking a part of the data points according to probability, and performing discrete cosine transform on the masked signal to obtain frequency domain information; (2) inputting the time domain and frequency domain information into the time domain feature extraction module and the frequency domain feature extraction module respectively, wherein the time domain feature extraction module is a U-Net combined with a semi-instance normalization block, and the frequency domain feature extraction module is a residual network containing multi-scale convolution, through which the signal features in the time domain and frequency domain are extracted respectively; (3) inputting the extracted time domain and frequency domain features into the cross-domain feature fusion module to obtain the fused time-frequency domain features; The second stage is to use the signal reconstruction module to reconstruct the time-frequency domain features obtained in the first stage. The signal reconstruction module uses cross-stage feature fusion to obtain the features from the first stage based on the features extracted in the first stage to increase the information flow between stages, and then obtains the denoised and smoothed ECG signal through the signal reconstruction module.
5. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The input mask randomly masks part of the input signal, and the network repairs the masked part of the information during the training process; first, for each input sample X i ∈R L , there is a corresponding mask vector M i ∈R L , the mask vector is each position according to the input mask ratio P IM The probability of 0 is set, and the rest of the positions are set to 1; multiplying the input sample with the corresponding mask vector will obtain the masked input X Mi , as shown in formula (1); X Mi =X i ×M i 。 6. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The time domain feature extraction module consists of a half-case normalization module HIN Block, Res Block, up and down sampling, and skip connection. In the input part of the network, a convolution with a convolution kernel size of 31x1 is used to extract the initial features of the signal, and then the initial features are input into the HIN Block of the encoder stage to extract features of different scales; then the output features are downsampled using a convolution with a convolution kernel size of 4 and a step size of 2, and the number of feature channels is increased to twice the original; in the decoder part, the features are upsampled using a transposed convolution with a kernel size and a step size of 2. The upsampled features are input into the ResBlock to extract high-level features, and the features from the encoder part are fused using skip connections.
7. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The frequency domain feature extraction module includes: discrete cosine transform DCT, frequency domain feature extraction network and inverse discrete cosine transform IDCT; The frequency domain feature extraction network is a multi-scale residual convolutional neural network; first, the input is subjected to discrete cosine transform DCT to convert the signal from the time domain to the frequency domain, and the result is input into a convolution layer with a convolution kernel size of 5x1 to extract the initial features of the frequency domain signal; then the initial features are respectively input into three ResBlocks with different convolution kernel sizes, so that the model can extract frequency features of different scales, splice the frequency domain features of different scales in the channel dimension, and then use a convolution layer with a convolution kernel size of 1x1 to reduce the dimension of the spliced features; finally, the output result of the convolution layer is subjected to inverse discrete cosine transform IDCT to obtain the frequency domain feature map of the corresponding time series signal.
8. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The cross-domain feature fusion module consists of a dual attention module DAM and a convolution with a kernel size of 31x1; The dual attention module DAM is obtained by connecting the channel attention module CAM and the spatial attention module SAM in series; the dual attention module DAM infers the attention map along the channel and spatial dimensions of the given feature map, and then multiplies the attention map with the input feature map to achieve adaptive feature refinement; then the output feature is combined with F fre The splicing is performed in the channel dimension and the splicing result is input into the one-dimensional convolution layer to realize the fusion of time domain and frequency domain features.
9. The method for electrocardiogram denoising based on frequency information enhancement according to claim 1, characterized in that: The signal reconstruction module consists of HIN Block, Res Block, up and down sampling and skip connection; and is combined with a cross-stage feature fusion module that introduces channel attention; An improved cross-stage feature fusion module is introduced between the two encoder-decoders to fuse the features from the encoder-decoder part of the first stage.
Citation Information
Cited By
Electrocardiosignal visualization enhancement method and system, electronic equipment and medium
CN119157551A
Operation stage identification method based on time-frequency feature fusion
CN119559554A
Man-machine interaction system and method of intelligent refrigerator
CN119889322A
Electroencephalogram time series data classification method and device in medical field
CN120067823A
A method and device for classifying electroencephalogram time series data in the medical field
CN120067823B
