CN114004258A - Semi-supervised electrocardio abnormality detection method - Google Patents
Semi-supervised electrocardio abnormality detection method Download PDFInfo
- Publication number
- CN114004258A CN114004258A CN202111293464.2A CN202111293464A CN114004258A CN 114004258 A CN114004258 A CN 114004258A CN 202111293464 A CN202111293464 A CN 202111293464A CN 114004258 A CN114004258 A CN 114004258A
- Authority
- CN
- China
- Prior art keywords
- electrocardio
- discriminator
- generator
- data
- samples
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 39
- 230000005856 abnormality Effects 0.000 title claims abstract description 20
- 238000012549 training Methods 0.000 claims abstract description 44
- 238000000034 method Methods 0.000 claims abstract description 36
- 230000002159 abnormal effect Effects 0.000 claims abstract description 23
- 230000009466 transformation Effects 0.000 claims abstract description 9
- 239000000284 extract Substances 0.000 claims abstract description 4
- 230000009467 reduction Effects 0.000 claims abstract description 4
- 230000000747 cardiac effect Effects 0.000 claims description 13
- 238000000354 decomposition reaction Methods 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 claims description 8
- 230000003993 interaction Effects 0.000 claims description 3
- 230000006870 function Effects 0.000 description 8
- 238000013528 artificial neural network Methods 0.000 description 7
- 230000003042 antagnostic effect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000002547 anomalous effect Effects 0.000 description 2
- 230000002457 bidirectional effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 241000212376 Ammi Species 0.000 description 1
- 235000007034 Carum copticum Nutrition 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000008033 biological extinction Effects 0.000 description 1
- 238000007635 classification algorithm Methods 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 238000003064 k means clustering Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/02—Preprocessing
- G06F2218/04—Denoising
- G06F2218/06—Denoising by applying a scale-space analysis, e.g. using wavelet analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- 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/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- 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/084—Backpropagation, e.g. using gradient descent
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/08—Feature extraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2218/00—Aspects of pattern recognition specially adapted for signal processing
- G06F2218/12—Classification; Matching
Abstract
The invention discloses a semi-supervised electrocardio abnormality detection method, which comprises the following steps: carrying out noise reduction on the electrocardiosignals by using wavelet threshold transformation, then randomly selecting a plurality of normal electrocardio data as a training set, and then randomly selecting a plurality of normal electrocardio data and abnormal electrocardio data for a threshold value optimizing data set; constructing an AD-ECGGAN network model, wherein the AD-ECGGAN network model comprises a generator and a discriminator; a fixed generator, which extracts n real electrocardio samples from the training set, generates n false electrocardio samples by using defined noise distribution in the generator, and trains a discriminator through the real electrocardio samples and the false electrocardio samples; the AD-ECGGAN model for detecting the electrocardio abnormality improves the network structure for generating the countermeasure network, and provides a new training method, so that the AD-ECGGAN model can train a classifier for detecting the electrocardio signal abnormality under the condition of lacking abnormal electrocardio samples, a professional doctor does not need to label abnormal data, and the labor and time cost is greatly saved.
Description
Technical Field
The invention relates to the technical field of intelligent medical treatment and health, in particular to a semi-supervised electrocardiogram abnormity detection method based on generation of an antagonistic network.
Background
The measurement of electrocardiograms plays an important auxiliary role in modern diagnostics. The development of artificial intelligence greatly improves the accuracy of electrocardiosignal classification and abnormity detection. However, most of the existing detection methods belong to supervised learning. Supervised learning relies on a large number of accurately labeled data sets. When analyzing medical signals such as electrocardio, the collected samples need to be labeled by a professional doctor, and the process consumes a great deal of time and labor cost. Moreover, the electrocardiosignals are used as medical data, and have privacy and sensitivity. Therefore, a large number of accurately labeled electrocardiographic data sets are often difficult to obtain. In addition, the number of positive samples is much larger than that of negative samples in the medical data, and the unbalanced data distribution also affects the accuracy of classification and abnormality detection. Due to the reasons, the conventional supervised electrocardio abnormality detection method is difficult to effectively fall on the ground.
Anomalies in data refer to one or a series of observations that deviate significantly from the overall distribution of the data. Whether anomaly detection is labeled from a data set can be classified into supervised learning, semi-supervised learning, and unsupervised learning. Supervised learning requires a large number of labeled data sets and overfitting to a training set is easily caused, so that the generalization capability of a model is not strong, the current accuracy of unsupervised learning is not ideal, and semi-supervised learning which only requires positive samples but does not require negative samples is particularly suitable for medical data. Anomaly detection can be methodically classified as statistical learning-based, classical machine learning-based, and neural network-based (deep learning). The statistical learning-based method comprises template matching, a moving average method, an exponential smoothing method, setting of a predetermined confidence interval and the like. The methods based on classical machine learning include K-means clustering, density-based clustering, local abnormal factor method, forest isolation, single-class support vector machine, extreme gradient lifting and the like. The neural network-based convolutional neural network, residual neural network, wavelet network, LSTM network, automatic encoder and the like. The above methods can be generalized to statistics, regression, clustering and reconstruction.
With the development of deep neural networks, methods of anomaly detection by neural networks are increasingly used. The initial detection method using neural networks is to learn normal data and then use a classification algorithm to distinguish normal data from abnormal data. The method based on the encoder and the decoder has good effect in the methods, and the idea is to use normal data to learn an encoding-decoding model, so that the model can reconstruct the normal data and cannot reconstruct abnormal data. However, this method is very susceptible to noise and requires various constraints to be imposed on the model. One idea of anomaly detection is to consider positive samples as one class and negative samples as one class, and perform two classifications. The practical situation is that the positive samples are easy to obtain in large quantity, and the negative samples are difficult to obtain.
Disclosure of Invention
The invention aims to provide a semi-supervised electrocardio abnormality detection method, which trains an electrocardio abnormality detection model under the condition of only possessing normal electrocardio samples, has higher model detection efficiency than a supervised model, and can feed back results in real time.
In order to achieve the purpose, the technical scheme of the application is as follows: a semi-supervised cardiac electrical anomaly detection method comprises the following steps:
step 1: carrying out noise reduction on the electrocardiosignals by using wavelet threshold transformation, then randomly selecting a plurality of normal electrocardio data as a training set, and then randomly selecting a plurality of normal electrocardio data and abnormal electrocardio data for a threshold value optimizing data set;
step 2: an AD-ECGGAN network model (an electrocardio anomaly detection countermeasure network model) is constructed, and the AD-ECGGAN network model comprises a generator and a discriminator;
and step 3: a fixed generator, which extracts n real electrocardio samples from the training set, generates n false electrocardio samples by using defined noise distribution in the generator, and trains a discriminator through the real electrocardio samples and the false electrocardio samples; setting a discriminator for updating k times in each cycle, and updating the generator for 1 time in one cycle; the loss of the generator and the arbiter and the accuracy of the arbiter are printed at each round;
and 4, step 4: judging whether the network is converged or not according to the loss of the generator and the discriminator and the accuracy of the discriminator, and if yes, turning to the step 5; if not, continuing the countermeasure training of the step 3;
and 5: stopping training the generator, continuing to train the discriminator by using the abnormal electrocardiogram data generated by the generator and the real electrocardiogram data in the training set until the accuracy is not improved any more, and storing the discriminator model at the moment;
step 6: calling the stored discriminator model, and finding out an optimal threshold value theta in a threshold value interval of [0.4-0.6] by using the threshold value optimizing data set;
and 7: and carrying out electrocardio abnormality detection by using the discriminator model and the optimal threshold value theta.
Further, denoising the electrocardiosignal by using wavelet threshold transformation, which is specifically as follows:
inputting the electrocardiosignals into a wavelet function to carry out multi-scale decomposition; and after wavelet coefficients of all scales are obtained, threshold decomposition is carried out, and then the electrocardiosignals are reconstructed through inverse transformation.
Further, the threshold decomposition rule is a fixed threshold method:
the wavelet function selects a soft threshold estimation method, and the formula is as follows:
wherein, N is the length value of each layer of wavelet high-frequency coefficient; λ is a threshold; and w is a high-frequency wavelet coefficient.
Further, the objective function expression of the AD-ECGGAN network model is as follows:
where G denotes a generator, D denotes a discriminator, and z denotes random noise.
Further, a modified BILSTM layer is added to the generator, and a small-batch discriminator layer is added to the discriminator.
Furthermore, the improved BILSTM layer is implemented as follows:
kt=f(w1xt+w2kt-1)
k′t=f(w3xt+w5k′t+1)
ot=g(w4kt+w6k′t)
wherein x istRepresenting the current input, ktRepresents the current output, k, in forward propagationt-1Represents the output of the previous time in forward propagation, k'tRepresents the current output, k ', in backward propagation't+1Representing the output of the latter time in backward propagation, otRepresents the final output, w1-w6Is the weight of the threshold unit; calculating from the moment 1 to the moment t during forward propagation to obtain the forward output of each moment; during backward propagation, backward calculation is carried out from the moment t to the moment 1, and backward output of each moment is obtained; and combining the calculation results of the forward layer and the backward layer at the corresponding time at each time to obtain final output, so that the final output covers the information of the bidirectional input sequence.
Furthermore, the small batch discriminator layer obtains difference information between feature maps in a small batch of samples as additional output of a next layer in the discriminator, so as to achieve the purpose of information interaction between the samples, specifically:
wherein, sample xiThe feature vector of a layer in the discriminator isF (x)i) Multiplication by a tensorObtain the tensorThen, the L1 distance of the row vector of M between each sample is obtained to obtainThen all c are put togetherb(xi,xj) Add to obtain o (x)i)bB are o (x)i)bThe combination yields a vector o (x) of size Bi) (ii) a Finally, o (x)i) And f (x)i) And merging into a vector as the input of the next layer of the discriminator.
Further, the loss function of the generator and the arbiter is represented by the KL divergence (relative entropy) formula as follows:
wherein p (x) represents the distribution of the real electrocardiographic data, and q (x) generates the distribution of the electrocardiographic data.
As a further method for stopping the training generator, the method is to freeze the parameters of the generator, specifically: setting a flag to be 0 at the beginning of training, and updating the flag to be 1 after judging the network convergence; starting the anti-training of each pair of wheels, judging whether flag is 0, and if the flag is 0, carrying out the anti-training; if the value is 1, the generator parameters are frozen, and the discriminant continues to be trained.
As a further step, the optimal threshold θ is traversed between [0.4, 0.6], the output value of the discriminator model is set to o, o > θ represents that normal electrocardio is predicted, o < θ represents that abnormal electrocardio is predicted, and in order to find θ with the highest accuracy, the calculation formula is as follows:
wherein TP is true positive, which indicates that the classification prediction is correct and is judged to be positive; TN is true negative, which means that the classification prediction is correct and is judged as negative; FP is false positive, indicating that the classification prediction is wrong and is judged to be positive; FN is false negative, indicating that the classification prediction was wrong and was judged negative.
Due to the adoption of the technical scheme, the invention can obtain the following technical effects: the AD-ECGGAN model for detecting the electrocardio abnormality improves the network structure for generating the countermeasure network, and provides a new training method, so that the AD-ECGGAN model can train a classifier for detecting the electrocardio signal abnormality under the condition of lacking abnormal electrocardio samples, a professional doctor does not need to label abnormal data, and the labor and time cost is greatly saved. The accuracy of the proposed model reaches 94.33%, and the accuracy under AMMI classification reaches 96.61%. Moreover, because of the semi-supervised model, the model can detect any abnormal electrocardio, including rare and rarely recorded abnormal electrocardio. Compared with a supervised model, the model detection efficiency is higher, the real-time feedback result can be realized, and the method can be applied to wearable medical equipment such as single-lead and two-lead equipment. The effect of generating the electrocardio data through the improved network is obviously improved by the single-view generation capability. According to the training method, any existing confrontation network model can be simply changed by using the training method provided by the invention, so that the discriminator model has the capability of anomaly detection. In addition, the idea and the method of the invention can be simply migrated and popularized to the abnormality detection of other time series data, including but not limited to log abnormality detection, audio abnormality detection, video abnormality detection and the like.
Drawings
FIG. 1 is a flow chart of a semi-supervised method for detecting abnormal electrocardio-signals;
FIG. 2 is a diagram of an AD-ECGGAN network model architecture;
FIG. 3 is a schematic diagram of a BILSTM layer model;
FIG. 4 is a diagram of generation of a reactive network generator and arbiter training loss;
fig. 5 is a generated electrocardiogram.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to solve the technical problem of training an electrocardio abnormality detection model under the condition of only possessing a normal electrocardio sample, and provides an AD-ECGGAN network model, which comprises the following steps:
generating an antagonistic network through improvement for generating abnormal electrocardio samples;
a new method for judging Nash equilibrium and a new training method are provided, and a discriminator for generating an antagonistic network is used for anomaly detection;
the method specifically comprises the following steps:
step 1: carrying out noise reduction treatment on the electrocardiosignals by using wavelet threshold transformation, randomly selecting a plurality of normal electrocardio data as a training set from the treated data, and then randomly selecting a plurality of normal electrocardio data and abnormal electrocardio data for a threshold value optimizing data set;
specifically, the electrocardiosignals are input into a wavelet function for multi-scale decomposition; after wavelet coefficients of all scales are obtained, threshold decomposition is carried out, and then electrocardiosignals are reconstructed through inverse transformation;
the threshold decomposition rule is a fixed threshold method:
the wavelet function selects a soft threshold estimation method, and the formula is as follows:
wherein, N is the length value of each layer of wavelet high-frequency coefficient; λ is a threshold; and w is a high-frequency wavelet coefficient.
Step 2: constructing an AD-ECGGAN network model, wherein the AD-ECGGAN network model comprises a generator and a discriminator;
specifically, the AD-ECGGAN model is a new network model provided according to the characteristics of electrocardiosignals, improves the structures of a generator and a discriminator network, and provides a new training method;
the objective function expression of the AD-ECGGAN model is as follows:
where G denotes a generator, D denotes a discriminator, and z denotes random noise. The generator receives a random noise z, maximally fits random noise obeying certain simple distribution, makes the random noise obey the distribution of real data as much as possible, and generates a false electrocardio sample. The discriminator is responsible for judging whether the input data is real data, and gives the value of the real sample as large as possible and the value of the generated sample as small as possible. During training, the generator and the discriminator play games with each other, the false electrocardio samples generated by the generator are slowly close to real data, and the judgment capability of the discriminator is slowly enhanced. When the discriminator cannot determine whether the data is real data or distributed data, the generator has well learned the distribution rule of the real data, and the network is converged at the moment.
An improved BILSTM layer is added in the generator, so that the generator is more suitable for electrocardiosignals. A small batch of discriminator layers are added to the discriminator, and the training stability is effectively improved.
BILSTM is a special recurrent neural network, and a memory unit and a threshold control mechanism are added to relieve the problems of gradient extinction and gradient explosion of RNN in a long sequence input task. The BILSTM comprises an input layer, a forward LSTM layer, an inverse LSTM layer and an output layer. The improved BILSTM specific implementation method of the invention is as follows:
kt=f(w1xt+w2kt-1)
k′t=f(w3xt+w5k′t+1)
ot=g(w4kt+w6k′t)
wherein x istRepresenting the current input, ktRepresents the current output, k, in forward propagationt-1Represents the output of the previous time in forward propagation, k'tRepresents the current output, k ', in backward propagation't+1Representing the output of the latter time in backward propagation, otRepresents the final output, w1-w6Is the weight of the threshold unit. And calculating from the moment 1 to the moment t during forward propagation to obtain the forward output of each moment. And reversely calculating from the moment t to the moment 1 during backward propagation, and acquiring backward output of each moment. And combining the calculation results of the forward layer and the backward layer at the corresponding time at each time to obtain a final output, wherein the final output covers the information of the bidirectional input sequence.
The small-batch discriminator layer can effectively prevent mode collapse and improve the stability of training. The small-batch discriminator layer obtains the difference information between the characteristic graphs in a small-batch sample as the additional output of the next layer in the discriminator so as to achieve the purpose of information interaction among the samples.
Wherein, sample xiThe feature vector of a layer in the discriminator isF (x)i) Multiplication by a tensorObtain the tensorThen, the L1 distance of the row vector of M between each sample is calculated to obtainThen all c are put togetherb(xi,xj) Add to obtain o (x)i)bB are o (x)i)bThe combination yields a vector o (x) of size Bi). Finally, o (x)i) And f (x)i) And merging into a vector as the input of the next layer of the discriminator.
And step 3: a fixed generator, which extracts n real electrocardio samples from the training set, generates n false electrocardio samples by using defined noise distribution in the generator, and trains a discriminator through the real electrocardio samples and the false electrocardio samples; setting a discriminator for updating k times in each cycle, and updating the generator for 1 time in one cycle; the loss of the generator and the arbiter and the accuracy of the arbiter are printed at each round;
specifically, the AD-ECGGAN network model is trained through the countermeasure mode.
In the invention, the generator generates abnormal data in the process of generating electrocardio, and the discriminator distinguishes the boundary between the real normal data and the generated abnormal data. When the zero-sum game between the generators and the discriminators approaches nash equilibrium, the training of the generators is stopped (i.e. the parameters of the generators are frozen) and then the discriminators continue to be trained until the discriminator accuracy no longer improves. At the beginning of training, the generator cannot generate a sufficient amount of potentially anomalous data, and the discriminator can only separate the generated data from the real data by a rough boundary. After several iterations, the generator can generate more and more potential outlier data that appears inside or near the real data, at which point the discriminator can accurately describe the boundaries of the real data. The generator effectively improves the accuracy of the discriminator by generating potentially anomalous data.
And 4, step 4: judging whether the network is converged or not according to the loss of the generator and the discriminator and the accuracy of the discriminator, and if yes, turning to the step 5; if not, continuing the countermeasure training of the step 3;
specifically, the loss function of the generator and the discriminator is a KL divergence (relative entropy) formula as follows:
where p (x) represents the distribution of true electrocardiograms, and q (x) generates the distribution of electrocardiograms.
And judging whether the network converges or not, namely judging whether the confrontation game of the generator and the discriminator reaches Nash equilibrium or not, wherein the Nash equilibrium point of the zero sum game is 1/2. The specific method is to judge whether the accuracy of the discriminator is stabilized at 50 +/-0.2% in the last 5 rounds of training and whether the loss fluctuation of the generator and the discriminator is stabilized at +/-0.2%.
And 5: stopping training the generator, continuing to train the discriminator by using the abnormal electrocardiogram data generated by the generator and the real electrocardiogram data in the training set until the accuracy is not improved any more, and storing the discriminator model at the moment;
specifically, the method for stopping the training generator is to freeze parameters of the generator, specifically: and setting a flag to be 0 at the beginning of training, and updating the flag to be 1 after judging the convergence of the network. Starting the anti-training of each pair of wheels, judging whether flag is 0, and if the flag is 0, carrying out the anti-training; if the value is 1, the generator parameters are frozen, and the discriminant continues to be trained. Continuing to train the discriminators requires attention to stop immediately when accuracy is no longer increasing, rather than stopping when the discriminator loss is no longer decreasing, the purpose of this operation being to prevent overfitting.
Step 6: calling the stored discriminator model, and finding out an optimal threshold value theta in a threshold value interval of [0.4-0.6] by using the threshold value optimizing data set;
and 7: and carrying out electrocardio abnormality detection by using the discriminator model and the optimal threshold value theta.
Specifically, the optimal threshold θ is traversed between [0.4 and 0.6], the output value of the discriminator model is set as o, o > θ represents that normal electrocardio is predicted, o < θ represents that abnormal electrocardio is predicted, and in order to find θ with the highest accuracy, the calculation formula is as follows:
wherein TP is true positive, which indicates that the classification prediction is correct and is judged to be positive; TN is true negative, which means that the classification prediction is correct and is judged as negative; FP is false positive, indicating that the classification prediction is wrong and is judged to be positive; FN is false negative, indicating that the classification prediction was wrong and was judged negative.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, it should be noted that, for those skilled in the art, many modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A semi-supervised electrocardio abnormality detection method is characterized by comprising the following steps:
step 1: carrying out noise reduction on the electrocardiosignals by using wavelet threshold transformation, then randomly selecting a plurality of normal electrocardio data as a training set, and then randomly selecting a plurality of normal electrocardio data and abnormal electrocardio data for a threshold value optimizing data set;
step 2: constructing an AD-ECGGAN network model, wherein the AD-ECGGAN network model comprises a generator and a discriminator;
and step 3: a fixed generator, which extracts n real electrocardio samples from the training set, generates n false electrocardio samples by using defined noise distribution in the generator, and trains a discriminator through the real electrocardio samples and the false electrocardio samples; setting a discriminator for updating k times in each cycle, and updating the generator for 1 time in one cycle; the loss of the generator and the arbiter and the accuracy of the arbiter are printed at each round;
and 4, step 4: judging whether the network is converged or not according to the loss of the generator and the discriminator and the accuracy of the discriminator, and if yes, turning to the step 5; if not, continuing the countermeasure training of the step 3;
and 5: stopping training the generator, continuing to train the discriminator by using the abnormal electrocardiogram data generated by the generator and the real electrocardiogram data in the training set until the accuracy is not improved any more, and storing the discriminator model at the moment;
step 6: calling the stored discriminator model, and finding out an optimal threshold value theta in a threshold value interval of [0.4-0.6] by using the threshold value optimizing data set;
and 7: and carrying out electrocardio abnormality detection by using the discriminator model and the optimal threshold value theta.
2. The semi-supervised cardiac electrical anomaly detection method according to claim 1, wherein wavelet threshold transformation is used for denoising cardiac electrical signals, and the method specifically comprises the following steps:
inputting the electrocardiosignals into a wavelet function to carry out multi-scale decomposition; and after wavelet coefficients of all scales are obtained, threshold decomposition is carried out, and then the electrocardiosignals are reconstructed through inverse transformation.
3. The semi-supervised cardiac electrical anomaly detection method according to claim 2, wherein the threshold decomposition rule is a fixed threshold method:
the wavelet function selects a soft threshold estimation method, and the formula is as follows:
wherein, N is the length value of each layer of wavelet high-frequency coefficient; λ is a threshold; and w is a high-frequency wavelet coefficient.
5. The semi-supervised cardiac electrical anomaly detection method as recited in claim 1, wherein a modified BILSTM layer is added to the generator, and a small batch of arbiter layers is added to the arbiter.
6. The semi-supervised cardiac electrical anomaly detection method according to claim 5, wherein the improved BILSTM layer is implemented as follows:
kt=f(w1xt+w2kt-1)
k′t=f(w3xt+w5k′t+1)
ot=g(w4kt+w6k′t)
wherein x istRepresenting the current input, ktRepresents the current output, k, in forward propagationt-1Representing the output of the previous time in forward propagation,k′trepresents the current output, k ', in backward propagation't+1Representing the output of the latter time in backward propagation, otRepresents the final output, w1-w6Is the weight of the threshold unit; calculating from the moment 1 to the moment t during forward propagation to obtain the forward output of each moment; during backward propagation, backward calculation is carried out from the moment t to the moment 1, and backward output of each moment is obtained; and combining the calculation results of the forward layer and the backward layer at the corresponding time to obtain final output.
7. The semi-supervised cardiac electrical anomaly detection method according to claim 5, wherein the small batch discriminator layer obtains difference information between feature maps in a small batch of samples as additional output of a next layer in the discriminator to achieve the purpose of information interaction between samples, specifically:
wherein, sample xiThe feature vector of a layer in the discriminator isF (x)i) Multiplication by a tensorObtain the tensorThen obtaining each sampleThe L1 distance of the line vector of M is obtainedThen all c are put togetherb(xi,xj) Add to obtain o (x)i)bB are o (x)i)bThe combination yields a vector o (x) of size Bi) (ii) a Finally, o (x)i) And f (x)i) And merging into a vector as the input of the next layer of the discriminator.
8. The semi-supervised cardiac electrical anomaly detection method according to claim 1, wherein the loss function of the generator and the discriminator is KL divergence, and the formula is as follows:
wherein p (x) represents the distribution of the real electrocardiographic data, and q (x) generates the distribution of the electrocardiographic data.
9. The semi-supervised cardiac electrical anomaly detection method according to claim 1, wherein the method for stopping the training generator is to freeze parameters of the generator, and specifically comprises the following steps: setting a flag to be 0 at the beginning of training, and updating the flag to be 1 after judging the network convergence; starting the anti-training of each pair of wheels, judging whether flag is 0, and if the flag is 0, carrying out the anti-training; if the value is 1, the generator parameters are frozen, and the discriminant continues to be trained.
10. The semi-supervised cardiac electrical anomaly detection method according to claim 1, wherein the optimal threshold θ is traversed between [0.4 and 0.6], the output value of the discriminator model is set as o, o > θ represents that normal cardiac electrical is predicted, o < θ represents that abnormal cardiac electrical is predicted, and the calculation formula is as follows in order to find θ with the highest accuracy:
wherein TP is true positive, which indicates that the classification prediction is correct and is judged to be positive; TN is true negative, which means that the classification prediction is correct and is judged as negative; FP is false positive, indicating that the classification prediction is wrong and is judged to be positive; FN is false negative, indicating that the classification prediction was wrong and was judged negative.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111293464.2A CN114004258B (en) | 2021-11-03 | 2021-11-03 | Semi-supervised electrocardiographic abnormality detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111293464.2A CN114004258B (en) | 2021-11-03 | 2021-11-03 | Semi-supervised electrocardiographic abnormality detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114004258A true CN114004258A (en) | 2022-02-01 |
CN114004258B CN114004258B (en) | 2024-04-02 |
Family
ID=79927188
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111293464.2A Active CN114004258B (en) | 2021-11-03 | 2021-11-03 | Semi-supervised electrocardiographic abnormality detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114004258B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115381438A (en) * | 2022-08-24 | 2022-11-25 | 华南师范大学 | Method and device for reconstructing vital sign signals, computer equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100191139A1 (en) * | 2009-01-28 | 2010-07-29 | Brainscope, Inc. | Method and Device for Probabilistic Objective Assessment of Brain Function |
CN112991579A (en) * | 2021-01-14 | 2021-06-18 | 北京航空航天大学 | Helicopter mobile part abnormity detection method based on generation countermeasure network |
-
2021
- 2021-11-03 CN CN202111293464.2A patent/CN114004258B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100191139A1 (en) * | 2009-01-28 | 2010-07-29 | Brainscope, Inc. | Method and Device for Probabilistic Objective Assessment of Brain Function |
CN112991579A (en) * | 2021-01-14 | 2021-06-18 | 北京航空航天大学 | Helicopter mobile part abnormity detection method based on generation countermeasure network |
Non-Patent Citations (1)
Title |
---|
陈国炜;刘磊;郭嘉逸;潘宗序;胡文龙;: "基于生成对抗网络的半监督遥感图像飞机检测", 中国科学院大学学报, no. 04, 8 July 2020 (2020-07-08) * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115381438A (en) * | 2022-08-24 | 2022-11-25 | 华南师范大学 | Method and device for reconstructing vital sign signals, computer equipment and storage medium |
CN115381438B (en) * | 2022-08-24 | 2023-04-18 | 华南师范大学 | Method and device for reconstructing vital sign signals, computer equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN114004258B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Zenati et al. | Adversarially learned anomaly detection | |
Gidaris et al. | Generating classification weights with gnn denoising autoencoders for few-shot learning | |
Yu et al. | Whole process monitoring based on unstable neuron output information in hidden layers of deep belief network | |
US11727279B2 (en) | Method and apparatus for performing anomaly detection using neural network | |
Yang et al. | Robust and adaptive online time series prediction with long short-term memory | |
CN109394205B (en) | Electrocardiosignal analysis method based on deep neural network | |
CN113723007B (en) | Equipment residual life prediction method based on DRSN and sparrow search optimization | |
CN108876044B (en) | Online content popularity prediction method based on knowledge-enhanced neural network | |
Salama et al. | A novel ant colony algorithm for building neural network topologies | |
CN115903741B (en) | Industrial control system data anomaly detection method | |
CN110558971A (en) | Method for generating countermeasure network electrocardiogram abnormity detection based on single target and multiple targets | |
Tasfi et al. | Deep neural networks with confidence sampling for electrical anomaly detection | |
Challu et al. | Deep generative model with hierarchical latent factors for time series anomaly detection | |
Addabbo et al. | Gait recognition using FMCW radar and temporal convolutional deep neural networks | |
Ding et al. | Efficient BiSRU combined with feature dimensionality reduction for abnormal traffic detection | |
Suresh et al. | A sequential learning algorithm for meta-cognitive neuro-fuzzy inference system for classification problems | |
CN114004258A (en) | Semi-supervised electrocardio abnormality detection method | |
CN107862375A (en) | A kind of two stage equipment fault diagnosis method | |
Sadr et al. | An anomaly detection method for satellites using Monte Carlo dropout | |
CN108665001B (en) | Cross-tested idle state detection method based on deep belief network | |
Fan et al. | Interpretable multi-scale neural network for granger causality discovery | |
Yang et al. | Bayesian-wavelet-based multisource decision fusion | |
CN113035348A (en) | Diabetes diagnosis method based on GRU feature fusion | |
Liu et al. | Product processing quality classification model for small-sample and imbalanced data environment | |
CN116595465A (en) | High-dimensional sparse data outlier detection method and system based on self-encoder and data enhancement |
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 |