Hyperspectral image classification method for cross-domain small sample learning based on diffusion enhancement prototype knowledge distillation

This cross-domain few-shot learning method, which enhances prototype knowledge distillation through diffusion, solves the problems of domain shift, increased class divergence, and blurred inter-class boundaries in hyperspectral image classification. It achieves higher classification accuracy and feature separability and is suitable for cross-domain few-shot learning of hyperspectral images.

CN121544946APending Publication Date: 2026-02-17XIAN UNIV OF POSTS & TELECOMM
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511772222.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing hyperspectral image classification methods suffer from domain shift, increased class divergence, blurred inter-class boundaries, and cross-domain noise interference in cross-domain few-sample learning, making it difficult to effectively distinguish between domain-related noise and domain-invariant semantic features.

Method used

We employ a cross-domain few-shot learning method based on diffusion-enhanced prototype knowledge distillation. Through data preparation, diffusion-enhanced pre-training, meta-knowledge extraction, few-shot learning transfer, and global-local prototype knowledge distillation, combined with a bi-branch spatial spectral attention module and signal-to-noise ratio enhancement loss, we optimize model parameters to suppress noise interference and improve feature separability.

Benefits of technology

It effectively suppresses domain shift, reduces inter-class confusion and noise interference in the target domain, improves classification accuracy in cross-domain scenarios, enhances feature representation capabilities, and solves the problems of increased class divergence and blurred inter-class boundaries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121544946A_ABST
    Figure CN121544946A_ABST
Patent Text Reader

Abstract

The invention discloses a hyperspectral image classification method for cross-domain small sample learning based on diffusion enhancement prototype knowledge distillation, and belongs to the technical field of hyperspectral image processing. The method comprises the following steps: extracting a neighborhood data cube, aligning spectrums, dividing a support set and a query set, and applying a mask and enhancing noise; executing domain adversarial denoising and reconstruction tasks, aligning feature distribution, and outputting a pre-training encoder; decoupling features, capturing spectrum-space global and local dependency relationships, and calculating similarity between a query set and a category prototype; constructing a distillation framework to realize knowledge migration; optimizing model parameters, and introducing a signal-to-noise ratio to enhance loss suppression noise; and performing feature extraction by using the optimized student model to generate a hyperspectral image classification result. According to the method, the problems of domain offset, intra-class feature dispersion, inter-class boundary fuzziness, noise interference and the like are solved, and the classification accuracy in a small sample scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hyperspectral image processing technology, and more specifically to a hyperspectral image classification method based on cross-domain few-shot learning using diffusion-enhanced prototype knowledge distillation. Background Technology

[0002] Pixel-level classification methods for hyperspectral images (HSI) mainly fall into two categories: those based on manually generated features and those based on deep learning features. The paper "Cross domain few-shot learning based on decoupled knowledge distillation for hyperspectral image classification" (DOI: 10.1109 / TGRS.2024.3476116) proposes a classification framework based on decoupled knowledge distillation for cross-domain few-shot learning. It utilizes a knowledge distillation strategy to determine the priority of key target domain features and reduces the influence of biased meta-knowledge. It also enhances the model's ability to capture spectral correlations by minimizing the distance between similar spectral bands through feature maps.

[0003] However, the aforementioned framework still has significant limitations: the teacher network is only pre-trained on source domain data without considering adaptive optimization for the target domain, making it difficult to effectively distinguish between domain-related noise and domain-invariant semantic features in cross-domain tasks. This few-shot learning mode, dominated by source domain features, further exacerbates the model's over-reliance on source domain supervision signals, leading to significant domain shift problems, increased class divergence in the target domain feature space, blurred inter-class boundaries, and cross-domain noise interference.

[0004] Therefore, there is an urgent need for a new classification method that can effectively solve the problems of domain shift, increased class divergence, blurred inter-class boundaries, and cross-domain noise interference in existing technologies. Summary of the Invention

[0005] The purpose of this invention is to provide a hyperspectral image classification method based on diffusion-enhanced prototype knowledge distillation and cross-domain few-shot learning, so as to solve the above-mentioned problems existing in the prior art.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A hyperspectral image classification method based on diffusion-enhanced prototype knowledge distillation and cross-domain few-shot learning includes the following steps: S1: Data preparation: Based on the hyperspectral images of the source and target domains, extract neighborhood data cubes centered on pixels, unify data dimensions through a spectral alignment mapping layer, divide the support set and query set, and introduce a masking mechanism and noise perturbation strategy to implement data augmentation. S2: Diffusion-enhanced pre-training uses a diffusion model to perform domain adversarial denoising and reconstruction tasks on visible source data and masked target data. It embeds a domain discriminator and combines a gradient inversion layer to align the feature distributions of the source and target domains, and outputs a pre-trained encoder model. S3: Meta-knowledge extraction uses a dual-branch spatial-spectral attention module to decouple features, capture global and local dependencies in the spectral-spatial dimension, and calculates the similarity between query set features and category prototypes through a few-shot learning strategy; S4: Few-shot learning transfer, constructing a global-local prototype knowledge distillation framework that includes student models, teacher models and historical student models, and achieving knowledge transfer through differentiated enhancement strategies; S5: Global-local prototype knowledge distillation, combining global prototype alignment and local contrastive learning to optimize model parameters, teacher model extracts target domain category prototypes to guide student model feature distribution alignment, historical student model strengthens local consistency through contrastive learning, and introduces signal-to-noise ratio enhancement loss to suppress noise interference; S6: Output classification results. Use the optimized student model to extract features from unlabeled samples in the target domain and generate hyperspectral image classification results through a K-NN classifier.

[0007] Further, S1 includes: Extract data blocks of a predetermined size centered on each pixel of the source and target domain images; A spectral alignment mapping layer is used to transform data blocks of different spectral dimensions into a unified dimension. Several samples are selected from each of the multiple categories and divided into a support set for training and a query set for evaluation. The student model is subjected to a strong mask and noise enhancement, while the teacher model is subjected to a weak mask and noisy samples.

[0008] Further, S2 includes: Hyperspectral image patches are sampled from visible source data and masked target data, and data subsets are divided by random masking operations; Forward diffusion noise addition is performed on the visible subset, and Markov chain is used to model the noise diffusion. Special basic data units are concatenated into the input sequence, and adaptive feature calibration is achieved through a conditional Transformer architecture. A domain discriminator and a gradient inversion layer are introduced in the intermediate layer between the encoder and decoder to drive the learning of domain-invariant features. The conditional Transformer encoder and diffusion decoder are used to perform inverse denoising to gradually restore the original data; By jointly optimizing the denoising, reconstruction, and adversarial losses, the total pre-training loss is obtained, and the pre-trained encoder model is output.

[0009] Furthermore, the forward noise addition process employs preset noise scheduling parameters and achieves signal and noise mixing through a multi-step weighting method.

[0010] Furthermore, the dual-branch spatial spectral attention module described in S3 includes: The spatial feature extraction branch uses two-dimensional convolutional kernels to extract spatial context features; The spectral feature extraction branch captures spectral sequence features through a one-dimensional convolutional layer; The feature fusion unit enhances features by adjusting local and global channel weights.

[0011] Furthermore, the global-local prototype knowledge distillation framework described in S4 includes: The student model distills discriminative meta-knowledge from cross-domain data through a few-shot learning strategy. The teacher model provides supervisory signals for prototype alignment; Historical student models are used to assist in local comparative learning.

[0012] Furthermore, the differentiated enhancement strategy described in S4 involves the student model processing the strongly enhanced feature version, while the teacher model and the historical student model process the weakly enhanced feature version, and the parameters of the historical student model are updated after each training iteration.

[0013] Furthermore, the global prototype alignment described in S5 includes: The teacher model extracts prototype vectors for each category from the target domain data; The student model extracts features from data in the same target domain and calculates student prototype vectors; The student model gradually aligns with its prototype distribution by minimizing the distance from the teacher prototype.

[0014] Furthermore, the local contrastive learning described in S5 includes: Construct positive sample pairs of features between the student model and the historical student model; Use the characteristics of other samples in the same batch as negative samples; Feature space optimization is achieved by comparing the similarity between positive and negative samples.

[0015] Furthermore, the signal-to-noise ratio enhancement loss described in S5 is expressed as follows:

[0016] in, Represents the true value. Indicates the predicted value. Indicates clean signal power. This represents the noise power corresponding to the prediction error.

[0017] In summary, the present invention has at least one of the following beneficial technical effects: By leveraging the synergistic effect of diffusion-enhanced pre-training (DA-PT) and prototype knowledge distillation, domain shift and source domain bias are effectively suppressed, reducing inter-class confusion and noise interference in the target domain. By combining the unsupervised domain adaptation module with the diffusion model and domain adversarial learning, robust features are extracted from noisy data, reducing feature distribution differences and improving classification accuracy in cross-domain scenarios. A dual-branch spatial spectral attention (DB-SSA) module is employed to capture global and local spectral-spatial dependencies, thereby enhancing feature representation. Global-Local Prototype Knowledge Distillation (GL-PKD) addresses the issues of increased class divergence and blurred inter-class boundaries through prototype alignment and local contrastive learning, thereby improving feature separability. In the early stages of training, feature alignment is given priority, and classification supervision is gradually strengthened by adaptively adjusting the loss weights. In addition, signal-to-noise ratio enhancement loss is combined to effectively reduce noise interference. Attached Figure Description

[0018] Figure 1 This is a flowchart of the present invention; Figure 2 This is a model architecture diagram of the present invention; Figure 3 This is a schematic diagram of the network architecture for diffusion-enhanced pre-training according to the present invention; Figure 4 This is a schematic diagram of global-local prototype knowledge distillation according to the present invention.

[0019] Figure 5 This is a block diagram showing the output classification results of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0021] This embodiment provides a hyperspectral image classification method based on diffusion-enhanced prototype knowledge distillation and cross-domain few-shot learning, such as... Figure 1 As shown, it includes the following steps: S1: Data preparation: Based on the hyperspectral images of the source and target domains, extract neighborhood data cubes centered on pixels, unify data dimensions through a spectral alignment mapping layer, divide the support set and query set, and introduce a masking mechanism and noise perturbation strategy to implement data augmentation. S2: Diffusion-enhanced pre-training uses a diffusion model to perform domain adversarial denoising and reconstruction tasks on visible source data and masked target data. It embeds a domain discriminator and combines a gradient inversion layer to align the feature distributions of the source and target domains, and outputs a pre-trained encoder model. S3: Meta-knowledge extraction uses a dual-branch spatial-spectral attention module to decouple features, capture global and local dependencies in the spectral-spatial dimension, and calculates the similarity between query set features and category prototypes through a few-shot learning strategy; S4: Few-shot learning transfer, constructing a global-local prototype knowledge distillation framework that includes student models, teacher models and historical student models, and achieving knowledge transfer through differentiated enhancement strategies; S5: Global-local prototype knowledge distillation, combining global prototype alignment and local contrastive learning to optimize model parameters, teacher model extracts target domain category prototypes to guide student model feature distribution alignment, historical student model strengthens local consistency through contrastive learning, and introduces signal-to-noise ratio enhancement loss to suppress noise interference; S6: Output classification results. Use the optimized student model to extract features from unlabeled samples in the target domain and generate hyperspectral image classification results through a K-NN classifier.

[0022] The following examples are used in conjunction with Figure 2 Detailed explanation.

[0023] S1: Data preparation. Based on the hyperspectral images of the source and target domains, neighborhood data cubes are extracted with pixels as the center. The data dimension is unified through a spectral alignment mapping layer, and the support set and query set are divided. A masking mechanism and noise perturbation strategy are introduced to implement data augmentation.

[0024] The source and target domains are processed by extracting neighborhood data cubes centered on each pixel, dividing them into query and support sets. A mapping layer is used to align the data to a unified dimension, and a masking mechanism and noise perturbation strategy are introduced to perform data augmentation. In the data preparation stage, the input hyperspectral images for the source and target domains are respectively... and ,in and Indicates the height and width of the spatial dimension. and These represent the spectral dimensions of the source and target domains, respectively.

[0025] First, using each pixel of the source and target domain images as the center, extract neighborhood data blocks of a predetermined size, such as: neighborhood data blocks ,in The pixel block size.

[0026] Secondly, a spectral alignment mapping layer transforms data blocks with different spectral dimensions into a unified dimension. To address the issue of spectral resolution differences caused by different sensors, a further spectral alignment mapping layer is used to transform the source domain... With the target domain Convert to a unified Data blocks, in which The unified spectral dimensions.

[0027] Next, a number of samples are selected from each of the multiple categories, and divided into a support set for training and a query set for evaluation. Specifically, from... Select from each category Each sample is divided into a support set. With query set ,in and These represent the number of samples in the support set and the query set, respectively. The support set is used for training, and the query set is used for model performance evaluation.

[0028] Finally, addressing the issue of temperature parameter dependence on empirical settings in traditional knowledge distillation methods, a strong mask and noise enhancement are applied to the student model to improve its feature robustness; while a weak mask and noisy samples are used for the teacher model to generate stable supervision signals. Specifically, given labeled samples... By applying masks and noise of different intensities, two enhanced versions are generated. and They share the same tag .

[0029] S2: Diffusion-enhanced pre-training uses a diffusion model to perform domain adversarial denoising and reconstruction tasks on visible source data and masked target data. It embeds a domain discriminator and combines a gradient inversion layer to align the feature distributions of the source and target domains, outputting a pre-trained encoder model.

[0030] The diffusion-enhanced pre-training phase includes ( Figure 3The algorithm samples hyperspectral image patches from visible source data and masked target data, and divides the data into subsets through random masking. It then performs forward diffusion noise addition on the visible subsets, using a Markov chain to model the noise diffusion. Special basic data units are concatenated into the input sequence, and adaptive feature calibration is achieved through a conditional Transformer architecture. A domain discriminator and gradient inversion layer are introduced in the intermediate layer between the encoder and decoder to drive domain-invariant feature learning. Inverse denoising is performed using the conditional Transformer encoder and diffusion decoder to gradually recover the original data. Finally, the denoising, reconstruction, and adversarial losses are jointly optimized to obtain the total pre-training loss, and the pre-trained encoder model is output.

[0031] First, hyperspectral image patches are sampled from the visible source data and the masked target data. Then, through a random mask operation with a preset ratio, the... Divide into visible subsets and mask subset During this process, The center pixel will be retained in This is to preserve critical information. Subsequently, [the following is done / under review / etc.]... The noise addition operation employs preset noise scheduling parameters in its forward noise addition process, achieving signal-noise mixing through a multi-step weighting method. The forward process of the diffusion model is modeled using a Markov chain. The initial state... Indicates no noise input. This represents the data obtained by weighting the signal and noise. The forward noise addition process of diffusion is defined as shown in formula (1).

[0032] (1) in , , These are the preset noise scheduling parameters. It is an identity matrix.

[0033] Simultaneously, two special tokens (basic data units, i.e., one of multiple local regions in hyperspectral image segmentation) are concatenated into the input sequence: a classification token. and time-embedded token .in Random initialization, Based on diffusion steps It is obtained through the sinusoidal position encoding formulas (2) and (3).

[0034] (2) (3) in This indicates the embedding dimension of the time token. , .after, After being encoded by two layers of MLP, it is incorporated into the sequence.

[0035] Secondly, due to the significant advantages of the Conditional Transformer architecture in image generation, this architecture encodes class labels as conditional vectors and injects them into the layer normalization module via affine transformation. By establishing... By linking with the layer-normalized affine parameters, adaptive feature calibration of the input patch is achieved under different noise levels. The encoding process is shown in the following equation.

[0036] (4) (5) (6) in, express The Input token, For linear embedding layers, For location embedding, For the number of floors, This indicates conditional layer normalization.

[0037] The intermediate layer between the encoder and the decoder is represented as shown in Equation (7).

[0038] (7) in, Representation layer normalization. This represents the intermediate feature representation generated by the encoder module.

[0039] Simultaneously, a domain discriminator is introduced in the intermediate layer between the encoder and decoder, combined with a gradient inversion layer (GRL). During backpropagation, the gradients are inverted, thereby driving the encoder to learn domain-invariant features: (8) The adversarial loss function is: (9) in, For the domain-invariant features extracted by the encoder, For domain discriminators.

[0040] Subsequently, the conditional Transformer encoder and the diffusion decoder are used for inverse denoising. The diffusion decoder process is shown in equations (9)-(11).

[0041] (10) (11) (12) The reverse process is modeled as a Markov chain. The Gaussian noise injected during forward diffusion is gradually removed. For learnable parameters, for those derived from Generated denoised output The reverse process can effectively remove additive noise while maintaining data consistency, i.e., minimizing the learned reverse process. With target distribution The distribution differences between them. Therefore, at each time step Mandatory constraints and The variances are equal, and it is deduced that... As shown in formula (13).

[0042] (13) Among them, noise item Sampling from the standard normal distribution It is an identity matrix.

[0043] Finally, the loss function is used. To optimize parameters ,in It is a noise predictor. Correspondingly, this study constructs two decoders for denoising and reconstruction tasks, respectively. The denoising loss and reconstruction loss are shown in equations (14) and (15), respectively.

[0044] (14) (15) The final pre-training loss is: (16) Output pre-trained encoder model This model possesses cross-domain robust feature extraction capabilities. Through domain adversarial learning and diffusion denoising optimization, it can generate domain-invariant feature representations, providing fundamental support for the subsequent meta-knowledge extraction stage.

[0045] S3: Meta-knowledge extraction employs a dual-branch spatial-spectral attention module to decouple features, capture global and local dependencies in the spectral-spatial dimension, and calculates the similarity between query set features and category prototypes through a few-shot learning strategy.

[0046] To enhance the feature representation capability of hyperspectral image classification tasks in cross-domain few-shot learning, a dual-branch spatiotemporal-spectral attention (DB-SSA) module was designed, comprising: a spatial feature extraction branch, which extracts spatial context features using two-dimensional convolutional kernels; a spectral feature extraction branch, which captures spectral sequence features through one-dimensional convolutional layers; and a feature fusion unit, which enhances features through local and global channel weight adjustments. In this module, the input hyperspectral image patch... First, the features are embedded into a spatiotemporal-spectral embedding metric space to form embedded features. In the DB-SSA module, the spatial branch uses a two-dimensional convolutional kernel to extract spatial context features. The spectral branch captures spectral sequence features through a one-dimensional convolutional layer. Subsequently, a three-dimensional average pooling operation is introduced to compress the spatial dimension and generate local channel weights. The learned weights and input features Perform element-wise multiplication to generate an intermediate representation. Then, regarding Perform a second three-dimensional average pooling, and then sequentially pass through two... Convolution operation: The first convolution compresses the channel dimension to ( (For compression ratio), the second convolution reconstructs the original channel dimensions. This processing ultimately generates global channel attention weights through Sigmoid activation. and apply it ,get Finally, regarding the spatial branching... Apply Sigmoid activation, and with Combined, the output features are obtained. .

[0047] Then, we use a pre-trained encoder as a feature extractor. By simultaneously performing few-shot learning in both the source and target domains, the model can effectively achieve cross-domain knowledge transfer, thereby enhancing its ability to identify new categories in the target domain. Taking FSL training in the source domain as an example, during the training process, from... Randomly selected from the source categories Each category forms a training task. Each training task performs few-shot classification by calculating the Euclidean distance between the query set feature embeddings and the category prototypes. Finally, the distance is mapped to the query sample. The predicted probability is given by the formula (17).

[0048] (17) in, The embedding representation of the corresponding query set sample represents the class discrimination features in the latent space. Prototype vector For the first The class supports the center point of the set of samples, locating each class in geometric space. Metric function. Used to calculate the Euclidean distance between eigenvectors. This represents unlabeled query samples that need to be categorized. This indicates its true category.

[0049] The loss function for few-sample learning of the source domain query set is calculated based on the predicted probability, as shown in formula (18).

[0050] (18) in, Indicates the supported set size. This represents the size of the query set. Similarly, the loss function for small sample learning of the target domain query samples can be expressed as shown in formula (19).

[0051] (19) The overall loss function for small sample learning is expressed as shown in Equation (20).

[0052] (20) S4: Few-shot learning transfer, constructing a global-local prototype knowledge distillation framework that includes student models, teacher models and historical student models, and achieving knowledge transfer through a differentiated enhancement strategy.

[0053] The core objective of cross-domain few-shot learning is to extract and remove partial meta-knowledge. To address the distribution alignment bias caused by the dominance of source domain data, thereby reducing systematic bias in target domain prediction and promoting sustainable knowledge interaction between the source and target domains, this invention introduces a prototype knowledge distillation strategy, in which a teacher model guides a student model to autonomously learn downstream tasks.

[0054] The global-local prototypical knowledge distillation framework comprises three core components: student model Teacher Model and history student model Within this framework, the student model The core function is to distill discriminative meta-knowledge from cross-domain data through a few-shot learning strategy; teacher model The historical student model is responsible for providing supervisory signals for prototype alignment. It is responsible for assisting local contrastive learning. Meanwhile, considering the pre-trained model's ability to extract features from masked and noisy hyperspectral samples, it is used in the student model. During training, target domain samples are enhanced with strong masks and noise amplification to extract discriminative meta-knowledge using a few-shot learning strategy, while the teacher model... and history student model During training, weak masks and noise enhancements are applied to the target domain samples, thereby increasing the possibility of improving classification accuracy during the knowledge distillation stage.

[0055] Specifically, embedded features and These represent the weak and strong enhancement versions of the same image patch, respectively. After representation using a bi-branch spatiotemporal-spectral attention enhancement feature, Input Obtain features , Enter them separately and Obtain features and . and Maintain the same initial parameter configuration and use a consistent training strategy during training. After each iteration, transfer the previous generation... Archive as These features are then used together with the current model for feature extraction in subsequent training phases. The aforementioned differentiated enhancement strategy involves the student model processing strongly enhanced feature versions, while the teacher model and historical student models process weakly enhanced feature versions. The parameters of the historical student model are updated after each training iteration.

[0056] The student model acts as the primary learner, the teacher model provides guidance, and the historical model facilitates comparison. Differentiation enhancement ensures robustness and stability. Knowledge transfer is achieved through feature extraction and parameter updates.

[0057] S5: Global-local prototype knowledge distillation, combining global prototype alignment and local contrastive learning to optimize model parameters. The teacher model extracts the target domain category prototype to guide the student model feature distribution alignment. The historical student model strengthens local consistency through contrastive learning, and introduces signal-to-noise ratio enhancement loss to suppress noise interference.

[0058] The teacher model extracts class prototype features from the target domain data to achieve global prototype alignment. The historical student network strengthens the consistency of local features through contrastive learning. It combines adaptive weighted fusion of global prototype distillation loss and local contrastive loss, and introduces signal-to-noise ratio enhancement loss to suppress noise interference.

[0059] 1) Global prototype alignment ( Figure 4 ) The teacher model extracts prototype vectors for each category from the target domain data, serving as discriminative reference points for that category in the feature space. The student model extracts features from the same target domain data and calculates student prototype vectors. The student model gradually aligns its prototype distribution by minimizing the distance to the teacher prototype, constructing a class discrimination structure consistent with the teacher model. This prototype-driven transfer strategy achieves cross-domain feature alignment and transfers discriminative meta-knowledge.

[0060] Specifically, teacher model Embedding features in the target domain The samples are encoded and grouped by class according to their predicted pseudo-labels. Then, the prototype vector of each class is calculated by grouping, as shown in Equation (21).

[0061] (twenty one) in, This indicates that the pseudo-tag belongs to the first... The number of samples in the class.

[0062] Similarly, student model Extract features from data in the same target domain and calculate student prototype vectors. .

[0063] Finally, the cosine similarity loss between the teacher and student prototypes is minimized as shown in Equation (22).

[0064] (twenty two) 2) Local contrastive learning ( Figure 4 ) Local contrastive learning drives the student model to learn class-discriminative local feature representations by constructing feature similarity comparisons between positive and negative sample pairs. This method achieves compact intra-class and separated inter-class features in the feature space by maximizing the similarity of positive sample pairs and minimizing the similarity of negative sample pairs, thus enhancing the model's ability to capture class boundaries. Local contrastive learning includes constructing positive sample pairs of features from the student model and historical student models; using features from other samples in the same batch as negative samples; and optimizing the feature space by comparing the similarity between positive and negative samples.

[0065] Specifically, for embedded features and Student Model Generate output features History student model Generate output features The two constitute a positive sample pair The feature set generated from the remaining samples in the same training batch. As negative samples, they participate in contrastive learning. Contrastive learning is achieved by maximizing the similarity of positive sample pairs and suppressing the similarity of negative sample pairs, as shown in formula (23). (twenty three) in, This is the temperature coefficient.

[0066] The total loss function of the global-local prototype knowledge distillation module is expressed as shown in Equation (24).

[0067] (twenty four) in, For classification loss function, and These are weight parameters that are dynamically adjusted during training. In the early stages of training, the focus is on global distribution alignment, while in the later stages, the emphasis shifts to refining local features.

[0068] To effectively reduce the interference of redundant and noisy data on model performance, higher signal-to-noise ratio (SNR) samples are given greater weight, while lower SNR samples are penalized less. The SNR enhancement loss function is defined as shown in formula (24). (twenty four) in, Represents the true value. Indicates the predicted value. Characterizing clean signal power, Characterizes the noise power corresponding to the prediction error.

[0069] Finally, the loss function of the overall method is expressed as the sum of three parts, as shown in formula (25).

[0070] (25) S6: Output the classification results, using the optimized student model distilled with global-local prototype knowledge. Feature extraction is performed on unlabeled samples in the target domain, and hyperspectral image classification results are generated using a K-NN classifier. Figure 5 ).

[0071] In the meta-testing phase, all unlabeled pixels in the target domain are first input into the student model optimized by global-local prototype knowledge distillation. In the process, feature vectors of unlabeled samples in the target domain are extracted. Then, a K-NN classifier is used to calculate the distance to each feature vector, select the K nearest neighbor samples, and derive the predicted label based on the majority voting principle, finally generating a hyperspectral image classification result map.

[0072] Embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0073] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0074] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0075] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0076] Contents not described in detail in this specification are prior art known to those skilled in the art. It is hereby indicated that the above description is intended to help those skilled in the art understand this invention, but does not limit the scope of protection of this invention. Any equivalent substitutions, modifications, improvements, or simplifications of the above descriptions that do not depart from the essential content of this invention fall within the scope of protection of this invention.

Claims

1. A hyperspectral image classification method based on diffusion-enhanced prototype knowledge distillation for cross-domain small sample learning, characterized in that, The method comprises the following steps: S1: data preparation, based on the source domain and the target domain, extracting a neighborhood data cube centered on each pixel of the hyperspectral image, mapping the data dimensions through spectral alignment, dividing the support set and the query set, and introducing a mask mechanism and a noise disturbance strategy to implement data enhancement; S2: diffusion enhancement pre-training, using a diffusion model to perform domain adversarial denoising and reconstruction tasks on visible source data and masked target data, embedding a domain discriminator and combining a gradient reversal layer to align the feature distributions of the source domain and the target domain, and outputting a pre-trained encoder model; S3: meta-knowledge extraction, using a double-branch spatial-spectral attention module to decouple the features, capture the global and local dependencies in the spectral-spatial dimensions, and calculate the similarity between the query set features and the class prototypes through a small sample learning strategy; S4: small sample learning transfer, constructing a global-local prototype knowledge distillation framework including a student model, a teacher model and a historical student model, and realizing knowledge transfer through a differential enhancement strategy; S5: global-local prototype knowledge distillation, combining global prototype alignment and local contrastive learning to optimize model parameters, the teacher model extracts target domain class prototypes to guide the student model feature distribution alignment, the historical student model strengthens local consistency through contrastive learning, and a signal-to-noise ratio enhancement loss is introduced to suppress noise interference; S6: output classification results, using the optimized student model to extract features of unlabelled samples in the target domain, and generating hyperspectral image classification results through a K-NN classifier.

2. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, The S1 comprises: extracting a data block of a predetermined size centered on each pixel of the source domain image and the target domain image; convert the data blocks of different spectral dimensions to a uniform dimension through a spectral alignment mapping layer; select several samples from each of the plurality of classes to divide into a support set for training and a query set for evaluation; apply strong masking and noise enhancement to the student model, and use weak masking and noisy samples for the teacher model.

3. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, The S2 comprises: sampling hyperspectral image blocks from visible source data and masked target data, and dividing the data subsets through random masking operations; performing diffusion forward noise addition on the visible subset, and modeling noise diffusion using a Markov chain; splicing special basic data units in the input sequence, and implementing adaptive feature calibration through a conditional Transformer architecture; introducing a domain discriminator and a gradient reversal layer in the middle layer of the encoder and the decoder to drive domain-invariant feature learning; using a conditional Transformer encoder and a diffusion decoder to perform reverse denoising to gradually restore the original data; jointly optimizing denoising, reconstruction and adversarial loss to obtain a total pre-training loss, and outputting a pre-trained encoder model.

4. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 3, characterized in that: The diffusion forward noise addition uses preset noise scheduling parameters to mix the signal and the noise through a multi-step weighting method.

5. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, The double-branch spatial-spectral attention module in S3 comprises: a spatial feature extraction branch using a two-dimensional convolution kernel to extract spatial context features; a spectral feature extraction branch capturing spectral sequence features through a one-dimensional convolution layer; a feature fusion unit implementing feature enhancement through local and global channel weight adjustment.

6. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, The global-local prototype knowledge distillation framework in S4 comprises: Student model, distilling discriminative meta-knowledge from cross-domain data by small sample learning strategy; Teacher model, providing supervision signal of prototype alignment; Historical student model, assisting local contrastive learning.

7. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that: S4 describes the differential enhancement strategy, that is, the student model processes the strong enhancement feature version, the teacher model and the historical student model process the weak enhancement feature version, and the historical student model parameters are updated after each training iteration.

8. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, S5 describes the global prototype alignment, including: The teacher model extracts prototype vectors of each category from the target domain data; The student model extracts features from the same target domain data and calculates student prototype vectors; The student model gradually aligns its prototype distribution by minimizing the distance with the teacher prototype.

9. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, S5 describes the local contrastive learning, including: Constructing positive sample pairs of student model and historical student model features; Using the features of other samples in the same batch as negative samples; Optimizing the feature space by comparing the similarity of positive and negative samples.

10. The hyperspectral image classification method based on diffusion enhanced prototype knowledge distillation for cross-domain few-shot learning according to claim 1, characterized in that, The signal-to-noise ratio enhancement loss in S5 is expressed as: ; wherein, represents a real value, represents a predicted value, represents a clean signal power, represents a noise power corresponding to a prediction error.

Citation Information

Cited By

  • Cross-domain image classification based on self-supervised spectral space modeling

    CN121837940A

  • Cross-domain image classification based on self-supervised spectral space modeling

    CN121837940B