CN115470827B - Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals - Google Patents
Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals Download PDFInfo
- Publication number
- CN115470827B CN115470827B CN202211161910.9A CN202211161910A CN115470827B CN 115470827 B CN115470827 B CN 115470827B CN 202211161910 A CN202211161910 A CN 202211161910A CN 115470827 B CN115470827 B CN 115470827B
- Authority
- CN
- China
- Prior art keywords
- feature
- convolution
- block
- inputting
- module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/24—Detecting, measuring or recording bioelectric or biomagnetic signals of the body or parts thereof
- A61B5/316—Modalities, i.e. specific diagnostic methods
- A61B5/318—Heart-related electrical modalities, e.g. electrocardiography [ECG]
- A61B5/346—Analysis of electrocardiograms
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7203—Signal processing specially adapted for physiological signals or for diagnostic purposes for noise prevention, reduction or removal
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61B—DIAGNOSIS; SURGERY; IDENTIFICATION
- A61B5/00—Measuring for diagnostic purposes; Identification of persons
- A61B5/72—Signal processing specially adapted for physiological signals or for diagnostic purposes
- A61B5/7235—Details of waveform analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/088—Non-supervised learning, e.g. competitive learning
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/10—Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation
Landscapes
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Public Health (AREA)
- Veterinary Medicine (AREA)
- Heart & Thoracic Surgery (AREA)
- Surgery (AREA)
- Animal Behavior & Ethology (AREA)
- Pathology (AREA)
- Medical Informatics (AREA)
- Artificial Intelligence (AREA)
- Signal Processing (AREA)
- Cardiology (AREA)
- Theoretical Computer Science (AREA)
- Psychiatry (AREA)
- Physiology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Measurement And Recording Of Electrical Phenomena And Electrical Characteristics Of The Living Body (AREA)
Abstract
A self-supervised learning and twinning network-based anti-resistance electrocardiosignal noise reduction method integrates coordinate attention modules (Coordinate attention, CA) in an encoder, and effectively enhances the expression capability of network learning characteristics by embedding position information into channel attention. The invention provides a new self-supervision learning module, which consists of a reconstruction prediction module and an improved twin network, wherein electrocardiosignals divided into a plurality of sections of different patches are used as input by the module, and the front half part of the patch is used for predicting the rear half part of the patch by utilizing the strong correlation among local signals in the patch, so that the self-supervision learning in the patch is realized. The self-supervision learning capability of the reconstruction prediction module is utilized to combine the reconstruction prediction module with a twin network, and the twin network is used to compare the electrocardiosignals predicted through self-supervision learning with the actually reconstructed electrocardiosignals, so that the generator can better grasp the local key characteristics of the electrocardiosignals, and the denoising of the signals is facilitated.
Description
Technical Field
The invention relates to the technical field of electrocardiosignal processing, in particular to a resistance electrocardiosignal noise reduction method based on self-supervision learning and a twin network.
Background
Electrocardiogram is a non-invasive tool for detecting and diagnosing cardiovascular diseases, parameters of various indexes in heart activities can be directly obtained through electrocardiosignals, and heart states of heart patients and related complications can be accurately diagnosed. However, during the signal acquisition, some noise is always accompanied, which can mask some important features of the electrocardiographic signal. Therefore, removing noise is of great significance to the study of electrocardiographic signals.
Neural networks are a method often used to remove noise, with some learning-based networks (e.g., noise-reducing self-encoder, encoder/decoder networks) having achieved good results in the image field. Similarly, in audio and speech processing, the development of deep neural networks is also becoming more and more mature. Compared with codec networks, the generation of countermeasure networks (Generative Adversarial Nets, GAN) is a popular research direction in the field of artificial intelligence, and the frequency of use of GAN is increasing in the field of electrocardiosignal processing. However, in training the GAN model, researchers are always accustomed to comparing the final generated noise reduction signal with the original clean signal, thereby making the noise reduction signal approximate to clean data. The method only focuses on the distinction between two signals, and does not consider the potential representation relation between the interiors of the signals, so that the trained model has poor generalization capability and is difficult to adapt to various situations where noise exists.
Disclosure of Invention
In order to overcome the defects of the technology, the invention provides a method for reducing the noise of the resistant electrocardiosignals based on self-supervision learning and a twin network. The model utilizes a coder-decoder structure in the generator to denoise the electrocardiosignal containing noise, then the obtained noise reduction signal is sent to a reconstruction prediction module to carry out secondary reconstruction, a twin network is used for comparing the distance between the secondary reconstruction result and the noise reduction signal, finally a discriminator is used for judging the noise reduction signal generated by the decoder, the probability of the noise reduction signal being a clean signal is judged, and model parameters are optimized in a game mode, so that the purpose of removing noise is achieved.
The technical scheme adopted for overcoming the technical problems is as follows:
a method for reducing noise of a resistant electrocardiosignal based on self-supervision learning and a twin network comprises the following steps:
a) Reading N pieces of electrocardiosignal data in an MIT-BIH arrhythmia database, and intercepting M pieces of which the length is L on a first channel of each signal, wherein the j pieces arej={1,2,...,M},/>An electrocardiosignal for the ith signal point in the jth segment;
b) Selecting three types of noise BW, MA and EM from an MIT-BIH noise pressure database, and intercepting M fragments with the length L on a first channel of the BW, MA and EM noise respectively;
c) Respectively carrying out normalization processing on the intercepted electrocardiosignal data and noise;
d) Adding Xdb, ydb, zdb noise intensities to BW, MA and EM three types of noise of the M fragments with the length of L respectively, and randomly adding the BW, MA and EM three types of noise of the M fragments with the length of L to normalized electrocardiosignal data to form a noisy electrocardiosignal;
e) Dividing the electrocardiosignal containing noise into a training set X according to the proportion of A to B to C train Verification set X val Test set X test ;
f) Establishing a neural network model, wherein the neural network model is composed of a generator network and a discriminator network;
g) Training set X train Inputting into a generator network of the neural network model, and outputting to obtain a noise reduction signal set
h) Aggregating noise reduction signalsThe noise reduction signal is input to a discriminator, and the discriminator is used to determine the probability that the noise reduction signal is from a clean signal.
Preferably, N pieces of electrocardiographic signal data in the MIT-BIH arrhythmia database are read in step a) using the WFDB library in python, n=48, l=512, m=400.
Preferably, in step b), l×m is less than or equal to 650000, in step d), x=0, y=1.25, and z=5.
Preferably, in step e), a=8, b=1, c=1.
Further, step g) comprises the steps of:
g-1) the generator network is sequentially composed of an encoder, a decoder and a self-supervision learning module;
g-2) the encoder is sequentially composed of a first convolution block, a second convolution block, a third convolution block, a first coordinate attention module, a fourth convolution block, a fifth convolution block, a sixth convolution block, a second coordinate attention module and a seventh convolution block;
g-3) training set X train ={x 1 ,x 2 ,...,x i ,...,x Q },x i For the ith noisy electrocardiosignal in the training set, i e {1, 2., Q }, Q is training set X train The total number of the electrocardiosignals containing noise,the ith noisy electrocardiosignal x i Sequentially inputting into a first convolution block to obtain a feature F1, and inputting the feature F1 into a second convolution blockObtaining a feature F2, inputting the feature F2 into a third convolution block to obtain a feature F3, inputting the feature F3 into a first coordinate attention module to obtain a refined feature F4, inputting the refined feature F4 into a fourth convolution block to obtain a feature F5, inputting the feature F5 into a fifth convolution block to obtain a feature F6, inputting the feature F6 into a sixth convolution block to obtain a feature F7, inputting the feature F7 into a second coordinate attention module to obtain a refined feature F8, and inputting the refined feature F8 into a seventh convolution block to obtain a potential feature F9;
g-4) the decoder is sequentially composed of a first deconvolution block, a second deconvolution block, a third deconvolution block, a fourth deconvolution block, a fifth deconvolution block, a sixth deconvolution block and a seventh deconvolution block;
g-5) inputting the potential feature F9 into the first deconvolution block to obtain a feature F10, splicing the feature F10 with the refined feature F8, inputting the spliced feature F10 into the second deconvolution block to obtain a feature F11, splicing the spliced feature F11 with the feature F6, inputting the spliced feature F12 into the third deconvolution block to obtain a feature F12, splicing the spliced feature F12 with the feature F5, inputting the spliced feature F13 into the fourth deconvolution block to obtain a feature F13, splicing the spliced feature F13 with the refined feature F4, inputting the spliced feature F13 into the fifth deconvolution block to obtain a feature F14, splicing the spliced feature F14 with the refined feature F2 into the sixth deconvolution block to obtain a feature F15, splicing the spliced feature F15 with the feature F1 into the seventh deconvolution block to obtain an i-th noise reduction signal
g-6) combining the Q noise reduction signals into a noise reduction signal set Preferably, the first convolution block is sequentially composed of a convolution layer with a convolution kernel size of 1×31, a step length of 1 and filling (0, 15), a Batchnorm2d layer and a ReLU activation function layer; the second convolution block is sequentially formed by convolution kernel with the size of 2 multiplied by 31, step length of 2 and filling of (1, 15) and BatchNorm2d layer and ReLU activation function layer; the third convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fourth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fifth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the sixth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the seventh convolution block sequentially consists of a convolution kernel with the size of 2 multiplied by 31, the step length of 2, filling of (1, 15) and BatchNorm2d layers, and the first deconvolution block, the second deconvolution block, the third deconvolution block, the fourth deconvolution block, the fifth deconvolution block and the sixth deconvolution block sequentially consist of a deconvolution layer with the size of 1 multiplied by 32, the step length of 2, filling of (0, 15), the BatchNorm2d layers and a ReLU activation function layer; the seventh deconvolution block consists of deconvolution layer with convolution kernel size of 1×31, step size of 1, and padding of (0, 15), batchnorm2d layer, and ReLU activation function layer.
Further, the method further comprises the following steps after the step g-6):
g-7) establishing a self-supervision learning module, wherein the self-supervision learning module consists of a reconstruction prediction module and an improved twin network, the reconstruction prediction module sequentially consists of a convolution layer with the size of 3 multiplied by 3, the number of channels of 1, a convolution layer filled with (1, 1), a BatchNorm2d layer and a ReLU activation function layer, and the improved twin network sequentially consists of a convolution neural network with the size of 1 multiplied by 1, a convolution layer with the size of 3 multiplied by 3, a SENet network and a Linear layer;
g-8) applying the ith noise reduction signalThe noise reduction signal with the length L in each section is re-divided into L/len sections according to the sampling points with the number len, and the noise reduction signal after division is +.>Denoted as-> For the ith noise reduction signal->J= {1,2,..l/len };
g-10) front halfInputting the reconstructed prediction module to obtain the second half part +.>Is the predicted output of (2)
g-12) outputting the predictionAnd the second half->Respectively input into the improved twin network to respectively obtain different spatial expressions, and the spatial expressions are expressed by the formula +.>Calculating to obtain the distance Loss 1 In the formula, I.I 2 Is the L2 norm and g (·) is the modified twin network.
Further, step h) comprises the steps of:
h-1) the discriminator is composed of a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a full connection layer and a Sigmoid activation function layer in sequence, wherein the first convolution module, the second convolution module and the third convolution module are composed of a convolution kernel with the size of 1 multiplied by 16, a step length of 4, a convolution layer filled with (0, 6), a Batch Norm layer and a leakyReLU activation function layer in sequence, the convolution kernel of the fourth convolution layer is 1 multiplied by 15, the step length of 1, the filling is (0, 7) and the channel number of 1;
h-2) applying the ith noise reduction signalInputting the feature d1 into a first convolution module to obtain a feature d1, inputting the feature d1 into a second convolution module to obtain a feature d2, inputting the feature d2 into a third convolution module to obtain a feature d3, inputting the feature d3 into a fourth convolution module to obtain a feature d4, inputting the feature d4 into a fully connected layer, mapping the learned feature into a unit t, inputting the unit t into a Sigmoid activation function layer, and mapping the unit t into [0,1 ]]Between by the formulaCalculating to obtain the i noise reduction signal +.>Probability from clean signal->Where e is a natural constant.
Further, the method also comprises the following steps:
i-1) by the formulaCalculating Loss function Loss of encoder and decoder 2 Wherein λ and β are balance factors, λ=0.2, β=0.7, d (·) is the discriminator judgmenti noise reduction signals->Electrocardiosignals +.>Probability of being from noisy signal instead of original clean signal,/->Electrocardiosignals of the kth signal point in the ith clean segment are obtained;
i-2) is calculated by the formula Loss G =Loss 2 +γLoss 1 Calculating to obtain the total Loss function Loss of the generator G Wherein γ is a balance factor, γ=0.1;
i-3) by the formulaCalculating a Loss function Loss of the discriminator D In the formula->Judging electrocardiosignals of kth signal point in ith clean segment for discriminator +.>Probability from the original clean signal;
i-4) Total Loss function Loss through generator Using Adam optimizer G Training generator, loss function Loss through discriminator D Training the discriminator, wherein the initial learning rate is set to be 0.001, the batch size is set to be 32, the iteration number is 100, in each iteration, the generator is trained three times first and then the discriminator is trained once, the learning rate of the generator is updated to be 0.5 times of the original learning rate every 30 times, the learning rate of the discriminator is updated to be 0.5 times of the original learning rate every 40 times, and the verification set X is obtained after the training is completed val Inputting the model into a neural network to select an optimal neural network model;
i-5) test set X test Input toIn the generator network of the optimal neural network model, the noise reduction signal set is obtained by outputting
The beneficial effects of the invention are as follows: by fusing the coordinate attention modules (Coordinate attention, CA) in the encoder, embedding the location information into the channel attention, the expressive power of the network learning features is effectively enhanced. The invention provides a new self-supervision learning module, which consists of a reconstruction prediction module and an improved twin network, wherein electrocardiosignals divided into a plurality of sections of different patches are used as input by the module, and the front half part of the patch is used for predicting the rear half part of the patch by utilizing the strong correlation among local signals in the patch, so that the self-supervision learning in the patch is realized. The self-supervision learning capability of the reconstruction prediction module is utilized to combine the reconstruction prediction module with a twin network, and the twin network is used to compare the electrocardiosignals predicted through self-supervision learning with the actually reconstructed electrocardiosignals, so that the generator can better grasp the local key characteristics of the electrocardiosignals, and the denoising of the signals is facilitated.
Drawings
FIG. 1 is a diagram of a neural network framework of the present invention;
fig. 2 is a block diagram of the self-supervised learning module of the present invention.
Detailed Description
The invention is further described with reference to fig. 1 and 2.
A method for reducing noise of a resistant electrocardiosignal based on self-supervision learning and a twin network comprises the following steps:
a) Reading N pieces of electrocardiosignal data in an MIT-BIH arrhythmia database, and intercepting M pieces of which the length is L on a first channel of each signal, wherein the j pieces arej={1,2,...,M},/>Is the firstElectrocardiosignals of the ith signal point in the j segments.
b) And selecting three types of noises BW, MA and EM from the MIT-BIH noise pressure database, and respectively cutting M fragments with the length L on a first channel of the BW, MA and EM noises.
c) And respectively carrying out normalization processing on the intercepted electrocardiosignal data and noise.
d) And adding Xdb, ydb, zdb noise intensities to BW, MA and EM of the M fragments with the length of L respectively, and randomly adding the BW, MA and EM of the M fragments with the length of L to normalized electrocardiosignal data to form the electrocardiosignal containing noise.
e) Dividing the electrocardiosignal containing noise into a training set X according to the proportion of A to B to C train Verification set X val Test set X test 。
f) A neural network model is built, which is composed of a generator network and an identifier network.
g) Training set X train Inputting into a generator network of the neural network model, and outputting to obtain a noise reduction signal set
h) Aggregating noise reduction signalsThe noise reduction signal is input to a discriminator, and the discriminator is used to determine the probability that the noise reduction signal is from a clean signal.
By fusing the coordinate attention modules (Coordinate attention, CA) in the encoder, embedding the location information into the channel attention, the expressive power of the network learning features is effectively enhanced. The invention provides a new self-supervision learning module, which consists of a reconstruction prediction module and an improved twin network, wherein electrocardiosignals divided into a plurality of sections of different patches are used as input by the module, and the front half part of the patch is used for predicting the rear half part of the patch by utilizing the strong correlation among local signals in the patch, so that the self-supervision learning in the patch is realized. The self-supervision learning capability of the reconstruction prediction module is utilized to combine the reconstruction prediction module with a twin network, and the twin network is used to compare the electrocardiosignals predicted through self-supervision learning with the actually reconstructed electrocardiosignals, so that the generator can better grasp the local key characteristics of the electrocardiosignals, and the denoising of the signals is facilitated.
Example 1:
the WFDB library in python is used in step a) to read N pieces of electrocardiographic signal data in the MIT-BIH arrhythmia database, n=48, l=512, m=400.
Example 2:
by the formulaCalculating to obtain normalized electrocardiosignal Normaized(s) of ith signal point in jth segment i ),
Example 3:
in step b), l×m is less than or equal to 650000, in step d), x=0, y=1.25, and z=5.
Example 4:
in step e), a=8, b=1, c=1. The training set fragment number is 15360, and the sample numbers of the verification set and the test set are 1920.
Example 5:
step g) comprises the steps of:
g-1) the generator network is sequentially composed of an encoder, a decoder and a self-supervision learning module.
g-2) the encoder is composed of a first convolution block, a second convolution block, a third convolution block, a first coordinate attention module, a fourth convolution block, a fifth convolution block, a sixth convolution block, a second coordinate attention module and a seventh convolution block in sequence. The encoder network structure is that two coordinate attention modules are added on the basis of the traditional convolution network, so that the network can better capture information on the horizontal and vertical characteristics, and the characteristic extraction capacity of the encoder network is improved.
g-3) training set X train ={x 1 ,x 2 ,...,x i ,...,x Q },x i For the ith noisy electrocardiosignal in the training set, i e {1, 2., Q }, Q is training set X train The total number of the electrocardiosignals containing noise,the ith noisy electrocardiosignal x i Sequentially inputting the features into a first convolution block to obtain a feature F1, inputting the feature F1 into a second convolution block to obtain a feature F2, inputting the feature F2 into a third convolution block to obtain a feature F3, inputting the feature F3 into a first coordinate attention module to obtain a refined feature F4, inputting the refined feature F4 into a fourth convolution block to obtain a feature F5, inputting the feature F5 into a fifth convolution block to obtain a feature F6, inputting the feature F6 into a sixth convolution block to obtain a feature F7, inputting the feature F7 into the second coordinate attention module to obtain a refined feature F8, and inputting the refined feature F8 into a seventh convolution block to obtain a potential feature F9.
g-4) in order to decode out the potential representation of the signal, we send the potential representation obtained by the encoder to the decoder, which corresponds to the number of encoders. In addition, we introduce a jump connection between the convolution layer and the deconvolution layer, which effectively avoids the gradient vanishing problem. Specifically, the decoder sequentially comprises a first deconvolution block, a second deconvolution block, a third deconvolution block, a fourth deconvolution block, a fifth deconvolution block, a sixth deconvolution block and a seventh deconvolution block.
g-5) inputting the potential feature F9 into the first deconvolution block to obtain a feature F10, splicing the feature F10 and the refined feature F8, inputting the spliced feature F10 and the refined feature F8 into the second deconvolution block to obtain a feature F11, splicing the feature F11 and the feature F6, inputting the spliced feature F11 and the spliced feature F6 into the third deconvolution block to obtain a feature F12, splicing the spliced feature F12 and the spliced feature F5 into the fourth deconvolution blockThe method comprises the steps of obtaining a feature F13, splicing the feature F13 and a refined feature F4, inputting the spliced feature F13 and the refined feature F4 into a fifth deconvolution block to obtain a feature F14, splicing the feature F14 and the feature F2, inputting the spliced feature F14 and the spliced feature F2 into a sixth deconvolution block to obtain a feature F15, splicing the feature F15 and the spliced feature F1, and inputting the spliced feature F15 and the spliced feature F1 into a seventh deconvolution block to obtain an ith noise reduction signalg-6) combining the Q noise reduction signals into a noise reduction signal set
Example 6:
the first convolution block is sequentially composed of a convolution layer with the convolution kernel size of 1 multiplied by 31, the step length of 1 and filling (0, 15), a BatchNorm2d layer and a ReLU activation function layer; the second convolution block is sequentially composed of a convolution kernel with the size of 2 multiplied by 31, the step length of 2, filling (1, 15), a BatchNorm2d layer and a ReLU activation function layer; the third convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fourth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fifth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the sixth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the seventh convolution block sequentially consists of a convolution kernel with the size of 2 multiplied by 31, the step length of 2, filling of (1, 15) and BatchNorm2d layers, and the first deconvolution block, the second deconvolution block, the third deconvolution block, the fourth deconvolution block, the fifth deconvolution block and the sixth deconvolution block sequentially consist of a deconvolution layer with the size of 1 multiplied by 32, the step length of 2, filling of (0, 15), the BatchNorm2d layers and a ReLU activation function layer; the seventh deconvolution block consists of deconvolution layer with convolution kernel size of 1×31, step size of 1, and padding of (0, 15), batchnorm2d layer, and ReLU activation function layer.
Example 7:
further comprising the following steps performed after step g-6):
g-7) energy for enhancing local characteristics within a signal of interest to a networkThe self-monitoring learning module consists of a reconstruction prediction module and an improved twin network, wherein the reconstruction prediction module sequentially consists of a convolution layer with the convolution kernel size of 3 multiplied by 3, the channel number of 1 and filling (1, 1), a BatchNorm2d layer and a ReLU activation function layer. The module takes electrocardiosignals divided into a plurality of sections of different patches as input, and utilizes strong correlation among local signals in the patches to predict the latter half of the patch by the former half of the patch so as to realize self-supervision learning in the patch. The improved twin network is sequentially composed of a convolution neural network with a convolution kernel size of 1 multiplied by 1, a convolution layer with a convolution kernel size of 3 multiplied by 3, a squeze-and-Excitation Networks (SENet) network and a Linear layer. The convolutional neural network of 1×1 amplifies the channel number by 4 times, which leads to better interaction between features. A convolution layer with a convolution kernel size of 3 x 3 is provided to increase the depth of the network. The important feature extraction capability of the network is enhanced by introducing a attentive mechanism through the SENet network. The features are stretched and then passed through the Linear layer to obtain the predicted value. By ensuring reconstruction of the signalAnd the second half->The obtained predicted values are as close as possible to ensure the effectiveness of our reconstructed prediction network.
g-8) applying the ith noise reduction signalThe length L noise reduction signal of each segment is re-divided into L/len segments according to the number len of sampling points, preferably len=32, and the noise reduction signal after division is +.>Represented as For the ith noise reduction signal->J= {1,2,..l/len };
g-10) front halfInputting the reconstructed prediction module to obtain the second half part +.>Is the predicted output of (2)
g-12) outputting the predictionAnd the second half->Respectively input into the improved twin network to respectively obtain different spatial representations, and the prediction output is utilized>And the second half->Lost distance betweenThe similarity degree of different spatial representations is evaluated, the smaller the obtained loss value is, the more similar the two are represented, and then the loss is fed back to the coder and decoder, so that the noise reduction performance of the coder and decoder is improved. Specifically, by the formula->Calculating to obtain the distance Loss 1 In the formula, I.I 2 Is the L2 norm and g (·) is the modified twin network.
Example 8:
step h) comprises the steps of:
h-1) the discriminator is composed of a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a full connection layer and a Sigmoid activation function layer in sequence, wherein the first convolution module, the second convolution module and the third convolution module are composed of a convolution kernel with the size of 1 multiplied by 16, a step length of 4, a convolution layer filled with (0, 6), a Batch Norm layer and a leakyReLU activation function layer in sequence, the convolution kernel of the fourth convolution layer is 1 multiplied by 15, the step length of 1, the filling is (0, 7) and the channel number of 1;
h-2) applying the ith noise reduction signalInputting the feature d1 into a first convolution module to obtain a feature d1, inputting the feature d1 into a second convolution module to obtain a feature d2, inputting the feature d2 into a third convolution module to obtain a feature d3, inputting the feature d3 into a fourth convolution module to obtain a feature d4, inputting the feature d4 into a fully connected layer, mapping the learned feature into a unit t, inputting the unit t into a Sigmoid activation function layer, and mapping the unit t into [0,1 ]]Between by the formulaCalculating to obtain the i noise reduction signal +.>Probability from clean signal->Where e is a natural constant.
Example 9:
the method also comprises the following steps:
i-1) by the formulaCalculating Loss function Loss of encoder and decoder 2 Wherein, lambda and beta are balance factors, lambda=0.2, beta=0.7, D (·) is the discriminator to judge the ith noise reduction signal +.>Electrocardiosignals +.>Probability of being from noisy signal instead of original clean signal,/->Is the electrocardiosignal of the kth signal point in the ith clean segment.
i-2) is calculated by the formula Loss G =Loss 2 +γLoss 1 Calculating to obtain the total Loss function Loss of the generator G Wherein γ is a balance factor, and γ=0.1.
i-3) by the formulaCalculating a Loss function Loss of the discriminator D Wherein D(s) i k ) Judging electrocardiosignals of kth signal point in ith clean segment for discriminator +.>Probability from the original clean signal.
i-4) Total Loss function Loss through generator Using Adam optimizer G Training generator, loss function Loss through discriminator D Training discriminators, initial learning rate is set to beThe batch size is 32, the iteration times are 100, in each iteration, the generator is trained for three times and the discriminator is trained for one time, the learning rate of the generator is updated to be 0.5 times of the original learning rate every 30 times, the learning rate of the discriminator is updated to be 0.5 times of the original learning rate every 40 times, and after the training is completed, the verification set X is obtained val Inputting the model into a neural network to select an optimal neural network model.
i-5) test set X test Inputting into the generator network of the optimal neural network model, and outputting to obtain a noise reduction signal set
Finally, it should be noted that: the foregoing description is only a preferred embodiment of the present invention, and the present invention is not limited thereto, but it is to be understood that modifications and equivalents of some of the technical features described in the foregoing embodiments may be made by those skilled in the art, although the present invention has been described in detail with reference to the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. A method for reducing noise of a resistant electrocardiosignal based on self-supervision learning and a twin network is characterized by comprising the following steps:
a) Reading N pieces of electrocardiosignal data in an MIT-BIH arrhythmia database, and intercepting M pieces of which the length is L on a first channel of each signal, wherein the j pieces are An electrocardiosignal for the ith signal point in the jth segment;
b) Selecting three types of noise BW, MA and EM from an MIT-BIH noise pressure database, and intercepting M fragments with the length L on a first channel of the BW, MA and EM noise respectively;
c) Respectively carrying out normalization processing on the intercepted electrocardiosignal data and noise;
d) Adding Xdb, ydb, zdb noise intensities to BW, MA and EM three types of noise of the M fragments with the length of L respectively, and randomly adding the BW, MA and EM three types of noise of the M fragments with the length of L to normalized electrocardiosignal data to form a noisy electrocardiosignal;
e) Dividing the electrocardiosignal containing noise into a training set X according to the proportion of A to B to C train Verification set X val Test set X test ;
f) Establishing a neural network model, wherein the neural network model is composed of a generator network and a discriminator network;
g) Training set X train Inputting into a generator network of the neural network model, and outputting to obtain a noise reduction signal set
h) Aggregating noise reduction signalsInputting the noise reduction signals into a discriminator, and judging the probability of the noise reduction signals from clean signals by using the discriminator;
step g) comprises the steps of:
g-1) the generator network is sequentially composed of an encoder, a decoder and a self-supervision learning module;
g-2) the encoder is sequentially composed of a first convolution block, a second convolution block, a third convolution block, a first coordinate attention module, a fourth convolution block, a fifth convolution block, a sixth convolution block, a second coordinate attention module and a seventh convolution block;
g-3) training set X train ={x 1 ,x 2 ,...,x i ,...,x Q },x i Is the ith bar in training setNoisy electrocardiosignals, i e {1, 2.,. Q }, Q being training set X train The total number of the electrocardiosignals containing noise,the ith noisy electrocardiosignal x i Sequentially inputting the features into a first convolution block to obtain a feature F1, inputting the feature F1 into a second convolution block to obtain a feature F2, inputting the feature F2 into a third convolution block to obtain a feature F3, inputting the feature F3 into a first coordinate attention module to obtain a refined feature F4, inputting the refined feature F4 into a fourth convolution block to obtain a feature F5, inputting the feature F5 into a fifth convolution block to obtain a feature F6, inputting the feature F6 into a sixth convolution block to obtain a feature F7, inputting the feature F7 into the second coordinate attention module to obtain a refined feature F8, and inputting the refined feature F8 into a seventh convolution block to obtain a potential feature F9;
g-4) the decoder is sequentially composed of a first deconvolution block, a second deconvolution block, a third deconvolution block, a fourth deconvolution block, a fifth deconvolution block, a sixth deconvolution block and a seventh deconvolution block;
g-5) inputting the potential feature F9 into the first deconvolution block to obtain a feature F10, splicing the feature F10 with the refined feature F8, inputting the spliced feature F10 into the second deconvolution block to obtain a feature F11, splicing the spliced feature F11 with the feature F6, inputting the spliced feature F12 into the third deconvolution block to obtain a feature F12, splicing the spliced feature F12 with the feature F5, inputting the spliced feature F13 into the fourth deconvolution block to obtain a feature F13, splicing the spliced feature F13 with the refined feature F4, inputting the spliced feature F13 into the fifth deconvolution block to obtain a feature F14, splicing the spliced feature F14 with the refined feature F2 into the sixth deconvolution block to obtain a feature F15, splicing the spliced feature F15 with the feature F1 into the seventh deconvolution block to obtain an i-th noise reduction signal
g-7) establishing a self-supervision learning module, wherein the self-supervision learning module consists of a reconstruction prediction module and an improved twin network, the reconstruction prediction module sequentially consists of a convolution layer with the size of 3 multiplied by 3, the number of channels of 1, a convolution layer filled with (1, 1), a BatchNorm2d layer and a ReLU activation function layer, and the improved twin network sequentially consists of a convolution neural network with the size of 1 multiplied by 1, a convolution layer with the size of 3 multiplied by 3, a SENet network and a Linear layer;
g-8) applying the ith noise reduction signalThe noise reduction signals with the length L are re-divided into L/len sections according to the sampling points with the number len, and the noise reduction signals after division are +.>Denoted as-> For the ith noise reduction signal->J= {1,2,..l/len };
g-10) front halfInputting the reconstructed prediction module to obtain the second half part +.>Prediction output of +.>
g-12) outputting the predictionAnd the second half->Respectively input into the improved twin network to respectively obtain different spatial expressions, and the spatial expressions are expressed by the formula +.>Calculating to obtain the distance Loss 1 In the formula, I.I 2 Is the L2 norm and g (·) is the modified twin network.
2. The method for reducing noise of the resistant electrocardiosignals based on self-supervised learning and a twin network as claimed in claim 1, wherein the method comprises the following steps: the WFDB library in python is used in step a) to read N pieces of electrocardiographic signal data in the MIT-BIH arrhythmia database, n=48, l=512, m=400.
3. The method for reducing noise of the resistant electrocardiosignals based on self-supervised learning and a twin network as claimed in claim 2, wherein the method comprises the following steps: in step b), l×m is less than or equal to 650000, in step d), x=0, y=1.25, and z=5.
4. The method for reducing noise of the resistant electrocardiosignals based on self-supervised learning and a twin network as claimed in claim 1, wherein the method comprises the following steps: in step e), a=8, b=1, c=1.
5. The method for reducing noise of the resistant electrocardiosignals based on self-supervised learning and a twin network as claimed in claim 1, wherein the method comprises the following steps: the first convolution block is sequentially composed of a convolution layer with the convolution kernel size of 1 multiplied by 31, the step length of 1 and filling (0, 15), a BatchNorm2d layer and a ReLU activation function layer; the second convolution block is sequentially composed of a convolution kernel with the size of 2 multiplied by 31, the step length of 2, filling (1, 15), a BatchNorm2d layer and a ReLU activation function layer; the third convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fourth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the fifth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the sixth convolution block is sequentially formed by filling (1, 15) layers and BatchNorm2d layers with the convolution kernel size of 2 multiplied by 31 and the step length of 2; the seventh convolution block sequentially consists of a convolution kernel with the size of 2 multiplied by 31, the step length of 2, filling of (1, 15) and BatchNorm2d layers, and the first deconvolution block, the second deconvolution block, the third deconvolution block, the fourth deconvolution block, the fifth deconvolution block and the sixth deconvolution block sequentially consist of a deconvolution layer with the size of 1 multiplied by 32, the step length of 2, filling of (0, 15), the BatchNorm2d layers and a ReLU activation function layer; the seventh deconvolution block consists of deconvolution layer with convolution kernel size of 1×31, step size of 1, and padding of (0, 15), batchnorm2d layer, and ReLU activation function layer.
6. The method for noise reduction of resistant electrocardiosignals based on self-supervised learning and twin networks as claimed in claim 1, wherein the step h) comprises the steps of:
h-1) the discriminator is composed of a first convolution module, a second convolution module, a third convolution module, a fourth convolution module, a full connection layer and a Sigmoid activation function layer in sequence, wherein the first convolution module, the second convolution module and the third convolution module are composed of a convolution kernel with the size of 1 multiplied by 16, a step length of 4, a convolution layer filled with (0, 6), a Batch Norm layer and a leakyReLU activation function layer in sequence, the convolution kernel of the fourth convolution layer is 1 multiplied by 15, the step length of 1, the filling is (0, 7) and the channel number of 1;
h-2) applying the ith noise reduction signalInputting the feature d1 into a first convolution module to obtain a feature d1, inputting the feature d1 into a second convolution module to obtain a feature d2, inputting the feature d2 into a third convolution module to obtain a feature d3, inputting the feature d3 into a fourth convolution module to obtain a feature d4, inputting the feature d4 into a fully connected layer, mapping the learned feature into a unit t, inputting the unit t into a Sigmoid activation function layer, and mapping the unit t into [0,1 ]]Between by the formulaCalculating to obtain the i noise reduction signal +.>Probability from clean signal->Where e is a natural constant.
7. The method for noise reduction of resistant electrocardiosignals based on self-supervised learning and twinning networks as recited in claim 1, further comprising the steps of:
i-1) by the formulaCalculating Loss function Loss of encoder and decoder 2 Wherein, lambda and beta are balance factors, lambda=0.2, beta=0.7, D (·) is the discriminator to judge the ith noise reduction signal +.>Electrocardiosignals +.>Probability of being from noisy signal instead of original clean signal,/->Electrocardiosignals of the kth signal point in the ith clean segment are obtained;
i-2) is calculated by the formula Loss G =Loss 2 +γLoss 1 Calculating to obtain the total Loss function Loss of the generator G Wherein γ is a balance factor, γ=0.1;
i-3) by the formulaCalculating a Loss function Loss of the discriminator D In the formula->Judging electrocardiosignals of kth signal point in ith clean segment for discriminator +.>Probability from the original clean signal;
i-4) Total Loss function Loss through generator Using Adam optimizer G Training generator, loss function Loss through discriminator D Training the discriminator, wherein the initial learning rate is set to be 0.001, the batch size is set to be 32, the iteration number is 100, in each iteration, the generator is trained three times first and then the discriminator is trained once, the learning rate of the generator is updated to be 0.5 times of the original learning rate every 30 times, the learning rate of the discriminator is updated to be 0.5 times of the original learning rate every 40 times, and the verification set X is obtained after the training is completed val Inputting the model into a neural network to select an optimal neural network model;
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211161910.9A CN115470827B (en) | 2022-09-23 | 2022-09-23 | Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211161910.9A CN115470827B (en) | 2022-09-23 | 2022-09-23 | Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115470827A CN115470827A (en) | 2022-12-13 |
CN115470827B true CN115470827B (en) | 2023-06-20 |
Family
ID=84336046
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211161910.9A Active CN115470827B (en) | 2022-09-23 | 2022-09-23 | Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115470827B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116186593B (en) * | 2023-03-10 | 2023-10-03 | 山东省人工智能研究院 | Electrocardiosignal detection method based on separable convolution and attention mechanism |
CN116383649B (en) * | 2023-04-03 | 2024-01-23 | 山东省人工智能研究院 | Electrocardiosignal enhancement method based on novel generation countermeasure network |
CN116458897B (en) * | 2023-04-18 | 2024-01-26 | 山东省人工智能研究院 | Electrocardiosignal quality assessment method based on two-dimensional image and attention mechanism |
CN116584951B (en) * | 2023-04-23 | 2023-12-12 | 山东省人工智能研究院 | Electrocardiosignal detection and positioning method based on weak supervision learning |
CN117727053B (en) * | 2024-02-08 | 2024-04-19 | 西南科技大学 | Multi-category Chinese character single sample font identification method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020003533A1 (en) * | 2018-06-29 | 2020-01-02 | Nec Corporation | Pattern recognition apparatus, pattern recognition method, and computer-readable recording medium |
CN110942001A (en) * | 2019-11-14 | 2020-03-31 | 五邑大学 | Method, device, equipment and storage medium for identifying finger vein data after expansion |
CN112435221A (en) * | 2020-11-10 | 2021-03-02 | 东南大学 | Image anomaly detection method based on generative confrontation network model |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190228313A1 (en) * | 2018-01-23 | 2019-07-25 | Insurance Services Office, Inc. | Computer Vision Systems and Methods for Unsupervised Representation Learning by Sorting Sequences |
WO2021167020A1 (en) * | 2020-02-21 | 2021-08-26 | 学校法人慶應義塾 | Signal restoration system, signal restoration method, program, and signal generation system using ai |
CN111814656B (en) * | 2020-07-02 | 2021-05-04 | 山东省人工智能研究院 | Electrocardiosignal noise reduction method based on countermeasure generation network |
US20230363655A1 (en) * | 2020-09-30 | 2023-11-16 | Queen's University At Kingston | Method and Apparatus for Generating an Electrocardiogram from a Photoplethysmogram |
CN112487914B (en) * | 2020-11-25 | 2021-08-31 | 山东省人工智能研究院 | ECG noise reduction method based on deep convolution generation countermeasure network |
CN113935378A (en) * | 2021-10-14 | 2022-01-14 | 山东省人工智能研究院 | ECG noise reduction method based on antagonistic depth full convolution network |
CN114067177B (en) * | 2021-11-18 | 2022-09-20 | 中国人民解放军国防科技大学 | Remote sensing image classification network robustness improving method based on self-supervision learning |
CN114494489A (en) * | 2022-01-05 | 2022-05-13 | 电子科技大学长三角研究院(衢州) | Self-supervision attribute controllable image generation method based on depth twin network |
CN114676777A (en) * | 2022-03-25 | 2022-06-28 | 中国科学院软件研究所 | Self-supervision learning fine-grained image classification method based on twin network |
CN114648048B (en) * | 2022-04-01 | 2022-10-25 | 山东省人工智能研究院 | Electrocardiosignal noise reduction method based on variational self-coding and PixelCNN model |
-
2022
- 2022-09-23 CN CN202211161910.9A patent/CN115470827B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020003533A1 (en) * | 2018-06-29 | 2020-01-02 | Nec Corporation | Pattern recognition apparatus, pattern recognition method, and computer-readable recording medium |
CN110942001A (en) * | 2019-11-14 | 2020-03-31 | 五邑大学 | Method, device, equipment and storage medium for identifying finger vein data after expansion |
CN112435221A (en) * | 2020-11-10 | 2021-03-02 | 东南大学 | Image anomaly detection method based on generative confrontation network model |
Non-Patent Citations (2)
Title |
---|
Self-Supervised CycleGAN for Object-Preserving Image-to-Image Domain Adaptation;Xie, X., Chen, J., Li, Y., Shen, L., Ma, K., Zheng, Y.;《ECCV 2020: Computer Vision – ECCV 2020》;第498–513页 * |
基于双层生成对抗网络的素描人脸合成方法;李凯旋等;《计算机应用与软件》;第36卷(第12期);第176-183页 * |
Also Published As
Publication number | Publication date |
---|---|
CN115470827A (en) | 2022-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115470827B (en) | Self-supervision learning and twin network-based noise reduction method for resistant electrocardiosignals | |
CN110136731B (en) | Cavity causal convolution generation confrontation network end-to-end bone conduction voice blind enhancement method | |
CN110071913B (en) | Unsupervised learning-based time series anomaly detection method | |
CN112052763B (en) | Video abnormal event detection method based on two-way review generation countermeasure network | |
CN112818892A (en) | Multi-modal depression detection method and system based on time convolution neural network | |
CN110522444B (en) | Electrocardiosignal identification and classification method based on Kernel-CNN | |
CN111460956A (en) | Unbalanced electrocardiogram sample classification method based on data enhancement and loss weighting | |
CN115602152B (en) | Voice enhancement method based on multi-stage attention network | |
CN113160190A (en) | Method, equipment, device and storage medium for detecting abnormity of fastener of contact network | |
CN112434891A (en) | Method for predicting solar irradiance time sequence based on WCNN-ALSTM | |
Cheuk et al. | Revisiting the onsets and frames model with additive attention | |
CN113328755A (en) | Compressed data transmission method facing edge calculation | |
CN114224288B (en) | Microcapsule neural network training method and equipment for detecting epileptic brain electrical signals | |
CN115146700A (en) | Runoff prediction method based on Transformer sequence-to-sequence model | |
CN115054270A (en) | Sleep staging method and system for extracting sleep spectrogram features based on GCN | |
CN115177262A (en) | Heart sound and electrocardiogram combined diagnosis device and system based on deep learning | |
CN114882992B (en) | Multi-site functional magnetic resonance imaging heterogeneity removing method for predicting diseases | |
CN116561569A (en) | Industrial power load identification method based on EO feature selection and AdaBoost algorithm | |
CN113288050B (en) | Multidimensional enhanced epileptic seizure prediction system based on graph convolution network | |
CN116521863A (en) | Tag anti-noise text classification method based on semi-supervised learning | |
CN115795360A (en) | Cable fault detection method based on artificial neural network | |
CN114997303A (en) | Bladder cancer metabolic marker screening method and system based on deep learning | |
Gagneré et al. | Adapting Pitch-Based Self Supervised Learning Models for Tempo Estimation | |
CN116509414B (en) | Electrocardiosignal denoising classification system and method | |
CN112085718B (en) | NAFLD ultrasonic video diagnosis system based on twin attention network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |