Hyperspectral classification method and system based on gaussian semantic modeling and semi-supervised comparison

CN122530804APending Publication Date: 2026-08-07JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JILIN UNIVERSITY
Filing Date
2026-05-15
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0002]Transformer架构凭借其卓越的长程依赖建模能力,已在自然语言处理和计算机视觉领域取得显著进展,并被逐渐引入高光谱图像分类任务中,然而直接将其套用于高光谱场景时仍面临诸多基础性瓶颈:首先,现有标准令牌化流程普遍采用均匀网格对图像进行硬划分,这种机械的分割方式会严重破坏高光谱数据内部固有的连续空谱关联,导致生成的离散令牌缺乏清晰且符合物理意义的语义表达;其次,尽管Transformer擅长捕捉全局信息,但其无差别的全局自注意力计算模式容易稀释或忽视地物边界、局部几何形状以及空间上下文一致性等细微却至关重要的结构约束,难以实现精准的地物边缘刻画;此外,高光谱图像标注成本极高,实际应用中普遍面临严重的标记样本匮乏问题,而标准Transformer模型参数量大、对大规模标注数据依赖性强,在小样本场景下极易陷入过拟合,难以提取出兼具判别性与泛化性的鲁棒特征表示

Benefits of technology

本发明通过深度融合高斯语义建模与半监督对比学习,有效破解了高光谱图像空间异质性强、标记样本稀缺及光谱混叠导致的分类瓶颈,实现了分类精度与模型鲁棒性的全面提升。自适应跨通道融合与对比一致性引导精准捕获了空谱局部特征的深层协同关联,而自适应高斯加权聚合生成的语义令牌则在有效抑制邻域背景噪声与异常值干扰的同时,强化了中心像素的语义主导性,显著增强了复杂地物边界的刻画能力;结合地物类别原型约束与置信度加权的半监督对比学习机制,不仅充分盘活了海量未标记样本的潜在价值以缓解小样本过拟合,从根源上降低了噪声伪标签对特征空间的污染,构建出类内极度紧凑、类间高度可分的鲁棒特征流形;语义门控机制对优化后的特征分布进行自适应降噪与聚焦,并协同全局上下文特征实现了局部细节与宏观语义的完美互补,最终在极低标注成本下依然能够输出空间平滑、细节保真且高度精准的地物分类结果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122530804A_ABST
    Figure CN122530804A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of hyperspectral image classification, and specifically discloses a hyperspectral classification method and system based on Gaussian semantic modeling and semi-supervised comparison, which comprises the following steps: S1, acquiring a hyperspectral image to be classified and dividing the hyperspectral image into image blocks; S2, extracting local features of the spectral dimension and the spatial dimension of the image blocks to generate local space-spectrum features; S3, using an adaptive Gaussian weighting function to aggregate the local space-spectrum features in the neighborhood to generate semantic tokens; S4, optimizing the feature space distribution of the semantic tokens based on an improved InfoNCE comparison loss function; S5, element-wise weighting the optimized feature space distribution to extract global context features of the token sequence; and S6, obtaining ground object class prediction results of each pixel point based on the global context features; through Gaussian semantic modeling of the local space-spectrum features and semi-supervised comparison feature space optimization combined with a prototype constraint, the application realizes accurate pixel-level classification of the hyperspectral image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hyperspectral image classification technology, and more specifically to a hyperspectral classification method and system based on Gaussian semantic modeling and semi-supervised comparison. Background Technology

[0002] The Transformer architecture, with its superior long-range dependency modeling capabilities, has made significant progress in natural language processing and computer vision, and has been gradually introduced into hyperspectral image classification tasks. However, directly applying it to hyperspectral scenes still faces several fundamental bottlenecks: First, existing standard tokenization processes generally use uniform grids to hard-divide images. This mechanical segmentation method severely disrupts the inherent continuous spatial-spectral correlation within hyperspectral data, resulting in generated discrete tokens lacking clear and physically meaningful semantic representations. Second, although Transformer excels at capturing global information, its indiscriminate global self-attention computation mode easily dilutes or ignores subtle but crucial structural constraints such as ground object boundaries, local geometry, and spatial context consistency, making it difficult to achieve accurate ground object edge delineation. In addition, hyperspectral image annotation is extremely costly, and practical applications generally face a severe shortage of labeled samples. Standard Transformer models have a large number of parameters and are highly dependent on large-scale labeled data, making them prone to overfitting in small-sample scenarios and making it difficult to extract robust feature representations that are both discriminative and generalizable. In conclusion, directly using the existing Transformer paradigm cannot meet the requirements for fine classification of hyperspectral images.

[0003] Therefore, it is urgent to break through the inherent paradigm of the traditional Transformer and construct a new feature representation and modeling method that can not only replace hard partitioning with adaptive local aggregation to fully preserve the spatial spectral semantics, but also introduce a robust semi-supervised mechanism to fully explore the value of unlabeled data, and supplement it with refined feature selection to suppress global computational noise. Summary of the Invention

[0004] The purpose of this invention is to provide a hyperspectral classification method and system based on Gaussian semantic modeling and semi-supervised contrastive analysis. By using Gaussian semantic modeling of local spatial spectral features and semi-supervised contrastive feature space optimization combined with prototype constraints, pixel-level accurate classification of hyperspectral images can be achieved.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A hyperspectral classification method based on Gaussian semantic modeling and semi-supervised contrastive analysis includes the following steps: S1. Obtain the hyperspectral image to be classified and divide it into hyperspectral image blocks of a preset size; S2. Extract the local features of the spectral and spatial dimensions of the hyperspectral image patch, and generate the local spatial-spectral features of the hyperspectral image patch through an adaptive cross-channel fusion and contrast consistency guidance mechanism. S3. Use an adaptive Gaussian weighting function to perform weighted aggregation of local spatial spectral features in the neighborhood to generate semantic tokens dominated by the features of the center pixel. S4. Construct positive and negative sample pairs using labeled and unlabeled hyperspectral images, combine land cover category prototype constraints and confidence weighting mechanisms, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. S5. Use a semantic gating mechanism to perform element-wise weighting on the feature space distribution of the optimized semantic tokens, and extract the global context features of the weighted token sequence. S6. Based on the global context features, obtain the land cover category prediction result for each pixel in the hyperspectral image.

[0006] The present invention also provides a system for performing a hyperspectral classification method based on Gaussian semantic modeling and semi-supervised contrast, comprising: The image acquisition module is used to acquire hyperspectral images to be classified and divide them into hyperspectral image blocks of a preset size; The local feature extraction module is used to extract local features in the spectral and spatial dimensions of hyperspectral image patches, and generate local spatial-spectral features of hyperspectral image patches through an adaptive cross-channel fusion and contrast consistency guidance mechanism. The semantic token generation module is used to perform weighted aggregation of local spatial spectral features in the neighborhood using an adaptive Gaussian weighting function to generate semantic tokens dominated by the features of the center pixel. The feature distribution optimization module is used to construct positive and negative sample pairs using labeled and unlabeled samples, combine the land cover category prototype constraint and confidence weighting mechanism, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. The global context modeling module is used to perform element-wise weighting of the feature space distribution of the optimized semantic tokens using a semantic gating mechanism, and to extract the global context features of the weighted token sequence. The classification prediction module is used to obtain the land cover category prediction result for each pixel in the hyperspectral image based on the global context features.

[0007] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements a hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison.

[0008] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements a hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison.

[0009] According to specific embodiments provided by the present invention, the present invention has the following technical effects compared to the prior art: This invention effectively overcomes the classification bottlenecks caused by the strong spatial heterogeneity, scarce labeled samples, and spectral aliasing in hyperspectral images by deeply fusing Gaussian semantic modeling and semi-supervised contrastive learning, achieving a comprehensive improvement in classification accuracy and model robustness. Adaptive cross-channel fusion and contrast consistency guidance accurately capture the deep collaborative correlations of local spatial and spectral features, while the semantic tokens generated by adaptive Gaussian weighted aggregation effectively suppress neighborhood background noise and outlier interference, while strengthening the semantic dominance of the central pixel and significantly enhancing the ability to characterize complex land cover boundaries. The semi-supervised contrastive learning mechanism, which combines land cover category prototype constraints and confidence weighting, not only fully utilizes the potential value of massive unlabeled samples to alleviate small-sample overfitting, but also fundamentally reduces the pollution of the feature space by noise pseudo-labels, constructing a robust feature manifold that is extremely compact within classes and highly separable between classes. The semantic gating mechanism adaptively denoises and focuses the optimized feature distribution, and, in conjunction with global context features, achieves perfect complementarity between local details and macroscopic semantics. Ultimately, it can still output spatially smooth, detail-preserving, and highly accurate land cover classification results with extremely low annotation costs. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0011] The following description, in conjunction with the accompanying drawings, further illustrates the hyperspectral classification method and system based on Gaussian semantic modeling and semi-supervised comparison of the present invention. Figure 1 This is a schematic diagram of the overall process of the hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the CG-A-LSSICM process in Embodiment 1 of the present invention; Figure 3 This is a graph showing the quality analysis results in Example 1 of this invention; Figure 4This is the InfoNCE flowchart in Embodiment 1 of the present invention; wherein (a) is the flowchart for constructing the improved InfoNCE loss; and (b) is the flowchart for optimizing the joint loss. Figure 5 This is a graph showing the impact of the comparative loss weights on classification performance in Embodiment 2 of this invention; Figure 6 This is a graph showing the effect of Gaussian kernel standard deviation on classification performance in Example 2 of this invention; Figure 7 This is a diagram illustrating the impact of PCA dimensionality reduction on classification performance in Example 2 of this invention. Figure 8 This is a graph showing the impact of input block size on classification performance in Embodiment 2 of this invention; Figure 9 This is a classification result image on the Indian Pines dataset in Embodiment 2 of this invention; Figure 10 This is a classification result image on the Pavia University dataset in Embodiment 2 of this invention. Detailed Implementation

[0012] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0013] To better understand the purpose, structure, and function of this invention, the invention will be described in further detail below with reference to the accompanying drawings.

[0014] Example 1 like Figure 1 As shown, this invention provides a hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison, comprising the following steps: S1. Obtain the hyperspectral image to be classified and divide it into hyperspectral image blocks of a preset size; S2. Extract the local features of the spectral and spatial dimensions of the hyperspectral image patch, and generate the local spatial-spectral features of the hyperspectral image patch through an adaptive cross-channel fusion and contrast consistency guidance mechanism. In this embodiment, the input hyperspectral image patch is first subjected to an initial convolutional mapping to obtain a basic feature representation. Then, parallel pathways are constructed using grouped convolutions to extract local features in both the spectral and spatial dimensions. The spectral branch primarily describes the continuous variations between adjacent bands, while the spatial branch focuses on texture, edge, and shape information in the local neighborhood. This approach reduces feature interference caused by mixing high-dimensional spectral and spatial information within the same convolutional kernel, and preserves local structural details while controlling parameter scale.

[0015] Based on this, the local features are divided into two sub-branches, each modeled using lightweight local convolution. Unlike fixed-ratio feature exchange methods, this embodiment employs an adaptive cross-channel fusion strategy, dynamically generating fusion weights based on the statistical response of the input features. This allows the information interaction strength between the two sub-branches to adjust with sample variations. This approach can suppress the propagation of invalid information in regions with significant local structural differences and enhance the complementary relationship between effective features. Let the local features of the two sub-branches be... 1 and 2. The adaptive fusion weights can then be expressed as: β = s ( MLP ( GAP ([ 1, 2]))); in, GAP (.) indicates global average pooling, and [.,.] indicates feature concatenation. MLP (.) indicates a multilayer perceptron. s (.) represents the Sigmoid activation function. Based on dynamic weights, the two sub-branches complete bidirectional interaction, specifically in the following form: X’ 1 = 1+ β 2; X’ 2 = 2+ (1-) β ) 2; In the formula, This indicates element-wise multiplication. Local spatial spectral information in different sub-branches can achieve more targeted complementarity, improving the adaptability of local features to complex land cover distributions.

[0016] After adaptive interaction, features are integrated through convolutional mapping and nonlinear activation to generate a unified local spatial-spectral representation. The resulting features not only retain the spectral continuity information of the original pixels but also incorporate the spatial context structure within the neighborhood, thus providing a more complete local discriminative basis for subsequent modeling. The enhanced local features can be written as: Flocal = f ([ X 1’ , X 2’ ]); in, f (.) represents convolution mapping and nonlinear transformation.

[0017] Considering that local representations are easily affected by noise, inter-spectral perturbations, and sample scarcity in scenarios with few samples, this embodiment further incorporates contrast consistency guidance, specifically: Two different augmented views are constructed for the same sample and input into a CG-A-LSSICM branch with shared parameters, constraining the representations of the two views in the local feature space to be as consistent as possible. This reduces feature shifts caused by perturbations, enabling the module to learn a more stable and compact local spatial-spectral representation. Let the two augmented views for the same sample be... x (a) and x (b) The corresponding local feature representations are as follows: and Then the local consistency loss can be defined as: LLC =1_cos( g ( ), g ( )); in, g (.) represents the projection mapping function, and cos(.,.) represents the cosine similarity. This loss term is used to constrain the local representation of the same sample to remain consistent under different augmented views, thereby reducing feature shifts caused by perturbations and improving the stability of local spatial spectrum representations. As an auxiliary constraint in the local modeling stage, the local consistency loss will be incorporated into a unified optimization objective along with the classification loss and contrastive loss during subsequent training to enhance the model's discriminative ability and robustness under small sample conditions.

[0018] In summary, the CG-A-LSSICM in this embodiment does not change the basic framework of local spatial spectrum modeling. Instead, it further incorporates dynamic fusion and consistency constraints into the original local decoupling and interaction enhancement process. The former enables the module to adaptively adjust the information exchange intensity between channels based on the local response characteristics of different samples; the latter enhances the stability of local representations under perturbation conditions. Through these two improvements, the module maintains its lightweight characteristics while improving the discriminative power and robustness of local spatial spectrum features, and also provides higher-quality input features for subsequent semantic token construction and global context modeling.

[0019] S3. Use an adaptive Gaussian weighting function to perform weighted aggregation of local spatial spectral features in the neighborhood to generate semantic tokens dominated by the features of the center pixel. This embodiment specifically addresses the issue where traditional Transformer, when applied to hyperspectral image classification, suffers from semantic fragmentation due to hard-partition tokenization. The Gaussian Semantic Tokenizer introduces a continuously differentiable weighted mapping mechanism to smoothly transform the original spectral sequence into semantic tokens. This mechanism, based on spatial proximity, uses a two-dimensional Gaussian kernel function to dynamically calculate the correlation weights between feature points, eliminating the disruption of spectral continuity caused by hard-partition boundaries. The first step in this calculation is locating the center pixel. P c The second step is to determine the neighborhood corresponding to that point. N ( P c The Gaussian weighted semantic mapping function is written as follows: ; in the formula s Control the receptive field range and adjust s The numerical values ​​can be used to extract local features. This parameterized weighting method preserves the sensitivity of ground features and weakens the interference of irrelevant background features through exponential decay. In the token generation stage, each semantic token... Tk It is obtained by weighted aggregation of all feature vectors in the neighborhood, and the specific calculation method is shown in the formula: ; F ( The token is the basic feature extracted by the local spatial spectrum correlation modeling module. In this generation method, the token can carry the dominant feature of the central pixel and incorporate contextual information that conforms to the spatial distribution law, improving the physical interpretability of the token. Traditional methods directly linearly project image patches into tokens. Gaussian weighted mapping relies on probability density distribution to complete the soft decision of feature selection, reducing the problem of quantization error accumulation caused by hard partitioning. The standard deviation parameter of the Gaussian kernel... s Leveraging a learnable mechanism, the model establishes a correlation with spatial scales. It autonomously adjusts the aggregation range based on the distribution characteristics of different types of land features. Artificial land features, which tend to have regular shapes, are smaller in scale. s Values ​​that can generate tokens that focus on details; natural vegetation distribution is relatively diffuse, and larger... s The value captures more representative regional features, and scale adaptation allows the token generation process to match the actual distribution pattern of ground features, improving the consistency of feature expression of geographical meaning. The semantic tokens generated by Gaussian weighting have center enhancement properties, and the token energy distribution fits the actual boundaries of ground features, preserving more discriminative information under the same feature dimension.

[0020] To verify the effectiveness of tokens generated by the Gaussian Semantic Tokenizer, this invention analyzes them from three perspectives: intra-class compactness, inter-class separability, and low-dimensional visual distribution. Compared with traditional hard partitioning tokenization, tokens generated by Gaussian semantic mapping exhibit a more pronounced intra-class clustering trend and clearer class spacing in the feature space. This indicates that the Gaussian weighting mechanism can better preserve continuous spectral variations and local spatial context information during token construction, thereby mitigating the semantic fragmentation problem caused by hard partitioning.

[0021] from Figure 3 The t-SNE visualization results show that the tokens processed by Gaussian semantic mapping form a more compact cluster structure in two-dimensional space, with more concentrated distribution of samples of the same class and a significant reduction in the overlapping area between samples of different classes. In contrast, tokens generated by traditional hard partitioning still exhibit significant aliasing between some closely related categories, indicating that its ability to express the semantics of continuous spatial spectrum in hyperspectral data remains limited.

[0022] Overall, the Gaussian Semantic Tokenizer does not simply divide image patches into discrete sequences, but rather constructs token representations with continuous semantic attributes through Gaussian weighted aggregation. This mechanism improves the token's ability to jointly represent the dominant features of the central pixel and neighborhood context information, providing higher-quality input for subsequent contrastive learning and global context modeling, and laying the foundation for maintaining a stable feature distribution under small sample conditions.

[0023] S4. Construct positive and negative sample pairs using labeled and unlabeled hyperspectral images, combine land cover category prototype constraints and confidence weighting mechanisms, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. Specifically, this embodiment addresses the issues of limited labeled samples, loose feature distribution, and insufficient negative samples in hyperspectral images. It improves the InfoNCE loss within a semi-supervised contrastive learning framework. Two views obtained from the same sample after different spatial-spectral enhancements are used as positive sample pairs. Furthermore, a class prototype constraint and confidence weighting mechanism are introduced during the negative sample construction process. This allows contrastive learning to no longer rely solely on random negative samples within a batch, but instead simultaneously utilizes structural information at the class level to constrain the embedding space.

[0024] Specifically, let the input sample xi Two views were obtained after two independent enhancements. xi (a) and xi (b) Then, it is mapped into a feature representation by the encoder. zi (a) and zi(b) These two constitute a positive sample pair, used to ensure that the semantic expression of the same sample remains consistent under different perturbation conditions. Meanwhile, to alleviate the instability caused by insufficient negative samples under small sample conditions, this embodiment further introduces a category prototype. p c As an auxiliary comparison target, among which p c Indicates the first c The center representation of a class sample in the feature space. For the current sample, in addition to the positive samples, the prototypes of other classes and the high-confidence outlier samples within the batch together constitute the negative sample set, thereby enhancing intra-class compactness while improving inter-class separability. Based on this idea, the improved contrastive loss is written as:

[0025] in, sim (.,.) represents the cosine similarity. t For temperature coefficient, p yi The prototype vector representing the category to which the current sample belongs. N i Represents the set of negative samples. w k For the first k The confidence weights of each negative sample are used, with α used to balance the contributions between sample-level positive contrast and prototype-level positive contrast. Compared to the standard InfoNCE, this form retains the basic idea of ​​"bringing positive samples closer and moving negative samples further away" while introducing class prototype constraints and confidence weighting mechanisms, making it more suitable for hyperspectral classification scenarios with few samples, high noise, and blurred class boundaries.

[0026] Considering that the final task is still classification, this embodiment jointly optimizes the classification loss, local consistency loss, and improved contrastive loss, with the unified objective function defined as: L = L cls +λ1 L lc +λ2 L con ; in, L cls Cross-entropy classification loss, L lc For local consistency loss, L con For the improved contrast loss, l 1 and l2 represents the tradeoff coefficient. Through joint optimization, the model can not only maintain representational stability at the local feature level, but also achieve tighter intra-class aggregation and clearer inter-class separation in the embedding space, thus providing a more stable and discriminative structured representation for subsequent global context modeling.

[0027] Overall, this loss design is more suitable for use in conjunction with Gaussian Semantic Tokenizer and Cascaded Transformer Encoder. The former is responsible for generating input tokens with semantic continuity, the latter extracts high-level semantic embeddings, and the improved InfoNCE loss further enhances intra-class aggregation and inter-class separation in the feature space, forming a relatively complete optimization chain together with semantic token generation, local feature modeling, and global context modeling.

[0028] The advantage of semi-supervised contrastive learning lies in its ability to improve the model's generalization ability under small sample conditions by adjusting the feature space structure. This mechanism uses the relative relationship between positive and negative samples as a constraint, making similar samples more concentrated in the embedding space and further separating dissimilar samples, thereby improving the discriminativeness of feature representations and reducing noise interference. Contrastive learning also introduces multi-view enhancement constraints, enabling the model to maintain stable representations under different spectral perturbations and spatial deformations, which helps learn more invariant essential features. This characteristic is particularly important for hyperspectral classification tasks with insufficient labeled samples, as limited supervision often struggles to cover the complex variations of similar ground features in real-world scenarios.

[0029] Building upon this, the semi-supervised framework can also utilize a large number of unlabeled samples to participate in feature distribution modeling, expanding the sources of statistical information during training and avoiding the model's over-reliance on a small number of labeled samples. The improved InfoNCE loss further strengthens intra-class aggregation and inter-class separation, making the decision boundaries clearer. Meanwhile, the continuous token representation generated by the Gaussian Semantic Tokenizer enhances the smoothness of the feature space and reduces the semantic fragmentation caused by hard partitioning. The synergy of these two approaches allows for a more stable and compact feature distribution in small-sample scenarios, thereby improving the model's generalization performance.

[0030] S5. Use a semantic gating mechanism to perform element-wise weighting on the feature space distribution of the optimized semantic tokens, and extract the global context features of the weighted token sequence. Specifically, in this embodiment, after completing local spatial-spectral correlation enhancement and Gaussian semantic tokenization, the input features have been transformed from original pixel blocks into token sequences with certain discriminative semantics. To further characterize the long-range dependencies between pixels and achieve global contextual semantic modeling in complex scenes, this embodiment constructs a global modeling module based on a cascaded Transformer encoding structure. This structure consists of multiple Transformer encoder layers stacked layer by layer, each layer containing a multi-head self-attention mechanism and a feedforward neural network module. Through progressive information propagation, local spatial-spectral features can be gradually extended to a wider range of contextual environments, establishing spatial-spectral correlations from the local neighborhood to the global scene.

[0031] While cascaded Transformers possess strong global dependency modeling capabilities, directly inputting semantic tokens indiscriminately into the encoder often leads to the assumption that different tokens contribute equally to attention propagation. For small-sample hyperspectral classification tasks, this approach can easily result in the over-propagation of low-quality tokens susceptible to noise during global modeling, thereby weakening the role of key discriminative semantics. Therefore, this embodiment introduces a semantic gating mechanism at the input of the cascaded Transformer. Without altering the backbone encoding structure, this mechanism adaptively adjusts the strength of different tokens participating in global modeling, enhancing the effective propagation of key semantic information and suppressing interference from unstable responses.

[0032] Suppose the token sequence generated by the Gaussian Semantic Tokenizer is: T =[ t 1, t 2,…, t N ] ∈R Nxd ; in, N Indicates the number of tokens. d This represents the token feature dimension. To reflect the semantic importance of different tokens, gate weights are first constructed using linear mapping and activation functions: g =σ( W g T + b g ); in, W g and b g For learnable parameters, s (.) represents the Sigmoid activation function.

[0033] In this embodiment, the original token is weighted element by element to obtain the gated token representation: =g T in, This represents element-wise multiplication. After this step, semantic tokens with higher discriminative contributions will be more fully preserved in subsequent global attention propagation, while tokens that are more affected by local noise or semantic uncertainty will be moderately suppressed.

[0034] The gated token sequence is then fed into a cascaded Transformer encoder for global semantic modeling. For any encoding layer, the input tokens are first mapped to a query, key, and value vector: Q = W Q , K = W K , V = W V ; The corresponding self-attention output can be represented as: ; Under the multi-head self-attention mechanism, the model can explicitly establish global associations between different tokens, allowing each location to integrate contextual information from the entire sequence. Unlike convolutional neural networks, which are limited by local receptive fields, this structure is more suitable for processing hyperspectral images with complex land cover distributions, subtle category differences, and strong spatial correlations. Simultaneously, the feedforward neural network performs further nonlinear transformations and semantic refinement on the attention output, enabling the encoding results to express the differences between land cover categories at a higher level.

[0035] Furthermore, to enhance spatial topological representation and improve the training stability of deep networks, the model incorporates relative position encoding, residual connections, and layer normalization during global encoding. Relative position encoding preserves spatial adjacency during token interaction, allowing attention modeling to consider not only semantic similarity but also spatial layout information. Residual connections and layer normalization help alleviate gradient decay and feature degradation issues in deep training, promoting the continuous transmission of multi-layer semantic information. This embodiment maintains the core structure of the cascaded Transformer while implementing input token quality control through a semantic gating mechanism, thereby improving the relevance and stability of global context modeling with minimal structural cost.

[0036] Under semantic gating, the cascaded Transformer no longer propagates all tokens equally, but instead engages in global interaction around a more discriminative semantic center. As the number of encoding layers increases, multi-head self-attention mechanisms and feedforward networks are executed alternately, gradually completing the hierarchical modeling process from local semantics to global semantics. Among them, the bottom encoder mainly focuses on fine-grained associations between neighboring tokens, emphasizing local spatial structure and basic spectral variation patterns; the middle encoder further integrates contextual relationships within the region, strengthening the consistent expression within ground features; and the top encoder establishes scene-level semantic associations on a larger scale, identifying spatially dispersed but spectrally similar ground feature units, thereby forming a more complete global representation.

[0037] Compared to standard global modeling without gating, semantically gating token sequences can more effectively suppress the interference of low-quality responses on deep semantic interactions during multi-layer propagation, allowing the attention distribution of deep networks to be more focused on key regions with discriminative significance. This enables the model to more stably retain local boundary information, continuous spectral variation information, and important land cover category clues during cross-layer semantic propagation, mitigating semantic diffusion, noise accumulation, and feature oversmoothing that may occur in deep modeling. For the common problems of "same object, different spectrum" and "same spectrum, different object" in hyperspectral images, this global interaction mechanism oriented towards key semantics can provide more reliable contextual discrimination, thereby enhancing the spatial consistency and semantic integrity of classification results.

[0038] From the overall modeling process, the original hyperspectral neighborhood information is first filtered and enhanced by the local spatial spectrum enhancement module to obtain more stable local discriminative features. Then, the Gaussian semantic tokenizer further organizes the local features into token representations with continuous semantic attributes, providing structured input for subsequent global interactions. During the training phase, semi-supervised contrastive learning optimizes the embedding space distribution through intra-class aggregation and inter-class separation, enhancing the model's representation robustness under small sample conditions. On this basis, the semantic gating cascaded Transformer further completes the global context integration, enabling local discriminative information to establish connections in a larger scene range and expanding the scope of supervision provided by limited labeled samples.

[0039] By performing more targeted global association modeling on semantic tokens that already possess discriminative power, the model can more effectively integrate contextual information between distant pixels without significantly increasing structural complexity, forming a composite representation that balances "local refinement" and "global consistency." For hyperspectral image classification tasks with a limited number of labeled samples, blurred class boundaries, and complex spatial distribution, this mechanism helps to further improve the model's classification stability, generalization ability, and spatial continuity annotation performance.

[0040] S6. Based on the global context features, obtain the land cover category prediction result for each pixel in the hyperspectral image.

[0041] Example 2 To ensure that the parameter settings in subsequent quantitative comparison experiments, ablation experiments, and small sample evaluations are based on reasonable criteria, the data partitioning method in this embodiment is as follows: Five labeled samples are randomly selected from each class to form a labeled training set. Simultaneously, a certain number of unlabeled samples are drawn from the remaining samples for comparative learning. The remaining samples serve as the test set. The Adam optimizer is used during training, with an initial learning rate of 0.001, a batch size of 64, and 150 training epochs. Local consistency loss weights are used. l 1 is fixed at 0.10, temperature coefficient t The balance coefficient α between sample-level positive contrast and prototype-level positive contrast is fixed at 0.20. These parameters are mainly used to maintain training stability and control the synergistic relationship between different loss terms. Preliminary experiments show that their variation within a small range has a relatively limited impact on the overall trend, so they will not be discussed in detail in the parameter analysis.

[0042] First, we tested the dimensionality reduction of Principal Component Analysis (PCA). Hyperspectral images have a large number of original bands; directly inputting them into the network would not only increase the training burden but also easily introduce redundant bands and noise, thus affecting the feature distribution during semantic token generation and contrastive learning. Experiments with different PCA retention dimensions revealed that as the number of principal components gradually increases, the model's classification accuracy on the three datasets initially rises and then plateaus. When the dimensionality reduction is small, some effective spectral information is not fully preserved, making it difficult for the model to accurately characterize subtle differences between categories. As the dimensionality continues to increase, although spectral information becomes richer, redundant components also increase, limiting the improvement in accuracy. Experimental results show that when the PCA retention dimension is 30, the overall accuracy (OA) on all three datasets reaches a good level, indicating that this setting can effectively balance the preservation of effective spectral information with computational complexity control.

[0043] Secondly, the input block size is analyzed. The input block size determines the local spatial neighborhood range that the model can perceive, and is also an important factor affecting the modeling of local spatial-spectral correlation and the Gaussian semantic aggregation effect. Smaller input blocks are insufficient to provide sufficient spatial context information, resulting in insufficient ability of the model to characterize the boundaries of ground objects and neighborhood structures; while excessively large input blocks may introduce too much background information unrelated to the category of the central pixel, increasing the proportion of mixed pixels and thus weakening the discriminative power of semantic tokens. Experimental results show that as the input block size gradually increases, the model classification accuracy first increases and then slightly decreases. Among them, the 13×13 input block achieves better results on all three datasets, indicating that this neighborhood scale can preserve local spatial structure information while minimizing interference from irrelevant backgrounds.

[0044] Secondly, regarding the Gaussian kernel standard deviation s Parameter analysis is performed. This parameter determines the scope of the Gaussian semantic tokenizer when performing weight allocation and semantic aggregation within the neighborhood, and is one of the key parameters that distinguishes the method in this embodiment from traditional hard partitioning tokenization. s When the value is small, the model tends to focus more on local features near the center pixel. While this can highlight local details, it may also ignore contextual information that is helpful for class classification. s When the value is too large, the semantic aggregation range expands significantly, easily including background regions and features outside the boundary, thus weakening the dominant role of the central semantic element. Experimental results show that as... s By gradually increasing the value from a smaller value, the model's operational accuracy (OA) first steadily improved on the three datasets, and then... s The optimal value is reached when the value is 1.6; As the range of Gaussian aggregation continues to increase, the overall performance begins to decline slightly. This indicates that a moderate range of Gaussian aggregation is more conducive to constructing high-quality semantic tokens that combine center-discriminating information and neighborhood context information.

[0045] Finally, compare the loss weights. l 2 Sensitivity analysis is performed. In the method of this embodiment 1, l 2 This value is used to adjust the influence of the contrastive loss on the overall optimization objective. If the value is too small, the constraint effect of contrastive learning on intra-class aggregation and inter-class separation is insufficient, making it difficult to fully leverage the advantages of semi-supervised contrastive learning in small sample scenarios; if the value is too large, the model may overemphasize the optimization of the embedding space structure, thereby weakening the direct guiding role of the classification objective on the decision boundary. Experimental results show that as... l As the value 2 is increased from 0.1 to 0.5, the model's classification accuracy continuously improves across the three datasets; when l 2When the value was further increased to 0.7 and 1.0, the OA (Adjustment Ability) showed a certain degree of decline, indicating that excessively strong contrast constraints would affect the dominant role of classification loss. A comprehensive comparison shows that... l When 2=0.5, the model achieves a good balance between accuracy and stability, so it was used as the default setting in subsequent experiments.

[0046] Based on the results of the parameter sensitivity experiments above, the model parameters were uniformly set as follows in subsequent quantitative comparison experiments, ablation experiments, and small sample evaluations: principal component analysis dimensionality reduction dimension of 30, input block size of 13×13, Gaussian kernel standard deviation σ of 1.6, contrast loss weight λ2 of 0.5, local consistency loss weight λ1 of 0.10, temperature coefficient τ of 0.20, and balance coefficient α between sample-level and prototype-level positive contrast of 0.30. This parameter combination achieves a reasonable balance between classification accuracy, training stability, and computational cost, and provides a parameter basis for the validity of subsequent experimental results.

[0047] To verify the classification performance of Gaussian Semantic Tokenizer combined with semi-supervised contrastive learning, experiments were conducted under consistent control conditions, comparing this method with six mainstream hyperspectral image classification models. The comparison targets included HybridSN and SSRN based on convolutional neural networks, SSGC based on graph convolution, the traditional Transformer model ViT, the hyperspectral-adaptive Transformer variant SpectralFormer, and CapsNet based on capsule networks. All methods employed a consistent training-test split rule on the Indian Pines, Pavia University, and Houston datasets; during the split, only 5 labeled samples were randomly selected from each class to enter the training set to simulate extremely small sample sizes. Evaluation metrics included overall accuracy, average accuracy, Kappa coefficient, and accuracy per class, with five-fold cross-validation introduced to reduce the volatility caused by random sampling.

[0048] On the Indian Pines dataset, experimental results show that the method in this embodiment achieves an overall accuracy of 92.36%, which is 4.17 percentage points higher than the best-performing SpectralFormer model in the comparison, with a Kappa coefficient of 0.912. For categories with similar spectral characteristics and higher classification difficulty (such as Alfalfa, i.e., category 1; Corn-notill, i.e., category 2), this method achieves more stable classification results, with category accuracies of 89.2% and 93.5% respectively, representing an improvement of more than 8% compared to the traditional Transformer. Further observation from the spatial distribution visualization results shows that after processing by the method in Embodiment 1, the scatter noise near the category boundaries is significantly reduced, and the outlines of ground features are more complete. The Pavia University dataset shows a similar trend, with an overall accuracy of 96.78%; as a representative of complex urban scenes, the Houston dataset, in which the method in Embodiment 1 further achieves an overall accuracy of 97.14%.

[0049] Table 1. Classification results of different classification methods on different datasets.

[0050] This performance advantage stems primarily from two aspects: First, the Gaussian semantic tokenizer better preserves the physical meaning of spectral information during the mapping of continuous spectral sequences; second, the semi-supervised contrastive learning mechanism can still form a more compact and separable feature distribution even with very few labeled samples. In contrast, traditional Transformers often employ hard-partition tokenization, causing breaks in the local correlations of spectral sequences. In the Indian Pines dataset, Corn-min (class 3) and Soybean-notill (class 4) are both in the early growth stages of crops, with subtle spectral differences that are not easily captured directly; however, the Gaussian weighted semantic mapping, through adaptive bandwidth, forms overlapping receptive fields in the spectral dimension, which is more conducive to preserving the gradual features of transition regions. Furthermore, the semi-supervised contrastive learning framework, combined with an improved InfoNCE loss, explicitly applies the optimization objective of "intra-class aggregation and inter-class separation" in the feature space, enabling it to learn more reliable discrimination boundaries even with only 5 labeled samples per class, thanks to the distribution structure of a large number of unlabeled samples. Building on this, the cascaded Transformer module gradually completes the understanding along the path from local spatial spectral features to global contextual semantics; facing the complex categories of urban scenes and the spatial spectral heterogeneity of building facade materials in the Houston dataset, this module can provide a more suitable global modeling capability.

[0051] To verify the effectiveness of the hyperspectral image classification method combining Gaussian semantic tokenizer and semi-supervised contrastive learning in preserving spatial structure and semantic consistency, this embodiment visually compares the classification results of two standard datasets: Indian Pines and Pavia University. The results show that, compared with the traditional Transformer classification method, the method in Embodiment 1 has better contour preservation capabilities in complex feature boundary regions and can effectively reduce classification noise and improve the accuracy and stability of classification results in heterogeneous regions where farmland and buildings are interspersed.

[0052] In the Indian Pines dataset, the classification map generated by the method in Example 1 exhibits good spatial continuity and can reconstruct the strip-like planting structure in crop zones more completely. In contrast, traditional methods are more prone to boundary blurring, local breaks, and misclassification in areas with complex land cover distribution or significant boundary changes. The method in Example 1, through the synergistic effect of local spatial spectral correlation modeling, Gaussian semantic mapping, and semi-supervised contrastive learning, preserves clear boundary information while maintaining spatial coherence.

[0053] In the Pavia University dataset, the method in this embodiment also demonstrates strong structure preservation capabilities in urban building areas, accurately distinguishing roofs of different materials and maintaining the consistency of the overall geometric layout of building clusters, reducing fragmented classification phenomena. Especially in the boundary areas between roads, buildings, and surrounding features, the classification results are more complete and continuous, demonstrating a better ability to represent complex scenes.

[0054] From a spectral perspective, the token sequence processed by Gaussian semantic mapping can better preserve the physical attributes of land features in the continuous spectral space. The feature distribution of similar land features under different lighting conditions is more compact, indicating that the Gaussian weighting mechanism helps to mitigate spectral perturbations caused by lighting variations. In shaded areas, the method in Example 1 still maintains high classification consistency, demonstrating its robustness in suppressing shadow interference and compensating for local spectral distortions.

[0055] Furthermore, semi-supervised contrastive learning optimizes the feature space distribution, making intra-class samples more concentrated and inter-class samples more separated, which helps improve classification reliability under small sample conditions. Meanwhile, cascaded Transformers enhance the model's ability to model long-range dependencies, making classification results more consistent over large homogeneous regions. In summary, the method in Example 1 demonstrates significant advantages in terms of preserving complex boundaries, maintaining spatial structure continuity, spectral consistency, and shadow robustness.

[0056] To verify the effectiveness and synergistic effect of the method in Example 1, an ablation experiment was designed to examine the contributions of the Gaussian Semantic Tokenizer module and the semi-supervised contrastive learning module to the overall classification performance. The experiments were conducted on three datasets: Indian Pines, Pavia University, and Houston. To ensure fairness in the comparison, all model variants used the same local spatial spectral feature extraction module, global encoding structure, and training parameters; only the target module was removed or replaced.

[0057] Four model variants were set up in the experiment: the complete model Proposed, the model with Gaussian Semantic Tokenizer removed (w / o GST), the model with semi-supervised contrastive learning removed (w / o SCL), and the baseline model with both modules removed. The ablation results are shown in Table 2.

[0058] Overall, the complete model achieved the best performance on all three datasets. On the Indian Pines dataset, the complete model achieved OA, AA, and Kappa scores of 92.36%, 92.14%, and 0.9120, respectively. After removing the Gaussian Semantic Tokenizer, the performance dropped to 90.81%, 90.49%, and 0.8951. After removing semi-supervised contrastive learning, the scores became 91.49%, 91.05%, and 0.9004. This indicates that the Gaussian Semantic Tokenizer can improve the ability to identify subtle differences by preserving the semantic integrity of continuous spectral sequences, and semi-supervised contrastive learning helps to form a more compact and separable feature distribution under small sample conditions.

[0059] On the Pavia University and Houston datasets, the full model also achieved the best results, with OA, AA, and Kappa all outperforming the other three variants, indicating that both modules can bring stable performance gains and have a more significant synergistic enhancement effect when used together.

[0060] From a mechanistic perspective, the Gaussian Semantic Tokenizer generates token representations with continuous semantic attributes through Gaussian weighted mapping, mitigating the information fragmentation caused by traditional hard partitioning methods. Semi-supervised contrastive learning optimizes the feature space distribution through improved contrast objectives, making similar samples more concentrated and dissimilar samples more separated. The former improves the quality of input representations, while the latter optimizes the distribution of deep features; together, they facilitate the model's transition from local discriminative feature extraction to global semantic modeling. In summary, ablation experiments verify the practical role and synergistic effectiveness of the two key designs in this invention.

[0061] Table 2 Ablation experiment results under different module configurations

[0062] Obtaining labeled samples for hyperspectral images is costly; therefore, classification performance under small sample conditions is a crucial criterion for evaluating the practicality of a method. To further verify the robustness of the proposed method in scenarios with scarce samples, this paper employs a progressive small-sample training setting: for each dataset, 3, 5, 8, and 10 labeled samples are randomly selected from each class to form the training set, with the remaining samples used as the test set. By gradually increasing the number of training samples, the performance trend of the model under different levels of supervision can be observed more intuitively.

[0063] The experimental results are shown in Table 3. Overall, as the number of training samples per class increases from 3 to 10, the classification performance of the method in this invention continues to improve, indicating that the constructed framework of "local spatial spectrum enhancement—Gaussian semantic token construction—semi-supervised contrastive optimization—global context modeling" can gradually learn more stable discriminative representations as the amount of supervised information increases. Meanwhile, even under the extreme condition of only 3 labeled samples per class, the model still maintains good overall accuracy and Kappa coefficient, demonstrating that this method has a strong ability to utilize limited supervised information.

[0064] Further analysis reveals that this performance advantage stems primarily from two aspects. First, the Gaussian Semantic Tokenizer can still effectively preserve discriminative information in continuous spectral sequences even with limited samples, resulting in more stable semantic representations for input tokens. Second, semi-supervised contrastive learning leverages unlabeled samples to participate in feature space modeling, promoting the clustering of similar samples in the embedding space and distancing dissimilar samples, thereby alleviating the problem of unclear decision boundaries under small sample conditions. The synergistic effect of these two aspects enables the model to achieve good intra-class compactness and inter-class separability even with extremely limited samples.

[0065] From the performance trend, when the number of training samples is small, the model is more sensitive to changes in the number of samples; as the number of labeled samples in each class gradually increases, the performance improvement tends to stabilize. This indicates that the method of the present invention has significant advantages in extremely small sample scenarios. The results in Table 3 verify that the method of the present invention has good stability and generalization ability under different small sample settings, and is suitable for practical classification tasks in hyperspectral images where annotation costs are high and the number of samples is limited.

[0066] Table 3. Small sample experimental results of different methods

[0067] Example 3 The present invention also provides a system for performing the hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison in Example 1, the system comprising: The image acquisition module is used to acquire hyperspectral images to be classified and divide them into hyperspectral image blocks of a preset size; The local feature extraction module is used to extract local features in the spectral and spatial dimensions of hyperspectral image patches, and generate local spatial-spectral features of hyperspectral image patches through an adaptive cross-channel fusion and contrast consistency guidance mechanism. The semantic token generation module is used to perform weighted aggregation of local spatial spectral features in the neighborhood using an adaptive Gaussian weighting function to generate semantic tokens dominated by the features of the center pixel. The feature distribution optimization module is used to construct positive and negative sample pairs using labeled and unlabeled samples, combine the land cover category prototype constraint and confidence weighting mechanism, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. The global context modeling module is used to perform element-wise weighting of the feature space distribution of the optimized semantic tokens using a semantic gating mechanism, and to extract the global context features of the weighted token sequence. The classification prediction module is used to obtain the land cover category prediction result for each pixel in the hyperspectral image based on the global context features.

[0068] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and the computer program, when executed by the processor, implements the hyperspectral image classification method based on Gaussian semantic modeling and semi-supervised contrastive learning in Embodiment 1.

[0069] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the hyperspectral image classification method based on Gaussian semantic modeling and semi-supervised contrastive learning in Embodiment 1.

[0070] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison, characterized in that, Includes the following steps: S1. Obtain the hyperspectral image to be classified and divide it into hyperspectral image blocks of a preset size; S2. Extract the local features of the spectral and spatial dimensions of the hyperspectral image patch, and generate the local spatial-spectral features of the hyperspectral image patch through an adaptive cross-channel fusion and contrast consistency guidance mechanism. S3. Use an adaptive Gaussian weighting function to perform weighted aggregation of local spatial spectral features in the neighborhood to generate semantic tokens dominated by the features of the center pixel. S4. Construct positive and negative sample pairs using labeled and unlabeled hyperspectral images, combine land cover category prototype constraints and confidence weighting mechanisms, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. S5. Use a semantic gating mechanism to perform element-wise weighting on the feature space distribution of the optimized semantic tokens, and extract the global context features of the weighted token sequence. S6. Based on the global context features, obtain the land cover category prediction result for each pixel in the hyperspectral image.

2. The hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison according to claim 1, characterized in that, In S2, the process of generating local spatial spectral features includes: After initial convolution mapping, hyperspectral image patches are used to construct parallel pathways using grouped convolution to extract local features in the spectral and spatial dimensions respectively; Global average pooling, feature concatenation, and multilayer perceptron processing are applied to the local features of the spectral and spatial dimensions. Adaptive fusion weights are generated using the Sigmoid activation function to obtain the features after the interaction of the spectral and spatial dimensions. The interacting features are then subjected to convolutional mapping and nonlinear activation to generate unified local spatial spectral features.

3. The hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison according to claim 2, characterized in that, In S2, the process of generating local spatial spectral features further includes: Two different enhanced views are constructed for the same hyperspectral image patch, and the two different enhanced views are input into a CG-A-LSSICM branch with shared parameters to constrain the representation of the two views in the local feature space to calculate the local consistency loss.

4. The hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison according to claim 1, characterized in that, In S3, the semantic token generation process is as follows: The neighborhood of the current pixel is located, and the association weight between each feature point in the neighborhood and the center pixel is dynamically calculated using a two-dimensional Gaussian kernel function. The standard deviation of the Gaussian kernel is a learnable parameter used to adaptively adjust the aggregation range according to the distribution characteristics of ground features. Based on the association weights, the local spatial spectral features in the neighborhood are weighted and aggregated to generate a semantic token with the central pixel as the dominant feature and incorporating spatial context information.

5. The hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison according to claim 1, characterized in that, In S4, the optimization process of the feature space distribution of semantic tokens is as follows: Two views obtained by performing two independent spatial spectral enhancements on the same hyperspectral image are taken as positive sample pairs, and the prototype vector of the current hyperspectral image category is taken as the prototype-level positive contrast target. The prototypes of other categories and the high-confidence outlier samples within the batch are taken as the negative sample set. An improved InfoNCE contrast loss is constructed based on cosine similarity by utilizing the temperature coefficient, the confidence weight of each negative sample in the negative sample set, and the balance coefficient between sample-level positive contrast and prototype-level positive contrast. The improved contrastive loss, cross-entropy classification loss, and local consistency loss are jointly optimized to adjust the feature space distribution of the semantic tokens.

6. The hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison according to claim 5, characterized in that, In S5, the semantic gating mechanism performs element-wise weighting on the feature space distribution of the optimized semantic token, specifically as follows: The sequence of semantic tokens is sequentially processed through a linear mapping and a Sigmoid activation function to generate gating weights that reflect the semantic importance of each token. The gating weights are multiplied element-wise with the original semantic tokens to enhance the propagation of high-discrimination-contribution tokens and suppress the propagation of low-quality or noise-affected semantic tokens. The gated weighted semantic token sequence is mapped to query, key, and value vectors and input into a cascaded Transformer encoder containing a multi-head self-attention mechanism, a feedforward neural network, relative position encoding, residual connections, and layer normalization for hierarchical global semantic modeling.

7. A hyperspectral classification system based on Gaussian semantic modeling and semi-supervised comparison, used to execute the hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison as described in any one of claims 1-6, characterized in that, include: The image acquisition module is used to acquire hyperspectral images to be classified and divide them into hyperspectral image blocks of a preset size; The local feature extraction module is used to extract local features in the spectral and spatial dimensions of hyperspectral image patches, and generate local spatial-spectral features of hyperspectral image patches through an adaptive cross-channel fusion and contrast consistency guidance mechanism. The semantic token generation module is used to perform weighted aggregation of local spatial spectral features in the neighborhood using an adaptive Gaussian weighting function to generate semantic tokens dominated by the features of the center pixel. The feature distribution optimization module is used to construct positive and negative sample pairs using labeled and unlabeled samples, combine the land cover category prototype constraint and confidence weighting mechanism, and optimize the feature space distribution of the semantic token based on the improved InfoNCE contrastive loss function. The global context modeling module is used to perform element-wise weighting of the feature space distribution of the optimized semantic tokens using a semantic gating mechanism, and to extract the global context features of the weighted token sequence. The classification prediction module is used to obtain the land cover category prediction result for each pixel in the hyperspectral image based on the global context features.

8. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program that, when executed by the processor, implements the hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the hyperspectral classification method based on Gaussian semantic modeling and semi-supervised comparison as described in any one of claims 1-6.