Image classification method without passive domain adaptation via class-guided meta-learning
Through the method of class-guided meta-learning, the teacher network and student network are used to classify images, and the category-aware meta-learning module is combined to correct the pseudo labels. This solves the problems of noise accumulation and data deviation in passive domain adaptive image classification, and achieves Provides more efficient target domain model performance and resource utilization.
Patent Information
- Application Number
- CN202311543424.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-11-17
AI Technical Summary
Existing passive domain adaptive image classification methods have problems with noise accumulation and data deviation when dealing with uneven data distribution, resulting in reduced model performance and inability to effectively utilize unlabeled target domain data.
Using a method based on class-guided meta-learning, by constructing a self-training teacher-student network of teacher network and student network, combined with a category-aware meta-learning module, the pseudo-labels are corrected and sample weights are assigned, reducing noise accumulation and data deviation, and improving the model performance.
Without accessing source domain data, it significantly improves the classification performance of the target domain model, solves the problems of data privacy and resource waste, and improves the prediction accuracy of rare class samples.
Smart Images

Figure CN117523295B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image classification, and more specifically, relates to an image classification method based on class-guided meta-learning and passive domain adaptation. Background Art
[0002] Deep neural networks have successfully demonstrated high performance in various applications. However, if the distribution of training and test data is different, significant performance degradation will occur, which is called domain shift. Unsupervised domain adaptation image classification uses fully labeled source data images and unlabeled target image data to alleviate the domain shift problem under the assumption that the data distribution in the two domains is different. All traditional unsupervised domain adaptation image classification methods assume the availability of both source data and corresponding labels. However, this may be impractical in some cases. First, growing concerns about data privacy and security force companies to release only target image data without access to source data images. Second, when the source data images are much larger than the target data images, many resources are required to train the model. Passive domain adaptation aims to adapt the pre-trained source model to the unlabeled target domain without access to well-labeled source data. This application scenario is more common than traditional unsupervised domain adaptation.
[0003] Existing passive domain adaptive image classification methods can be divided into two categories. One is the data generation method. The purpose of the data generation method is to reconstruct the source domain to compensate for the missing source domain data, so that the unsupervised domain adaptation method can be extended to the passive domain adaptive image classification method. However, the training of the generative model is usually complex and the generative model is prone to model collapse, that is, the generated image samples are clustered around some local patterns in the feature space, while ignoring other potential categories and sample distributions. The other is the self-training-based method, which assumes that the source pre-trained model has a certain degree of generalization on the target domain due to the similarity between the source and target domains. At present, self-training based methods occupy the mainstream of passive domain adaptive image classification methods. They mainly guide model self-training by predicting labels of target domain images through source domain models. However, the existing self-training based methods have the following main problems: 1) Allocating the obtained pseudo-labels to samples with the same weight to guide model training is prone to noise accumulation, resulting in degradation of model performance; 2) Existing methods do not take into account the fact that the collected data presents a significant long-tail distribution phenomenon, that is, the number of samples of some common classes is large, and the number of samples of rare classes is small, which often leads to relatively stable predictions of the trained model for common classes, while the latter is prone to prediction errors. Existing methods often ignore this data bias problem, resulting in poor model prediction results. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide an image classification method for passive domain adaptation based on class-guided meta-learning, which improves the quality of pseudo-labels by correcting them, and learns a weight for each sample through class-guided meta-learning to reduce the noise accumulation problem of erroneous labels. At the same time, according to the different confidence levels of the classes, the data deviation problem caused by the long-tail distribution of the classes is reduced, and the classification performance of the target domain model is significantly improved.
[0005] In order to achieve the above-mentioned object of the invention, the image classification method based on passive domain adaptation of class-guided meta-learning of the present invention comprises the following steps:
[0006] S1: Select the trained source domain feature extractor and source domain feature classifier according to actual needs, use their parameters to initialize the target domain feature extractor and target domain feature classifier, and then copy the target domain feature extractor and target domain feature classifier, one group as the teacher network and one group as the student network, thereby forming a self-training teacher-student network;
[0007] S3: Construct a category-aware meta-learning module, including a loss calculation module, a loss multi-layer perceptron, a pseudo-like accuracy calculation module, a pseudo-like accuracy multi-layer perceptron, and a confidence calculation module, where:
[0008] The loss calculation module is used to calculate the predicted label loss L(w) based on the predicted label obtained by the student network for the image sample and send it to the loss multi-layer perceptron, where w represents the student network parameter;
[0009] The multilayer perceptron is used to generate the corresponding sample weights according to the predicted label loss L(w) of the image sample x. θ represents the network parameters of the multi-layer perceptron, S represents the preset weight dimension, and the sample weight P(L(w),θ) is sent to the confidence weight calculation module;
[0010] The class pseudo accuracy calculation module is used to calculate the class pseudo accuracy p of each image sample in K categories based on the predicted labels of all image samples by the teacher network. k And sent to the class pseudo accuracy multilayer perceptron, k = 1, 2, ..., K, K represents the number of target categories, class pseudo accuracy p k The calculation formula is as follows:
[0011]
[0012] in, Represents the teacher network for image sample x i The predicted label of represents a binary function, when hour otherwise Represents the target domain feature extractor in the teacher network For image x i The extracted feature vector is Represents the target domain feature classifier For the feature vector The inferred possibility, Indicates that the softmax function is used according to the possibility The obtained probability;
[0013] The multilayer perceptron is used to calculate the pseudo accuracy of each image sample according to the K classes of pseudo accuracy p k Generate the category weight of the image sample Represents the network parameters of the multilayer perceptron with pseudo-accuracy class, and the class weight Send to the confidence weight calculation module;
[0014] The confidence weight calculation module is used to calculate the confidence weight based on the sample weight P(L(w),θ) and the category weight Calculate the confidence weight
[0015]
[0016] in, Represents the dot product between two vectors;
[0017] S3: The teacher network, the student network and the meta-learning module constitute a meta-learning model, wherein the teacher network and the student network predict the input image respectively to obtain the predicted label, and the meta-learning module calculates the confidence weight according to the predicted labels of the teacher network and the student network;
[0018] S4: Set the number of iterations t = 1;
[0019] S5: Image set X T Each image x i Input into the teacher network to get image x i The probability of belonging to category k is γ i,k , thereby determining the image x i The classification result is used as the initial pseudo label y′ of the image. i , thus obtaining the image set X T The corresponding pseudo-label set Y′ T , i = 1, 2, ..., N, N represents the number of images, y ′ i ∈[1,K];
[0020] S6: Use the pseudo-label correction method to correct the pseudo-label set Y′ T Process each image xi Corrected pseudo label y i , thus obtaining the corrected pseudo label set Y T ;
[0021] S7: For the meta-learning model, the model training loss function of the self-training teacher-student network is used as the lower-level task of meta-learning, and the confidence weight function of the meta-learning module is used as the upper-level task of meta-learning. T The meta-learning model is trained, and the upper-level tasks and the lower-level tasks are iteratively updated alternately to complete the training of the meta-learning model;
[0022] S8: Determine whether t<t max , t max Indicates the maximum number of iterations predicted, if yes, go to step S9, otherwise go to step S10;
[0023] S9: Let t=t+1, use the parameters of the current student network to update the parameters of the teacher network, and return to step S5;
[0024] S10: Extract the student network from the final meta-learning model as the target domain model, and use the target domain model to classify the target domain data images.
[0025] The present invention is based on a passive domain adaptation image classification method of class-guided meta-learning, constructs a self-training teacher-student network composed of a teacher network and a student network, and constructs a category-aware meta-learning module, the teacher network, the student network and the meta-learning module constitute a meta-learning model, the teacher network is used to obtain a pseudo-label for each image sample in an image set and perform pseudo-label correction, for the meta-learning model, the model training loss function of the self-training teacher-student network is used as a lower-level task of meta-learning, the confidence weight function of the meta-learning module is used as an upper-level task of meta-learning, the image set is used to train the meta-learning model, and then the parameters of the teacher network are used to update the parameters of the student network, and the pseudo-label is re-obtained, and this cycle is repeated until the maximum number of iterations is reached, the student network is extracted from the final meta-learning model as a target domain model, and the target domain model is used to classify the target domain data image.
[0026] The present invention has the following beneficial effects:
[0027] 1) The present invention can classify unlabeled target domain images by relying on a pre-trained model in the source domain when the source domain data cannot be accessed, which not only protects the privacy of the source domain data but also solves the waste of computing and storage resources of large-scale source domain data, and improves the passive domain adaptation effect;
[0028] 2) The present invention improves the quality of pseudo labels by correcting the pseudo labels, thereby improving the learning effect;
[0029] 3) The present invention supplements the meta-knowledge from the category and the loss information of the original image samples through class-guided meta-learning, outputs the pseudo-label confidence of each image sample, reduces the data bias problem caused by the long-tail distribution of the class, and significantly improves the classification performance of the target domain model. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a flowchart of a specific implementation method of the image classification method based on passive domain adaptation of class-guided meta-learning of the present invention;
[0031] Figure 2 is a structural diagram of the category-aware meta-learning module of the present invention;
[0032] Figure 3 4 is a flow chart of the pseudo-label correction method based on information constraints in this embodiment. DETAILED DESCRIPTION
[0033] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.
[0034] Example
[0035] Figure 1 1 is a flowchart of a specific implementation of the image classification method based on passive domain adaptation of class-guided meta-learning of the present invention. Figure 1 As shown, the specific steps of the image classification method based on passive domain adaptation of class-guided meta-learning of the present invention include:
[0036] S101: Building a self-training teacher-student network:
[0037] According to actual needs, the trained source domain feature extractor and source domain feature classifier are selected, and their parameters are used to initialize the target domain feature extractor and target domain feature classifier. Then, the target domain feature extractor and target domain feature classifier are copied, one set as the teacher network and one set as the student network, thus forming a self-training teacher-student network. According to actual needs, the unlabeled images of the target domain are determined to obtain the image set X T In practical applications, the image set X can be T The images in are enhanced according to the preset method to better extract features.
[0038] S102: Constructing a category-aware meta-learning module:
[0039] Although pseudo-label correction can greatly improve the quality of pseudo-labels, due to the objective problem of the domain gap between the source domain and the target domain, some sample labels still have the problem of incorrect assignment. In order to alleviate the performance degradation caused by the accumulation of pseudo-label errors, samples with low confidence in pseudo-labels should be suppressed during model training. Therefore, the present invention sets up a category-aware meta-learning module, which considers the meta-knowledge from the category and the loss information of the sample to learn the confidence weight of each sample. Figure 2 is a structural diagram of the category-aware meta-learning module in the present invention. Figure 2 As shown, the category-aware meta-learning module in the present invention includes a loss calculation module, a loss multi-layer perceptron, a pseudo-like accuracy calculation module, a pseudo-like accuracy multi-layer perceptron and a confidence calculation module, wherein:
[0040] The loss calculation module is used to calculate the predicted label loss L(w) based on the predicted label obtained by the student network for the image sample and send it to the loss multi-layer perceptron, where w represents the student network parameter. In this embodiment, the predicted label loss adopts the commonly used cross entropy loss, and the calculation formula is as follows:
[0041] L(w)=-ylog(f(x,w))
[0042] Among them, y represents the current label of image sample x, and f(x,w) represents the predicted label of input image sample x obtained by the student network with parameter w.
[0043] The multi-layer perceptron is used to generate the corresponding sample weights according to the predicted label loss L(w) of the image sample. θ represents the network parameters of the multi-layer perceptron, S represents the preset weight dimension, and the sample weight P(L(w),θ) is sent to the confidence weight calculation module.
[0044] The class pseudo accuracy calculation module is used to calculate the class pseudo accuracy p of each image sample in K categories based on the predicted labels of all image samples by the teacher network. k And sent to the class pseudo accuracy multilayer perceptron, k = 1, 2, ..., K, K represents the number of target categories, class pseudo accuracy p k The calculation formula is as follows:
[0045]
[0046] in, Represents the teacher network for image sample x i The predicted label of represents a binary function, when hour otherwise Represents the target domain feature extractor in the teacher network For image x i The extracted feature vector is Represents the target domain feature classifier For the feature vector The inferred likelihood (i.e. logits), Indicates that the softmax function is used according to the possibility The obtained probability.
[0047] The multilayer perceptron is used to calculate the pseudo accuracy of each image sample according to the K classes of pseudo accuracy p k Generate the category weight of the image sample Represents the network parameters of the multilayer perceptron with pseudo-accuracy class, and the class weight Sent to the confidence weight calculation module. For example, setting S to 3 is equivalent to dividing the K classes into three groups: high confidence class, medium confidence class, and low confidence class, so that the class-guided meta-learning confidence module can assign different class weights to different groups of classes.
[0048] The confidence weight calculation module is used to calculate the confidence weight based on the sample weight P(L(w),θ) and the category weight Calculate the confidence weight
[0049]
[0050] in, Represents the dot product between two vectors.
[0051] S103: Building a meta-learning model:
[0052] The teacher network, student network and meta-learning module constitute a meta-learning model, in which the teacher network and the student network predict the input image respectively to obtain the predicted label, and the meta-learning module calculates the confidence weight according to the predicted labels of the teacher network and the student network.
[0053] S104: Set the number of iterations t=1.
[0054] S105: Using the teacher network to obtain pseudo labels:
[0055] The image set X T Each image x i Input into the teacher network to get image x i The probability of belonging to category k is γ i,k , thus determining the image x i The classification result is used as the initial pseudo label y′ of the image. i , thus obtaining the image set X TThe corresponding pseudo-label set Y′ T , i = 1, 2, ..., N, N represents the number of images, y ′ i ∈[1,K].
[0056] In this embodiment, in order to improve the accuracy of the initial pseudo-label, a weighted average method is used to determine the pseudo-label. The specific method is as follows:
[0057] For image x i Perform random M enhancement processing, and then use the enhanced image x i,m Input to the teacher network to get the predicted label, m = 1, 2, ..., M, and then use the following formula to calculate the image x i The probability of belonging to category k is γ i,k :
[0058]
[0059] in, Target domain feature extractor representing the teacher network For image x i,m The extracted features, Target domain feature classifier representing the teacher network The predicted image x i,m The probability of belonging to class k.
[0060] Selection probability γ i,k The category number corresponding to the maximum value is taken as image x i The pseudo label y′ i .
[0061] S106: Pseudo-label correction:
[0062] Considering that there is a certain domain offset between the source domain and the target domain, the pseudo label set Y T There is a lot of noise, so the pseudo-label correction method is used in the present invention to correct the pseudo-label set Y′ T Process each image x i Corrected pseudo label y i , thus obtaining the corrected pseudo label set Y T , further improving the quality of pseudo labels.
[0063] The specific method of pseudo-label correction can be set according to actual needs. For example, conventional pseudo-label correction is to correct pseudo-labels by iteratively updating the class center of the category. According to research, when the data categories are unevenly distributed, the classifier often has a certain bias towards the "large" category (there are many samples belonging to this category), and tends to assign higher prediction values to the "large" category during classification. The smoothness assumption in machine learning can alleviate this bias to a certain extent. When the features between two samples are similar, the two samples have a greater probability of being assigned the same label. Therefore, in order to improve the quality of the corrected pseudo-label, a pseudo-label correction method based on information constraints is proposed in this embodiment. Figure 3 is a flow chart of the pseudo-label correction method based on information constraints in this embodiment. Figure 3 As shown, the specific steps of the pseudo-label correction method based on information constraints in this embodiment include:
[0064] S201: Construct adjacency matrix:
[0065] Calculate the image set X T The adjacency matrix A of the image, whose element w i,j Represents image x i , x j The weight between i,j , the calculation formula is as follows:
[0066]
[0067] in, They represent the target domain feature extractor of the teacher network For image x i , x j The extracted features, in practical applications, if the pseudo-label is determined by weighted average, the feature can be the average value of M features. Representation characteristics and In this embodiment, the feature and The cosine similarity of the expanded one-dimensional vector is used as the similarity between features. σ represents the tuning parameter and e represents the natural constant.
[0068] S202: Sample division based on entropy value:
[0069] According to the pseudo label determination, each image x i The probability of belonging to category k is γ i,k Calculate the entropy value entropy(x) corresponding to each image i ):
[0070]
[0071] According to the initial pseudo label y′ of the image i Divide and obtain the image set of each category From the image collection Select the z images with the highest entropy value, and set z according to the actual situation. The screened images are used as samples with clean labels, and the remaining images are used as unlabeled samples, thereby dividing the sample set L with clean labels and the sample set U without labels.
[0072] S203: Update the label using the label propagation algorithm:
[0073] The label propagation algorithm is used to update the label of the unlabeled sample, and the clean label information is propagated from L to U by using the assumption that the adjacent points of the adjacency matrix have similar labels. Considering that the unlabeled sample already has a pseudo label y′ in step S105 i , these pseudo labels can be used as a priori information to constrain the generation of labels. Therefore, the objective function of the label propagation algorithm in this embodiment is set as follows:
[0074]
[0075] Among them, h i 、h j Represents image x i 、x j The one-hot encoding of the labels, y i represents the clean label from the set L, and μ represents the constraint parameter. Represents the label matrix consisting of the one-hot encoding of the labels of all images.
[0076] By optimizing and solving the above-mentioned label propagation target loss function based on information constraints, the correction of each image label can be completed. In this embodiment, the following optimization steps are used to obtain the corresponding closed-form solution:
[0077] 1) The first term in the loss function is further expanded as:
[0078]
[0079] Because in the constraints, when i∈L, h i =y i is a known value, so the first term is a constant, and for the second term It can be further expanded to obtain:
[0080]
[0081] In addition, is a diagonal matrix whose diagonal elements are j∈U; let the matrix The element is a ij , i∈L, j∈U, |L|, |U| represent the number of samples in set L and set U respectively. In addition, according to the constraint conditions, the first term of the above formula is also a constant, so the above formula can be further expressed as:
[0082]
[0083] in, represents the label matrix composed of the unique hot encoding of the labels of the image samples in the set U, Represents the label matrix composed of the unique hot encoding of the labels of each image sample in the set L.
[0084] Similarly, for the third item It can be further expanded to obtain:
[0085]
[0086] In addition, is a diagonal matrix whose diagonal elements are j∈U; let the matrix The element is a ij , i∈U, j∈U. Therefore, the above formula can be further expressed as:
[0087]
[0088] According to the above analysis, the objective function is finally expanded as:
[0089]
[0090] in, Represents the label matrix composed of the one-hot encoding corresponding to the pseudo labels obtained in step S105 for all images in the unlabeled sample set U.
[0091] For h U Taking partial derivatives and setting the equation equal to 0, we can obtain the closed-form solution of the objective function:
[0092]
[0093] Where I represents the identity matrix. From the label matrix h U The corrected pseudo labels of each sample in the unlabeled sample set U are extracted to complete the pseudo label correction.
[0094] S107: Training Meta-Learning Model:
[0095] For the meta-learning model, the model training loss function of the self-training teacher-student network is used as the lower-level task of meta-learning, and the confidence weight function of the meta-learning module is used as the upper-level task of meta-learning. The meta-learning model is trained using the data set, and the upper-level tasks and the lower-level tasks are iteratively updated alternately to complete the training of the meta-learning model.
[0096] The two-layer task optimization of the meta-learning module can be expressed as follows:
[0097]
[0098]
[0099] in, represents a clean data set, || represents the number of image samples in the set, x meta represents an image sample in a high-quality dataset, y meta Represents image sample x meta Tags, Represents the student network for image sample x meta The predicted label of .
[0100] Since the present invention is aimed at the image classification task without passive domain adaptation, it is impossible to obtain a clean data set for unbiased estimation. Therefore, the prediction consistency loss of the input perturbation is used as meta-knowledge to guide the learning of the meta-learning upper-level task. The expression of the meta-learning two-level optimization task based on the prediction consistency loss is as follows:
[0101]
[0102]
[0103] in, Represents the data set X T A randomly selected sub-dataset, x D Representation dataset The image samples in A(x D ) represents the image sample Image samples after data enhancement processing, They represent the student network for data sample x D And the enhanced data sample A(x D ), κ() represents the KL divergence, which is used as the prediction consistency loss to measure the input perturbation. Represents image sample x i The predicted label loss L(w) is Represents image sample x i The corresponding confidence weight.
[0104] S108: Determine whether t<t max , t max Indicates the predicted maximum number of iterations. If yes, go to step S109, otherwise go to step S110.
[0105] S109: Let t=t+1, use the parameters of the current student network to update the parameters of the teacher network, and return to step S105.
[0106] S110: Image classification using target domain model:
[0107] The student network is extracted from the final meta-learning model as the target domain model, and the target domain model is used to classify the target domain data images.
[0108] In order to better illustrate the technical effect of the present invention, the present invention is experimentally verified using specific examples. In this experimental verification, the passive domain adaptation field conventional test basic data set Office-31 is used, which consists of three different domains, including the Amazon merchant image domain (Amazon), the low-resolution image domain collected by the webcam (Webcam), and the high-resolution image domain taken by the SLR camera (DSLR). The data set contains 31 categories of common office objects, such as laptops, filing cabinets, keyboards, etc., with a total of 4652 images. In order to fully reflect the advantages of the present invention, six passive domain adaptation tasks are designed, namely Amazon→DSLR, Amazon→Webcam, DSLR→Webcam, DSLR→Amazon, Webcam→Amazon, Webcam→DSLR.
[0109] Four comparison methods were set up in this experimental verification, namely ResNet50, DANN (Domain-adversarial training of neural networks), CDAN (Conditional adversarial domain adaptation) and SHOT (Source hypothesis transfer for unsupervised domain adaptation).
[0110] The present invention is implemented by PyTorch and trained on an NVIDIA RTX3090 GPU. The teacher network and the student network in the self-training teacher-student network used in the present invention adopt ResNet50.
[0111] Table 1 is a statistical table of classification accuracy of the present invention and the comparative method under different tasks in this embodiment.
[0112]
[0113] Table 1
[0114] As shown in Table 1, it can be seen from the results in Table 1 that the present invention achieves the best results in the six adaptive tasks of the Office-31 dataset, thereby verifying the effectiveness of the present invention.
[0115] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.
Claims
1. An image classification method based on passive domain adaptation with class-guided meta-learning, characterized in that: The following steps are involved: S1: Select the trained source domain feature extractor and source domain feature classifier according to actual needs, use their parameters to initialize the target domain feature extractor and target domain feature classifier, and then copy the target domain feature extractor and target domain feature classifier, one group as the teacher network and one group as the student network, thereby forming a self-training teacher-student network; S3: Construct a category-aware meta-learning module, including a loss calculation module, a loss multi-layer perceptron, a pseudo-like accuracy calculation module, a pseudo-like accuracy multi-layer perceptron, and a confidence calculation module, where: The loss calculation module is used to calculate the predicted label loss L(w) based on the predicted label obtained by the student network for the image sample and send it to the loss multi-layer perceptron, where w represents the student network parameter; The multilayer perceptron is used to generate the corresponding sample weights according to the predicted label loss L(w) of the image sample x. θ represents the network parameters of the multi-layer perceptron, S represents the preset weight dimension, and the sample weight P(L(w),θ) is sent to the confidence weight calculation module; The class pseudo accuracy calculation module is used to calculate the class pseudo accuracy p of each image sample in K categories based on the predicted labels of all image samples by the teacher network. k And sent to the class pseudo accuracy multilayer perceptron, k = 1, 2, ..., K, K represents the number of target categories, class pseudo accuracy p k The calculation formula is as follows: in, Represents the teacher network for image sample x i The predicted label of represents a binary function, when hour otherwise Represents the target domain feature extractor in the teacher network For image x i The extracted feature vector is Represents the target domain feature classifier For the feature vector The inferred possibility, Indicates that the softmax function is used according to the possibility The obtained probability; The multilayer perceptron is used to calculate the pseudo accuracy of each image sample according to the K classes of pseudo accuracy p k Generate the category weight of the image sample Represents the network parameters of the multilayer perceptron with pseudo-accuracy class, and the class weight Send to the confidence weight calculation module; The confidence weight calculation module is used to calculate the confidence weight based on the sample weight P(L(w),θ) and the category weight Calculate the confidence weight in, Represents the dot product between two vectors; S3: The teacher network, the student network and the meta-learning module constitute a meta-learning model, wherein the teacher network and the student network predict the input image respectively to obtain the predicted label, and the meta-learning module calculates the confidence weight according to the predicted labels of the teacher network and the student network; S4: Set the number of iterations t = 1; S5: Image set X T Each image x i Input into the teacher network to get image x i The probability of belonging to category k is γ i,k , thus determining the image x i The classification result is used as the initial pseudo label y of the image i ′, thus obtaining the image set X T The corresponding pseudo label set Y T ′, i = 1, 2, ..., N, N represents the number of images, y i ′∈[1,K]; S6: Use the pseudo-label correction method to correct the pseudo-label set Y T ′ is processed to obtain each image x i Corrected pseudo label y i , thus obtaining the corrected pseudo label set Y T ; The specific steps of the pseudo-label correction method are as follows: 1) Calculate the image set X T The adjacency matrix A of the image, whose element a i,j Represents image x i , x j The weight between i,j , the calculation formula is as follows: in, They represent the target domain feature extractor of the teacher network For image x i , x j The extracted features, Representation characteristics and Similarity; σ represents the tuning parameter, e represents the natural constant; 2) According to the pseudo label determination for each image x i The probability of belonging to category k is γ i,k Calculate the entropy value entropy(x) corresponding to each image i ): According to the initial pseudo label y of the image i ′ Divide to get the image set of each category From the image collection Select the z images with the highest entropy value, z is set according to the actual situation, and the selected images are used as samples with clean labels, and the remaining images are used as unlabeled samples, so as to obtain a set of clean labeled samples L and an unlabeled sample set U; 3) The corrected labels of the image samples in the unlabeled sample set U are calculated using the following method: The following formula is used to calculate the label matrix composed of the unique hot encoding of the labels of the image samples in the set U: in, represents a diagonal matrix whose diagonal elements are is a diagonal matrix whose diagonal elements are matrix The element is a ij , i∈U,j∈U; represents the label matrix composed of the unique hot encoding of the labels of the image samples in the set U, represents the label matrix composed of the one-hot encoding corresponding to the pseudo labels obtained in step S5 for all images in the unlabeled sample set U, L, U represent the number of samples in the set L and the set U respectively, I represents the unit matrix, and μ represents the constraint parameter; From the label matrix h U Extract the corrected pseudo labels of each sample in the unlabeled sample set U, and complete the pseudo label correction; S7: For the meta-learning model, the model training loss function of the self-training teacher-student network is used as the lower-level task of meta-learning, and the confidence weight function of the meta-learning module is used as the upper-level task of meta-learning. T The meta-learning model is trained, and the upper-level tasks and the lower-level tasks are iteratively updated alternately to complete the training of the meta-learning model; S8: Determine whether t<t max , t max Indicates the maximum number of iterations predicted, if yes, go to step S9, otherwise go to step S10; S9: Let t=t+1, use the parameters of the current student network to update the parameters of the teacher network, and return to step S5; S10: Extract the student network from the final meta-learning model as the target domain model, and use the target domain model to classify the target domain data images.
2. The image classification method according to claim 1, characterized in that: In step S5, the pseudo label is determined by the following method: For image x n Perform random M enhancement processing, and then use the enhanced image x i,m Input to the teacher network to get the predicted label, m = 1, 2, ..., M, and then use the following formula to calculate the image x i The probability of belonging to category k is γ i,k : in, Target domain feature extractor representing the teacher network For image x i,m The extracted features, Target domain feature classifier representing the teacher network The predicted image x i,m The probability of belonging to category k; Selection probability γ i,k The category number corresponding to the maximum value is taken as image x i The pseudo label y i ′.
3. The image classification method according to claim 1, characterized in that: The expression of the two-layer optimization task in the meta-learning model training process in step S7 is as follows: in, Represents the data set X T A randomly selected sub-dataset, x D Representation dataset The image samples in A(x D ) represents the image sample Image samples after data enhancement processing, They represent the student network for data sample x D And the enhanced data sample A(x D ), κ() represents the KL divergence. Represents image sample x i The predicted label loss L(w) is Represents image sample x i The corresponding confidence weight.
Citation Information
Patent Citations
Noise correction algorithm driven by small-scale reliable data set
CN115578568A
Target object classification-oriented model self-enhancement method, medium and equipment
CN116977731A
Method and system for continual META-learning
WO2021068180A1
