CN113127705A - Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method - Google Patents
Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method Download PDFInfo
- Publication number
- CN113127705A CN113127705A CN202110360734.0A CN202110360734A CN113127705A CN 113127705 A CN113127705 A CN 113127705A CN 202110360734 A CN202110360734 A CN 202110360734A CN 113127705 A CN113127705 A CN 113127705A
- Authority
- CN
- China
- Prior art keywords
- data
- generator
- model
- discriminator
- abnormal
- 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 48
- 230000002457 bidirectional effect Effects 0.000 title claims abstract description 15
- 230000002159 abnormal effect Effects 0.000 claims abstract description 70
- 230000006870 function Effects 0.000 claims abstract description 22
- 238000013507 mapping Methods 0.000 claims abstract description 19
- 238000012549 training Methods 0.000 claims description 30
- 238000000034 method Methods 0.000 claims description 21
- 238000013528 artificial neural network Methods 0.000 claims description 17
- 230000005856 abnormality Effects 0.000 claims description 11
- 238000013527 convolutional neural network Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 7
- 230000007787 long-term memory Effects 0.000 claims description 5
- 230000006403 short-term memory Effects 0.000 claims description 4
- 238000007781 pre-processing Methods 0.000 claims description 3
- 238000010276 construction Methods 0.000 claims description 2
- 238000004364 calculation method Methods 0.000 abstract description 9
- 238000012545 processing Methods 0.000 abstract description 2
- 230000002547 anomalous effect Effects 0.000 abstract 2
- 238000013135 deep learning Methods 0.000 description 14
- 239000010410 layer Substances 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 230000015654 memory Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 4
- 238000003909 pattern recognition Methods 0.000 description 4
- 238000011160 research Methods 0.000 description 4
- 230000003042 antagnostic effect Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000011176 pooling Methods 0.000 description 2
- 206010028980 Neoplasm Diseases 0.000 description 1
- 230000004913 activation Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 201000011510 cancer Diseases 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 230000002950 deficient Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002955 isolation Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000007500 overflow downdraw method Methods 0.000 description 1
- 239000002356 single layer Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Images
Classifications
-
- 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
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90348—Query processing by searching ordered data, e.g. alpha-numerically ordered data
-
- 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/045—Combinations of 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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Biomedical Technology (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Testing And Monitoring For Control Systems (AREA)
Abstract
The invention relates to a heterogeneous bidirectional generation confrontation network model and a time sequence anomaly detection method, which comprises a generator G, a discriminator D and a data processing module, wherein the generator G is used for learning the characteristics of a time sequence, generating anomalous data similar to real data from random noise and inputting the anomalous data into the discriminator D for judgment, and realizing the mapping from a potential generation space to an original data space; the encoder E is used for calculating the reconstruction error of the generator G; the discriminator D is used for identifying and distinguishing different patterns, and discriminates whether the data generated by the generator G is normal data or abnormal data. The invention fully combines the abnormal reconstruction error of the generator and the classification error of the discriminator through the improved abnormal value function, improves the performance of the abnormal value function and improves the detection precision; finally, by means of the improved bidirectional generation countermeasure network encoder-generator-discriminator framework, the reconstruction error calculation complexity and accuracy of the generator can be improved, and the anomaly detection speed is increased.
Description
Technical Field
The invention relates to the technical field of data processing, in particular to a heterogeneous bidirectional generation confrontation network model and a time series anomaly detection method.
Background
In the last decade, we have entered the big data era, with a dramatic increase in the data available. Of these, it is noteworthy that, with the rapid development of information technology, time series data is increasing at an unthinkable rate in various industries such as medical, business, biology, finance, internet, and the like, such as electrocardiographic medical records, stock price quotations, earthquake activity records, and the like. Analysis and application of time series data is now an area of great interest. Among the many research directions in time series data mining, time series anomaly detection research is emerging, and simply, anomalies refer to values that are different from the majority of the data set. In static data, if the data set itself is assumed to be from a certain distribution, anomalies refer to those values that deviate from this distribution; if it is assumed that the observed values in the data set originate from a model, the anomalies refer to those values that deviate from the model. There are many causes of the abnormality, such as sudden weather causes, policy changes, writing errors, and the like. The anomalies themselves are sometimes of great significance and provide a lot of useful information. Such as: credit card fraud may be manifested as the credit card being used almost simultaneously in different places, presumably credit card fraud by analyzing the usage of the credit card. Sensors are often used in life to track parameters around various environments, and sudden changes in which may be the occurrence of a surrounding event of interest. In medicine, normal MRJ or PET scans are often collected, and if an abnormal condition other than these occurs, it may be that cancer has occurred. The satellite or remote sensors are used to collect a large number of weather conditions, climate changes, etc. so that sudden weather changes can be predicted based on possible abnormal conditions. Therefore, finding anomalies in the time series is a very meaningful task.
Today in the big data era, technologies such as artificial intelligence represented by deep learning are introduced to analyze time series data, optimize models and solve practical problems. In recent years, deep learning has strong capacity in learning expression forms of complex data (high-dimensional data, time data, spatial data and graphic data), deep learning technology has no requirement for fixing a model structure, characteristics are automatically extracted from massive data through an algorithm on the basis of the data, the data are continuously used for many times to improve the performance of the deep learning, and the application practice effect shows good applicability and accuracy until the application requirement or the iteration frequency is reached. In recent years, deep learning has been successfully applied to a plurality of time series practical application fields, and scholars and experts at home and abroad have devoted themselves to research in this respect, and have achieved a lot of excellent research results in some important fields including sequence matching, pattern recognition, clustering, trend analysis, similarity detection, classification, long-term and short-term prediction, and the like. When complex heterogeneous mass data is processed, the anomaly detection method based on deep learning has better performance than the traditional anomaly detection method when various problems in practical application are solved.
Currently, the current time series anomaly detection method based on deep learning generally includes: the method is used for deep learning of feature extraction, deep feature learning facing normal data and end-to-end abnormal value direct deep learning. The deep learning for feature extraction includes methods of directly using mature pre-training deep neural networks such as AlexNet, VGG and the like to extract low-dimensional features, or explicitly training a deep feature extraction model independently; the depth feature learning facing the normal data is mainly to learn the distribution and feature representation of the normal data, while the abnormal data does not meet the distribution and feature representation, and the normal data and the abnormal data can be distinguished by calculating abnormal values, and the method comprises a self-encoder for detecting the abnormal data based on reconstruction errors, a generation countermeasure network based on generation and discrimination errors, a predictive model based on classification errors, a fusion method based on traditional abnormal measurement such as distance, One-Class, cluster and the like; the end-to-end abnormal value direct deep learning is to directly learn the abnormal value of the data instance by using the deep neural network, which is a specific method for deep learning, and mainly considers how to design an effective loss function and how to combine the deep neural network with the abnormal value measurement, wherein the method comprises a model based on ranking, a priority driving model, an end-to-end One-Class classification model and the like.
Due to the unknown, heterogeneous and scarce nature of the anomaly itself and the increasing complexity of high-dimensional data and the correlation between the dimensions of the data, the existing anomaly detection methods still have the following disadvantages: 1) the recall rate for complex data (massive, heterogeneous and high-noise) is insufficient; 2) normal data or abnormal feature learning still depends on a large amount of training data with labels, and is difficult to acquire in practice; 3) the performance of detection for complex anomalies, particularly context-related anomalies and aggregate anomalies, is inadequate. Moreover, training based on anomaly detection that generates an antagonistic network may now suffer from a number of problems, such as inability to converge and pattern collapse, the generator network may be misled and generate data instances other than normal ones, especially when the true distribution of a given data set is complex or the training data contains unexpected outliers, and again, an outlier function based on the generation of the antagonistic network is built on the generator with the goal of data synthesis rather than anomaly detection, so that the outlier function performance relying only on the generator is somewhat deficient.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides a heterogeneous bidirectional generation confrontation network model and a time series abnormity detection method, and solves the defects of the existing time series abnormity detection method based on deep learning.
The purpose of the invention is realized by the following technical scheme: a heterogeneous bidirectional generation confrontation network model comprises a generator G and an encoder E, wherein the neural network is a multilayer long and short term memory network, and a discriminator D, wherein the neural network is a convolutional neural network; the generator G is used for learning the characteristics of the time sequence, generating abnormal data similar to normal data from random noise and inputting the abnormal data into the discriminator D for judgment, so that mapping from a potential generation space to an original data space is realized; the encoder E is used for calculating the reconstruction error of the generator G; the discriminator D is used for identifying and distinguishing different modes and discriminating whether the data generated by the generator G is normal data or abnormal data;
through the game between the generator G and the discriminator D, the model for finally achieving Nash equilibrium is as follows:
the computation of outliers for the model includes computing a discriminant error and a reconstruction error; constructing an outlier functionTo compute the outliers of the model, wherein,in order to determine the error, the error is determined,is a reconstruction error; the discrimination error is directly obtained through the classification cross entropy of the discriminator.
The encoder E trains with the generator G simultaneously in the countertraining process, so that the encoder E simultaneously realizes inverse mapping from a data space to a potential generation space while the potential space is mapped to an original data space by training the generator G, and further, reconstruction errors are quickly and accurately realizedAnd (4) calculating.
A time series abnormity detection method based on heterogeneous bidirectional generation countermeasure network model comprises an abnormity detection step; the abnormality detecting step includes:
inputting real data containing abnormal data and normal data into the trained model;
classifying abnormal data and normal data by a discriminator D in the model, and calculating a classification cross entropy to obtain a discrimination error
Mapping data to a potential generation space through an encoder E in the model to obtain E (x), mapping the potential generation space to an original data space through a generator G to obtain G (E (x)), and further mapping the potential generation space to the original data space through the generator GCalculating to obtain a reconstruction error
Combined discrimination errorAnd reconstruction errorBy function of outliersAnd calculating an abnormal value to realize abnormal detection.
The time series anomaly detection method also comprises the steps of model construction and model training; the model building and training steps are performed before the anomaly detection step.
The model building step comprises:
constructing a generator G and an encoder E of which the neural network is a multilayer long and short term memory network; the generator G is used for learning the characteristics of the time sequence, generating abnormal data similar to normal data from random noise and inputting the abnormal data into the discriminator D for judgment, so that mapping from a potential generation space to an original data space is realized; the encoder E is used for calculating the reconstruction error of the generator G;
and constructing a discriminator D of which the neural network is a convolutional neural network, wherein the discriminator D is used for identifying and distinguishing different modes, and discriminating whether the data generated by the generator G is normal data or abnormal data.
The model training step comprises:
acquiring training data which are normal data x, preprocessing the training data, and inputting the preprocessed training data into a model completing the model building step;
a generator G in the model generates abnormal data x 'through random noise z, an encoder E encodes training data to generate potential generated spatial data z', and a discriminator D classifies and discriminates the generated abnormal data x 'and normal data x and performs a plurality of countercheck iterations with the generator G until the discriminator D accurately discriminates the abnormal data x' and the normal data x generated by the generator D.
The invention has the following advantages: on one hand, a long-short term memory network is selected as a generator, a convolutional neural network is selected as a heterogeneous generation countermeasure network of a discriminator, so that the advantages of the two types of neural networks in sequence data and pattern recognition capability are fully exerted, high-dimensional abnormality can be detected by checking reconstruction performed in a learned low-dimensional potential space, and the convergence of training and the effectiveness of the model are ensured; on the other hand, the improved abnormal value function fully combines the reconstruction error of the generator and the classification error of the discriminator, so that the performance of the abnormal value function is improved, and the detection precision is improved; finally, by means of the improved bidirectional generation countermeasure network encoder-generator-discriminator framework, the reconstruction error calculation complexity and accuracy of the generator can be improved, and the anomaly detection speed is increased.
Drawings
FIG. 1 is a schematic diagram of a generation countermeasure network architecture;
FIG. 2 is a schematic diagram of a single-layer structure of a long term memory network;
FIG. 3 is a schematic diagram of a convolutional neural network structure;
FIG. 4 is a schematic diagram of a real data base;
FIG. 5 is a diagram illustrating a heterogeneous bi-directional generative countermeasure network architecture of the present invention;
FIG. 6 is a graph of the performance of a data set;
FIG. 7 is a diagram illustrating the convergence curve of the loss function according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the detailed description of the embodiments of the present application provided below in connection with the appended drawings is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application. The invention is further described below with reference to the accompanying drawings.
The invention realizes the unsupervised anomaly detection of the non-stationary nonlinear multi-element mass complex time sequence by constructing the heterogeneous generation countermeasure network. The method comprises the steps of generating potential abnormal data by using a generator, classifying normal data and abnormal data by using a discriminator, constructing an abnormal value function by using different reconstruction errors of the abnormal data and the normal data and combining a classification result, thereby realizing more accurate abnormal detection; the method specifically comprises the following steps:
x for a given data set1,x2,...,xNTherein ofOrder toFor low-dimensional representation space, the anomaly detection target based on deep learning is obtained by learningMapping data space to feature representation spaceOr an outlier functionSo that abnormal and normal data can be distinguished through phi or tau, wherein phi and tau are constructed based on a neural network, H hidden layers are included, and the weight matrix of the hidden layers is theta ═ M1,M2,...,MH}。
sx=f(x,φΘ*,ψW*)
sx=τ(x;Θ*)
wherein phi maps the original data to a representation space Z, psi is a learning task of normal data on the representation space Z, a weight matrix of the neural network is W,is a loss function of the model, f is an abnormal value calculation function, calculates an abnormal score using phi and psi, and tau is a function of directly calculating an abnormal value for end-to-end learning.
As shown in fig. 1, the neural network of the generator G is a multi-layer long-short term memory network for learning the characteristics of the time series, and the discriminator is a convolutional neural network for recognizing and distinguishing the unused patterns by using its strong pattern recognition capability, and the design of the heterogeneous generation countermeasure network can better utilize the learning capability of the long-short term memory network for the memory and time-related characteristics of the series and the pattern recognition capability of the convolutional neural network.
Unlike previous methods based on generating a countermeasure network, the present invention utilizes the idea of generating countermeasures, where the generator directly generates abnormal data from random noise, rather than normal data, and the discriminator discriminates whether the data is the generated abnormal data or the original normal data. The generator aims to generate data which is similar to normal data as much as possible and can not be identified by the discriminator; the goal of the discriminator is to discriminate as much as possible between true data and abnormal data. The two games are played to finally reach Nash equilibrium.
Wherein, C0And CnShowing the cost of misjudging the abnormal and normal data, and zeta (x) epsilon (0, 1) is an abnormal value function used for minimizing the objective function.
As shown in fig. 2, the generation model G based on the long-short term memory network: for the generator long-short term memory network model, for a layer of unidirectional LSTM, the update equation is:
ft=σ(bf+Wf[Ct-1,ht-1,xt])
it=σ(bi+Wi[Ct-1,ht-1,xt])
ot=σ(bo+Wo[Ct,ht-1,xt])
ht=ottanh(Ct)
wherein x istIs the input feature vector h at time t in the same time windowt-1,ht,Ct-1,CtHidden state vector and neuron state vector input or output for t time, when t is 0, ht-1,Ct-1Is absent, ht,CtAre transferred between the same layers, and all htBut also as an output of the LSTM layer, Wf,Wi,WC,WoThe weight matrixes are respectively a forgetting gate, an input gate, a hidden state vector and an output gate, and are spliced by three weight matrixes for expression simplicity and correspond to bf,bi,bC,boIs its offset vector. Sigma is a sigmoid function.
As shown in fig. 3, the convolutional neural network-based discriminant model D: in order to prevent the over-fitting of the generated antagonistic network model result, the discrimination model D uses a convolution neural network with a structure completely different from that of the generated model G, and x represents time series data, and when passing through the convolution neural network layer, the following convolution mathematical operation is performed,
cj=f(x*Wj+bj)
wherein, WjAnd bjF is a specific activation function as a weight parameter of the convolutional layer. The features extracted by the convolution operation are further subjected to the following pooling operations:
pj=pooling(cj)+bj
in the final abnormal detection process, for a given piece of data, two parts need to be considered based on the calculation of generating an abnormal value of the countermeasure network, firstly, the judgment error of a discriminator is judged, and the discriminator of the model is essentially a two-classifier for distinguishing the generated abnormal data from the real normal data, so that the discriminator is only required to be used for judging whether the normal data or the abnormal data is equivalent to a result of two-classification; secondly, the reconstruction error of the generator is, because there is a clear difference between the normal data and the error of the abnormal data generated by the generator, and the generator generates the abnormal data by random noise in the model, the reconstruction error of the normal data is significantly larger than that of the abnormal data, so that the abnormal value function can be constructed as follows:
whereinIn order to determine the error, the error is determined,for error reconstruction, i.e. generation of errors, but directly calculated from the structure of the generative countermeasure networkIt is difficult because the generator only implements the mapping from the potential generation space to the original data space if the inverse mapping E from the original data space to the potential generation space can be found: z ═ e (x), the reconstruction error can be calculated from the following equation
To this end, the model improves the existing generative countermeasure network into a bidirectional generative countermeasure network to generate abnormal data while implementing an inverse mapping E from the data space to the potential generative space: z ═ E (x), by adding the encoder E on the basis of the existing generator G and the discriminator D, the encoder E and the generator G are trained simultaneously in the antithetical training process, so that the encoder E simultaneously realizes the inverse mapping from the data space to the potential generation space while training the generator G to realize the potential space-to-data space mapping,thus, reconstruction error can be rapidly and accurately realizedAnd (4) calculating. The specific implementation architecture is shown in fig. 5, so that the overall MinMax model of the model is formed by:
the invention is explained below by way of corresponding experimental data and examples;
1. data set
As shown in fig. 4, a data service log of a real data center in the whole month of 6 months in 2017 is selected as a data set, total log entries exceed 4000000, log contents include that the first to fourteen columns respectively include a timestamp, transmission time, a remote host, transmission data volume, a file name, a transmission type, a special flag bit, a transmission direction, an access mode, a user id, a service id, an authentication method, an authentication id and a completion state, total data is 4094157, the data volume reaches the level of ten million, and it is ensured that no future information or irrelevant information is contained, and major data dimensions fluctuate little by little or no time during the period; in addition to the real dataset, the present invention also employs two common open datasets optdigits and vertebral for anomaly detection.
2. Data pre-processing
t is the current time, assuming t is present0,t1,t2,...,tMFor anomaly detection, each feature is first normalized individually, and zscore normalization is used to first find the feature average for a sliding window of current length NDifference of alignmentσ1,σ2,...,σm,
And respectively subtracting the corresponding average values from the characteristic, and dividing the average values by the standard deviation to remove dimensional differences among the characteristics.
3. Model training process
When the discrimination model D is trained, the data generated by the generation model G in the previous round and the real data are directly spliced together to be used as a new input x. x generates a score (a number between 0 and 1) by the discriminant model D, and performs inverse gradient propagation by the loss function of score and y composition. When training the generative model G, the generative model G and the discriminant model D are taken as a whole. The ensemble is still input with one score. When a group of noise data is input, a pseudo data can be generated in a generation model G, the pseudo data is scored through a discrimination model D, the generation model G aims to enable the expression D (G (z)) of the pseudo data G (z) generated by the generation model G on the discrimination model D to be consistent with the expression D (x) of real data x on the discrimination model D, the performance of the discrimination model D and the performance of the generation model G are continuously improved through the two processes of mutual confrontation and iterative optimization, and when the discrimination capability of the discrimination model D is improved to a certain degree finally and the data source cannot be correctly discriminated, the generation model G can be considered to learn the distribution of the real data. Since the parameters of the discriminant model D are not trainable. This ensures that the training of the generative model G is in accordance with the scoring criteria of the discriminative model D. It is noted that, in the present technique, the encoder E is trained while training G, and the pseudo data E (x) generated by the encoder is consistent with the random noise z, so as to implement inverse mapping from the original data to the potential generation space, and facilitate the calculation of the subsequent abnormal value.
4. Model performance index
The performance comparison of the models still employs several sorted confusion matrix-based main performance indicators: precision, recall, F1-Score and Roc curves;
the accuracy rate refers to the proportion of the actual positive samples in the samples predicted to be positive by the model to the samples predicted to be positive, and the calculation formula is
The recall ratio refers to the proportion of the samples predicted to be positive in the samples actually being positive to the samples actually being positive, and the calculation formula is as follows:
f1 score is the harmonic mean of precision and recall and is calculated as:
the abscissa of the ROC curve is a False Positive Rate (FPR); the ordinate is True Positive Rate (TPR). The FPR and TPR calculation methods are respectively as follows:
5. results of model comparisons
As can be seen from fig. 6 and 7, and tables 1 and 2 below, the experimental results of the model in the real data set and the open data set are as follows, compared with the existing model:
(1) as shown in Table 1, on the real data set, the accuracy, recall, F1-Score and ROC of the model are respectively 0.996, 0.974, 0.985 and 0.955, and the detection performance for the abnormity is higher overall and is better than that of the existing typical model.
(2) As shown in Table 2, the model also achieves better detection performance on open data sets optdigits and vertebral, the ROC value is slightly lower than that of the Isolation Forest model only in optdigs, and the ROC value is superior to that of the existing typical model in other aspects.
(3) As shown in FIG. 6, the ROC curve of the present model is significantly better than that of the existing model.
(4) As shown in fig. 7, the model has better convergence and faster convergence rate in the training process.
Table 1, and table comparing detection performance of 4 typical anomaly detection methods based on machine learning in real data set
IForest | KNN | AutoEncoder | SOGAAL | OurMethod | |
Precision | 0.555 | 0.476 | 0.585 | 0.756 | 0.996 |
Recall | 0.562 | 0.471 | 0.674 | 0.869 | 0.974 |
F1 | 0.558 | 0.472 | 0.566 | 0.809 | 0.985 |
ROC | 0.650 | 0.420 | 0.740 | 0.812 | 0.955 |
Table 2, and table for comparing detection performance of 4 typical anomaly detection methods based on machine learning on two open anomaly detection data sets
Aiming at the problem of abnormality detection of multivariate time sequence data, particularly non-stationary nonlinear multivariate mass complex time sequence, the invention designs an unsupervised abnormality detection method based on heterogeneous bidirectional generation confrontation network structure, which has the advantages that: (1) the method solves the characteristic representation and learning of normal data in a complex time sequence, realizes unsupervised anomaly detection, and has better practicability and application value; (2) the problems of poor training convergence and model collapse existing in an anomaly detection model based on a generated countermeasure network are solved; (3) the performance of the abnormal value function is improved, the calculation complexity is reduced, and the abnormal detection can be realized more accurately in a shorter time.
The foregoing is illustrative of the preferred embodiments of this invention, and it is to be understood that the invention is not limited to the precise form disclosed herein and that various other combinations, modifications, and environments may be resorted to, falling within the scope of the concept as disclosed herein, either as described above or as apparent to those skilled in the relevant art. And that modifications and variations may be effected by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (7)
1. A heterogeneous bi-directionally generated countermeasure network model, characterized by: the device comprises a generator G and an encoder E, wherein the neural network is a multilayer long and short term memory network, and a discriminator D, wherein the neural network is a convolutional neural network; the generator G is used for learning the characteristics of the time sequence, generating abnormal data similar to normal data from random noise and inputting the abnormal data into the discriminator D for judgment, so that mapping from a potential generation space to an original data space is realized; the encoder E is used for calculating the reconstruction error of the generator G; the discriminator D is used for identifying and distinguishing different modes and discriminating whether the data generated by the generator G is normal data or abnormal data; through the game between the generator G and the discriminator D, the model for finally achieving Nash equilibrium is as follows:
2. a heterogeneous bi-directional generative countermeasure network model according to claim 1 wherein: computing outliers for the model includes computing discriminantsError and reconstruction error; constructing an outlier function sx=αlD(X)-(1-α)lG(X) to calculate an outlier of the model, wherein lDTo discriminate errors, |GIs a reconstruction error; the discrimination error is directly obtained through the classification cross entropy of the discriminator.
3. A heterogeneous bi-directional generative countermeasure network model according to claim 1 wherein: the encoder E trains with the generator G simultaneously in the countertraining process, so that the encoder E simultaneously realizes inverse mapping from a data space to a potential generation space while the potential space is mapped to an original data space by the training generator G, and further, the reconstruction error is quickly and accurately calculated.
4. A time series anomaly detection method based on a heterogeneous bidirectional generation countermeasure network model is characterized by comprising the following steps: the time series abnormality detection method includes an abnormality detection step; the abnormality detecting step includes:
inputting real data containing abnormal data and normal data into the trained model;
classifying abnormal data and normal data by a discriminator D in the model, and calculating a classification cross entropy to obtain a discrimination error lD;
Mapping data to a potential generation space through an encoder E in the model to obtain E (x), mapping the potential generation space to an original data space through a generator G to obtain G (E (x)), and then mapping the potential generation space to the original data space through lG(X)=||x-G(E(X))||1Calculating to obtain a reconstruction error lG;
Combined with the discrimination error lDAnd a reconstruction error lGBy means of an outlier function sx=αlD(X)-(1-α)lGAnd (X) calculating an abnormal value to realize abnormal detection.
5. The method for detecting the time series abnormality based on the heterogeneous bidirectional generation countermeasure network model according to claim 4, wherein: the time series anomaly detection method also comprises the steps of model construction and model training; the model building and training steps are performed before the anomaly detection step.
6. The method for detecting the time series abnormality based on the heterogeneous bidirectional generation countermeasure network model according to claim 5, wherein: the model building step comprises:
constructing a generator G and an encoder E of which the neural network is a multilayer long and short term memory network; the generator G is used for learning the characteristics of the time sequence, generating abnormal data similar to normal data from random noise and inputting the abnormal data into the discriminator D for judgment, so that mapping from a potential generation space to an original data space is realized; the encoder E is used for calculating the reconstruction error of the generator G;
and constructing a discriminator D of which the neural network is a convolutional neural network, wherein the discriminator D is used for identifying and distinguishing different modes, and discriminating whether the data generated by the generator G is normal data or abnormal data.
7. The method for detecting the time series abnormality based on the heterogeneous bidirectional generation countermeasure network model according to claim 5, wherein: the model training step comprises:
acquiring training data which are normal data x, preprocessing the training data, and inputting the preprocessed training data into a model completing the model building step;
a generator G in the model generates abnormal data x 'through random noise z, an encoder E encodes training data to generate potential generated spatial data z', and a discriminator D classifies and discriminates the generated abnormal data x 'and normal data x and performs a plurality of countercheck iterations with the generator G until the discriminator D accurately discriminates the abnormal data x' and the normal data x generated by the generator D.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110360734.0A CN113127705B (en) | 2021-04-02 | 2021-04-02 | Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110360734.0A CN113127705B (en) | 2021-04-02 | 2021-04-02 | Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113127705A true CN113127705A (en) | 2021-07-16 |
CN113127705B CN113127705B (en) | 2022-08-05 |
Family
ID=76774731
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110360734.0A Active CN113127705B (en) | 2021-04-02 | 2021-04-02 | Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113127705B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114139648A (en) * | 2021-12-07 | 2022-03-04 | 北京科技大学 | Intelligent detection method and system for abnormity of tailing filling pipeline |
CN114330486A (en) * | 2021-11-18 | 2022-04-12 | 河海大学 | Power system bad data identification method based on improved Wasserstein GAN |
CN115288994A (en) * | 2022-08-03 | 2022-11-04 | 西安安森智能仪器股份有限公司 | Compressor abnormal state detection method based on improved DCGAN |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109948117A (en) * | 2019-03-13 | 2019-06-28 | 南京航空航天大学 | A kind of satellite method for detecting abnormality fighting network self-encoding encoder |
CN110430183A (en) * | 2019-07-31 | 2019-11-08 | 福建师范大学 | The MH-LSTM method for detecting abnormality of dialogue-based characteristic similarity |
CN110442600A (en) * | 2019-04-17 | 2019-11-12 | 江苏网谱数据服务有限公司 | A kind of time series method for detecting abnormality |
CN110569925A (en) * | 2019-09-18 | 2019-12-13 | 南京领智数据科技有限公司 | LSTM-based time sequence abnormity detection method applied to electric power equipment operation detection |
CN110598851A (en) * | 2019-08-29 | 2019-12-20 | 北京航空航天大学合肥创新研究院 | Time series data abnormity detection method fusing LSTM and GAN |
CN111310583A (en) * | 2020-01-19 | 2020-06-19 | 中国科学院重庆绿色智能技术研究院 | Vehicle abnormal behavior identification method based on improved long-term and short-term memory network |
CN111447212A (en) * | 2020-03-24 | 2020-07-24 | 哈尔滨工程大学 | Method for generating and detecting APT (advanced persistent threat) attack sequence based on GAN (generic antigen network) |
CN111562996A (en) * | 2020-04-11 | 2020-08-21 | 北京交通大学 | Method and system for detecting time sequence abnormality of key performance index data |
CN111669373A (en) * | 2020-05-25 | 2020-09-15 | 山东理工大学 | Network anomaly detection method and system based on space-time convolutional network and topology perception |
CN111914873A (en) * | 2020-06-05 | 2020-11-10 | 华南理工大学 | Two-stage cloud server unsupervised anomaly prediction method |
CN112016435A (en) * | 2020-08-25 | 2020-12-01 | 中移(杭州)信息技术有限公司 | Abnormal behavior detection method and device, electronic equipment and storage medium |
CN112257917A (en) * | 2020-10-19 | 2021-01-22 | 北京工商大学 | Time series abnormal mode detection method based on entropy characteristics and neural network |
CN112416643A (en) * | 2020-11-26 | 2021-02-26 | 清华大学 | Unsupervised anomaly detection method and unsupervised anomaly detection device |
-
2021
- 2021-04-02 CN CN202110360734.0A patent/CN113127705B/en active Active
Patent Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109948117A (en) * | 2019-03-13 | 2019-06-28 | 南京航空航天大学 | A kind of satellite method for detecting abnormality fighting network self-encoding encoder |
CN110442600A (en) * | 2019-04-17 | 2019-11-12 | 江苏网谱数据服务有限公司 | A kind of time series method for detecting abnormality |
CN110430183A (en) * | 2019-07-31 | 2019-11-08 | 福建师范大学 | The MH-LSTM method for detecting abnormality of dialogue-based characteristic similarity |
CN110598851A (en) * | 2019-08-29 | 2019-12-20 | 北京航空航天大学合肥创新研究院 | Time series data abnormity detection method fusing LSTM and GAN |
CN110569925A (en) * | 2019-09-18 | 2019-12-13 | 南京领智数据科技有限公司 | LSTM-based time sequence abnormity detection method applied to electric power equipment operation detection |
CN111310583A (en) * | 2020-01-19 | 2020-06-19 | 中国科学院重庆绿色智能技术研究院 | Vehicle abnormal behavior identification method based on improved long-term and short-term memory network |
CN111447212A (en) * | 2020-03-24 | 2020-07-24 | 哈尔滨工程大学 | Method for generating and detecting APT (advanced persistent threat) attack sequence based on GAN (generic antigen network) |
CN111562996A (en) * | 2020-04-11 | 2020-08-21 | 北京交通大学 | Method and system for detecting time sequence abnormality of key performance index data |
CN111669373A (en) * | 2020-05-25 | 2020-09-15 | 山东理工大学 | Network anomaly detection method and system based on space-time convolutional network and topology perception |
CN111914873A (en) * | 2020-06-05 | 2020-11-10 | 华南理工大学 | Two-stage cloud server unsupervised anomaly prediction method |
CN112016435A (en) * | 2020-08-25 | 2020-12-01 | 中移(杭州)信息技术有限公司 | Abnormal behavior detection method and device, electronic equipment and storage medium |
CN112257917A (en) * | 2020-10-19 | 2021-01-22 | 北京工商大学 | Time series abnormal mode detection method based on entropy characteristics and neural network |
CN112416643A (en) * | 2020-11-26 | 2021-02-26 | 清华大学 | Unsupervised anomaly detection method and unsupervised anomaly detection device |
Non-Patent Citations (1)
Title |
---|
马金: "基于深度神经网络的序列异常检测研究", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114330486A (en) * | 2021-11-18 | 2022-04-12 | 河海大学 | Power system bad data identification method based on improved Wasserstein GAN |
CN114139648A (en) * | 2021-12-07 | 2022-03-04 | 北京科技大学 | Intelligent detection method and system for abnormity of tailing filling pipeline |
CN114139648B (en) * | 2021-12-07 | 2022-08-02 | 北京科技大学 | Intelligent detection method and system for abnormity of tailing filling pipeline |
CN115288994A (en) * | 2022-08-03 | 2022-11-04 | 西安安森智能仪器股份有限公司 | Compressor abnormal state detection method based on improved DCGAN |
CN115288994B (en) * | 2022-08-03 | 2024-01-19 | 西安安森智能仪器股份有限公司 | Improved DCGAN-based compressor abnormal state detection method |
Also Published As
Publication number | Publication date |
---|---|
CN113127705B (en) | 2022-08-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113127705B (en) | Heterogeneous bidirectional generation countermeasure network model and time sequence anomaly detection method | |
Yang et al. | Convolutional prototype network for open set recognition | |
Yu et al. | A bearing fault and severity diagnostic technique using adaptive deep belief networks and Dempster–Shafer theory | |
CN111832647A (en) | Abnormal flow detection system and method | |
Doroz et al. | Dynamic signature verification method based on association of features with similarity measures | |
Porwik et al. | The k-NN classifier and self-adaptive Hotelling data reduction technique in handwritten signatures recognition | |
Teng et al. | Customer credit scoring based on HMM/GMDH hybrid model | |
US20220383322A1 (en) | Clustering-based data selection for optimization of risk predictive machine learning models | |
Yu et al. | Control chart recognition based on the parallel model of CNN and LSTM with GA optimization | |
CN110555463B (en) | Gait feature-based identity recognition method | |
Hu | Fuzzy integral-based perceptron for two-class pattern classification problems | |
CN113705715B (en) | Time sequence classification method based on LSTM and multi-scale FCN | |
Nair et al. | A life cycle on processing large dataset-LCPL | |
Sun et al. | Neighborhood graph embedding interpretable fault diagnosis network based on local and non-local information balanced under imbalanced samples | |
CN111401440B (en) | Target classification recognition method and device, computer equipment and storage medium | |
Bustos-Brinez et al. | Ad-dmkde: Anomaly detection through density matrices and fourier features | |
Wei et al. | Multisensor Fused Fault Diagnosis for Rotation Machinery Based on Supervised Second‐Order Tensor Locality Preserving Projection and Weighted k‐Nearest Neighbor Classifier under Assembled Matrix Distance Metric | |
Yazdani et al. | Applying bounded fuzzy possibilistic method on critical objects | |
Cai et al. | Motion recognition for 3D human motion capture data using support vector machines with rejection determination | |
Wang et al. | Review on functional data classification | |
Oh et al. | Multivariate time series open-set recognition using multi-feature extraction and reconstruction | |
Mohanty et al. | Fraud detection using outlier analysis: a survey | |
Aparicio et al. | Chemometrics as an aid in authentication | |
CN117692261B (en) | Malicious Bot recognition method based on behavior subgraph characterization | |
Ma et al. | Modeling Multivariate Time Series via Prototype Learning: A Multi-Level Attention-based Perspective |
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 | ||
TR01 | Transfer of patent right |
Effective date of registration: 20221028 Address after: Room 304-7, Building 10, No. 258, Huayuan East Avenue, Baiyun Street, Kecheng District, Quzhou City, Zhejiang Province 324000 (self declared) Patentee after: Quzhou Haiyi Technology Co.,Ltd. Address before: 610000 Jinzhou Road, Jinniu District, Chengdu, Sichuan 999 Patentee before: XIHUA University |
|
TR01 | Transfer of patent right |