Hyperspectral Image Classification Method and System Based on Spectral Domain Sensing and Uncertainty Regulation

Through the combination of spectral domain perception mechanism and multi-layer perceptron, the problems of high-dimensionality, complex features and noise interference in hyperspectral image classification are solved, and high-precision and efficient classification effects are achieved, which are suitable for scenarios such as real-time monitoring and online environmental monitoring.

CN120279428BActive Publication Date: 2025-08-05WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510764121.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-08-05
Estimated Expiration
2045-06-10

AI Technical Summary

Technical Problem

The existing hyperspectral image classification methods are difficult to achieve efficient and accurate classification effects when dealing with high-dimensionality, complex features, data imbalance and noise interference. Especially in traditional methods and deep learning models, there are problems such as high computational complexity, low classification accuracy, and strong noise sensitivity.

Method used

The spectrum domain perception mechanism is used to obtain the band importance weight, and through noise removal and feature focus, combining multi-layer perceptrons and uncertainty evaluation units, an adaptive adjustment mechanism is built to optimize the model training process, and improve feature extraction and classification accuracy.

Benefits of technology

It improves the accuracy and computing efficiency of hyperspectral image classification, enhances the adaptability and generalization capabilities of the model, can maintain high performance in complex scenarios, and is suitable for practical applications such as real-time monitoring and online environmental monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120279428B_ABST
    Figure CN120279428B_ABST
Patent Text Reader

Abstract

The present invention provides a hyperspectral image classification method and system based on spectral domain perception and uncertainty control, including establishing a hyperspectral image set, performing noise removal processing on the hyperspectral image to obtain a first image, and then normalizing the second image to obtain a second image, obtaining the importance weight of each band of the second image based on a spectral domain perception mechanism, projecting the feature tensor of the second image to obtain a projected feature tensor, and combining an attention mechanism to dynamically weight the projected feature tensor based on the importance weight to obtain a dynamic focus feature tensor, using a multilayer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and train it, constructing an uncertainty assessment unit to dynamically control the loss function and constructing an adaptive adjustment mechanism to adaptively adjust model parameters, and using the trained multilayer perceptron to output the classification result. The present invention can efficiently and accurately process hyperspectral images with high dimensions, complex features, data imbalance, and noise interference.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing and analysis, and in particular to a hyperspectral image classification method and system based on spectral domain perception and uncertainty control. Background Art

[0002] Hyperspectral imagery, with its rich spectral information, demonstrates unique value and broad application prospects in numerous fields, such as crop monitoring in agricultural production, mineral identification in geological exploration, ecological assessment in environmental science, and target detection in military reconnaissance. However, the critical task of hyperspectral image classification faces numerous challenges, severely restricting its full potential.

[0003] Traditional machine learning methods, such as support vector machines (SVMs) and decision trees, have significant limitations when processing hyperspectral images. These methods typically rely on manually designed features, and for data such as hyperspectral images, which are high-dimensional, complex, and contain rich spectral details, it is difficult to extract sufficiently comprehensive and discriminative features. For example, when faced with large-scale hyperspectral datasets, the selection of kernel functions and parameter tuning of SVMs become extremely complex, computationally expensive, and due to inadequate feature extraction, it is difficult to achieve satisfactory classification accuracy. Decision tree methods are prone to overfitting, especially in high-dimensional data, and are more sensitive to noise. The decision rules they generate often cannot accurately capture the complex relationship between spectral features and object categories, resulting in poor reliability and stability of classification results.

[0004] In recent years, with the rise of deep learning technology, several neural network-based methods have been applied to the field of hyperspectral image classification, attempting to overcome the bottlenecks of traditional methods. While recurrent neural networks (RNNs) and their variants have the ability to process sequential data, they struggle to effectively learn long-term dependencies when processing long sequences of spectral data from hyperspectral images due to vanishing or exploding gradients. Furthermore, their training process is complex and time-consuming, resulting in low efficiency for high-dimensional data. Furthermore, unsupervised learning methods such as autoencoders (AEs) and their derivative variational autoencoders (VAEs), while capable of feature extraction and dimensionality reduction for hyperspectral data, often require integration with other classifiers to achieve the final category decision in classification tasks, increasing model complexity and uncertainty. Furthermore, their feature extraction is not very targeted, and their ability to capture key features for specific classification tasks is limited, making them difficult to directly and effectively apply to complex hyperspectral image classification scenarios.

[0005] Hyperspectral imagery also suffers from data imbalance, i.e., significant disparity in the number of samples across different object categories. This makes traditional classification methods and some conventional deep learning models prone to bias towards samples from the majority category during training, resulting in a significant decrease in classification accuracy for minority categories and significantly compromising overall classification performance. Furthermore, hyperspectral imagery is inevitably subject to various noise artifacts during acquisition and transmission, including sensor noise and atmospheric noise. This noise can obscure the true spectral characteristics of objects, further complicating classification and reducing accuracy and reliability.

[0006] In summary, although many methods have been tried to be applied to hyperspectral image classification, there is still a lack of a classification method that can efficiently and accurately handle the high dimensionality, complex features, data imbalance and noise interference of hyperspectral images. An innovative solution is urgently needed to meet the growing practical application needs and promote the in-depth development and widespread application of hyperspectral image technology in various fields. Summary of the Invention

[0007] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide a hyperspectral image classification method based on spectral domain perception and uncertainty control. The spectral characteristics of each band of the hyperspectral image are analyzed through noise removal and spectral domain perception mechanism, and the information entropy of each band and the correlation coefficient with the category label are obtained. Based on this, the importance weight of the band is obtained, focusing on the key spectral bands, reducing the interference of redundant information such as the band where the noise is located, and solving the imbalance of hyperspectral image data through uncertainty assessment unit and adaptive adjustment mechanism.

[0008] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0009] A hyperspectral image classification method based on spectral domain perception and uncertainty control, comprising:

[0010] Establishing a hyperspectral image set including several hyperspectral images;

[0011] Performing noise removal on each hyperspectral image to obtain a first image;

[0012] a second image obtained by normalizing the first image;

[0013] Obtaining an importance weight of each band of the second image based on a spectral domain perception mechanism;

[0014] Obtain the feature tensor of the second image, construct a dynamic focusing unit, use a linear projection layer to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and combine the attention mechanism to dynamically weight the projected feature tensor based on the importance weight to obtain a dynamic focusing feature tensor;

[0015] Construct a feature enhancement submodule, use a multi-layer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, construct an uncertainty assessment unit to dynamically control the loss function of the multi-layer perceptron, and construct an adaptive adjustment mechanism to adaptively adjust the model parameters of the multi-layer perceptron;

[0016] Use the trained multilayer perceptron to output the classification results.

[0017] Furthermore, the normalization method is:

[0018] A Min-Max linear operation is performed on the first image, and pixel values of the first image are mapped to the interval [0, 1] through a linear transformation.

[0019] Furthermore, a method for obtaining the importance weight of each band of the second image based on the spectral domain perception mechanism is as follows:

[0020] Get the information entropy of each band, the calculation formula is:

[0021]

[0022] in, Represents the number of different pixel values in a certain band of the second image. Is the index variable for traversing pixel values, is the pixel value, is the pixel value in the band The probability of is the information entropy of each band, is a logarithmic function with base 10;

[0023] The Pearson correlation coefficient calculation method is used to obtain the correlation coefficient of the category label of each band;

[0024] The information entropy of each band and the correlation coefficient of the category label are normalized, and the normalized information entropy and the correlation coefficient of the category label are combined through weighted combination to obtain the importance weight of each band.

[0025] Furthermore, a dynamic focusing unit is constructed, and a linear projection layer is used to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor. At the same time, the attention mechanism is combined to perform dynamic weighted summation of the projected feature tensor based on the importance weight to obtain a dynamic focused feature tensor. Specifically, the method is as follows:

[0026] Create query projection layer, key projection layer and value projection layer;

[0027] Pass the feature tensor of the second image through the corresponding linear projection layer to obtain a projected feature tensor. The projected feature tensor includes a query tensor, a key tensor, and a value tensor. The feature tensor of the second image is [B, N, C], and the projected feature tensor is [B, N, 64], where B is the batch size, N is the length of the one-dimensional sequence expanded from the two-dimensional spatial information of the second image, and C is the number of bands.

[0028] Perform weighted operations on the value tensor according to the importance weight to obtain the weighted value tensor;

[0029] Get attention energy, the calculation formula is:

[0030]

[0031] in, is the attention energy, which is used to measure the correlation between different features. is batch matrix multiplication, To transpose the value tensor, Represents the number of different value types of pixel values in a certain band of the second image;

[0032] The attention weight is obtained through the softmax function, and the calculation formula is:

[0033]

[0034] in, is the attention weight, It will Each element of is converted into a probability value, is the last dimension of the projected feature tensor;

[0035] The attention weight is multiplied by the weighted value tensor to obtain the dynamic focus feature tensor, and the dynamic focus feature tensor is subjected to Token pruning according to the preset Token pruning ratio. A certain proportion of bands with higher importance scores are retained, and the dynamic focus feature tensor after Token pruning is filled with zero values.

[0036] Furthermore, the method of using a multilayer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training is as follows:

[0037] Construct a three-layer multilayer perceptron. The first layer is the input layer, and the number of nodes in the input layer is the same as the dimension of the dynamic focus feature tensor; the second layer is the hidden layer and uses ReLU as the activation function; the third layer is the output layer.

[0038] Furthermore, the method of constructing an uncertainty assessment unit to dynamically control the loss function of the multilayer perceptron is as follows:

[0039] During initialization, the relevant parameters are initialized according to the input prior probability, category weight, focus weight, loss function type and number of warm-up rounds, and the prior probability and category weight are transferred to the image processing unit;

[0040] During the forward propagation process, the type of loss function used is determined according to the number of rounds of current training, specifically:

[0041] when When , the BCE loss function is used to calculate the loss, and the calculation formula is:

[0042]

[0043] in, is the BCE loss function value, is the first parameter, is the second parameter, Indicates the number of preheating rounds, Indicates the current round number, is a logarithmic function with base 10;

[0044] For the positive sample loss, the calculation formula is:

[0045]

[0046] in, is the predicted value of the multilayer perceptron, is the positive sample mask, is the positive sample loss corresponding to the BCE loss function;

[0047] For negative sample loss, the calculation formula is:

[0048]

[0049] in, is the negative sample mask, is the negative sample loss corresponding to the BCE loss function;

[0050] For unlabeled sample loss, the calculation formula is:

[0051]

[0052] in, is the unlabeled sample mask, is the unlabeled sample loss corresponding to the BCE loss function;

[0053] when When , the sigmoid loss function is used to calculate the loss;

[0054] For the positive sample loss, the calculation formula is:

[0055]

[0056] in, , For the The model prediction value of positive samples, N is the number of positive samples, is the positive sample loss corresponding to the sigmoid loss function, is the natural exponential function;

[0057] For negative sample loss, the calculation formula is:

[0058]

[0059] in, , For the The model prediction value of negative samples, M is the number of negative samples, is the negative sample loss corresponding to the sigmoid loss function;

[0060] For unlabeled sample loss, the calculation formula is:

[0061]

[0062] in, , For the The model prediction value of unlabeled samples, K is the number of unlabeled samples, is the unlabeled sample loss corresponding to the sigmoid loss function;

[0063] When calculating the final loss, when the unlabeled sample loss does not need to be considered, the calculation formula is:

[0064]

[0065] in, is the positive sample loss, is the negative sample loss, when hour, for , for ,when hour, for , for ;

[0066] When considering the impact of unlabeled sample loss on the final loss as needed, add it to the final loss in a certain weighted way:

[0067]

[0068] in, is the weight coefficient of the unlabeled sample loss, when hour, for ,when hour, for , is the weight.

[0069] Furthermore, the method of constructing an adaptive adjustment mechanism to adaptively adjust the model parameters of the multilayer perceptron is as follows:

[0070] If the accuracy of the model on the validation set does not improve for several consecutive rounds or the loss value starts to rise, the model is judged to be overfitting. The learning rate is multiplied by the decay factor, the weight of L2 regularization is increased, and the sampling ratio of difficult samples is increased.

[0071] A hyperspectral image classification system based on spectral domain perception and uncertainty control, comprising:

[0072] An image acquisition module, used for establishing a hyperspectral image set including a plurality of hyperspectral images;

[0073] A first processing module is used to perform noise removal processing on each hyperspectral image to obtain a first image;

[0074] A second processing module, configured to perform normalization processing on the first image to obtain a second image;

[0075] a third processing module, configured to obtain an importance weight of each band of the second image based on a spectral domain perception mechanism;

[0076] A fourth processing module is configured to obtain a feature tensor of the second image, construct a dynamic focusing unit, project the feature tensor of the second image using a linear projection layer to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and perform a dynamic weighted summation of the projected feature tensor based on importance weights in conjunction with an attention mechanism to obtain a dynamic focused feature tensor.

[0077] The model training module is used to construct a feature enhancement submodule, use a multi-layer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, build an uncertainty assessment unit to dynamically control the loss function of the multi-layer perceptron, and build an adaptive adjustment mechanism to adaptively adjust the model parameters of the multi-layer perceptron;

[0078] The result output module is used to output the classification results using the trained multi-layer perceptron.

[0079] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the hyperspectral image classification method based on spectral domain perception and uncertainty control is implemented.

[0080] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned hyperspectral image classification method based on spectral domain perception and uncertainty control.

[0081] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0082] The present invention can improve classification accuracy: the spectral domain perception mechanism can accurately focus on key spectral bands, effectively extract discriminative features, and reduce the interference of irrelevant spectral information. At the same time, the multi-layer perceptron further enhances the feature expression capability, enabling the model to more accurately distinguish different types of land objects. The adaptive adjustment mechanism optimizes the model training process by rationally evaluating and adjusting sample risks, thereby enhancing the model's adaptability to unbalanced data and further improving classification accuracy. Combining the advantages of both, this method can achieve a higher accuracy rate in hyperspectral image classification tasks, and can more accurately identify various land object types in practical applications, providing a more reliable basis for decision-making in related fields.

[0083] The present invention can improve computational efficiency: the dynamic focusing unit effectively reduces the dimension and computational complexity of the data through projection and Token pruning operations on the feature tensor. At the same time, the multi-layer perceptron structure has lower computational complexity than the complex convolutional neural network structure while ensuring the feature enhancement effect. The uncertain performance control module avoids unnecessary computational overhead and improves training efficiency by dynamically adjusting the training parameters. Therefore, when processing large-scale hyperspectral image data, the method of the present invention can significantly shorten the training time and inference time of the model, improve computational efficiency, and meet the requirements of real-time and fast processing in practical applications. For example, in scenarios such as real-time monitoring of drones and online environmental monitoring, accurate classification results can be quickly given to provide support for timely decision-making.

[0084] This invention enhances model adaptability and generalization capabilities: During model training, the dynamic focusing unit and uncertainty assessment unit efficiently extract and optimize features, enabling the model to better adapt to hyperspectral image data collected by different sensors in different scenarios, and demonstrating greater robustness to data diversity and complexity. Even in complex situations such as shifting data distribution and significant noise interference, the model maintains high classification performance, reduces overfitting, and exhibits improved generalization capabilities. This model can be widely applied to various practical hyperspectral image classification tasks, providing strong technical support for research and application in diverse fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0085] The accompanying drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0086] Figure 1 This is a flow chart of a hyperspectral image classification method based on spectral domain perception and uncertainty control of the present invention;

[0087] Figure 2 This is a schematic diagram of the overall process of a hyperspectral image classification method based on spectral domain perception dynamic focusing and uncertainty performance control of the present invention;

[0088] Figure 3 This is a diagram showing the water recognition result of a specific embodiment of the present invention;

[0089] Figure 4 This is a strawberry recognition result diagram according to a specific embodiment of the present invention;

[0090] Figure 5 This is a road recognition result diagram according to a specific embodiment of the present invention;

[0091] Figure 6 This is a soybean recognition result diagram according to a specific embodiment of the present invention;

[0092] Figure 7 This is a recognition result diagram of a melon field in a specific embodiment of the present invention;

[0093] Figure 8 This is a diagram showing the recognition results of water spinach according to a specific embodiment of the present invention;

[0094] Figure 9 This is a schematic diagram of a hyperspectral image classification system based on spectral domain perception and uncertainty control in the present invention. DETAILED DESCRIPTION

[0095] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0096] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the system or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0097] Example 1

[0098] Example 1 provides a hyperspectral image classification method based on spectral domain perception and uncertainty control, such as Figure 1 As shown, including:

[0099] Step S1: establishing a hyperspectral image set including a plurality of hyperspectral images;

[0100] Step S2: performing noise removal processing on each hyperspectral image to obtain a first image;

[0101] Step S3: normalizing the first image to obtain a second image;

[0102] Step S4: obtaining the importance weight of each band of the second image based on the spectral domain perception mechanism;

[0103] Step S5: Obtain the feature tensor of the second image, construct a dynamic focusing unit, use a linear projection layer to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and combine the attention mechanism to dynamically weight the projected feature tensor based on the importance weight to obtain a dynamic focusing feature tensor;

[0104] Step S6: constructing a feature enhancement submodule, using a multilayer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, constructing an uncertainty assessment unit to dynamically control the loss function of the multilayer perceptron, and constructing an adaptive adjustment mechanism to adaptively adjust the model parameters of the multilayer perceptron;

[0105] Step S7: Use the trained multi-layer perceptron to output the classification results.

[0106] This embodiment provides a hyperspectral image classification method based on spectral domain perception and uncertainty control. Through unique model design and training strategies, it effectively improves the performance of hyperspectral image classification and overcomes the shortcomings of existing technologies. It performs spectral feature analysis on each band of hyperspectral images through noise removal and spectral domain perception mechanisms, obtains the information entropy of each band and the correlation coefficient with the category label, and uses this as a basis to obtain the importance weight of the band, focusing on key spectral bands, reducing the interference of redundant information such as the band where the noise is located, and solving the imbalance of hyperspectral image data through uncertainty assessment units and adaptive adjustment mechanisms.

[0107] In step S2 of this embodiment, Figure 2 As shown in the figure, the acquired hyperspectral image is subjected to noise removal processing. The median filtering method is used to perform traversal filtering on the image with a 3x3 filter window to remove noise points in the image and reduce the interference of noise on image feature extraction and classification.

[0108] In step S3 of this embodiment, Figure 2 As shown, the normalization method is: perform Min-Max linear operation on the first image, and map the pixel values of the first image to the interval [0, 1] through linear transformation. The calculation formula is:

[0109]

[0110] in, is the original pixel value, and are the minimum and maximum pixel values of the band in the image, respectively. is the normalized pixel value.

[0111] In step S4 of this embodiment, a spectral perception mechanism (SPM) is designed to analyze the spectral characteristics of each band of the second image, calculate the information entropy of each band and the correlation coefficient with the category label, and use this as a basis to obtain the importance weight of the band.

[0112] like Figure 2 As shown, the method for obtaining the importance weight of each band of the second image based on the spectral domain perception mechanism is:

[0113] Get the information entropy of each band, the calculation formula is:

[0114]

[0115] in, Represents the number of different pixel values in a certain band of the second image. Is the index variable for traversing pixel values, is the pixel value, is the pixel value in the band The probability of is the information entropy of each band, is a logarithmic function with base 10;

[0116] The Pearson correlation coefficient calculation method is used to obtain the correlation coefficient of the category label of each band;

[0117] The information entropy of each band and the correlation coefficient of the category label are normalized, and the normalized information entropy and correlation coefficient are weighted and combined to obtain the importance weight of each band. For example, the experiment uses an information entropy weight of 0.4 and a correlation coefficient weight of 0.6.

[0118] In step S5 of this embodiment, based on the above-mentioned spectral domain perception results, the feature tensor of the second image is obtained, a dynamic focusing unit (DFU) is constructed, and a linear projection layer (nn.Linear) is used to project the feature tensor of the second image, mapping it from the original dimension to a low-dimensional space (the embedding dimension is set to 64). At the same time, combined with the attention mechanism, the projected feature tensor is dynamically weighted and summed according to the importance weight of each band, so that the model can focus on key spectral bands and feature areas during the feature extraction process, reduce the interference of redundant information, and improve the efficiency and accuracy of feature extraction.

[0119] The feature tensor of the second image is a spectral feature sequence after the two-dimensional spatial information is flattened. The method for obtaining the feature tensor of the second image is as follows: the second image is represented as [B, H, W, C], where B is the batch size, H is the height, W is the width, and C is the number of bands. After flattening the spatial dimension, the feature tensor is obtained. The feature tensor is represented as [B, N, C], where N = H × W, and N is the length of the one-dimensional sequence obtained by expanding the two-dimensional spatial information of the second image.

[0120] like Figure 2 As shown in FIG, a dynamic focusing unit is constructed, and a linear projection layer is used to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor. At the same time, the attention mechanism is combined to perform a dynamic weighted summation of the projected feature tensor based on the importance weight to obtain a dynamic focused feature tensor. Specifically, the method is as follows:

[0121] Create query projection layer, key projection layer, and value projection layer. The query projection layer, key projection layer, and value projection layer are all linear projection layers (nn.Linear).

[0122] Pass the feature tensor of the second image through the corresponding linear projection layer to obtain a projected feature tensor. The projected feature tensor includes a query tensor, a key tensor, and a value tensor. The feature tensor of the second image is [B, N, C], and the projected feature tensor is [B, N, 64], where B is the batch size, N is the length of the one-dimensional sequence expanded from the two-dimensional spatial information of the second image, and C is the number of bands.

[0123] Perform weighted operations on the value tensor (V) according to the importance weights to obtain the weighted value tensor;

[0124] Get attention energy, the calculation formula is:

[0125]

[0126] in, is the attention energy, which is used to measure the correlation between different features. is batch matrix multiplication, To perform a transpose operation on the value tensor;

[0127] The attention weight is obtained through the softmax function, and the calculation formula is:

[0128]

[0129] in, is the attention weight, It will Each element of is converted into a probability value, is the last dimension of the projected feature tensor;

[0130] The attention weight is multiplied by the weighted value tensor to obtain the dynamic focus feature tensor, and the dynamic focus feature tensor is subjected to Token pruning according to the preset Token pruning ratio. The 50% bands with higher importance scores are retained, and the dynamic focus feature tensor after Token pruning is filled with zero values.

[0131] In step S6 of this embodiment, Figure 2 As shown in the figure, a feature enhancement submodule (FES) is constructed, using a multi-layer perceptron (MLP) structure to perform nonlinear transformation and enhancement on the dynamically focused features. The MLP consists of multiple fully connected layers and an activation function (ReLU). By performing multiple layers of linear transformation and nonlinear activation on the features, it further improves the expressiveness and discriminability of the features, making them more conducive to subsequent classification tasks.

[0132] The method of using a multilayer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training is as follows:

[0133] Construct a three-layer multilayer perceptron. The first layer is the input layer, and the number of nodes in the input layer is the same as the dimension of the dynamic focus feature tensor; the second layer is the hidden layer and uses ReLU as the activation function; the third layer is the output layer.

[0134] Specifically, a three-layer multilayer perceptron (MLP) is constructed. The first layer is the input layer, with the same number of nodes as the feature dimension after dynamic focusing (e.g., 64). The second layer is the hidden layer, with 128 nodes and using ReLU as the activation function. The third layer is the output layer, also with 64 nodes. The features after the nonlinear transformation of the hidden layer are output as the enhanced feature tensor, further improving the expressiveness and discriminability of the features.

[0135] In step S6 of this embodiment, Figure 2 As shown in the figure, a Risk Assessment Unit (RAU) is designed to dynamically control the model training process of the multilayer perceptron according to the set risk assessment strategy, combined with prior knowledge and sample weights.

[0136] The method of constructing an uncertainty evaluation unit to dynamically control the loss function of the multilayer perceptron is:

[0137] During initialization, the relevant parameters are initialized according to the input prior probability, class weight, focal weight, loss function type, and number of warm-up rounds, and the prior probability and class weight are transferred to the image processing unit. For example, the prior probability (prior) is 0.3769, the class weight (class_weight) is 0.5, the focal weight (focal_weight) is 2, and the number of warm-up rounds (warm_up) is 50;

[0138] During the forward propagation process, the type of loss function used is determined by the number of rounds of current training, including:

[0139] when When , the BCE (binary cross entropy) loss function (binary cross entropy) is used to calculate the loss, and the calculation formula is:

[0140]

[0141] in, is the BCE loss function value, is the first parameter, is the second parameter, Indicates the number of preheating rounds, Indicates the current round number;

[0142] For the positive sample loss, the calculation formula is:

[0143]

[0144] in, is the predicted value of the multilayer perceptron, is the positive sample mask, When it is 0, it means it is not a positive sample. When it is 1, it indicates a positive sample. is the positive sample loss corresponding to the BCE loss function;

[0145] For negative sample loss, the calculation formula is:

[0146]

[0147] in, is the negative sample mask, is the negative sample loss corresponding to the BCE loss function;

[0148] For unlabeled sample loss, the calculation formula is:

[0149]

[0150] in, is the unlabeled sample mask, is the unlabeled sample loss corresponding to the BCE loss function;

[0151] when When , the sigmoid loss function is used to calculate the loss;

[0152] For the positive sample loss, the calculation formula is:

[0153]

[0154] in, , For the The model prediction value of positive samples, N is the number of positive samples, is the positive sample loss corresponding to the sigmoid loss function, is the natural exponential function;

[0155] For negative sample loss, the calculation formula is:

[0156]

[0157] in, , For the The model prediction value of negative samples, M is the number of negative samples, is the negative sample loss corresponding to the sigmoid loss function;

[0158] For unlabeled sample loss, the calculation formula is:

[0159]

[0160] in, , For the The model prediction value of unlabeled samples, K is the number of unlabeled samples, is the unlabeled sample loss corresponding to the sigmoid loss function;

[0161] When calculating the final loss, when the unlabeled sample loss does not need to be considered, the calculation formula is:

[0162]

[0163] in, is the positive sample loss, is the negative sample loss, when hour, for , for ,when hour, for , for , is the weight;

[0164] When considering the impact of unlabeled sample loss on the final loss as needed, add it to the final loss in a certain weighted way:

[0165]

[0166] in, is the weight coefficient of the unlabeled sample loss, when hour, for ,when hour, for .

[0167] In step S6 of this embodiment, Figure 2 As shown, an adaptive adjustment mechanism (AAM) is constructed to adaptively adjust the training parameters of the multilayer perceptron model, such as the learning rate and parameter update step size, according to the output results of the uncertainty evaluation unit.

[0168] The method of constructing an adaptive adjustment mechanism to adaptively adjust the model parameters of the multilayer perceptron is:

[0169] If the model's accuracy on the validation set does not improve for several consecutive rounds or the loss value starts to rise, the model is judged to be overfitting. In this case, the learning rate is multiplied by the decay factor, the weight of ridge regression (L2 regularization) is increased, and the sampling ratio of difficult samples is increased.

[0170] Set multiple monitoring metrics, such as the model's accuracy on the validation set and the trend of the loss value. If the model's accuracy on the validation set does not improve for several consecutive rounds or the loss value begins to rise, the model may be overfitting. In this case, the adaptive adjustment mechanism takes the following measures: multiplying the learning rate by a decay factor (such as 0.8), increasing the L2 regularization weight (for example, from 0.0005 to 0.001), and adjusting the sample sampling strategy, such as increasing the sampling ratio of difficult samples (from 0.2 to 0.3). This optimizes the model training process, ensures that the model maintains good performance and stability at different training stages, avoids falling into local optimal solutions, and improves the model's robustness and generalization ability.

[0171] In order to verify the effect of the method of the present invention, based on the above technical solution, this embodiment carried out a simulation experiment, and the specific results are analyzed as follows:

[0172] 1. Experimental images

[0173] In this example, the proposed hyperspectral image classification method based on spectral domain perception and uncertainty control is experimented on the WHU-Hi-HanChuan public dataset to verify the effectiveness and reliability of the method.

[0174] The HanChuan dataset's hyperspectral imagery features 274 spectral channels spanning wavelengths from 400 to 1000 nanometers. The resulting images have a spatial resolution of 0.109 meters and dimensions of 1217 x 303 meters. Given the significant shadows, this dataset exhibits a more pronounced spectral diversity. During the detection process, six ground objects were specifically selected to ensure no ambiguous markings, thereby ensuring accurate and reliable detection.

[0175] 2. Experimental methods and related parameter settings

[0176] The experiment selected the stochastic gradient descent algorithm, used the Adam (Adaptive Moment Estimation) optimizer, and the entire training process lasted 1000 times. The learning rate was 0.001, and the batch size was set to 16. and The default values of are determined to be 0.3 and 0.1 respectively. In addition, the proportion of the test set in all experiments is always 0.9.

[0177] The main evaluation indicators include precision, recall and Precision is primarily used to assess how accurately a classifier identifies true positive samples from among all samples it determines to be positive. Correspondingly, recall is used to assess a classifier's ability to detect all actual positive samples. The F1 score, a balance between precision and recall, is a suitable metric for evaluating the performance of single-class classification tasks, providing a comprehensive and objective reflection of the quality of the task.

[0178] 3. Comparison of experimental results

[0179] Table 1 - HanChuan dataset F1 test results

[0180]

[0181] Table 2 - HanChuan dataset precision / recall test results

[0182]

[0183] like Figure 3-Figure 8 The figure shows the recognition results for water, strawberries, roads, soybeans, melon fields, and water spinach. As shown in Table 1, the average F1 score for the proposed method on the HanChuan dataset for six ground object categories reached 92.91%, with the highest F1 score for the road classification task (95.71%), validating the dynamic focusing unit's ability to extract highly discriminative spectral features. Table 2 further demonstrates that the proposed method achieved average precision and recall of 91.74% and 94.13%, respectively. The method performed particularly well in the road (98.52%) and water (95.31%) classification tasks, demonstrating the advantage of the spectral domain perception mechanism in dynamically weighting key bands.

[0184] Example 2

[0185] Example 2 provides a hyperspectral image classification system based on spectral domain perception and uncertainty control, which is applied to the above-mentioned hyperspectral image classification method based on spectral domain perception and uncertainty control, such as Figure 9 As shown, including:

[0186] An image acquisition module, used for establishing a hyperspectral image set including a plurality of hyperspectral images;

[0187] A first processing module is used to perform noise removal processing on each hyperspectral image to obtain a first image;

[0188] A second processing module, configured to perform normalization processing on the first image to obtain a second image;

[0189] a third processing module, configured to obtain an importance weight of each band of the second image based on a spectral domain perception mechanism;

[0190] A fourth processing module is configured to obtain a feature tensor of the second image, construct a dynamic focusing unit, project the feature tensor of the second image using a linear projection layer to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and perform a dynamic weighted summation of the projected feature tensor based on importance weights in conjunction with an attention mechanism to obtain a dynamic focused feature tensor.

[0191] The model training module is used to construct a feature enhancement submodule, use a multi-layer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, build an uncertainty assessment unit to dynamically control the loss function of the multi-layer perceptron, and build an adaptive adjustment mechanism to adaptively adjust the model parameters of the multi-layer perceptron;

[0192] The result output module is used to output the classification results using the trained multi-layer perceptron.

[0193] Example 3

[0194] Example 3 provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the hyperspectral image classification method based on spectral domain perception and uncertainty control is implemented.

[0195] Example 4

[0196] Example 4 provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the above-mentioned hyperspectral image classification method based on spectral domain perception and uncertainty control.

[0197] The memory in the embodiment of the present invention is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.

[0198] The hyperspectral image classification method based on spectral domain perception and uncertainty control disclosed in the embodiments of the present invention can be applied to or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, the various steps of the hyperspectral image classification method based on spectral domain perception and uncertainty control can be completed by hardware integrated logic circuits or software instructions in the processor. The aforementioned processor may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly implemented and executed by a hardware decoding processor or by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in a memory. The processor reads information from the memory and, in conjunction with its hardware, completes the steps of the hyperspectral image classification method based on spectral domain perception and uncertainty control provided in the embodiments of the present invention.

[0199] In an exemplary embodiment, the electronic device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), FPGAs, general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.

[0200] It is understood that the memory can be volatile memory or non-volatile memory, or can include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disk, or compact disc read-only memory (CD-ROM); magnetic surface memory can be magnetic disk memory or tape memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus random access memory (DRRAM). The memory described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.

[0201] The above embodiments are merely illustrative of the technical solutions of the present invention. The methods of the present invention are not limited solely to those described in the above embodiments, but are subject to the scope defined by the claims. Any modifications, supplements, or equivalent substitutions made by those skilled in the art based on these embodiments are within the scope of protection claimed in the claims.

Claims

1. A hyperspectral image classification method based on spectral domain perception and uncertainty control, characterized in that: include: Establishing a hyperspectral image set including several hyperspectral images; Performing noise removal on each hyperspectral image to obtain a first image; a second image obtained by normalizing the first image; Obtaining an importance weight of each band of the second image based on a spectral domain perception mechanism; Obtain the feature tensor of the second image, construct a dynamic focusing unit, use a linear projection layer to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and combine the attention mechanism to dynamically weight the projected feature tensor based on the importance weight to obtain a dynamic focusing feature tensor; Construct a feature enhancement submodule, use a multi-layer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, construct an uncertainty assessment unit to dynamically control the loss function of the multi-layer perceptron, and construct an adaptive adjustment mechanism to adaptively adjust the model parameters of the multi-layer perceptron; Use the trained multilayer perceptron to output the classification results.

2. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: The normalization method is: A Min-Max linear operation is performed on the first image, and pixel values of the first image are mapped to the interval [0, 1] through a linear transformation.

3. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: The method for obtaining the importance weight of each band of the second image based on the spectral domain perception mechanism is: Get the information entropy of each band, the calculation formula is: in, Represents the number of different pixel values in a certain band of the second image. Is the index variable for traversing pixel values, is the pixel value, is the pixel value in the band The probability of is the information entropy of each band, is a logarithmic function with base 10; The Pearson correlation coefficient calculation method is used to obtain the correlation coefficient of the category label of each band; The information entropy of each band and the correlation coefficient of the category label are normalized, and the normalized information entropy and the correlation coefficient of the category label are combined through weighted combination to obtain the importance weight of each band.

4. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: A dynamic focusing unit is constructed, and a linear projection layer is used to project the feature tensor of the second image to map the original dimension to a low-dimensional space to obtain a projected feature tensor. At the same time, the attention mechanism is combined to dynamically weight the projected feature tensor based on the importance weight to obtain a dynamic focusing feature tensor. The specific method is as follows: Create query projection layer, key projection layer and value projection layer; The feature tensor of the second image is passed through the corresponding linear projection layer to obtain a projected feature tensor. The projected feature tensor includes a query tensor, a key tensor, and a value tensor. The feature tensor of the second image is [B, N, C], and the projected feature tensor is [B, N, 64], where B is the batch size, N is the length of the one-dimensional sequence expanded from the two-dimensional spatial information of the second image, and C is the number of bands. Perform weighted operations on the value tensor according to the importance weight to obtain the weighted value tensor; Get attention energy, the calculation formula is: in, is the attention energy, which is used to measure the correlation between different features. is batch matrix multiplication, To transpose the value tensor, Represents the number of different value types of pixel values in a certain band of the second image; The attention weight is obtained through the softmax function, and the calculation formula is: in, is the attention weight, It will Each element of is converted into a probability value, is the last dimension of the projected feature tensor; The attention weight is multiplied by the weighted value tensor to obtain the dynamic focus feature tensor, and the dynamic focus feature tensor is subjected to Token pruning according to the preset Token pruning ratio. A certain proportion of bands with higher importance scores are retained, and the dynamic focus feature tensor after Token pruning is filled with zero values.

5. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: The method of using a multilayer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training is as follows: Construct a three-layer multilayer perceptron. The first layer is the input layer, and the number of nodes in the input layer is the same as the dimension of the dynamic focus feature tensor; the second layer is the hidden layer and uses ReLU as the activation function; the third layer is the output layer.

6. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: The method of constructing an uncertainty evaluation unit to dynamically control the loss function of the multilayer perceptron is: During initialization, the relevant parameters are initialized according to the input prior probability, category weight, focus weight, loss function type and number of warm-up rounds, and the prior probability and category weight are transferred to the image processing unit; During the forward propagation process, the type of loss function used is determined according to the number of rounds of current training, specifically: when When , the BCE loss function is used to calculate the loss, and the calculation formula is: in, is the BCE loss function value, is the first parameter, is the second parameter, Indicates the number of preheating rounds, Indicates the current round number, is a logarithmic function with base 10; For the positive sample loss, the calculation formula is: in, is the predicted value of the multilayer perceptron, is the positive sample mask, is the positive sample loss corresponding to the BCE loss function; For negative sample loss, the calculation formula is: in, is the negative sample mask, is the negative sample loss corresponding to the BCE loss function; For unlabeled sample loss, the calculation formula is: in, is the unlabeled sample mask, is the unlabeled sample loss corresponding to the BCE loss function; when When , the sigmoid loss function is used to calculate the loss; For the positive sample loss, the calculation formula is: in, , For the The model prediction value of positive samples, N is the number of positive samples, is the positive sample loss corresponding to the sigmoid loss function, is the natural exponential function; For negative sample loss, the calculation formula is: in, , For the The model prediction value of negative samples, M is the number of negative samples, is the negative sample loss corresponding to the sigmoid loss function; For unlabeled sample loss, the calculation formula is: in, , For the The model prediction value of unlabeled samples, K is the number of unlabeled samples, is the unlabeled sample loss corresponding to the sigmoid loss function; When calculating the final loss, when the unlabeled sample loss does not need to be considered, the calculation formula is: in, is the positive sample loss, is the negative sample loss, when hour, for , for ,when hour, for , for , is the weight; When considering the impact of unlabeled sample loss on the final loss as needed, add it to the final loss in a certain weighted way: in, is the weight coefficient of the unlabeled sample loss, when hour, for ,when hour, for .

7. The hyperspectral image classification method based on spectral domain perception and uncertainty control according to claim 1 is characterized in that: The method of constructing an adaptive adjustment mechanism to adaptively adjust the model parameters of the multilayer perceptron is: If the accuracy of the model on the validation set does not improve for several consecutive rounds or the loss value starts to rise, the model is judged to be overfitting. In this case, the learning rate is multiplied by the decay factor, the weight of the ridge regression is increased, and the sampling ratio of difficult samples is increased.

8. A hyperspectral image classification system based on spectral domain perception and uncertainty control, characterized in that: include: An image acquisition module, used for establishing a hyperspectral image set including a plurality of hyperspectral images; A first processing module is used to perform noise removal processing on each hyperspectral image to obtain a first image; A second processing module, configured to perform normalization processing on the first image to obtain a second image; a third processing module, configured to obtain an importance weight of each band of the second image based on a spectral domain perception mechanism; A fourth processing module is configured to obtain a feature tensor of the second image, construct a dynamic focusing unit, project the feature tensor of the second image using a linear projection layer to map the original dimension to a low-dimensional space to obtain a projected feature tensor, and perform a dynamic weighted summation of the projected feature tensor based on importance weights in conjunction with an attention mechanism to obtain a dynamic focused feature tensor. The model training module is used to construct a feature enhancement submodule, use a multi-layer perceptron to perform nonlinear transformation and enhancement on the dynamic focus feature tensor and perform model training, build an uncertainty assessment unit to dynamically control the loss function of the multi-layer perceptron, and build an adaptive adjustment mechanism to adaptively adjust the model parameters of the multi-layer perceptron; The result output module is used to output the classification results using the trained multi-layer perceptron.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the hyperspectral image classification method based on spectral domain perception and uncertainty control according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the hyperspectral image classification method based on spectral domain perception and uncertainty control is implemented as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Unmanned aerial vehicle hyperspectral vegetation species classification method and system based on deep learning

    CN117935090A

  • Hyperspectral image dimension reduction method based on tensor graph embedding

    CN118097324A