Hyperspectral image classification method based on self-supervised contrast learning network
By using a self-supervised contrastive learning network and combining rotation prediction and mask reconstruction tasks, feature extraction and fusion of hyperspectral images are performed, which solves the problem of insufficient feature extraction under conditions with few labels and achieves efficient and accurate hyperspectral image classification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-17
AI Technical Summary
Existing hyperspectral remote sensing image classification methods suffer from insufficient feature extraction under conditions of few labels, neglect the correlation between spatial and spectral channels, have weak generalization ability, and have high model complexity, redundancy, and computational cost.
We employ a self-supervised contrastive learning network approach, utilizing a dual-task self-supervised module, a dual-branch spatial-spectral feature extraction and fusion module, and a self-supervised contrastive feature learning module. We pre-train on unlabeled data using rotation prediction and mask reconstruction tasks, and combine spatial and spectral dual attention mechanisms for feature extraction and fusion, thereby reducing model complexity and improving generalization ability.
With a small number of labeled samples, it effectively extracts robust and discriminative features, achieves high-precision classification, reduces dependence on labeled data, and improves training efficiency and classification accuracy.
Smart Images

Figure CN121884138A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hyperspectral remote sensing image processing technology, specifically to a hyperspectral image classification method based on a self-supervised contrastive learning network. Background Technology
[0002] Hyperspectral images (HSI) are three-dimensional cubic data that simultaneously contain two-dimensional spatial information and one-dimensional spectral information. They can finely characterize the material composition and spatial structure of objects on the Earth's surface within a narrow spectral range, and are therefore widely used in agriculture, environmental monitoring, military reconnaissance, and many other fields. The core task of hyperspectral image classification is to extract discriminative features from its massive, high-dimensional data for model prediction.
[0003] Traditional classification methods, such as K-Nearest Neighbors (KNN) and Support Vector Machines (SVM), typically rely on manually designed features or raw spectral curves. These methods have limited ability to distinguish between "same object, different spectra" and "different object, same spectrum" phenomena, and suffer from limited feature extraction capabilities, failing to fully exploit the rich, deep spatial-spectral joint feature information within hyperspectral data. In recent years, deep learning methods, leveraging their powerful feature extraction capabilities based on Convolutional Neural Networks (CNNs), have been widely applied in hyperspectral image classification. By constructing deep networks capable of simultaneously learning both spatial texture and spectral discrimination features, the classification accuracy and robustness of the model can be effectively improved.
[0004] However, existing deep learning methods still face two major problems: First, the models heavily rely on large amounts of labeled data. Pixel-level annotation of hyperspectral images requires experts with specialized domain knowledge, and is time-consuming and costly. When faced with insufficient labeled data, complex deep learning models suffer from overfitting, and their generalization ability decreases significantly. Second, the models also face the problems of excessive complexity and feature redundancy. Existing network models often have complex structures and large numbers of parameters in pursuit of higher classification accuracy, which leads to increased computational costs and slower inference speed. Furthermore, the networks often extract a large amount of redundant spatial or spectral feature information, failing to form a compact and efficient feature representation.
[0005] To reduce reliance on labeled data, self-supervised learning techniques have been applied to hyperspectral image processing. These methods extract various predefined pre-defined tasks, enabling the model to learn useful features from unlabeled data. However, existing self-supervised methods often employ a single pre-defined task, resulting in limited representational power of the learned features and failing to fully utilize the unique spatial-spectral duality of hyperspectral data. Furthermore, designing lightweight and efficient self-supervised network architectures to reduce model complexity and redundancy while ensuring the extraction of useful features remains a key challenge. Summary of the Invention
[0006] Objective: To address the shortcomings of existing hyperspectral remote sensing image classification algorithms, such as insufficient feature extraction under limited label conditions, neglect of spatial and spectral channel correlations, and weak generalization ability, this invention proposes a hyperspectral image classification method based on a self-supervised contrastive learning network. This method simultaneously acquires rich spatial-spectral features by introducing dual self-supervised task pre-training and a dual-branch spatial-spectral feature extraction and fusion module. Furthermore, an improved surrogate task network is incorporated to reduce spatial and spectral redundancy in deep neural networks, thereby enhancing the model's generalization ability and achieving high-precision classification with a limited number of labeled samples.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] This invention provides a hyperspectral image classification method based on a self-supervised contrastive learning network, comprising the following steps:
[0009] S1: Construct the overall network, including a dual-task self-supervised module, a dual-branch spatial-spectral feature extraction and fusion module, and a self-supervised contrastive feature learning module. The dual-branch spatial-spectral feature extraction and fusion module includes a spatial branch module and a spectral branch module.
[0010] S2: The dual-task self-supervised module constructs two parallel self-supervised agent tasks—rotation prediction and mask reconstruction—by applying two different geometric and content transformations to the same image sample. This drives the network to learn discriminative spatial-spectral feature representations under unlabeled conditions. This module effectively utilizes the structural information of the image itself as a supervision signal, solving the problem of insufficient feature learning in scenarios with few labels.
[0011] S3: The dual-branch spatial-spectral feature extraction and fusion module constructs parallel spatial and spectral dual-branch processing paths to extract spatial texture features and spectral discriminative features from hyperspectral images, respectively. It also introduces a dual spatial and spectral attention mechanism to adaptively calibrate and enhance the extracted features. Finally, a weighted fusion strategy is used to effectively integrate the two types of optimized features to form a joint feature representation with stronger discriminative power. This module solves the problems of insufficient utilization of spatial and spectral information, feature redundancy, and weak adaptive ability of the fusion process in hyperspectral data.
[0012] S4: The self-supervised contrastive feature learning module serves as the overall optimization framework. By constructing and optimizing a multi-task joint loss function, it organically combines the three tasks of rotation prediction, mask reconstruction, and explicit instance contrast, and collaboratively drives the spatial-spectral feature extraction and fusion module to learn structured and highly discriminative feature representations. This module solves the problems of limited signals and underutilization of inter-sample relationships in a single self-supervised task.
[0013] S5: The dual-task self-supervised module, the dual-branch spatial spectral feature extraction and fusion module, and the self-supervised contrastive feature learning module are integrated to form a new type of self-supervised contrastive learning convolutional neural network.
[0014] S6: The existing network is pre-trained using self-supervised contrastive learning to refine feature extraction capabilities and determine model parameters. Subsequently, the parameters are fine-tuned using a small amount of data. Finally, a fully connected layer completes the final classification and outputs the results. This method significantly reduces model complexity while improving network training efficiency.
[0015] Furthermore, the self-supervised training process of the rotating mask self-supervised module in step S2 is as follows:
[0016] A1: Input hyperspectral image patch Perform random rotation enhancement processing; from a preset set of discrete angles. A rotation angle is randomly selected with moderate probability. Then on Perform the corresponding rotation transformation to obtain the rotated enhanced sample. And generate corresponding rotation angle category labels. ;
[0017] A2: For the same original image patch Perform random masking; generate a mask that matches... Random binary mask matrix of the same size The mask ratio is Positions with a value of 0 indicate that the image is masked; the enhanced image after masking is obtained by multiplying element by element. ;
[0018] A3: Rotate the enhanced sample The input is a shared feature extraction encoder that extracts high-level features. These features are then passed through a global average pooling layer and a lightweight rotation classifier to predict the rotation angle, and the output is a predicted probability distribution. ;
[0019] A4: Enhance the image with a mask Features are extracted from the same shared feature extraction encoder; then this feature map is fed into a lightweight decoder, which consists of several upsampling layers and The convolutional layers are stacked to gradually restore the spatial dimensions and number of channels of the image, and output the reconstructed image. ;
[0020] A5: Calculate rotation prediction loss The cross-entropy loss function is used, and the calculation formula is as follows: ,in Rotation angle The corresponding one-hot encoding;
[0021] A6: Calculate the mask reconstruction loss To guide the model to focus on learning the contextual information of the masked portion, the loss is calculated only in the masked region; mean squared error loss is used, and the formula is as follows: ,in Represents the set of all masked pixel locations;
[0022] A7: The weighted sum of the rotation prediction loss and the mask reconstruction loss constitutes the overall optimization objective of this module. ,in and It is a hyperparameter that balances the weights of the two tasks; the parameters in the shared encoder, rotation classifier, and reconstruction decoder built in the website are optimized through the backpropagation algorithm;
[0023] Furthermore, in step S3, the process of feature extraction, enhancement, and fusion performed by the spatial spectrum feature extraction and fusion module is as follows:
[0024] B1: Input is the hyperspectral image features obtained after processing by the dual-branch self-supervised module. First, the input features are copied and fed into two parallel branches: spatial and spectral.
[0025] B2: Input The input is fed into a spatial feature extraction subnetwork consisting of multiple convolutional blocks, which outputs the initial spatial features. Next, the initialization features will be implemented. The input is fed into the corresponding spatial attention module; this module first aggregates the spatial information in the initialization features through global average pooling and global max pooling operations, generates two associated spatial context descriptors, and concatenates them; after concatenation, it passes through a lightweight network containing convolutional layers and a sigmoid activation function to generate a spatial attention weight map. The generated spatial attention weight map is used to reweight the initial spatial features to obtain the weighted and enhanced spatial features: ;
[0026] B3: Input Global average pooling is performed in the spatial dimension to compress the data into a spectral vector. Focusing on global information in the spectral dimension; spectral vectors The input is fed into a spectral feature extraction subnetwork consisting of multiple fully connected layers, which outputs an initial spectral feature vector. ; the initial spectral eigenvector The input is a spectral attention module; this module learns the weight information in each spectral feature channel through two fully connected layers and a sigmoid activation function, generating the corresponding spectral attention weight vector. The generated spectral attention weight vector is used to reweight the initial spectral features, resulting in a weighted and enhanced spectral feature vector. ;
[0027] B4: Enhanced spatial features Transform it into a spatial global feature vector through global average pooling. An adaptive weighted fusion strategy is adopted: the spatial global feature vectors are fused together. With spectral eigenvectors Input a fusion gated unit; this unit generates an adaptive fusion weight coefficient from the spatial and spectral feature vectors through a fully connected layer and a sigmoid function. The final output joint feature representation is generated by a weighted sum: ;
[0028] Furthermore, the process of loss calculation and joint optimization performed by the self-supervised contrastive feature learning module in step S4 is as follows:
[0029] C1: Receives the rotation prediction loss from the rotation mask self-supervised module. With mask reconstruction loss and joint feature representation from the dual-branch spatial spectrum feature extraction and fusion module ;
[0030] C2: For a batch (Batch Size = Each original sample in ) Two views are generated respectively through random rotation and masking. and A positive sample pair is formed; the generated views are sequentially passed through a dual-branch spatial spectral feature extraction and fusion module to obtain their joint feature representation. and The joint feature representation is passed through a projection head, which is a multilayer perceptron, to map the features to a lower-dimensional space that is more suitable for contrast, thus obtaining the projected features. and ;
[0031] C3: Calculate the explicit instance contrast loss : Normalized temperature-scaled cross-entropy loss is used; for a positive sample pair The loss is calculated as follows:
[0032]
[0033] The total contrastive loss is the average of the losses for all positive sample pairs:
[0034] ;
[0035] C4: Rotate the prediction loss Mask reconstruction loss Loss compared to explicit instances By performing the appropriate weighted summation, the overall optimization objective of the module can be obtained: ,in An adjustable hyperparameter to balance the importance of the three tasks;
[0036] C5: Minimize the total objective loss using backpropagation and gradient descent algorithms. The rotating mask self-supervised module, the spatial spectral feature extraction and fusion module, and all learnable parameters in the projection head are jointly optimized. In other words, optimization is performed: ,in The learning rate;
[0037] In this invention, we first address the problem of insufficient feature learning in hyperspectral images with limited samples by designing a rotation-mask self-supervised module. This module applies two different geometric and content transformations—rotation and masking—to the same image sample. The rotation prediction task enables the network to learn the global semantic structure and spatial layout information of the image, while the mask reconstruction task enables the network to learn the local context and spectral continuity information of the image. Both tasks utilize the same feature extraction encoder, and through joint optimization, the network learns more detailed feature representations without relying on any manual annotation, effectively solving the difficulty of feature learning under conditions of scarce labeled data.
[0038] Secondly, the enhanced features are input into a dual-branch spatial-spectral feature extraction and fusion module, which employs a spatial and spectral dual-branch structure. The spatial branch utilizes a deep convolutional network combined with a spatial attention module to enhance important spatial feature information; the spectral branch, through a fully connected network and spectral attention mechanism, focuses on more discriminative spectral band information. Finally, an adaptive weighted fusion strategy is used to weightedly fuse the enhanced global spatial features and spectral features, forming a more discriminative joint spatial-spectral feature representation. This achieves feature complementarity and deep fusion of spatial-spectral information, effectively solving the problems of insufficient spatial-spectral information extraction and low fusion efficiency in hyperspectral images.
[0039] Next, a self-supervised contrastive feature learning module was used as a unified model framework. This module is not limited to self-supervised signals for a single task, but innovatively combines rotation prediction loss, mask reconstruction loss, and an implicit contrastive learning objective. By constructing a multi-task joint loss function and co-optimizing it, this module enables the model to learn semantic invariance to rotation, contextual sensitivity to mask regions, and good separability of sample features in the latent space. Without constructing complex negative sample pairs, it can efficiently guide the network to learn a structured and discriminative feature space, which is beneficial for subsequent downstream classification tasks.
[0040] Finally, the features extracted and enhanced by the above modules are used as a classifier through a fully connected layer. After pre-training, we retain only the trained dual-branch spatial spectral feature extraction and fusion module as the feature extractor, connect it to a new classification head, and fine-tune the model with a small number of labeled samples to obtain the final classification result.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0042] (1) To solve the classification problem when there is insufficient labeled data, the dual-task self-supervised module of rotation prediction and mask reconstruction is used to pre-train the unlabeled data, which can effectively reduce the model's dependence on labeled data and learn features with strong robustness and high discriminativeness.
[0043] (2) To enhance key feature information, reduce information redundancy, and achieve feature complementarity and deep fusion of spatial and spectral information, a dual-branch spatial-spectral feature extraction and fusion module is introduced.
[0044] (3) To accelerate the convergence speed and improve the classification accuracy, a self-supervised contrastive learning module is used. Attached Figure Description
[0045] Figure 1 This is a network model diagram for an embodiment of the present invention;
[0046] Figure 2 Diagram of the dual-task self-supervised module model;
[0047] Figure 3 This is a model diagram of the spatial spectral feature extraction and fusion module;
[0048] Figure 4 A diagram of the self-supervised contrastive feature learning module model; Detailed Implementation
[0049] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0050] like Figure 1 As shown in the figure, an embodiment of the present invention discloses a hyperspectral image classification method based on a self-supervised contrastive learning network, which includes the following steps:
[0051] Furthermore, in step S2, as follows Figure 2 The self-supervised training process of the rotating mask self-supervised module shown is as follows:
[0052] A1: Input hyperspectral image patch Perform random rotation enhancement processing; from a preset set of discrete angles. A rotation angle is randomly selected with moderate probability. Then on Perform the corresponding rotation transformation to obtain the rotated enhanced sample. And generate corresponding rotation angle category labels. ;
[0053] A2: For the same original image patch Perform random masking; generate a mask that matches... Random binary mask matrix of the same size The mask ratio is Positions with a value of 0 indicate that the image is masked; the enhanced image after masking is obtained by multiplying element by element. ;
[0054] A3: Rotate the enhanced sample The input is a shared feature extraction encoder that extracts high-level features. These features are then passed through a global average pooling layer and a lightweight rotation classifier to predict the rotation angle, and the output is a predicted probability distribution. ;
[0055] A4: Enhance the image with a mask Features are extracted from the same shared feature extraction encoder; then this feature map is fed into a lightweight decoder, which consists of several upsampling layers and The convolutional layers are stacked to gradually restore the spatial dimensions and number of channels of the image, and output the reconstructed image. ;
[0056] A5: Calculate rotation prediction loss The cross-entropy loss function is used, and the calculation formula is as follows: ,in Rotation angle The corresponding one-hot encoding;
[0057] A6: Calculate the mask reconstruction loss To guide the model to focus on learning the contextual information of the masked portion, the loss is calculated only in the masked region; mean squared error loss is used, and the formula is as follows: ,in Represents the set of all masked pixel locations;
[0058] A7: The weighted sum of the rotation prediction loss and the mask reconstruction loss constitutes the overall optimization objective of this module. ,in and It is a hyperparameter that balances the weights of the two tasks; the parameters in the shared encoder, rotation classifier, and reconstruction decoder built in the website are optimized through the backpropagation algorithm;
[0059] Furthermore, in step S3, as follows Figure 3 The process of feature extraction, enhancement, and fusion performed by the spatial spectral feature extraction and fusion module shown is as follows:
[0060] B1: Input is the hyperspectral image features obtained after processing by the dual-branch self-supervised module. First, the input features are copied and fed into two parallel branches: spatial and spectral.
[0061] B2: Input The input is fed into a spatial feature extraction subnetwork consisting of multiple convolutional blocks, which outputs the initial spatial features. Next, the initialization features will be implemented. The input is fed into the corresponding spatial attention module; this module first aggregates the spatial information in the initialization features through global average pooling and global max pooling operations, generates two associated spatial context descriptors, and concatenates them; after concatenation, it passes through a lightweight network containing convolutional layers and a sigmoid activation function to generate a spatial attention weight map. The generated spatial attention weight map is used to reweight the initial spatial features to obtain the weighted and enhanced spatial features: ;
[0062] B3: Input Global average pooling is performed in the spatial dimension to compress the data into a spectral vector. Focusing on global information in the spectral dimension; spectral vectors The input is fed into a spectral feature extraction subnetwork consisting of multiple fully connected layers, which outputs an initial spectral feature vector. ; the initial spectral eigenvector The input is a spectral attention module; this module learns the weight information in each spectral feature channel through two fully connected layers and a sigmoid activation function, generating the corresponding spectral attention weight vector. The generated spectral attention weight vector is used to reweight the initial spectral features, resulting in a weighted and enhanced spectral feature vector. ;
[0063] B4: Enhanced spatial features Transform it into a spatial global feature vector through global average pooling. An adaptive weighted fusion strategy is adopted: the spatial global feature vectors are fused together. With spectral eigenvectors Input a fusion gated unit; this unit generates an adaptive fusion weight coefficient from the spatial and spectral feature vectors through a fully connected layer and a sigmoid function. The final output joint feature representation is generated by a weighted sum: ;
[0064] Furthermore, in step S4, as follows Figure 4 The process of loss calculation and joint optimization in the self-supervised contrastive feature learning module shown is as follows:
[0065] C1: Receives the rotation prediction loss from the rotation mask self-supervised module. With mask reconstruction loss and joint feature representation from the dual-branch spatial spectrum feature extraction and fusion module ;
[0066] C2: For a batch (Batch Size = Each original sample in ) Two views are generated respectively through random rotation and masking. and A positive sample pair is formed; the generated views are sequentially passed through a dual-branch spatial spectral feature extraction and fusion module to obtain their joint feature representation. and The joint feature representation is passed through a projection head, which is a multilayer perceptron, to map the features to a lower-dimensional space that is more suitable for contrast, thus obtaining the projected features. and ;
[0067] C3: Calculate the explicit instance contrast loss : Normalized temperature-scaled cross-entropy loss is used; for a positive sample pair The loss is calculated as follows:
[0068]
[0069] The total contrastive loss is the average of the losses for all positive sample pairs:
[0070] ;
[0071] C4: Rotate the prediction loss Mask reconstruction loss Loss compared to explicit instances By performing the appropriate weighted summation, the overall optimization objective of the module can be obtained: ,in An adjustable hyperparameter to balance the importance of the three tasks;
[0072] C5: Minimize the total objective loss using backpropagation and gradient descent algorithms. The rotating mask self-supervised module, the spatial spectral feature extraction and fusion module, and all learnable parameters in the projection head are jointly optimized. In other words, optimization is performed: ,in The learning rate;
[0073] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A hyperspectral image classification method based on a self-supervised contrastive learning network, characterized in that, Includes the following steps: S1: Construct the overall network, including a dual-task self-supervised module, a dual-branch spatial-spectral feature extraction and fusion module, and a self-supervised contrastive feature learning module. The dual-branch spatial-spectral feature extraction and fusion module includes a spatial branch module and a spectral branch module. S2: The dual-task self-supervised module constructs two parallel self-supervised agent tasks—rotation prediction and mask reconstruction—by applying two different geometric and content transformations to the same image sample, driving the network to learn discriminative spatial-spectral feature representations under unlabeled conditions. This module effectively utilizes the structural information of the image itself as a supervision signal, solving the problem of insufficient feature learning in scenarios with few labels; S3: The dual-branch spatial-spectral feature extraction and fusion module constructs parallel spatial and spectral dual-branch processing paths to extract spatial texture features and spectral discriminative features from hyperspectral images, respectively. It also introduces a dual spatial and spectral attention mechanism to adaptively calibrate and enhance the extracted features. Finally, a weighted fusion strategy is used to effectively integrate the two types of optimized features to form a joint feature representation with stronger discriminative power. This module solves the problems of insufficient utilization of spatial and spectral information, feature redundancy, and weak adaptive ability of the fusion process in hyperspectral data. S4: The self-supervised contrastive feature learning module serves as the overall optimization framework. By constructing and optimizing a multi-task joint loss function, it organically combines the three tasks of rotation prediction, mask reconstruction, and explicit instance contrast, and collaboratively drives the spatial-spectral feature extraction and fusion module to learn structured and highly discriminative feature representations. This module solves the problems of limited signals and underutilization of inter-sample relationships in a single self-supervised task. S5: The dual-task self-supervised module, the dual-branch spatial spectral feature extraction and fusion module, and the self-supervised contrastive feature learning module are integrated to form a new type of self-supervised contrastive learning convolutional neural network. S6: The existing network is pre-trained using self-supervised contrastive learning to refine feature extraction capabilities and determine model parameters. Subsequently, the parameters are fine-tuned using a small amount of data. Finally, a fully connected layer completes the final classification and outputs the results. This method significantly reduces model complexity while improving network training efficiency.
2. The hyperspectral image classification method based on a self-supervised contrastive learning network according to claim 1, characterized in that, The self-supervised training process of the rotating mask self-supervised module in step S2 is as follows: A1: Input hyperspectral image patch Perform random rotation enhancement processing; From a pre-defined discrete perspective set A rotation angle is randomly selected with moderate probability. Then on Perform the corresponding rotation transformation to obtain the rotated enhanced sample. And generate corresponding rotation angle category labels. ; A2: For the same original image patch Perform random masking; generate a mask that matches... Random binary mask matrix of the same size The mask ratio is Positions with a value of 0 indicate that the image is masked; the enhanced image after masking is obtained by multiplying element by element. ; A3: Rotate the enhanced sample The input is a shared feature extraction encoder that extracts high-level features. These features are then passed through a global average pooling layer and a lightweight rotation classifier to predict the rotation angle, and the output is a predicted probability distribution. ; A4: Enhance the image with a mask Features are extracted from the same shared feature extraction encoder. The feature map is then fed into a lightweight decoder, which consists of several upsampling layers and The convolutional layers are stacked to gradually restore the spatial dimensions and number of channels of the image, and output the reconstructed image. ; A5: Calculate rotation prediction loss The cross-entropy loss function is used, and the calculation formula is as follows: ,in Rotation angle The corresponding one-hot encoding; A6: Calculate the mask reconstruction loss To guide the model to focus on learning the contextual information of the masked portion, the loss is calculated only in the masked region; mean squared error loss is used, and the formula is as follows: ,in Represents the set of all masked pixel locations; A7: The weighted sum of the rotation prediction loss and the mask reconstruction loss constitutes the overall optimization objective of this module. ,in and It is a hyperparameter that balances the weights of the two tasks; the parameters in the shared encoder, rotation classifier, and reconstruction decoder built in the website are optimized through the backpropagation algorithm.
3. The hyperspectral image classification method based on a self-supervised contrastive learning network according to claim 1, characterized in that, The process of feature extraction, enhancement, and fusion performed by the spatial spectrum feature extraction and fusion module in step S3 is as follows: B1: Input is the hyperspectral image features obtained after processing by the dual-branch self-supervised module. First, the input features are copied and fed into two parallel branches: spatial and spectral. B2: Input The input is fed into a spatial feature extraction subnetwork consisting of multiple convolutional blocks, which outputs the initial spatial features. Next, the initialization features will be implemented. The input is fed into the corresponding spatial attention module; This module first aggregates the spatial information in the initial features through global average pooling and global max pooling operations, generating two associated spatial context descriptors, which are then concatenated. After concatenation, a lightweight network containing convolutional layers and a sigmoid activation function is used to generate a spatial attention weight map. The generated spatial attention weight map is used to reweight the initial spatial features to obtain the weighted and enhanced spatial features: ; B3: Input Perform global average pooling in the spatial dimension to compress the data into a spectral vector. Focusing on global information in the spectral dimension; spectral vectors The input is fed into a spectral feature extraction subnetwork consisting of multiple fully connected layers, which outputs an initial spectral feature vector. ; the initial spectral eigenvector Input spectral attention module; This module learns the weight information in each spectral feature channel through two fully connected layers and a sigmoid activation function, generating the corresponding spectral attention weight vector. The generated spectral attention weight vector is used to reweight the initial spectral features, resulting in a weighted and enhanced spectral feature vector. ; B4: Enhanced spatial features Transform it into a spatial global feature vector through global average pooling. An adaptive weighted fusion strategy is adopted: the spatial global feature vectors are fused together. With spectral eigenvectors Input a fusion gated unit; this unit generates an adaptive fusion weight coefficient from the spatial and spectral feature vectors through a fully connected layer and a sigmoid function. The final output joint feature representation is generated by a weighted sum: .
4. The hyperspectral image classification method based on a self-supervised contrastive learning network according to claim 1, characterized in that, The process of loss calculation and joint optimization performed by the self-supervised contrastive feature learning module in step S4 is as follows: C1: Receives the rotation prediction loss from the rotation mask self-supervised module. With mask reconstruction loss and joint feature representation from the dual-branch spatial spectrum feature extraction and fusion module ; C2: For a batch (Batch Size = Each original sample in ) Two views are generated respectively through random rotation and masking. and A positive sample pair is formed; the generated views are sequentially passed through a dual-branch spatial spectral feature extraction and fusion module to obtain their joint feature representation. and The joint feature representation is passed through a projection head, which is a multilayer perceptron, to map the features to a lower-dimensional space that is more suitable for contrast, thus obtaining the projected features. and ; C3: Calculate the explicit instance contrast loss : Normalized temperature-scaled cross-entropy loss is used; for a positive sample pair The loss is calculated as follows: The total contrastive loss is the average of the losses for all positive sample pairs: ; C4: Rotate the prediction loss Mask reconstruction loss Loss compared to explicit instances By performing the appropriate weighted summation, the overall optimization objective of the module can be obtained: ,in An adjustable hyperparameter to balance the importance of the three tasks; C5: Minimize the total objective loss using backpropagation and gradient descent algorithms. The rotating mask self-supervised module, the spatial spectral feature extraction and fusion module, and all learnable parameters in the projection head are jointly optimized. In other words, optimization is performed: ,in This is the learning rate.