Abnormal data identification method and device
Through the target neural network model, the absolute value, mean value and covariance of the reconstruction error are used to determine the determination threshold, which solves the problem of low accuracy in identifying abnormal data in the existing technology and achieves higher identification accuracy.
Patent Information
- Application Number
- CN202011403613.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-04
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-12-04
AI Technical Summary
In the existing technology, when the model identifies abnormal data, it is necessary to manually determine the judgment threshold, which results in the judgment threshold being inaccurate enough, which in turn results in low accuracy in identifying abnormal data.
The target neural network model is used to determine the determination threshold through the absolute value of the reconstruction error of the target sample data, the mean and covariance of the reconstruction error distribution, and use it to identify the target data as normal data or abnormal data. The target neural network The weighted sum of model accuracy and coverage is used as the decision threshold.
It improves the identification accuracy of abnormal data and ensures that the target neural network model can determine the most accurate judgment threshold, thereby improving the effect of identifying abnormal data.
Smart Images

Figure CN112598111B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for identifying abnormal data. Background Art
[0002] In the prior art, when using a model to identify abnormal data, it is usually necessary to determine a judgment threshold for identification. In the prior art, when determining the judgment threshold, artificial parameters are usually required, and the determined judgment threshold is not accurate enough, which further causes low accuracy of model recognition and low accuracy of identifying abnormal data.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a method and device for identifying abnormal data, so as to at least solve the technical problem of low accuracy in identifying abnormal data.
[0005] According to one aspect of an embodiment of the present invention, a method for identifying abnormal data is provided, comprising: acquiring target data to be detected; inputting the target data into a target neural network model, wherein the target neural network model is a model obtained by training an original neural network model using target sample data, and a determination threshold of the target neural network model is a target determination threshold, and the determination threshold is a threshold obtained according to the absolute value of a reconstruction error of the target sample data, a mean value and a covariance of a reconstruction error distribution, and the determination threshold is used to identify whether the target sample data is normal data or abnormal data, and when the determination threshold is the target determination threshold, the target score of the target neural network model is the highest, and the target score is a weighted sum of the accuracy and coverage of the target neural network model; and determining whether the target data is normal data or abnormal data according to the recognition result output by the target neural network model.
[0006] According to another aspect of an embodiment of the present invention, there is also provided an abnormal data identification device, comprising: a first acquisition unit, used to acquire target data to be detected; an input unit, used to input the above target data into a target neural network model, wherein the above target neural network model is a model obtained by training an original neural network model using target sample data, and the determination threshold of the above target neural network model is a target determination threshold, and the above determination threshold is a threshold obtained according to the absolute value of the reconstruction error of the above target sample data, the mean and covariance of the reconstruction error distribution, and the above determination threshold is used to identify the above target sample data as normal data or abnormal data, and when the above determination threshold is the above target determination threshold, the target score of the above target neural network model is the highest, and the above target score is the weighted sum of the accuracy and coverage of the above target neural network model; a first determination unit, used to determine whether the above target data is normal data or abnormal data according to the recognition result output by the above target neural network model.
[0007] In an embodiment of the present invention, a method is adopted to obtain target data to be detected; input the above target data into a target neural network model, wherein the above target neural network model is a model obtained by training an original neural network model using target sample data, and the determination threshold of the above target neural network model is a target determination threshold, and the above determination threshold is a threshold obtained according to the absolute value of the reconstruction error of the above target sample data, the mean value and covariance of the reconstruction error distribution, and the above determination threshold is used to identify the above target sample data as normal data or abnormal data. When the above determination threshold is the above target determination threshold, the target score of the above target neural network model is the highest, and the above target score is the weighted sum of the accuracy and coverage of the above target neural network model; a method is used to determine whether the above target data is normal data or abnormal data according to the recognition result output by the above target neural network model, because in the above method, the target determination threshold of the target neural network model is determined from multiple determination thresholds, and the multiple determination thresholds are thresholds obtained according to the absolute value of the reconstruction error of the above target sample data, the mean value and covariance of the reconstruction error distribution, so that the most accurate target determination threshold can be determined for the target neural network model, thereby improving the effect of determining the accuracy of abnormal data, and thus solving the technical problem of low accuracy in identifying abnormal data. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0009] Figure 1 is a schematic diagram of an application environment of an optional abnormal data identification method according to an embodiment of the present invention;
[0010] Figure 2 is a schematic diagram of an application environment of another optional abnormal data identification method according to an embodiment of the present invention;
[0011] Figure 3 is a schematic diagram of a process of an optional abnormal data identification method according to an embodiment of the present invention;
[0012] Figure 4 is a schematic diagram of time series data of an optional abnormal data identification method according to an embodiment of the present invention;
[0013] Figure 5 is a schematic diagram of an LSTM network unit of an optional abnormal data identification method according to an embodiment of the present invention;
[0014] Figure 6 is a schematic diagram of an expanded LSTM unit of an optional abnormal data identification method according to an embodiment of the present invention;
[0015] Figure 7 is a schematic diagram of an LSTM autoencoder of an optional abnormal data identification method according to an embodiment of the present invention;
[0016] Figure 8 It is a schematic diagram of the structure of an optional abnormal data identification device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0019] According to one aspect of an embodiment of the present invention, a method for identifying abnormal data is provided. Optionally, as an optional implementation, the above-mentioned method for identifying abnormal data can be but is not limited to being applied to: Figure 1 in the environment shown.
[0020] like Figure 1 As shown, the terminal device 102 includes a memory 104 for storing various data generated during the operation of the terminal device 102, a processor 106 for processing and calculating the above data, and a display 108 for displaying the recognition result. The terminal device 102 can exchange data with a server 112 through a network 110. The server 112 includes a database 114 for storing various data and a processing engine 116 for processing the above data. As shown in step S102 to step S106. The terminal device 102 sends the target data to the server 112, and the server 112 recognizes the target data and returns the recognition result.
[0021] As an optional implementation, the above abnormal data identification method can be applied to, but not limited to, Figure 2 in the environment shown.
[0022] like Figure 2 As shown, the terminal device 202 includes a memory 204 for storing various data generated during the operation of the terminal device 202, a processor 206 for processing and calculating the above data, and a display 208 for displaying the recognition result. The terminal device 202 can perform steps S202 to S206. Figure 1 The difference is that the terminal device 202 completes the identification of abnormal data.
[0023] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.
[0024] Optionally, as an optional implementation, as Figure 3 As shown, the above-mentioned method for identifying abnormal data includes:
[0025] S302, obtaining target data to be detected;
[0026] S304, inputting the target data into the target neural network model, wherein the target neural network model is a model obtained by training the original neural network model with the target sample data, the determination threshold of the target neural network model is the target determination threshold, the determination threshold is a threshold obtained according to the absolute value of the reconstruction error of the target sample data, the mean and covariance of the reconstruction error distribution, and the determination threshold is used to identify whether the target sample data is normal data or abnormal data. When the determination threshold is the target determination threshold, the target score of the target neural network model is the highest, and the target score is the weighted sum of the accuracy and coverage of the target neural network model;
[0027] S306, determining whether the target data is normal data or abnormal data according to the recognition result output by the target neural network model.
[0028] Optionally, the above abnormal data identification method can be applied, but not limited to, in the process of identifying numerical data or in the process of identifying non-numerical data. If non-numerical data is identified, the non-numerical data is converted into a numerical variable.
[0029] In the process of identifying abnormal data, first, the data to be identified is obtained and input into the target neural network model. The target determination threshold of the determination threshold of the target neural network model is a threshold determined from multiple determination thresholds. Each determination threshold is a threshold obtained based on the absolute value of the reconstruction error of the target sample data, the mean and covariance of the reconstruction error distribution. The target score of the target neural network model under the target determination threshold is the highest, and the target score is the weighted sum of the accuracy and coverage of the target neural network model.
[0030] Optionally, before inputting the target data into the target neural network model, the method also includes: acquiring target sample data; reconstructing the target sample data to determine the absolute value of the reconstruction error, the mean and covariance of the reconstruction error distribution of each target sample data in the target sample data; determining a reconstruction score for each target sample data based on the absolute value of the reconstruction error, the mean and covariance of the reconstruction error distribution; determining multiple decision thresholds based on the reconstruction scores; and determining a target decision threshold from the multiple decision thresholds.
[0031] Optionally, determining multiple decision thresholds based on the reconstruction scores includes: determining each reconstruction score as a decision threshold; or sorting the reconstruction scores according to size, and determining the average value of every two adjacent reconstruction scores in the sorted reconstruction scores as a decision threshold; or using the quantile of the reconstruction score as the decision threshold.
[0032] Optionally, determining a target decision threshold from multiple decision thresholds includes: determining a target score of a target neural network model corresponding to each decision threshold among the multiple decision thresholds, wherein the target score is obtained by recognition accuracy and recognition coverage; and determining the decision threshold with the largest target score as the target decision threshold.
[0033] Optionally, determining a target score of the target neural network model corresponding to each of the multiple determination thresholds includes: obtaining a first number of target sample data, a second number of target sample data identified as abnormal data, and a total number of sample data in the sample data set where the target sample data is located; determining a ratio of the second number to the first number as accuracy, and determining a ratio of the second number to the total number as coverage; and inputting the accuracy and coverage into a predetermined formula to determine the target score.
[0034] Optionally, inputting the accuracy and coverage into a predetermined formula to determine the target score includes: determining the target score by the following formula:
[0035]
[0036] Among them, F β-score is the target score, precision is the accuracy, recall is the coverage, and β is a real number greater than 0.
[0037] Optionally, determining whether the target data is normal data or abnormal data based on the recognition result output by the target neural network model includes: when the recognition result is greater than the target judgment threshold, determining that the target data is normal data; when the recognition result is less than or equal to the target judgment threshold, determining that the target data is abnormal data.
[0038] The above abnormal data identification method is explained with reference to a specific example.
[0039] Assuming that the business system or data warehouse generates data continuously (taking numerical data as an example), the time series data is defined as:
[0040] DS={(x1,t1),(x1,t1),...,(x T , t T ), ...}
[0041] Where xT is a vector representing multidimensional data with timestamp tT. When putting time series data into the long short-term memory network, batch samples are often used for training, such as Figure 4 As shown in the figure, a batch of training data, where MB is the size of the batch sample. Each Window is a window. If the continuously generated data is non-numeric, you need to use Encoding and other data preprocessing techniques such as one-hot encoding and word2vec to convert the data into numeric variables.
[0042] Recurrent neural networks (RNNs) can capture the temporal dependencies between data points and can effectively handle time series problems. It is a type of recurrent neural network that takes sequence data as input, performs recursion in the direction of sequence evolution, and all nodes (recurrent units) are connected in a chain. Recurrent neural networks have memory, parameter sharing, and Turing completeness, so they have certain advantages in learning nonlinear features of sequences. Recurrent neural networks are used in natural language processing (NLP), such as speech recognition, language modeling, machine translation, and other fields, and are often used for various time series forecasts. RNNs are chained and expanded through time-dependent backpropagation. Each layer is calculated according to the feedforward neural network framework. Considering the parameter sharing of RNNs, the gradient of the weight is the sum of the gradients of all layers:
[0043]
[0044] Where L is the loss function. When optimizing the loss function, RNNs are prone to extreme nonlinear behaviors, including gradient vanishing and gradient explosion, after the error gradient has been back-propagated for multiple time steps. Unlike feedforward neural networks, gradient vanishing and gradient explosion only occur in deep structures and can be alleviated by designing the gradient ratio. For RNNs, the above phenomenon may occur as long as the sequence length is sufficient. Therefore, as time goes by, due to the continuous matrix multiplication of RNN in updating weight calculations, the weight coefficients will inevitably grow or decay exponentially, causing large changes in the gradient.
[0045] To solve the long-term and short-term dependency problems of general RNNs, the Long Short-Term Memory Network (LSTM) was designed. Due to its unique network design structure, LSTM is suitable for processing and predicting important events with very long intervals and delays in time series. LSTM also has the same chain structure as RNNs, but it is different from RNNs in terms of repeated modules: LSTM has a unique three-gate control (forget gate, update gate, and output gate) structure, and interacts through special mathematical forms. Figure 5 The classic structure of the LSTM unit is shown. Its "forget gate" and "update gate" select the necessary previous information and new information based on the input data at each time step. The information is transmitted to the next step together with the unit state. In addition, each LSTM unit also outputs its value separately. Figure 5 In , Last cell state is the previous cell source state, Last output is the previous cell source output, Current input is the current input, Cruuent output is the current output, Current cell state is the current cell source state, and Cruuent hypothesis is the current reasoning output. LSTM units can be expanded over time, such as Figure 6 As shown in the figure. The LSTM unit takes the data window as input (one instance per time step). Therefore, the LSTM unit can extract useful and useless timing information from the network. Where a and c are the transformation and output respectively, x is the input of the current cell source, and h is the output of the hidden layer.
[0046] The above is an introduction to the model. Next is the abnormal data identification process.
[0047] In the anomaly detection task, abnormal data is the research object, so the anomaly is regarded as the positive class and the normal data is regarded as the negative class, as shown in the confusion matrix in Table 1 below, the counts listed are:
[0048] True positive (TP) or f++, corresponds to the positive samples correctly predicted by the classification model;
[0049] False negative (FN) or f+-, corresponds to positive samples that are incorrectly predicted by the classification model;
[0050] False positive (FP) or f-+, corresponds to negative samples that are incorrectly predicted by the classification model;
[0051] True negative (TN) or f--, corresponds to negative samples that are correctly predicted by the classification model.
[0052] Table 1
[0053]
[0054] For anomaly detection tasks, there are two widely used metrics: precision and recall. Combined with the confusion matrix, their corresponding mathematical forms are shown in the following equation:
[0055] precision=TP / (TP+FP) (3)
[0056] recall=TP / (TP+FN) (4)
[0057] In anomaly detection tasks, simply using precision and recall to evaluate its effect is often unreliable, and high precision and high recall often cannot coexist. For example, if detection system 1 covers 100 samples, 70 of which are target samples, that is, the detection accuracy is 80%, and if detection system 2 covers 10 samples, 10 of which are target samples, that is, the detection accuracy is 100%, the accuracy of detection system 2 is higher than that of detection system 1, but it is obvious that detection system 2 is not effective in identifying anomalies due to its low recall. Similarly, recall cannot reflect the detection effect alone.
[0058] In order to effectively evaluate the performance of anomaly detection systems, it is necessary to construct new evaluation metrics. F-score, the weighted average of precision and recall, can be used as an effective evaluation metric.
[0059]
[0060] When the weighting factor β=1, precision and recall have equal weights. β<1 means that precision is more important than recall. In any case, precision is less important than recall. The F-score ranges from 0 to 1. The closer it is to 1, the better the anomaly detection performance. Optionally, the area under the receiver operating characteristic curve (AUC) value can also be used as an evaluation indicator.
[0061] Abnormal data identification also involves autoencoders. LSTM-based autoencoders. Autoencoders are neural networks with a symmetrical structure. Usually, autoencoders have at least one hidden layer, and the number of neurons in the hidden layer is smaller than the input and output layers. The basic goal of an autoencoder is to reconstruct its own input and learn the low-dimensional encoding layer of the input data in a hidden state. In addition, the autoencoder can measure the reconstruction error between the input and the prediction. Usually, the input layer and the hidden layer are called encoders, and their symmetrical hidden layer and output layer are called decoders. For the input X, the objective function is to find the weight vectors for the encoder and decoder in order to minimize the reconstruction error, as shown in the formula:
[0062]
[0063] The structure diagram of the autoencoder can be shown as Figure 7 shown.
[0064] The LSTM-AutoEncoder (LSTM-AE) has the same encoder-decoder structure, and its internal neurons are LSTM units and follow Figure 6 Connections shown. Figure 7 It is a basic LSTM-based autoencoder architecture with a single LSTM layer on both the encoder and decoder sides. LSTM-AE takes a window of time series length T as input and passes information along with the LSTM units. When the encoder reaches the last encoder state, such as Figure 7 As shown in (b), its cell state actually fixes the length of the input window and copies it to the decoder state as the initial cell, so the sequential input information is transmitted and stored in the decoder. The decoder makes predictions in the opposite sequential window, which makes it easier to optimize. It should be noted that, unlike deep LSTM, the output of the encoder at each time step is not directly used as the input of the decoder, and the logical connection between the encoder and the decoder is actually different from that of the stacked LSTM. Here, the output of the encoder is ignored, and different works have contributed to the study of the decoder input. Considering that the final cell state of the encoder has stored all the relevant information, the LSTM-AE feeds a constant vector for the anomaly detection task to the decoder. During the model optimization process, the size of the hidden layer representation vector, that is, the size of the cell state, is another hyperparameter that needs to be learned for initialization truncation. On large-scale datasets, the larger the hidden vector, the more information LSTM-AE can capture. Figure 7 Where E is the encoder, D is the decoder, x is the input, c is the storage unit that stores the encoder, d is the input of the decoder, and y is the output of the decoder.
[0065] Anomaly score and actual abnormal data detection: In the anomaly detection system of the embodiment of the present application, the anomaly detection score is innovatively defined using the mean and covariance of the reconstructed error distribution:
[0066] anomaly score = (e-μ) T ∑ -1 (e-μ) (7)
[0067] Where e is the absolute value of the sample reconstruction error, and μ and ∑ are the mean and covariance of the reconstruction error distribution, respectively. After LSTM-AE training, the error distribution of normal samples is often significantly abnormal from that of abnormal samples, that is, the corresponding error distribution mean and covariance are significantly different. Therefore, by defining anomaly score and its threshold screening, "abnormal" and "normal" can be distinguished more effectively. In the anomaly score threshold screening, the candidate thresholds are blocked according to the quantile of the anomaly score, and the data set composed of mixed "normal" and "abnormal" data is used for detection. The F1-score of the test result is calculated for each candidate threshold, and the anomaly score value corresponding to the maximum F1-score is taken as the screening threshold. In addition, we also compared the effect of directly using reconstruction error for anomaly detection. Its distinguishing ability is far inferior to the anomaly score, that is, the anomaly score can significantly improve the performance of anomaly detection. On actual large-scale business data, the anomaly score-based LSTM-AE proposed in the present invention can effectively identify abnormal data points, and its corresponding precision, recall and F1-score are as high as 0.95, 0.9 and 0.92 respectively.
[0068] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0069] According to another aspect of the embodiments of the present invention, there is also provided an abnormal data identification device for implementing the abnormal data identification method. Figure 8 As shown, the device comprises:
[0070] A first acquisition unit 802 is used to acquire target data to be detected;
[0071] An input unit 804 is used to input the target data into a target neural network model, wherein the target neural network model is a model obtained by training the original neural network model using the target sample data, the determination threshold of the target neural network model is a target determination threshold, the determination threshold is a threshold obtained according to the absolute value of the reconstruction error of the target sample data, the mean of the reconstruction error distribution, and the covariance, the determination threshold is used to identify whether the target sample data is normal data or abnormal data, and when the determination threshold is the target determination threshold, the target score of the target neural network model is the highest, and the target score is a weighted sum of the accuracy and coverage of the target neural network model;
[0072] The first determination unit 806 is used to determine whether the target data is normal data or abnormal data according to the recognition result output by the target neural network model.
[0073] Optionally, the abnormal data identification device can be applied to, but not limited to, the process of identifying numerical data or the process of identifying non-numerical data. If non-numerical data is identified, the non-numerical data is converted into a numerical variable.
[0074] In the process of identifying abnormal data, first, the data to be identified is obtained and input into the target neural network model. The target determination threshold of the determination threshold of the target neural network model is a threshold determined from multiple determination thresholds. Each determination threshold is a threshold obtained based on the absolute value of the reconstruction error of the target sample data, the mean and covariance of the reconstruction error distribution. The target score of the target neural network model under the target determination threshold is the highest, and the target score is the weighted sum of the accuracy and coverage of the target neural network model.
[0075] As an optional example, the device also includes: a second acquisition unit, used to acquire target sample data before inputting the target data into the target neural network model; a second determination unit, used to reconstruct the target sample data and determine the absolute value of the reconstruction error of each target sample data in the target sample data, the mean and covariance of the reconstruction error distribution; a third determination unit, used to determine the reconstruction score of each target sample data based on the absolute value of the reconstruction error, the mean and covariance of the reconstruction error distribution; a fourth determination unit, used to determine multiple judgment thresholds based on the reconstruction scores; and a fifth determination unit, used to determine a target judgment threshold from multiple judgment thresholds.
[0076] As an optional example, the fourth determination unit includes: a first determination module, used to determine each reconstruction score as a decision threshold, or sort the reconstruction scores according to size, and determine the average value of every two adjacent reconstruction scores in the sorted reconstruction scores as a decision threshold, or use the quantile of the reconstruction score as the decision threshold.
[0077] As an optional example, the fifth determination unit includes: a second determination module, used to determine the target score of the target neural network model corresponding to each determination threshold among multiple determination thresholds, wherein the target score is obtained by recognition accuracy and recognition coverage, and the determination threshold with the largest target score is determined as the target determination threshold.
[0078] As an optional example, the second determination module includes: an acquisition submodule, used to acquire a first number of target sample data, a second number of target sample data identified as abnormal data, and a total number of sample data in the sample data set where the target sample data is located; a first determination submodule, used to determine the ratio of the second number to the first number as the accuracy, and determine the ratio of the second number to the total number as the coverage; and a second determination submodule, used to input the accuracy and coverage into a predetermined formula to determine the target score.
[0079] As an optional example, the second determination submodule is further used to: determine the target score by using the above formula 1.
[0080] As an optional example, the first determination unit includes: a third determination module, used to determine that the target data is normal data when the recognition result is greater than the target determination threshold; a fourth determination module, used to determine that the target data is abnormal data when the recognition result is less than or equal to the target determination threshold.
[0081] For other examples of the embodiments of the present application, please refer to the above examples and will not be repeated here.
[0082] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0083] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0085] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0086] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0087] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for identifying abnormal data, characterized in that: include: Acquire target data to be detected; Input the target data into a target neural network model, wherein the target neural network model is a model obtained by training an original neural network model using target sample data, a determination threshold of the target neural network model is a target determination threshold, the determination threshold is a threshold obtained according to the absolute value of the reconstruction error of the target sample data, the mean and covariance of the reconstruction error distribution, the determination threshold is used to identify whether the target sample data is normal data or abnormal data, and when the determination threshold is the target determination threshold, the target score of the target neural network model is the highest, and the target score is a weighted sum of the accuracy and coverage of the target neural network model; Determining whether the target data is normal data or abnormal data according to a recognition result output by the target neural network model; Before inputting the target data into the target neural network model, the method further includes: Acquiring the target sample data; Reconstructing the target sample data, and determining the absolute value of the reconstruction error, the mean value and the covariance of the reconstruction error distribution of each target sample data in the target sample data; Determine a reconstruction score of each target sample data according to the absolute value of the reconstruction error, the mean and covariance of the reconstruction error distribution; Determining a plurality of the determination thresholds according to the reconstruction scores; Determining the target determination threshold from the plurality of determination thresholds; Determining the target determination threshold from the plurality of determination thresholds comprises: Determine a target score of the target neural network model corresponding to each of the plurality of determination thresholds; Determine the determination threshold with the maximum target score as the target determination threshold; In the determination of the plurality of determination thresholds, the target score of the target neural network model corresponding to each of the determination thresholds includes: Acquire a first quantity of the target sample data, a second quantity of the target sample data identified as abnormal data, and a total quantity of sample data in the sample data set where the target sample data is located; Determine a ratio of the second number to the first number as the accuracy, and determine a ratio of the second number to the total number as the coverage; Inputting the accuracy and the coverage into a predetermined formula to determine the target score; The target score is determined by the following formula: Among them, F β-score is the target score, precision is the accuracy, recall is the coverage, and β is a real number greater than 0.
2. The method according to claim 1, characterized in that Determining the plurality of decision thresholds according to the reconstruction scores comprises: Determine each of the reconstruction scores as a decision threshold; or sorting the reconstruction scores according to their magnitude, and determining an average value of every two adjacent reconstruction scores among the sorted reconstruction scores as a determination threshold; Alternatively, the quantile of the reconstruction score is used as the determination threshold.
3. The method according to any one of claims 1 to 2, characterized in that: Determining whether the target data is normal data or abnormal data according to the recognition result output by the target neural network model includes: When the recognition result is greater than the target determination threshold, determining that the target data is normal data; When the recognition result is less than or equal to the target determination threshold, the target data is determined to be abnormal data.
4. A device for identifying abnormal data, characterized in that: include: A first acquisition unit, used to acquire target data to be detected; An input unit, used to input the target data into a target neural network model, wherein the target neural network model is a model obtained by training an original neural network model using target sample data, a determination threshold of the target neural network model is a target determination threshold, the determination threshold is a threshold obtained according to an absolute value of a reconstruction error of the target sample data, a mean value of a reconstruction error distribution, and a covariance, the determination threshold is used to identify whether the target sample data is normal data or abnormal data, and when the determination threshold is the target determination threshold, the target score of the target neural network model is the highest, and the target score is a weighted sum of the accuracy and coverage of the target neural network model; A first determination unit, configured to determine whether the target data is normal data or abnormal data according to a recognition result output by the target neural network model; The device also includes: A second acquisition unit, used for acquiring the target sample data before inputting the target data into the target neural network model; A second determining unit is used to reconstruct the target sample data and determine the absolute value of the reconstruction error, the mean value and the covariance of the reconstruction error distribution of each target sample data in the target sample data; A third determining unit, configured to determine a reconstruction score of each target sample data according to an absolute value of the reconstruction error, a mean value and a covariance of the reconstruction error distribution; a fourth determining unit, configured to determine a plurality of the determination thresholds according to the reconstruction scores; a fifth determining unit, configured to determine the target determination threshold from the plurality of determination thresholds; The fifth determination unit includes: a second determination module, which is used to determine a target score of the target neural network model corresponding to each determination threshold among multiple determination thresholds, wherein the target score is obtained by the recognition accuracy and the recognition coverage, and the determination threshold with the largest target score is determined as the target determination threshold; The second determination module includes: an acquisition submodule, used to acquire a first number of target sample data, a second number of target sample data identified as abnormal data, and a total number of sample data in the sample data set where the target sample data is located; a first determination submodule, used to determine the ratio of the second number to the first number as the accuracy, and the ratio of the second number to the total number as the coverage; a second determination submodule, used to input the accuracy and the coverage into a predetermined formula to determine the target score; The target score is determined by the following formula: Among them, F β-score is the target score, precision is the accuracy, recall is the coverage, and β is a real number greater than 0.
5. The device according to claim 4, characterized in that The fourth determining unit includes: The first determination module is used to determine each of the reconstruction scores as a determination threshold, or to sort the reconstruction scores according to size and determine the average value of every two adjacent reconstruction scores in the sorted reconstruction scores as a determination threshold, or to use the quantile of the reconstruction score as the determination threshold.
Citation Information
Patent Citations
Anomaly detection system and anomaly detection method
CN108628281A
Single classifier anomaly detection method based on multilayer random neural network
CN109858509A
Time series data anomaly detection method fusing LSTM and GAN
CN110598851A
Data type determination method and device, storage medium and electronic device
CN110781433A
Abnormal power consumption behavior identification method based on improved deep self-encoding network
CN110929843A
