CN-121981186-A - Image recognition model pruning compression method and system based on intra-class response evaluation drive
Abstract
The invention discloses an image recognition model pruning compression method and system based on intra-class response evaluation drive, wherein the method comprises the steps of firstly adopting JS divergence to select an initial noise-containing image data set and respectively obtain a clean image sample and a noise image sample, and then classifying the clean image sample and the noise image sample to obtain a clean sample subset and a noise sample subset; the invention realizes the functions of reserving parameters mainly capturing information from clean data and eliminating parameters mainly influenced by noise data, and can accurately calculate the importance of the parameters according to the response of the parameters to the clean data and the noise data by classifying and calculating the importance of the parameters in each subset and adopting a weighted aggregation strategy, thereby not only reducing the parameters of the deep neural network while maintaining the performance of the image recognition model, but also improving the pruning compression efficiency and effect of the image recognition model, and being suitable for being widely popularized and used.
Inventors
- Yao Yazhou
- SUN ZEREN
- NIE LIQIANG
- DENG XIANG
- WANG MENG
Assignees
- 南京理工大学
Dates
- Publication Date
- 20260505
- Application Date
- 20260403
Claims (8)
- 1. The image recognition model pruning compression method based on intra-class response evaluation driving is characterized by comprising the following steps of, Step A, selecting an initial noise-containing image data set by adopting JS divergence and respectively obtaining a clean image sample and a noise image sample; Step B, classifying the clean image samples and the noise image samples to obtain a clean sample subset and a noise sample subset; Step C, calculating importance scores of the filter parameters of the neural network convolutional layer under the selected noisy image data set and obtaining importance scores of the filter parameters under the selected noisy image data set; Step D, calculating importance scores of filter parameters based on the clean sample subset and the noise sample subset and by using importance scores of the filter parameters under the selected noise-containing image data set; step E, cross-category weighted aggregation is carried out on the filter parameter importance scores, and parameter comprehensive importance scores are obtained; And F, pruning compression is carried out on the image recognition model based on the parameter comprehensive importance score, and the image recognition model after pruning compression is obtained.
- 2. The method for pruning a model based on intra-class response evaluation driving as set forth in claim 1, wherein step A comprises selecting an initial noisy image dataset using JS divergence and obtaining a clean image sample and a noisy image sample, respectively, as follows, Step A1, selecting an initial noisy image data set by adopting JS divergence, wherein the initial noisy image data set is shown in a formula (1), (1) Wherein, the For the probability of the noise to be present, As a function of the JS divergence, For a true distribution of the initial noisy image dataset, For the predicted distribution of the image recognition model, As a function of the KL-divergence, Is that And Is an average distribution of (3); step A2, calculating the clean probability of the image sample in the initial noisy image data set, specifically as shown in a formula (2), (2) Wherein, the Is a clean probability; Step A3, arranging all image samples in the initial noisy image data set in descending order according to the image sample clean probability, and then taking out from the two ends of the head and tail Scaling the image samples to obtain clean samples And noise samples Wherein The scale is selected for the image sample.
- 3. The method of pruning compression of image recognition model based on intra-class response evaluation driving as set forth in claim 2, wherein step B comprises classifying clean image samples and noise image samples to obtain a subset of clean samples and a subset of noise samples, and in particular, setting the clean image samples and noise image samples to have The specific steps of the category are as follows, Step B1, classifying the clean image samples to obtain a clean sample subset, wherein the classification basis of the clean sample subset is the label of the image in the original data set, specifically as shown in a formula (3), (3) Wherein, the For the classification of the resulting clean subset of class i, For the identification of a clean sample, Is a category serial number; step B2, classifying the noise image samples and obtaining noise sample subsets, wherein the classification basis of the noise sample subsets is the prediction result of the image in the image recognition model, specifically as shown in a formula (4), (4) Wherein, the For the classification of the resulting noise subsets of class i, Identified for noise samples.
- 4. The method for pruning compression of image recognition models based on intra-class response evaluation driving as set forth in claim 3, wherein step C is performed to calculate the importance scores of the filter parameters of the convolutional layer of the neural network under the selected noisy image dataset and obtain the importance scores of the filter parameters under the selected noisy image dataset, specifically as shown in formula (5), (5) Wherein, the For the importance scores of the filter parameters under the chosen noisy image dataset, In order to calculate the function in response to the score, As a function of the parameters of the filter, To pick a noisy image dataset and pick a noisy image dataset , For the purpose of the transposition, As a loss function relative to filter parameters Is a matrix of hessians of (c), Is the Fisher matrix of the filter.
- 5. The method for pruning compression of an image recognition model based on intra-class response evaluation driving as set forth in claim 4, wherein step D is performed by calculating a filter parameter importance score based on the clean sample subset and the noise sample subset and using the importance scores of the filter parameters under the selected noisy image dataset by the steps of, Step D1, the probability of cleanliness is calculated As a clean sample subset Is weighted by the loss of (1), and noise probability is further calculated As a subset of noise samples The weighted total loss is shown in equation (6), (6) Wherein, the To pick the weighted total loss of the noisy image dataset, In order to weight the total loss, In the case of a single image sample, As a function of the loss, For a single image sample Is used for the cleaning of the object, For a single image sample Is a noise probability of (1); Step D2, calculating the parameter importance scores of the filters in the class, specifically as shown in formula (7), (7) Wherein, the To balance filter parameters At clean sample subset And noise sample subset Lower response score Is a parameter of (a).
- 6. The method for pruning a model based on intra-class response evaluation driving as set forth in claim 5, wherein step E performs cross-class weighted aggregation on the filter parameter importance scores and obtains parameter composite importance scores, specifically as shown in formula (8), ; ; (8) Wherein, the Aggregate weights for a clean subset of class i, For clean sample subsets Is used for the number of samples in the sample, Aggregate weights for the i-th class of noise subsets, For a subset of noise samples Is used for the number of samples in the sample, For the parameter composite importance score, To weight the total loss Is a Fisher matrix of (2).
- 7. The method for pruning compression of image recognition models based on intra-class response evaluation driving of claim 6, wherein step F is characterized in that pruning compression is performed on the image recognition models based on the parameter comprehensive importance scores to obtain the pruned compressed image recognition models, specifically, descending order is performed on all obtained parameter comprehensive importance scores, and filter parameters corresponding to the last parameter comprehensive importance scores are removed to complete pruning compression operation on the image recognition models and obtain the pruned compressed image recognition models.
- 8. An image recognition model pruning compression system based on intra-class response evaluation driving, wherein the specific pruning compression process of the image recognition model pruning compression system is based on the image recognition model pruning compression method of any one of claims 1-7, and is characterized by comprising an image selecting module, a classification processing module, a first importance score calculating module, a second importance score calculating module, a cross-class weighting aggregation module and a model pruning compression module, wherein the image selecting module is used for selecting an initial noisy image data set by adopting JS divergence and respectively obtaining a clean image sample and a noise image sample; The classification processing module is used for classifying the clean image samples and the noise image samples and obtaining a clean sample subset and a noise sample subset; The first importance score calculation module is used for calculating the importance score of the filter parameters of the neural network convolution layer under the selected noisy image data set and obtaining the importance score of the filter parameters under the selected noisy image data set; the second importance score calculation module is used for calculating importance scores of filter parameters based on the clean sample subset and the noise sample subset and by using importance scores of the filter parameters under the selected noise-containing image data set; the cross-category weighted aggregation module is used for performing cross-category weighted aggregation on the filter parameter importance scores and obtaining parameter comprehensive importance scores; the model pruning compression module is used for pruning the image recognition model based on the parameter comprehensive importance score and obtaining the image recognition model after pruning compression.
Description
Image recognition model pruning compression method and system based on intra-class response evaluation drive Technical Field The invention relates to the technical field of pattern recognition, in particular to a method and a system for pruning and compressing an image recognition model based on intra-class response evaluation driving. Background The image recognition model is an algorithm system for automatically classifying, filtering or evaluating images by using a deep neural network, and the core target of the image recognition model is to find out target images or reject images which do not meet requirements from a large number of pictures according to preset standards. While deep neural networks exhibit excellent performance in a wide range of applications, their computational requirements present significant challenges for deployment on resource-constrained devices such as edge hardware and smartphones. At present, model pruning compression is an effective method for reducing the deployment cost of a deep neural network in an image recognition model, the storage requirement and the inference time of the deep neural network can be reduced by deleting redundant filters or channels in the image recognition model, the existing model pruning compression method is mostly carried out under the assumption of clean and accurate annotation data, so that tag noise inevitably and seriously reduces the performance of the deep neural network in many actual scenes, a model trained under the noise tag condition often shows higher sensitivity to the removal of network parameters, the stability of the image recognition model is poorer than that of an ideal condition, meanwhile, the existing model pruning compression method is generally concentrated on a model structure, the uniqueness of data is ignored, and the effect is poor when the model with the noise tag is compressed, and therefore, the image recognition model pruning compression method and the system driven based on intra-class response evaluation need to be designed. Disclosure of Invention The invention aims to overcome the defects of the prior art, and aims to better and effectively solve the problems that the existing model pruning compression method is carried out under the assumption of clean and accurate annotation data, so that tag noise is unavoidable and seriously reduces the performance of a deep neural network in a plurality of actual scenes, and a model trained under the noise tag condition always shows higher sensitivity to the removal of network parameters, so that compared with ideal conditions, the stability of an image recognition model is poorer, the existing model pruning compression method is generally concentrated on a model structure, the uniqueness of data is ignored, and the effect is poor when the model with the noise tag is compressed, and the image recognition model pruning compression method and system based on intra-class response evaluation driving are provided. In order to achieve the above purpose, the technical scheme adopted by the invention is as follows: An image recognition model pruning compression method based on intra-class response evaluation driving comprises the following steps, Step A, selecting an initial noise-containing image data set by adopting JS divergence and respectively obtaining a clean image sample and a noise image sample; Step B, classifying the clean image samples and the noise image samples to obtain a clean sample subset and a noise sample subset; Step C, calculating importance scores of the filter parameters of the neural network convolutional layer under the selected noisy image data set and obtaining importance scores of the filter parameters under the selected noisy image data set; Step D, calculating importance scores of filter parameters based on the clean sample subset and the noise sample subset and by using importance scores of the filter parameters under the selected noise-containing image data set; step E, cross-category weighted aggregation is carried out on the filter parameter importance scores, and parameter comprehensive importance scores are obtained; And F, pruning compression is carried out on the image recognition model based on the parameter comprehensive importance score, and the image recognition model after pruning compression is obtained. The method for pruning and compressing the image recognition model based on the intra-class response evaluation drive comprises the steps of A, selecting an initial noisy image data set by JS divergence and respectively obtaining a clean image sample and a noisy image sample, wherein the specific steps are as follows, Step A1, selecting an initial noisy image data set by adopting JS divergence, wherein the initial noisy image data set is shown in a formula (1), (1) Wherein, the For the probability of the noise to be present,As a function of the JS divergence,For a true distribution of the initial noisy image dataset,For the predicted distr