Object detection model training method and device, equipment and storage medium
By obtaining and processing sample object data in financial business, training autoencoder and detection model, generating object confidence scores and category pseudo-labels, and updating the model, the problem of low accuracy of abnormal object detection in financial business is solved, and the problem of improved Model detection capability.
Patent Information
- Application Number
- CN202411128097.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-10
AI Technical Summary
In the field of financial business, in the prior art, due to insufficient labeled data in abnormal object detection and unbalanced data sets, the model has low accuracy in detecting abnormal object.
By obtaining the first sample object data with the sample object category label and the second sample object data without the sample object category label, training the autoencoder and detection model, calculating the loss value and exception probability vector, generating the object confidence score and Category pseudo-labels are used to update models, and loop iterative training is used to improve detection accuracy.
It effectively compensates for the problem of insufficient training data, improves the accuracy of the model for abnormal objects detection, and reduces the defect of low accuracy of semi-supervised learning.
Smart Images

Figure CN119106352A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of artificial intelligence and financial technology, and in particular to a training method and apparatus, device and storage medium for an object detection model. Background Art
[0002] At present, in various financial business fields, there are often some abnormal objects that perform transaction processing that does not meet the requirements, and the execution of such transactions often affects resource security. In this regard, the relevant technology adopts an abnormal object detection method based on a graph neural network model to detect whether each object executing a financial transaction is an abnormal object.
[0003] However, in reality, the objects that are truly judged as abnormal objects are often few in number, and most objects are normal objects. This makes it difficult to obtain a large amount of labeled data, and the number of normal objects in the obtained labeled data is much larger than the number of abnormal objects, resulting in insufficient labeled data and unbalanced data sets during model training. This phenomenon will greatly affect the effect of model training and make the model's detection accuracy of abnormal objects low. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a training method and apparatus, device and storage medium for an object detection model, aiming to improve the model's detection accuracy for abnormal objects.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a method for training an object detection model, and the method for training an object detection model includes:
[0006] Acquire first sample object data of a first sample object and second sample object data of a second sample object, wherein the first sample object has a sample object category label, and the second sample object does not have a sample object category label;
[0007] Training a first autoencoder, a second autoencoder, and an original detection model based on the first sample object data;
[0008] Based on the second sample object data, calculating a first loss value of the second sample object by using the trained first autoencoder, and calculating a second loss value of the second sample object by using the trained second autoencoder;
[0009] Inputting the second sample object data into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object;
[0010] Calculating an object confidence score of the second sample object based on the first loss value, the second loss value, and the sample object abnormality probability vector;
[0011] generating an object category pseudo label for the second sample object based on the object confidence score and the sample object abnormality probability vector, and updating the first sample object based on the second sample object with the object category pseudo label;
[0012] The original detection model is trained based on the updated first sample object data of the first sample object to obtain the object detection model.
[0013] In some embodiments, the trained original detection model is integrated by a plurality of sub-models; the second sample object data includes sample object basic information of the second sample object and sample transaction information of a sample associated transaction generated by the second sample object;
[0014] The step of inputting the second sample object data into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object includes:
[0015] Based on the sample object basic information and the sample transaction information, performing anomaly scoring on the second sample object through each of the sub-models to obtain a sample anomaly probability sub-vector output by each of the sub-models;
[0016] Based on the total number of the sub-models, vector averaging is performed on a plurality of the sample abnormality probability sub-vectors to obtain the sample object abnormality probability vector.
[0017] In some embodiments, calculating the object confidence score of the second sample object based on the first loss value, the second loss value, and the sample object abnormality probability vector includes:
[0018] Normalizing the sample object abnormal probability vector to obtain a sample object abnormality score;
[0019] Calculating the difference between the first loss value and the second loss value to obtain a loss difference;
[0020] The abnormal score of the sample object and the absolute value of the loss difference are calculated to obtain the object confidence score.
[0021] In some embodiments, there are multiple second sample objects; generating an object category pseudo label of the second sample object based on the object confidence score and the sample object abnormality probability vector, and updating the first sample object based on the second sample object with the object category pseudo label includes:
[0022] Based on the object confidence score, screening out an intermediate sample object from a plurality of the second sample objects;
[0023] Determining the object category pseudo label of the intermediate sample object based on the sample object anomaly probability vector of the intermediate sample object;
[0024] For the intermediate sample object, based on the magnitude relationship between the first loss value and the second loss value, determining a reference classification identifier of the intermediate sample object;
[0025] The intermediate sample object whose object category pseudo label is consistent with the reference classification identifier is determined as a candidate sample object, and the candidate sample object is merged with the first sample object to update the first sample object.
[0026] In some embodiments, the step of selecting an intermediate sample object from a plurality of the second sample objects based on the object confidence score includes:
[0027] Arranging the plurality of second sample objects based on the object confidence scores to obtain a first ranking;
[0028] The second sample object with a predetermined ranking in the first ranking is determined as the middle sample object.
[0029] In some embodiments, the first sample object includes a positive sample object and a negative sample object, and the first sample object data includes positive sample data of the positive sample object and negative sample data of the negative sample object; the original detection model is formed by a collection of multiple sub-models;
[0030] The training of the first autoencoder, the second autoencoder, and the original detection model based on the first sample object data includes:
[0031] Training the first autoencoder based on the negative sample data of the negative sample object;
[0032] Training the second autoencoder based on the positive sample data of the positive sample object;
[0033] Each of the sub-models is trained based on the positive sample data and the negative sample data.
[0034] To achieve the above objective, a second aspect of an embodiment of the present application provides an object detection method, the method comprising:
[0035] Acquire object association data of a target object, where the object association data is used to indicate basic object information of the target object and transaction content information of a target association transaction generated by the target object;
[0036] Inputting the basic object information and the transaction content information into a preset object detection model, wherein the object detection model is integrated by a plurality of pre-trained object detection sub-models, and the object detection model is generated according to the training method of the object detection model described in the first aspect;
[0037] Based on the basic information of the object and the transaction content information, the target object is scored for abnormality by each of the object detection sub-models to obtain an abnormal probability sub-vector output by each of the object detection sub-models;
[0038] Integrate the multiple abnormal probability sub-vectors to obtain the abnormal probability vector of the target object;
[0039] The abnormal probability vector is normalized based on a preset function to obtain a target object detection label of the target object, wherein the target object detection label is used to indicate that the target object is an abnormal object or to indicate that the target object is a normal object.
[0040] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides a training device for an object detection model, wherein the training device for an object detection model comprises:
[0041] an acquiring unit, configured to acquire first sample object data of a first sample object and second sample object data of a second sample object, wherein the first sample object has a sample object category label, and the second sample object does not have a sample object category label;
[0042] A first training unit, configured to train a first autoencoder, a second autoencoder, and an original detection model based on the first sample object data;
[0043] A first calculation unit is used to calculate a first loss value of the second sample object through the trained first autoencoder based on the second sample object data, and calculate a second loss value of the second sample object through the trained second autoencoder;
[0044] a detection unit, configured to input the second sample object data into the trained original detection model to perform object anomaly detection, and obtain a sample object anomaly probability vector of the second sample object;
[0045] a second calculation unit, configured to calculate an object confidence score of the second sample object based on the first loss value, the second loss value, and the sample object abnormality probability vector;
[0046] a generating unit, configured to generate an object category pseudo label of the second sample object based on the object confidence score and the sample object abnormality probability vector, and update the first sample object based on the second sample object with the object category pseudo label;
[0047] The second training unit is used to train the original detection model based on the updated first sample object data of the first sample object to obtain the object detection model.
[0048] To achieve the above objective, a fourth aspect of an embodiment of the present application provides an object detection device, the object detection device comprising:
[0049] An acquisition module, used for acquiring object association data of a target object, wherein the object association data is used for indicating basic object information of the target object and transaction content information of a target association transaction generated by the target object;
[0050] An input module, used to input the basic object information and the transaction content information into a preset object detection model, wherein the object detection model is integrated by a plurality of pre-trained object detection sub-models, and the object detection model is generated according to the training method of the object detection model described above;
[0051] A scoring module, configured to perform anomaly scoring on the target object through each of the object detection sub-models based on the object basic information and the transaction content information, and obtain anomaly probability sub-vectors output by each of the object detection sub-models;
[0052] An integration module, used for integrating the plurality of abnormal probability sub-vectors to obtain an abnormal probability vector of the target object;
[0053] A normalization module is used to normalize the abnormal probability vector based on a preset function to obtain a target object detection label of the target object, wherein the target object detection label is used to indicate that the target object is an abnormal object or to indicate that the target object is a normal object.
[0054] To achieve the above-mentioned purpose, the fifth aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned object detection method or object detection model training method when executing the computer program.
[0055] To achieve the above-mentioned purpose, the sixth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned object detection method or object detection model training method.
[0056] The object detection model training method, object detection method and device, electronic device and storage medium proposed in the present application can enrich the data of the sample object by obtaining the first sample object data of the first sample object with the sample object category label and the second sample object data of the second sample object without the sample object category label. Then, based on the first sample object data, the first autoencoder, the second autoencoder, and the original detection model are trained to realize unsupervised training of the first autoencoder and the second autoencoder, and to realize supervised training of the original detection model. Further, based on the second sample object data, the first loss value of the second sample object is calculated by the trained first autoencoder, and the second loss value of the second sample object is calculated by the trained second autoencoder; the second sample object data is input into the trained original detection model for object anomaly detection, and the sample object anomaly probability vector of the second sample object is obtained, which can more conveniently determine the abnormal prediction of the second sample object by the original detection model. Furthermore, based on the first loss value, the second loss value and the sample object abnormal probability vector, the object confidence score of the second sample object is calculated; based on the object confidence score and the sample object abnormal probability vector, the object category pseudo-label of the second sample object is generated, and the first sample object is updated based on the second sample object with the object category pseudo-label. This method selects the second sample object data with higher credibility of the object category pseudo-label according to the object confidence score and puts it into the training data set where the first sample object is located, which can effectively make up for the defect of insufficient training data in related technologies and the defect of low accuracy of semi-supervised learning. Finally, the original detection model is trained based on the first sample object data after the update to obtain the object detection model, and the model training is performed in a loop iteration manner, which can improve the accuracy of the model in detecting abnormal objects. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 is a flow chart of a method for training an object detection model provided in an embodiment of the present application;
[0058] Figure 2 is a schematic diagram of a specific implementation process of determining the first loss value and the second loss value in an embodiment of the present application;
[0059] Figure 3 yes Figure 1 Flow chart of step S104 in FIG.
[0060] Figure 4 It is a schematic diagram of a specific implementation process of generating an abnormal probability vector of a sample object in an embodiment of the present application;
[0061] Figure 5 yes Figure 1Flow chart of step S105 in FIG.
[0062] Figure 6 yes Figure 1 Flow chart of step S106 in FIG.
[0063] Figure 7 yes Figure 6 Flow chart of step S601 in FIG.
[0064] Figure 8 is a flow chart of an object detection method provided in an embodiment of the present application;
[0065] Fig. 9 It is a structural schematic diagram of a training device for an object detection model provided in an embodiment of the present application;
[0066] Fig.10 is a schematic diagram of the structure of an object detection device provided in an embodiment of the present application;
[0067] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0069] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0070] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0071] The training method, apparatus, device and storage medium of the object detection model provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the training method of the object detection model in the embodiments of the present application is described.
[0072] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0073] The training method of the object detection model provided in the embodiment of the present application relates to the field of financial technology. The training method of the object detection model provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements a data processing method, etc., but is not limited to the above forms.
[0074] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0075] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the identity or characteristics of the object, such as object information, object behavior data, object historical data, and object location information, the permission or consent of the object will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the personal information of the object, the separate permission or separate consent of the object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the object, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0076] Figure 1 is an optional flowchart of the object detection model training method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S107.
[0077] Step S101, obtaining first sample object data of a first sample object and second sample object data of a second sample object;
[0078] Step S102, training a first autoencoder, a second autoencoder, and an original detection model based on the first sample object data;
[0079] Step S103, based on the second sample object data, calculating the first loss value of the second sample object through the trained first autoencoder, and calculating the second loss value of the second sample object through the trained second autoencoder;
[0080] Step S104, inputting the second sample object data into the trained original detection model to perform object anomaly detection, and obtaining a sample object anomaly probability vector of the second sample object;
[0081] Step S105, calculating the object confidence score of the second sample object based on the first loss value, the second loss value and the sample object abnormality probability vector;
[0082] Step S106, generating an object category pseudo label of a second sample object based on the object confidence score and the sample object abnormality probability vector, and updating the first sample object based on the second sample object with the object category pseudo label;
[0083] Step S107: training the original detection model based on the updated first sample object data of the first sample object to obtain an object detection model.
[0084] Steps S101 to S107 shown in the embodiment of the present application can enrich the data of the sample object by obtaining the first sample object data of the first sample object with the sample object category label and the second sample object data of the second sample object without the sample object category label. Then, based on the first sample object data, the first autoencoder, the second autoencoder, and the original detection model are trained to achieve unsupervised training of the first autoencoder and the second autoencoder, and supervised training of the original detection model. Further, based on the second sample object data, the first loss value of the second sample object is calculated by the trained first autoencoder, and the second loss value of the second sample object is calculated by the trained second autoencoder; the second sample object data is input into the trained original detection model for object anomaly detection, and the sample object anomaly probability vector of the second sample object is obtained, which can more conveniently determine the abnormal prediction of the original detection model for the second sample object. Furthermore, based on the first loss value, the second loss value and the sample object abnormal probability vector, the object confidence score of the second sample object is calculated; based on the object confidence score and the sample object abnormal probability vector, the object category pseudo-label of the second sample object is generated, and the first sample object is updated based on the second sample object with the object category pseudo-label. This method selects the second sample object data with higher credibility of the object category pseudo-label according to the object confidence score and puts it into the training data set where the first sample object is located, which can effectively make up for the defect of insufficient training data in related technologies and the defect of low accuracy of semi-supervised learning. Finally, the original detection model is trained based on the first sample object data after the update to obtain the object detection model, and the model training is performed in a loop iteration manner, which can improve the accuracy of the model in detecting abnormal objects.
[0085] In step S101 of some embodiments, first sample object data of a first sample object and second sample object data of a second sample object are acquired.
[0086] The first sample object is a general term for labeled sample objects, and the first sample object has a sample object category label. The first sample object includes a positive sample object whose sample object category label is an abnormal object (the sample object category label is 1) and a negative sample object whose sample object category label is a normal object (the sample object category label is 0).
[0087] The first sample object data is used to indicate sample object basic information of the first sample object (eg, object terminal address, object identifier, object location, etc.), and sample transaction information of a sample associated transaction generated by the first sample object (eg, timestamp of the sample associated transaction, transaction type, etc.).
[0088] It should be noted that the first sample object data in the embodiment of the present application includes positive sample data of positive sample objects and negative sample data of negative sample objects.
[0089] The second sample object is a general term for unlabeled sample objects, and the second sample object does not have a sample object category label.
[0090] The second sample object data is used to indicate sample object basic information of the second sample object (e.g., object terminal address, object identifier, object location, etc.) and sample transaction information of the sample associated transaction generated by the second sample object (e.g., timestamp and transaction type of the sample associated transaction).
[0091] In the specific implementation of this embodiment, with authorization, sample object data of each sample object is extracted from the Internet, and the sample object that can be truly determined to be a normal object or an abnormal object is used as the first sample object, and the sample object that cannot be determined to be a normal object or an abnormal object is used as the second sample object. In addition, for each sample object, a log file can be obtained from a server, application or device, and the basic object information and transaction content of each sample object recorded in the log file are used as the sample object data of the sample object.
[0092] It should be noted that in the embodiment of the present application, the original detection model is composed of multiple sub-models. Each sub-model of the original detection model is a graph neural network model (GNN).
[0093] See also Figure 2 In some embodiments, step S102 may include but is not limited to the following steps:
[0094] Training a first autoencoder based on negative sample data of the negative sample object;
[0095] Training a second autoencoder based on the positive sample data of the positive sample object;
[0096] Each sub-model is trained based on positive sample data and negative sample data.
[0097] Among them, the first autoencoder and the second autoencoder are both unsupervised models, and the first autoencoder and the second autoencoder are both composed of an encoder and a decoder.
[0098] Specifically, when training the first autoencoder based on the negative sample data of the negative sample object, first, the negative sample data of each negative sample object is input into the first autoencoder, and the encoder compresses and encodes the negative sample data to obtain the negative sample encoding features. Then, the negative sample encoding features are input into the decoder, and the decoder decodes the negative sample encoding features to achieve data restoration, retain as much information about the input negative sample object data as possible, and obtain the negative sample prediction data of the negative sample object. Further, the mean square error function is used to calculate the loss of the negative sample data and the negative sample prediction data of multiple negative sample objects to obtain the loss value, and the loss value is compared with the preset loss threshold. If the loss value is greater than the preset loss threshold, the model parameters of the first autoencoder are adjusted, and the above process is repeated until the loss value is less than or equal to the preset loss threshold, and the training of the first autoencoder is stopped to obtain the trained first autoencoder. Among them, the preset loss threshold is set according to actual business needs and is not limited.
[0099] In addition, the specific process of training the second autoencoder based on the positive sample data of the positive sample object is similar to the specific process of training the first autoencoder based on the negative sample data of the negative sample object. The difference is that the sample data used in the training is different, and the model parameters of the trained first autoencoder and second autoencoder are different. To save space, it will not be repeated.
[0100] When each sub-model is trained based on positive sample data and negative sample data, each sub-model includes a multi-layer perceptron and a pooling layer. Specifically, for each sub-model, the first sample object data (positive sample data and negative sample data) is first input into the multi-layer perceptron of the sub-model, and the multi-layer perceptron performs feature extraction on the first sample object data to obtain sample object features. Next, the sample object features are input into the pooling layer, and the pooling layer performs a binary classification prediction (abnormal prediction) on the first sample object, outputs the abnormal prediction features of the first sample object, and finally, the probability of the abnormal prediction features is calculated based on a preset function to obtain the abnormal probability of each first sample object. Furthermore, for each positive sample object, the positive sample sub-loss value is determined based on the negative logarithm of the abnormal probability of the first sample object; for each negative sample object, the negative sample sub-loss value is determined based on the negative logarithm of the difference between 1 and the abnormal probability. Finally, add all positive sample sub-loss values and all negative sample sub-loss values to get the total sample loss value, and then divide the total sample loss value by the sum of the positive sample object and the negative sample object to get the sample loss value. Compare the sample loss value with the preset loss threshold. If the loss value is greater than the preset loss threshold, adjust the model parameters of the sub-model and repeat the above process until the sample loss value is less than or equal to the preset loss threshold. Stop training each sub-model and get the original detection model after training. The preset loss threshold is set according to actual business needs and is not restricted.
[0101] The advantage of this embodiment is that the first autoencoder and the second autoencoder are trained separately by unsupervised learning, and each sub-model of the original detection model is trained by supervised learning, which can improve the model training efficiency.
[0102] In step S103 of some embodiments, based on the second sample object data, a first loss value of the second sample object is calculated by the trained first autoencoder, and a second loss value of the second sample object is calculated by the trained second autoencoder.
[0103] The first loss value is used to indicate the difference between the output result obtained by inputting the second sample object data into the trained first autoencoder and the second sample object data.
[0104] The second loss value is used to determine the difference between the output result of inputting the second sample object data into the trained second autoencoder and the second sample object data.
[0105] In the specific implementation of this embodiment, first, the second sample object data is input into the encoder of the trained first autoencoder, and the encoder compresses and encodes the second sample object data to obtain the second sample object encoding features. Then, the second sample object encoding features are input into the decoder of the trained first autoencoder, and the decoder decodes the second sample object encoding features to achieve data restoration, retain as much information about the input second sample object data as possible, and obtain the first prediction data of the second sample object. Further, the first prediction data and the second sample object data are calculated for similarity to obtain the object data similarity, and regularization calculation is performed based on the object data similarity to obtain the first loss value L0.
[0106] In some specific embodiments, a mean square error loss function may be used as a loss function for calculating the first loss value and the second loss value.
[0107] Furthermore, the specific process of calculating the second loss value of the second sample object by the trained second autoencoder is similar to the specific process of calculating the first loss value of the second sample object by the trained first autoencoder in the above step, which will not be described in detail to save space.
[0108] like Figure 2As shown, it is a simple illustration of the training and application of the first autoencoder and the second autoencoder. Specifically, during training, the first sample object is first divided into a positive sample object and a negative sample object according to the sample object category label of the first sample object, and the first sample object data is divided into positive sample data of the positive sample object and negative sample data of the negative sample object. Then, the first autoencoder A0 is trained using the negative sample data of the negative sample object; at the same time, the second autoencoder A1 is trained using the positive sample data of the positive sample object, so that the trained first autoencoder A0 and the second autoencoder A1 both meet the preset training requirements. Furthermore, in the application stage, the second sample object data is respectively input into the trained first autoencoder and the trained second autoencoder, and the first loss value L0 is calculated based on the difference between the output result of the first autoencoder and the second sample object data, and the second loss value L1 is calculated based on the difference between the output result of the second autoencoder and the second sample object data.
[0109] Autoencoder is an unsupervised learning algorithm used to learn effective representation or encoding of data. It consists of two parts: an encoder and a decoder. The goal of the autoencoder is to minimize the difference between the input data and the reconstructed data. Based on the definition of the autoencoder, the embodiment of the present application can construct an assumption that the loss value of the negative sample object in the first autoencoder is less than the loss value of the negative sample object in the second encoder, while the loss value of the positive sample object in the first autoencoder is greater than the loss value of the positive sample object in the second encoder. Based on this assumption, a classification hint (reference classification identifier) can be obtained to guide the training process of the original detection model, where the classification hint (reference classification identifier) can be expressed as shown in formula (1):
[0110]
[0111] Among them, Classification Hint refers to the reference classification identifier of the second sample object; L0 is the loss value of the second sample object on the first autoencoder (first loss value); L1 is the loss value of the second sample object on the second autoencoder (second loss value).
[0112] The advantage of this embodiment is that the trained first autoencoder and the trained second autoencoder are used to respectively determine the feature learning status of the first autoencoder for the second sample object (first loss value) and the feature learning status of the second autoencoder for the second sample object (second loss value). Furthermore, the classification hint (reference classification identifier) of the second sample object can be determined based on the size relationship between the first loss value and the second loss value, and the reference classification identifier can be used to screen the second sample object in subsequent steps. This method can improve the feature extraction quality of the second sample object and the accuracy of determining the reference classification identifier.
[0113] The following is a detailed description of step S104.
[0114] In step S104, the second sample object data is input into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object.
[0115] It should be noted that the trained original detection model is integrated from a plurality of sub-models; the second sample object data includes sample object basic information of the second sample object and sample transaction information of the sample associated transaction generated by the second sample object.
[0116] See also Figure 3 In some embodiments, step S104 may include but is not limited to steps S301 to S302:
[0117] Step S301, based on the basic information of the sample object and the sample transaction information, the second sample object is scored for abnormality through each sub-model to obtain a sample abnormality probability sub-vector output by each sub-model;
[0118] Step S302: Based on the total number of sub-models, vector averaging is performed on multiple sample abnormality probability sub-vectors to obtain a sample object abnormality probability vector.
[0119] Steps S301 to S302 are described in detail below.
[0120] The sample anomaly probability sub-vector is used to indicate the probability that a single sub-model considers that the second sample object is an anomaly object.
[0121] The sample object abnormality probability vector is used to indicate the probability that the original detection model considers the second sample object to be an abnormal object as a whole.
[0122] In step S301 of some embodiments, each sub-model includes a multi-layer perceptron and a pooling layer. Specifically, for each sub-model, the basic information of the sample object and the sample transaction information are first input into the multi-layer perceptron of the sub-model, and the multi-layer perceptron performs feature extraction on the basic information of the sample object to obtain the basic features of the sample object, and the multi-layer perceptron performs feature extraction on the sample transaction information to obtain the sample transaction features. Then, the basic features of the sample object and the sample transaction features are concatenated to obtain the sample object concatenated features. Further, the sample object concatenated features are input into the pooling layer, and the pooling layer performs a binary classification prediction (abnormal prediction) on the second sample object, and outputs a sample abnormality probability sub-vector.
[0123] Among them, for the j-th second sample object, the sample abnormal probability sub-vector output by each sub-model can be expressed as θ refers to the model parameters of the sub-model, and x refers to the second sample object data of the j-th second sample object.
[0124] In step S302 of some embodiments, first, the number of sub-models in the original detection model is counted to obtain the total number of sub-models. Then, the sample abnormality probability sub-vectors of all sub-models are added to obtain the sum of the sample abnormality probability sub-vectors. Finally, the sum of the sample abnormality probability sub-vectors is divided by the total number to obtain the sample object abnormality probability vector.
[0125] For the j-th second sample object, the sample object abnormal probability vector of the second sample object can be expressed as shown in formula (2):
[0126]
[0127] Among them, f ensemble (x) refers to the sample object abnormality probability vector of the second sample object, k refers to the total number of sub-models, and k is an integer greater than 0.
[0128] Furthermore, in order to directly obtain the object type of the second sample object, the original detection model also includes a preset function, which is used to convert the sample object abnormality probability vector into a binary classification label, so that the object detection result is more intuitive. Based on this, when the model is trained, the sample object abnormality probability vector is input into the preset function, and the predicted object label of the second sample object can be obtained, where the predicted object label is 0 or 1. When the predicted object label is 1, it indicates that the second sample object is predicted by the original detection model as an abnormal object, and when the predicted object label is 0, it indicates that the second sample object is predicted by the original detection model as a normal object.
[0129] For example, for the second sample object, when the sample object abnormal probability vector of the second sample object is f ensemble (x), the predicted object label of the second sample object is expressed as in, is the predicted object label and argmax(.) is the preset function.
[0130] like Figure 4As shown, it is a specific schematic diagram of outputting the sample object abnormality probability vector based on the original detection model. Among them, the original detection model has n sub-models, and n is an integer greater than 0. First, the sample object basic information and sample transaction information are used as inputs of each sub-model. Specifically, the sample object basic information and sample transaction information are input into sub-model 1 for abnormality scoring, and sub-model 1 outputs sample abnormality probability sub-vector 1. The sample object basic information and sample transaction information are input into sub-model 2 for abnormality scoring, and sub-model 1 outputs sample abnormality probability sub-vector 2, ..., the sample object basic information and sample transaction information are input into sub-model n for abnormality scoring, and sub-model 1 outputs sample abnormality probability sub-vector n. Further, in the output layer of the original detection model, the sample abnormality probability sub-vector 1, the sample abnormality probability sub-vector 2, ..., and the sample abnormality probability sub-vector n are vector averaged to obtain the sample object abnormality probability vector of the second sample object.
[0131] The advantage of this embodiment is that it utilizes the idea of ensemble learning to integrate multiple parallel sub-models into an original detection model, so that each sub-model can independently perform abnormality scoring on the input data (basic information of the sample object and sample transaction information), obtain a sample abnormality probability sub-vector, and realize independent abnormality detection of the sub-model. Further, the sample abnormality probability sub-vectors output by multiple sub-models are averaged to obtain the sample object abnormality probability vector, which can reduce the impact of the detection bias of a certain sub-model on the final result, and can improve the abnormality detection accuracy of the model and the stability of the model operation as a whole. In addition, when training the original detection model, each sub-model is jointly trained based on the same training data, so each sub-model can also learn from each other during training, which is conducive to optimizing the degree of attention of each sub-model to the abnormal information in the sample object data (the first sample object data, the second sample object data), and can also improve the model detection capability as a whole.
[0132] The following is a detailed description of step S105.
[0133] In step S105, the object confidence score of the second sample object is calculated based on the first loss value, the second loss value and the sample object abnormality probability vector.
[0134] See also Figure 5 In some embodiments, step S105 may include but is not limited to steps S401 to S403:
[0135] Step S501, normalizing the sample object abnormal probability vector to obtain the sample object abnormal score;
[0136] Step S502, calculating the difference between the first loss value and the second loss value to obtain a loss difference;
[0137] Step S503, performing a difference calculation on the sample object abnormality score and the absolute value of the loss difference to obtain the object confidence score.
[0138] Steps S501 to S503 are described in detail below.
[0139] The sample object anomaly score is used to indicate the abnormality of the second sample object in the numerical space, wherein the value range of the sample object anomaly score is between [0, 1].
[0140] The loss difference is used to indicate the difference between the predicted data generated by the first autoencoder and the second autoencoder for the second sample object.
[0141] The object confidence score is used to indicate the credibility of the sample object abnormality probability vector of the second sample object. The smaller the object confidence score, the greater the credibility of the sample object abnormality probability vector of the second sample object.
[0142] In step S501 of some embodiments, first, a preset normalization function is called with authorization. Then, the sample object abnormal probability vector is normalized using the normalization function, and the sample object abnormal probability vector is converted from a vector space to a numerical space to quantify the prediction result that the original detection model predicts that the second sample object is an abnormal object, and obtains a sample object abnormality score. The preset normalization function includes but is not limited to a softmax function.
[0143] In step S502 of some embodiments, the first loss value and the second loss value are subjected to difference processing, and the loss difference is obtained by subtracting the second loss value from the first loss value. When the first loss value is L0 and the second loss value is L1, the loss difference can be expressed as L0-L1. The greater the difference between the first loss value L0 and the second loss value L1, the higher the confidence (credibility or authenticity) of the prediction result (predicted object label) of the original detection model for abnormal detection of the second sample object.
[0144] In step S503 of some embodiments, the sample object anomaly score and the absolute value of the loss difference are calculated by subtracting the absolute value of the loss difference from the sample object anomaly score to obtain the object confidence score. The object confidence score can be expressed as shown in formula (3):
[0145] Confidence Score=H(x)-|L0-L1| Formula (3);
[0146] Where H(x) is the sample object anomaly score, Confidence Score is the object confidence score, and |L0-L1| is the absolute value of the loss difference. When the object confidence score is larger, the confidence (credibility or authenticity) of the prediction result (predicted object label) of the original detection model for the second sample object anomaly detection is smaller.
[0147] The benefit of this embodiment is that an object confidence score is introduced to measure the credibility (truthfulness) of the prediction results of object anomaly detection of the original detection model in model training, and when calculating the object confidence score, it does not rely solely on the abnormality probability (sample object abnormality probability vector) obtained by each sub-model, but rather integrates the output difference between the first autoencoder and the second autoencoder (the difference between the output data of the first autoencoder and the second sample object data, and the difference between the output data of the second autoencoder and the second sample object data), which can effectively improve the accuracy and authenticity of the object confidence score.
[0148] The following is a detailed description of step S106.
[0149] In step S106 , an object category pseudo label of the second sample object is generated based on the object confidence score and the sample object abnormality probability vector, and the first sample object is updated based on the second sample object with the object category pseudo label.
[0150] The object category pseudo label is used to indicate the object category of the second sample object determined according to the output of the original detection model. The object category pseudo label is not necessarily the true category of the second sample object, but can only indicate the object category of the second sample object to a certain degree of credibility.
[0151] See also Figure 6 In some embodiments, step S106 may include but is not limited to steps S601 to S604:
[0152] Step S601, based on the object confidence score, screening out an intermediate sample object from a plurality of second sample objects;
[0153] Step S602, determining an object category pseudo label of the intermediate sample object based on the sample object abnormality probability vector of the intermediate sample object;
[0154] Step S603, for the intermediate sample object, based on the magnitude relationship between the first loss value and the second loss value, determining a reference classification identifier of the intermediate sample object;
[0155] Step S604: determine the intermediate sample object whose object category pseudo label is consistent with the reference classification identifier as a candidate sample object, and merge the candidate sample object with the first sample object to update the first sample object.
[0156] Steps S601 to S604 are described in detail below.
[0157] The intermediate sample object refers to a second sample object whose object confidence score meets the requirement among multiple second sample objects.
[0158] The reference classification identifier is used to indicate an object category of a second sample object that can be used for reference.
[0159] The candidate sample object refers to the second sample object to be added to the labeled training set where the first sample object is located.
[0160] In step S601 of some embodiments, since the smaller the object confidence score, the more reliable the predicted object label of the second sample object, it is possible to screen out several second sample objects with smaller object confidence scores as intermediate sample objects from among the multiple second sample objects according to the object confidence scores.
[0161] In step S602 of some embodiments, the object category pseudo label of the intermediate sample object is the predicted object label of the intermediate sample object, wherein the generation method of the predicted object label has been described in detail in the above step S302, and is not repeated here to save space. The object category pseudo label of the intermediate sample object can be expressed as Among them, the object category pseudo label is 0 or 1. When the object category pseudo label is When the original detection model predicts the intermediate sample object as an abnormal object, when the object category pseudo label is , the original detection model predicts the intermediate sample object as a normal object.
[0162] In step S603 of some embodiments, for each intermediate sample object, the first loss value and the second loss value are compared. According to the setting rule of the reference classification identifier in the above step S102, if the first loss value of the intermediate sample object is less than or equal to the second loss value, the reference classification identifier ClassificationHint of the intermediate sample object is determined to be 0; if the first loss value of the intermediate sample object is greater than the second loss value, the reference classification identifier Classification Hint of the intermediate sample object is determined to be 1.
[0163] In step S604 of some embodiments, first, the object category pseudo label of each intermediate sample object is compared with the reference classification identifier. Then, the object category pseudo label is compared with the reference classification identifier. The intermediate sample objects are determined as candidate sample objects, and the candidate sample objects are merged with the first sample objects to update the first sample objects, so that the number of the first sample objects is increased.
[0164] The benefit of this embodiment is that the first autoencoder (first loss value) and the second autoencoder (second loss value) and entropy (sample object anomaly score) are used to calculate the object confidence score, and the second sample object data with higher credibility of the object pseudo-label is screened according to the object confidence score and put into the training data set where the first sample object is located, which can effectively make up for the defect of decreased accuracy of the direct learning algorithm. At the same time, the direct semi-supervised training method is adopted to merge the pseudo-label test set (candidate sample object) with the first sample object, and the candidate sample object is used as part of the training set to participate in the model training, which can effectively increase the number of positive samples in the supervised training, thereby making up for the problem of insufficient sample size of positive sample training data in the related technology.
[0165] See also Figure 7 In some embodiments, step S601 includes but is not limited to steps S701 to S702:
[0166] Step S701, arranging a plurality of second sample objects based on object confidence scores to obtain a first ranking;
[0167] Step S702: determine the second sample object with a predetermined ranking in the first sorting as the middle sample object.
[0168] Steps S701 to S702 are described in detail below.
[0169] The first ranking is used to indicate the order of selecting the plurality of second sample objects.
[0170] The predetermined ranking is used to limit the number of selected second sample objects.
[0171] In the specific implementation of this embodiment, first, based on the size of the object confidence score of each second sample object, each second sample object is arranged in descending order according to the object confidence score from large to small to obtain a first sorting. Then, since the predicted object label of the second sample object that is closer to the end in the first sorting is more credible, the second sample object with the last predetermined ranking in the first sorting is determined as the middle sample object.
[0172] In another implementation of this embodiment, first, based on the size of the object confidence score of each second sample object, each second sample object is sorted in ascending order according to the object confidence score from small to large to obtain a first ranking. Then, because the predicted object label of the second sample object that is closer to the front in the first ranking is more credible, the second sample objects with the first predetermined ranking in the first ranking are determined as intermediate sample objects.
[0173] The advantage of this embodiment is that, based on the object confidence scores of each second sample object, a more credible second sample object is preferentially selected in iterative training as the second sample object to be added to the labeled training set where the first sample object is located, which can improve the accuracy of sample screening and further improve the data reliability of the training set in subsequent iterative rounds.
[0174] It should be noted that the predetermined ranking can be determined based on the training accuracy of the object detection model. When the training accuracy of the object detection model is smaller and the detection accuracy requirement of the object detection model is higher, the predetermined ranking is set to a smaller value. Specifically, the preset relationship function is called, the training accuracy of the object detection model is input into the preset relationship function as an independent variable, and the output of the relationship function is used as the specific value of the predetermined ranking. Among them, the preset relationship function is an increasing function with the training accuracy of the object detection model as the independent variable and the predetermined name as the dependent variable.
[0175] In step S107 of some embodiments, the original detection model is trained based on the updated first sample object data of the first sample object to obtain an object detection model.
[0176] When this embodiment is implemented, in a new iteration round, the specific method of training the original detection model based on the first sample object data of the updated first sample object is similar to the specific process of training each sub-model based on the positive sample data and the negative sample data in the above step S102. The difference is that the training in step S102 is based on the first sample object data of the first sample object, and the training in S107 is based on the first sample object data of the updated first sample object, and the data volume of the first sample object data in step S107 is larger. To save space, it will not be repeated here.
[0177] For example, in a specific model training process, in the first iteration round, the training process of steps S101-S106 is executed, a batch of candidate sample objects are screened out from the second sample objects, and the candidate sample objects are added as new first sample objects to the training set where the original first sample objects are located, so that the number of first sample objects is increased, and at the same time, the number of second sample objects is reduced. Next, in the second iteration round, the training process of steps S101-S106 is performed again on the trained first autoencoder, the trained second autoencoder, and the trained original detection model generated after the first iteration round using each first sample object in the new training set (composed of the second sample object determined as the candidate sample object and the first sample object) and each second sample object in the new test set (composed of the second sample object not determined as the candidate sample object). By analogy, the first autoencoder, the second autoencoder, and the original detection model are iterated cyclically through multiple iteration rounds until all the second sample objects are assigned object category pseudo labels, and all the second sample objects have been merged with the first sample object as candidate sample objects. At the same time, the original detection model trained by the merged first sample object and second sample object and meeting the training requirements is used as the final object detection model. Wherein, when the predetermined iteration round is reached, for a small number of second sample objects that cannot achieve the consistency between the object pseudo label and the reference classification identifier, the object category pseudo label can be directly assigned as the category label of the second sample object, so as to facilitate the merging of all the second sample objects and the first sample object.
[0178] Figure 8 is an optional flowchart of the object detection method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S801 to S805.
[0179] Step S801, obtaining object association data of a target object;
[0180] Step S802, inputting basic object information and transaction content information into a preset object detection model;
[0181] Step S803, based on the basic information of the object and the transaction content information, the target object is scored for abnormality through each object detection sub-model to obtain an abnormal probability sub-vector output by each object detection sub-model;
[0182] Step S804, integrating multiple abnormal probability sub-vectors to obtain an abnormal probability vector of the target object;
[0183] Step S805 , normalizing the abnormal probability vector based on a preset function to obtain a target object detection label of the target object.
[0184] Steps S801 to S805 are described in detail below.
[0185] In step S801 of some embodiments, the target object is an object that needs to be detected for abnormality. The object association data is used to indicate basic object information of the target object and transaction content information of the target association transaction generated by the target object.
[0186] When this embodiment is implemented specifically, with authorization permission, the basic object information of the target object and the transaction content information of the target-related transaction generated by the target object are retrieved from the background log of the server, and the basic object information and the transaction content information are integrated into the object-related data of the target object, so that the object-related data can be used for object detection.
[0187] In step S802 of some embodiments, the object detection model is integrated by a plurality of pre-trained object detection sub-models, and the object detection model is generated according to the object detection model training method of the above-mentioned embodiment.
[0188] In step S803 of some embodiments, the abnormal probability sub-vector output by each object detection sub-model is used to indicate the probability that a single object detection sub-model predicts that the target object is an abnormal object.
[0189] In the specific implementation of this embodiment, the specific process of step S803 is similar to the above step S301, and will not be described in detail to save space.
[0190] In step S804 of some embodiments, the abnormal probability vector of the target object is used to indicate the probability size of the object detection model predicting that the target object is an abnormal object as a whole.
[0191] In the specific implementation of this embodiment, the specific process of step S804 is similar to the above step S302, and will not be described in detail to save space.
[0192] In step S805 of some embodiments, a preset function is used to convert the abnormal probability vector from the vector space to the numerical space. The target object detection label is used to indicate that the target object is an abnormal object or that the target object is a normal object.
[0193] In the specific implementation of this embodiment, first, the abnormal probability vector is normalized using a preset function, and the abnormal probability vector is converted from a vector space to a numerical space to quantify the prediction result of the original detection model predicting that the target object is an abnormal object, and the object abnormal probability is obtained. Next, the object abnormal probability is compared with a preset threshold, wherein the preset threshold is a pre-set value. The value range of the preset threshold is (0,1). When the object abnormal probability is less than the preset threshold, the target object detection label of the target object is determined as a normal object. When the object abnormal probability is greater than or equal to the preset threshold, the target object detection label of the target object is determined as an abnormal object.
[0194] The object detection method of the embodiment of the present application uses the basic object information and transaction content information of the target object as the model input data of the object detection, and uses the object detection model based on ensemble learning to perform anomaly scoring, so as to obtain the anomaly probability sub-vectors output by different object detection sub-models, and jointly determine the target object detection label of the target object by combining multiple anomaly probability sub-vectors, which can reduce the impact of the detection bias of individual object detection sub-models on the final detection results, and can effectively improve the accuracy of object anomaly detection.
[0195] See also Fig. 9 The present application also provides a training device for an object detection model, which can implement the training method for the object detection model. The device includes:
[0196] An acquiring unit 910 is configured to acquire first sample object data of a first sample object and second sample object data of a second sample object, wherein the first sample object has a sample object category label and the second sample object does not have a sample object category label;
[0197] A first training unit 920, configured to train a first autoencoder, a second autoencoder, and an original detection model based on first sample object data;
[0198] A first calculation unit 930 is used to calculate a first loss value of the second sample object through the trained first autoencoder based on the second sample object data, and calculate a second loss value of the second sample object through the trained second autoencoder;
[0199] A detection unit 940 is used to input the second sample object data into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object;
[0200] A second calculation unit 950 is used to calculate an object confidence score of a second sample object based on the first loss value, the second loss value and the sample object abnormality probability vector;
[0201] A generating unit 960, configured to generate an object category pseudo label of a second sample object based on the object confidence score and the sample object abnormality probability vector, and update the first sample object based on the second sample object with the object category pseudo label;
[0202] The second training unit 970 is used to train the original detection model based on the updated first sample object data of the first sample object to obtain an object detection model.
[0203] In some embodiments, the first sample object includes a positive sample object and a negative sample object, and the first sample object data includes positive sample data of the positive sample object and negative sample data of the negative sample object; the original detection model is composed of a plurality of sub-models;
[0204] The first training unit 920 is used to:
[0205] Training a first autoencoder based on negative sample data of the negative sample object;
[0206] Training a second autoencoder based on the positive sample data of the positive sample object;
[0207] Each sub-model is trained based on positive sample data and negative sample data.
[0208] In some embodiments, the trained original detection model is integrated by a plurality of sub-models; the second sample object data includes sample object basic information of the second sample object and sample transaction information of a sample associated transaction generated by the second sample object;
[0209] The detection unit 940 is used for:
[0210] Based on the basic information of the sample object and the sample transaction information, the second sample object is scored for abnormality through each sub-model to obtain a sample abnormality probability sub-vector output by each sub-model;
[0211] Based on the total number of sub-models, multiple sample abnormality probability sub-vectors are vector averaged to obtain the sample object abnormality probability vector.
[0212] In some embodiments, the second computing unit 950 is configured to:
[0213] Normalize the sample object abnormal probability vector to obtain the sample object abnormal score;
[0214] Calculate the difference between the first loss value and the second loss value to obtain a loss difference;
[0215] The object confidence score is obtained by calculating the difference between the sample object anomaly score and the absolute value of the loss difference.
[0216] In some embodiments, there are multiple second sample objects; the generating unit 960 is used to:
[0217] Based on the object confidence score, screening out an intermediate sample object from a plurality of second sample objects;
[0218] Determine an object category pseudo label of the intermediate sample object based on a sample object abnormality probability vector of the intermediate sample object;
[0219] For the intermediate sample object, based on the magnitude relationship between the first loss value and the second loss value, determining a reference classification identifier of the intermediate sample object;
[0220] The intermediate sample object whose object category pseudo label is consistent with the reference classification identifier is determined as a candidate sample object, and the candidate sample object is merged with the first sample object to update the first sample object.
[0221] In some embodiments, the step of selecting an intermediate sample object from a plurality of second sample objects based on the object confidence score comprises:
[0222] Arranging the plurality of second sample objects based on the object confidence scores to obtain a first ranking;
[0223] The second sample object with a predetermined ranking in the first sorting is determined as the middle sample object.
[0224] The specific implementation of the training device for the object detection model is basically the same as the specific implementation of the training method for the above-mentioned object detection model, and will not be repeated here.
[0225] See also Fig.10 The present application also provides an object detection device that can implement the above object detection method. The device includes:
[0226] An acquisition module 1010 is used to acquire object-related data of a target object, where the object-related data is used to indicate basic object information of the target object and transaction content information of a target-related transaction generated by the target object;
[0227] An input module 1020, used to input basic object information and transaction content information into a preset object detection model, wherein the object detection model is integrated by a plurality of pre-trained object detection sub-models, and the object detection model is generated according to the training method of the object detection model described above;
[0228] Scoring module 1030, used to perform abnormal scoring on the target object through each object detection sub-model based on the basic information of the object and the transaction content information, and obtain the abnormal probability sub-vector output by each object detection sub-model;
[0229] An integration module 1040 is used to integrate multiple abnormal probability sub-vectors to obtain an abnormal probability vector of a target object;
[0230] The normalization module 1050 is used to perform normalization processing on the abnormal probability vector based on a preset function to obtain a target object detection label of the target object, wherein the target object detection label is used to indicate that the target object is an abnormal object or is used to indicate that the target object is a normal object.
[0231] The specific implementation of the object detection device is basically the same as the specific implementation of the above-mentioned object detection method, and will not be repeated here.
[0232] The embodiment of the present application also provides an electronic device, the electronic device comprising: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein the program is executed by the processor to realize the above-mentioned object detection method or the object detection model training method. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0233] See also Fig.11 , Fig.11 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0234] The processor 1101 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0235] The memory 1102 may be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 may store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1102, and the processor 1101 calls and executes the object detection method or the object detection model training method of the embodiments of this application;
[0236] Input / output interface 1103, used to implement information input and output;
[0237] The communication interface 1104 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0238] A bus 1105 that transmits information between various components of the device (e.g., the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0239] The processor 1101 , the memory 1102 , the input / output interface 1103 and the communication interface 1104 are connected to each other in communication within the device via the bus 1105 .
[0240] An embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the above-mentioned object detection method or object detection model training method.
[0241] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0242] The object detection method, the object detection model training method, the object detection device, the object detection model training device, the electronic device and the computer-readable storage medium provided by the embodiments of the present application can enrich the data of the sample object by obtaining the first sample object data of the first sample object with the sample object category label and the second sample object data of the second sample object without the sample object category label. Then, the first autoencoder, the second autoencoder and the original detection model are trained based on the first sample object data, and the unsupervised training of the first autoencoder and the second autoencoder can be realized, and the supervised training of the original detection model can be realized. Further, based on the second sample object data, the first loss value of the second sample object is calculated by the trained first autoencoder, and the second loss value of the second sample object is calculated by the trained second autoencoder; the second sample object data is input into the trained original detection model for object anomaly detection, and the sample object anomaly probability vector of the second sample object is obtained, which can more conveniently determine the abnormal prediction of the original detection model for the second sample object. Since the original detection model is composed of multiple sub-models, the model is constructed by using the idea of ensemble learning, which can reduce the impact of the detection deviation of a certain sub-model on the final result, and can improve the accuracy of the model's anomaly detection and the stability of the model operation as a whole. Furthermore, based on the first loss value, the second loss value and the sample object abnormal probability vector, the object confidence score of the second sample object is calculated; based on the object confidence score and the sample object abnormal probability vector, the object category pseudo-label of the second sample object is generated, and the first sample object is updated based on the second sample object with the object category pseudo-label. This method selects the second sample object data with higher credibility of the object category pseudo-label according to the object confidence score and puts it into the training data set where the first sample object is located, which can effectively make up for the defect of insufficient training data in related technologies and the defect of low accuracy of semi-supervised learning. Finally, the original detection model is trained based on the first sample object data after the update to obtain the object detection model, and the model training is performed in a loop iteration manner, which can improve the accuracy of the model in detecting abnormal objects.
[0243] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0244] It can be understood by those skilled in the art that Figure 1-7 The technical solutions shown in the figure do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown in the figure, or a combination of certain steps, or different steps.
[0245] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0246] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0247] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0248] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0249] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as 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 devices or units, which can be electrical, mechanical or other forms.
[0250] The units described above 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.
[0251] In addition, each functional unit in each embodiment of the present application 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.
[0252] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0253] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for training an object detection model, characterized in that: The training method of the object detection model includes: Acquire first sample object data of a first sample object and second sample object data of a second sample object, wherein the first sample object has a sample object category label, and the second sample object does not have a sample object category label; Training a first autoencoder, a second autoencoder, and an original detection model based on the first sample object data; Based on the second sample object data, calculating a first loss value of the second sample object by using the trained first autoencoder, and calculating a second loss value of the second sample object by using the trained second autoencoder; Inputting the second sample object data into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object; Calculating an object confidence score of the second sample object based on the first loss value, the second loss value, and the sample object abnormality probability vector; Generate an object category pseudo label for the second sample object based on the object confidence score and the sample object abnormality probability vector, and update the first sample object based on the second sample object with the object category pseudo label; The original detection model is trained based on the updated first sample object data of the first sample object to obtain the object detection model.
2. The method according to claim 1, characterized in that The trained original detection model is integrated by a plurality of sub-models; the second sample object data includes sample object basic information of the second sample object and sample transaction information of the sample associated transaction generated by the second sample object; The step of inputting the second sample object data into the trained original detection model to perform object anomaly detection to obtain a sample object anomaly probability vector of the second sample object includes: Based on the sample object basic information and the sample transaction information, performing anomaly scoring on the second sample object through each of the sub-models to obtain a sample anomaly probability sub-vector output by each of the sub-models; Based on the total number of the sub-models, vector averaging is performed on a plurality of the sample abnormality probability sub-vectors to obtain the sample object abnormality probability vector.
3. The method according to claim 1, characterized in that The calculating the object confidence score of the second sample object based on the first loss value, the second loss value and the sample object abnormality probability vector comprises: Normalizing the sample object abnormal probability vector to obtain a sample object abnormality score; Calculating the difference between the first loss value and the second loss value to obtain a loss difference; The abnormal score of the sample object and the absolute value of the loss difference are calculated to obtain the object confidence score.
4. The method according to claim 1, characterized in that: There are multiple second sample objects; generating object category pseudo labels of the second sample objects based on the object confidence scores and the sample object abnormality probability vectors, and updating the first sample objects based on the second sample objects with the object category pseudo labels, including: Based on the object confidence score, screening out an intermediate sample object from a plurality of the second sample objects; Determining the object category pseudo label of the intermediate sample object based on the sample object anomaly probability vector of the intermediate sample object; For the intermediate sample object, based on the magnitude relationship between the first loss value and the second loss value, determining a reference classification identifier of the intermediate sample object; The intermediate sample object whose object category pseudo label is consistent with the reference classification identifier is determined as a candidate sample object, and the candidate sample object is merged with the first sample object to update the first sample object.
5. The method according to claim 4, characterized in that The step of selecting an intermediate sample object from the plurality of second sample objects based on the object confidence score comprises: Arranging the plurality of second sample objects based on the object confidence scores to obtain a first ranking; The second sample object with a predetermined ranking in the first ranking is determined as the middle sample object.
6. The method according to any one of claims 1 to 5, characterized in that: The first sample object includes a positive sample object and a negative sample object, and the first sample object data includes positive sample data of the positive sample object and negative sample data of the negative sample object; The original detection model is composed of a plurality of sub-models; The training of the first autoencoder, the second autoencoder, and the original detection model based on the first sample object data includes: Training the first autoencoder based on the negative sample data of the negative sample object; Training the second autoencoder based on the positive sample data of the positive sample object; Each of the sub-models is trained based on the positive sample data and the negative sample data.
7. An object detection method, characterized in that: The object detection method comprises: Acquire object association data of a target object, where the object association data is used to indicate basic object information of the target object and transaction content information of a target association transaction generated by the target object; Inputting the basic object information and the transaction content information into a preset object detection model, wherein the object detection model is integrated by a plurality of pre-trained object detection sub-models, and the object detection model is generated according to the object detection model training method according to any one of claims 1 to 6; Based on the basic information of the object and the transaction content information, the target object is scored for abnormality by each of the object detection sub-models to obtain an abnormal probability sub-vector output by each of the object detection sub-models; Integrate the plurality of abnormal probability sub-vectors to obtain an abnormal probability vector of the target object; The abnormal probability vector is normalized based on a preset function to obtain a target object detection label of the target object, wherein the target object detection label is used to indicate that the target object is an abnormal object or to indicate that the target object is a normal object.
8. A training device for an object detection model, characterized in that: The training device of the object detection model comprises: an acquiring unit, configured to acquire first sample object data of a first sample object and second sample object data of a second sample object, wherein the first sample object has a sample object category label, and the second sample object does not have a sample object category label; A first training unit, configured to train a first autoencoder, a second autoencoder, and an original detection model based on the first sample object data; A first calculation unit is used to calculate a first loss value of the second sample object through the trained first autoencoder based on the second sample object data, and calculate a second loss value of the second sample object through the trained second autoencoder; a detection unit, configured to input the second sample object data into the trained original detection model to perform object anomaly detection, and obtain a sample object anomaly probability vector of the second sample object; a second calculation unit, configured to calculate an object confidence score of the second sample object based on the first loss value, the second loss value, and the sample object abnormality probability vector; a generating unit, configured to generate an object category pseudo label of the second sample object based on the object confidence score and the sample object abnormality probability vector, and update the first sample object based on the second sample object with the object category pseudo label; The second training unit is used to train the original detection model based on the updated first sample object data of the first sample object to obtain the object detection model.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the object detection model training method of any one of claims 1 to 6, or implements the object detection method described in claim 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the object detection model training method of any one of claims 1 to 6, or implements the object detection method described in claim 7.
Citation Information
Patent Citations
Object detection model training method and device, object detection method and device, computer equipment and storage medium
CN111291755A
Target recognition model training method and device based on image processing
CN113569615A
Target detection model training method and device and target detection method and device
CN116975622A
Abnormality detection method, device and equipment and computer readable storage medium
CN117931883A
Neural network training method using semi-pseudo-labels
EP4224366A1
