Quantitative model testing method, system, equipment and medium

By performing information entropy compression and performance inversion on the annotated data set, the problem of time-consuming model testing and high storage space in the existing technology is solved, efficient model testing in resource-constrained scenarios is achieved, and the scope of application is expanded.

CN118628872APending Publication Date: 2024-09-10XIAN MICROELECTRONICS TECH INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410581410.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-11
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

In deployment scenarios where computing device resources are extremely limited, existing model testing methods require high testing time and sample storage space, and have limited application scope.

Method used

By performing information entropy compression on the annotated data set, a compressed test set is obtained, and the pre-trained model and quantified model are used to evaluate and identify it to achieve performance inversion and reduce the sample storage space and number of inferences required for model testing.

Benefits of technology

While compressing the size of the data set, the performance of the complete data set and the compressed data set is close, effectively reducing the number of inferences and time-consuming inference for quantitative model testing, and improving the application scope of model testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628872A
    Figure CN118628872A
Patent Text Reader

Abstract

The invention discloses a quantitative model testing method, system and device and a medium, and the method comprises the steps: carrying out the preprocessing and label labeling of an image data set, and obtaining a labeled data set; reasoning and identifying the annotation data set through a pre-training model to obtain an identification output set and a complete evaluation result; performing information entropy compression on the annotation data set according to the identification output set to obtain a compression test set; performing evaluation identification on the compression test set through the pre-training model to obtain a compression evaluation result, and performing quantitative identification on the compression test set through the quantitative model to obtain a quantitative evaluation result; and performing performance inversion on the quantitative evaluation result according to the complete evaluation result and the compression evaluation result to obtain a performance inversion result of the quantitative model. According to the test method, the application range of model test can be effectively expanded, and the test time and the sample storage space required by the model test are reduced. The invention relates to the technical field of model quantification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of model quantization technology, and in particular to a testing method, system, equipment and medium for a quantization model. Background Art

[0002] As deep neural network models develop rapidly, people are particularly concerned about the performance of models in real deployment scenarios due to the black-box nature of their model structures and the unexplainable nature of their prediction results. Therefore, the industry often needs to use test datasets to test pre-trained models and multiple quantized and compressed models in real embedded deployment scenarios to evaluate the performance of the models and select the optimal quantized and compressed model for deployment.

[0003] At present, the existing model testing method usually inputs the complete test data set into the pre-trained neural network model or several quantized and compressed models for testing. The application scope of this model testing method is relatively limited. In deployment scenarios where computing device resources are extremely limited, this model testing method requires high test time and sample storage space when testing the model.

[0004] Therefore, the problems existing in the prior art still need to be solved and optimized. Summary of the invention

[0005] The purpose of the present invention is to solve one of the technical problems existing in the related art to at least a certain extent.

[0006] To this end, an object of an embodiment of the present invention is to provide a testing method for a quantitative model, which can effectively improve the application scope of model testing and reduce the testing time and sample storage space required for model testing.

[0007] Another object of an embodiment of the present application is to provide a testing system for a quantitative model.

[0008] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present application include:

[0009] In a first aspect, an embodiment of the present application provides a method for testing a quantitative model, including:

[0010] Acquire an original image data set, and preprocess and label the image data set to obtain a labeled data set, wherein the labeled data set includes multiple labeled data samples;

[0011] Performing inference recognition on the labeled data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes a plurality of recognition results, each of which corresponds to one of the labeled data samples, and the recognition result is used to record probability information of the labeled data sample;

[0012] According to the recognition output set, the labeled data set is compressed for information entropy to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the labeled data set based on the information entropy of the labeled data samples, and the information entropy of each labeled data sample is obtained based on the corresponding probability information;

[0013] The compressed test set is evaluated and identified by the pre-trained model to obtain a compressed evaluation result, and the compressed test set is quantized and identified by the quantization model to obtain a quantized evaluation result;

[0014] According to the complete evaluation result and the compressed evaluation result, the performance inversion is performed on the quantization evaluation result to obtain the performance inversion result of the quantization model.

[0015] In addition, the testing method of a quantitative model according to the above embodiment of the present application may also have the following additional technical features:

[0016] Further, in one embodiment of the present application, the step of performing information entropy compression on the labeled data set according to the recognition output set to obtain a compressed test set includes:

[0017] Get the preset sample extraction strategy;

[0018] Acquire information entropy of the labeled data sample according to the probability information;

[0019] According to all the information entropies, the labeled data sets are sequentially sorted to obtain a sorted data set;

[0020] According to the sample extraction strategy, the sorted data set is subjected to strategy extraction to obtain the compressed test set.

[0021] Further, in one embodiment of the present application, if the sample extraction strategy is uniform sampling, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set includes:

[0022] Get the sampling interval;

[0023] According to the sampling interval, the sorted data set is sampled at intervals to obtain the compression test set.

[0024] Further, in one embodiment of the present application, if the sample extraction strategy is feature clustering sampling, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set includes:

[0025] Get the preset sampling threshold;

[0026] According to the sampling threshold, the sorted data set is grouped into samples to obtain a plurality of data groups, each of the data groups includes a plurality of annotated data samples, and the number of the annotated data samples in the data group is equal to the sampling threshold;

[0027] All the data groups are clustered and compressed to obtain the compression test set.

[0028] Further, in one embodiment of the present application, clustering and compressing all the data groups to obtain the compression test set includes:

[0029] Obtaining a non-output layer feature value corresponding to each of the labeled data samples, and dividing all non-output layer feature values ​​into groups according to the data grouping to obtain feature groups;

[0030] According to the feature grouping, clustering and extracting all the data groups to obtain a plurality of the target data samples;

[0031] All the target data samples are combined to obtain the compressed test set.

[0032] Furthermore, in one embodiment of the present application, clustering and extracting the data groups according to the feature grouping to obtain a plurality of the target data samples includes:

[0033] Get the current cluster center point and number of iterations;

[0034] According to the current cluster center point, all the non-output layer feature values ​​are assigned to the nearest cluster cluster to obtain a first cluster cluster;

[0035] According to the first cluster, updating the mean of the corresponding cluster center point to obtain a center point update result;

[0036] If the center point update result is that the cluster center point has not changed or the current number of iterations is greater than or equal to the preset maximum iteration threshold, the cluster center points of all the first cluster clusters are used as sample screening points for the current data grouping, and the current data grouping is subjected to sample screening to obtain a number of target data samples; or, if the center point update result is that the cluster center point has changed, and the current number of iterations is less than the preset maximum iteration threshold, the current cluster center point and the number of iterations are updated according to the center point update result, and then the step of obtaining the current cluster center point and the number of iterations is returned to be executed.

[0037] Further, in one embodiment of the present application, the performance inversion of the quantized evaluation result is performed according to the complete evaluation result and the compressed evaluation result to obtain the performance inversion result of the quantized model, including:

[0038] Calculating the accuracy difference between the complete evaluation result and the compressed evaluation result to obtain a quantified compression difference;

[0039] According to the quantization compression difference, the quantization evaluation result is differentially migrated to obtain a performance inversion result of the quantization model.

[0040] In a second aspect, an embodiment of the present application provides a testing system for a quantization model, including:

[0041] An acquisition module is used to acquire an original image data set, and preprocess and label the image data set to obtain a labeled data set, wherein the labeled data set includes a plurality of labeled data samples;

[0042] A complete recognition module, used to perform inference recognition on the annotated data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes multiple recognition results, each of which corresponds to one of the annotated data samples, and the recognition result is used to record the probability information of the annotated data sample;

[0043] A compression module, used for performing information entropy compression on the annotated data set according to the recognition output set to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the annotated data set based on the information entropy of the annotated data samples, and the information entropy of each annotated data sample is obtained based on the corresponding probability information;

[0044] A compression identification module, used to evaluate and identify the compression test set through the pre-trained model to obtain a compression evaluation result, and to quantize and identify the compression test set through a quantization model to obtain a quantization evaluation result;

[0045] An inversion module is used to perform performance inversion on the quantitative evaluation result according to the complete evaluation result and the compressed evaluation result to obtain a performance inversion result of the quantitative model.

[0046] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0047] at least one processor;

[0048] at least one memory for storing at least one program;

[0049] When the at least one program is executed by the at least one processor, the at least one processor implements the method of the first aspect described above.

[0050] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a program executable by a processor, and the program executable by the processor is used to implement the method of the first aspect when executed by the processor.

[0051] The advantages and benefits of the present application will be partially given in the following description, and partially become apparent from the following description, or be understood through the practice of the present application:

[0052] A testing method for a quantization model disclosed in an embodiment of the present application, wherein the testing method obtains an original image data set, and preprocesses and labels the image data set to obtain a labeled data set, wherein the labeled data set includes multiple labeled data samples; the labeled data set is inferred and recognized by a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes multiple recognition results, each of which corresponds to one labeled data sample, and the recognition result is used to record the probability information of the labeled data sample; according to the recognition output set, the labeled data set is information entropy compressed to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are extracted from the labeled data set based on the information entropy of the labeled data samples, and the information entropy of each labeled data sample is obtained based on the corresponding probability information; the compressed test set is evaluated and recognized by the pre-trained model to obtain a compressed evaluation result, and the compressed test set is quantitatively recognized by the quantization model to obtain a quantitative evaluation result; according to the complete evaluation result and the compressed evaluation result, the quantitative evaluation result is performance inverted to obtain the performance inversion result of the quantization model. This testing method is based on information entropy compression of annotated data sets and performance inversion of quantitative evaluation results. It can compress the data set size while making the performance of the complete data set and the compressed data set close, so that the quantitative model can infer the performance of the complete data set based on the performance of the compressed data set. In addition, this testing method is based on information entropy compression of annotated data sets. The obtained compressed data set can effectively reduce the testing time and sample storage space required for quantitative models in deployment scenarios with extremely limited computing devices, thereby increasing the application scope of model testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the embodiments of the present application or the drawings of the related technical solutions in the prior art are introduced below. It should be understood that the drawings introduced below are only for the convenience of clearly expressing some embodiments of the technical solutions of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1 A flowchart of a test method for a quantitative model provided in an embodiment of the present application;

[0055] Figure 2 A schematic diagram of the structure of a test system for a quantitative model provided in an embodiment of the present application;

[0056] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0057] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and are not to be construed as limitations on the present application. For the step numbers in the following embodiments, they are only provided for the convenience of explanation, and the order between the steps is not limited in any way, and the execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0059] At present, the existing model testing method usually inputs the complete test data set into a pre-trained neural network model or several quantized compressed models for testing. It requires the pre-trained neural network model and the quantized compressed model to traverse all samples to obtain the performance indicators of the model. In scenarios where computing device resources are extremely limited, this model testing method is time-consuming and occupies storage space to traverse and reason all test data set samples, and its application scope is relatively limited. Specifically, in embedded deployment scenarios (such as embedded boards), the reasoning of a single data sample is slow, and the board storage space is limited. It is extremely difficult to load a large number of test data sets for testing, and the required test time and sample storage space are both high.

[0060] In addition, in the existing model testing methods, the sample storage space of the compressed test data set is usually adopted, and the compression strategy of each storage unit is adaptively formulated to provide a compression ratio, so as to reduce the sample storage space required for the test, reduce the loading time required for the embedded board to load a large number of test data sets, and thus reduce the overall test time required for the model test. However, this model testing method does not reduce the number of samples in the test data set, but only changes the storage space required for a single data sample. It cannot reduce the number of inferences and inference time required for the model to be tested to complete the test. The required test time is still high, and the required sample storage space is still relatively high.

[0061] In view of this, an embodiment of the present application provides a testing method for a quantization model. The testing method is based on information entropy compression of annotated data sets and performance inversion of quantization evaluation results. While compressing the data set size, the performance of a complete data set and a compressed data set can be made close, so that the quantization model does not need to traverse and reason about all samples, and the performance of the quantization model on the compressed data set can be inferred. In addition, the testing method is based on information entropy compression of the annotated data set, and the resulting compressed test set effectively reduces the number of samples that the quantization model needs to traverse and reason, reduces the sample storage space required during the test, and reduces the number of inferences and the time required for the quantization model to complete the test, so that the testing method can be applied to scenarios where computing device resources are extremely limited, thereby increasing the application scope of model testing.

[0062] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0063] Reference Figure 1 In an embodiment of the present application, a method for testing a quantitative model includes:

[0064] Step 110: obtaining an original image data set, and preprocessing and labeling the image data set to obtain a labeled data set, wherein the labeled data set includes a plurality of labeled data samples;

[0065] In an embodiment of the present application, an image data set may collect test image data from multiple perspectives and environmental conditions through a photographic device, and integrate all collected test image data sets to obtain an original image data set; after obtaining the original image data set, each test image data in the image data set may be preprocessed and labeled according to the computer vision task performed by the quantization model. The preprocessing may specifically be at least one of image cropping, image scaling, image rotation, color correction, etc. of the test image. The examples in the present application are for illustration only.

[0066] It can be understood that common computer vision tasks mainly include image classification, target detection and speech segmentation. Therefore, for image classification tasks, the label annotation of the image dataset can be the category annotation of all test image data; for target detection tasks, the label annotation of the image dataset can be the annotation of target detection boxes of all test image data; for semantic segmentation tasks, the label annotation of the image dataset can be the pixel-level category annotation of all test image data. The examples in this application are for illustration only and do not impose any limitation on this application.

[0067] Step 120: perform inference recognition on the annotated data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes a plurality of recognition results, each of which corresponds to one of the annotated data samples, and the recognition result is used to record probability information of the annotated data sample;

[0068] In an embodiment of the present application, the labeled data set includes multiple labeled data samples. Based on the pre-trained model, each labeled data sample in the labeled data set can be identified to obtain an identification result corresponding to each labeled data sample. The identification result is a prediction result of the pre-trained model predicting the labeled data sample, which is used to characterize the probability information of the labeled data sample.

[0069] Step 130: According to the recognition output set, the labeled data set is compressed with information entropy to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the labeled data set based on the information entropy of the labeled data samples, and the information entropy of each labeled data sample is obtained based on the corresponding probability information;

[0070] In some embodiments, the step 130, performing information entropy compression on the annotated data set according to the recognition output set to obtain a compressed test set, includes:

[0071] Step 131: Obtain a preset sample extraction strategy;

[0072] Step 132: Obtain information entropy of the labeled data sample according to the probability information;

[0073] Step 133: sort the labeled data set in order according to all the information entropies to obtain a sorted data set;

[0074] In the embodiment of the present application, information entropy is used to characterize the uncertainty of each labeled data sample in the labeled data set, and information entropy compression is used to make the sample information entropy distribution in the labeled data set as similar as possible to the sample information entropy distribution in the compressed test set, and the preset sample extraction strategy includes a uniform sampling extraction strategy and a feature clustering sampling extraction strategy. In addition, for step 132, the information entropy corresponding to each labeled data sample can be determined according to the probability information in each recognition result.

[0075] For example, for an image classification task, the labeled data sample can directly use the classification probability information in the recognition result to calculate the information entropy of each labeled data sample. The specific equivalent formula can be expressed as:

[0076] E(x i ; θ) = f θ (y i |x i )log(f θ (y i |x i )),i=1…N

[0077] Among them, E() is information entropy; x i is the i-th labeled data sample; θ is the model parameter of the pre-trained model; y i is the label corresponding to the i-th labeled data sample; f θ (y i |x i ) is the recognition result output when the i-th labeled data sample is input into the pre-trained model using the model parameters θ. The recognition result records the probability information of the i-th labeled data sample being classified into each category; log() is the logarithmic function; N is the total number of labeled data samples.

[0078] For the target detection task, the information entropy of each labeled data sample can be calculated using the average predicted probability information of the target box classification in the recognition result; while the semantic segmentation task can use the average predicted probability information of each pixel classification in the recognition result to calculate the information entropy of each labeled data sample.

[0079] Specifically, the equivalent formula for the information entropy of the target detection task or semantic segmentation task can be expressed as:

[0080]

[0081] It is understandable that for the target detection task, y j is the label corresponding to the jth target box in the i-th labeled data sample; f θ (y i |x i ) is the recognition result corresponding to the jth target frame of the ith labeled data sample; n is the total number of target frames in the ith labeled data sample; p j is the classification probability information of the jth target box.

[0082] For the semantic segmentation task, y j is the label corresponding to the jth pixel in the i-th labeled data sample; f θ (y i |x i ) is the recognition result corresponding to the jth pixel of the ith labeled data sample; n is the total number of pixels in the ith labeled data sample; p j is the classification probability information of the j-th pixel.

[0083] It should be noted that the sequential sorting in step 133 can be based on the information entropy corresponding to each labeled data sample, and all labeled data samples are sorted in positive order or reverse order, so as to obtain a sorted data set sorted from small to large or from large to small according to the information entropy. It is worth mentioning that compared with the performance of the compressed test set directly extracted from the labeled data set, the data performance difference with the data performance of the labeled data set; the embodiment of the present application can make the data performance of the extracted compressed test set smaller than the data performance of the complete data set of the labeled data set through the sequential sorting in step 133, and can be used in quantitative model testing to obtain more accurate performance test results. In addition, the examples of this application only illustrate several preferred extraction methods, and in some feasible implementations, the labeled data set can also be directly extracted based on the size of the information entropy, using sequential, random and other strategies, which will not be elaborated in this application.

[0084] Step 134: Perform strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set.

[0085] Furthermore, if the sample extraction strategy is uniform sampling, the step 134, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set, includes:

[0086] Step A1, obtaining a sampling interval;

[0087] Step A2: performing interval sampling on the sorted data set according to the sampling interval to obtain the compression test set.

[0088] In the embodiment of the present application, the sampling interval can be a preset interval, and its specific interval value can be any one of 2, 3, 5, etc.; or, the sampling interval can be calculated based on the specific required sampling number, and the number of data samples in the sorted data set is obtained by the ratio of the sampling number. The example of the present application is only for illustration. In addition, after determining the sampling interval, a sample of the sorted labeled data can be extracted from the sorted data set at every sampling interval; finally, all the extracted labeled data samples are used as the compression test set.

[0089] In some embodiments, if the sample extraction strategy is feature clustering sampling, the step 134, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set, includes:

[0090] Step B1, obtaining a preset sampling threshold;

[0091] Step B2: grouping the sorted data set into samples according to the sampling threshold to obtain a plurality of data groups, each of which includes a plurality of labeled data samples, and the number of labeled data samples in the data group is equal to the sampling threshold;

[0092] In the embodiment of the present application, the sampling threshold is used to group the sorted data set, and the specific value of the sampling threshold can be set according to the actual situation, or can be determined according to the total number of data in the sorted data set. Specifically, the sample grouping can be based on the sampling threshold, and the sorted labeled data samples are extracted from the sorted data set. When the cumulative extracted labeled data samples are equal to the sampling threshold, the sorted data samples whose number is equal to the sampling threshold are divided into a data group, thereby obtaining a plurality of data groups, each of which includes the labeled data samples whose number is equal to the sampling threshold.

[0093] Step B3: cluster and compress all the data groups to obtain the compression test set.

[0094] Furthermore, the step B3, performing cluster compression on all the data groups to obtain the compression test set, includes:

[0095] Step B31, obtaining a non-output layer feature value corresponding to each of the labeled data samples, and dividing all non-output layer feature values ​​into groups according to the data grouping to obtain feature groups;

[0096] In an embodiment of the present application, for a certain data grouping, the group correspondence division in step B31 can first determine the labeled data samples in the data grouping, and then determine the predicted feature values ​​of the second-to-last layer (that is, the non-output layer feature values) when the pre-trained model infers and recognizes the labeled data samples based on the labeled data samples, and the same applies to the remaining non-output layer feature values; after obtaining all the non-output layer feature values, the non-output layer feature values ​​belonging to the same grouping relationship can be added to the feature grouping according to the grouping relationship of each labeled data sample to the data grouping, so as to complete the group correspondence division.

[0097] It can be understood that, for a certain data group, the group division in step B31 can also be to determine the labeled data samples in the data group, and determine the predicted feature values ​​of the second-to-last layer when the pre-trained model infers and recognizes the labeled data samples based on the labeled data samples; after determining the non-output layer feature values, replace the labeled data samples in the data group with the corresponding non-output layer feature values, and the same applies to the remaining labeled data samples. After all labeled data samples are replaced with non-output layer feature values, the obtained grouped data is the feature grouping.

[0098] It should be noted that the non-output layer feature values ​​in the embodiments of the present application may also be the predicted feature values ​​of the third-to-last layer, the fourth-to-last layer, etc. of the pre-trained model; in addition, when the pre-trained model is a VGG image classification model, its second-to-last layer is a fully connected layer, and when the pre-trained model is a ResNet image classification model, its second-to-last layer is a convolutional layer. Compared with the first-to-last layer (i.e., the output layer), these non-output layer feature values ​​have rich abstract meaning information, which can effectively improve the effect of subsequent clustering extraction.

[0099] Step B32: performing cluster extraction on all the data groups according to the feature grouping to obtain a plurality of the target data samples;

[0100] Furthermore, the step B32, clustering and extracting the data groups according to the feature groups to obtain a plurality of the target data samples, includes:

[0101] Step B321, obtaining the current cluster center point and number of iterations;

[0102] Step B322: according to the current cluster center point, all the non-output layer feature values ​​are assigned to the nearest cluster cluster to obtain a first cluster cluster;

[0103] Step B323: According to the first cluster, update the mean of the corresponding cluster center point to obtain a center point update result;

[0104] Step B324: If the center point update result is that the cluster center point has not changed or the current number of iterations is greater than or equal to the preset maximum iteration threshold, the cluster center points of all the first cluster clusters are used as sample screening points for the current data grouping, and the current data grouping is subjected to sample screening to obtain a number of target data samples; or, if the center point update result is that the cluster center point has changed, and the current number of iterations is less than the preset maximum iteration threshold, the current cluster center point and the number of iterations are updated according to the center point update result, and then the step of obtaining the current cluster center point and the number of iterations is returned to be executed.

[0105] In the embodiment of the present application, the cluster extraction of a certain data group in step B32 can be specifically divided into the first clustering iteration process and the second and more clustering iteration processes. Specifically, for the first clustering iteration process, the current cluster center point can be a number of randomly selected initialized center points as the current cluster center point; then, for a certain non-output layer feature value in the corresponding feature group, the distance between the non-output layer feature value and all cluster center points can be calculated respectively, and the cluster center point corresponding to the minimum distance among all distances is used as the allocation target of the non-output layer feature value. The distance calculation can be implemented according to any one of Euclidean distance, Manhattan distance, Chebyshev distance, etc., so as to realize the allocation of the non-output layer feature value to the cluster cluster represented by the nearest cluster center point, and the other non-output layer feature values ​​are similar, so as to complete the nearest cluster cluster allocation. In addition, for the second and subsequent clustering iteration processes, the cluster center point updated in the previous clustering iteration process can be used as the cluster center point of the current clustering iteration process. The rest of the content is similar, and this application will not elaborate on it here.

[0106] It can be understood that, for a certain first cluster, the cluster update in step B323 can be to calculate the mean of all points in the first cluster to obtain the updated cluster center point corresponding to the first cluster; then compare the updated cluster center point with the current cluster center point to obtain the center point update result, and the center point update result is used to characterize that the updated cluster center point is the same as the current cluster center point (that is, the cluster center point has not changed), or that the updated cluster center point is different from the current cluster center point (that is, the cluster center point has changed), and the same applies to the other first clusters.

[0107] It should be noted that when the cluster center point has not changed or the current number of iterations is greater than or equal to the preset maximum iteration threshold, several updated cluster center points can be obtained, and the updated cluster center points correspond to the feature groupings and data groupings; then, for a certain cluster center point, the cluster center point can be used as a sample screening point to screen the labeled data samples in the corresponding data grouping to obtain the screened labeled data samples (i.e., target data samples), and the same applies to the remaining cluster center points, thereby obtaining several target data samples.

[0108] Step B33: merge all the target data samples to obtain the compression test set.

[0109] In the embodiment of the present application, all target data samples obtained based on the first clustering cluster screening can be merged to obtain the final compressed test set. It is worth mentioning that the embodiment of the present application can further make the data performance of the compressed test set equal to or close to the data performance of the complete annotated data set based on the clustering compression of data grouping.

[0110] Step 140: evaluating and identifying the compression test set by using the pre-trained model to obtain a compression evaluation result, and quantizing and identifying the compression test set by using the quantization model to obtain a quantization evaluation result;

[0111] In an embodiment of the present application, in an embedded deployment scenario, the compression test set can be input into a pre-trained model and a quantization model respectively, and the model performance of the pre-trained model based on the compression test set (i.e., the compression evaluation result) and the model performance of the quantization model based on the compression test set (i.e., the quantization evaluation result) can be obtained; or, in an embedded deployment scenario, the compression test set can be input into the quantization model for testing, and in a non-embedded deployment scenario, the compression test set can be input into the pre-trained model for testing, so as to obtain the compression evaluation result and the quantization evaluation result.

[0112] Step 150: Perform performance inversion on the quantization evaluation result according to the complete evaluation result and the compressed evaluation result to obtain a performance inversion result of the quantization model.

[0113] In some embodiments, the step 150 of performing performance inversion on the quantitative evaluation result according to the complete evaluation result and the compressed evaluation result to obtain the performance inversion result of the quantitative model includes:

[0114] Step 151: Calculate the accuracy difference between the complete evaluation result and the compressed evaluation result to obtain a quantized compression difference;

[0115] Step 152: perform difference migration on the quantization evaluation result according to the quantization compression difference amount to obtain a performance inversion result of the quantization model.

[0116] In an embodiment of the present application, the compression evaluation result and the quantitative evaluation result can be the recognition accuracy of the model for the compressed test set, and the complete evaluation result can be the recognition accuracy of the pre-trained model for the annotated data set. After obtaining the complete evaluation result, the compression evaluation result and the quantitative evaluation result, the difference in recognition accuracy between the complete evaluation result and the compression evaluation result can be calculated first to obtain the quantitative compression difference; then, the difference in accuracy between the pre-trained model in the annotated data set and the compressed test set is summed with the quantitative evaluation result to complete the difference migration and obtain the predicted recognition accuracy of the quantitative model in the annotated data set (that is, the performance inversion result).

[0117] It is worth mentioning that the embodiment of the present application extracts information entropy based on labeled data samples to obtain a compressed test set whose data performance is close to that of the labeled data set, which can enable the quantitative model to complete the test of the model in a scenario where computing resources are extremely limited. While reducing the number of inferences and the time required to complete the test, as well as reducing the sample storage space required for the test, the accuracy of the obtained model performance indicators is relatively high.

[0118] A testing system for a quantization model proposed according to an embodiment of the present application is described in detail below with reference to the accompanying drawings.

[0119] Reference Figure 2 , a test system for a quantization model proposed in an embodiment of the present application includes:

[0120] The acquisition module 101 is used to acquire an original image data set, and preprocess and label the image data set to obtain a labeled data set, wherein the labeled data set includes a plurality of labeled data samples;

[0121] A complete recognition module 102 is used to perform inference recognition on the annotated data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes multiple recognition results, each of which corresponds to one of the annotated data samples, and the recognition result is used to record the probability information of the annotated data sample;

[0122] A compression module 103 is used to perform information entropy compression on the annotated data set according to the recognition output set to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the annotated data set based on the information entropy of the annotated data samples, and the information entropy of each annotated data sample is obtained based on the corresponding probability information;

[0123] The compression identification module 104 is used to evaluate and identify the compression test set through the pre-trained model to obtain a compression evaluation result, and to quantize and identify the compression test set through the quantization model to obtain a quantization evaluation result;

[0124] The inversion module 105 is used to perform performance inversion on the quantitative evaluation result according to the complete evaluation result and the compressed evaluation result to obtain a performance inversion result of the quantitative model.

[0125] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0126] Reference Figure 3 , the embodiment of the present application further provides an electronic device, including:

[0127] at least one processor 201;

[0128] At least one memory 202, used to store at least one program;

[0129] When the at least one program is executed by the at least one processor 201, the at least one processor 201 implements the above method embodiment.

[0130] Similarly, it can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0131] The embodiment of the present application further provides a computer-readable storage medium, in which a program executable by the processor 201 is stored. The program executable by the processor 201 is used to implement the above-mentioned method embodiment when executed by the processor 201.

[0132] Similarly, the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0133] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part described as a larger operation is performed independently.

[0134] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0135] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for 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 various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0136] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0137] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0138] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0139] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0140] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0141] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A testing method for a quantitative model, characterized in that: include: Acquire an original image data set, and preprocess and label the image data set to obtain a labeled data set, wherein the labeled data set includes multiple labeled data samples; Performing inference recognition on the labeled data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes a plurality of recognition results, each of which corresponds to one of the labeled data samples, and the recognition result is used to record probability information of the labeled data sample; According to the recognition output set, the labeled data set is compressed for information entropy to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the labeled data set based on the information entropy of the labeled data samples, and the information entropy of each labeled data sample is obtained based on the corresponding probability information; The compressed test set is evaluated and identified by the pre-trained model to obtain a compressed evaluation result, and the compressed test set is quantized and identified by the quantization model to obtain a quantized evaluation result; According to the complete evaluation result and the compressed evaluation result, the performance inversion is performed on the quantization evaluation result to obtain the performance inversion result of the quantization model.

2. The testing method of the quantitative model according to claim 1, characterized in that: The step of performing information entropy compression on the labeled data set according to the recognition output set to obtain a compressed test set includes: Get the preset sample extraction strategy; According to the probability information, obtaining the information entropy of the labeled data sample; According to all the information entropies, the labeled data sets are sequentially sorted to obtain a sorted data set; According to the sample extraction strategy, the sorted data set is subjected to strategy extraction to obtain the compressed test set.

3. The testing method of the quantitative model according to claim 2, characterized in that: If the sample extraction strategy is uniform sampling, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set includes: Get the sampling interval; According to the sampling interval, the sorted data set is sampled at intervals to obtain the compression test set.

4. The testing method of the quantitative model according to claim 2, characterized in that: If the sample extraction strategy is feature clustering sampling, performing strategy extraction on the sorted data set according to the sample extraction strategy to obtain the compressed test set includes: Get the preset sampling threshold; According to the sampling threshold, the sorted data set is grouped into samples to obtain a plurality of data groups, each of the data groups includes a plurality of annotated data samples, and the number of the annotated data samples in the data group is equal to the sampling threshold; All the data groups are clustered and compressed to obtain the compression test set.

5. The testing method of the quantitative model according to claim 4, characterized in that: The step of clustering and compressing all the data groups to obtain the compression test set includes: Obtaining a non-output layer feature value corresponding to each of the labeled data samples, and dividing all non-output layer feature values ​​into groups according to the data grouping to obtain feature groups; According to the feature grouping, clustering and extracting all the data groups to obtain a plurality of the target data samples; All the target data samples are combined to obtain the compressed test set.

6. The testing method of the quantitative model according to claim 5, characterized in that: The step of performing clustering extraction on the data groups according to the feature grouping to obtain a plurality of target data samples includes: Get the current cluster center point and number of iterations; According to the current cluster center point, all the non-output layer feature values ​​are assigned to the nearest cluster cluster to obtain a first cluster cluster; According to the first cluster, updating the mean of the corresponding cluster center point to obtain a center point update result; If the center point update result is that the cluster center point has not changed or the current number of iterations is greater than or equal to the preset maximum iteration threshold, the cluster center points of all the first cluster clusters are used as sample screening points for the current data grouping, and the current data grouping is subjected to sample screening to obtain a number of target data samples; or, if the center point update result is that the cluster center point has changed, and the current number of iterations is less than the preset maximum iteration threshold, the current cluster center point and the number of iterations are updated according to the center point update result, and then the step of obtaining the current cluster center point and the number of iterations is returned to be executed.

7. The testing method of the quantitative model according to claim 1, characterized in that: The step of performing performance inversion on the quantized evaluation result according to the complete evaluation result and the compressed evaluation result to obtain the performance inversion result of the quantized model includes: Calculating the accuracy difference between the complete evaluation result and the compressed evaluation result to obtain a quantified compression difference; According to the quantization compression difference, the quantization evaluation result is differentially migrated to obtain a performance inversion result of the quantization model.

8. A test system for a quantitative model, characterized in that: include: An acquisition module is used to acquire an original image data set, and preprocess and label the image data set to obtain a labeled data set, wherein the labeled data set includes a plurality of labeled data samples; A complete recognition module, used to perform inference recognition on the annotated data set through a pre-trained model to obtain a recognition output set and a complete evaluation result, wherein the recognition output set includes multiple recognition results, each of which corresponds to one of the annotated data samples, and the recognition result is used to record the probability information of the annotated data sample; A compression module, used for performing information entropy compression on the annotated data set according to the recognition output set to obtain a compressed test set, wherein the compressed test set is used to characterize a set of several target data samples, wherein the target data samples are obtained by extracting from the annotated data set based on the information entropy of the annotated data samples, and the information entropy of each annotated data sample is obtained based on the corresponding probability information; A compression identification module, used to evaluate and identify the compression test set through the pre-trained model to obtain a compression evaluation result, and to quantize and identify the compression test set through a quantization model to obtain a quantization evaluation result; An inversion module is used to perform performance inversion on the quantitative evaluation result according to the complete evaluation result and the compressed evaluation result to obtain a performance inversion result of the quantitative model.

9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.