Unlabeled anomaly recognition method, device and storage medium based on supervision

By training the prediction model in the label-free anomaly identification method and calculating the mean and standard deviation of the prediction error, abnormal samples are identified, which solves the problem of poor anomaly detection results under label-free conditions in the existing technology and achieves high-accuracy anomalies. Identify.

CN110378386BActive Publication Date: 2024-09-06PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910537023.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-20
Publication Date
2024-09-06
Estimated Expiration
2039-06-20

AI Technical Summary

Technical Problem

Existing anomaly detection methods either require a large amount of labeled data (supervised) or have unsatisfactory results (unsupervised), making it difficult to achieve high-accuracy anomaly identification under unlabeled conditions.

Method used

A supervised unlabeled anomaly identification method is adopted to obtain the basic features and target features of unlabeled sample data, train the prediction model, calculate the mean and standard deviation of the prediction error, define abnormal critical points, and identify samples that are not within the normal range as abnormal.

Benefits of technology

It achieves high-accuracy anomaly identification of data under label-free conditions, improves the efficiency and accuracy of anomaly detection, and avoids dependence on label information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110378386B
    Figure CN110378386B
Patent Text Reader

Abstract

The present invention relates to the field of machine learning, and proposes a supervised unlabeled anomaly recognition method, device and storage medium, the method comprising: obtaining unlabeled sample data, the unlabeled sample data comprising basic features and target features corresponding to the basic features; inputting the basic features as input features and the target features as target variables into a prediction model for training; inputting the basic features into the trained prediction model for prediction, and outputting a prediction value corresponding to the target feature; obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error; and recording an unlabeled sample whose prediction error does not fall within the normal interval as an abnormal sample. The present invention does not require labeling of sample data, and can improve the accuracy of data anomaly recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of anomaly detection technology, and in particular to a supervised unlabeled anomaly recognition method, device and computer-readable storage medium. Background Art

[0002] Anomaly detection is the detection of data and behaviors that do not meet expectations. In practical applications, it includes denoising, network intrusion detection, fraud detection, equipment failure detection, opportunity identification, risk identification, special group identification, disease diagnosis, video monitoring, etc. Anomaly detection detects abnormal conditions by analyzing input data. Input data types include: continuous, binary, categorical, graph, spatiotemporal data, image, audio, etc., and outputs abnormal events or abnormal probabilities. When choosing anomaly detection methods, we must consider both the problem to be solved and the data status, such as data type, data distribution, data labeling, data volume, etc.

[0003] Existing anomaly detection methods are either supervised or unsupervised. Supervised methods require a large amount of labeled data, which is often difficult to obtain in practical applications; while unsupervised detection methods require manual assumptions about data distribution, and since there is no labeled information, the effect is often not as ideal as supervised methods.

[0004] Currently, there is an urgent need for an anomaly recognition method that can be applied to supervised and unlabeled environments. Summary of the invention

[0005] The present invention provides a supervised unlabeled anomaly recognition method, an electronic device and a computer-readable storage medium, the main purpose of which is to perform anomaly recognition on unlabeled data in a supervised manner, with low data requirements and high recognition accuracy.

[0006] To achieve the above object, the present invention provides a supervised unlabeled anomaly recognition method, which is applied to an electronic device, and is characterized in that the method comprises:

[0007] Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features;

[0008] Inputting the basic features as input features and the target features as target variables into a prediction model for training;

[0009] Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature;

[0010] Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error;

[0011] Unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples.

[0012] Preferably, the prediction model is an xgboost model, a CART model, an adaboost model or a GBDT.

[0013] Preferably, the prediction error is the absolute difference between the predicted value and the target feature.

[0014] Preferably, the step of determining a normal interval according to the prediction error comprises:

[0015] Obtaining the mean and standard deviation of the prediction error;

[0016] defining two abnormal critical points based on the mean and standard deviation of the prediction errors;

[0017] The normal interval is the interval between the two abnormal critical points.

[0018] Preferably, the two abnormal critical points are and The normal range is

[0019] in, is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

[0020] To achieve the above object, the present invention further provides an electronic device, which includes: a memory and a processor, wherein the memory includes a supervised unlabeled anomaly recognition program, and when the supervised unlabeled anomaly recognition program is executed by the processor, the following steps are implemented:

[0021] Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features;

[0022] Inputting the basic features as input features and the target features as target variables into a prediction model for training;

[0023] Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature;

[0024] Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error;

[0025] Unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples.

[0026] Preferably, the step of determining a normal interval according to the prediction error comprises:

[0027] Obtaining the mean and standard deviation of the prediction error;

[0028] defining two abnormal critical points based on the mean and standard deviation of the prediction errors;

[0029] The normal interval is the interval between the two abnormal critical points.

[0030] Preferably, the two abnormal critical points are and The normal range is

[0031] in, is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

[0032] Preferably, the prediction error is the absolute difference between the predicted value and the target feature.

[0033] To achieve the above objectives, the present invention also provides a computer-readable storage medium, which includes a supervised unlabeled anomaly recognition program. When the supervised unlabeled anomaly recognition program is executed by a processor, any step in the supervised unlabeled anomaly recognition method as described above is implemented.

[0034] The supervised unlabeled anomaly recognition method, electronic device and computer-readable storage medium proposed in the present invention train the prediction model through a large amount of unlabeled sample data, and determine the normal interval range according to the difference between the predicted value output by the prediction model and the true value (target feature). The sample data is identified as anomaly through the normal interval. The sample data does not require labeling information and is identified in a supervised manner, which can improve the accuracy of data anomaly recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of an application environment according to a specific embodiment of the supervised unlabeled anomaly recognition method of the present invention;

[0036] Figure 2 for Figure 1 A module diagram of a specific embodiment of a supervised unlabeled anomaly recognition program;

[0037] Figure 3 The process of the specific embodiment of the supervised unlabeled anomaly recognition method of the present invention is as follows Figure 1 ;

[0038] Figure 4The process of the specific embodiment of the supervised unlabeled anomaly recognition method of the present invention is as follows Figure 2 .

[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0040] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0041] The present invention provides a supervised unlabeled anomaly recognition method, which is applied to an electronic device 1. Figure 1 , which is a schematic diagram of the application environment of a preferred embodiment of the supervised unlabeled anomaly recognition method of the present invention.

[0042] In this embodiment, the electronic device 1 may be a terminal device with computing functions, such as a server, a smart phone, a tablet computer, a portable computer, or a desktop computer.

[0043] The electronic device 1 includes a processor 12 , a memory 11 , a network interface 14 and a communication bus 15 .

[0044] The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory 11, etc. In some embodiments, the readable storage medium may be an internal storage unit of the electronic device 1, such as a hard disk of the electronic device 1. In other embodiments, the readable storage medium may also be an external memory 11 of the electronic device 1, such as a plug-in hard disk equipped on the electronic device 1, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc.

[0045] In this embodiment, the readable storage medium of the memory 11 is generally used to store the supervised unlabeled anomaly recognition program 10 installed in the electronic device 1. The memory 11 can also be used to temporarily store data that has been output or is to be output.

[0046] In some embodiments, the processor 12 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 11, such as executing a supervised unlabeled anomaly recognition program 10.

[0047] The network interface 14 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), and is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0048] The communication bus 15 is used to realize the connection and communication between these components.

[0049] Figure 1 The electronic device 1 is shown only with components 11 - 15 , but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0050] Optionally, the electronic device 1 may further include a user interface, which may include an input unit such as a keyboard, a voice input device such as a microphone and other devices with voice recognition function, a voice output device such as a speaker, headphones, etc. Optionally, the user interface may also include a standard wired interface or a wireless interface.

[0051] Optionally, the electronic device 1 may further include a display, which may also be referred to as a display screen or a display unit. In some embodiments, it may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an organic light-emitting diode (OLED) touch device. The display is used to display information processed in the electronic device 1 and to display a visual user interface.

[0052] Optionally, the electronic device 1 further includes a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is called a touch control area. In addition, the touch sensor described here may be a resistive touch sensor, a capacitive touch sensor, etc. Moreover, the touch sensor includes not only a contact touch sensor, but also a proximity touch sensor, etc. In addition, the touch sensor may be a single sensor or a plurality of sensors arranged in an array, for example.

[0053] In addition, the area of ​​the display of the electronic device 1 can be the same as or different from the area of ​​the touch sensor. Optionally, the display and the touch sensor are stacked to form a touch display screen. The device detects touch operations triggered by the user based on the touch display screen.

[0054] Optionally, the electronic device 1 may further include a radio frequency (RF) circuit, a sensor, an audio circuit, etc., which will not be described in detail here.

[0055] exist Figure 1In the device embodiment shown, the memory 11 as a computer storage medium may include an operating system and a supervised unlabeled anomaly recognition program 10; when the processor 12 executes the supervised unlabeled anomaly recognition program 10 stored in the memory 11, the following steps are implemented:

[0056] Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features;

[0057] Inputting the basic features as input features and the target features as target variables into a prediction model for training;

[0058] Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature;

[0059] Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error;

[0060] Unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples.

[0061] Among them, the basic features are the input features of the unlabeled sample data to be identified, and the target features are the output features of the unlabeled sample data to be identified. For example, when the application scenario is abnormal electricity consumption, the input features can be season and weather, and the output features are electricity consumption, and then the abnormal electricity consumption is tested and identified. When the application scenario is employee system access, the input features can be employee age, company length of service, position, etc., and the output features are the employee's system access within a certain period of time, and then the system access is identified as abnormal.

[0062] In the process of predictive model training, the unlabeled sample data is used as training data, and its input features and target features are input into the predictive model for training. After the model training is completed, the basic features in the unlabeled sample data are input into the predictive model again for prediction, and the predicted value corresponding to the real target feature can be obtained.

[0063] Preferably, the prediction model can be selected from an xgboost (eXtreme Gradient Boosting) model, a CART model, an adaboost (adaptive boosting) model or a GBDT (GradientBoosting Decision Tree).

[0064] Among them, CART (Classification and regression tree) is a learning method for the conditional probability distribution of the output random variable Y (target feature) under the condition of a given input random variable X (basic feature). CART assumes that the decision tree is a binary tree, and the values ​​of the internal node features are "yes" and "no". The left branch is the branch with the value of "yes", and the right branch is the branch with the value of "no". Such a decision tree is equivalent to recursively dividing each feature into two, dividing the input space, that is, the feature space, into a finite number of units, and determining the predicted probability distribution on these units, that is, the conditional probability distribution of the output under the given input. It consists of tree generation and tree pruning.

[0065] The principle of GBDT is mainly to use the training set and the true value of the sample (that is, the standard answer) to train a tree, and then use this tree to predict the training set to obtain the predicted value corresponding to each sample. Since there is a certain deviation between the predicted value and the true value, the "residual" can be obtained by subtracting the two. Next, the second tree is trained. At this time, the true value is no longer used, but the residual is used as the standard answer. After the training of the two trees is completed, the residual of each sample can be obtained again, and then the third tree can be further trained, and so on. The total number of trees can be specified manually, or certain indicators (such as the error on the validation set) can be monitored to stop training. When predicting a new sample, each tree will have an output value. Adding these output values ​​​​will get the final predicted value of the sample.

[0066] Preferably, the prediction error is the absolute difference between the predicted value and the target feature.

[0067] Furthermore, the step of determining a normal interval according to the prediction error includes:

[0068] Obtaining the mean and standard deviation of the prediction error;

[0069] defining two abnormal critical points based on the mean and standard deviation of the prediction errors;

[0070] The normal interval is the interval between the two abnormal critical points.

[0071] The two abnormal critical points are and The normal range is is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

[0072] The mean calculation formula of the prediction error is:

[0073]

[0074] in, is the mean of the prediction error, x i is each prediction error, n is the number of prediction errors;

[0075] The standard deviation calculation formula of the prediction error is:

[0076]

[0077] in, is the standard deviation of the prediction error, is the mean of the prediction error, x i are the prediction errors, and N is the number of prediction errors.

[0078] The supervised unlabeled anomaly recognition method provided by the present invention can be applied to various anomaly recognition scenarios. As a specific example, the anomaly recognition process of the present invention will be described in detail below by taking the employee system access volume as an example.

[0079] First, a large amount of unlabeled sample data is obtained. The unlabeled sample data further includes basic features, that is, basic information of employees, such as age, position, length of service, etc., and target features, that is, employees' historical / current system access volume. System access volume is related to employees' access time and access times. The unlabeled sample data is shown in the following table:

[0080]

[0081] The above-mentioned time series data are all unlabeled sample data, which are input into the prediction model as training data for model training (their sample ID and time period are not input into the prediction model), where the basic features are used as input features and the target features are used as target variables, and both are input into the prediction model for training at the same time.

[0082] After the prediction model training is completed, the basic features in the unlabeled sample data are separately input into the trained prediction model for prediction, and the predicted system access volume is output. The difference between the predicted value and the actual system access volume is the prediction error of the prediction model. In other words, the prediction error is the difference between the predicted system access volume output by the prediction model and the actual system access volume.

[0083] Then, the mean and standard deviation of the prediction errors are calculated based on the prediction errors.

[0084] The mean calculation formula of the prediction error is:

[0085]

[0086] in, is the mean of the prediction error, x iis each prediction error, n is the number of prediction errors;

[0087] The standard deviation calculation formula of the prediction error is:

[0088]

[0089] in, is the standard deviation of the prediction error, is the mean of the prediction error, x i are the prediction errors, and N is the number of prediction errors.

[0090] According to the mean and standard deviation of the prediction error, the abnormal critical point is determined as and The normal range is Among them, a is a preset coefficient, and the value can be set according to the test requirements. It is usually set to 3, which means that sample data outside 3 times the standard deviation are defined as abnormal data.

[0091] Then, according to the normal interval, the unlabeled samples whose prediction errors do not fall within the normal interval are recorded as abnormal samples, and the abnormal situation of the employee's system access volume is obtained. In the application process, the basic features of the unlabeled sample data are input into the prediction model for abnormal identification to identify whether the current employee's system access volume is abnormal.

[0092] The electronic device 1 proposed in the above embodiment trains a prediction model through a large amount of unlabeled sample data, and then predicts and identifies the unlabeled data through the prediction model. This method does not require any label information, and at the same time can improve the accuracy of anomaly recognition through supervised methods.

[0093] In other embodiments, the supervised unlabeled anomaly recognition program 10 can also be divided into one or more modules, one or more modules are stored in the memory 11 and executed by the processor 12 to complete the present invention. The module referred to in the present invention refers to a series of computer program instruction segments that can complete a specific function. Figure 2 As shown, Figure 1 A program module diagram of a preferred embodiment of a supervised unlabeled anomaly recognition program 10.

[0094] like Figure 2 As shown, the supervised unlabeled anomaly recognition procedure 10 can be divided into:

[0095] The sample data acquisition unit 101 is used to acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features.

[0096] The prediction model training unit 102 is used to input the basic features as input features and the target features as target variables into the prediction model for training.

[0097] The prediction unit 103 is used to input the basic features into the trained prediction model for prediction, and output the prediction value corresponding to the target feature.

[0098] The normal interval determination unit 104 is used to obtain the prediction error of the prediction model based on the prediction value and the target feature, and determine the normal interval according to the prediction error.

[0099] The identification unit 105 is configured to record the unlabeled samples whose prediction errors do not fall within the normal range as abnormal samples.

[0100] In addition, the present invention also provides a supervised unlabeled anomaly recognition method. Figure 3 and Figure 4 , which is a flowchart of different embodiments of the supervised unlabeled anomaly recognition method of the present invention. The method can be executed by a device, which can be implemented by software and / or hardware.

[0101] In this embodiment, the supervised unlabeled anomaly recognition method includes: step S110 to step S150.

[0102] S110: Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features.

[0103] Among them, the basic features are the input features of the unlabeled sample data to be identified, and the target features are the output features of the unlabeled sample data to be identified. For example, when the application scenario is abnormal electricity consumption, the input features can be season and weather, and the output features are electricity consumption, and then the abnormal electricity consumption is tested and identified. When the application scenario is employee system access, the input features can be employee age, company length of service, position, etc., and the output features are the employee's system access within a certain period of time, and then the system access is identified as abnormal.

[0104] Preferably, the prediction model can be selected from an xgboost (eXtreme Gradient Boosting) model, a CART model, an adaboost (adaptive boosting) model or a GBDT (GradientBoosting Decision Tree).

[0105] Among them, CART (Classification and regression tree) is a learning method for the conditional probability distribution of the output random variable Y (target feature) under the condition of a given input random variable X (basic feature). CART assumes that the decision tree is a binary tree, and the values ​​of the internal node features are "yes" and "no". The left branch is the branch with the value of "yes", and the right branch is the branch with the value of "no". Such a decision tree is equivalent to recursively dividing each feature into two, dividing the input space, that is, the feature space, into a finite number of units, and determining the predicted probability distribution on these units, that is, the conditional probability distribution of the output under the given input. It consists of tree generation and tree pruning.

[0106] The principle of GBDT is mainly to use the training set and the true value of the sample (that is, the standard answer) to train a tree, and then use this tree to predict the training set to obtain the predicted value corresponding to each sample. Since there is a certain deviation between the predicted value and the true value, the "residual" can be obtained by subtracting the two. Next, the second tree is trained. At this time, the true value is no longer used, but the residual is used as the standard answer. After the training of the two trees is completed, the residual of each sample can be obtained again, and then the third tree can be further trained, and so on. The total number of trees can be specified manually, or certain indicators (such as the error on the validation set) can be monitored to stop training. When predicting a new sample, each tree will have an output value. Adding these output values ​​​​will get the final predicted value of the sample.

[0107] S120: Input the basic features as input features and the target features as target variables into a prediction model for training.

[0108] In the process of predictive model training, unlabeled sample data is used as training data, and its input features and target features are input into the predictive model for training.

[0109] S130: Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature.

[0110] After the model training is completed, the basic features in the unlabeled sample data are input into the prediction model again for prediction, and the prediction values ​​corresponding to the actual target features can be obtained.

[0111] S140: Obtain a prediction error of the prediction model based on the prediction value and the target feature, and determine a normal interval according to the prediction error.

[0112] The prediction error is the absolute difference between the predicted value and the target feature.

[0113] The step of determining the normal interval according to the prediction error comprises:

[0114] First, obtain the mean and standard deviation of the prediction error;

[0115] Then, two abnormal critical points are defined based on the mean and standard deviation of the prediction errors;

[0116] Finally, the normal interval is the interval between the two abnormal critical points.

[0117] The two abnormal critical points are and The normal range is is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

[0118] The mean calculation formula of the prediction error is:

[0119]

[0120] in, is the mean of the prediction error, x i is each prediction error, n is the number of prediction errors;

[0121] The standard deviation calculation formula of the prediction error is:

[0122]

[0123] in, is the standard deviation of the prediction error, is the mean of the prediction error, x i are the prediction errors, and N is the number of prediction errors.

[0124] S150: Recording unlabeled samples whose prediction errors do not fall within the normal range as abnormal samples.

[0125] The supervised unlabeled anomaly recognition method provided by the present invention can be applied to various anomaly recognition scenarios. As a specific example, the anomaly recognition process of the present invention will be described in detail below by taking the employee system access volume as an example.

[0126] First, a large amount of unlabeled sample data is obtained. The unlabeled sample data further includes basic features, that is, basic information of employees, such as age, position, length of service, etc., and target features, that is, employees' historical / current system access volume. System access volume is related to employees' access time and access times. The unlabeled sample data is shown in the following table:

[0127]

[0128] The above-mentioned time series data are all unlabeled sample data, which are input into the prediction model as training data for model training (their sample ID and time period are not input into the prediction model), where the basic features are used as input features and the target features are used as target variables, and both are input into the prediction model for training at the same time.

[0129] After the prediction model training is completed, the basic features in the unlabeled sample data are separately input into the trained prediction model for prediction, and the predicted system access volume is output. The difference between the predicted value and the actual system access volume is the prediction error of the prediction model. In other words, the prediction error is the difference between the predicted system access volume output by the prediction model and the actual system access volume.

[0130] Then, the mean and standard deviation of the prediction errors are calculated based on the prediction errors.

[0131] The mean calculation formula of the prediction error is:

[0132]

[0133] in, is the mean of the prediction error, x i is each prediction error, n is the number of prediction errors;

[0134] The standard deviation calculation formula of the prediction error is:

[0135]

[0136] in, is the standard deviation of the prediction error, is the mean of the prediction error, x i are the prediction errors, and N is the number of prediction errors.

[0137] According to the mean and standard deviation of the prediction error, the abnormal critical point is determined as and The normal range is Among them, a is a preset coefficient, and the value can be set according to the test requirements. It is usually set to 3, which means that sample data outside 3 times the standard deviation are defined as abnormal data.

[0138] Then, according to the normal interval, the unlabeled samples whose prediction errors do not fall within the normal interval are recorded as abnormal samples, and the abnormal situation of the employee's system access volume is obtained. In the application process, the basic features of the unlabeled sample data are input into the prediction model for abnormal identification to identify whether the current employee's system access volume is abnormal.

[0139] The supervised unlabeled anomaly identification method proposed in the above embodiment trains the prediction model through a large amount of unlabeled sample data, and determines the normal interval range based on the difference between the predicted value output by the prediction model and the true value. The sample data is identified for anomalies through the normal interval, so that the sample data does not require labeling information and is identified in a supervised manner, which can improve the accuracy of data anomaly identification.

[0140] In addition, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a supervised unlabeled anomaly recognition program, and when the supervised unlabeled anomaly recognition program is executed by a processor, the following operations are implemented:

[0141] Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features;

[0142] Inputting the basic features as input features and the target features as target variables into a prediction model for training;

[0143] Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature;

[0144] Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error;

[0145] Unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples.

[0146] Preferably, the prediction model is an xgboost model, a CART model, an adaboost model or a GBDT.

[0147] Preferably, the prediction error is the absolute difference between the predicted value and the target feature.

[0148] Preferably, the step of determining a normal interval according to the prediction error comprises:

[0149] Obtaining the mean and standard deviation of the prediction error;

[0150] defining two abnormal critical points based on the mean and standard deviation of the prediction errors;

[0151] The normal interval is the interval between the two abnormal critical points.

[0152] Preferably, the two abnormal critical points are and The normal range is

[0153] in, is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

[0154] Preferably, the mean calculation formula of the prediction error is:

[0155]

[0156] in, is the mean of the prediction error, x i is each prediction error, n is the number of prediction errors;

[0157] The standard deviation calculation formula of the prediction error is:

[0158]

[0159] in, is the standard deviation of the prediction error, is the mean of the prediction error, x i are the prediction errors, and N is the number of prediction errors.

[0160] Preferably, the prediction error is the absolute difference between the predicted value and the target feature.

[0161] The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the specific implementation of the above-mentioned supervised unlabeled anomaly recognition method and electronic device, and will not be described in detail here.

[0162] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, device, article or method including the element.

[0163] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. Through the description of the above implementation modes, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation mode. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0164] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A supervised unlabeled anomaly recognition method applied to electronic devices, characterized in that: The method comprises: Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features; Input the basic features as input features and the target features as target variables into a prediction model for training; wherein the prediction model is an xgboost model, a CART model, an adaboost model or a GBDT; Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature; Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error; The unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples; The step of determining the normal interval according to the prediction error comprises: Obtaining the mean and standard deviation of the prediction error; defining two abnormal critical points based on the mean and standard deviation of the prediction errors; The normal interval is the interval between the two abnormal critical points; The two abnormal critical points are and The normal range is in, is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

2. The supervised unlabeled anomaly recognition method according to claim 1, characterized in that: The prediction error is the absolute difference between the predicted value and the target feature.

3. An electronic device, characterized in that: The electronic device includes: a memory and a processor, wherein the memory includes a supervised unlabeled anomaly recognition program, and when the supervised unlabeled anomaly recognition program is executed by the processor, the following steps are implemented: Acquire unlabeled sample data, where the unlabeled sample data includes basic features and target features corresponding to the basic features; Input the basic features as input features and the target features as target variables into a prediction model for training; wherein the prediction model is an xgboost model, a CART model, an adaboost model or a GBDT; Inputting the basic features into the trained prediction model for prediction, and outputting the prediction value corresponding to the target feature; Obtaining a prediction error of the prediction model based on the prediction value and the target feature, and determining a normal interval according to the prediction error; The unlabeled samples whose prediction errors do not fall within the normal range are recorded as abnormal samples; and the step of determining the normal range according to the prediction errors comprises: Obtaining the mean and standard deviation of the prediction error; defining two abnormal critical points based on the mean and standard deviation of the prediction errors; The normal interval is the interval between the two abnormal critical points; the two abnormal critical points are respectively and The normal range is in, is the mean of the prediction error, a is the preset coefficient, and σ is the standard deviation of the prediction error.

4. The electronic device according to claim 3, characterized in that: The prediction error is the absolute difference between the predicted value and the target feature.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a supervised unlabeled anomaly recognition program. When the supervised unlabeled anomaly recognition program is executed by a processor, the steps of the supervised unlabeled anomaly recognition method according to claim 1 or 2 are implemented.