A method, device and storage medium for identifying object type of business object
By building a multi-level classifier model based on unbalanced sample set and updating the sample weight during the training process, the accuracy and stability of object type recognition in unbalanced sample scenarios are solved, and higher prediction accuracy and The training set is representative.
Patent Information
- Application Number
- CN202110864070.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-07-29
AI Technical Summary
In the binary classification scenario of unbalanced samples, the prior art is difficult to effectively improve the accuracy and stability of object type recognition of business objects, especially when most classes are sampled to equalize with a few classes, the stability and representativeness of the training set are especially true when most classes are sampled to be balanced with a few classes. Affected.
An object type recognition method for business objects is adopted to construct an object type recognition model including two or more sequentially associated classifiers. These classifiers are constructed based on an imbalanced sample set configured with sample weights, and the sample weights of other classifiers are determined based on the prediction results of the previous classifier, except for the first classifier. During the training process, this method improves the importance of wrongly judged samples by updating the sample weight, thereby improving the prediction accuracy of the model.
By improving the representativeness and stability of the training set and improving the weight and importance of wrongly judged samples, the accuracy and stability of object type recognition of business objects are significantly improved. At the same time, a quantitative classifier error rate calculation method and a quantitative calculation method for classifier prediction weights are provided, making the determination of error rate and prediction weights more accurate and easy to analyze.
Smart Images

Figure CN113569957B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence technology, and in particular, to a method, device, and storage medium for identifying the object type of a business object. Background Art
[0002] Imbalanced samples refer to the situation in which the probability of each type of sample appearing is uneven in a classification prediction scenario, such as anomaly detection (where the probability of anomalies is small). RUSBoost is a prediction method for imbalanced samples. In each iteration, samples from the majority class are sampled, a weak classifier is trained, and the prediction error is obtained. This is used as the weight of the weak classifier (the larger the error, the smaller the weight). The scores of each weak classifier when predicting each type are accumulated, and the category with the highest prediction score is taken as the final prediction category. However, in a scenario where the number of positive samples is far less than the number of negative samples, the prediction effect obtained by directly calling the RUSBoost method is limited. Moreover, when the majority class is sampled to balance with the minority class, the sampling results of the majority class may not be representative, which also reduces the stability of the training set. Summary of the Invention
[0003] The purpose of the embodiments of this specification is to provide a method, device, and storage medium for identifying the object type of a business object, which can improve the accuracy and stability of object type identification of a business object.
[0004] This specification provides a method, device, and storage medium for identifying the object type of a business object, which are implemented in the following ways:
[0005] A method for identifying the object type of a business object, the method comprising: receiving business data of a target business object; obtaining a pre-constructed object type identification model, the object type identification model comprising two or more sequentially associated classifiers; wherein the classifiers are constructed based on an unbalanced sample set configured with sample weights; sample weights corresponding to the training of classifiers other than the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier; processing the business data using each classifier of the object type identification model to obtain processing results of the business data by each classifier; and determining the object type of the target business object based on the processing results of the business data by each classifier.
[0006] On the other hand, an embodiment of the present specification provides an object type identification device for a business object, which is applied to a server, and the device includes: a receiving module for receiving business data of a target business object; an acquisition module for acquiring a pre-constructed object type identification model, wherein the object type identification model includes two or more classifiers associated in sequence; wherein the classifier is constructed based on an unbalanced sample set configured with sample weights; the sample weights corresponding to the training of other classifiers except the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier; a prediction module for processing the business data using each classifier of the object type identification model to obtain the processing results of the business data by each classifier; and a type determination module for determining the object type of the target business object based on the processing results of the business data by each classifier.
[0007] On the other hand, an embodiment of this specification provides a computer-readable storage medium having computer instructions stored thereon, which, when executed, implement the steps of the method described in any one or more of the above embodiments.
[0008] The object type identification method, device and storage medium of the business object provided by one or more embodiments of this specification can improve the representativeness and stability of the training set by training the model directly based on the unbalanced sample set for the unbalanced sample binary classification scenario. In the process of sample weight replacement, the weight of the misjudged sample can be further improved, and the variance of the sample weight can be expanded to enhance the importance of the misjudged sample, so that the model pays more attention to the misjudged sample in iterative training, thereby improving the accuracy of the overall prediction results of the model. By further providing a quantitative method for calculating the error rate of the classifier, the determination of the error rate can be made more accurate, and it is also easier for testers to analyze and understand. At the same time, a new quantitative calculation method for the prediction weight of the classifier is also provided, which makes the determination of the prediction weight more accurate, thereby further improving the accuracy and stability of the object type identification of the business object. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some of the embodiments described in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without inventive work. In the drawings:
[0010] Figure 1 A diagram of the training and testing process of the object type recognition model provided in this manual;
[0011] Figure 2A schematic diagram of the implementation flow of the object type identification method for the business object provided in this specification;
[0012] Figure 3 This is a schematic diagram of the module structure of the object type identification device for business objects provided in this specification. DETAILED DESCRIPTION
[0013] In order to help those skilled in the art better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in one or more embodiments of this specification in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the embodiments of this specification.
[0014] The object type identification method for business objects can be applied to a single server or a server cluster consisting of multiple servers, or to smart terminal devices capable of performing data processing functions. The business objects can be business users, business products, business orders, and so on, to identify abnormal users / products / orders. Accordingly, the object type can be, for example, normal / abnormal. Of course, the business objects can also be of other types depending on the application scenario, such as risky / non-risky. Typically, in business systems, the amount of data for abnormal business objects is relatively small, while the amount of data for normal business objects is relatively large. If samples are extracted based on data volume proportion, the sample size distribution of samples corresponding to different object types in the constructed sample set will vary significantly, resulting in a significant imbalance in the number of samples of different object types in the sample set. However, most classification algorithms have a fundamental assumption: uniform data distribution. Therefore, an imbalance in the number of samples can affect the performance of the classifier to a certain extent. The classifier may identify abnormal business objects of interest as noise and ignore them during the learning process. This can lead to a phenomenon in which the overall performance of a classifier is excellent, but the correct identification rate of abnormal business objects is low.
[0015] To address the above issues, oversampling or undersampling are currently commonly used to balance the proportion of samples of different object types in the sample set. Undersampling usually balances the proportion of samples of different object types in the sample set by deleting samples corresponding to object types with a larger proportion of samples. However, undersampling ignores the actual distribution of data for different business objects, thereby losing this information, making it difficult to ensure the accuracy of the final constructed classifier. Oversampling usually balances the proportion of samples of different object types in the sample set by increasing the number of samples corresponding to object types with a smaller proportion of samples. For example, the number of samples of the corresponding type can be increased by copying samples or simulating and generating new samples. However, oversampling may be prone to problems such as overfitting or excessive noise, resulting in weak generalization capabilities of the constructed classifier.
[0016] Accordingly, the embodiments of this specification provide a method for constructing a classifier based on an unbalanced sample set collected originally. This method uses the constructed classifier to identify the object type of business objects, avoiding issues caused by oversampling or undersampling, and reducing the low accuracy rate of correct recognition due to an imbalance in the number of samples. Using the solutions provided in the embodiments of this specification, the accuracy of identifying abnormal business objects can be improved while retaining effective information about the actual business.
[0017] In an example scenario provided in this specification, a server is employed to identify the object type of a business object, using the normal / abnormal object type as an example. The server can first construct an object type identification model. The object type identification model can include two or more sequentially associated classifiers. The classifiers can be constructed based on an unbalanced sample set. The unbalanced sample set can include positive and negative samples. The positive and negative samples can correspond to abnormal business objects and normal business objects.
[0018] The unbalanced sample set may refer to a sample set obtained by extracting samples based on the actual ratio of the number of normal business objects and abnormal business objects in the business system. For example, if a sample is extracted for a business object within a preset time interval, the ratio of the number of normal business objects and abnormal business objects in the business system within the preset time interval may be first extracted as the sample extraction ratio. If the ratio of the number of normal business objects and abnormal business objects extracted is 10091:1, 10091:1 may be used as the sample extraction ratio, and positive / negative samples may be extracted from the business system based on 10091:1. Alternatively, the order of magnitude of 10000:1 corresponding to the extracted ratio of 10091:1 may be used as the sample extraction ratio, so as to extract positive / negative samples from the business system based on 10000:1.
[0019] The architecture adopted by the classifier can be configured as needed, such as decision tree, Bayesian, support vector machine, etc. Preferably, the classifier can be constructed using the LightGBM algorithm.
[0020] The unbalanced sample set can be used as a training set to train each classifier of the object type recognition model in turn. A sample label is configured for each sample in the unbalanced sample set. In this scenario example, it can be assumed that the sample label of the positive sample is an abnormal business object, and the sample label of the negative sample is a normal business object. Of course, the above assumptions are only for the convenience of description. In actual applications, the sample label of the positive sample can be a normal business object, and the sample label of the negative sample can be an abnormal business object. For ease of processing, the value of the sample label y(i) can be configured, the sample label y(i) value of the negative sample is 0, and the sample label y(i) value of the positive sample is 1. Of course, in actual applications, other label value configuration methods can also be used, which are not limited here.
[0021] At the beginning of training, the sample weight of each sample in the unbalanced sample set is initialized. The sample weight of each sample in the unbalanced sample set can be configured to adopt a specified weight value. For example, the sample weight can be initialized to 1 / N, where N represents the number of samples in the unbalanced sample set. The unbalanced sample set with the initial configuration weight 1 / N can be used to train the first round of classifiers, that is, to build the first classifier. Preferably, when the classifier is constructed based on the LightGBM algorithm, the sample weight of each sample in the unbalanced sample set can be configured to 1. When the sample weight is 1, a better type recognition effect can be obtained. Accordingly, Among them, w t (i) represents the sample weight corresponding to sample i in the imbalanced sample set, subscript t represents the identifier of the classifier currently being trained, and t=1 represents the identifier of the first classifier. The first classifier is trained on an unbalanced sample set with y(i) and sample labels y(i).
[0022] For any classifier t, after training is completed, the trained classifier t can be used to predict each sample in the imbalanced sample set to obtain the probability p of each sample i being predicted as a positive sample. t (i), where p t (i)∈[0,1].
[0023] You can get the pre-configured specified prediction threshold s. If p t (i)≥s, then the prediction result y t (i)′=1(positive sample), if p t (i)<s, then the prediction result y t (i)′=0 (negative sample).
[0024] Then the probability r of sample i being predicted correctly t (i) is: r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i)).
[0025] Compare the prediction results y of sample i t (i)′ and sample label y(i):
[0026] If sample i is predicted correctly: y t (i) = y t (i)′, then pr t (i) = 1; or, y t (i)≠y t (i)′, then pr t (i) = 0;
[0027] If sample i is predicted incorrectly: y t (i) = y t (i)′, then pw t (i) = 0; or, y t (i)≠y t (i)′, then pw t (i)=1.
[0028] The sample weight of each sample in the imbalanced sample set can be updated based on the above prediction accuracy and correct probability. t+1 (i) = pr t (i)×r t (i)+pw t (i)×(1+r t (i)). Based on the updated sample weight w t+1 (i) Train the next classifier (t+1).
[0029] Afterwards, we can configure the sample weight w based on t+1 The imbalanced sample set of (i) is used to train a classifier identified as (t+1).
[0030] Each classifier of the object type recognition model is trained in sequence according to the above method. Through the above method, the sample weight of a sample is updated based on the correct prediction of the previous classifier for a certain sample and the probability of correct prediction. The weight of the incorrectly predicted sample can be increased, so that more attention can be paid to this type of sample during the subsequent classifier training, so that the subsequent classifier can perform enhanced training for this type of sample, thereby improving the recognition accuracy of the recognition model finally constructed.
[0031] In some other implementations, the sample weight w of each sample in the unbalanced sample set can also be extracted. t+1 The maximum value of (i) is used as the benchmark weight wm t+1 . Using the reference weight wm t+1 Update the sample weight of each sample in the unbalanced sample set to obtain the updated sample weight in, You can use the configuration with sample weights The classifier identified as (t+1) is trained on the imbalanced sample set. Further adjusting the initially calculated sample weights using the maximum weight value can increase the variance of the weights between samples, further increasing the importance of misclassified samples. This allows for greater attention to be paid to misclassified samples in subsequent classifier training, thereby further improving the recognition accuracy of the ultimately constructed recognition model.
[0032] For any classifier t, after the training is completed, the sample weight w corresponding to the classifier t training can also be obtained t (i). And calculate the prediction error rate e of classifier t t .in,
[0033] e t =wsw t / ws t
[0034] ws t Represents the sample weight w of each sample in the imbalanced sample set t (i) and wsw t The sample weight w represents the sample that the specified classifier predicts incorrectly t (i) and.
[0035]
[0036]
[0037] T represents the number of classifiers included in the object type recognition model.
[0038] By calculating the prediction error rate of the classifier in the above manner, the error rate prediction can be made more accurate and efficient.
[0039] A prediction weight for each classifier can also be determined based on the prediction error rate, thereby determining the object type of the target business object based on the prediction weight of each classifier in the object type identification model and the processing results of each classifier on the business data. By further incorporating the prediction error rate as the importance of each classifier's influence on the prediction result, the accuracy of the prediction result can be further improved by integrating the prediction results of each classifier.
[0040] Preferably, the weight evaluation factor α of the classifier can also be calculated based on the prediction error rate t ; Among them, α t =e t / (1-e t );
[0041] Extract the minimum non-zero value α among the weight evaluation factors of each classifier of the object type recognition model min ;
[0042] The prediction weight wes of the classifier is determined in the following way t :
[0043] If α t ≠0, then wes t =log(1 / α t );
[0044] If α t =0, then wes t =log(1 / α min )+1.
[0045] The prediction error rate e of each classifier obtained above can be t and the prediction weight wes t The associated data is stored for use in subsequent testing or identification processes.
[0046] Figure 1 This is a diagram of the model training and testing process for another scenario example provided in this manual. Samples with a larger proportion of samples in the sample set can be described as majority class samples, and samples with a smaller proportion of samples can be described as minority class samples. The majority class is assumed to be negative, with a sample label y(i) of 0, while the minority class is assumed to be positive, with a sample label y(i) of 1.
[0047] Assume that the number of training set samples is N, and the training set samples are numbered i∈[1, N]. The number of test set samples is M, and the test set samples are numbered j∈[1, M].
[0048] like Figure 1 As shown, the following steps can be used to train and test the model.
[0049] S101: Initialize the sample weight of each sample in the training set to 1.
[0050] The subscript t indicates the current training round. t = 1 indicates the first training round, i.e., the first classifier is trained. The classifiers of the object type recognition model are trained sequentially. The classifier trained in the first round can be used as the first classifier, and so on.
[0051] S102: Determine whether the current training round is less than or equal to the preset round T.
[0052] The training round count variable t is initialized to 1. t=1 indicates that the current training round is 1. The preset round number T is generally 5 or 10.
[0053] If t≤T, then enter the training, otherwise the training ends.
[0054] S103: Train the classifier to predict the probability of each sample being a positive sample.
[0055] The classifier is trained based on the training set configured with sample weights. After the training is completed, each sample in the training set is predicted to obtain the probability p of each sample in the training set being a positive sample. t (i)∈[0,1].
[0056] S104: Obtain the probability of each sample being predicted correctly.
[0057] The probability of correct prediction for each sample in the training set is r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i)).
[0058] S105: Distinguish whether the prediction result is a positive sample or a negative sample according to a specified prediction threshold.
[0059] Assume that the specified prediction threshold of the classifier is s, which is generally set to 0.5. t (i)≥s, then the prediction result y t (i)′ is 1 (positive sample), if p t (i)<s, then the prediction result y t (i)′ is 0 (negative sample).
[0060] S106: Calculate the prediction error rate and α value of the classifier based on the sample label, the sample prediction result, and the sample weight.
[0061] Get the weight w of each sample in the training set t (i), t∈[1, T], subscript t is the current training round.
[0062] The sum of the weights of all misjudged samples y(i)≠y t (i)′, t∈[1, T].
[0063] The sum of the weights of each sample t∈[1,T].
[0064] Then the prediction error rate e of the current classifier t is t=wsw t / ws t , t∈[1,T]. The prediction error rate can be used by analysts to observe the changes in the error rate of each classifier. According to this prediction error rate calculation method, the prediction error rate can be made easier to understand and observe.
[0065] The α value of the current classifier t, α t =e t / (1-e t ), t∈[1,T].
[0066] S107: Calculate the weight of each sample in the new round of training based on the prediction result of each sample and the probability of correct prediction.
[0067] The sample prediction is correct, pr t (i) = 1, y t (i) = y t (i)′;pr t (i) = 0, y t (i)≠y t (i)′.
[0068] Sample prediction error, pw t (i) = 1, y t (i)≠y t (i)′;pw t (i) = 0, y t (i) = y t (i)′.
[0069] Get the correct prediction probability r of each sample in the training set calculated in step S104 t (i), where r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i)).
[0070] The weight w of each sample in the training set in the new round of training t+1 (i) = pr t (i)×r t (i)+pw t (i)×(1+r t (i)) to increase the weight of misclassified samples.
[0071] S108: updating the weight of each sample in the new round of training according to the maximum value of the weight of the training set samples in the new round of training.
[0072] The maximum value wm of the weight of each training set sample in the new round of training t+1 =max{w t+1(i), i∈[1, N]}.
[0073] The weight w of each training set sample in the new round of training t+1 (i) = w t+1 (i) / wm t+1 This adjustment can increase the variance of weights between samples, further enhancing the importance of misclassified samples and allowing the model to pay more attention to misclassified samples during iterative training.
[0074] S109: Save the currently trained classifier, α value, and error rate.
[0075] S110: Current training round + 1.
[0076] S111: After the training is completed, the test set is predicted based on the classifier and α value generated during the training to obtain the prediction score.
[0077] Calculate the minimum non-zero α value among all α values min =min{α t ≠0, t∈[1,T]}.
[0078] Calculate the weight wes of each classifier t :
[0079] wes t =log(1 / α t ), α t ≠0, t∈[1,T];
[0080] wes t =log(1 / α min )+1,α t =0,t∈[1,T].
[0081] Input each sample of the test set, and pass each classifier h generated by the previous training t , t∈[1, T], predict the probability p of each sample in the test set to be a positive sample t (j)∈[0, 1], t∈[1, T].
[0082] Calculate the prediction score for each sample in the test set
[0083] S112: Observe the model prediction effect based on the sample labels and prediction scores of the test set.
[0084] For each sample in the test set, sort it in descending order by its prediction score proba(j). If the prediction score is greater than or equal to the specified prediction threshold, the prediction result is 1 (positive sample). If the prediction score is less than the specified prediction threshold, the prediction result is 0 (negative sample). The prediction effect of the model can be analyzed by observing the sample labels and prediction results of the test set.
[0085] For the imbalanced sample binary classification scenario, the solution provided by the above scenario example can be used to improve the representativeness and stability of the training set by directly training the model based on the imbalanced sample set. During the sample weight change process, the weight of the misclassified samples can be further increased, and the variance of the sample weight can be expanded to increase the importance of the misclassified samples, so that the model pays more attention to the misclassified samples during iterative training, thereby improving the accuracy of the model's overall prediction results. By further providing a quantitative method for calculating the classifier error rate, the determination of the error rate can be made more accurate and easier for testers to analyze and understand. At the same time, a new quantitative calculation method for the classifier prediction weight is also provided, making the determination of the prediction weight more accurate. In addition, special treatment is added for each classifier's weight evaluation factor α being 0 to further realize the determination of the prediction weight under special circumstances.
[0086] Based on the above scenario example, this specification also provides a method for identifying the object type of a business object. Figure 2 This is a flow chart of an embodiment of the method for identifying the object type of the business object provided in this specification. Figure 2 As shown, in one embodiment of the method for identifying the object type of a business object provided in this specification, the method can be applied to a server and can include the following steps.
[0087] S20: Receive business data of the target business object. The data types and features included in the business data can be configured according to the type of the business object and the identification scenario.
[0088] S22: Obtain a pre-built object type recognition model, wherein the object type recognition model includes two or more classifiers associated in sequence; wherein the classifiers are constructed based on an unbalanced sample set configured with sample weights; and sample weights corresponding to the training of other classifiers except the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier.
[0089] Samples can be extracted from the business system to construct an unbalanced sample set. The proportion of samples corresponding to each object type in the unbalanced sample set can be determined based on the proportion of business objects of each object type in the business system. Sample weights can be assigned to each sample in the unbalanced sample set to distinguish the importance of each sample during classifier training.
[0090] The sample weights of each sample in the unbalanced sample set may be initialized and configured first, so as to train the first classifier based on the initialized sample weights. Preferably, when the classifier is constructed based on the LightGBM algorithm, the first classifier of the object type recognition model is trained in the following manner: the sample weight of each sample in the unbalanced sample set is configured to be 1; and the first classifier of the object type recognition model is trained using the unbalanced sample set configured with the sample weight 1.
[0091] Any classifier to be trained except the first classifier in the object type recognition model can be used as a target classifier. When training the target classifier, the sample weight of each sample in the imbalanced sample set is configured in the following manner:
[0092] w t+1 (i) = pr t (i)×r t (i)+pw t (i)×(1+r t (i))
[0093] Among them, w t+1 (i) represents the sample weight corresponding to sample i, t+1 represents the identifier of the target classifier, t represents the identifier of the previous classifier of the target classifier, t≥1; if y t (i) = y t (i)′, then pr t (i)=1; if y t (i)≠y t (i)′, then pr t (i)=0; if y t (i)≠y t (i)′, then pw t (i)=1; if y t (i) = y t (i)′, then pw t (i) = 0; r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i));y t (i) represents the actual label of sample i, y t (i)′ represents the predicted label of sample i by the classifier identified as t, p t (i) represents the probability that the classifier identified as t predicts that sample i belongs to the specified label.
[0094] Using the configuration with sample weight w t+1 The target classifier is trained with the imbalanced sample set of (i).
[0095] Alternatively, the sample weight w of each sample in the unbalanced sample set can be extracted t+1 The maximum value of (i) is used as the benchmark weight wm t+1 ; Using the reference weight wm t+1 Update the sample weight of each sample in the unbalanced sample set to obtain the updated sample weight in, Accordingly, we can use the configuration with sample weights The target classifier is trained using the imbalanced sample set.
[0096] S24: Utilize each classifier of the object type recognition model to process the business data to obtain a processing result of each classifier on the business data.
[0097] S26: Determine the object type of the target business object based on the processing results of the business data by the classifiers.
[0098] During the training process, any classifier can be used as a designated classifier. Get the sample weight w corresponding to the training of the designated classifier t (i); where t represents the identifier of the specified classifier and i represents the sample identifier. Calculate the prediction error rate e of the specified classifier t ; Among them, e t =wsw t / ws t , ws t Represents the sample weight w of each sample in the imbalanced sample set t (i) and; wsw t The sample weight w represents the sample that the specified classifier predicts incorrectly t (i) and.
[0099] Correspondingly, in the object type identification process, the prediction weight of the specified classifier can be determined based on the prediction error rate; based on the prediction weight of each classifier in the object type identification model and the processing results of each classifier on the business data, the object type of the target business object is determined.
[0100] In some embodiments, the weight evaluation factor α of the specified classifier can also be calculated based on the prediction error rate. t ; Among them, α t =e t / (1-e t ). Extract the minimum non-zero value α among the weight evaluation factors of each classifier of the object type recognition model min The prediction weight wes of the specified classifier is determined by the following method: t :
[0101] If α t ≠0, then wes t =log(1 / α t );
[0102] If α t =0, then wes t =log(1 / α min )+1.
[0103] Correspondingly, the prediction score proba(j) of each classifier for the target business object can also be calculated; wherein, p t (j) represents the probability that the classifier identified by t predicts that the target business object j belongs to the specified label, and T represents the number of classifiers included in the object type recognition model. The specified label can be one of the object types. For example, if the object type is abnormal / normal, the specified label can be normal or abnormal. For example, in the above scenario example, the specified label is the abnormal business object.
[0104] If the prediction score proba(j) is greater than or equal to the specified prediction threshold, the object type of the target business object j is the specified label. If the prediction score proba(j) is less than the specified prediction threshold, the object type of the target business object j is not the specified label.
[0105] Based on the above-mentioned object type identification method of the business object, the embodiment of this specification also provides an object type identification device for the business object. Figure 3 As shown, the device may include: a receiving module 30 for receiving business data of a target business object; an acquisition module 32 for acquiring a pre-constructed object type recognition model, wherein the object type recognition model includes two or more classifiers that are sequentially associated; wherein the classifier is constructed based on an unbalanced sample set configured with sample weights; the sample weights corresponding to the training of other classifiers except the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier; a prediction module 34 for processing the business data using each classifier of the object type recognition model to obtain the processing results of each classifier on the business data; a type determination module 36 for determining the object type of the target business object based on the processing results of each classifier on the business data.
[0106] It should be noted that the above-mentioned device may also include other implementations according to the description of the above-mentioned embodiment. Specific implementation methods can refer to the description of the relevant method embodiments, and will not be described in detail here.
[0107] This specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed, implement the steps of the method described in any one or more of the above embodiments. The storage medium may include a physical device for storing information, which usually digitizes the information and then stores it in a medium using electrical, magnetic or optical means. The storage medium may include: devices that use electrical energy to store information, such as various types of memories, such as RAM, ROM, etc.; devices that use magnetic energy to store information, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, bubble memories, and USB flash drives; devices that use optical means to store information, such as CDs or DVDs. Of course, there are other types of readable storage media, such as quantum memories, graphene memories, and so on.
[0108] It should be noted that the embodiments of this specification are not limited to situations that must comply with standard data models / templates or the embodiments of this specification. Certain industry standards or slightly modified implementation plans based on the implementation of custom methods or the description of the embodiments can also achieve the same, equivalent or similar, or predictable implementation effects of the above embodiments after deformation. The embodiments obtained by applying these modified or deformed data acquisition, storage, judgment, processing methods, etc. can still fall within the scope of the optional implementation plans of this specification.
[0109] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referenced across them. Each embodiment focuses on the differences from the other embodiments. In particular, since the system embodiments are generally similar to the method embodiments, their description is relatively simple. For relevant parts, reference can be made to the description of the method embodiments. Throughout this specification, reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and integrate the different embodiments or examples, and features of different embodiments or examples, described in this specification, without conflict.
[0110] The foregoing is merely an example of the present invention and is not intended to limit the present invention. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims of the present invention.
Claims
1. A method for identifying an object type of a business object, characterized in that: The method comprises: Receive business data of the target business object; Obtaining a pre-built object type recognition model, the object type recognition model comprising two or more classifiers that are sequentially associated; wherein the classifiers are built based on an unbalanced sample set configured with sample weights; and sample weights corresponding to the training of other classifiers except the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier; Using each classifier of the object type recognition model to process the business data, and obtaining processing results of each classifier on the business data; Determining the object type of the target business object based on the processing results of the business data by each classifier; Among them, the classifiers other than the first classifier in the object type recognition model are trained in the following manner: Using any classifier to be trained in the object type recognition model except the first classifier as a target classifier; The sample weight of each sample in the unbalanced sample set is configured in the following manner: w t+1 (i)=pr t (i)×r t (i)+pw t (i)×(1+r t (i)) Among them, w t+1 (i) represents the sample weight corresponding to sample i, t+1 represents the identifier of the target classifier, and t represents the identifier of the previous classifier of the target classifier; t≥1 if y t (i) = y t (i)', then pr t (i)=1; if y t (i)≠y t (i)', then pr t (i)=0; if y t (i)≠y t (i)', then pw t (i)=1; if y t (i) = y t (i)', then pw t (i) = 0; r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i)); y t (i) represents the actual label of sample i, y t (i)' represents the predicted label of sample i by the classifier identified as t, p t (i) represents the probability that the classifier identified as t predicts that sample i belongs to the specified label, r t (i) represents the probability that the classifier identified as t correctly predicts the prediction sample i; Using the configuration with sample weight w t+1 The target classifier is trained with the imbalanced sample set of (i).
2. The method according to claim 1, characterized in that In the case where the classifier is constructed based on the LightGBM algorithm, the first classifier of the object type recognition model is trained in the following manner: The sample weight of each sample in the unbalanced sample set is configured to be 1; The first classifier of the object type recognition model is trained using the unbalanced sample set configured with sample weight 1.
3. The method according to claim 1, characterized in that The configuring the sample weight of each sample in the unbalanced sample set further includes: Extract the sample weight w of each sample in the unbalanced sample set t+1 The maximum value of (i) is taken as the reference weight wm t+1 ; Using the reference weight wm t+1 Update the sample weight of each sample in the unbalanced sample set to obtain an updated sample weight in, Accordingly, the sample weights are configured The target classifier is trained with the imbalanced sample set.
4. The method according to claim 1, characterized in that The method further comprises: Using any classifier of the object type recognition model as a designated classifier; Get the sample weight w corresponding to the training of the specified classifier t (i); where t represents the identifier of the specified classifier and i represents the sample identifier; Calculate the prediction error rate e of the specified classifier t ; Among them, e t =wsw t / ws t , ws t Represents the sample weight w of each sample in the unbalanced sample set t (i) and; wsw t The sample weight w represents the sample that is incorrectly predicted by the specified classifier. t (i) and.
5. The method according to claim 4, characterized in that The determining the object type of the target business object based on the processing result of the business data by each classifier in the object type identification model includes: Determining a prediction weight of the specified classifier according to the prediction error rate; The object type of the target business object is determined based on the prediction weights of each classifier in the object type recognition model and the processing results of each classifier on the business data.
6. The method according to claim 5, characterized in that The determining the prediction weight of the designated classifier based on the prediction error rate comprises: Calculate the weight evaluation factor α of the specified classifier according to the prediction error rate t ; Among them, α t =e t / (1-e t ); Extract the minimum non-zero value α among the weight evaluation factors of each classifier of the object type recognition model min ; The prediction weight wes of the specified classifier is determined in the following way t : If α t ≠0, then wes t =log(1 / α t ); If α t =0, then wes t =log(1 / α min )+1.
7. The method according to claim 6, characterized in that The object type of the target business object is determined in the following manner: Calculate the prediction score proba(j) of each classifier for the target business object; where, p t (j) represents the probability that the classifier identified as t predicts that the target business object j belongs to the specified label, and T represents the number of classifiers included in the object type recognition model; If the prediction score proba(j) is greater than or equal to the specified prediction threshold, the object type of the target business object j is the specified label; If the prediction score proba(j) is less than the specified prediction threshold, the object type of the target business object j is a non-specified label.
8. A device for identifying the object type of a business object, characterized in that: Applied to a server, the device comprises: A receiving module, used for receiving business data of a target business object; An acquisition module is used to acquire a pre-built object type recognition model, wherein the object type recognition model includes two or more classifiers that are sequentially associated; wherein the classifiers are constructed based on an unbalanced sample set configured with sample weights; and the sample weights corresponding to the training of other classifiers except the first classifier are determined based on the prediction results of the previous classifier of the corresponding classifier; A prediction module, used to process the business data using each classifier of the object type recognition model to obtain a processing result of each classifier on the business data; A type determination module, used to determine the object type of the target business object based on the processing results of the business data by each classifier; Among them, the classifiers other than the first classifier in the object type recognition model are trained in the following manner: Using any classifier to be trained in the object type recognition model except the first classifier as a target classifier; The sample weight of each sample in the unbalanced sample set is configured in the following manner: w t+1 (i)=pr t (i)×r t (i)+pw t (i)×(1+r t (i)) Among them, w t+1 (i) represents the sample weight corresponding to sample i, t+1 represents the identifier of the target classifier, and t represents the identifier of the previous classifier of the target classifier; t≥1 if y t (i) = y t (i)', then pr t (i)=1; if y t (i)≠y t (i)', then pr t (i)=0; if y t (i)≠y t (i)', then pw t (i)=1; if y t (i) = y t (i)', then pw t (i) = 0; r t (i) = y(i) × p t (i)+(1-y(i))×(1-p t (i)); y t (i) represents the actual label of sample i, y t (i)' represents the predicted label of sample i by the classifier identified as t, p t (i) represents the probability that the classifier identified as t predicts that sample i belongs to the specified label, r t (i) represents the probability that the classifier identified as t correctly predicts the prediction sample i; Using the configuration with sample weight w t+1 The target classifier is trained with the imbalanced sample set of (i).
9. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instructions are executed, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Far infrared pedestrian detection method for changed scenes
CN104239907A
User behavior prediction method and device, equipment and medium
CN112801718A