Method and device for determining discrimination threshold value of classification model and electronic equipment

By dynamically determining the discrimination threshold of the classification model and using the maximum prediction probability values ​​of multiple data sets, the problem of insufficient generalization ability caused by the fixed discrimination threshold in the existing technology is solved, and the efficient adaptation and accuracy of the classification model in different scenarios are achieved. sexual enhancement.

CN118799882APending Publication Date: 2024-10-18CHINA MOBILE GROUP ZHEJIANG +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202311361424.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the existing technology, the discrimination threshold of the classification model is usually fixed and cannot be dynamically adjusted, resulting in insufficient generalization capabilities and inability to adapt to changes in different business scenarios, resulting in poor performance of the classification model in different scenarios.

Method used

By obtaining multiple data sets, use the classification model to predict each data set, calculate the maximum prediction probability value of each data set as the target prediction probability value, and dynamically determine the discrimination threshold to improve the generalization ability and adaptability of the classification model. .

Benefits of technology

It effectively improves the generalization ability and accuracy of the classification model, can dynamically adapt to the concerns of different business scenarios, and is suitable for various types of classification problems without the need for complex adjustments to the original model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799882A_ABST
    Figure CN118799882A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine learning, and provides a discrimination threshold determination method and device of a classification model, and electronic equipment. The method comprises the following steps: acquiring a plurality of data sets corresponding to a to-be-promoted classification model; for each image data set, determining a predicted image sample corresponding to each image sample in the image data set by adopting an image classification model; according to the first prediction probability value of each prediction image sample, determining a first evaluation score corresponding to each prediction image sample; determining a first prediction probability value corresponding to the maximum first evaluation score in all the first evaluation scores as a first target prediction probability value corresponding to the image data set; and determining a discrimination threshold value of the image classification model according to the first target prediction probability values corresponding to the plurality of image data sets. According to the method, by determining the judgment threshold, the generalization ability of the classification model is effectively improved, an original classification model does not need to be subjected to complex adjustment, and the method can be suitable for various types of classification problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of machine learning, and in particular to a method, device and electronic device for determining a discrimination threshold of a classification model. Background Art

[0002] In the field of machine learning technology, a classification model refers to a model that can make classification predictions for unlabeled data after training data samples with category labels based on a classification algorithm. Assume that the data sample labeled with the target category is a positive example. If the probability of a data sample predicted by the classification model is greater than the probability threshold for discriminating positive examples (abbreviated as: discriminant threshold), the data sample is a positive example. Otherwise, it is not a positive example. Among them, the discriminant threshold can determine the generalization ability of the classification model. The generalization ability refers to the ability to perform well in predicting unknown data, and is also an important criterion for measuring the quality of the classification model.

[0003] Existing methods for determining the discrimination threshold often determine a fixed value based on expert experience, which is the discrimination threshold. However, this method cannot be dynamically adjusted based on changes in business scenarios, resulting in the classification model in different business scenarios being unable to have a better discrimination threshold, which in turn leads to insufficient generalization ability of the classification model. Summary of the invention

[0004] The embodiments of the present application provide a method, device and electronic device for determining a discrimination threshold of a classification model, so as to solve the technical problem of insufficient generalization ability of the classification model.

[0005] In a first aspect, an embodiment of the present application provides a method for determining a discrimination threshold of a classification model, comprising:

[0006] Acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples;

[0007] For each of the image data sets, using the image classification model, determine the predicted image samples corresponding to each of the image samples in the image data set; determine the first evaluation scores corresponding to each of the predicted image samples according to the first predicted probability values; and determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set;

[0008] Determining a discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the plurality of image data sets;

[0009] For each of the text data sets, using the text classification model, determine the predicted text samples corresponding to each of the text samples in the text data set; determine the second evaluation scores corresponding to each of the predicted text samples according to the second predicted probability values; determine the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target predicted probability value corresponding to the text data set;

[0010] The discrimination threshold of the text classification model is determined according to the second target prediction probability values ​​corresponding to each of the multiple text data sets.

[0011] In a second aspect, an embodiment of the present application provides a device for determining a discrimination threshold of a classification model, comprising:

[0012] An acquisition unit is used to acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples;

[0013] A processing unit is used to determine, for each of the image data sets, the predicted image samples corresponding to each image sample in the image data set using the image classification model; determine, based on the first predicted probability value of each predicted image sample, the first evaluation score corresponding to each predicted image sample; determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set; determine the discrimination threshold of the image classification model based on the first target predicted probability values ​​corresponding to each of the multiple image data sets; for each of the text data sets, determine, based on the text classification model, the predicted text samples corresponding to each text sample in the text data set; determine, based on the second predicted probability value of each predicted text sample, the second evaluation score corresponding to each predicted text sample; determine the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target predicted probability value corresponding to the text data set; determine the discrimination threshold of the text classification model based on the second target predicted probability values ​​corresponding to each of the multiple text data sets.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the steps of the method for determining a discrimination threshold of a classification model described in the first aspect are implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for determining a discrimination threshold of a classification model described in the first aspect.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method for determining a discrimination threshold of a classification model described in the first aspect.

[0017] The method, device and electronic device for determining the discrimination threshold of a classification model provided in the embodiments of the present application obtain multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples; for each image data set, the image classification model is used to determine the predicted image sample corresponding to each image sample in the image data set; according to the first predicted probability value of each predicted image sample, the first evaluation score corresponding to each predicted image sample is determined; the largest first evaluation score among all the first evaluation scores is determined. The first predicted probability value corresponding to an evaluation score is determined as the first target predicted probability value corresponding to the image data set; the discrimination threshold of the image classification model is determined according to the first target predicted probability values ​​corresponding to each of the multiple image data sets; for each of the text data sets, the text classification model is used to determine the predicted text sample corresponding to each text sample in the text data set; according to the second predicted probability value of each predicted text sample, the second evaluation score corresponding to each predicted text sample is determined; the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores is determined as the second target predicted probability value corresponding to the text data set; according to the second target predicted probability values ​​corresponding to each of the multiple text data sets, the discrimination threshold of the text classification model is determined. The method effectively improves the generalization ability of the classification model by determining the discrimination threshold, and can dynamically adapt to different concerns of the business scenario, and improve the accuracy and reliability of the classification model. At the same time, the method does not require complex adjustments to the original classification model and can be applied to various types of classification problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is one of the flow charts of the method for determining the discrimination threshold of the classification model provided in the embodiment of the present application;

[0020] Figure 2 This is the second flow chart of the method for determining the discrimination threshold of the classification model provided in the embodiment of the present application;

[0021] Figure 3 It is a structural diagram of a discrimination threshold determination system of a classification model provided in an embodiment of the present application;

[0022] Figure 4 It is a flow chart of each module in the discrimination threshold determination system of the classification model provided in the embodiment of the present application;

[0023] Figure 5a It is a schematic diagram of a flow chart of an input module determining a classification model to be improved provided in an embodiment of the present application;

[0024] Figure 5b It is a flow chart of the data processing module provided in the embodiment of the present application determining multiple data sets corresponding to the classification model to be improved;

[0025] Figure 5c It is a schematic diagram of a process for determining a prediction output item by a prediction analysis module provided in an embodiment of the present application;

[0026] Figure 5d It is a schematic diagram of a process of dynamically adjusting a sample prediction value by a dynamic adjustment module provided in an embodiment of the present application;

[0027] Figure 5e This is a schematic diagram of a process for determining an evaluation score by a classification evaluation module provided in an embodiment of the present application;

[0028] Figure 5f It is a flow chart of the optimal split point acquisition module provided in the embodiment of the present application for determining the discrimination threshold of the classification model to be improved;

[0029] Figure 5g This is a schematic diagram of the process of outputting data by the output display module provided in the embodiment of the present application;

[0030] Figure 6 It is a structural schematic diagram of a discrimination threshold determination device for a classification model provided in an embodiment of the present application;

[0031] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] In order to better understand the embodiments of the present application, the background technology is first described accordingly:

[0034] 1) Existing methods for improving the generalization ability of classification models focus on two aspects: customizing and optimizing classification algorithms for specific business scenarios and enhancing the characteristics of training data samples. However, the classification algorithm optimization and data feature addition methods that perform well under the evaluation criteria of specific business scenarios usually do not perform well under the evaluation criteria of other business scenarios. Optionally, specific business scenarios may include: medical business scenarios, financial business scenarios, security business scenarios, and livelihood business scenarios.

[0035] In other words, the above methods are limited to specific business scenarios and are not universal: the improvement methods of classification algorithm optimization and training sample feature enhancement are only effective for the current business scenario. Even for the same business model, the improvement methods will become invalid due to changes in the business scenario evaluation criteria. Moreover, the improvement methods cannot be directly used for different business scenario evaluation criteria. If you need to improve the generalization ability, you need to re-optimize the classification algorithm and enhance the training sample features.

[0036] 2) Existing methods of improving the generalization ability of classification models by optimizing classification algorithms and enhancing sample features, if the optimization and enhancement are insufficient, the generalization ability of the classification model will not be improved well, and if the optimization and enhancement are excessive, the generalization ability of the classification model will be reduced due to overfitting. Among them, the judgment of the degree of optimization and enhancement method often depends on expert experience rather than the technology itself.

[0037] In other words, the above method has the risk of reducing the generalization ability of the original classification model: this method often depends on the expert experience to judge the degree of optimization of the classification algorithm and the method of enhancing sample features. Only when the judgment is correct, will it be effective to improve the generalization ability of the classification model by optimizing the classification algorithm and enhancing sample features. Otherwise, the improvement effect will be minimal at best and the generalization ability of the original classification model will be reduced at worst.

[0038] 3) Existing classification models usually set the discrimination threshold to 0.5 or a fixed value, rather than dynamically adjusting it based on changes in business scenarios. This is not necessarily the optimal probability threshold for the current business scenario.

[0039] That is to say, the fixed values ​​involved in the above methods may lead to a decrease in the generalization ability of the classification model: the existing classification model usually sets the discrimination threshold to 0.5 or a fixed value, rather than dynamically calculating it according to the business scenario. It is not necessarily the best probability threshold suitable for the current business scenario. On the contrary, the model activation ability may be very poor due to the different emphasis of the evaluation criteria of the business scenario. For example, the false positives and false negatives in medical diagnosis increase, the key customers are missed in the analysis of telecommunications customer churn, the IoT equipment is misdiagnosed, the customer's face recognition error when opening a card, the telecommunications anti-fraud interception is not timely, and the customer credit assessment is inaccurate, etc.

[0040] In summary, no matter which method is used, it cannot effectively improve the generalization ability of the classification model. Not only is it not universal for the business scenarios of conventional classification prediction, but it cannot effectively avoid the risk of reducing the generalization ability of the original classification model, and does not have the absolute advantage of superimposed model classification accuracy.

[0041] In addition, in the field of machine learning, the performance of classification models is usually measured by different evaluation criteria such as precision and accuracy. For some classification problems, the proportion of sample positive examples is small but very important. Improving the recall rate of sample positive examples will greatly save labor costs and effectively improve the efficiency of business processing. For example, in business scenarios such as telecommunications customer churn analysis, IoT device abnormality diagnosis, customer card opening face recognition detection, telecommunications anti-fraud interception and customer credit assessment, it is necessary to focus on the recall rate of true positive examples. However, for some classification problems, precision may not be the only concern. For example, in medical diagnosis scenarios, false positive or negative results may lead to serious consequences. Therefore, it is necessary to focus on the accuracy of false positive and false negative examples. Therefore, in these cases, it is crucial to select an appropriate discrimination threshold to determine the reliability of the classification results according to different business evaluation criteria in different business scenarios.

[0042] The method for determining the discrimination threshold of the classification model provided in the embodiment of the present application effectively improves the generalization ability of the classification model by determining the discrimination threshold, and can dynamically adapt to different concerns of business scenarios, and improve the accuracy and reliability of the classification model. At the same time, the method does not require complex adjustments to the original classification model and can be applied to various types of classification problems.

[0043] The following uses an electronic device as an example to further explain the embodiments of the present application in detail:

[0044] Figure 1 A flow chart of a method for determining a discrimination threshold of a classification model provided in an embodiment of the present application. Figure 1 , the present application embodiment provides a method for determining a discrimination threshold of a classification model, which may include:

[0045] 101. Acquire multiple data sets corresponding to the classification model to be improved, wherein the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, and each image data set includes multiple image samples.

[0046] Among them, the image classification model refers to a model that can make classification predictions for unlabeled images after training image samples with category labels based on a classification algorithm.

[0047] Since the image classification models corresponding to different business scenarios are different, for each business scenario, the electronic device can first obtain the corresponding classification model to be improved, that is, the image classification model under each business scenario; the electronic device then obtains multiple initial image samples, and samples, screens and cleans the multiple initial image samples to obtain multiple image samples, and then obtains a data set; the electronic device can also repeat the sampling, screening and cleaning steps on the multiple initial image samples until the preset number of sampling times is reached. In this way, the electronic device can obtain multiple data sets to provide data support for subsequently determining the discrimination threshold for the classification model to be improved.

[0048] 102. For each image data set, use an image classification model to determine the predicted image samples corresponding to each image sample in the image data set; determine the first evaluation score corresponding to each predicted image sample based on the first predicted probability value of each predicted image sample; and determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set.

[0049] Among them, the image samples are the input data of the image classification model, and the predicted image samples are the output data of the image classification model.

[0050] The predicted probability value refers to the probability that the image sample is a positive example.

[0051] For each image data set, the electronic device can first use the image classification model to determine the predicted image sample corresponding to each image sample in the image data set, and then determine the first evaluation score corresponding to each predicted image sample; the electronic device then compares all the first evaluation scores to determine the maximum first evaluation score, and determines the first predicted probability value corresponding to the maximum first evaluation score as the first target predicted probability value corresponding to the image data set. Based on this, the electronic device can ultimately obtain as many first target predicted probability values ​​as there are image data sets, so as to provide data support for the subsequent determination of the discrimination threshold of the classification model to be improved.

[0052] In some embodiments, the electronic device determines the first evaluation score corresponding to each predicted image sample based on the first predicted probability value of each predicted image sample, which may include: the electronic device determines the first prediction probability cut point of each predicted image sample based on the first predicted probability value of each predicted image sample; the electronic device determines the first evaluation score corresponding to each predicted image sample based on the first prediction probability cut point of each predicted image sample.

[0053] In the process of determining the first evaluation score corresponding to each predicted image sample, the electronic device can determine the first prediction probability cut-off point of each predicted image sample according to the first prediction probability value of each predicted image sample, and then determine the first evaluation score corresponding to each predicted image sample. That is, the electronic device can ultimately obtain as many first prediction probability cut-off points as there are first prediction probability values, and then obtain as many first evaluation scores.

[0054] In some embodiments, the electronic device determines the first evaluation score corresponding to each predicted image sample according to the first predicted probability segmentation point of each predicted image sample, which may include one of the following implementation methods:

[0055] Implementation method 1: Sort the first prediction probability value of each prediction image sample from small to large to obtain a first prediction probability value sequence; traverse the prediction image samples corresponding to the first prediction probability value in the first prediction probability value sequence, and if the first current prediction image sample is not the last prediction image sample, determine the first prediction probability cut point of the first current prediction image sample according to the first prediction probability value of the first current prediction image sample and the first prediction probability value of the next adjacent prediction image sample of the first current prediction image sample; if the first current prediction image sample is the last prediction image sample, determine the first prediction probability value of the first current prediction image sample as the first prediction probability cut point of the first current prediction image sample.

[0056] In the process of determining the first evaluation score corresponding to each predicted image sample, the electronic device may first sort the first predicted probability value of each predicted image sample in ascending order to obtain a first predicted probability value sequence; the electronic device then traverses the predicted image samples corresponding to the first predicted probability value in the first predicted probability value sequence, and determines whether the currently traversed predicted image sample, that is, the first current predicted image sample is the last predicted image sample; if not, the first predicted probability cut point of the first current predicted image sample is determined based on the first predicted probability value of the first current predicted image sample and the first predicted probability value of the next adjacent predicted image sample of the first current predicted image sample; if so, the first predicted probability value of the first current predicted image sample may be directly determined as the first predicted probability cut point of the first current predicted image sample.

[0057] In some embodiments, the electronic device determines the first prediction probability cut point of the first current prediction image sample based on the first prediction probability value of the first current prediction image sample and the first prediction probability value of the next adjacent prediction image sample of the first current prediction image sample, which may include: the electronic device obtains the first prediction probability cut point of the first current prediction image sample according to the first cut point formula.

[0058] The formula for the first split point is:

[0059] P iqf represents the first prediction probability cut-off point of the i-th prediction image sample, the i-th prediction image sample is the first current prediction image sample; α1 represents the first constant; P iyc represents the first prediction probability value of the i-th prediction image sample; β1 represents the second constant; P (i+1)yc represents the first prediction probability value of the i+1th predicted image sample, where the i+1th predicted image sample is the next adjacent predicted image sample after the first current predicted image sample.

[0060] Based on the first prediction probability value sequence, the electronic device can accurately determine the first prediction probability cut-off point of the first current prediction image sample that is not the last prediction image sample based on the first cut-off point formula.

[0061] Implementation method 2: Sort the first prediction probability value of each prediction image sample from large to small to obtain a second prediction probability value sequence; traverse the prediction image samples corresponding to the second prediction probability value in the second prediction probability value sequence, and if the second current prediction image sample is not the first prediction image sample, determine the first prediction probability cut point of the second current prediction image sample according to the first prediction probability value of the second current prediction image sample and the first prediction probability value of the previous adjacent prediction image sample of the second current prediction image sample; if the second current prediction image sample is the first prediction image sample, determine the first prediction probability value of the second current prediction image sample as the first prediction probability cut point of the second current prediction image sample.

[0062] In the process of determining the first evaluation score corresponding to each predicted image sample, the electronic device may first sort the first predicted probability value of each predicted image sample in order from large to small to obtain a second predicted probability value sequence; the electronic device then traverses the predicted image samples corresponding to the second predicted probability value in the second predicted probability value sequence, and determines whether the currently traversed predicted image sample, that is, the second current predicted image sample, is the first predicted image sample; if not, the first predicted probability cut point of the second current predicted image sample is determined based on the first predicted probability value of the second current predicted image sample and the first predicted probability value of the previous adjacent predicted image sample of the second current predicted image sample; if so, the first predicted probability value of the second current predicted image sample may be directly determined as the first predicted probability cut point of the second current predicted image sample.

[0063] In some embodiments, the electronic device determines the first prediction probability cutting point of the second current prediction image sample based on the first prediction probability value of the second current prediction image sample and the first prediction probability value of the previous adjacent prediction image sample of the second current prediction image sample, which may include: the electronic device obtains the first prediction probability cutting point of the second current prediction image sample according to the second cutting point formula.

[0064] The second split point formula is:

[0065] P jqf represents the first prediction probability cut-off point of the j-th prediction image sample, and the j-th prediction image sample is the second current prediction image sample; α2 represents the third constant; P jyc represents the first prediction probability value of the j-th prediction image sample; β2 represents the fourth constant; P (j-1)yc represents the first prediction probability value of the j-1th prediction image sample, where the j-1th prediction image sample is the previous adjacent prediction image sample of the second current prediction image sample.

[0066] Based on the second prediction probability value sequence, the electronic device can accurately determine the first prediction probability cut-off point of the second current prediction image sample that is not the first prediction image sample based on the second cut-off point formula.

[0067] In some embodiments, the electronic device determines the first evaluation score corresponding to each predicted image sample according to the first predicted probability segmentation point of each predicted image sample, which may include one of the following implementation methods:

[0068] Implementation method 1: Based on the predicted image sample corresponding to the first predicted probability value in the first predicted probability value sequence, if the first predicted probability value of the first current predicted image sample is greater than the first predicted probability cut-off point of the first current predicted image sample, the first sample prediction value of each of the previous adjacent predicted image samples from the first predicted image sample to the first current predicted image sample is set to the first parameter, and the first sample prediction value of each of the first current predicted image sample to the last predicted image sample is set to the second parameter; according to the first parameter and the second parameter, the first reset item queue corresponding to the first current predicted image sample is determined, and the first evaluation score corresponding to the first reset item queue is determined.

[0069] In the process of determining the first evaluation score corresponding to each predicted image sample, the electronic device traverses the predicted image samples corresponding to the first predicted probability value in the first predicted probability value sequence, and determines whether the first predicted probability value corresponding to the currently traversed predicted image sample, that is, the first current predicted image sample, is greater than the first predicted probability cut-off point of the first current predicted image sample: if greater, it is necessary to update the sample prediction values ​​corresponding to all predicted image samples, specifically: the first sample prediction values ​​of the first predicted image sample to the previous adjacent predicted image sample of the first current predicted image sample are all set to the first parameter (such as 0), and the first sample prediction values ​​of the first current predicted image sample to the last predicted image sample are all set to the second parameter (such as 1), and then combine all the first parameters and all the second parameters to determine the first reset item queue corresponding to the first current predicted image sample, and determine the first evaluation score corresponding to the first reset item queue.

[0070] Otherwise, there is no need to update the sample prediction values ​​corresponding to all predicted image samples.

[0071] Implementation method 2: Based on the predicted image sample corresponding to the second predicted probability value in the second predicted probability value sequence, if the second predicted probability value of the second current predicted image sample is greater than the second predicted probability cut-off point of the second current predicted image sample, the second sample prediction value of each of the previous adjacent predicted image samples from the first predicted image sample to the second current predicted image sample is set to the third parameter, and the second sample prediction value of each of the second current predicted image sample to the last predicted image sample is set to the fourth parameter; according to the third parameter and the fourth parameter, the second reset item queue corresponding to the second current predicted image sample is determined, and the first evaluation score corresponding to the second reset item queue is determined.

[0072] In the process of determining the first evaluation score corresponding to each predicted image sample, the electronic device traverses the predicted image samples corresponding to the second predicted probability value in the second predicted probability value sequence, and determines whether the second predicted probability value corresponding to the currently traversed predicted image sample, that is, the second current predicted image sample, is greater than the second predicted probability cut-off point of the second current predicted image sample: if greater, it is necessary to update the sample prediction values ​​corresponding to all predicted image samples, specifically: the second sample prediction values ​​of the first predicted image sample to the previous adjacent predicted image sample of the second current predicted image sample are all set to the third parameter (such as 1), and the second sample prediction values ​​of the second current predicted image sample to the last predicted image sample are all set to the fourth parameter (such as 0), and then combine all third parameters and all fourth parameters to determine the second reset item queue corresponding to the second current predicted image sample, and determine the first evaluation score corresponding to the second reset item queue.

[0073] Otherwise, there is no need to update the sample prediction values ​​corresponding to all predicted image samples.

[0074] 103. Determine a discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the multiple image data sets.

[0075] After determining the first target prediction probability values ​​corresponding to each of the multiple image data sets, the electronic device can calculate all the first target prediction probability values ​​to obtain the discrimination threshold of the image classification model. The discrimination threshold of the image classification model corresponding to different business scenarios is different.

[0076] In some embodiments, the electronic device determines the discrimination threshold of the image classification model based on the first target prediction probability values ​​corresponding to each of the multiple image data sets, which may include: the electronic device determines the sample weights of the image samples corresponding to each of the first target prediction probability values; the electronic device determines the discrimination threshold of the image classification model based on all the first target prediction probability values ​​and all the sample weights.

[0077] After determining the first target prediction probability values ​​corresponding to each of the multiple image data sets, the electronic device can first determine the sample weights of the image samples corresponding to all the first target prediction probability values, and then combine all the first target prediction probability values ​​to determine the discrimination threshold of the image classification model.

[0078] In some embodiments, the electronic device determines the discrimination threshold of the image classification model based on all first target prediction probability values ​​and all sample weights, which may include: the electronic device obtains the discrimination threshold of the image classification model according to a threshold formula.

[0079] The threshold formula is: K ≥ 2;

[0080] P 阈值 represents the discrimination threshold; K represents the total number of all first target prediction probability values; W k represents the kth first target prediction probability value among all first target prediction probability values; P kqf Represents the sample weight of the image sample corresponding to the kth first target prediction probability value.

[0081] The electronic device can accurately determine the discrimination threshold of the image classification model based on the above threshold formula.

[0082] In an embodiment of the present application, multiple data sets corresponding to the classification model to be improved are obtained, wherein the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, and each image data set includes multiple image samples; for each image data set, the image classification model is used to determine the predicted image sample corresponding to each image sample in the image data set; according to the first predicted probability value of each predicted image sample, the first evaluation score corresponding to each predicted image sample is determined; the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores is determined as the first target predicted probability value corresponding to the image data set; according to the first target predicted probability values ​​corresponding to each of the multiple image data sets, the discrimination threshold of the image classification model is determined. This method effectively improves the generalization ability of the image classification model by determining the discrimination threshold.

[0083] Figure 2 A flow chart of a method for determining a discrimination threshold of a classification model provided in an embodiment of the present application. Figure 2 , the present application embodiment provides a method for determining a discrimination threshold of a classification model, which may include:

[0084] 201. Acquire multiple data sets corresponding to the classification model to be improved; wherein the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, and each text data set includes multiple text samples.

[0085] Among them, the text classification model refers to a model that can make classification predictions for unlabeled text after training text samples with category labels based on a classification algorithm.

[0086] 202. For each text data set, a text classification model is used to determine the predicted text sample corresponding to each text sample in the text data set; based on the second predicted probability value of each predicted text sample, a second evaluation score corresponding to each predicted text sample is determined; and the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores is determined as the second target predicted probability value corresponding to the text data set.

[0087] 203. Determine a discrimination threshold of the text classification model according to the second target prediction probability values ​​corresponding to each of the multiple text data sets.

[0088] It should be noted that steps 201-203 and Figure 1 The steps 101-103 are similar and will not be described in detail here.

[0089] In an embodiment of the present application, multiple data sets corresponding to the classification model to be improved are obtained; wherein the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, and each text data set includes multiple text samples; for each text data set, the text classification model is used to determine the predicted text sample corresponding to each text sample in the text data set; according to the second predicted probability value of each predicted text sample, the second evaluation score corresponding to each predicted text sample is determined; the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores is determined as the second target predicted probability value corresponding to the text data set; according to the second target predicted probability values ​​corresponding to each of the multiple text data sets, the discrimination threshold of the text classification model is determined. The method effectively improves the generalization ability of the text classification model by determining the discrimination threshold.

[0090] Combined with the above Figure 1 and Figure 2 ,By determining the discrimination threshold, the generalization ability of different ,classification models can be effectively improved, and the different concerns of the ,business scenarios can be dynamically adapted to the different concerns of the ,classification models, and the accuracy and reliability of the classification models can be improved.,At the same time, this method does not require complex adjustments to the ,original classification model, and can be applied to various types of ,classification problems.

[0091] Figure 3 This is a schematic diagram of the structure of the discrimination threshold determination system of the classification model provided in the embodiment of the present application. Figure 3 The embodiment of the present application provides a discrimination threshold determination system for a classification model, which can be called a classification model dynamic prompt system, including: an input module, a data processing module, a prediction analysis module, a dynamic adjustment module, a classification evaluation module, an optimal segmentation point acquisition module and an output display module.

[0092] The input module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the model parameters and model attributes of the classification model that needs to improve the generalization ability (i.e., the classification model to be improved) and submit them to the classification model dynamic improvement system. Optionally, the above business scenario can be an image classification business scenario or a text classification business scenario, which is not specifically limited here.

[0093] The data processing module is used to provide custom configuration functions according to business scenarios, and based on the custom configuration functions, customize sampling / loop sampling, statistical analysis and data cleaning of labeled data samples that need to be verified (such as image samples or text samples) to obtain processed data samples, and submit the processed data samples to the classification model dynamic improvement system.

[0094] The prediction and analysis module is used to predict the processed data samples with the classification model whose generalization ability needs to be improved, obtain the prediction results (such as predicted image samples or predicted text samples), and collect, process and analyze the prediction results.

[0095] The dynamic adjustment module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, obtain the prediction probability cut point of each prediction data sample in the above prediction results; then according to the prediction probability value of each prediction data sample, a custom selection sorting method (such as from small to large or from large to small) is used to dynamically adjust the sample prediction value of each prediction data sample.

[0096] The classification evaluation module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the global classification evaluation standard, evaluate the classification effect of the reset item queue at each segmentation point, and calculate the corresponding evaluation score.

[0097] The optimal split point acquisition module is used to obtain the optimal split point of each sampling data (i.e., each data set, each data set includes multiple data samples) in turn, and then perform weighted calculation on all the optimal split points to obtain the comprehensive optimal split point corresponding to multiple sampling data, and then dynamically adjust the optimal probability threshold (i.e., classification threshold) when building data sample prediction for the classification model whose generalization ability needs to be improved based on the comprehensive optimal split point.

[0098] The output display module is used to provide custom configuration functions according to business scenarios, and based on the custom configuration functions, customize the display of result output item configuration and display format. At the same time, it provides custom export methods and customized export capabilities.

[0099] For example, Figure 4 FIG. 1 is a flow chart of each module in the discrimination threshold determination system of the classification model provided in the embodiment of the present application. Figure 4 It can be seen that there is no limit to the time sequence of the input module determining the classification model to be improved and the data processing model determining multiple data sets.

[0100] Combination Figure 3 , Optionally, the input module may include: a model acquisition module to be improved and a model import module.

[0101] The data processing module may include: a data acquisition module, a data import module, a data sampling module, a loop processing module, a data statistical analysis module and a data cleaning module.

[0102] The prediction and analysis module may include: a positive example prediction module and a positive example sorting module.

[0103] The dynamic adjustment module may include: a segmentation point acquisition module, an ascending positive example prediction probability reset module, and a descending positive example prediction probability reset module.

[0104] The classification evaluation module may include: a classification evaluation standard selection module and a classification effect evaluation module.

[0105] The optimal segmentation point acquisition module may include: a single optimal segmentation point acquisition module, a comprehensive optimal segmentation point acquisition module and a classification model dynamic improvement application module.

[0106] The output display module may include: an output display configuration module, an output detail display module and an export module.

[0107] (1) For the acquisition module: For example, Figure 5a , which is a flow chart of the input module provided in the embodiment of the present application to determine the classification model to be improved. Figure 5a It can be seen that the module for obtaining the model to be improved is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the classification model whose generalization ability needs to be improved; and then organize and summarize the model parameters and model properties of the classification model.

[0108] The model import module is used to import the sorted and summarized model parameters and model attributes into the classification model dynamic improvement system, and use the classification model corresponding to the model parameters and model attributes imported into the classification model dynamic improvement system as the classification model to be improved.

[0109] (2) For the data processing module: the data acquisition module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the screening of labeled data samples that need to be verified, and organize and summarize all labeled data samples.

[0110] The data import module is used to import the sorted and summarized labeled data samples into the classification model dynamic improvement system.

[0111] The data sampling module is used to sample the sorted and summarized labeled data samples to obtain sampled labeled data samples (i.e., data sets) and calculate relevant statistical values. Optionally, the relevant statistical values ​​may include: the sampling sample size is Q 总 , the sample size of the positive sample is Q 正, sample weight W and optimal split point P 切 . Where W = μ0*(Q 正 / Q 总 ), μ0 represents the preset parameter; the optimal split point P 切 The initial value of is 0. The sampled labeled data samples may include positive samples and non-positive samples.

[0112] The loop processing module is used to loop record the relevant information of the labeled data samples and track the subsequent processing results.

[0113] The data statistical analysis module is used to perform statistical analysis on the sampled labeled data samples, filter out the labeled data samples with abnormal statistical results, and update the relevant statistical values.

[0114] The data cleaning module is used to clean the labeled data samples with abnormal statistical results and update the relevant statistical values.

[0115] For example, Figure 5b , which is a flow chart of the data processing module provided in the embodiment of the present application determining multiple data sets corresponding to the classification model to be improved. Figure 5b It can be seen that the data acquisition module provides a custom configuration function, and based on the custom configuration function, it customarily filters out the labeled data samples that need to be verified ( Figure 5b The data import module imports the sorted and summarized labeled data samples into the classification model dynamic improvement system.

[0116] The data sampling module samples the organized and summarized labeled data samples. The sampling method and sampling ratio can be selected according to different needs: if the circular sampling flag is F=0, then the sampling ratio value range is (0,1], and the default is no sampling (that is, the sampling method is none and the sampling ratio is 100%). If the circular sampling flag is F=1, then the sampling ratio value range is (0,1). The sampling method and sampling ratio must be set. After the sampling is completed, the relevant statistical values ​​corresponding to all the sampled labeled data samples are calculated, and based on the relevant statistical values, a sampling record item is generated for all the sampled labeled data samples. At this time, the sampling record item may include: the sampling sample size is Q 总 , the sample size of the positive sample is Q 正 , sample weight W and optimal split point P 切Then, if the sampling ratio is <100%, it will directly enter the loop processing module, otherwise, it will directly enter the data statistical analysis module; the loop processing module sets the number of loops to N, N≥2, which is a positive integer and is a global unified configuration of the system. If N=1, it will directly enter the data statistical analysis module; otherwise, it will set the loop sampling flag F=1 (the loop sampling flag F defaults to 0), add the sampling number I to the sampling record, and then. Loop into the data sampling module for data sampling, and also add the sampling number I to the sampling record until N data samples are completed (that is, multiple data sets are obtained, and then the final sampling record item is obtained.

[0117] The data statistical analysis module selects labeled data samples with abnormal statistical results such as duplication, information error, missing information, and extreme values ​​based on the sampled labeled data samples and the calculated related statistical values. After the screening is completed, Q is calculated. 重复 , Q 信息错误 , Q 信息缺失 and Q 极值 The data cleaning module uses the cleaning method selected according to different needs based on the abnormal labeled data samples and the calculated related statistical values. After the cleaning is completed, the final sampling record items are updated, and the processed data (i.e. the final labeled data samples), the final sampling record items and the related statistical values ​​are updated to the classification model dynamic improvement system.

[0118] (3) For the prediction analysis module: For example, Figure 5c FIG. 1 is a flow chart of the prediction analysis module according to an embodiment of the present application for determining the prediction output items. Figure 5c It can be seen that the positive example prediction module is used to use the classification model to be improved to predict the final labeled data samples one by one, obtain multiple predicted data samples (such as predicted image samples or predicted text samples), and calculate the predicted probability value of each predicted data sample.

[0119] The positive example sorting module is used to sort the prediction output items corresponding to the above-mentioned multiple prediction data samples based on the prediction probability value of each prediction data sample to obtain the final prediction output item. Optionally, the prediction output item may include: the sample true value Y 真实 , sample prediction value Y 预测 and the predicted probability value P 正 .

[0120] (4) For the dynamic adjustment module: a split point acquisition module is used to determine the split point of each prediction data sample and add all the split points to the final prediction output item.

[0121] The ascending positive example prediction probability reset module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, reset the sample prediction value in the above final prediction output item in the ascending case.

[0122] The descending positive example prediction probability reset module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, reset the sample prediction value in the above final prediction output item in the descending case.

[0123] For example, Figure 5d , which is a schematic diagram of the process of dynamically adjusting the sample prediction value by the dynamic adjustment module provided in the embodiment of the present application. Figure 5d It can be seen that the split point acquisition module receives the sorted final prediction output item (the sample true value Y 真实 , sample prediction value Y 预测 and the predicted probability value P 正 ), calculate the split point P of each predicted data sample in turn 切分 , and added to the final prediction output (the true value of the sample Y 真实 , sample prediction value Y 预测 , predicted probability value P 正 , the split point P 切分 ), the split point can be determined using the above split point formula.

[0124] The ascending positive example prediction probability reset module receives the output items (i.e., the first prediction probability value sequence) sorted from small to large by all prediction probability values, and calculates the total sample true value and sample prediction value reset item queue Z corresponding to each output item in turn. 升重置 . Let Z 0升重置 is a subset of the output items (the true value of the sample Y 真实 , sample prediction value Y 预测 ), for the i-th output item, i∈[1,Q 总 ], first Z i升重置 Initialize to Z 0升重置 , then update Z i升重置 Each output item in the queue. The update rule is as follows: If the predicted probability value P iyc >Split point P iqf , then, from the 1st item to the i-1th item, all Y i预测 Set the first parameter to 0; starting from the i-th item, all Y i预测 Set to the second parameter 1. Otherwise, it will not be updated. 升重置 Add to the final prediction output (the true value of the sample Y 真实 , sample prediction value Y 预测 , predicted probability value P 正 , the split point P 切分, reset item queue Z 升重置 )middle.

[0125] The descending positive example prediction probability reset module receives the output items sorted from large to small according to all the prediction probability values ​​(i.e., the first prediction probability value sequence), and calculates the full sample true value and sample prediction value reset item queue Z corresponding to each output item in turn. 降重置 . Let Z 0降重置 is a subset of the output items (the true value of the sample Y 真实 , sample prediction value Y 预测 ). For the i-th output item, i∈[1,Q 总 ], first Z i降重置 Initialize to Z 0降重置 , then update Z i降重置 Each output item in the queue. The update rule is as follows: If the predicted probability value P iyc < Cut point P iqf , then, from the 1st item to the i-1th item, all Y i预测 Set to the third parameter 1; starting from the i-th item, all Y i预测 Set the fourth parameter to 0. Otherwise, it will not be updated. 降重置 Add to the final prediction output (the true value of the sample Y 真实 , sample prediction value Y 预测 , predicted probability value P 正 , the split point P 切分 , reset item queue Z 降重置 )middle.

[0126] (5) For the classification evaluation module: the classification evaluation standard selection module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the selection of the global classification evaluation standard S0, and then set the corresponding calculation formula. Among them, S0 is the system global unified configuration, and the default is F1-Score.

[0127] The classification effect evaluation module is used to evaluate the classification effect of the reset item queue at each segmentation point and calculate the evaluation score S corresponding to each reset item queue. 评估 .

[0128] For example, Figure 5e The figure is a schematic diagram of the process of determining the evaluation score by the classification evaluation module provided in the embodiment of the present application. Figure 5e It can be seen that the classification evaluation standard selection module provides a custom configuration function according to the business scenario, and based on the custom configuration function, customizes the selection of the global classification evaluation standard S0. The classification effect evaluation module receives the dynamically adjusted final prediction output item (the sample true value Y 真实 , sample prediction value Y 预测, predicted probability value P 正 , the split point P 切分 , reset item queue Z 升 / 降重置 ), extract the reset item queue Z 升 / 降重置 , according to the global classification evaluation standard S0, Z 升 / 降重置 Evaluation score S 评估 Calculate and add to the final prediction output (the sample true value Y 真实 , sample prediction value Y 预测 , predicted probability value P 正 , the split point P 切分 , reset item queue Z 升 / 降重置 , classification evaluation score S 评估 )middle.

[0129] (6) Optimal split point acquisition module: A single optimal split point acquisition module is used to obtain the optimal split point (i.e., target prediction probability value) corresponding to a single sampling data (i.e., the first data set).

[0130] The comprehensive optimal segmentation point acquisition module is used to perform weighted calculation on all optimal segmentation points to obtain the comprehensive optimal segmentation point of multiple sampling data.

[0131] The classification model dynamic improvement application module is used to adjust the optimal probability threshold (i.e., the discrimination threshold) during classification model prediction based on the above-mentioned comprehensive optimal split point.

[0132] For example, Figure 5f FIG. 1 is a flow chart of the optimal segmentation point acquisition module provided in the embodiment of the present application for determining the discrimination threshold of the classification model to be improved. Figure 5f It can be seen that the single best split point acquisition module receives the final prediction output item of the classification evaluation module, and according to all the evaluation scores S in the final prediction output item 评估 Sort in descending or ascending order, evaluate the score S 评估 The highest output item split point P 切分 This is the optimal split point P for this sampling data. 最佳切分 , and P 最佳切分 The value is updated to P in the sampling record item of this sampling qf The module for obtaining the best split point is based on all P qf , and use the above threshold formula to determine the comprehensive optimal split point P 综合最佳切分 The classification model dynamic improvement application module adjusts the discrimination threshold P when the classification model is predicted. 正例判别阈值 =P 综合最佳切分 , where the discrimination threshold P 正例判别阈值 It means that the predicted positive probability is greater than P 综合最佳切分When , it is predicted as a positive example, otherwise it is not a positive example. Finally, the optimal probability threshold of the classification model after system optimization is set to the above-mentioned discrimination threshold P 正例判别阈值 .

[0133] (7) For the output display module: For example, Figure 5g The figure is a schematic diagram of the process of outputting data by the output display module provided in the embodiment of the present application. Figure 5g It can be seen that the output display configuration module is used to provide a custom configuration function according to the business scenario, and based on the custom configuration function, customize the display result output item configuration and display format.

[0134] The output detail display module is used to display the output details, including the output optimal probability threshold, the first N cut-off points, the evaluation score at each cut-off point, the first N sample probability prediction values ​​at each cut-off point, and other information.

[0135] The export module is used to provide custom export methods and customized export capabilities.

[0136] It should be noted that the specific implementation process of the discrimination threshold determination system of the above classification model in the process of interaction with the user is as follows:

[0137] Step 1: The user customizes the model to be optimized and the training data through the system interface, that is, inputs relevant configuration parameters into the system. The relevant configuration parameters may include: model parameters, model attributes, whether the data is sampled / circulated, cleaning rules and other information.

[0138] Step 2: After the user clicks the "Start Optimization" button on the system interface, an optimization instruction is generated; the system background responds to the optimization instruction, calculates the predicted probability value and sorts the results by the default sorting method.

[0139] Step 3: Users customize the prediction probability value sorting method and global classification evaluation criteria based on the business scenario needs to select the best split point. The system calculates the best split point based on the prediction probability value sorting method and global classification evaluation criteria entered by the user, and sets the system's best probability threshold accordingly.

[0140] Step 4: After the system calculation is completed, the system interface will display "Display Results". Users can click "Display Results" to customize the output details.

[0141] Step 5: Users can repeat steps 3 and 4 above according to specific needs to obtain different dynamic optimal probability thresholds under various business evaluation criteria, that is, to obtain the discrimination thresholds corresponding to the classification models under different business scenarios.

[0142] Step 6: The user inputs the prediction sample, and the system outputs the current classification result and the predicted probability value of the current classification result. At the same time, the system's current evaluation criteria and the system's optimal probability threshold can be customized.

[0143] The following are several possible implementation scenarios corresponding to the method for determining the discrimination threshold of the classification model provided in the embodiments of the present application:

[0144] Scenario 1: In a medical diagnosis scenario, it is necessary to determine whether a patient has a certain disease. The collected training data set can be used to train the classification model, and the test data set is used to evaluate the performance of the classification model. Among them, the discrimination threshold determination method of the classification model is adopted to determine that the optimal probability threshold of the classification model is 0.7. Then, the test data set is classified using this optimal probability threshold, and the classification results are evaluated. Compared with using the default probability threshold (usually 0.5), using the above optimal probability threshold of 0.7 can reduce the false positive rate by 10% and the false negative rate by 5%, respectively, thereby improving the accuracy of the classification results.

[0145] Scenario 2: In an IoT device anomaly diagnosis scenario, it is necessary to diagnose abnormal devices and report them for repair in a timely manner. The collected training data set can be used to train the classification model, and the test data set is used to evaluate the performance of the classification model. Among them, the discrimination threshold determination method of the classification model is adopted to determine the optimal probability threshold of the classification model as 0.68. Then, the test data set is classified using the optimal probability threshold, and the classification results are evaluated. Compared with using the default probability threshold, using the above optimal probability threshold of 0.68 can increase the true case detection rate of device anomalies by 16%, thereby improving the accuracy of the classification results.

[0146] Scenario 3: In a telecom anti-fraud interception scenario, it is necessary to intelligently identify whether telecom fraud is involved while minimizing the disturbance to the public. The collected training data set can be used to train the classification model, and the test data set is used to evaluate the performance of the classification model. Among them, the discrimination threshold determination method of the classification model is adopted to determine the optimal probability threshold of the classification model as 0.57. Then, the test data set is classified using the optimal probability threshold, and the classification results are evaluated. Compared with using the default probability threshold, using the above optimal probability threshold of 0.57 can increase the true case detection rate of telecom anti-fraud by 12%, thereby improving the accuracy of the classification results.

[0147] The above shows that by customizing the evaluation criteria of the classification model and calculating the comprehensive best positive probability cut-off point of the classification result to dynamically adjust the best probability threshold, the accuracy and reliability of the classification results can be effectively improved, and the generalization ability of the classification model can be effectively improved, so as to better cope with classification problems in actual application scenarios. In addition, the above process can effectively reduce the positive rate and false negative rate, and improve the recall rate of true positive examples.

[0148] The following is a description of a discrimination threshold determination device for a classification model provided in an embodiment of the present application. The discrimination threshold determination device for a classification model described below and the discrimination threshold determination method for a classification model described above can be referenced to each other.

[0149] Figure 6 This is a schematic diagram of the structure of a device for determining a discrimination threshold of a classification model provided in an embodiment of the present application. Figure 6 , the embodiment of the present application provides a device for determining a discrimination threshold of a classification model, which may include:

[0150] The acquisition unit 601 is used to acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples;

[0151] Processing unit 602 is used to determine, for each image data set, the predicted image sample corresponding to each image sample in the image data set using the image classification model; determine the first evaluation score corresponding to each predicted image sample according to the first prediction probability value of each predicted image sample; determine the first prediction probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target prediction probability value corresponding to the image data set; determine the discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the multiple image data sets; determine, for each text data set, the predicted text sample corresponding to each text sample in the text data set using the text classification model; determine the second evaluation score corresponding to each predicted text sample according to the second prediction probability value of each predicted text sample; determine the second prediction probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target prediction probability value corresponding to the text data set; determine the discrimination threshold of the text classification model according to the second target prediction probability values ​​corresponding to each of the multiple text data sets.

[0152] Optionally, the processing unit 602 is specifically used to determine the first prediction probability cut point of each prediction image sample according to the first prediction probability value of each prediction image sample; and determine the first evaluation score corresponding to each prediction image sample according to the first prediction probability cut point of each prediction image sample.

[0153] Optionally, the processing unit 602 is specifically used to sort the first prediction probability values ​​of each prediction image sample from small to large to obtain a first prediction probability value sequence; traverse the prediction image samples corresponding to the first prediction probability value in the first prediction probability value sequence, and if the first current prediction image sample is not the last prediction image sample, determine the first prediction probability cut point of the first current prediction image sample according to the first prediction probability value of the first current prediction image sample and the first prediction probability value of the next adjacent prediction image sample of the first current prediction image sample; if the first current prediction image sample is the last prediction image sample, determine the first prediction probability value of the first current prediction image sample as the first current prediction image sample. The first prediction probability cutting point is determined; the first prediction probability values ​​of the prediction image samples are sorted from large to small to obtain a second prediction probability value sequence; the prediction image samples corresponding to the second prediction probability value in the second prediction probability value sequence are traversed, and if the second current prediction image sample is not the first prediction image sample, the first prediction probability cutting point of the second current prediction image sample is determined according to the first prediction probability value of the second current prediction image sample and the first prediction probability value of the previous adjacent prediction image sample of the second current prediction image sample; if the second current prediction image sample is the first prediction image sample, the first prediction probability value of the second current prediction image sample is determined as the first prediction probability cutting point of the second current prediction image sample.

[0154] Optionally, the processing unit 602 is specifically used to, based on the predicted image sample corresponding to the first predicted probability value in the first predicted probability value sequence, if the first predicted probability value of the first current predicted image sample is greater than the first predicted probability cut-off point of the first current predicted image sample, set the first sample prediction values ​​of the first predicted image sample to the previous adjacent predicted image sample of the first current predicted image sample to the first parameter, and set the first sample prediction values ​​of the first current predicted image sample to the last predicted image sample to the second parameter; determine the first reset item queue corresponding to the first current predicted image sample according to the first parameter and the second parameter, and determine the first reset item queue corresponding to the first reset item queue a first evaluation score of the first prediction probability value; based on the predicted image sample corresponding to the second prediction probability value in the second prediction probability value sequence, if the second prediction probability value of the second current predicted image sample is greater than the second prediction probability cut-off point of the second current predicted image sample, then the second sample prediction values ​​of the first predicted image sample to the previous adjacent predicted image sample of the second current predicted image sample are all set to the third parameter, and the second sample prediction values ​​of the second current predicted image sample to the last predicted image sample are all set to the fourth parameter; according to the third parameter and the fourth parameter, the second reset item queue corresponding to the second current predicted image sample is determined, and the first evaluation score corresponding to the second reset item queue is determined.

[0155] Optionally, the processing unit 602 is specifically configured to obtain a first predicted probability segmentation point of the first current predicted image sample according to a first segmentation point formula; wherein the first segmentation point formula is: P iqf represents the first prediction probability cut-off point of the i-th prediction image sample, and the i-th prediction image sample is the first current prediction image sample; α1 represents the first constant; P iy represents the first prediction probability value of the i-th prediction image sample; β1 represents the second constant; P (i+1)yc represents a first prediction probability value of the i+1th prediction image sample, where the i+1th prediction image sample is a subsequent adjacent prediction image sample of the first current prediction image sample;

[0156] Optionally, the processing unit 602 is specifically configured to obtain a first prediction probability segmentation point of the second current prediction image sample according to a second segmentation point formula; wherein the second segmentation point formula is: P jqf represents the first prediction probability cut-off point of the j-th prediction image sample, and the j-th prediction image sample is the second current prediction image sample; α2 represents the third constant; P jyc represents the first prediction probability value of the j-th prediction image sample; β2 represents the fourth constant; P (j-1)yc represents a first prediction probability value of the j-1th prediction image sample, where the j-1th prediction image sample is a previous adjacent prediction image sample of the second current prediction image sample.

[0157] Optionally, the processing unit 602 is specifically used to determine the sample weights of the image samples corresponding to all the first target prediction probability values; and determine the discrimination threshold of the image classification model based on all the first target prediction probability values ​​and all the sample weights.

[0158] Optionally, the processing unit 602 is specifically configured to obtain a discrimination threshold of the image classification model according to a threshold formula; wherein the threshold formula is: K≥2; P 阈值 represents the discrimination threshold; K represents the total number of all first target prediction probability values; W k represents the kth first target prediction probability value among all the first target prediction probability values; P kqf Indicates the sample weight of the image sample corresponding to the k-th first target prediction probability value.

[0159] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call a computer program in the memory 730 to execute the steps of the method for determining the discrimination threshold of the classification model, for example including:

[0160] Acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples;

[0161] For each of the image data sets, using the image classification model, determine the predicted image samples corresponding to each of the image samples in the image data set; determine the first evaluation scores corresponding to each of the predicted image samples according to the first predicted probability values; and determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set;

[0162] Determining a discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the plurality of image data sets;

[0163] For each of the text data sets, using the text classification model, determine the predicted text samples corresponding to each of the text samples in the text data set; determine the second evaluation scores corresponding to each of the predicted text samples according to the second predicted probability values; determine the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target predicted probability value corresponding to the text data set;

[0164] The discrimination threshold of the text classification model is determined according to the second target prediction probability values ​​corresponding to each of the multiple text data sets.

[0165] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0166] On the other hand, an embodiment of the present application also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the steps of the method for determining the discrimination threshold of the classification model provided in the above embodiments.

[0167] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, which stores a computer program, and the computer program is used to enable the processor to execute the steps of the method for determining the discrimination threshold of the classification model provided in the above embodiments.

[0168] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.

[0169] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining a discrimination threshold of a classification model, characterized in that: include: Acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples; For each of the image data sets, using the image classification model, determine the predicted image samples corresponding to each of the image samples in the image data set; determine the first evaluation scores corresponding to each of the predicted image samples according to the first predicted probability values; and determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set; Determining a discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the plurality of image data sets; For each of the text data sets, using the text classification model, determine the predicted text samples corresponding to each of the text samples in the text data set; determine the second evaluation scores corresponding to each of the predicted text samples according to the second predicted probability values; determine the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target predicted probability value corresponding to the text data set; The discrimination threshold of the text classification model is determined according to the second target prediction probability values ​​corresponding to each of the multiple text data sets.

2. The method for determining the discrimination threshold of a classification model according to claim 1, characterized in that: The determining, according to the first prediction probability value of each predicted image sample, a first evaluation score corresponding to each predicted image sample comprises: Determining a first prediction probability cutoff point for each prediction image sample according to the first prediction probability value of each prediction image sample; According to the first prediction probability cut-off point of each predicted image sample, a first evaluation score corresponding to each predicted image sample is determined.

3. The method for determining the discrimination threshold of a classification model according to claim 2, characterized in that: The determining, according to the first prediction probability cut-off point of each prediction image sample, a first evaluation score corresponding to each prediction image sample comprises: The first prediction probability values ​​of the prediction image samples are sorted from small to large to obtain a first prediction probability value sequence; the prediction image samples corresponding to the first prediction probability values ​​in the first prediction probability value sequence are traversed, and if the first current prediction image sample is not the last prediction image sample, the first prediction probability cutoff point of the first current prediction image sample is determined according to the first prediction probability value of the first current prediction image sample and the first prediction probability value of the next adjacent prediction image sample of the first current prediction image sample; if the first current prediction image sample is the last prediction image sample, the first prediction probability value of the first current prediction image sample is determined as the first prediction probability cutoff point of the first current prediction image sample; The first prediction probability values ​​of the predicted image samples are sorted from large to small to obtain a second prediction probability value sequence; the predicted image samples corresponding to the second prediction probability value in the second prediction probability value sequence are traversed, and if the second current predicted image sample is not the first predicted image sample, the first prediction probability cutoff point of the second current predicted image sample is determined according to the first prediction probability value of the second current predicted image sample and the first prediction probability value of the previous adjacent predicted image sample of the second current predicted image sample; if the second current predicted image sample is the first predicted image sample, the first prediction probability value of the second current predicted image sample is determined as the first prediction probability cutoff point of the second current predicted image sample.

4. The method for determining the discrimination threshold of a classification model according to claim 3, characterized in that: The determining, according to the first prediction probability cut-off point of each prediction image sample, a first evaluation score corresponding to each prediction image sample comprises: Based on the predicted image sample corresponding to the first predicted probability value in the first predicted probability value sequence, if the first predicted probability value of the first current predicted image sample is greater than the first predicted probability cut-off point of the first current predicted image sample, the first sample prediction values ​​of each of the first predicted image sample to the previous adjacent predicted image sample of the first current predicted image sample are set to the first parameter, and the first sample prediction values ​​of each of the first current predicted image sample to the last predicted image sample are set to the second parameter; according to the first parameter and the second parameter, a first reset item queue corresponding to the first current predicted image sample is determined, and a first evaluation score corresponding to the first reset item queue is determined; Based on the predicted image sample corresponding to the second predicted probability value in the second predicted probability value sequence, if the second predicted probability value of the second current predicted image sample is greater than the second predicted probability cut-off point of the second current predicted image sample, the second sample prediction value of each of the previous adjacent predicted image samples from the first predicted image sample to the second current predicted image sample is set to the third parameter, and the second sample prediction value of each of the second current predicted image sample to the last predicted image sample is set to the fourth parameter; according to the third parameter and the fourth parameter, the second reset item queue corresponding to the second current predicted image sample is determined, and the first evaluation score corresponding to the second reset item queue is determined.

5. The method for determining the discrimination threshold of a classification model according to claim 3, characterized in that: The determining, according to the first prediction probability value of the first current prediction image sample and the first prediction probability value of the next adjacent prediction image sample of the first current prediction image sample, the first prediction probability cutting point of the first current prediction image sample comprises: According to the first cutting point formula, a first predicted probability cutting point of the first current predicted image sample is obtained; The first split point formula is: P iqf represents the first prediction probability cut-off point of the i-th prediction image sample, the i-th prediction image sample is the first current prediction image sample; α1 represents the first constant; P iyc represents the first prediction probability value of the i-th prediction image sample; β1 represents the second constant; P (i+1)yc represents a first prediction probability value of the i+1th prediction image sample, where the i+1th prediction image sample is a subsequent adjacent prediction image sample of the first current prediction image sample; The determining, according to the first prediction probability value of the second current prediction image sample and the first prediction probability value of the previous adjacent prediction image sample of the second current prediction image sample, the first prediction probability cut-off point of the second current prediction image sample comprises: According to the second split point formula, a first predicted probability split point of the second current predicted image sample is obtained; The second split point formula is: P jqf represents the first prediction probability cut-off point of the j-th prediction image sample, and the j-th prediction image sample is the second current prediction image sample; α2 represents the third constant; P jyc represents the first prediction probability value of the j-th prediction image sample; β2 represents the fourth constant; P (j-1)yc represents a first prediction probability value of the j-1th prediction image sample, where the j-1th prediction image sample is a previous adjacent prediction image sample of the second current prediction image sample.

6. The method for determining the discrimination threshold of a classification model according to any one of claims 1 to 5, characterized in that: Determining the discrimination threshold of the image classification model according to the first target prediction probability values ​​corresponding to each of the plurality of image data sets includes: Determine the sample weights of the image samples corresponding to all first target prediction probability values; Determine a discrimination threshold of the image classification model according to all the first target prediction probability values ​​and all the sample weights.

7. The method for determining the discrimination threshold of a classification model according to claim 6, characterized in that: Determining the discrimination threshold of the image classification model according to all the first target prediction probability values ​​and all the sample weights includes: According to the threshold formula, the discrimination threshold of the image classification model is obtained; Wherein, the threshold formula is: P 阈值 represents the discrimination threshold; K represents the total number of all first target prediction probability values; W k represents the kth first target prediction probability value among all the first target prediction probability values; P kqf Represents the sample weight of the image sample corresponding to the k-th first target prediction probability value.

8. A device for determining a discrimination threshold of a classification model, characterized in that: include: An acquisition unit is used to acquire multiple data sets corresponding to the classification model to be improved; wherein, when the classification model to be improved is an image classification model, the multiple data sets are multiple image data sets, each image data set includes multiple image samples; when the classification model to be improved is a text classification model, the multiple data sets are multiple text data sets, each text data set includes multiple text samples; A processing unit is used to determine, for each of the image data sets, the predicted image samples corresponding to each image sample in the image data set using the image classification model; determine, based on the first predicted probability value of each predicted image sample, the first evaluation score corresponding to each predicted image sample; determine the first predicted probability value corresponding to the maximum first evaluation score among all the first evaluation scores as the first target predicted probability value corresponding to the image data set; determine the discrimination threshold of the image classification model based on the first target predicted probability values ​​corresponding to each of the multiple image data sets; for each of the text data sets, determine, based on the text classification model, the predicted text samples corresponding to each text sample in the text data set; determine, based on the second predicted probability value of each predicted text sample, the second evaluation score corresponding to each predicted text sample; determine the second predicted probability value corresponding to the maximum second evaluation score among all the second evaluation scores as the second target predicted probability value corresponding to the text data set; determine the discrimination threshold of the text classification model based on the second target predicted probability values ​​corresponding to each of the multiple text data sets.

9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the method for determining the discrimination threshold of the classification model according to any one of claims 1 to 7 are implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for determining the discrimination threshold of the classification model according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Regression learning adjustment method, device and system and computer readable storage medium

    CN112906799A

  • Enabling combined use of natural language processing models in a secure environment

    EP3879428A1

  • Information processing apparatus, method, and non-transitory computer readable medium

    US20230104117A1

  • Machine learning method and device

    WO2020096099A1