A construction method of a difficulty measurer for sample ordering and a sample difficulty ordering method

By constructing a difficulty measure and utilizing the weights in the image classification model training process, the problem of low sample sorting efficiency in existing technologies is solved, achieving more efficient sample sorting and improved model generalization performance.

CN116524353BActive Publication Date: 2025-12-12HOHAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310333075.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2025-12-12
Estimated Expiration
2043-03-30

AI Technical Summary

Technical Problem

In existing technologies, image classification models struggle to effectively utilize intermediate results during training, and predefined course learning requires expert knowledge, making it difficult to adapt to the complexity of different sample features, resulting in low efficiency and insufficient model generalization performance.

Method used

A difficulty measurer is constructed using weights generated during the training of the image classification model. The timing of constructing the difficulty measurer is determined by calculating the accuracy growth rate. Sub-models are constructed based on historical weights, divided into easy and hard groups, and samples are sorted to achieve flexible and effective sample sorting.

Benefits of technology

It improves the accuracy of sample sorting, enhances the generalization performance of image classification models, solves the problem of inconsistency between human and model decision boundaries, and achieves a more efficient training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116524353B_ABST
    Figure CN116524353B_ABST
Patent Text Reader

Abstract

The application discloses a construction method of a difficulty measurer for sample ordering and a sample difficulty ordering method, uses historical weights generated in a training process of an image classification model as a submodel to construct the difficulty measurer, and orders data in a training data set from easy to difficult by using the constructed difficulty measurer. The application solves the problem that an existing difficulty measurer depends on prior knowledge, fully excavates knowledge learned by the model in the training process, accelerates model training, and enhances model generalization performance.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of deep learning, and particularly relates to a construction method of a difficulty measurer for sample sequencing and a sample difficulty sequencing method. BACKGROUND

[0002] Image classification is one of the basic tasks of computer vision. Image classification is to find the class label to which a given image belongs by using an algorithm. The process of image classification mainly includes image preprocessing, image feature extraction, and image classification using a classifier. Early image classification techniques mostly take people as the object of designing features. For different recognition scenarios, corresponding experts need to perform recognition manually, mainly relying on the prior knowledge of designers, and then manually coding according to specific application scenarios and data types and field characteristics to be processed. This way, it is difficult to process massive data, and there are problems such as low efficiency.

[0003] With the development of deep learning, methods based on deep learning and convolutional neural networks can effectively learn feature expression from a large number of samples by automatically extracting and self-learning features, and the model has stronger generalization ability. Convolutional neural networks have been successful in computer vision and natural language and other fields due to their excellent performance, but their excellent performance depends on a large number of parameters and a large amount of calculation. With the continuous deepening of the application field of neural networks, networks that simply pursue performance are no longer suitable for optimization scenarios that comprehensively consider resource constraints, low energy consumption, and real-time performance. Deep learning is a process of repeatedly adjusting model parameters, and the model parameters are adjusted during the iteration process to improve the accuracy of the model. In the model training process, the intermediate model generated is discarded during the training process, and the intermediate results generated during model training cannot be fully utilized.

[0004] The learning process of humans and animals generally follows the order from easy to difficult. In traditional machine learning algorithms, all training samples are randomly input into the model, ignoring the complexity of the data samples and the learning state of the current model. Therefore, Bengio, a leader in machine learning, and his research team first proposed the concept of curriculum learning (Cl). Curriculum learning advocates starting with easy samples and gradually progressing to complex samples and knowledge. It helps machine learning in two aspects: first, it can accelerate the training of machine learning models, and under the condition of achieving the same model performance, curriculum learning can accelerate the training and reduce the number of training iterations; second, it enables the model to achieve better generalization performance, i.e., the model can be trained to a better local optimal value state.

[0005] The curriculum learning assigns different weights to training samples of different difficulties according to the difficulty of the samples. In the initial stage, the weight of the simple sample is the highest, and with the continuation of the training process, the weight of the difficult sample will be gradually increased. The curriculum learning is a method of obtaining a better local minimum and a regularization method. The core problem of the curriculum learning is the strategy of "training from simple data to difficult data", therefore, the design of the curriculum needs to determine two things, 1) determine what kind of training sample should be easier than other samples; 2) when should the model be trained with more difficult samples, and how many difficult samples. For the first problem, a difficulty measurer can be used to determine the relative "easiness" of each sample. For the second problem, a training scheduler can be used to determine the order of the data in the entire training process according to its judgment. Therefore, the curriculum learning framework generally has two core components: difficulty measurer and training scheduler.

[0006] The simplest curriculum learning is the predefined curriculum learning (Predefined CL), which mainly defines the difficulty standard of the data through the prior knowledge of human beings, and needs to be based on the data characteristics of specific tasks, such as the angle of the head picture in face recognition. However, the predefined curriculum learning has the following problems: 1) it needs expert knowledge and has a high cost. Moreover, when the dimension of the sample feature is very large, even the experts are difficult to define a computable difficulty measurer in advance; 2) the decision boundary of the model and the human being is basically different, and for the human being, the simple example is not necessarily simple for the model. Therefore, the sample difficulty needs to be determined by the model itself, and the samples need to be sorted from easy to difficult, so as to simply, efficiently and flexibly determine the "curriculum". SUMMARY

[0007] The purpose of the present application is to provide a method for constructing a difficulty measurer for sample sorting and a sample difficulty sorting method, which fully utilizes the historical weights generated by the image classification model in the training process to construct the difficulty measurer, sorts the data in the data set, and makes the image classification model trained by using the sorted data set more efficient and has stronger generalization performance.

[0008] To achieve the above purpose, the technical scheme adopted by the present application is as follows:

[0009] The present application provides a method for constructing a difficulty measurer for sample sorting, comprising:

[0010] training an image classification model, saving the weights generated in the current iteration in the training process, and calculating the accuracy of the image classification model in the current iteration;

[0011] determine whether to start constructing the difficulty measurer based on the accuracy of the image classification model of the current iteration and the accuracy of the image classification model of the previous iteration; if yes, construct the difficulty measurer using the image classification model corresponding to the saved weight generated in each iteration; if no, continue the iterative training until the iteration termination condition is reached.

[0012] Further, the training image classification model saves the weight generated in the current iteration in the training process, and calculates the accuracy of the image classification model of the current iteration, comprising:

[0013] An image classification model is constructed using a feature extraction network and a fully connected layer.

[0014] A training sample set is obtained and sample categories are labeled, and a feature extraction network is used to extract sample feature vectors in the training sample set.

[0015] A fully connected layer is used to generate a probability vector corresponding to each category of the sample according to the sample feature vector and the number of categories of the training sample set.

[0016] The sample loss is calculated according to the loss function, the feature extraction network parameters are optimized using the back propagation algorithm, the weight generated in the current iteration is saved, and the accuracy of the image classification model of the current iteration is calculated.

[0017] Further, the feature extraction network selects a convolutional neural network.

[0018] Further, the determination of whether to start constructing the difficulty measurer based on the accuracy of the image classification model of the current iteration and the accuracy of the image classification model of the previous iteration comprises:

[0019] The accuracy growth rate is calculated based on the accuracy of the image classification model of the current iteration and the accuracy of the image classification model of the previous iteration, as follows:

[0020]

[0021] wherein, I a (t) represents the accuracy growth rate of the current iteration t, A t and A t-1 respectively represent the accuracy of the image classification model calculated in the current iteration t and the previous iteration t-1.

[0022] The calculated accuracy growth rate is compared with a preset threshold, if I a (t)≤θ, it is determined to start constructing the difficulty measurer, wherein θ is the preset threshold.

[0023] It is determined to start constructing the difficulty measurer at the Nth iteration, and N is set as follows:

[0024] N=max{8,t}.

[0025] Further, if t is less than 8, the iterative training is continued until the training is full 8 times, and the weights generated in the 8 times of iterative training and the corresponding image classification model are saved.

[0026] Further, the image classification model corresponding to the saved weights generated in each iteration is used to construct the difficulty measurer, which comprises:

[0027] n weights are selected from the saved weights generated in each iteration, and the selection of n is as follows:

[0028]

[0029] wherein, indicates rounding up;

[0030] The n weights are used to construct the difficulty measurer.

[0031] Further, when n is 8, the n weights are selected from the N weights in an equal step manner.

[0032] The application also provides a sample difficulty sorting method, which comprises:

[0033] Based on the confidence of the sub-models in the constructed difficulty measurer, the sub-models in the difficulty measurer are divided into a simple group and a difficult group; the difficulty measurer is constructed by using the construction method of the difficulty measurer for sample sorting described above;

[0034] The training sample set is sent into the constructed difficulty measurer, the sample categories are predicted by the sub-models of the difficulty measurer, and the prediction results are given;

[0035] According to the prediction results of all the sub-models on the input sample categories and the confidence of the sub-models in the simple group and the difficult group, the sample difficulty score is calculated;

[0036] Based on the sample difficulty score, all the samples are sorted in the order from simple to difficult.

[0037] Further, based on the confidence of the sub-models in the constructed difficulty measurer, the sub-models in the difficulty measurer are divided into a simple group and a difficult group, which comprises:

[0038] The grouping is performed as follows:

[0039]

[0040] wherein, x i ​​denotes the i-th sub-model, g1 and g2 respectively denote the simple group and the difficult group, c i denotes the confidence of the i-th sub-model, c denotes the confidence sum of all sub-models in the difficulty measurer, and n denotes the number of all sub-models in the difficulty measurer.

[0041] The confidence of the sub-model adopts the accuracy of the corresponding image classification model.

[0042] Further, the sample difficulty score is calculated, and the calculation sample difficulty score comprises:

[0043] The sample difficulty score is calculated in the following manner:

[0044]

[0045] wherein R is the sample difficulty score, ε is a preset minimum constant, λ1 and λ2 are respectively the average confidence of all sub-models in the simple group and the difficult group, respectively denote the proportion of the sub-models that correctly predict in the simple group and the difficult group, m1 and m2 are respectively the number of the sub-models that correctly predict the sample category in the simple group and the difficult group, and n1 and n2 are respectively the number of the sub-models in the simple group and the difficult group.

[0046] The lower the score is, the simpler the difficulty is.

[0047] Compared with the prior art, the present application has the following beneficial effects:

[0048] The present application provides a construction method of a difficulty measurer for sample sorting, which utilizes the weights generated in the image classification model training process, fully excavates the “knowledge” learned by the model in the training process, guides the subsequent training of the model, and can effectively solve the problem of different decision boundaries between humans and models, and effectively improve the accuracy of sample sorting. BRIEF DESCRIPTION OF DRAWINGS

[0049] Figure 1 The construction method of the difficulty measurer for sample sorting provided by the present application is a flow chart;

[0050] Figure 2 The sample difficulty sorting method provided by the present application is a flow chart. DETAILED DESCRIPTION

[0051] The present application is further described below. The following examples are only used to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the protection scope of the present application.

[0052] The present application provides a construction method of a difficulty measurer for sample sorting, referring to Figure 1 , comprising:

[0053] training the image classification model, saving the weight generated in the current iteration in the training process, and calculating the accuracy of the image classification model in the current iteration;

[0054] based on the accuracy of the image classification model in the current iteration and the accuracy of the image classification model in the last iteration, determining whether to start constructing the difficulty measurer; if yes, constructing the difficulty measurer according to the image classification model corresponding to the weight generated in each iteration saved; and if no, continuing to iterate and train until the iteration termination condition is reached.

[0055] In an embodiment of the present application, the image classification model is trained, the weight generated in the current iteration is saved in the training process, and the accuracy of the image classification model in the current iteration is calculated, and the specific implementation process is as follows:

[0056] An image classification model is constructed by using a feature extraction network and a fully connected layer.

[0057] A training sample set is obtained and sample categories are labeled, and a feature extraction network is used to extract sample feature vectors in the training sample set.

[0058] A fully connected layer is used to generate a probability vector corresponding to each category of the sample according to the sample feature vector and the number of categories of the training sample set.

[0059] The sample loss is calculated according to the loss function, the feature extraction network parameters are optimized by using the back propagation algorithm, the network weight generated in the current iteration is saved, and the accuracy of the image classification model in the current iteration is calculated.

[0060] It should be noted that the specific update process is the same as the existing update process, and those skilled in the art can easily know it, which will not be described here.

[0061] In the embodiment, the feature extraction network is a convolutional neural network.

[0062] In an embodiment of the present application, based on the accuracy of the image classification model in the current iteration and the accuracy of the image classification model in the last iteration, it is determined whether to start constructing the difficulty measurer, and the specific operation is as follows:

[0063] Based on the accuracy of the image classification model in the current iteration and the accuracy of the image classification model in the last iteration, the accuracy growth rate is calculated as follows:

[0064]

[0065] wherein, I a (t) represents the accuracy growth rate of the current iteration t, A t and A t-1 respectively represent the accuracy of the image classification model calculated in the current iteration t and the last iteration t-1.

[0066] The calculated accuracy growth rate is compared with a preset threshold, and if I a (t)≤θ, it is judged that the difficulty measurer is started to be built, and θ is a preset threshold;

[0067] It is determined that the difficulty measurer is started to be built at the Nth iteration, and N is set as follows:

[0068] N=max{8,t}.

[0069] When the accuracy of the image classification model improves quickly, it indicates that the training effect of the model is good, and the samples can be sorted when the training effect improves at a slow speed; when the accuracy of the image classification model improves slowly, it indicates that the training effect of the model is poor, and the difficulty measurer needs to sort the samples as soon as possible, but in order to ensure the accuracy of the difficulty measurer in sorting the samples, the difficulty measurer needs to be built after the training of the 8th period.

[0070] In an embodiment of the present application, the difficulty measurer is built according to the saved weights generated in each iteration, and the specific implementation process is as follows:

[0071] The network structure of the difficulty measurer is composed of n sub-models, and the sub-models are image classification models corresponding to the historical weights saved in the training process;

[0072] The number of historical weights selected Wherein, Indicates rounding up;

[0073] When the value of N is relatively small, in order to ensure the accuracy of the difficulty measurer in sorting, at least 8 historical weights are selected, and the image classification models corresponding to the historical weights are loaded, which together constitute the difficulty measurer;

[0074] When the value of N is relatively large, in order to reduce the calculation amount of the difficulty measurer, the difficulty measurer is built by selecting historical weights.

[0075] It should be noted that when historical weights are selected, they are selected from the N historical weights in an equal step manner.

[0076] Based on the above difficulty measurer, the present application also provides a sample difficulty sorting method, which is described with reference to Figure 2 , and includes:

[0077] Based on the confidence of the sub-models in the difficulty measurer, the sub-models in the difficulty measurer are divided into a simple group and a difficult group;

[0078] The training sample set is sent into the constructed difficulty measurer, the sample category is predicted by the sub-models of the difficulty measurer, and a prediction result is given;

[0079] According to the prediction results of the input sample categories by all the sub-models and the confidence of the sub-models in the simple group and the difficult group, the sample difficulty score is calculated;

[0080] Based on the sample difficulty score, all the samples are sorted in order from easy to difficult.

[0081] As a preferred embodiment, the sub-models in the difficulty measurer are divided into a simple group and a difficult group, and the specific method is as follows:

[0082] The i-th sub-model x i The grouping method is as follows:

[0083]

[0084] Wherein, g1 and g2 respectively represent the simple group and the difficult group, c i represents the confidence of the i-th sub-model, and c represents the sum of the confidence of all the sub-models in the difficulty measurer.

[0085] It should be noted that in the present embodiment, the accuracy after the image classification model is trained is selected as the confidence of the sub-model.

[0086] When the confidence of the sub-model is less than the average confidence, it is classified into the simple group, and when the confidence of the sub-model is greater than the average confidence, it is classified into the difficult group.

[0087] The training sample set is sent into the constructed difficulty measurer, and each sub-model of the difficulty measurer respectively predicts the sample to obtain the category probability corresponding to the sample.

[0088] As a preferred embodiment, according to the prediction results of all the sub-models on the input sample, the sample is evaluated to determine the difficulty of the sample, and the evaluation formula of the difficulty is as follows:

[0089]

[0090] Wherein, R is the difficulty score of the sample, ε is a very small constant, and the purpose is to ensure the correctness of the formula; λ1 and λ2 are respectively the average confidence of all the sub-models in the simple group and the difficult group, and the purpose is to adjust the weight of the simple group and the difficult group in the evaluation; respectively represent the proportion of the sub-models that correctly predict the simple group and the difficult group, m1 and m2 respectively represent the number of sub-models that correctly predict the sample category in the simple group and the difficult group, and n1 and n2 respectively represent the number of sub-models in the simple group and the difficult group. When the values of s1 and s2 are both relatively large, it is indicated that the difficulty measurer considers the sample to be a simple sample, i.e., the smaller the score, the simpler it is; when the values of s1 and s2 are both relatively small, it is indicated that the difficulty measurer considers the sample to be a difficult sample, i.e., the larger the score, the more difficult it is. The correct prediction refers to that the model predicts the sample category to be consistent with the labeled category.

[0091] Those skilled in the art will understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code.

[0092] The present application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for carrying out the functions specified in the flowchart

[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed by the computer or other programmable data processing apparatus provide a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 steps for carrying out the functions specified in the flowchart

[0094] The above description is only the preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, without departing from the technical principles of the present application, a number of improvements and modifications can be made, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims

1. A construction method of a difficulty measurer for sample ordering, characterized by, The method comprises the following steps: training an image classification model, saving the weights generated in the current iteration during the training process, and calculating the accuracy of the image classification model in the current iteration; based on the accuracy of the image classification model in the current iteration and the accuracy of the image classification model in the last iteration, determining whether to start constructing a difficulty measurer, comprising: based on the accuracy of the image classification model in the current iteration and the accuracy of the image classification model in the last iteration, calculating the accuracy growth rate, as follows: , wherein, denotes the accuracy growth rate of the current iteration , and denote the accuracy of the image classification model calculated in the current iteration and in the last iteration , respectively. The calculated accuracy increase rate is compared with a preset threshold value, and if it is determined that the difficulty measurer is started, wherein the preset threshold value is 0.

1. determined at the beginning of the first iteration to construct the difficulty measurer, the difficulty measurer is constructed, the following are set: ; if yes, constructing the difficulty measurer using the image classification models corresponding to the saved weights generated in each iteration, comprising: selecting a weight from the saved weights generated for each iteration the selection being made in a manner​ ; wherein denotes rounding up to the next whole number; denotes rounding up to the next whole number; This Each weight corresponds to an image classification model, which is used as a sub-model to construct a difficulty measure. if no, continuing to iterate and train until the iteration termination condition is reached.

2. A method for constructing a difficulty measurer for sample ordering according to claim 1, characterized in that, The training of the image classification model, saving the weights generated in the current iteration during the training process, and calculating the accuracy of the image classification model in the current iteration, comprises the following steps: constructing an image classification model using a feature extraction network and a fully connected layer; obtaining a training sample set and labeling the sample categories, extracting sample feature vectors in the training sample set using the feature extraction network; generating a probability vector corresponding to each category of the sample using the fully connected layer according to the sample feature vector and the number of categories of the training sample set; calculating the sample loss according to the loss function, optimizing the feature extraction network parameters using the back propagation algorithm, saving the weights generated in the current iteration, and calculating the accuracy of the image classification model in the current iteration.

3. A method of constructing a difficulty measurer for sample ordering according to claim 2, wherein, The feature extraction network selects a convolutional neural network.

4. The method of claim 1, wherein, If If the number of iterations is less than 8, the iterative training is continued until the training is completed for 8 times, and the weights generated in the 8 times of iterative training and the corresponding image classification model are saved.

5. A method of constructing a difficulty measurer for sample ordering according to claim 4, characterized in that, When is equal to , the weights are selected in an equi-pace manner from weights.

6. A method of sample difficulty ordering, the method comprising: The method comprises the following steps: based on the confidence of the sub-models in the constructed difficulty measurer, dividing the sub-models in the difficulty measurer into a simple group and a difficult group; the difficulty measurer is constructed using the method for constructing a difficulty measurer for sample sorting according to any one of claims 1 to 5; sending the training sample set into the constructed difficulty measurer, predicting the sample categories through the sub-models of the difficulty measurer, and giving the prediction results; calculating the sample difficulty score according to the prediction results of all sub-models on the input sample categories and the confidence of the sub-models in the simple group and the difficult group; sorting all samples in order from simple to difficult based on the sample difficulty score.

7. The method of claim 6, wherein, The method comprises the following steps: grouping in the following manner: ; wherein, denotes the th submodel, and denotes the simple group and the difficult group, respectively, denotes the th submodel's confidence, denotes the sum of the confidence of all submodels in the difficulty measurer, denotes the number of all submodels in the difficulty measurer; The confidence of the sub-models uses the accuracy of the corresponding image classification model.

8. The method of claim 7, wherein, The method comprises the following steps: calculating the sample difficulty score in the following manner: ; wherein, is a difficulty score of the sample, is a preset minimum constant, and are average confidence of all sub-models of the simple group and the difficult group, respectively, respectively represent the proportion of sub-models that correctly predict the simple group and the difficult group, and respectively represent the number of sub-models that correctly predict the sample category in the simple group and the difficult group, and respectively represent the number of sub-models in the simple group and the difficult group. The lower the score, the simpler the difficulty.

Citation Information

Patent Citations

  • Garbage multi-target detection method based on improved YOLOv3

    CN111833322A

  • Method for constructing image text matching model based on prior knowledge graph

    CN114547235A