An Active Domain Adaptation Classification Method for Hyperspectral Images Based on Prototype Alignment
By adopting the active domain adaptation method based on prototype alignment in hyperspectral image classification, the problems of high-dimensional characteristics and class imbalance are solved, and the classification performance and generalization capabilities of the model are significantly improved.
Patent Information
- Application Number
- CN202510041036.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-20
- Estimated Expiration
- 2045-01-10
AI Technical Summary
Existing active domain adaptation methods are difficult to effectively deal with the high-dimensional characteristics and spectral variability of hyperspectral images, and ignore the class imbalance problem in the target domain, resulting in a degradation of classification performance.
Using a prototype-based alignment method, the target domain prototype is obtained through pseudo-label allocation, and the cross-entropy loss and prototype alignment loss are trained. The target domain specific samples are identified and marked, and the distinction of the model is further enhanced through class balance self-training.
It effectively improves the classification performance on the target domain, alleviates the problem of category imbalance, and improves the cost-effectiveness and generalization capabilities of the model.
Smart Images

Figure CN119494989B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of hyperspectral image classification, and particularly relates to an active domain adaptation classification method for hyperspectral images based on prototype alignment. Background Art
[0002] In recent years, with the rapid development of machine learning and deep learning methods, significant progress has been made in hyperspectral image classification technology. However, these methods usually assume that the training data (source domain) and the test data (target domain) share the same distribution. In practical applications, due to factors such as imaging devices, sensor parameters, and acquisition environment differences, there is often a domain shift problem between the source domain and the target domain. This distribution difference will significantly reduce the performance of the classification model in the target domain. Especially when there is a lack of labeled data in the target domain, the generalization ability of the model is usually difficult to guarantee.
[0003] To solve the domain shift problem, domain adaptation technology has gradually been introduced into the field of hyperspectral image classification. Domain adaptation reduces the distribution difference between the source domain and the target domain, enabling the model trained from the source domain to generalize well to the target domain scenario. Especially active domain adaptation, which combines the advantages of domain adaptation and active learning, actively selects a small number of but information-rich unlabeled data in the target domain for manual annotation, significantly reducing the annotation cost while improving the model performance. This method is particularly suitable for practical application scenarios in hyperspectral image classification where it is difficult to label data in the target domain but high-precision classification is still required.
[0004] Existing active domain adaptation methods usually perform feature extraction and domain alignment based on the low-dimensional characteristics of natural images, and it is difficult to handle the high-dimensional characteristics and spectral variability of hyperspectral images. In the active sample selection stage, existing methods often only focus on the uncertainty or representativeness of samples, while ignoring the guiding role of the semantic structure in the target domain, resulting in the selection of suboptimal samples that fail to effectively capture the specific features of the target domain. In addition, most existing active domain adaptation methods ignore the class imbalance phenomenon existing in hyperspectral images. This neglect makes it difficult for the model to effectively learn the discriminative features of the minority classes, and may then result in class bias in the target domain, significantly degrading the classification performance in the imbalanced scenario. Summary of the Invention
[0005] The purpose of the present invention is to provide an active domain adaptation classification method for hyperspectral images based on prototype alignment, which can effectively improve the classification performance in the target domain with a limited annotation budget, improve the cost-effectiveness, and at the same time alleviate the class imbalance problem commonly existing in hyperspectral images.
[0006] To achieve the purpose of the present invention, the present invention provides an active domain adaptation classification method for hyperspectral images based on prototype alignment, including the following steps:
[0007] Step 1: Assign pseudo-labels to the target domain samples to obtain target domain prototypes;
[0008] Step 2: Obtain the first-stage loss function through the cross-entropy loss of the source domain, the feature-level prototype alignment loss, and the task-level prototype alignment loss;
[0009] Step 3: Identify target domain specific samples;
[0010] Step 4: Select and label samples from the target domain specific samples to obtain a labeled target domain sample set;
[0011] Step 5: Obtain the second-stage loss function through the cross-entropy loss of the labeled target domain sample set, the feature-level prototype alignment loss of the labeled target domain sample set, and the first-stage loss function;
[0012] Step 6: Obtain the class frequencies of the target domain through the labeled target domain sample set and the unlabeled target domain sample set;
[0013] Step 7: Obtain a target domain sample set for class-balanced self-training through the class frequencies of the target domain;
[0014] Step 8: Obtain the third-stage loss function through the cross-entropy loss of the target domain sample set for class-balanced self-training and the second-stage loss function.
[0015] Compared with the prior art, the significant progress of the present invention lies in: (1) By using a feature extractor with a spectral attention mechanism, the present invention enables the model to focus on spectral information with high discrimination, suppress the influence of band variability and redundant bands, and effectively solves the problems of the high-dimensional characteristics and spectral variability of hyperspectral images; (2) The present invention constructs target domain prototypes based on pseudo-labeled target domain samples, guides active sample selection through the target domain prototypes, and fully utilizes the semantic information of the target domain, enabling the model to capture the structural characteristics of the semantic distribution of the target domain; (3) The present invention performs self-training by sampling pseudo-labeled target domain samples with a balanced class distribution, further enhancing the discrimination of the model for the target domain and alleviating the class imbalance problem in the target domain.
[0016] To more clearly illustrate the functional characteristics and structural parameters of the present invention, the following further describes with reference to the accompanying drawings and specific embodiments. Description of the Drawings
[0017] The accompanying drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and the schematic embodiments and descriptions of the present invention are used to explain the present invention, and do not constitute an improper limitation to the present invention. In the drawings:
[0018] Figure 1It is a schematic diagram of the framework of the present invention;
[0019] Figure 2 It is a schematic diagram of the Pavia cross-domain dataset based on the present invention, where Figure 2 (a) is the false color image of the University of Pavia, Figure 2 (b) is the true value label of the University of Pavia, Figure 2 (c) is the false color image of Pavia Center, Figure 2 (d) is the true value label of Pavia Center;
[0020] Figure 3 It is a schematic diagram of the Houston cross-domain dataset based on the present invention, where Figure 3 (a) is the false color image of Houston 2013, Figure 3 (b) is the true value label of Houston 2013, Figure 3 (c) is the false color image of Houston 2018, Figure 3 (d) is the true value label of Houston 2018;
[0021] Figure 4 It is a schematic diagram of the Shanghai-Hangzhou cross-domain dataset based on the present invention, where Figure 4 (a) is the false color image of Shanghai, Figure 4 (b) is the true value label of Shanghai, Figure 4 (c) is the false color image of Hangzhou, Figure 4 (d) is the true value label of Hangzhou;
[0022] Figure 5 It is a schematic diagram of the classification effect of the deep learning network model of the present invention on the target domain dataset, where Figure 5 (a) is the classification effect of the deep learning network model of the present invention on Pavia Center, Figure 5 (b) is the classification effect of the deep learning network model of the present invention on Houston 2018, Figure 5 (c) is the classification effect of the deep learning network model of the present invention on Hangzhou. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments; based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] A hyperspectral image active domain adaptation classification method based on prototype alignment of the present invention, combined with Figure 1 , includes three stages:
[0025] The first stage:
[0026] 1. A hyperspectral image active domain adaptation classification method based on prototype alignment, characterized by comprising the following steps:
[0027] Step 1: Assign pseudo labels to target domain samples to obtain target domain prototypes;
[0028] 1.1、Get source domain prototype through source domain samples:
[0029] ;
[0030] Among them, Indicates category 's source domain prototype, means belonging to the category The number of source domain samples, means all belonging to the category In the source domain sample of , the L2 normalized feature vector of samples;
[0031] 1.2. Predict the target domain sample through the classifier to obtain the first pseudo label;
[0032] 1.3. Obtain the remaining pseudo labels based on the source domain prototype closest to the target domain sample and K source domain samples;
[0033] 1.4. Filter the target domain samples whose first pseudo-label is the same as the remaining pseudo-labels to obtain high-confidence target domain samples; obtain the target domain prototype through the high-confidence target domain samples:
[0034] ;
[0035] Among them, Indicates category Target domain prototype, means belonging to the category The number of target domain samples, means all belonging to the category In the target domain sample of L2 normalized feature vector of samples.
[0036] Step 2: Obtain the first-stage loss function through the cross entropy loss of the source domain, the feature-level prototype alignment loss, and the task-level prototype alignment loss;
[0037] 2.1. According to the distance between each sample and the source domain prototype and the target domain prototype of its category, the feature-level prototype alignment loss is obtained :
[0038] ;
[0039] Among them, represents the number of source domain samples, represents the th L2-normalized feature vector of the source domain sample, represents the th label of the source domain sample, represents the number of the high-confidence target domain samples, represents the th L2-normalized feature vector of the high-confidence target domain sample, represents the th pseudo-label of the high-confidence target domain sample;
[0040] 2.2. Input the distances between the target domain samples and the target domain prototypes of each category into the softmax function to obtain the class probability distribution predicted by the target domain prototypes for the target domain samples , and the th element of the class probability distribution is expressed as:
[0041] ;
[0042] Among them, represents the Euclidean distance; the class probability distribution predicted by the source domain prototypes for the target domain samples is obtained in a similar way as the above formula;
[0043] 2.3. Measure the difference between the class probability distribution predicted by the source domain prototypes for the target domain samples and the class probability distribution predicted by the target domain prototypes for the target domain samples through the KL-divergence to obtain the task-level prototype alignment loss :
[0044] ;
[0045] Among them, represents the source domain, represents the target domain, represents the pairwise KL-divergence;
[0046] 2.4. Obtain the first-stage loss function :
[0047] ;
[0048] Among them, represents the cross-entropy loss of the source domain.
[0049] Second stage:
[0050] Step 3: Identify target domain specific samples;
[0051] 3.1. Obtain the prototype-based prediction label according to the class probability distribution predicted for the target domain samples by the target domain prototype ; ;
[0052] 3.2. Pass the target domain samples through the classifier to predict the classifier-based prediction label ;
[0053] 3.3. Obtain the target domain specific samples by selecting the target domain samples where the classifier-based prediction label and the prototype-based prediction label are inconsistent.
[0054] Step 4: Select and label samples from the target domain specific samples to obtain the labeled target domain sample set;
[0055] 4.1. Combine the classifier-based prediction label and the prototype-based prediction label of the target domain specific samples to obtain the label pair of the target domain specific samples;
[0056] 4.2. Quantify the uncertainty of the samples under each label pair of the target domain specific samples by the difference between the highest prediction probability and the second highest prediction probability of the classifier:
[0057] ;
[0058] Among them, represents the highest prediction probability of the classifier for the sample , represents the second highest prediction probability of the classifier for the sample ; when is smaller, the uncertainty of the sample is higher; select the sample with the highest uncertainty in each label pair to obtain the uncertain sample subset of each label pair;
[0059] 4.3. Calculate the maximum mean square difference between the samples in the uncertain sample subset of each label pair and itself to obtain the representative measure of the samples in the uncertain sample subset of each label pair:
[0060] ;
[0061] Among them, represents the maximum mean squared difference, represents the pair of labels of the subset of uncertain samples, represents the radial basis function kernel, represents the feature extractor;
[0062] 4.4. Calculate the maximum mean squared difference between the samples in the subset of uncertain samples of each pair of labels and the samples that have been selected before and belong to the same pair of labels, to obtain the diversity measure of the samples in the subset of uncertain samples of each pair of labels; subtract the diversity measure of the samples in the subset of uncertain samples of each pair of labels from the representative measure of the samples in the subset of uncertain samples of each pair of labels, to obtain the comprehensive measure of the samples in the subset of uncertain samples of each pair of labels:
[0063] ;
[0064] Among them, represents the comprehensive measure, represents the set of all samples that have been selected before and belong to the pair of labels ; Hand over the samples with the smallest comprehensive measure in the subset of uncertain samples of each pair of labels to the expert for annotation, to obtain the annotated target domain sample set.
[0065] Step 5. Obtain the second-stage loss function through the cross-entropy loss of the annotated target domain sample set, the feature-level prototype alignment loss of the annotated target domain sample set, and the first-stage loss function: The second-stage loss function :
[0066] ;
[0067] Among them, represents the cross-entropy loss of the annotated target domain sample set, represents the feature-level prototype alignment loss of the annotated target domain sample set.
[0068] The third stage:
[0069] Step 6. Obtain the class frequencies of the target domain through the annotated target domain sample set and the unannotated target domain sample set;
[0070] 6.1. Determine the number of samples of each category in the annotated target domain sample set:
[0071] ;
[0072] Among them, represents the number of samples belonging to class in the labeled target domain sample set, represents the labeled target domain sample set, represents the indicator function;
[0073] 6.2. Calculate the number of samples of each class in the unlabeled target domain sample set by weighted calculation of the prediction probabilities of the classifier for the unlabeled target domain sample set:
[0074] ;
[0075] Among them, represents the number of samples belonging to class in the unlabeled target domain sample set, represents the unlabeled target domain sample set, represents the classifier, represents the -dimensional vector output by softmax as the
[0076] ;
[0077] 6.3. Add the number of samples belonging to class in the labeled target domain sample set and the number of samples belonging to class in the unlabeled target domain sample set, and then divide by the total number of samples in the target domain to obtain the class frequency of the target domain:
[0078] ;
[0079] Among them, represents the frequency of class in the target domain, represents the number of samples in the labeled target domain sample set.
[0080] Step 7. Obtain the target domain sample set for class-balanced self-training through the class frequencies of the target domain;
[0081] 7.1. Sample samples with a proportion of from the samples of the class with the lowest frequency;
[0082] 7.2. Calculate the sampling proportion of samples of classes with higher frequencies:
[0083] ;
[0084] Among them, represents the sampling ratio of the category , and represents the frequency of the category with the lowest category frequency, and represents the parameter for controlling the sampling ratio of the category
[0085] 7.3. Sample the samples with the highest predicted probability of the classifier from each category sample to obtain the target domain sample set for class-balanced self-training.
[0086] Step 8. Obtain the third-stage loss function through the cross-entropy loss of the target domain sample set for class-balanced self-training and the second-stage loss function :
[0087] ;
[0088] Among them, represents the cross-entropy loss of the target domain sample set for class-balanced self-training.
[0089] By comparing the classification effect of the deep neural network classification model obtained by the hyperspectral image active domain adaptation classification method based on prototype alignment and class-balanced training described in the present invention with the active domain adaptation methods such as active adversarial domain adaptation (abbreviated as AADA), selection by unique margin (abbreviated as SDM), label distribution matching by density-aware active sampling (abbreviated as LAMDA), local context-aware active domain adaptation (abbreviated as LADA), domain adaptation based on class-matching contrastive learning (abbreviated as CLCM), class prototype-guided alignment network (abbreviated as CPGAN), masked self-distillation domain adaptation (abbreviated as MSDA), and easy-to-difficult domain adaptation with human expert intervention (abbreviated as IEH-DA) in the prior art, as well as hyperspectral image classification methods, three pairs of cross-domain datasets are selected in this embodiment: University of Pavia and Pavia Center (Pavia), Houston 2013 and Houston 2018 (Houston), Shanghai and Hangzhou (Shanghai-Hangzhou). The target domains of the selected cross-domain datasets are classified using the above methods respectively to obtain the classification accuracy. At the same time, the classification accuracy of the target domain datasets involved in this embodiment is further compared using the deep neural network classification model obtained by the hyperspectral image active domain adaptation classification method based on prototype alignment and class-balanced training (abbreviated as PCADA) described in this application. To ensure the fairness of the comparison, all methods are trained using 180 labeled samples randomly selected from each class in the source domain and all unlabeled target domain samples. For the Pavia cross-domain dataset, 30 samples are selected from the target domain for annotation, while for the Houston and Shanghai-Hangzhou cross-domain datasets, the number of annotated target domain samples is 40. The random sampling effect is eliminated by repeating the experiment ten times. The experimental results use the overall classification accuracy (OA), average classification accuracy (AA), and Kappa coefficient as the measurement indicators. The higher the values of the three indicators, the better the classification performance. The results are shown in the figure below. On the Pavia cross-domain dataset, the OA of PCADA is 95.06 0.57(%), which is improved by 10.39% - 1.56% compared with other methods. On the Houston cross-domain dataset, the OA of PCADA is 85.24 2.01(%), which is 25.63% - 2.61% higher than other methods. On the Shanghai-Hangzhou cross-domain dataset, PCADA also achieves the best classification performance compared with other comparison methods. In addition, the AA and Kappa of the present invention are also significantly improved.
[0090] By such as Figure 2 showing the first validation dataset used to verify the effectiveness of the algorithm proposed in the present invention, this dataset provides training samples and test samples for the algorithm proposed in the present invention, where, Figure 2(a) is the false-color image of the University of Pavia, which provides training data for the algorithm proposed by the present invention; Figure 2 (b) is the ground truth label of the University of Pavia, which provides supervision information for the algorithm proposed by the present invention; Figure 2 (c) is the false-color image of the Pavia Center, which provides training data and test data for the algorithm proposed by the present invention; Figure 2 (d) is the ground truth label of the Pavia Center, which is used to evaluate the performance of the algorithm proposed by the present invention.
[0091] Further, as Figure 3 shows the second validation dataset used to verify the effectiveness of the algorithm proposed by the present invention. This dataset provides training samples and test samples for the algorithm proposed by the present invention. Among them, Figure 3 (a) is the false-color image of Houston 2013, which provides training data for the algorithm proposed by the present invention; Figure 3 (b) is the ground truth label of Houston 2013, which provides supervision information for the algorithm proposed by the present invention; Figure 3 (c) is the false-color image of Houston 2018, which provides training data and test data for the algorithm proposed by the present invention; Figure 3 (d) is the ground truth label of Houston 2018, which is used to evaluate the performance of the algorithm proposed by the present invention.
[0092] Even further, as Figure 4 shows the third validation dataset used to verify the effectiveness of the algorithm proposed by the present invention. This dataset provides training samples and test samples for the algorithm proposed by the present invention. Among them, Figure 4 (a) is the false-color image of Shanghai, which provides training data for the algorithm proposed by the present invention; Figure 4 (b) is the ground truth label of Shanghai, which provides supervision information for the algorithm proposed by the present invention; Figure 4 (c) is the false-color image of Hangzhou, which provides training data and test data for the algorithm proposed by the present invention; Figure 4 (d) is the ground truth label of Hangzhou, which is used to evaluate the performance of the algorithm proposed by the present invention.
[0093] As Figure 5 shows the classification results of the algorithm proposed by the present invention. Among them, Figure 5 (a) is the classification effect of the algorithm proposed by the present invention on the Pavia Center, Figure 5 (b) is the classification effect of the algorithm proposed by the present invention on Houston 2018, Figure 5 (c) is the classification effect of the algorithm proposed by the present invention on Hangzhou.
[0094] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variation thereof are intended to cover non-exclusive inclusion, such that a process, method, article or apparatus comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or elements inherent to such process, method, article or apparatus.
[0095] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A hyperspectral image active domain adaptation classification method based on prototype alignment, characterized in that: The following steps are involved: Step 1: Assign pseudo labels to target domain samples to obtain target domain prototypes; Step 2: Obtain the first-stage loss function through the cross entropy loss of the source domain, the feature-level prototype alignment loss, and the task-level prototype alignment loss; Step 3: Identify target domain specific samples; Step 4: Select and label samples from the target domain specific samples to obtain a labeled target domain sample set; Step 5: Obtain a second-stage loss function by using the cross entropy loss of the labeled target domain sample set, the feature-level prototype alignment loss of the labeled target domain sample set, and the first-stage loss function; Step 6: Obtain the category frequency of the target domain through the labeled target domain sample set and the unlabeled target domain sample set; Step 7: Obtain a target domain sample set for class-balanced self-training through the category frequency of the target domain; Step 8: Obtain a third-stage loss function by using the cross entropy loss of the target domain sample set for class-balanced self-training and the second-stage loss function.
2. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 1 is characterized in that: The step 1 specifically The following steps are involved: 1.
1. Obtain source domain prototype through source domain samples: ; in, Indicates category The source domain prototype, Indicates that it belongs to the category The number of source domain samples, Indicates all belonging to the category The source domain samples L2 normalized feature vector of samples; 1.
2. Use the classifier to predict the target domain sample and obtain the first pseudo label; 1.
3. Obtain the remaining pseudo labels based on the source domain prototype closest to the target domain sample and K source domain samples; 1.
4. Filter the target domain samples whose first pseudo-label is the same as the remaining pseudo-labels to obtain high-confidence target domain samples; obtain the target domain prototype through the high-confidence target domain samples: ; in, Indicates category The target domain prototype, Indicates that it belongs to the category The number of target domain samples, Indicates all belonging to the category In the target domain sample The L2-normalized feature vector of samples.
3. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 2 is characterized in that: The step 2 specifically The following steps are involved: 2.
1. According to the distance between each sample and the source domain prototype and the target domain prototype of its category, the feature-level prototype alignment loss is obtained : ; in, represents the number of source domain samples, Indicates The L2-normalized feature vector of source domain samples, Indicates The labels of source domain samples, represents the number of high confidence target domain samples, Indicates The L2 normalized feature vector of the high confidence target domain samples, Indicates Pseudo labels of the high-confidence target domain samples; 2.
2. Target Domain Samples The distance between the target domain prototype and each category is input into the softmax function to obtain the distance between the target domain prototype and the target domain sample. Predicted class probability distribution , the class probability distribution No. Elements It is expressed as: ; in, Represents the Euclidean distance; the source domain prototype is obtained by a method similar to the above formula to the target domain sample Predicted class probability distribution ; 2.
3. Measure the source domain prototype against the target domain sample by KL-divergence Predicted class probability distribution and the target domain prototype to the target domain sample Predicted class probability distribution The difference between them gives the task-level prototype alignment loss : ; in, represents the source domain, represents the target domain, represents the pairwise KL-divergence; 2.
4. The first-stage loss function is obtained by using the cross entropy loss of the source domain, the feature-level prototype alignment loss, and the task-level prototype alignment loss. : ; in, represents the cross entropy loss of the source domain.
4. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 3 is characterized in that: The step 3 is specifically The following steps are involved: 3.
1. According to the target domain prototype, the target domain sample Predicted class probability distribution Get the predicted label based on the prototype ; 3.
2. The target domain samples Get the predicted label based on the classifier through the classifier prediction ; 3.
3. Target domain specific samples are obtained by selecting target domain samples whose predicted labels based on the classifier and the predicted labels based on the prototype are inconsistent.
5. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 4 is characterized in that: The step 4 specifically comprises the following steps: 4.
1. Combining the classifier-based predicted label and the prototype-based predicted label of the target domain specific sample to obtain a label pair of the target domain specific sample; 4.
2. The uncertainty of each sample under the label pair of the target domain specific sample is quantified by the difference between the highest prediction probability and the second highest prediction probability of the classifier: ; in, Represents the classifier for the sample The highest predicted probability, Represents the classifier for the sample The second highest predicted probability is The smaller the sample The higher the uncertainty, the higher the uncertainty; the highest uncertainty in each label pair Samples are selected to obtain a subset of uncertain samples for each label pair; 4.
3. Calculate the maximum square mean difference between the samples in the uncertain sample subset of each label pair and the samples themselves, and obtain the representativeness measure of the samples in the uncertain sample subset of each label pair: ; in, represents the maximum mean square difference, Represents a tag pair The uncertain sample subset, represents the radial basis function kernel, represents a feature extractor; 4.
4. Calculate the maximum square mean difference between the samples in the uncertain sample subset of each label pair and the previously selected samples belonging to the same label pair to obtain the diversity measure of the samples in the uncertain sample subset of each label pair; subtract the diversity measure of the samples in the uncertain sample subset of each label pair from the representative measure of the samples in the uncertain sample subset of each label pair to obtain the comprehensive measure of the samples in the uncertain sample subset of each label pair: ; in, Represents a comprehensive measure, Indicates that it was previously selected and belongs to the tag pair The set of all samples of ; the sample with the smallest comprehensive metric in the uncertain sample subset of each label pair is handed over to experts for labeling to obtain a labeled target domain sample set.
6. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 5 is characterized in that: The second stage loss function of step 5 : ; in, represents the cross entropy loss of the labeled target domain sample set, represents the feature-level prototype alignment loss of the labeled target domain sample set.
7. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 6 is characterized in that: The step 6 specifically The following steps are involved: 6.
1. Determine the number of samples in each category in the labeled target domain sample set: ; in, Indicates that the labeled target domain sample set belongs to the category The number of samples, represents the labeled target domain sample set, represents the indicator function; 6.
2. The predicted probability of the classifier for the unlabeled target domain sample set is calculated by weighted calculation to obtain the number of samples in each category in the unlabeled target domain sample set: ; in, Indicates that the unlabeled target domain sample set belongs to the category The number of samples, represents the unlabeled target domain sample set, represents the classifier, express Dimensional vector The output after softmax is Elements: ; 6.
3. The labeled target domain sample set belongs to the category The number of samples and the number of samples in the unlabeled target domain sample set belonging to the category Add the number of samples of the target domain and divide it by the total number of samples in the target domain to get the category frequency of the target domain: ; in, Represents the category in the target domain The frequency, Represents the number of samples in the labeled target domain sample set.
8. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 7 is characterized in that: The step 7 specifically includes the following steps: 7.
1. The sampling ratio from the samples of the lowest frequency category is Samples of 7.
2. Calculate the sampling ratio of samples of the more frequent categories: ; in, Indicates category The sampling ratio, represents the frequency of the category with the lowest category frequency, Indicates control category The sampling ratio parameters; 7.
3. Sample the samples with the highest classifier prediction probability from each category of samples to obtain the target domain sample set for class-balanced self-training.
9. The active domain adaptation classification method for hyperspectral images based on prototype alignment according to claim 8, characterized in that: The third stage loss function of step 8 : ; in, represents the cross entropy loss on the set of target domain samples used for class-balanced self-training.
10. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Domain adaptation image classification method based on feature and label space dynamic alignment
CN114282602A
Image classification method and system based on label noise domain self-adaption
CN114842267A