An uncertainty image recognition method and apparatus for low-quality image data
By optimizing the Gaussian distillation loss through sampling and similarity calculation in a multidimensional Gaussian space, the robustness and accuracy of small-scale neural network models in recognizing low-quality image data are improved, solving the problem of insufficient recognition capability of small-scale networks in existing technologies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG LAB
- Filing Date
- 2023-11-15
- Publication Date
- 2026-05-08
AI Technical Summary
Existing knowledge distillation techniques have failed to effectively improve the robustness of small-scale networks in recognizing low-quality image data, limiting their practical application.
By sampling and similarity calculation in the multidimensional Gaussian space of two neural network models, the feature representation ability of small-scale networks is optimized using Monte Carlo sampling and reparameterization, and the parameters are optimized using the Gaussian distillation loss function.
This improved the robustness and feature representation ability of small-scale neural network models for recognizing low-quality image data, thereby enhancing recognition accuracy.
Smart Images

Figure CN117557846B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image recognition, and specifically relates to a method and apparatus for uncertain image recognition of low-quality image data. Background Technology
[0002] Low-quality image data refers to images whose content is difficult to identify or is misidentified due to factors such as lighting, occlusion, and blurring. Small-scale networks, in particular, have weak modeling capabilities and cannot effectively identify and process this type of image data. Various technical solutions have been developed to process this type of image data.
[0003] For example, CN115984949A discloses a low-quality face image recognition method and device with an attention mechanism. This method includes acquiring an unknown face image and a trained face image recognition network model. The unknown face image is input into the face image recognition network model for feature extraction. The generated abstract feature map is input into a global pooling layer, and then a face feature vector is output. The distance between the face feature vector and all target feature vectors in the retrieval database is calculated to achieve face recognition. This technique employs convolution operations with different kernel sizes and various feature fusion methods in its feature extraction layer, combined with multiple strided convolution and pooling layers, to enhance the image feature extraction effect.
[0004] For example, CN113962862A – A method, apparatus, device, and medium for recognizing low-quality images based on super-resolution – can automatically generate one-to-one matching normal-resolution images and low-resolution images, construct an initial network and a loss function. The initial network includes a super-resolution network and a classification network connected in sequence. The loss function includes super-resolution loss and classification loss. The initial network is trained using training samples until the loss function converges, at which point training stops, resulting in a low-quality image recognition model. The target image is input into the low-quality image recognition model, and the recognition result is determined based on the output of the low-quality image recognition model. Then, the super-resolution network and the classification network are combined to achieve fine-grained classification of low-resolution images.
[0005] Knowledge distillation is a method that transfers the knowledge representation of a highly accurate but complex neural network model to a smaller neural network model, which can significantly improve the recognition accuracy of small-scale networks. However, existing knowledge distillation techniques do not consider improving the robustness of small-scale networks (such as MobileNetV2, ShuffleV2, and VGG8) to low-quality image data, thus limiting the practical application of small-scale networks. Summary of the Invention
[0006] In view of the above, the purpose of this invention is to provide a method and apparatus for uncertain image recognition of low-quality image data, which improves the robustness of recognition of low-quality image data by changing the feature representation capability of a small-scale network.
[0007] To achieve the above-mentioned objectives, an embodiment provides a method for uncertain image recognition of low-quality image data, comprising the following steps:
[0008] Obtain labeled image samples;
[0009] The selected first neural network model is used to map the input image samples to the first multidimensional Gaussian space and predict their mean and variance. Samples are sampled from the first multidimensional Gaussian space and input into the first classifier to calculate the first loss. The parameters of the first neural network model and the first classifier are optimized based on the first loss.
[0010] The mean and variance of the first multidimensional Gaussian space for each image sample are obtained using the first neural network model with optimized parameters and stored in memory;
[0011] The selected second neural network model is used to map the input image samples to the second multidimensional Gaussian space and predict its mean and variance. Samples are sampled from the second multidimensional Gaussian space and input into the second classifier to calculate the second loss. At the same time, the mean and variance of the first multidimensional Gaussian space are retrieved from the memory to calculate the comparative Gaussian distillation loss. The parameters of the second neural network model and the second classifier are optimized based on the second loss and the Gaussian distillation loss.
[0012] Preferably, the step of mapping the input image samples to a first multidimensional Gaussian space using a selected first neural network model and predicting their mean and variance is formally expressed as:
[0013]
[0014]
[0015] Where X represents the input image sample, μ represents the feature embedding function of the first neural network model. t , σ t The mean and variance values represent the first multidimensional Gaussian space to which the first neural network model is mapped;
[0016] When sampling from the first multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used to sample K times from the first multidimensional Gaussian space. The K sampled samples are input into the first classifier to calculate the first loss, which is formally expressed as:
[0017]
[0018]
[0019] Where, μ t and σ t Represents the mean and variance of the first multidimensional Gaussian space, ∈ (k) This represents the repetition parameter in the k-th sampling. This indicates that the heavy parameter ∈ follows a normal distribution. This represents the sample from the k-th sampling. and Both represent the parameters of the first classifier, where r is the index of category c, and C represents the set of categories. This indicates the first loss.
[0020] Preferably, when storing the mean and variance values of the first multidimensional Gaussian space into the memory, the sample number of the image sample is used as the index value to save the mean and variance values of the first multidimensional Gaussian space into the memory.
[0021] Preferably, the step of mapping the input image samples to a second multidimensional Gaussian space using a selected second neural network model and predicting its mean and variance is formally expressed as:
[0022]
[0023]
[0024] Where X represents the input image sample, μ represents the feature embedding function of the second neural network model. s , σ s The mean and variance values represent the second multidimensional Gaussian space to which the second neural network model is mapped;
[0025] When sampling from the second multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used. Samples are taken K times from the second multidimensional Gaussian space, and these K sampled samples are input into the second classifier to calculate the second loss. This can be formally expressed as:
[0026]
[0027]
[0028] Where, μ s and σ s Represents the mean and variance of the second multidimensional Gaussian space, ∈ (k) This represents the repetition parameter in the k-th sampling. This indicates that the heavy parameter ∈ follows a normal distribution. This represents the sample from the k-th sampling. and Both represent the parameters of the second classifier, where r is the index of class c, and C represents the set of classes. This indicates the second loss.
[0029] Preferably, the step of retrieving the mean and variance of the first multidimensional Gaussian space from the memory to calculate the comparative Gaussian distillation loss includes:
[0030] The mean and variance of positive image samples in the first multidimensional Gaussian space of the first neural network model are retrieved from the memory using the sample number, and are used as the first positive example. At the same time, the mean and variance of positive image samples with the same sample number in the second multidimensional Gaussian space of the second neural network model are used as the second positive example.
[0031] Using the sample number, the mean and variance of the negative example image sample of a different category from the positive example are retrieved from the memory. This is taken as the first negative example in the first multidimensional Gaussian space of the first neural network model. Similarly, the mean and variance of the negative example image sample with the same sample number in the second multidimensional Gaussian space of the second neural network model are taken as the second negative example.
[0032] The positive similarity between positive examples in Gaussian space is calculated using the mutual likelihood score, and the negative similarity between positive and negative examples in Gaussian space is calculated using the mutual likelihood score. The comparative Gaussian distillation loss is then calculated based on the positive and negative similarity scores.
[0033] Preferably, the positive similarity T between positive examples in Gaussian space is calculated using the mutual likelihood score, and is formally expressed as:
[0034]
[0035] in, and These represent the first and second positive examples of positive image samples belonging to the same sample number i, respectively, in the first neural network model and the second neural network model. express and The mutual likelihood scores;
[0036] The negative similarity N between positive and negative examples in Gaussian space is calculated using the mutual likelihood score, and can be formally represented as:
[0037]
[0038] in, and These represent the first and second negative image samples belonging to the same sample number j, respectively, corresponding to the first and second negative examples in the first and second neural network models. express and The mutual likelihood scores, express and The mutual likelihood scores between them;
[0039] Comparative Gaussian distillation loss was calculated based on positive example similarity T and negative example similarity N. Formal representation:
[0040]
[0041] Where G represents the number of negative examples.
[0042] Secondly, an embodiment of the present invention provides an uncertainty knowledge distillation training device for low-quality image data, comprising an acquisition module, a first update module, a storage module, and a second update module;
[0043] The acquisition module is used to acquire image samples with labels;
[0044] The first update module is used to map the input image samples to a first multidimensional Gaussian space using a selected first neural network model and predict its mean and variance values, sample samples from the first multidimensional Gaussian space and input them into the first classifier to calculate the first loss, and optimize the parameters of the first neural network model and the first classifier based on the first loss;
[0045] The storage module is used to obtain the mean and variance of the first multidimensional Gaussian space of each image sample using the first neural network model after parameter optimization and store them in the memory.
[0046] The second update module is used to map the input image samples to a second multidimensional Gaussian space using a selected second neural network model and predict its mean and variance. Samples are sampled from the second multidimensional Gaussian space and input into the second classifier to calculate the second loss. At the same time, the mean and variance of the first multidimensional Gaussian space are retrieved from the memory to calculate the comparative Gaussian distillation loss. The parameters of the second neural network model and the second classifier are optimized based on the second loss and the Gaussian distillation loss.
[0047] Thirdly, embodiments of the present invention provide a method for recognizing uncertain images from low-quality image data. The method employs a second neural network model and a second classifier with optimized parameters obtained through the aforementioned uncertainty knowledge distillation training method. The recognition method includes the following steps:
[0048] Obtain test image samples;
[0049] The test image samples are input into the second neural network model with optimized parameters to obtain the second multidimensional Gaussian space corresponding to the test image samples. K samples are then sampled from the second multidimensional Gaussian space to obtain K sampled samples. The K sampled samples are then input into the second classifier to obtain K classification results.
[0050] The final classification result for the test image sample is obtained by averaging the K classification results.
[0051] Fourthly, an embodiment of the present invention provides an uncertain image recognition device for low-quality image data, comprising an input module, a recognition module, and an output module;
[0052] The input module is used to acquire test image samples;
[0053] The recognition module is used to input test image samples into a parameter-optimized second neural network model to obtain a second multidimensional Gaussian space corresponding to the test image samples, and to sample K times from the second multidimensional Gaussian space to obtain K sampled samples, and input the K sampled samples into a second classifier to obtain K classification results;
[0054] The output module is used to average the K classification results to obtain the final classification result corresponding to the test image sample and output it.
[0055] Fifthly, an embodiment of the present invention provides a computing device including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used for the aforementioned uncertainty knowledge distillation training method and the aforementioned uncertainty image recognition method.
[0056] Compared with the prior art, the beneficial effects of the present invention include at least the following:
[0057] The technical solution of this invention makes minimal modifications to the original neural network model and does not limit specific neural network models. It performs knowledge distillation by measuring the similarity between sampled samples in the multidimensional Gaussian space of two neural network models, thereby improving the robustness and feature representation ability of small-scale neural network models. In this way, the neural network model can handle input image data of different qualities well and achieve high recognition accuracy. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0059] Figure 1 This is a flowchart of an embodiment of the present invention for an uncertainty knowledge distillation training method for low-quality image data;
[0060] Figure 2This is a flowchart of the calculation of comparative Gaussian distillation loss provided in an embodiment of the present invention;
[0061] Figure 3 This is a schematic diagram of the structure of an uncertainty knowledge distillation training device for low-quality image data provided in an embodiment of the present invention;
[0062] Figure 4 This is a flowchart of an uncertain image recognition method for low-quality image data provided in an embodiment of the present invention;
[0063] Figure 5 This is a schematic diagram of the structure of an uncertain image recognition device for low-quality image data provided in an embodiment of the present invention;
[0064] Figure 6 This is a schematic diagram of the structure of a computing device provided in an embodiment of the present invention. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of this invention.
[0066] The uncertain image recognition scheme for low-quality image data provided in the embodiment uses a neural network model to map the low-quality image data into a multidimensional Gaussian space. The variance value of the Gaussian space is used as the degree of uncertainty in the image feature expression. Then, corresponding image processing is performed, which specifically includes the training and recognition application of the neural network model.
[0067] like Figure 1 As shown in the embodiment, an uncertainty knowledge distillation training method for low-quality image data is provided, including the following steps:
[0068] S110, Obtain image samples with labels.
[0069] As a preferred implementation, the acquired image samples should include, but are not limited to, image samples with different lighting, different image quality, different sizes, and images containing targets of different sizes. The image samples can be face images or traffic scene images. The label refers to the category corresponding to the image sample classification task.
[0070] S120: Using the selected first neural network model, the input image samples are mapped to the first multidimensional Gaussian space and their mean and variance are predicted. Samples are sampled from the first multidimensional Gaussian space and input into the first classifier to calculate the first loss. The parameters of the first neural network model and the first classifier are optimized based on the first loss.
[0071] As a preferred implementation, VGG13 can be selected as the first neural network model. The selected first neural network model is used to map the input image samples to a first multidimensional Gaussian space and predict their mean and variance, formally represented as:
[0072]
[0073]
[0074] Where X represents the input image sample, μ represents the feature embedding function of the first neural network model. t , σ t The mean and variance values represent the first multidimensional Gaussian space to which the first neural network model is mapped;
[0075] When sampling from the first multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used to sample K times from the first multidimensional Gaussian space. The K sampled samples are input into the first classifier to calculate the first loss, which is formally expressed as:
[0076]
[0077]
[0078] Where, μ t and σ t Represents the mean and variance of the first multidimensional Gaussian space, ∈ (k) This represents the repetition parameter in the k-th sampling. This indicates that the heavy parameter ∈ follows a normal distribution. This represents the sample from the k-th sampling. and Both represent the parameters of the first classifier, where r is the index of category c, and C represents the set of categories. This indicates the first loss.
[0079] When optimizing the parameters of the first neural network model and the first classifier based on the first loss, the gradient descent method is used to update the parameters of the first neural network model and the first classifier.
[0080] S130: The mean and variance of the first multidimensional Gaussian space for each image sample are obtained using the first neural network model with optimized parameters and stored in the memory.
[0081] In a preferred embodiment, when storing the mean and variance values of the first multidimensional Gaussian space into memory, the sample number of the image sample is used as an index to save the mean and variance values of the first multidimensional Gaussian space into memory. Using the sample number as an index facilitates subsequent calculation of the comparative Gaussian distillation loss.
[0082] S140: Using the selected second neural network model, the input image samples are mapped to the second multidimensional Gaussian space and their mean and variance are predicted. Samples are sampled from the second multidimensional Gaussian space and input into the second classifier to calculate the second loss. At the same time, the mean and variance of the first multidimensional Gaussian space are retrieved from the memory to calculate the comparative Gaussian distillation loss. The parameters of the second neural network model and the second classifier are optimized based on the second loss and the Gaussian distillation loss.
[0083] As a preferred implementation, VGG8 is selected as the second neural network model. The selected second neural network model is used to map the input image samples to a second multidimensional Gaussian space and predict their mean and variance, formally represented as:
[0084]
[0085]
[0086] Where X represents the input image sample, μ represents the feature embedding function of the second neural network model. s , σ s The mean and variance values represent the second multidimensional Gaussian space to which the second neural network model is mapped;
[0087] When sampling from the second multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used. Samples are taken K times from the second multidimensional Gaussian space, and these K sampled samples are input into the second classifier to calculate the second loss. This can be formally expressed as:
[0088]
[0089]
[0090] Where, μ s and σ s Represents the mean and variance of the second multidimensional Gaussian space, ∈ (k) This represents the repetition parameter in the k-th sampling. This indicates that the heavy parameter ∈ follows a normal distribution. This represents the sample from the k-th sampling. and Both represent the parameters of the second classifier, where r is the index of class c, and C represents the set of classes. This indicates the second loss.
[0091] As a preferred implementation method, such as Figure 2 As shown, the calculation of the comparative Gaussian distillation loss involves retrieving the mean and variance values of the first multidimensional Gaussian space from the memory, including:
[0092] S210, retrieve the mean and variance of the positive image sample in the first multidimensional Gaussian space of the first neural network model from the memory using the sample number, and use it as the first positive example. At the same time, use the mean and variance of the positive image sample with the same sample number in the second multidimensional Gaussian space of the second neural network model as the second positive example.
[0093] S220, using the sample number, retrieve the mean and variance of the negative example image sample of a different category from the positive example from the memory. This is taken as the first negative example. Similarly, the mean and variance of the negative example image sample with the same sample number are taken as the second negative example.
[0094] S230: Calculate the positive similarity between positive examples in Gaussian space using the mutual likelihood score, calculate the negative similarity between positive and negative examples in Gaussian space using the mutual likelihood score, and calculate the comparative Gaussian distillation loss based on the positive and negative similarity scores.
[0095] As a preferred implementation, the positive similarity T between positive examples in Gaussian space is calculated using the mutual likelihood score, and is formally expressed as:
[0096]
[0097] in, and These represent the first and second positive examples of positive image samples belonging to the same sample number i, respectively, in the first neural network model and the second neural network model. express and The mutual likelihood scores;
[0098] The negative similarity N between positive and negative examples in Gaussian space is calculated using the mutual likelihood score, and can be formally represented as:
[0099]
[0100] in, and These represent the first and second negative image samples belonging to the same sample number j, respectively, corresponding to the first and second negative examples in the first and second neural network models. express and The mutual likelihood scores, express and The mutual likelihood score between them is calculated in the following form:
[0101]
[0102] in, and Let represent the mean of the l-th dimension corresponding to image sample i and image sample j, respectively. and Let represent the variance value of the l-th dimension.
[0103] Comparative Gaussian distillation loss was calculated based on positive example similarity T and negative example similarity N. Formal representation:
[0104]
[0105] Where G represents the number of negative examples.
[0106] The final loss function for training the second neural network model and the second classifier Formal representation:
[0107]
[0108] Based on the same inventive concept, such as Figure 3 As shown, the embodiment also provides an uncertainty knowledge distillation training device for low-quality image data, including an acquisition module 310, a first update module 320, a storage module 330, and a second update module 340; wherein, the acquisition module 310 is used to acquire image samples with labels; the first update module 320 is used to map the input image samples to a first multidimensional Gaussian space using a selected first neural network model and predict its mean and variance values, sample samples from the first multidimensional Gaussian space and input them into a first classifier to calculate a first loss, and optimize the parameters of the first neural network model and the first classifier based on the first loss; The storage module 330 is used to obtain the mean and variance of the first multidimensional Gaussian space for each image sample using the first neural network model after parameter optimization and store them in the memory; the second update module 340 is used to map the input image sample to the second multidimensional Gaussian space using the selected second neural network model and predict its mean and variance, sample samples from the second multidimensional Gaussian space and input them into the second classifier to calculate the second loss, and at the same time retrieve the mean and variance of the first multidimensional Gaussian space from the memory to calculate the comparative Gaussian distillation loss, and optimize the parameters of the second neural network model and the second classifier based on the second loss and the Gaussian distillation loss.
[0109] In a preferred embodiment, when sampling samples from the first multidimensional Gaussian space, the first update module 320 uses Monte Carlo sampling and reparameterization to sample K times from the first multidimensional Gaussian space. The K sampled samples are then input into the first classifier to calculate the first loss.
[0110] In a preferred embodiment, when storing the mean and variance values of the first multidimensional Gaussian space into the memory, the storage module 330 saves the mean and variance values of the first multidimensional Gaussian space into the memory using the sample number of the image sample as the index value.
[0111] In a preferred embodiment, when sampling samples from the second multidimensional Gaussian space, the second update module 340 uses Monte Carlo sampling and reparameterization to sample K times from the second multidimensional Gaussian space. The K sampled samples are then input into the second classifier to calculate the second loss.
[0112] In a preferred embodiment, the second update module 340 retrieves the mean and variance values of the first multidimensional Gaussian space from the memory to calculate the comparative Gaussian distillation loss, including:
[0113] The mean and variance of positive image samples in the first multidimensional Gaussian space of the first neural network model are retrieved from the memory using the sample number, and are used as the first positive example. At the same time, the mean and variance of positive image samples with the same sample number in the second multidimensional Gaussian space of the second neural network model are used as the second positive example.
[0114] Using the sample number, the mean and variance of the negative example image sample of a different category from the positive example are retrieved from the memory. This is taken as the first negative example in the first multidimensional Gaussian space of the first neural network model. Similarly, the mean and variance of the negative example image sample with the same sample number in the second multidimensional Gaussian space of the second neural network model are taken as the second negative example.
[0115] The positive similarity between positive examples in Gaussian space is calculated using the mutual likelihood score, and the negative similarity between positive and negative examples in Gaussian space is calculated using the mutual likelihood score. The comparative Gaussian distillation loss is then calculated based on the positive and negative similarity scores.
[0116] It should be noted that the uncertainty knowledge distillation training device provided in the above embodiments should be illustrated using the above-described division of functional modules when performing uncertainty knowledge distillation training. The functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal or server can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the uncertainty knowledge distillation training device and the uncertainty knowledge distillation training method embodiments provided in the above embodiments belong to the same concept; their specific implementation process is detailed in the uncertainty knowledge distillation training method embodiments, and will not be repeated here.
[0117] Based on the same inventive concept, such as Figure 4 As shown in the embodiment, an uncertain image recognition method for low-quality image data is provided, comprising the following steps:
[0118] S410, acquire test image samples;
[0119] S420, the test image sample is input into the parameter-optimized second neural network model to obtain the second multidimensional Gaussian space corresponding to the test image sample, and K samples are sampled from the second multidimensional Gaussian space K times to obtain K sampled samples, and the K sampled samples are input into the second classifier to obtain K classification results;
[0120] S430: Average the K classification results to obtain the final classification result corresponding to the test image sample.
[0121] Based on the same inventive concept, such as Figure 5 As shown, the embodiment also provides an uncertain image recognition device for low-quality image data, including an input module 510, a recognition module 520, and an output module 530; wherein, the input module 510 is used to acquire test image samples; the recognition module 520 is used to input the test image samples into a parameter-optimized second neural network model to obtain a second multidimensional Gaussian space corresponding to the test image samples, and sample K times from the second multidimensional Gaussian space to obtain K sampled samples, and input the K sampled samples into a second classifier to obtain K classification results; the output module 530 is used to average the K classification results to obtain the final classification result corresponding to the test image samples and output it.
[0122] It should be noted that the uncertainty image recognition device provided in the above embodiments should be illustrated by the division of the above functional modules when performing uncertainty image recognition. The functions can be assigned to different functional modules as needed, that is, the internal structure of the terminal or server can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the uncertainty image recognition device and the uncertainty image recognition method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the uncertainty image recognition method embodiments, which will not be repeated here.
[0123] Figure 6 The diagram shows a structural schematic of a computing device provided by the present invention. At the hardware level, in addition to a processor and memory, it also includes an internal bus, network interface, memory, and other hardware required for business operations. The memory is non-volatile memory. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to implement the uncertainty knowledge distillation training method described in S110-S140 above, and also the uncertainty image recognition method described in S410-S430 above. Of course, besides software implementation, the present invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to individual logic units, but can also be hardware or logic devices.
[0124] In the uncertainty image recognition scheme for low-quality image data provided in the above embodiments, if VGG13 is used as the first neural network model and VGG8 is used as the second neural network model, and the training method of the present invention is used for training, the recognition accuracy using the CIFAR100 test set as the second test set is 74.44%, which is about 1% to 2% higher than the technology of directly processing low-quality images without using the present invention.
[0125] The specific embodiments described above illustrate the technical solution and beneficial effects of the present invention in detail. It should be understood that the above description is only the most preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, additions, and equivalent substitutions made within the scope of the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for training uncertain knowledge distillation on low-quality image data, characterized in that, Includes the following steps: Obtain labeled image samples; The selected first neural network model is used to map the input image samples to the first multidimensional Gaussian space and predict their mean and variance. Samples are sampled from the first multidimensional Gaussian space and input into the first classifier to calculate the first loss. The parameters of the first neural network model and the first classifier are optimized based on the first loss. The mean and variance of the first multidimensional Gaussian space for each image sample are obtained using the first neural network model with optimized parameters and stored in memory; The selected second neural network model is used to map the input image samples to the second multidimensional Gaussian space and predict its mean and variance. Samples are sampled from the second multidimensional Gaussian space and input into the second classifier to calculate the second loss. At the same time, the mean and variance of the first multidimensional Gaussian space are retrieved from the memory to calculate the comparative Gaussian distillation loss. The parameters of the second neural network model and the second classifier are optimized based on the second loss and the Gaussian distillation loss. The step of retrieving the mean and variance of the first multidimensional Gaussian space from the memory and calculating the comparative Gaussian distillation loss includes: The mean and variance of positive image samples in the first multidimensional Gaussian space of the first neural network model are retrieved from the memory using the sample number, and are used as the first positive example. At the same time, the mean and variance of positive image samples with the same sample number in the second multidimensional Gaussian space of the second neural network model are used as the second positive example. Using the sample number, the mean and variance of the negative example image sample of a different category from the positive example are retrieved from the memory. This is taken as the first negative example in the first multidimensional Gaussian space of the first neural network model. Similarly, the mean and variance of the negative example image sample with the same sample number in the second multidimensional Gaussian space of the second neural network model are taken as the second negative example. The positive similarity between positive examples in Gaussian space is calculated using the mutual likelihood score, and the negative similarity between positive and negative examples in Gaussian space is calculated using the mutual likelihood score. The comparative Gaussian distillation loss is then calculated based on the positive and negative similarity scores.
2. The uncertainty knowledge distillation training method for low-quality image data according to claim 1, characterized in that, The process of mapping the input image samples to a first multidimensional Gaussian space using a selected first neural network model and predicting its mean and variance can be formally expressed as: in, This represents the input image sample. , This represents the feature embedding function of the first neural network model. , The mean and variance values represent the first multidimensional Gaussian space to which the first neural network model is mapped; When sampling from the first multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used to sample K times from the first multidimensional Gaussian space. The K sampled samples are input into the first classifier to calculate the first loss, which is formally expressed as: in, and Let represent the mean and variance of the first multidimensional Gaussian space. This represents the repetition parameter in the k-th sampling. Representing repeated parameters Follows a normal distribution. This represents the sample from the k-th sampling. and All represent the parameters of the first classifier. This is the index of category c, where C represents the set of categories. This indicates the first loss.
3. The uncertainty knowledge distillation training method for low-quality image data according to claim 1, characterized in that, When storing the mean and variance values of the first multidimensional Gaussian space into memory, the sample number of the image sample is used as the index value to save the mean and variance values of the first multidimensional Gaussian space into memory.
4. The uncertainty knowledge distillation training method for low-quality image data according to claim 1, characterized in that, The process of mapping the input image samples to a second multidimensional Gaussian space using a selected second neural network model and predicting its mean and variance can be formally expressed as follows: in, This represents the input image sample. , This represents the feature embedding function of the second neural network model. , The mean and variance values represent the second multidimensional Gaussian space to which the second neural network model is mapped; When sampling from the second multidimensional Gaussian space, Monte Carlo sampling and reparameterization are used. Samples are taken K times from the second multidimensional Gaussian space, and these K sampled samples are input into the second classifier to calculate the second loss. This can be formally expressed as: in, and Let represent the mean and variance of the second-dimensional Gaussian space. This represents the repetition parameter in the k-th sampling. Representing repeated parameters Follows a normal distribution. This represents the sample from the k-th sampling. and All represent the parameters of the second classifier. This is the index of category c, where C represents the set of categories. This indicates the second loss.
5. The uncertainty knowledge distillation training method for low-quality image data according to claim 1, characterized in that, The positive similarity T between positive examples in Gaussian space is calculated using the mutual likelihood score, and can be formally expressed as: in, and They respectively indicate that they belong to the same sample number The positive example image samples are respectively the first positive example and the second positive example corresponding to the first neural network model and the second neural network model. express and The mutual likelihood scores; The negative similarity N between positive and negative examples in Gaussian space is calculated using the mutual likelihood score, and can be formally represented as: in, and They respectively indicate that they belong to the same sample number The negative example image samples are respectively the first negative example and the second negative example corresponding to the first neural network model and the second neural network model. express and The mutual likelihood scores, express and The mutual likelihood scores between them; Comparative Gaussian distillation loss was calculated based on positive example similarity T and negative example similarity N. Formal representation: Where G represents the number of negative examples.
6. A knowledge distillation training device for low-quality image data, characterized in that, It includes an acquisition module, a first update module, a storage module, and a second update module; The acquisition module is used to acquire image samples with labels; The first update module is used to map the input image samples to a first multidimensional Gaussian space using a selected first neural network model and predict its mean and variance values, sample samples from the first multidimensional Gaussian space and input them into the first classifier to calculate the first loss, and optimize the parameters of the first neural network model and the first classifier based on the first loss; The storage module is used to obtain the mean and variance of the first multidimensional Gaussian space of each image sample using the first neural network model after parameter optimization and store them in the memory. The second update module is used to map the input image samples to the second multidimensional Gaussian space using the selected second neural network model and predict its mean and variance values, sample samples from the second multidimensional Gaussian space and input them into the second classifier to calculate the second loss, and simultaneously retrieve the mean and variance values of the first multidimensional Gaussian space from the memory to calculate the comparative Gaussian distillation loss, and optimize the parameters of the second neural network model and the second classifier based on the second loss and the Gaussian distillation loss. The step of retrieving the mean and variance of the first multidimensional Gaussian space from the memory and calculating the comparative Gaussian distillation loss includes: The mean and variance of positive image samples in the first multidimensional Gaussian space of the first neural network model are retrieved from the memory using the sample number, and are used as the first positive example. At the same time, the mean and variance of positive image samples with the same sample number in the second multidimensional Gaussian space of the second neural network model are used as the second positive example. Using the sample number, the mean and variance of the negative example image sample of a different category from the positive example are retrieved from the memory. This is taken as the first negative example in the first multidimensional Gaussian space of the first neural network model. Similarly, the mean and variance of the negative example image sample with the same sample number in the second multidimensional Gaussian space of the second neural network model are taken as the second negative example. The positive similarity between positive examples in Gaussian space is calculated using the mutual likelihood score, and the negative similarity between positive and negative examples in Gaussian space is calculated using the mutual likelihood score. The comparative Gaussian distillation loss is then calculated based on the positive and negative similarity scores.
7. A method for uncertain image recognition using low-quality image data, characterized in that, The method employs a parameter-optimized second neural network model and a second classifier obtained through the uncertainty knowledge distillation training method described in any one of claims 1-5. The identification method includes the following steps: Obtain test image samples; The test image samples are input into the second neural network model with optimized parameters to obtain the second multidimensional Gaussian space corresponding to the test image samples. K samples are then sampled from the second multidimensional Gaussian space to obtain K sampled samples. The K sampled samples are then input into the second classifier to obtain K classification results. The final classification result for the test image sample is obtained by averaging the K classification results.
8. An uncertain image recognition device for low-quality image data, characterized in that, It includes an input module, a recognition module, and an output module; The input module is used to acquire test image samples; The recognition module is used to input the test image sample into the second neural network model with optimized parameters in the method of any one of claims 1-5 to obtain the second multidimensional Gaussian space corresponding to the test image sample, and to sample K times from the second multidimensional Gaussian space to obtain K sampled samples, and input the K sampled samples into the second classifier to obtain K classification results; The output module is used to average the K classification results to obtain the final classification result corresponding to the test image sample and output it.
9. A computing device, characterized in that, The device includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the uncertainty knowledge distillation training method of any one of claims 1-5 and the uncertainty image recognition method of claim 7.
Citation Information
Patent Citations
Super-resolution-based low-quality image recognition method and device, equipment and medium
CN113962862A
Low-quality face image recognition method and equipment with attention mechanism
CN115984949A
Image recognition uncertainty knowledge distillation method and system
CN116797904A