CN-116486150-B - Uncertainty perception-based regression error reduction method for image classification model
Abstract
The invention discloses an uncertainty perception-based regression error reduction method for an image classification model, which aims at solving the problem that an image classification model of a new version is difficult to be compatible with an image classification model of an old version after image data or model architecture is updated. And estimating and obtaining an integrated prediction result of the model according to the uncertainty of the two image classification models in the prediction result by using a model integration strategy. Wherein the integration strategy is discussed separately for both data-free and small amounts of label-free cases. For the situation of no data, the uncertainty of the image classification model is estimated by adopting an image disturbance or model disturbance mode, and for the situation of a small amount of unlabeled data, the uncertainty of the old version image classification model is calibrated by adopting a temperature scaling mode, so that the old version image classification model is aligned to the new version image classification model. The invention reduces regression errors, obtains the integrated image classification model with forward compatibility, and has better performance effect.
Inventors
- MA XIAOXING
- XU JINGWEI
- CAO CHUN
- LV JIAN
- LI ZENAN
- ZHANG MAORUN
Assignees
- 南京大学
Dates
- Publication Date
- 20260508
- Application Date
- 20230420
Claims (8)
- 1. A regression error reduction method of an image classification model based on uncertainty perception is characterized by comprising the following steps of 1) respectively and independently training to obtain an old model and a new model of image classification when the image classification model is updated, 2) estimating the uncertainty of the image classification model by adopting an image disturbance or model disturbance strategy in the case of no data, 3) calibrating the uncertainty of the old model by adopting a temperature scaling strategy in the case of no tag data, and 4) obtaining an integrated model by using a simple average model integration method; In said 3), when part of the unlabeled data is available for reducing regression errors of the image classification model, the temperature scaling technique is used to process the regression errors and classify the image in the old model Performing temperature scaling to obtain By measuring the model uncertainty using the mean square error MSE, we realize: using a set of unlabeled image data on which the old model is temperature scaled And solving for the optimal temperature So that For the optimal temperature Using quasi-Newton method L-BFGS with multiple initial points; For subsequent input images, this temperature value is used each time Without change, and then obtaining the predicted output of the integrated model by the following expression : 。
- 2. The method for reducing regression errors of image classification models based on uncertainty perception according to claim 1 is characterized in that 1) the reasons for updating the image classification models are generally two, namely (1) more image data are collected for model training, (2) the underlying neural network architecture of the image classification models is updated, when the image classification models caused by the two reasons are updated, the old models and the new models of the image classification models are respectively and independently trained on corresponding image data sets by adopting corresponding network architectures, the trained new models are used for updating the original old models, regression errors are caused after model updating, and for the image data set D, samples with correct old model prediction and incorrect new model prediction are called as regression errors.
- 3. The method for regression error mitigation of image classification models based on uncertainty perception of claim 1 wherein 2) the input image is perturbed by random noise during image perturbation by Adding random noise to produce a set of similar input images The group of images are respectively input into the old model And new model And calculate the old model And new model Prediction variance of (a) And 。
- 4. The uncertainty-aware-based regression error mitigation method of image classification models of claim 1, wherein in 2) the model perturbation is performed by setting an old model And new model To then discard the output of a portion of the neurons to produce a set of similar stochastic models And Then input image to be predicted Respectively input into the two groups of models And Calculating variance of model predictive output of each group And 。
- 5. The method for reducing regression errors of image classification models based on uncertainty perception according to claim 1, wherein in the 4) the simple average model integration method, specifically, for new and old models in the regression error problem of the image classification models, means that the prediction probability distribution of the input data is simply averaged by the old model and the new model.
- 6. The method for reducing regression errors of image classification models based on uncertainty perception according to claim 1, wherein the old model and the new model are respectively and independently trained when the image classification models are updated, and the old model and the new model are trained by adopting the following procedures: 101 Constructing a model framework and randomly initializing model parameters; 102 Reading the image training data set according to batches and inputting the image training data set into a model; 103 Calculating the cross entropy of the model predicted value and the real label value to obtain the Loss of the model; 104 Adopting an error back propagation algorithm, and updating parameters of each neural network layer of the model according to Loss; 105 Training the model until the model converges to obtain a trained model.
- 7. The method for reducing regression errors of image classification models based on uncertainty perception according to claim 1, wherein uncertainty analysis is performed on new and old models of image classification, and an uncertainty analysis flow under the condition of no data or an uncertainty analysis flow under the condition of no label data can be adopted respectively according to different situations; 2) The uncertainty analysis implementation flow in the absence of data is as follows: 201 For old model And new model Inputting the same image data Respectively obtain corresponding prediction output And ; 202 Evaluating uncertainty of the model by means of image disturbance or model disturbance; 2021 For image perturbation mode): i) Based on image input By adding random noise generation Similar group of image inputs ; Ii) inputting the set of images At the same time input to And Obtaining corresponding prediction output generated by the old model and the new model respectively, and calculating variance of the prediction output And ; 2022 Mode for model perturbation): i) For old model And new model Randomly discarding output of a portion of neurons by setting a network dropout to produce a set of similar random models corresponding to the old model And a set of similar stochastic models corresponding to the new model ; Ii) inputting an image At the same time input to And Respectively obtain And A set of prediction outputs generated, a variance of the prediction outputs is calculated And ; 203 Obtaining prediction variance of the new model and the old model according to image disturbance or model disturbance, and respectively calculating scaling factors of the old model and the new model And The calculation formula is as follows: 204 Based on the scaling factor, obtaining the old model and the new model after adjustment by the scaling factor with respect to the image input Is a predicted output of (1): 。
- 8. The uncertainty-aware-based regression error mitigation method of an image classification model of claim 7, wherein 3) the uncertainty analysis implementation flow in the case of having small amounts of unlabeled data is as follows: 301 Given old model New model A set of unlabeled image data sets And image input to be predicted Respectively obtain corresponding prediction output And ; 302 Judging that the data set is in Whether or not the optimum temperature has been calculated : I) If yes, jump 304) execute; ii) if not, jump 303) is performed; 303 In the dataset According to Solving for optimal temperature using quasi-Newton method L-BFGS with multiple initial points ; 304 Using temperature scaling techniques, using optimum temperatures Scaling Logit of (A) Obtaining the old model after temperature scaling adjustment Is a predicted output of (1): 305 New model Is the predicted output of (2) No temperature scaling is required and so remains unchanged.
Description
Uncertainty perception-based regression error reduction method for image classification model Technical Field The invention relates to an uncertainty perception-based regression error reduction method for an image classification model, and belongs to the technical field of forward compatibility optimization of the image classification model in an image classification model updating process. Background The current image classification model is widely applied to various living scenes, such as face recognition, unmanned driving, photographing searching and the like. As a key component in these modern software systems, image classification models, like these traditional software, have undergone constant updates in an effort to provide better service to users. However, the continual updating of the image classification model may also introduce regression errors, i.e. there are always partial image samples whose predictions are correct in the old version of the image classification model but are wrong in the new version of the image classification model. The presence of regression errors destroys the forward compatibility of the new model. For image classification models, most of the architectures are based on Deep Neural Networks (DNNs), and since DNNs are an uncertainty model, regression errors generated after updating are unavoidable. For example, for the same image classification model and the same image data set, under the condition that other parameters are kept the same, the model is respectively and independently trained twice, and although the prediction accuracy of the image classification model after the two times of training is similar, the image samples which can be correctly predicted by the model are not completely the same. The ubiquitous regression errors in the image classification model can have destructive effects on production practices and user experience. For example, updating of a photo search App results in a search result that is different from the past, resulting in a decrease in the App's score in the application store, and a model that medically classifies X-ray images, after updating, changes in image samples that are prone to erroneous judgment, resulting in a need for re-adaption by the doctor. Such problems reflect regression errors that occur after the image classification model is updated, resulting in reduced forward compatibility of the model, which adversely affects the user experience. The regression error reduction of the image classification model still has a plurality of defects. On one hand, the existing model training technology cannot ensure the forward compatibility of the new image classification model after training on the old image classification model and cannot meet the service application requirements when the image data is updated or the model architecture is updated, and on the other hand, the existing regression error reduction technology can lead to the performance reduction of the image classification model, has poor practical effect and cannot meet the service application requirements. Disclosure of Invention Aiming at the problems of poor forward compatibility and performance reduction of a new image classification model in the process of updating image data or updating an image classification model framework in the prior art, the invention provides a lightweight application technology for reducing regression errors of the image classification model based on uncertainty perception. The method comprises the following steps of 1) respectively and independently training to obtain an old model and a new model of image classification when the image classification model is updated, 2) estimating the uncertainty of the image classification model by adopting an image disturbance or model disturbance strategy under the condition of no data, 3) calibrating the uncertainty of the old model by adopting a temperature scaling strategy under the condition of a small amount of non-label data, and 4) obtaining an integrated model by using a simple average model integration method. The image classification model update in said 1) is generally caused by two types of (1) collecting more image data for model training. For example, an App providing a photo search service to a user, while providing the service, collects more image data that can be used for training of model updates, and (2) an underlying neural network architecture updating the image classification model. For example, the network VGG architecture is an image classification model that was used since the last decade, while new network architectures such as ResNet have proven to provide greater accuracy and thus require upgrades. When the models caused by the two reasons are updated, the old model and the new model need to be independently trained on the corresponding image data sets by adopting corresponding network architectures, and the new model obtained by training is used for updating the original old model.