Hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation
By employing conditional alignment and pseudo-label generation, the problem of low cross-scene accuracy in hyperspectral image classification was solved. Conditional distribution alignment between the source and target domains was achieved using CMDD, SpePL, and PPUN, thereby improving classification accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUZHOU UNIVERSITY
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-30
AI Technical Summary
Existing hyperspectral image classification methods have low accuracy in cross-scene applications, especially in unlabeled or poorly labeled target domains, where it is difficult to effectively align the conditional distributions of the source and target domains, resulting in poor classification performance.
We propose a conditional alignment and pseudo-label generation method based on unsupervised domain adaptation. We explicitly model the directional differences of domain category features through Conditional Maximum Directional Difference (CMDD), and combine spectral pseudo-labels (SpePL) and spatial pseudo-labels (SpaPL) with the Pixel Patch Unified Network (PPUN) to achieve end-to-end distribution alignment and pseudo-label generation.
It significantly improves the accuracy of hyperspectral image classification across scenes, and can adapt to different spatial resolutions and spectral characteristics, achieving efficient and flexible classification result output.
Smart Images

Figure CN122313136A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a hyperspectral image classification method. Background Technology
[0002] Each pixel of a hyperspectral image is typically represented by a spectral vector consisting of tens to hundreds of narrow bands distributed in the range of 0.4μm-2.5μm. The value corresponds to the electromagnetic intensity at each wavelength, from which some properties of the observed object can be accurately revealed [1](Ghamisi P, Yokoya N, Li J, et al. Advances in hyperspectral image and signal processing: A comprehensive overview of the state of the art[J]. IEEE Geoscience and Remote Sensing Magazine, 2018, 5(4):37-78.). The valuable information contained in hyperspectral images has led to their application in a wide range of fields[2](Paoletti ME, Haut JM, Plaza J, et al. Deep learning classifiers for hyperspectral imaging: A review[J]. ISPRS Journal of Photogrammetry and Remote Sensing, 2019, 158: 279-317.), such as agriculture[3](Guerri MF, Distante C, Spagnolo P, et al. Deep learning techniques for hyperspectral image analysis in agriculture: A review[J]. ISPRS Open Journal of Photogrammetry and RemoteSensing, 2024, 12: 100062.) and medical diagnosis[4](Khan MJ, Khan HS, Yousaf A, et al. Modern trends in hyperspectral image analysis: A review[J]. Ieee Access, 2018, 6: 14118-14129.). In Earth hyperspectral imagery observations, hyperspectral images are typically acquired by hyperspectral instruments mounted on satellites or spacecraft. These instruments image sunlight reflected from objects on the ground at a certain altitude, thus covering a considerable geographical area. Classification is a mainstream task in Earth hyperspectral imagery observations; however, due to the vastness of the imaging area, labeling hyperspectral images is a laborious and time-consuming field effort.A natural idea is to use already labeled data to classify unlabeled hyperspectral images. However, the various imaging conditions of different hyperspectral images lead to a breach of the independent and identically distributed (i.i.d.) assumption. Fortunately, domain adaptation can effectively address this problem. The labeled data is called the source domain, and the data with no labels or only a few labels is called the target domain. The domain adaptation task aims to align the distributions of the source and target domains, allowing the model to classify the target domain in the same way it classifies the source domain.
[0003] Specifically, based on the availability of target domain labels, it is divided into semi-supervised domain adaptation and unsupervised domain adaptation. Semi-supervised domain adaptation refers to the source domain having data and sufficient labels, and the target domain having data and a small number of labels. Unsupervised domain adaptation refers to the source domain having data and sufficient labels, and the target domain having only data but no labels. It is more in line with the situation encountered in real-world applications [5](Peng J, Huang Y, Sun W, et al. Domain adaptation in remote sensing imageclassification: A survey[J]. IEEE Journal of Selected Topics in Applied EarthObservations and Remote Sensing, 2022, 15: 9842-9859.), which is also what this invention aims to study. The distribution to be aligned in unsupervised domain adaptation refers to the joint distribution. It can be viewed as a marginal distribution. and conditional distribution The product of: Therefore, as long as the marginal distributions and conditional distributions between domains are aligned, the alignment of distributions between domains can be achieved. Although the marginal distributions and conditional distributions between domains are generally different in reality [6](Zhang K, Schölkopf B, Muandet K, et al. Domain adaptation undertarget and conditional shift[C] / / International conference on machine learning. Pmlr, 2013: 819-827.), many proposed domain adaptation techniques assume that the marginal distributions between domains are different and the conditional distributions are the same or similar, and focus on the alignment of marginal distributions [7](Farahani A, Voghei S, Rasheed K, et al. A brief review of domain adaptation[J]. Advancesin data science and information engineering: proceedings from ICDATA 2020 and IKE 2020, 2021: 877-894.).Almost all instance-based domain adaptations adopt this assumption and align marginal distributions by addressing the covariate shift problem or the sample selection bias [5][8](Gretton A, Smola A, Huang J, et al. Covariate shift by kernel mean matching[J]. Dataset shift in machine learning, 2009, 3(4): 5.)[9](Huang J, Gretton A, Borgwardt K, et al. Correcting sample selection bias by unlabeled data[J]. Advances in neural information processing systems, 2006, 19.)
[10] (Sugiyama M, Nakajima S, Kashima H, et al. Direct importance estimation with model selection and its application to covariate shift adaptation[J]. Advances in neural information processing systems, 2007, 20.)
[11] (Sugiyama M, Suzuki T, Nakajima S, et al. Direct importance estimation for covariate shift adaptation[J]. Annals of the Institute of Statistical Mathematics, 2008, 60(4): 699-746.).In the transformation-based method, Pan et al.
[12] (Pan SJ, Tsang IW, Kwok JT, et al. Domain adaptation via transfer component analysis[J]. IEEE transactions on neural networks, 2010, 22(2): 199-210.) proposed Transfer component adaptation (TCA), which uses the MMD index
[13] (Gretton A, Borgwardt KM, Rasch MJ, et al. Akernel two-sample test[J]. The journal of machine learning research, 2012, 13(1): 723-773.)
[14] (Gretton A, Borgwardt K, Rasch M, et al. A kernel method for the two-sample-problem[J]. Advances in neural information processing systems, 2006, 19.) is used to measure the mean distance between domains. By minimizing MMD, the marginal distributions between domains are aligned and a domain-invariant feature transformation is learned. It is assumed that the conditional distributions of the source and target domains after the domain-invariant feature transformation are approximately equal.In deep domain adaptation, some early methods
[15] (Long M, Cao Y, Wang J, et al. Learning transferable features with deep adaptation networks[C] / / International conference on machine learning. PMLR, 2015: 97-105.)
[16] (Sun B, Saenko K. Deep coral: Correlation alignment for deep domain adaptation[C] / / European conference on computer vision. Cham: Springer InternationalPublishing, 2016: 443-450.)
[17] (Ganin Y, Lempitsky V. Unsupervised domainadaptation by backpropagation[C] / / International conference on machinelearning. PMLR, 2015: 1180-1189.)
[18] (Ganin Y, Ustinova E, Ajakan H, et al. Domain-adversarial training of neural networks[J]. Journal of machinelearning research, 2016, 17(59): 1-35.) Focus only on the problem of aligning the edge distribution of the domain. Long et al.
[15] proposed the Deep Domain Adaptation Network (DAN), which applies multiple MK-MMD metrics to multiple adaptation layers of the deep neural network to align the edge distribution. Sun et al.
[16] embedded CORAL
[19] (Sun B, Feng J, Saenko K. Return offrustratingly easy domain adaptation [C] / / Proceedings of the AAAI conference on artificial intelligence. 2016, 30(1).) into the deep network and proposed the Deep CORAL method, which aligns the edge distribution by minimizing the difference in the second-order statistic covariance between the features of the source domain and the target domain.In adversarial domain adaptation, Ganin et al.
[17]
[18] proposed adversarial domain adaptation neural networks (DANN), whose adversarial nature is based on the domain discriminator. It learns domain-invariant feature representations through the idea of generative adversarial networks
[20] (Goodfellow IJ, Pouget-Abadie J, Mirza M, et al. Generative adversarial nets[J]. Advances in neural information processing systems, 2014, 27.) to align edge distributions in a non-metric way.
[0004] Although some studies
[21] (Belkin M, Niyogi P, Sindhwani V. Manifold regularization: A geometric framework for learning from labeled and unlabeled examples[J]. Journal of machine learning research, 2006, 7(11).)
[22] (Gong M, Zhang K, Liu T, et al. Domain adaptation with conditional transferable components[C] / / International conference on machine learning. PMLR, 2016:2839-2848.) support that aligning only the marginal distributions can guarantee the alignment of the conditional distributions, this requires the fulfillment of appropriate assumptions and conditions, which are difficult to fully satisfy in reality. This also leads to the fact that the method of aligning only the marginal distributions cannot handle many real-world tasks well. The assumptions it relies on not only contradict the real situation, but more importantly, it escapes the most fundamental goal of domain adaptation: aligning the conditional distributions. Consider an ideal domain adaptation model, whose ultimate goal is to learn the true conditional distribution of the target domain. Given any target domain sample X, output the corresponding label. Imagine that if the conditional distributions of the source and target domains are well aligned, then theoretically, an ideal classifier could exist that achieves good results in both domains, even if the marginal distributions still differ significantly. Conversely, if the conditional distributions between the domains are not well aligned, it will directly affect the classifier's classification performance in the target domain, even if the marginal distributions of both are identical. Therefore, for domain adaptation tasks, the alignment of conditional distributions is more fundamental and important than the alignment of marginal distributions.
[0005] However, aligning conditional distributions is non-trivial for unsupervised domain adaptation. Alignment of conditional distributions requires the participation of target domain labels, but the target domain has no labels. Most studies alleviate this thorny problem by generating pseudo-labels of the target domain as proxies for the real labels, thus enabling alignment of conditional distributions. Long et al.
[23] (Long M, Wang J, Ding G, et al. Transfer feature learning with joint distribution adaptation[C] / / Proceedings of the IEEE international conference on computervision. 2013: 2200-2207.) proposed Joint Distribution Adaptation (JDA), which simultaneously aligns marginal and conditional distributions. They also proposed Conditional MMD as a measure of the difference in conditional distributions. The target domain pseudo-labels required for Conditional MMD are generated through the transformation matrix, and an iterative method is used to enhance the quality of the pseudo-labels. Wang et al.
[24] (Wang J, Chen Y, Hao S, et al. Balanced distribution adaptation for transfer learning[C] / / 2017 IEEE international conference on data mining (ICDM). IEEE, 2017: 1129-1134.) made improvements to JDA in terms of the importance balance between marginal and conditional distributions and the class balance. In deep domain adaptation, researchers mainly use adversarial learning or Statistics Matching-based methods to implicitly or explicitly align conditional distributions
[25] (Jiang J, Shu Y, Wang J, et al. Transferability in deep learning: A survey[J]. arXiv preprint arXiv:2201.05867, 2022.).In adversarial learning-based methods, Saito et al.
[26] (Saito K, Watanabe K, Ushiku Y, et al. Maximum classifier discrepancy for unsupervised domain adaptation[C] / / Proceedings of the IEEE conference on computer vision and pattern recognition. 2018: 3723-3732.) proposed the Maximum Classifier Discrepancy (MCD) method, which fixes the parameters of either the generator or the classifier and performs adversarial learning on the discrepancy between the two classifiers, thereby achieving implicit alignment of conditional distributions between domains. Including the multi-adversarial domain adaptation proposed by Pei et al.
[27] (Pei Z, Cao Z, Long M, et al. Multi-adversarial domain adaptation[C] / / Proceedings of the AAAI conference on artificial intelligence. 2018, 32(1).), the regularized conditional alignment proposed by Cicek et al.
[28] (Cicek S, Soatto S. Unsupervised domain adaptation via regularized conditional alignment[C] / / Proceedings of the IEEE / CVF internationalconference on computer vision. 2019: 1416-1425.), and the conditional adversarial adaptive network (CDAN) proposed by Long et al.
[29] (Long M, Cao Z, Wang J, et al. Conditional adversarial domain adaptation[J].Advances in neural information processing systems, 2018, 31.), they all achieve implicit alignment of conditional distributions between domains through adversarial learning.In statistical matching-based methods, Long et al.
[30] (Long M, Zhu H, Wang J, et al. Deeptransfer learning with joint adaptation networks[C] / / International conference on machine learning. PMLR, 2017: 2208-2217.) proposed Joint Adaptation Networks (JAN), which uses JMMD to align the joint distribution of feature and category predictions, thereby achieving alignment of conditional distributions. Kang et al.
[31] (Kang G, Jiang L, Yang Y, et al. Contrastive adaptation network for unsupervised domain adaptation[C] / / Proceedings of the IEEE / CVF conference on computer vision and pattern recognition. 2019: 4893-4902.) proposed Contrastive Adaptation Difference (CAD) in the Contrastive Adaptation Network (CAN). Based on the MMD, it constructs intra-class MMD and inter-class MMD by matching intra-class and inter-class MMD. By reducing the intra-class mean distance and increasing the inter-class mean distance, it aligns the conditional distribution. The pseudo-label of the target domain is given by K-means clustering. Zhu et al.
[32] (Zhu Y, Zhuang F, Wang J, et al. Deep subdomain adaptation network for image classification[J]. IEEE transactions on neural networks and learning systems, 2020, 32(4): 1713-1722.) proposed the Deep Subdomain Adaptation Network (DSAN), which uses LocalMMD as a measure of conditional distribution between domains. It is similar to the Conditional MMD proposed by Long et al. in JDA. The difference between the two is that LocalMMD considers the soft label of the target domain.
[0006] To our knowledge, broadly speaking, most domain adaptation methods for aligning conditional distributions directly use classifier predictions as proxies for the true labels in the target domain. However, because the accuracy of the pseudo-labels output by the classifier is very low in the very early stages of training, and only gradually improves after a certain number of training epochs of initial alignment, this problem makes it impossible to effectively align conditional distributions in the early stages of training. Furthermore, for deep domain adaptation based on statistical matching, the current mainstream methods are almost all MMD and its variants. MMD measures mean difference, which may lead to semantic ambiguity in high-dimensional cases, thus affecting the alignment effect of conditional distributions.
[0007] In hyperspectral image classification, although it is a pixel-level classification task, the category of a pixel depends not only on the spectral information of the pixel itself, but also on the contextual information formed by the central pixel and other pixels in the surrounding space. This information is called spatial information in hyperspectral image classification. For cross-domain classification tasks, different imaging heights or devices will result in different spatial resolutions in the source and target domains.Studies
[33] (Kondylatos S, Bountos NI, Michail D, et al. On the Generalization of Representation Uncertainty in Earth Observation[J]. arXiv preprint arXiv:2503.07082, 2025.) have shown that the closer the spatial resolution, the better the effect. However, many current methods
[34] (Yu C,Liu C, Yu H, et al. Unsupervised domain adaptation with dense-based compaction for hyperspectral imagery[J]. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 2021, 14: 12287-12299.)
[35] (Liu Z, Ma L, Du Q. Class-wise distribution adaptation for unsupervised classification of hyperspectral remote sensing images[J]. IEEE Transactions on Geoscience and Remote Sensing, 2020, 59(1): 508-521.)
[36] (Yu C, Liu C, Song M, et al. Unsupervised domain adaptation with content-wise alignment for hyperspectral imagery classification[J]. IEEE Geoscience and Remote Sensing Letters, 2021, 19: 1-5.) The source and target domain samples can only take the patch block size preset inside the model, which leads to the restriction and constraint of the context features of the center pixel, thus weakening the alignment effect between the source and target domains.Some researchers
[37] (Wittich D, Rottensteiner F. Appearance based deep domain adaptation for the classification of aerial images[J]. ISPRS Journal of Photogrammetry and Remote Sensing, 2021, 180: 82-102.) have used data preprocessing to unify the spatial resolution before model training, but this is not end-to-end and makes the method bloated. Therefore, a more flexible model design is needed.
[0008] Since the patch format introduces spatial information of the domains, and there are often huge differences in spatial information between domains, the spatial information of the source domain can hardly help in the classification of the target domain. Therefore, the learning and representation of spatial information with strong generalization between domains is needed.The first law of geography
[43] (Tobler W R. A computer movie simulating urban growth in the Detroit region [J]. Economic geography, 1970, 46(sup1):234-240.) is very valuable in solving this problem. The first law of geography: "everything is related to everything else, but near things are more related than distant things." Some scholars
[44] (Li W, Wu G, Zhang F, et al. Hyperspectral image classification using deep pixel-pair features [J]. IEEE Transactions on Geoscience and Remote Sensing, 2016, 55(2): 844-853.)
[45] (Lv X, Ming D, Lu T, et al. A new method for region-based majority voting CNNs for very high resolution image classification [J]. Remote Sensing, 2018, 10(12): 1946.)
[46] (Zhan Y, Qin J, Huang T, et al. Hyperspectral Image classification based on generative adversarial networks with feature fusing and dynamic neighborhood voting mechanism [C] / / IGARSS 2019-2019 IEEE International Geoscience and Remote Sensing Symposium. IEEE, 2019: 811-814.) By calculating the category of each pixel in the patch and then using a voting method to calculate the category with the largest proportion as the category of the center pixel, although the first law of geography is introduced, it is not end-to-end, and the model can only give the category of one pixel in each inference. To obtain the categories of all pixels in the patch, multiple inferences are required.Therefore, how the model can learn the first law of geography end-to-end and efficiently compute each pixel in the patch remains a challenge. Summary of the Invention
[0009] The purpose of this invention is to address the problem of low accuracy in existing cross-scene hyperspectral image classification methods, and to propose a hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation.
[0010] The specific process of the hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation is as follows:
[0011] Step 1: Obtain source and target domain data;
[0012] Step 2: Construct the pixel patch unified network model PPUN;
[0013] The pixel patch unified network model PPUN consists of an encoder PPUE, a global average pooling algorithm (Avgpool), and a classifier PPUC.
[0014] Step 3: Train the pixel patch unified network model PPUN based on the source domain and target domain data from Step 1 to obtain the trained pixel patch unified network model PPUN.
[0015] Step 4: Input the target domain data into the trained Pixel Patch Unified Network Model (PPUN), and the trained Pixel Patch Unified Network Model (PPUN) will output the classification results.
[0016] The beneficial effects of this invention are as follows:
[0017] A bottleneck in cross-scene hyperspectral image classification stems from domain offset, posing a significant challenge to applying models to new, unlabeled scenes. Unsupervised Domain Adaptation (UDA), aiming to align the distributions of the source and target domains, has become a powerful technique for addressing this challenge. This invention proposes a novel method called Conditional Alignment and Pseudo-Label Generation (CAPLG). This method comprises three main contributions: First, to address the issue of domain conditional distribution misalignment, Conditional Maximum Orientation Difference (CMDD) is proposed, which explicitly models the directional differences of domain class features and achieves alignment of domain conditional distributions by minimizing CMDD. Second, based on the spectral and spatial characteristics of hyperspectral images, Spectral Pseudo-Labels (SpePL) and Spatial Pseudo-Labels (SpaPL) are proposed, which fully learn the spectral and spatial information of the target domain, respectively. SpePL can also provide high-quality label guidance for CMDD in the early stages of training. Third, to address the alignment barrier caused by spatial resolution mismatch between the source and target domains, a Pixel Patch Unified Network (PPUN) is constructed, which not only supports flexible patch size strategies but also facilitates the efficient generation of SpaPL. Comparative experiments with some state-of-the-art and mainstream methods were conducted on three cross-scene hyperspectral image datasets. The experimental results show that the proposed method exhibits excellent performance on all three datasets.
[0018] In this invention, a conditional alignment and pseudo-label generation (CAPLG) method is proposed for unsupervised domain adaptation in hyperspectral image classification.
[0019] The contributions of this invention are as follows:
[0020] 1) Conditional Maximum Orientation Difference (CMDD) is proposed, which explicitly models inter-class differences and takes into account the directionality between features, using cosine similarity as a measure of similarity / directional consistency between source and target domain samples. Alignment of domain conditional distributions is achieved by minimizing the conditional maximum orientation difference.
[0021] 2) Spectral and spatial pseudo-labels were proposed. Spectral pseudo-labels effectively solve the problem of ineffective alignment of conditional distributions caused by the lack of high-quality pseudo-labels in the early stages of model training. Spatial pseudo-labels, on the other hand, realize a representation of the first law of geography and end-to-end learning, thereby fully learning the spatial information of the target domain.
[0022] 3) The pixel patch unified network is designed so that the source and target domains can use different patch sizes. This effectively solves the problem that previous methods had to train the model with a fixed patch size when facing domains with different spatial resolutions, which hindered the domain alignment effect. In addition, this network can classify all pixels in the patch with only one inference, which not only has great potential for inference efficiency, but also provides convenience for the rapid generation of spatial pseudo-labels. Attached Figure Description
[0023] Figure 1 This is a general framework diagram of the CAPLG of the present invention; Figure 2 This is a schematic diagram of the PPUN of the present invention.
[0024] Figure 3 The images are fake color images and real label images for the Pavia dataset: (a) fake color image of PU, (b) ground-truth map of PU, (c) fake color image of PC, and (d) ground-truth map of PC.
[0025] Figure 4 The images are fake color images and real label images for the Houston dataset: (a) fake color image for H13, (b) real label image for H13, (c) fake color image for H18, and (d) real label image for H18.
[0026] Figure 5 The images are fake color images and real label images for the Shanghai-Hangzhou dataset: (a) SH fake color image, (b) SH real label image, (c) HZ fake color image, and (d) HZ real label image.
[0027] Figure 6 Comparison of experimental results on the PC dataset: (a) DAN, (b) DANN, (c) JAN, (d) DeepCoral, (e) ground-truth, (f) CSTnet, (g) S4DL, (h) CLDA, (i) SCLUDA, (j) Proposed.
[0028] Figure 7 The following are comparative plots of experimental results on the H18 dataset: (a) DAN, (b) DANN, (c) JAN, (d) DeepCoral, (e) CSTnet, (f) S4DL, (g) CLDA, (h) SCLUDA, (i) ground-truth, (j) Proposed.
[0029] Figure 8The following are comparative plots of experimental results on the HZ dataset: (a) DAN, (b) DANN, (c) JAN, (d) DeepCoral, (e) ground-truth, (f) CSTnet, (g) S4DL, (h) CLDA, (i) SCLUDA, (j) Proposed.
[0030] Figure 9 The graph shows the impact of using the same or different patch sizes in the source domain PU and target domain PC on OA. The horizontal axis represents the target domain patch size, and the vertical axis represents the source domain patch size.
[0031] Figure 10 The graph shows the impact of using the same or different patch sizes in the source domain H13 and the target domain H18 on OA for H13-H18. The horizontal axis represents the target domain patch size, and the vertical axis represents the source domain patch size.
[0032] Figure 11 The graph shows the changes in classifier prediction accuracy and SpeL accuracy with the number of training iterations in the early stages of training for the PU-PC task.
[0033] Figure 12 The graph shows the changes in classifier prediction accuracy and SpeL accuracy with the number of training iterations in the H13-H18 tasks during the early stages of training.
[0034] Figure 13 The graph shows the changes in classifier prediction accuracy and SpeL accuracy as a function of the number of training iterations during the early stages of training for the SH-HZ task. Detailed Implementation
[0035] Specific Implementation Method 1: The specific process of this implementation method for hyperspectral image classification based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation is as follows:
[0036] Step 1: Obtain source and target domain data;
[0037] Step 2: Construct the Pixel Patch Unified Network Model (PPUN); the Pixel Patch Unified Network Model (PPUN) consists of the encoder PPUE, the global average pooling algorithm (Avgpool), and the classifier PPUC.
[0038] Step 3: Train the pixel patch unified network model PPUN based on the source domain and target domain data from Step 1 to obtain the trained pixel patch unified network model PPUN.
[0039] Step 4: Input the target domain data into the trained Pixel Patch Unified Network Model (PPUN), and the trained Pixel Patch Unified Network Model (PPUN) will output the classification results.
[0040] Figure 1 This diagram illustrates the overall framework of CAPLG. CAPLG includes the generation of PPUN, SpePL, and SpaPL, and loss terms including CMDD loss, source domain supervision loss, and target domain supervision loss. In short, PPUN mainly consists of PPUE and PPUC, and is the deep network used by CAPLG. The calculation of CMDD loss and the generation of SpePL rely on the cosine similarity matrix calculated between source and target domain samples. The PPUN network accelerates the generation of SpaPL. After SpePL and SpaPL are generated, they are used as part of the target domain supervision signal.
[0041] Specific Implementation Method Two: This implementation method differs from Specific Implementation Method One in that: in step one, the source domain and target domain data are acquired; the specific process is as follows:
[0042] Given the source domain ;
[0043] Give the target domain ;
[0044] in, Represents the image set in the source domain. This represents the set of labels corresponding to the images in the source domain; This represents the first image in the source domain image set. Represents the first image in the source domain image set. Zhang Image Represents the first image in the source domain image set. Zhang Image; This represents the label corresponding to the first image in the source domain image set. Represents the first image in the source domain image set. The labels corresponding to each image Represents the first image in the source domain image set. The labels corresponding to the images; This represents the total number of images in the source domain image set;
[0045] Represents the set of images in the target domain. This represents the first image in the target domain image set. Represents the first image in the target domain image set. Zhang Image Represents the first image in the target domain image set. Zhang Image; This represents the total number of images in the target domain image set;
[0046] Assume that the source domain and the target domain both have common features. One type of interest;
[0047] The label set corresponding to the image in the source domain It is known. This represents the total number of categories corresponding to the images in the source domain;
[0048] The label set corresponding to the image in the target domain It is unknown. This represents the total number of categories corresponding to the images in the target domain; the total number of categories corresponding to the images in the source domain is the same as the total number of categories corresponding to the images in the target domain, and the number of categories is also the same.
[0049] The task of unsupervised domain adaptation is to classify the target domain using known information and assign it... Give the corresponding .
[0050] The other steps and parameters are the same as in Specific Implementation Method 1.
[0051] Specific Implementation Method Three: This implementation method differs from Specific Implementation Method One or Two in that: in step two, a pixel patch unified network model PPUN is constructed; the pixel patch unified network model PPUN includes, in sequence, an encoder PPUE, a global average pooling Avgpool, and a classifier PPUC; the specific process is as follows:
[0052] The encoder PPUE consists of the following layers in sequence: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer.
[0053] The classifier PPUC consists of the following layers in sequence: the thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer.
[0054] To enable the model to address alignment challenges caused by varying spatial resolutions end-to-end, this invention designs a Pixel Patch Unified Network (PPUN), which solves the spatial resolution problem by allowing source and target domain samples to flexibly select patch sizes. Figure 2 As shown, PPUN mainly consists of a pixel patch unified encoder (PPUE) and a pixel patch unified classifier (PPUC), both of which are constructed using 1×1 convolutions, allowing inputs of arbitrary patch size.
[0055] Other steps and parameters are the same as in specific implementation method one or two.
[0056] Specific Implementation Method Four: This implementation method differs from Specific Implementation Methods One to Three in that: in step three, the pixel patch unified network model PPUN is trained based on the source and target domain data from step one to obtain the trained pixel patch unified network model PPUN; the specific process is as follows:
[0057] Image set in the source domain Input the Pixel Patch Unified Network Model (PPUN), and output the classification results of the images in the source domain.
[0058] Image set in the target domain The input is the Pixel Patch Unified Network Model (PPUN), and the output of the Pixel Patch Unified Network Model (PPUN) is the classification result of the image in the target domain.
[0059] A loss function is constructed based on the classification results of images in the source domain, the labels in the source domain, and the classification results of images in the target domain output by the Pixel Patch Unified Network Model (PPUN).
[0060] The process continues until the loss function converges, resulting in the trained pixel patch unified network model PPUN.
[0061] The other steps and parameters are the same as those in one of the specific implementation methods one to three.
[0062] Specific Implementation Method Five: This implementation method differs from one of Specific Implementation Methods One to Four in that: the image set in the source domain... The input is the Pixel Patch Unified Network Model (PPUN), and the output is the classification result of the image in the source domain; the specific process is as follows:
[0063] Image set in the source domain Input encoder PPUE, output feature vector The process is as follows:
[0064] Image set in the source domain The input layers are sequentially: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer. The twelfth ReLU activation function layer outputs the feature vector. ;
[0065] Feature vector The input is a global average pooling layer (Avgpool), and the output is a feature vector. ;
[0066] Feature vector The input is to the classifier PPUC, and the classifier PPUC outputs the classification result of the image in the source domain; the process is as follows:
[0067] Feature vector The thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer are input sequentially. The sixteenth convolutional layer outputs the label corresponding to the image in the source domain.
[0068] The other steps and parameters are the same as in any of the specific implementation methods one to four.
[0069] Specific Implementation Method Six: This implementation method differs from Specific Implementation Methods One to Five in that: the image set in the target domain... The input is the Pixel Patch Unified Network Model (PPUN), and the output of the PPUN model is the classification result of the image in the target domain; the specific process is as follows:
[0070] Image set in the target domain Input encoder PPUE, output feature vector The process is as follows:
[0071] Image set in the target domain The input layers are sequentially: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer. The twelfth ReLU activation function layer outputs the feature vector. ;
[0072] Feature vector The input is a global average pooling layer (Avgpool), and the output is a feature vector. ;
[0073] Feature vector The input is to the classifier PPUC, and the classifier PPUC outputs the classification result of the image in the target domain; the process is as follows:
[0074] Feature vector The thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer are input sequentially. The sixteenth convolutional layer outputs the classification result of the image in the target domain.
[0075] The other steps and parameters are the same as those in any of the specific implementation methods one to five.
[0076] Specific Implementation Method Seven: This implementation method differs from Specific Implementation Methods One through Six in that: the total loss function is constructed based on the classification results of the source domain image output by the Pixel Patch Unified Network Model (PPUN), the source domain label, and the classification results of the target domain image output by the Pixel Patch Unified Network Model (PPUN); the specific process is as follows:
[0077] 1) Calculate pseudo-labels, including spectral pseudo-labels. and space pseudo tags ;
[0078] 2) Calculate CMDD loss The process is as follows:
[0079] To achieve alignment of domain conditional distributions, this invention proposes the maximum directional difference of conditions as a metric. The core idea is to calculate the cosine similarity between features of samples from the source and target domains to assess the directional consistency of features across different categories within the domain.
[0080] The calculation process for CMDD is as follows:
[0081] 21) Calculate the CMDD loss using spectral pseudo-labels as target domain pseudo-labels. ;
[0082] 22) Calculate the CMDD loss using the pseudo-labels output by the classifier as pseudo-labels for the target domain. ;
[0083] 23) It is worth noting that in the experiments of this invention, in order to effectively align the conditional distribution throughout all stages, the CMDD loss of the target domain pseudo-label is used as the target domain pseudo-label for the first Z epochs during training due to the higher accuracy of the spectral pseudo-label. Subsequent training uses the pseudo-labels output by the classifier as the CMDD loss for the target domain pseudo-labels. In the experiment, Z was set to 5;
[0084] 3) Calculate the supervision loss, which includes the source domain supervision loss. and target domain supervision loss ;
[0085] 4) Source domain supervised loss Target domain supervision loss and CMDD loss Calculate total loss ; indicates as:
[0086] .
[0087] The other steps and parameters are the same as those in any of the specific implementation methods one to six.
[0088] Specific Implementation Method Eight: This implementation method differs from Specific Implementation Methods One through Seven in that: in step 1), the calculation of pseudo-labels includes spectral pseudo-labels. and space pseudo tags The process is as follows:
[0089] 11) Calculate spectral pseudo-labels The process is as follows:
[0090] The goal of spectral pseudo-labeling is to leverage the similarity between labeled source domain data and unlabeled target domain data to assign a pseudo-label to each target domain. Dimensional soft pseudo-label vectors, This represents the number of land cover categories of interest. The spectral pseudo-labels are calculated as follows:
[0091] 111) Image set in the target domain Input encoder PPUE, output feature vector ;
[0092] Feature vector The input is a global average pooling layer (Avgpool), and the output is a set of feature vectors. , Represents the feature vector set The first feature vector in the middle, Represents the feature vector set The Middle 1 eigenvector Represents the feature vector set The Middle 1 eigenvector;
[0093] 112) Image set in the source domain Input encoder PPUE, output feature vector ;
[0094] Feature vector Input is a global average pooling layer (Avgpool), and output is a feature. , Represents the feature vector set The first feature vector in the middle, Represents the feature vector set The Middle 1 eigenvector Represents the feature vector set The Middle 1 eigenvector;
[0095] 113) Feature-based and characteristics Calculate the similarity matrix , Represents a real number; it is expressed as:
[0096] (1)
[0097] in, Represents the feature vector set The Middle eigenvectors With feature vector set The Middle eigenvectors Cosine similarity between them;
[0098] 114) Calculate the source domain label one-hot; represented as:
[0099] (2)
[0100] in, Indicates one-hot encoding. This represents the set of labels corresponding to the images in the source domain; This indicates that the source domain label is one-hot; for example, one batch corresponds to... The labels are 1, 2, 3, 4, 5, 6. When the label corresponding to the image is category 2, the scalar inversion value is 0100000.
[0101] 115) Based on source domain tag onehot Calculate the number of items in each category to obtain a counting diagonal matrix; represented as:
[0102] (3)
[0103] in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix;
[0104] 116) Based on similarity matrix , Counting diagonal matrix Calculate spectral pseudo-labels ; indicates as:
[0105] (4)
[0106] in yes The inverse matrix is equivalent to the matrix of... The diagonal element in the middle represents the number of each category in the source domain, taken as the reciprocal.
[0107] In section E of the experimental part of this invention, it is shown that spectral pseudo-labels provide the necessary high-quality pseudo-labels for effective conditional distribution alignment of the model in the early stage of training, thereby enabling the model proposed in this invention to achieve effective conditional distribution alignment throughout the entire process.
[0108] 12) Computational space pseudo-labels The process is as follows:
[0109] To enable models to learn spatial information from the target domain, spatial pseudo-labels have been proposed. Spatial pseudo-labels can be viewed as a representation of the first law of geography, thereby enhancing the model's ability to learn more generalized spatial information from the target domain. Below are methods for generating spatial pseudo-labels; for example... Figure 1 As shown, the target domain feature blocks will avoid pooling, and the target domain class blocks will be obtained through PPUC. Specifically:
[0110] 121) The first image in the target domain image set Zhang Image The encoder PPUE and classifier PPUC are input sequentially. The classifier PPUC outputs the first image in the target domain image set. Zhang Image Corresponding target domain category block ;
[0111] in, and Representing the first image in the target domain image set respectively Zhang Image Height and width, This represents the total number of categories corresponding to the images in the target domain;
[0112] 122) To The classification map is obtained by taking the argmax of the category dimension for each spatial location. ; indicates as:
[0113] (5)
[0114] in, Indicates the first Zhang Image The corresponding classification diagram is number 1 Line 1 The category value of the column; Indicates the first Zhang Image The corresponding target domain category block Line 1 Liede Values on the channel; Indicates the first Zhang Image The corresponding target domain category block Line 1 Liede Values on the channel;
[0115] Indicates the first Zhang Image The corresponding target domain category block Line 1 There are in the list One value, The channel value corresponding to the maximum value among the values; Indicate category , Indicate category , ;
[0116] The mathematical meaning is to obtain a Value, for all Belonging to 1 to ,regardless What to retrieve, there exists a The value satisfies the condition ;
[0117] 123) Based on classification graph Calculate the category to which it belongs ratio ; indicates as:
[0118] (6)
[0119] in, This indicates an indicator function that, when the condition is met... Returns 1 if yes, otherwise returns 0;
[0120] 124) Based on the category it belongs to ratio Calculate the first image in the target domain image set Zhang Image Spatial pseudo-tags ; indicates as:
[0121] (7)
[0122] in, Represents the first image in the target domain image set. Zhang Image Spatial pseudo-tags, Represents the first image in the target domain image set. Zhang Image The spatial pseudo-label is 1. Represents the first image in the target domain image set. Zhang Image The spatial pseudo-label is 2. Represents the first image in the target domain image set. Zhang Image Spatial pseudo-labels are , Represents the first image in the target domain image set. Zhang Image Spatial pseudo-labels are ;
[0123] For the image set in the target domain Obtain spatial pseudo-labels corresponding to the image set in the target domain. ; indicates as:
[0124] (8).
[0125] The other steps and parameters are the same as those in any of the specific implementation methods one to seven.
[0126] Specific Implementation Method Nine: This implementation method differs from Specific Implementation Methods One through Eight in that: in step 21), the CMDD loss calculated using spectral pseudo-labels as target domain pseudo-labels is... The specific process is as follows:
[0127] 211) Pseudo-tags for target domains One-hot, represented as:
[0128] (9)
[0129] in, Indicates one-hot encoding. Indicates a spectral pseudo-label; This indicates a one-hot encoding of the target domain pseudo-label; for example, one "bath" corresponds to... The labels are 0, 1, 2, 3, 4, 5, 6. When the label corresponding to the image is the second category, the scalar inversion value is 0010000.
[0130] 212) Based on Calculate the number of items in each category to obtain the counting diagonal matrix. ; indicates as:
[0131] (10)
[0132] in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix;
[0133] 213) Based on counting diagonal matrices , Similarity matrix , Counting diagonal matrix Construct the maximum conditional direction difference matrix ; indicates as:
[0134] (11)
[0135] in, Indicates to performing operations on rows ;
[0136] In the formula Let be the cosine similarity matrix between the source domain and the target domain, as described in equation (1). As described in equation (2). As described in equation (3).
[0137] 214. Based on the maximum conditional direction difference matrix Calculate CMDD loss ; indicates as:
[0138] (12)
[0139] in, Represents the maximum conditional direction difference matrix Summation; Represents the maximum conditional direction difference matrix Seeking traces;
[0140] In step 22), the CMDD loss is calculated by using the pseudo-labels output by the classifier as pseudo-labels for the target domain. The specific process is as follows:
[0141] 221) The image set in the target domain The encoder PPUE, global average pooling (Avgpool), and classifier PPUC are input sequentially. The classification result output by classifier PPUC is used as the pseudo-label for the target domain. ;
[0142] 222) Pseudo-tags for target domains One-hot, represented as:
[0143]
[0144] in, Indicates one-hot encoding. Indicates a pseudo-tag for the target domain; This indicates a one-hot encoding of the target domain pseudo-label; for example, one "bath" corresponds to... The labels are 0, 1, 2, 3, 4, 5, 6. When the label corresponding to the image is category 2, the scalar inversion value is 0010000.
[0145] 223) Based on Calculate the number of items in each category to obtain the counting diagonal matrix. ; indicates as:
[0146]
[0147] in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix;
[0148] 224) Based on counting diagonal matrices , Similarity matrix , Counting diagonal matrix Construct the maximum conditional direction difference matrix ; indicates as:
[0149]
[0150] in, Indicates to performing operations on rows ;
[0151] In the formula Let be the cosine similarity matrix between the source domain and the target domain, as described in equation (1). As described in equation (2). As described in equation (3).
[0152] 225) Based on the maximum conditional direction difference matrix Calculate CMDD loss ; indicates as:
[0153]
[0154] in, Represents the maximum conditional direction difference matrix Summation; Represents the maximum conditional direction difference matrix Seeking traces;
[0155] In the formula Representation between domains Similarity in the same feature directions, CMDD loss By minimizing the similarity between different classes in different domains and maximizing the similarity between domains of the same class, the conditional distribution between domains can be measured.
[0156] The other steps and parameters are the same as those in one of the specific implementation methods one to eight.
[0157] Specific Implementation Method Ten: This implementation method differs from Specific Implementation Methods One through Nine in that: in step 3), the supervision loss is calculated, and the supervision loss includes the source domain supervision loss. and target domain supervision loss The specific process is as follows:
[0158] 31) Calculate the source domain supervision loss ; indicates as:
[0159] (13)
[0160] in, Represents the image set in the source domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially, and the source domain pseudo-label is output by classifier PPUC. ;
[0161] The source domain label is one-hot, obtained by formula (2);
[0162] 32) Calculate the supervised loss in the target domain The process is as follows: the target domain supervision loss consists of three losses, namely, the supervision of the target domain category vector by the spectral pseudo-label. Spatial pseudo-labels supervise the target domain category vector. and the self-supervised loss of the target domain class vector on itself. ;
[0163] 321) Calculate the supervision loss of spectral pseudo-labels. The process is as follows: In order to enhance learning stability and utilize the hard and soft label information of spectral pseudo-labels, the spectral pseudo-label supervision loss is designed as a multi-level cross-entropy loss consisting of three parts: hard label cross-entropy, soft label cross-entropy, and Top-k weighted cross-entropy.
[0164] 3211) Calculate the hard-label cross-entropy ; indicates as:
[0165] (14)
[0166] in, Represents the image set in the target domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially. The target domain pseudo-label is output by the classifier PPUC. ;
[0167] This refers to hard spectral pseudo-labels, i.e., one-hot encoded spectral pseudo-labels. (Regarding spectral pseudo-labels) onehot), spectral pseudo-label As described in formula (4); ;
[0168] The purpose of this loss term is to provide strong supervision over the most confident prediction class in the spectral pseudo-labels;
[0169] 3212) Calculate the cross-entropy of soft tags ; indicates as:
[0170] To accommodate all categories, soft-label cross-entropy is applied:
[0171] (15)
[0172] in, Represents the image set in the target domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially. The target domain pseudo-label is output by the classifier PPUC. ; The spectral pseudo-label is obtained from formula (4). This loss item involves monitoring all categories of spectral pseudo-labels;
[0173] 3213) Calculate the weighted Top-k cross-entropy loss. The specific process is as follows:
[0174] True labels often appear among the classes with the largest proportion of soft labels. To avoid overemphasizing the largest prediction class and drowning out the less important prediction classes, we further introduce Top-k weighted cross-entropy.
[0175] 32131) Extracting the softmax spectral pseudo-labels along the category dimension The maximum value and the former Category position index corresponding to the maximum value , ;
[0176] The acquisition process is as follows:
[0177] (16)
[0178] in, The spectral pseudo-label is obtained by formula (4);
[0179] express Categories ; Indicates the total number of land cover categories;
[0180] 32132), to The weights are obtained by performing softmax normalization. ; indicates as:
[0181] (17)
[0182] 32133) The weights are implemented through an indicator function. Shape from Transform into ,get A supervision term that can be directly substituted into the matrix form of topk weighted cross-entropy. ; indicates as:
[0183] (18)
[0184] in, Represents the first image in the target domain image set. The first image corresponds to the Supervision items of topk weighted cross-entropy, Represents the first image in the target domain image set. The topk weights corresponding to the images are as follows: Each weight value Represents the first image in the target domain image set. The topk index corresponding to the image is the first One index value; express Categories ; express Middle Count , ; This represents the total number of images in the target domain image set; Represents the first image in the target domain image set. Zhang Image ; Indicates the total number of land cover categories; Indicate category , ; Indicates an indicator function; , , ;
[0185] 32134) Finally, calculate the weighted Top-k cross-entropy loss. ; indicates as:
[0186] (19)
[0187] in, Indicates the first The supervision terms of topk weighted cross-entropy;
[0188] , The range is from 2 to excluding This is because the class with the largest proportion has already received sufficient supervision through hard-label cross-entropy and soft-label cross-entropy losses. By skipping the class with the largest proportion of predictions, the Top-k weighted cross-entropy loss can strengthen the model's learning of the less important prediction classes and avoid overly strong supervision of the largest prediction class. In the experiments of this invention, we take... ;
[0189] 3214) Based on hard-label cross-entropy Soft label cross-entropy Weighted Top-k Cross-Entropy Loss Calculate the supervision loss of spectral pseudo-labels ; indicates as:
[0190] (20)
[0191] This multi-level design utilizes hard and soft supervision from spectral pseudo-labels and Top-k weighted supervision to fully leverage spectral pseudo-labels, improve the stability of model learning, and enhance robust learning of spectral information of the target domain category.
[0192] 322) Computational spatial pseudo-label supervision loss The specific process is as follows:
[0193] This loss is achieved through soft-label cross-entropy loss. Since the spatial pseudo-labels have been normalized, the cross-entropy can be calculated directly without the need for softmax normalization.
[0194] (twenty one)
[0195] By supervising the learning of spatial pseudo-labels from the target domain, the model can make full use of the spatial information of the target domain, which helps the model learn the spatial consistency in geographic data. This reflects the first law of geography and thus improves the model's ability to learn spatial information of the target domain.
[0196] 323) Calculate the self-monitored loss The specific process is as follows:
[0197] Applying self-supervised cross-entropy loss to the target domain class vector output by the classifier helps the model gain more confidence in its predictions.
[0198] (twenty two)
[0199] in, This represents a hyperparameter used to control the weights of the self-supervised loss. In this invention... ;
[0200] 324) Spectral pseudo-label supervision loss calculated based on 321) Spatial pseudo-label supervision loss calculated by 322) Self-supervised loss calculated by (and 323) Calculate the supervised loss in the target domain The specific process is as follows:
[0201]
[0202] The PPUN network can handle inputs of arbitrary patch size and skip global pooling via T to directly output the classification results of all pixels in the patch, facilitating efficient generation of spatial pseudo-labels. The proposed spectral pseudo-labels effectively utilize the spectral structure characteristics of hyperspectral images, helping the model learn the spectral information of the target domain and achieving high accuracy even in the very early stages of training, ensuring the alignment of conditional distributions throughout the training process. The proposed spatial pseudo-labels effectively utilize the first law of geography to help the model learn rich spatial information of the target domain. The proposed maximum directional difference of category conditions, using source domain true labels and target domain pseudo-labels, explicitly models intra- and inter-class differences, effectively measuring the degree of difference in conditional distributions between domains.
[0203] The other steps and parameters are the same as those in any of the specific implementation methods one to nine.
[0204] The beneficial effects of the present invention are verified using the following embodiments:
[0205] Example 1:
[0206] A. Dataset Description: To validate the proposed method, three publicly available HSI datasets were used, including Pavia, Houston, and Shanghai-Hangzhou;
[0207]
[0208]
[0209]
[0210] 1) Pavia: The Pavia dataset comprises the University of Pavia (PU, source domain) and the Pavia Centre (PC, target domain). Both were captured using a Reflective Optics System Imaging Spectrometer (ROSIS) airborne sensor. PU contains 610×340 pixels and 103 bands. PC contains 1096×715 pixels and 102 bands. For PU, the last band was removed to ensure the same number of spectral bands as PC. Both datasets have a spectral wavelength range of 430–834 nm and a spatial resolution of 1.3 m. Details of samples in seven identical categories are shown in Table 1. Figure 3 The images show both false-color images and real label images.
[0211] 2) Houston: The Houston dataset was taken at the Houston campus in Houston, Texas, USA, using different sensors and from different years, including Houston 2013 (H13, source domain) and Houston 2018 (H18, target domain). H13 contains 349×1905 pixels and 144 spectral bands. Its spatial resolution is 2.5 meters. H18 contains 209×955 pixels and 48 spectral bands. Its spatial resolution is 1 meter, and the wavelength range is 380-1050 nm. Specifically, in the Houston 2013 dataset, we selected 209×955 overlapping regions and 48 spectral bands corresponding to Houston 2018. There are originally 7 classes shared by both datasets. Since the number of labels for the water category is very small in Houston 2018, the water category was removed, leaving six shared categories. Detailed sample information is shown in Table 2. Figure 4 They displayed their fake-color images and real label images.
[0212] 3) Shanghai-Hangzhou: The Shanghai (SH, source domain) and Hangzhou (HZ, target domain) datasets were obtained using the Hyperion hyperspectral image sensor mounted on the EO-1 satellite. The spectral range is 400nm-2500nm. After removing bad bands, 198 bands were retained, with a spatial resolution of 30m. Both datasets were captured in 2002. The Shanghai dataset has 1600×230 pixels, and the Hangzhou dataset has 590×230 pixels. They share three categories: water, ground / buildings, and plants. Detailed sample information is shown in Table 3. Figure 5 They displayed their fake-color images and real label images.
[0213] B. Experimental setup: Eight comparison methods were used to evaluate the performance of the proposed method, including DAN
[15] , DANN
[17]
[18] , JAN, DeepCoral
[16] , CSTnet
[38] (Shi Z, Lai X, Deng J, et al.Content-biased and style-assisted transfer network for cross-scene hyperspectral image classification[J]. IEEE Transactions on Geoscience and Remote Sensing, 2024, 62: 1-17.), S4DL
[39] (Feng J, Zhang T, Zhang J, et al. S4 DL: Shift-Sensitive Spatial–Spectral Disentangling Learning for Hyperspectral Image Unsupervised Domain Adaptation[J]. IEEE Transactions on Neural Networks and Learning Systems, 2025.), CLDA
[40] (Fang Z, Yang Y, Li Z, et al. Confident learning-based domain adaptation for hyperspectral image classification[J]. IEEE Transactions on Geoscience and Remote Sensing, 2022,60: 1-16.),SCLUDA
[41] (Li Z, Xu Q, Ma L, et al. Supervised contrastive learning-based unsupervised domain adaptation for hyperspectral imageclassification[J]. IEEE Transactions on Geoscience and Remote Sensing, 2023,61: 1-17.). For all methods, the data were preprocessed according to the standard normal distribution before training.For a fair comparison
[42] (Picard D. Torch. manual_seed (3407) is all you need: On the influence of random seeds in deep learning architectures for computer vision[J]. arXiv preprint arXiv:2109.08203, 2021.), all methods used the same ten consecutive integers as random seeds (2025-2034), and calculated OA, AA, and Kappa through these ten experiments as metrics for method performance (as well as the ablation and analysis experiments of this invention). Because the focus of this invention is on the alignment of conditional distributions, we chose a class-balanced sampling strategy to construct the training set. Specifically, we randomly sampled the same number of samples from each class in the source or target domain, with the number of samples per class being 200, 200, and 1000 on the three datasets, respectively. The epochs for all experiments were uniformly set to 100, and the batch sizes for the three datasets PU, Houston, and SH were set to 140, 120, and 300 respectively, thus ensuring that each epoch contained ten batches.
[0214] In this experiment, the feature extractors for DAN, DANN, JAN, and DeepCoral used ResNet18 with the SGD optimizer, a learning rate of 0.005, and a momentum of 0.9. The patch sizes on the three datasets were 5×5, 7×7, and 1×1, respectively. For CSTnet, S4DL, CLDA, and SCLUDA, the original settings remained unchanged except for the global settings mentioned above. For the proposed method, the SGD optimizer was used with a learning rate of 0.005 and a momentum of 0.9. It is worth noting that a flexible patch size strategy was adopted in the proposed method. The patch sizes on the three tasks were set to 5×5 and 7×7, 5×5 and 9×9, and 1×1 and 1×1, respectively. The former is the patch size of the source domain, and the latter is the patch size of the target domain.
[0215] C. Experimental Results: The performance of the proposed method on three publicly available datasets was analyzed. The classification results are shown in Tables 4, 5, and 6, respectively, and their color classification images are shown in Tables 4, 5, and 6. Figure 6 Figure 7 Figure 8 As shown, the method of the present invention achieves optimal performance on all datasets.
[0216] Table 4. Classification results (values ± standard deviation) of the Pavia dataset (PU-PC task)
[0217]
[0218]
[0219]
[0220] Pavia task: Color classification image and classification results as follows Figure 6 As shown in Table 4, the model proposed in this invention yielded optimal OA (92.72%), AA (92.45%), and Kappa (91.24%), making it the only method to achieve over 90%, and outperforming the suboptimal method (CSTnet) by 4.61%, 2.94%, and 5.44%, respectively. In ten experiments using ten consecutive numbers as random seeds, the standard deviations of the OA and Kappa indices were minimized, demonstrating the stability of the proposed method.
[0221] Houston task: Color classification chart and classification results as follows Figure 7 As shown in Table 5, the proposed method achieves higher OA (76.73%), AA (76.38%), and Kappa (64.68%) rates than the suboptimal method (SCLUDA) by 8.37%, 1.33%, and 9.39%, respectively. The proposed method is the only one to reach a Kappa rate within the strong consistency range (61% <= Kappa < 0.81), indicating good consistency and reliable results. Other methods fall within the moderate consistency range (0.41 <= Kappa < 0.61), demonstrating that the proposed method is more stable, robust, and reliable.
[0222] SH-HZ task: Color classification image and classification results as follows Figure 8 As shown in Table 6, the proposed method achieves optimal OA (94.18%), AA (94.88%), and AA (89.93%), but only surpasses the suboptimal method (JAN) by 0.96%, 0.60%, and 1.72%, respectively. Furthermore, five out of the eight comparisons show OA greater than 90%, indicating that the performance evaluation of different methods for this task is nearing saturation. This phenomenon is primarily due to the limited number of classes in the dataset (only three), with significant differences in spectral features among the classes, allowing most methods to achieve good classification results. Therefore, there is limited room for further improvement in this dataset. It is noteworthy that despite such a high benchmark evaluation, the proposed method still comprehensively outperforms all compared methods, demonstrating its effectiveness not only in complex scenarios but also in simpler ones, further validating its reliability and generalization ability.
[0223] The proposed method achieved state-of-the-art performance on all three datasets, demonstrating exceptional generalization ability. Only SCLUDA maintained a top-four ranking across all tasks, while the performance rankings of other methods fluctuated significantly with changes in the task. This result indicates that most methods have limited generalization ability and lack stability in multi-task scenarios. In contrast, the proposed method outperformed all performance evaluations across all tasks, demonstrating its excellent generalization ability and adaptability to classification needs in diverse task scenarios.
[0224] D. Effectiveness of the Flexible Patch Size Strategy: To evaluate the benefits of allowing different patch sizes for the source and target domains, this invention conducted experiments on the impact of the same or different patch sizes for the source and target domains on overall accuracy (OA). The experiments were conducted on the Pavia task with the same spatial resolution for both the source and target domains and the Houston task with different spatial resolutions. The experimental results are as follows: Figure 9 , Figure 10 As shown. Figure 9 , Figure 10 As shown, the diagonal elements represent the impact of the source and target domains having the same patch size on the model's operational accuracy (OA), while the off-diagonal elements represent the impact of the source and target domains having different patch sizes on the model's OA. In the Pavia task, the analysis results are as follows: Figure 9 As shown, when both the source and target domain patch sizes are 7×7, the model achieves an OA (Average Access) value of 92.38%, which is the optimal value under the same patch size conditions. When the source domain is 5×5 and the target domain is 7×7, the OA is 92.72%. Experiments show that the flexible patch size strategy brings a 0.34% improvement in OA. In the Houston task, as... Figure 10 As shown, when both the source and target domain patch sizes are 5×5, the model achieves an OA value of 74.70%, which is the optimal value under the same patch conditions. When the source domain is 5×5 and the target domain is 9×9, the model achieves an OA value of 76.73%. Therefore, the flexible patch size strategy helps improve the OA by an additional 2.03%, which is significantly better than the 0.34% improvement in the Pavia task. This improvement is mainly due to the different spatial resolutions of the source and target domains in the Houston task. The spatial resolution of the source domain Houston2013 is 2.5m, while the spatial resolution of the target domain Houston2018 is 1m. The optimal OA patch sizes for the source and target domains are 5×5 and 9×9, respectively. The experiment demonstrates that the flexible patch size strategy alleviates the domain alignment barrier caused by the different spatial resolutions between domains, which is the main problem that the PPUN network proposed in this invention aims to solve.
[0225] E. Early Reliability of Spectral Pseudo-Labels: In the early stages of training, the accuracy of the generated target domain spectral pseudo-labels is significantly higher than the prediction accuracy of the classifier. As... Figure 11 , Figure 12 , Figure 13 As shown, on all three training datasets, in the very first few training iterations, the classifier's accuracy in predicting target domain samples was at a very low level; however, at the same time, the accuracy of the spectral pseudo-labels for these samples was much higher.
[0226] In this invention, the high quality of spectral pseudo-labels early on not only serves as a supervisory signal to guide the model to learn the inter-class separability of the target domain earlier and accelerate convergence, but also provides a crucial element—reliable target domain pseudo-labels—for the early alignment of class conditional distributions between domains. The measurement and alignment of class conditional distributions between domains relies on reliable target domain pseudo-labels to divide the target domain training samples into meaningful semantic groups, thereby effectively aligning the feature distributions of the source and target domains under each semantic category. Insufficient pseudo-label quality introduces noise, leading to incorrect alignment directions and negative transfer. Thanks to the high accuracy of spectral pseudo-labels in the early stages of training, the method of this invention can initiate the conditional distribution alignment mechanism from the first training cycle without a warm-up phase. This allows the model to learn domain-invariant features as early as possible under the guidance of correct class classification, mitigating erroneous evolution of the feature space.
[0227] F. Ablation Experiments: In order to verify the effectiveness of each component of the method of this invention, ablation experiments were conducted on each task. As shown in Table 7, specifically, the baseline for evaluation was set at the loss consisting only of source domain supervision loss and target domain self-supervision loss, and CMDD loss, spectral pseudo-label loss and spatial pseudo-label loss were gradually introduced, and the impact of each loss term on OA was evaluated on each task.
[0228] Table 7 Ablation experiments under different tasks
[0229]
[0230] First, regarding the ablation of the CMDD loss, as observed in Table 7, the model performance improved across all three tasks with the addition of the CMDD loss term. This was particularly evident in the relatively complex Pavia and Houston tasks, where improvements of 3.54% and 3.05% were achieved, respectively. Even in the simpler SH task, despite a baseline performance of 93.30%, a gain of 0.44% was still achieved. Notably, the standard deviation decreased across all tasks after introducing the CMDD loss term, indicating that this loss not only improves model performance by enhancing the distribution alignment between domains but also contributes to the stability of model predictions.
[0231] Next, this invention evaluated the effect of pseudo-label supervision loss. After adding the CMDD loss term to the baseline, further adding a spectral pseudo-label loss term improved model performance by 0.48%, 2.09%, and 0.34% in the three tasks, respectively, validating the effectiveness of the spectral pseudo-label loss term. However, conversely, introducing spatial pseudo-labels alone reduced model performance by 1.78%, 0.77%, and 0.06% in the three tasks, respectively. This phenomenon is due to the different learning tasks corresponding to the two types of pseudo-labels. The spectral pseudo-label loss term focuses on the full utilization and modeling of spectral information in the target domain samples, while the spatial pseudo-label loss term focuses on learning the spatial context of the target domain samples. As is well known, a major characteristic of hyperspectral images is the fusion of space and spectrum; for hyperspectral image classification tasks, spectral information plays a dominant role. Without the full utilization and modeling of spectral information, simply applying spectral pseudo-labels may lead the model to learn misleading or redundant spatial information, thereby impairing overall performance.
[0232] Finally, when both spectral and spatial pseudo-labels are introduced, the model achieves optimal performance on all tasks. This result not only confirms the complementarity of the two pseudo-label supervision mechanisms, but also further confirms the essential characteristic of hyperspectral images as "spatial-spectral integration"—the realization of optimal performance requires the synergistic effect of spectral and spatial information.
[0233] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation, characterized in that: The specific process of the method is as follows: Step 1: Obtain source and target domain data; Step 2: Construct the pixel patch unified network model PPUN; The pixel patch unified network model PPUN consists of an encoder PPUE, a global average pooling algorithm (Avgpool), and a classifier PPUC. Step 3: Train the pixel patch unified network model PPUN based on the source domain and target domain data from Step 1 to obtain the trained pixel patch unified network model PPUN. Step 4: Input the target domain data into the trained Pixel Patch Unified Network Model (PPUN), and the trained Pixel Patch Unified Network Model (PPUN) will output the classification results.
2. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 1, characterized in that: In step one, source domain and target domain data are obtained; The specific process is as follows: Given the source domain ; Give the target domain ; in, Represents the image set in the source domain. This represents the set of labels corresponding to the images in the source domain; This represents the first image in the source domain image set. Represents the first image in the source domain image set. Zhang Image Represents the first image in the source domain image set. Zhang Image; This represents the label corresponding to the first image in the source domain image set. Represents the first image in the source domain image set. The labels corresponding to each image Represents the first image in the source domain image set. The labels corresponding to the images; This represents the total number of images in the source domain image set; Represents the set of images in the target domain. This represents the first image in the target domain image set. Represents the first image in the target domain image set. Zhang Image Represents the first image in the target domain image set. Zhang Image; This represents the total number of images in the target domain image set; The label set corresponding to the image in the source domain It is known. This represents the total number of categories corresponding to the images in the source domain.
3. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 2, characterized in that: In step two, a pixel patch unified network model PPUN is constructed. The pixel patch unified network model PPUN includes an encoder PPUE, a global average pooling Avgpool, and a classifier PPUC. The specific process is as follows: The encoder PPUE consists of the following layers in sequence: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer. The classifier PPUC consists of the following layers in sequence: the thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer.
4. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 3, characterized in that: In step three, the pixel patch unified network model PPUN is trained based on the source domain and target domain data from step one to obtain the trained pixel patch unified network model PPUN. The specific process is as follows: Image set in the source domain Input the Pixel Patch Unified Network Model (PPUN), and output the classification results of the images in the source domain. Image set in the target domain The input is the Pixel Patch Unified Network Model (PPUN), and the output of the Pixel Patch Unified Network Model (PPUN) is the classification result of the image in the target domain. A loss function is constructed based on the classification results of images in the source domain, the labels in the source domain, and the classification results of images in the target domain output by the Pixel Patch Unified Network Model (PPUN). The process continues until the loss function converges, resulting in the trained pixel patch unified network model PPUN.
5. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 4, characterized in that: Image set in the source domain Input the Pixel Patch Unified Network Model (PPUN), and output the classification results of the images in the source domain. The specific process is as follows: Image set in the source domain Input encoder PPUE, output feature vector The process is as follows: Image set in the source domain The input layers are sequentially: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer. The twelfth ReLU activation function layer outputs the feature vector. ; Feature vector The input is a global average pooling layer (Avgpool), and the output is a feature vector. ; Feature vector The input is to the classifier PPUC, and the classifier PPUC outputs the classification result of the image in the source domain; the process is as follows: Feature vector The thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer are input sequentially. The sixteenth convolutional layer outputs the label corresponding to the image in the source domain.
6. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 5, characterized in that: Image set in the target domain The input is the Pixel Patch Unified Network Model (PPUN), and the output of the Pixel Patch Unified Network Model (PPUN) is the classification result of the image in the target domain. The specific process is as follows: Image set in the target domain Input encoder PPUE, output feature vector The process is as follows: Image set in the target domain The input layers are sequentially: first convolutional layer, second batch normalization layer (BN), third ReLU activation function layer, fourth convolutional layer, fifth batch normalization layer (BN), sixth ReLU activation function layer, seventh convolutional layer, eighth batch normalization layer (BN), ninth ReLU activation function layer, tenth convolutional layer, eleventh batch normalization layer (BN), and twelfth ReLU activation function layer. The twelfth ReLU activation function layer outputs the feature vector. ; Feature vector The input is a global average pooling layer (Avgpool), and the output is a feature vector. ; Feature vector The input is to the classifier PPUC, and the classifier PPUC outputs the classification result of the image in the target domain; the process is as follows: Feature vector The thirteenth convolutional layer, the fourteenth convolutional layer, the fifteenth ReLU activation function layer, and the sixteenth convolutional layer are input sequentially. The sixteenth convolutional layer outputs the classification result of the image in the target domain.
7. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 6, characterized in that: The total loss function is constructed from the classification results of images in the source domain, the labels in the source domain, and the classification results of images in the target domain output by the pixel patch unified network model PPUN. The specific process is as follows: 1) Calculate pseudo-labels, including spectral pseudo-labels. and space pseudo tags ; 2) Calculate CMDD loss The process is as follows: 21) Calculate the CMDD loss using spectral pseudo-labels as target domain pseudo-labels. ; 22) Calculate the CMDD loss using the pseudo-labels output by the classifier as pseudo-labels for the target domain. ; 23) CMDD loss using spectral pseudo-labels as target domain pseudo-labels during the first Z epochs of training. Subsequent training uses the pseudo-labels output by the classifier as the CMDD loss for the target domain pseudo-labels. ; 3) Calculate the supervision loss, which includes the source domain supervision loss. and target domain supervision loss ; 4) Source domain supervised loss Target domain supervision loss and CMDD loss Calculate total loss ; indicates as: 。 8. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 7, characterized in that: In step 1), pseudo-labels are calculated, including spectral pseudo-labels. and space pseudo tags The process is as follows: 11) Calculate spectral pseudo-labels The process is as follows: 111) Image set in the target domain Input encoder PPUE, output feature vector ; Feature vector The input is a global average pooling layer (Avgpool), and the output is a set of feature vectors. , Represents the feature vector set The first feature vector in the middle, Represents the feature vector set The Middle 1 eigenvector Represents the feature vector set The Middle 1 eigenvector; 112) Image set in the source domain Input encoder PPUE, output feature vector ; Feature vector Input is a global average pooling layer (Avgpool), and output is a feature. , Represents the feature vector set The first feature vector in the middle, Represents the feature vector set The Middle 1 eigenvector Represents the feature vector set The Middle 1 eigenvector; 113) Feature-based and characteristics Calculate the similarity matrix , Represents a real number; it is expressed as: (1) in, Represents the feature vector set The Middle eigenvectors With feature vector set The Middle eigenvectors Cosine similarity between them; 114) Calculate the source domain label one-hot; represented as: (2) in, Indicates one-hot encoding. This represents the set of labels corresponding to the images in the source domain; Indicates the source domain tag is onehot; 115) Based on source domain tag onehot Calculate the number of items in each category to obtain a counting diagonal matrix; represented as: (3) in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix; 116) Based on similarity matrix , Counting diagonal matrix Calculate spectral pseudo-labels ; indicates as: (4) in yes The inverse matrix; 12) Computational space pseudo-labels The process is as follows: 121) The first image in the target domain image set Zhang Image The encoder PPUE and classifier PPUC are input sequentially. The classifier PPUC outputs the first image in the target domain image set. Zhang Image Corresponding target domain category block ; in, and Representing the first image in the target domain image set respectively Zhang Image Height and width, This represents the total number of categories corresponding to the images in the target domain; 122) To The classification map is obtained by taking the argmax of the category dimension for each spatial location. ; indicates as: (5) in, Indicates the first Zhang Image The corresponding classification diagram is number 1 Line 1 The category value of the column; Indicates the first Zhang Image The corresponding target domain category block Line 1 Liede Values on the channel; Indicates the first Zhang Image The corresponding target domain category block Line 1 Liede Values on the channel; Indicates the first Zhang Image The corresponding target domain category block Line 1 There are in the list One value, The channel value corresponding to the maximum value among the values; Indicate category , Indicate category , ; 123) Based on classification graph Calculate the category to which it belongs ratio ; indicates as: (6) in, This indicates an indicator function that, when the condition is met... Returns 1 if yes, otherwise returns 0; 124) Based on the category it belongs to ratio Calculate the first image in the target domain image set Zhang Image Spatial pseudo-tags ; indicates as: (7) in, Represents the first image in the target domain image set. Zhang Image Spatial pseudo-tags, Represents the first image in the target domain image set. Zhang Image The spatial pseudo-label is 1. Represents the first image in the target domain image set. Zhang Image The spatial pseudo-label is 2. Represents the first image in the target domain image set. Zhang Image Spatial pseudo-labels are , Represents the first image in the target domain image set. Zhang Image Spatial pseudo-labels are ; For the image set in the target domain Obtain spatial pseudo-labels corresponding to the image set in the target domain. ; indicates as: (8)。 9. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 8, characterized in that: In step 21), the CMDD loss is calculated using spectral pseudo-labels as target domain pseudo-labels. ; The specific process is as follows: 211) Pseudo-tags for target domains One-hot, represented as: (9) in, Indicates one-hot encoding. Indicates a spectral pseudo-label; This indicates a one-hot encoding of the target domain. 212) Based on Calculate the number of items in each category to obtain the counting diagonal matrix. ; indicates as: (10) in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix; 213) Based on counting diagonal matrices , Similarity matrix , Counting diagonal matrix Construct the maximum conditional direction difference matrix ; indicates as: (11) in, Indicates to performing operations on rows ; 214. Based on the maximum conditional direction difference matrix Calculate CMDD loss ; indicates as: (12) in, Represents the maximum conditional direction difference matrix Summation; Represents the maximum conditional direction difference matrix Seeking traces; In step 22), the CMDD loss is calculated by using the pseudo-labels output by the classifier as pseudo-labels for the target domain. The specific process is as follows: 221) The image set in the target domain The encoder PPUE, global average pooling (Avgpool), and classifier PPUC are input sequentially. The classification result output by classifier PPUC is used as the pseudo-label for the target domain. ; 222) Pseudo-tags for target domains One-hot, represented as: in, Indicates one-hot encoding. Indicates a pseudo-tag for the target domain; This indicates a one-hot encoding of the target domain. 223) Based on Calculate the number of items in each category to obtain the counting diagonal matrix. ; indicates as: in, This represents a column vector consisting entirely of 1s. The superscript T indicates transpose. This indicates taking a diagonal matrix; 224) Based on counting diagonal matrices , Similarity matrix , Counting diagonal matrix Construct the maximum conditional direction difference matrix ; indicates as: in, Indicates to performing operations on rows ; 225) Based on the maximum conditional direction difference matrix Calculate CMDD loss ; indicates as: in, Represents the maximum conditional direction difference matrix Summation; Represents the maximum conditional direction difference matrix Seeking traces.
10. The hyperspectral image classification method based on unsupervised domain adaptation, conditional alignment, and pseudo-label generation according to claim 9, characterized in that: In step 3), the supervision loss is calculated, including the source domain supervision loss. and target domain supervision loss ; The specific process is as follows: 31) Calculate the source domain supervision loss ; indicates as: (13) in, Represents the image set in the source domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially, and the source domain pseudo-label is output by classifier PPUC. ; Indicates the source domain tag is onehot; 32) Calculate the supervised loss in the target domain The process is as follows: 321) Calculate the supervision loss of spectral pseudo-labels. The process is as follows: 3211) Calculate the hard-label cross-entropy ; indicates as: (14) in, Represents the image set in the target domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially. The target domain pseudo-label is output by the classifier PPUC. ; This refers to hard spectral pseudo-labels, i.e., one-hot encoded spectral pseudo-labels. Spectral pseudo-labels As described in formula (4); ; 3212) Calculate the cross-entropy of soft tags ; indicates as: (15) in, Represents the image set in the target domain The encoder PPUE, global average pooling Avgpool, and classifier PPUC are input sequentially. The target domain pseudo-label is output by the classifier PPUC. ; Indicates a spectral pseudo-label. ; 3213) Calculate the weighted Top-k cross-entropy loss. ; The specific process is as follows: 32131) Extracting the softmax spectral pseudo-labels along the category dimension The maximum value and the former Category position index corresponding to the maximum value , ; The acquisition process is as follows: (16) in, Indicates a spectral pseudo-label; express Categories ; Indicates the total number of land cover categories; 32132), to The weights are obtained by performing softmax normalization. ; indicates as: (17) 32133) The weights are implemented through an indicator function. Shape from Transform into ,get A supervision term that can be directly substituted into the matrix form of topk weighted cross-entropy. ; indicates as: (18) in, Represents the first image in the target domain image set. The first image corresponds to the Supervision items of topk weighted cross-entropy, Represents the first image in the target domain image set. The topk weights corresponding to the images are as follows: Each weight value Represents the first image in the target domain image set. The topk index corresponding to the image is the first One index value; express Categories ; express Middle Count , ; This represents the total number of images in the target domain image set; Represents the first image in the target domain image set. Zhang Image ; Indicates the total number of land cover categories; Indicate category , ; , , ; Indicates an indicator function; 32134) Finally, calculate the weighted Top-k cross-entropy loss. ; indicates as: (19) in, Indicates the first The supervision terms of topk weighted cross-entropy; 3214) Based on hard-label cross-entropy Soft label cross-entropy Weighted Top-k Cross-Entropy Loss Calculate the supervision loss of spectral pseudo-labels ; indicates as: (20) 322) Computational spatial pseudo-label supervision loss The specific process is as follows: (21) 323) Calculate the self-monitored loss The specific process is as follows: (22) in, Indicates hyperparameters; 324) Spectral pseudo-label supervision loss calculated based on 321) Spatial pseudo-label supervision loss calculated by 322) Self-supervised loss calculated by (and 323) Calculate the supervised loss in the target domain The specific process is as follows: 。