End-to-end hyperspectral image clustering method based on multi-task self-driven clustering network

CN122551005APending Publication Date: 2026-08-11XIDIAN UNIV HANGZHOU RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

尽管如此,该两阶段框架仍存在明显局限:特征提取所提取的特征未必符合后续聚类算法的可分性假设,而聚类结果也无法反向指导特征学习,使得整体模型易收敛至次优解,限制了聚类性能的进一步提升

Benefits of technology

[0007] The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network provided by this invention extracts spectra by inputting hyperspectral image samples in batches into an autoencoder. Spatial features are analyzed and a reconstruction learning task is performed to enable the autoencoder to learn feature representations in an unsupervised manner. Simultaneously, a clustering head is used to predict the clustering probability distribution. Based on this, diversity enhancement learning, graph contrast learning, and self-driven clustering learning tasks are executed. The diversity enhancement learning task aims to bring the number of clusters closer to a preset value to avoid collapse. The graph contrast learning task constrains the clustering probability distribution based on nearest neighbor relationships, ensuring that structurally similar samples are clustered consistently while distancing non-similar samples. The self-driven clustering learning task narrows the spectral density... By establishing a bidirectional coupling between feature learning and cluster assignment using the distance between spatial features and their assigned cluster centers, the independent feature extraction and clustering processes in the traditional two-stage framework are transformed into end-to-end collaborative optimization. This effectively solves the problem of easy convergence to suboptimal solutions caused by the separation of feature representation and clustering objectives. At the same time, the discriminativeness, diversity, and regional continuity of the clustering results are improved through multi-task joint constraints. Ultimately, direct clustering output without post-processing steps is achieved, significantly improving the model's running efficiency and practical value while ensuring clustering accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122551005A_ABST
    Figure CN122551005A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of hyperspectral image clustering, and discloses an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network, which comprises the following steps: inputting samples into a self-encoder to extract spectral space features and performing a reconstruction learning task to learn feature representation in an unsupervised manner; using a clustering head to predict a clustering probability distribution, performing a diversity enhancement learning task and a graph contrast learning task, so that the number of clusters tends to a preset value, and samples that are nearest neighbors of each other are clustered consistently and samples that are not nearest neighbors are clustered away from each other; performing a self-driven clustering learning task to reduce the distance between features and the cluster centers to which the features belong; constructing a loss function for the four learning tasks and performing weighted summation, optimizing network parameters based on the weighted loss function, using the trained network to perform end-to-end hyperspectral image clustering, and realizing end-to-end joint optimization of hyperspectral image feature extraction and clustering analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of hyperspectral image clustering technology, specifically involving an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network. Background Technology

[0002] Hyperspectral images, as a three-dimensional data cube, reflect the contours and textures of ground features in their spatial dimension, while their spectral dimension covers the visible to thermal infrared bands, revealing the chemical and physical properties of targets. Compared to traditional remote sensing imagery, hyperspectral images significantly enhance target recognition capabilities due to their richer spectral information and have been widely applied in fields such as mineral exploration, agricultural management, and water quality surveys. Hyperspectral image classification is a core technology for this data, aiming to assign a corresponding ground feature category label to each pixel in the image. However, hyperspectral image classification typically relies on a large number of precisely labeled samples, but field collection and manual annotation are costly, especially in remote areas where acquisition is extremely difficult. Therefore, unsupervised clustering methods that do not require pre-labeling have become an important technical approach, achieving automatic grouping by mining the spectral-spatial structure of pixels themselves.

[0003] Traditional clustering methods mainly include the following categories: distance-based methods (such as K-means and fuzzy C-means), density-based methods (such as density-based spatial clustering algorithms), and probability-based methods (such as Gaussian mixture models). However, hyperspectral images are affected by factors such as illumination variations, atmospheric interference, and mixed pixels, often containing a large amount of redundancy and noise, making it difficult for the aforementioned traditional methods to extract discriminative features, thus limiting their clustering performance. In contrast, graph-based subspace clustering methods learn low-dimensional manifold structures by constructing adjacency relationships between pixels, effectively suppressing noise and becoming an effective solution for hyperspectral image clustering. However, this method requires calculating a global pixel affinity matrix, which faces high computational costs when processing large-scale hyperspectral images.

[0004] In recent years, with the development of neural networks, low-complexity, high-efficiency unsupervised feature extraction models such as graph neural networks (GNNs) and autoencoders (AEs) have begun to replace subspace clustering methods and are widely used in the feature extraction stage of hyperspectral image clustering. Current mainstream methods typically employ a two-stage framework: first, a designed deep network is used to extract discriminative feature representations; then, traditional clustering algorithms (such as K-means or spectral clustering) are applied to the learned features to obtain the final cluster labels. However, this two-stage framework still has significant limitations: the features extracted may not meet the separability assumptions of subsequent clustering algorithms, and the clustering results cannot guide feature learning in reverse, making the overall model prone to convergence to suboptimal solutions, thus limiting further improvements in clustering performance. Although some studies have attempted to alleviate these problems by applying clustering regularization to feature representations, the inherent separation between feature learning and clustering analysis has not been fundamentally resolved. Therefore, how to achieve end-to-end joint optimization of hyperspectral image feature extraction and clustering analysis remains a critical technical challenge that urgently needs to be overcome in this field. Summary of the Invention

[0005] To address the aforementioned problems in the prior art, this invention provides an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network.

[0006] The technical problem to be solved by this invention is achieved through the following technical solution: An end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network includes: Hyperspectral image samples are input into an autoencoder in batches to extract spectra. Spatial characteristics, and based on spectrum Spatial features are used to perform a reconstruction learning task, so that the autoencoder learns feature representations of hyperspectral image samples in an unsupervised manner; Based on the spectrum Spatial features are used to predict the clustering probability distribution using a clustering head. Based on the clustering probability distribution, a diversity enhancement learning task is performed to make the number of clusters predicted by the clustering head approach a preset value. A graph contrast learning task is also performed based on the nearest neighbor relationship between hyperspectral image samples to constrain the clustering probability distribution predicted by the clustering head, so that hyperspectral image samples that are the nearest neighbors are clustered consistently, and hyperspectral image samples that are not the nearest neighbors are clustered separately. Based on the spectrum Spatial features and the clustering probability distribution perform a self-driven clustering learning task to bring the spectrum closer together. The distance between a spatial feature and the cluster center to which it belongs; Loss functions are constructed for the reconstruction learning task, the graph contrast learning task, the diversity enhancement learning task, and the self-driven clustering learning task, respectively. The loss functions are weighted and summed. The parameters of the autoencoder and the clustering head are optimized based on the weighted loss functions to obtain the trained multi-task self-driven clustering network. End-to-end hyperspectral image clustering is performed using the aforementioned multi-task self-driven clustering network.

[0007] The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network provided by this invention extracts spectra by inputting hyperspectral image samples in batches into an autoencoder. Spatial features are analyzed and a reconstruction learning task is performed to enable the autoencoder to learn feature representations in an unsupervised manner. Simultaneously, a clustering head is used to predict the clustering probability distribution. Based on this, diversity enhancement learning, graph contrast learning, and self-driven clustering learning tasks are executed. The diversity enhancement learning task aims to bring the number of clusters closer to a preset value to avoid collapse. The graph contrast learning task constrains the clustering probability distribution based on nearest neighbor relationships, ensuring that structurally similar samples are clustered consistently while distancing non-similar samples. The self-driven clustering learning task narrows the spectral density... By establishing a bidirectional coupling between feature learning and cluster assignment using the distance between spatial features and their assigned cluster centers, the independent feature extraction and clustering processes in the traditional two-stage framework are transformed into end-to-end collaborative optimization. This effectively solves the problem of easy convergence to suboptimal solutions caused by the separation of feature representation and clustering objectives. At the same time, the discriminativeness, diversity, and regional continuity of the clustering results are improved through multi-task joint constraints. Ultimately, direct clustering output without post-processing steps is achieved, significantly improving the model's running efficiency and practical value while ensuring clustering accuracy.

[0008] The present invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description

[0009] Figure 1 This is a flowchart of an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network provided by the present invention; Figure 2 A schematic diagram of the self-encoder in this invention is shown; Figure 3 The relationship between the average probability vector distribution and cluster diversity in this invention is illustrated by way of example. Figure 4 The architecture and training principle of the multi-task self-driven clustering network in this invention are shown. Figure 5 The diagram shows the classification results obtained by the present invention and several existing algorithms on the PU (Pavia University) data using the Hungarian algorithm. Detailed Implementation

[0010] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0011] To achieve end-to-end joint optimization of hyperspectral image feature extraction and clustering analysis, this invention provides an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network. (See [link to relevant documentation]). Figure 1 The method includes the following steps: S10. Input the hyperspectral image samples into the autoencoder in batches to extract the spectrum. Spatial characteristics, and based on spectrum Spatial features are used to perform a reconstruction learning task so that the autoencoder can learn the feature representation of hyperspectral image samples in an unsupervised manner.

[0012] Specifically, for each pixel in the hyperspectral image, data blocks in its spatial neighborhood are extracted from the hyperspectral image centered on that pixel as hyperspectral image samples. Positive sample pairs are constructed for each hyperspectral image sample to form a positive sample pair dictionary, which is represented as a homogeneous map. The positive sample pairs in the positive sample pair dictionary are then input into the autoencoder in batches.

[0013] Understandably, the positive sample pair dictionary contains multiple positive sample pairs, and the Gaussian distance between the center pixels of the two data blocks constituting a positive sample pair is close. Therefore, for each hyperspectral image sample, a sample with a similar spectral density can be selected based on the Gaussian distance. The data patch with the most similar spatial features is selected as its positive sample. During the training of the autoencoder, the training data is input into the autoencoder in the form of positive sample pairs. Through the autoencoder's reconstruction learning task, the high-level feature representation of the samples (i.e., spectrum) is learned in an unsupervised manner. Spatial characteristics) lay the foundation for optimizing subsequent tasks.

[0014] See Figure 2 An autoencoder consists of an encoder and a decoder; the encoder includes multiple layers of two-dimensional convolutional layers (Conv2D) for extracting the spectrum of hyperspectral image samples. Spatial characteristics; the decoder is a transpose of the encoder, used to base the spectrum. Reconstructing hyperspectral image samples from spatial features. Figure 2 In this context, Softplus represents the Softplus activation function, and Flatten represents the Flatten layer, also known as the flattening layer. The reconstruction learning task performed in step S10 is achieved by minimizing the mean square error between the hyperspectral image samples input to the encoder and the hyperspectral image samples reconstructed by the decoder.

[0015] Specifically, hyperspectral images are represented as ,in The total number of samples, samples (hyperspectral image samples) (abbreviation) with positional embedding, Image height (number of pixel rows). Image width (number of pixel columns). This represents the number of spectral bands. Let be the set of real numbers. To extract spectral and spatial features from hyperspectral images, a convolutional autoencoder (CAE) is used as a feature extractor to learn discriminative features. For example, the CAE encoder consists of three 2D convolutional layers: the first layer uses a 3×3 kernel, and the next two layers use 2×2 kernels. Each layer is followed by a Softplus activation function. The encoder output is connected to the decoder input; the decoder structure is a transpose of the encoder structure. The features output by the encoder can be represented as: (1); in, Indicates encoder, Represents the spectrum of the encoder output. Spatial features, It is its first 1 eigenvector Indicates and The corresponding positive samples, These are the learnable parameters of the encoder.

[0016] Spectrum of encoder output Spatial feature input decoder decoder Based on spectrum Spatial features perform reconstruction learning tasks to reconstruct Its output can be represented as: (2); in, It is a decoder Learnable parameters It is a decoder The output is the reconstruction result.

[0017] In this invention, the autoencoder is trained through a reconstruction learning task to force unsupervised extraction of spectral-spatial features from the input hyperspectral image samples. This approach ensures that the learned features comprehensively encode both spectral properties and spatial context information. This reconstruction learning task is optimized by minimizing the mean squared error (MSE) between the autoencoder input and output, with the following loss function: (3); in, The loss is calculated for the loss function of the reconstructed learning task.

[0018] S20, Spectrum based on encoder output Spatial features are used to predict the cluster probability distribution using a clustering head. Based on this cluster probability distribution, a diversity enhancement learning task is performed to make the number of clusters predicted by the clustering head approach a preset value. Furthermore, a graph contrast learning task is performed based on the nearest neighbor relationship between hyperspectral image samples to constrain the cluster probability distribution predicted by the clustering head, so that hyperspectral image samples that are the nearest neighbors are clustered consistently, while hyperspectral image samples that are not the nearest neighbors are clustered separately.

[0019] The clustering head consists of a fully connected layer and a softmax activation function; the fully connected layer is used to convert the spectrum of the encoder output. Spatial features are mapped to the label space, and the Softmax activation function is used to convert the output of the fully connected layer into a clustering probability distribution.

[0020] Specifically, see Figure 4 The spectrum output by the encoder Spatial features The data is input into the fully connected layer of the clustering head and activated by the softmax function to predict clustering probabilities. The final output is the clustering probability distribution, thus mapping high-dimensional features to the label space. This computational process can be represented as: (4); in, This represents the mapping operation of the fully connected layer. These are the learnable parameters of the fully connected layer. Represents the cluster probability distribution. The category with the highest probability is the final predicted label, achieving end-to-end prediction from sample to label.

[0021] In hyperspectral image clustering, graph structures can be used to model the relationships between pixels. Based on this principle, this invention calculates the distance between samples using Gaussian distance, and then selects multiple nearest neighbor samples for each sample as homogeneous samples (positive samples). The Gaussian distance between samples... The similarity between them is characterized. Based on this, the present invention designs a graph contrastive learning task, which encourages the autoencoder to extract discriminative spectral-spatial-location features by forcing structurally similar samples to undergo consistent clustering assignments. However, using only this objective may lead to model degradation, with all samples being grouped into the same cluster. To avoid such trivial solutions, the present invention introduces an additional constraint that explicitly pushes apart the clustering representations of different samples in the feature space. This constraint enhances the separability of features and improves the robustness and efficiency of the clustering process.

[0022] Therefore, the graph contrast learning task in this invention is specifically used for: calculating the similarity between hyperspectral image samples based on Gaussian distance; selecting a preset number of nearest neighbor samples and non-nearest neighbor samples for each hyperspectral image sample based on this similarity; constructing a graph contrast loss function to minimize the graph contrast loss function, and constraining the clustering probability distribution predicted by the clustering head by minimizing the graph contrast loss function. The graph contrast loss function includes a first loss term and a second loss term; the first loss term is used to bring the clustering probability distributions of nearest neighbor samples closer together based on the calculated similarity, and the second loss term is used to push away the clustering probability distributions of non-nearest neighbor samples.

[0023] Specifically, the loss function for the above graph comparison is: (5); in, For the learnable parameters of the clustering head (mainly the fully connected layer), the graph contrastive learning task can constrain the fully connected layer to learn the relationships between samples. For the first A sample of hyperspectral images Clustering probability, for The The clustering probability of the nearest neighbor samples. The total number of hyperspectral image samples. for The set of nearest neighbor samples, For the first The hyperspectral image sample and its first Gaussian distance between the nearest neighbor samples for The Clustering probability of non-nearest neighbor samples, The loss calculated by the graph contrast loss function consists of two complementary parts: the first part (the first loss term) encourages samples with high structural similarity to produce a consistent probability distribution; the second part (the second loss term) forces diversity among different samples, prevents samples from collapsing into a single cluster, and preserves discriminative class information.

[0024] This invention also applies a diversity enhancement learning task to the output probabilities of the softmax layer to ensure the diversity of predicted probabilities, thereby guaranteeing that the final result matches the expected number of clusters. This is because, although the second term in the graph contrast learning task can alleviate the problem of cluster collapse into single classes, it still cannot guarantee that the number of clusters will reach the preset value. Therefore, this invention proposes a diversity enhancement learning task to ensure the number of generated clusters. This diversity enhancement learning task can guide the model to generate a cluster number close to the expected value, while effectively improving the stability of network training. Specifically, it is used to: calculate the average probability vector of the cluster probability distribution of all hyperspectral image samples in each batch; by minimizing the variance of the average probability vector, the frequency of occurrence of each cluster category in the cluster probability distribution tends to be uniform, thereby making the number of clusters in the cluster probability distribution approach the preset value. For this purpose, the following loss function can be constructed for the diversity enhancement learning task: (6); in, This is a preset value for the number of clusters, that is, the preset number of cluster categories. The average probability vector The Middle One element, , For the first Clustering probability of a hyperspectral image sample The number of hyperspectral image samples in a single batch. The loss is calculated using the loss function for the diversity enhancement learning task.

[0025] It is worth mentioning that, in order to enhance the diversity of clustering categories in the end-to-end learning framework, an average probability vector for adjusting each batch is proposed in Equation (6), which is defined as follows: (7); (8); in, Indicates the first The sample belongs to the first Clustering probability of each category.

[0026] by Figure 3 For example, among which and As shown in subgraph (a), the average probability vector The more elements close to zero in a batch, the fewer categories there are, resulting in lower cluster diversity. Conversely, in Figure 3 In subgraph (b), when When all elements are close to the same value, meaning each category appears with similar frequency, this indicates that the cluster assignments are evenly distributed across the categories, representing the highest cluster diversity. Therefore, the diversity of cluster assignments can be expressed as the average probability vector. The variance is used to characterize the distribution. The smaller the variance, the more uniform the distribution, and the higher the cluster diversity. Based on this, the loss function for the above diversity enhancement learning task can be defined as Equation (6). Thus, in the actual training process, Equation (6) is optimized batch by batch. It can facilitate the exploration of unknown categories in the early stages of clustering, thereby improving clustering performance.

[0027] S30, based on spectrum Spatial features and cluster probability distributions are used to perform a self-driven clustering learning task to bring the spectrum closer together. The distance between a spatial feature and the cluster center to which it belongs.

[0028] Based on the above three learning tasks, although a preliminary end-to-end unsupervised clustering framework has been established, the cluster labels and feature representations (spectral) still need further refinement. The intrinsic relationships between spatial features have not yet been fully modeled because existing clustering processes are essentially unidirectional optimization mechanisms. That is, existing clustering processes only cluster the feature representations output by the encoder, without providing feedback to the feature learning process. Therefore, collaborative optimization between feature learning and clustering objectives remains limited.

[0029] To overcome these limitations, this invention innovatively introduces a self-driven clustering learning task, specifically used to: utilize the clustering probability distribution as a soft label to analyze the spectra of all hyperspectral image samples within a single batch. Spatial features are weighted and averaged to estimate the cluster center for each cluster category; based on cluster centers and spectral density... Spatial features are used to construct a differentiable loss function for the self-driven clustering learning task. Minimizing this loss function brings the spectrum closer together. The distance between a spatial feature and the cluster center to which it belongs.

[0030] Specifically, this self-driven clustering learning task establishes a co-optimization between cluster labels and features by using cluster centroids. This creates a coupling relationship between the features extracted by the encoder and the labels predicted by the fully connected layer, achieving co-optimization between the two. The optimization problem can be expressed as: (9); in, Based on cluster probability distribution The generated predicted label matrix, , Indicates the first Does the _ sample belong to the _ ... There are several categories, and their calculation method is as follows: (10); In equation (10), This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise. Indicates the cluster center. Indicates the first The estimated center vectors of each category are calculated using the following formula: (11); here, Represents the cluster probability distribution The predicted belongs to the first The number of samples in a class.

[0031] However, based on the derivation of equation (9) and The process is non-differentiable. If equation (9) is used as the loss function for a self-driven clustering learning task, it is impossible to further optimize the cluster labels and feature representations (spectral). (Spatial features). To address this issue, this invention proposes using estimated cluster labels and estimated cluster centers to ensure differentiability. use Estimation is performed to determine the estimated values ​​of the cluster centers. The calculation is as follows: (12); in, yes Feature dimensions, This indicates the matrix transpose.

[0032] Understandably, for a single batch Spectra of each sample Spatial features, This can be interpreted as an estimated aggregation of samples from each category within a batch, while Corresponding to the estimated number of samples for each category, Since is the average probability vector within a batch, the loss function for the self-driven clustering learning task can be constructed as follows: (13); That is: (14).

[0033] in, For the spectrum Spatial features, This is the clustering probability distribution output by the clustering head. The estimated value of the cluster centers. The number of hyperspectral image samples in a single batch. , For the first Clustering probability of a hyperspectral image sample The loss is calculated for the loss function of the self-driven clustering learning task.

[0034] Therefore, by introducing soft label assignment and centroid estimation, Equation (14) effectively transforms the original non-differentiable centroid-based clustering objective into a fully differentiable optimization problem. The clustering process is no longer a passive post-processing step, but becomes an active supervisory signal, continuously refining the learned features. This design provides stable global constraints for large-scale hyperspectral image clustering by co-optimizing feature learning and clustering objectives. This task explicitly models soft cluster assignment and learnable cluster centers, establishing a bidirectional coupling between feature representation and clustering, which can alleviate the over-reliance on local graph relationships and achieve end-to-end clustering with a global distribution awareness.

[0035] S40. Construct loss functions for the reconstruction learning task, graph contrast learning task, diversity enhancement learning task, and self-driven clustering learning task, respectively. Sum the weighted loss functions and optimize the parameters of the autoencoder and clustering head based on the weighted loss functions to obtain the trained multi-task self-driven clustering network.

[0036] The loss functions for the four learning tasks have already been shown above and will not be repeated here.

[0037] For example, in one implementation, the weighted sum of the individual loss functions yields a weighted loss function that can be: (15); in, This indicates the total loss.

[0038] In another implementation, different weights can be assigned to each loss function. The specific ratio can be adjusted according to the actual training effect, which will not be elaborated in this invention.

[0039] Therefore, based on the weighted loss function, the network model composed of the autoencoder and the clustering head is trained collaboratively through multiple learning tasks. When the network model is trained to a stable state under the constraints of the four learning tasks, the network model at this time is the trained multi-task self-driven clustering network (including the encoder and clustering head with optimized parameters). Figure 4 The architecture and training principle of a multi-task self-driven clustering network are illustrated, in which... This indicates a refactoring of the learning task. Representation of the learning task through graph comparison. This indicates a diversity-enhancing learning task. This represents a self-driven clustering learning task.

[0040] Unlike traditional deep clustering methods that require additional traditional clustering algorithms to generate cluster labels, the pre-trained multi-task self-driven clustering network in this invention can directly map hyperspectral data end-to-end to the cluster label space, effectively solving the two-stage problem of feature extraction and clustering model construction.

[0041] S50. End-to-end hyperspectral image clustering is performed using a multi-task self-driven clustering network.

[0042] Specifically, the hyperspectral image to be clustered is converted to the same dimension as the hyperspectral image sample in step S10, and then input into the multi-task self-driven clustering network in batches. The multi-task self-driven clustering network can output the clustering probability distribution of each sample (corresponding to a pixel), where the highest probability is the classification of the pixel corresponding to that sample, that is, the cluster label.

[0043] The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network provided by this invention extracts spectra by inputting hyperspectral image samples in batches into an autoencoder. Spatial features are analyzed and a reconstruction learning task is performed to enable the autoencoder to learn feature representations in an unsupervised manner. Simultaneously, a clustering head is used to predict the clustering probability distribution. Based on this, diversity enhancement learning, graph contrast learning, and self-driven clustering learning tasks are executed. The diversity enhancement learning task aims to bring the number of clusters closer to a preset value to avoid collapse. The graph contrast learning task constrains the clustering probability distribution based on nearest neighbor relationships, ensuring that structurally similar samples are clustered consistently while distancing non-similar samples. The self-driven clustering learning task narrows the spectral density... By establishing a bidirectional coupling between feature learning and cluster assignment using the distance between spatial features and their assigned cluster centers, the independent feature extraction and clustering processes in the traditional two-stage framework are transformed into end-to-end collaborative optimization. This effectively solves the problem of easy convergence to suboptimal solutions caused by the separation of feature representation and clustering objectives. At the same time, the discriminativeness, diversity, and regional continuity of the clustering results are improved through multi-task joint constraints. Ultimately, direct clustering output without post-processing steps is achieved, significantly improving the model's running efficiency and practical value while ensuring clustering accuracy.

[0044] To verify the effectiveness of the proposed method, the PU and SA (Salinas Valley) hyperspectral datasets (dataset attributes are shown in Table 1) were used for validation. The proposed method was run on the PyTorch framework with an initial learning rate of 0.001. The Adam optimizer was used to optimize the network parameters, and the size of the input hyperspectral image data blocks (hyperspectral image samples) was set to 5×5 pixels by default. The batch size of samples input to the network was set to 40, and the epoch was set to 200. The weights of all loss functions were set to 1. Experimental hardware and software platform: PyTorch version 2.0.1, GPU: RTX4090, memory: 24G, Python version 3.9.18.

[0045] Table 1. Detailed properties of the PU and SA hyperspectral datasets

[0046] In addition, to evaluate the performance of the method proposed in this invention, it was compared with ten benchmark methods. To ensure the fairness of the experiment, the experimental parameters of each comparison algorithm were set in the same way as those of this invention.

[0047] Figure 5The diagram illustrates the classification results obtained by the present invention and several existing algorithms on PU data using the Hungarian algorithm. (a) is the ground truth classification diagram; (b) is the classification result of the K-means algorithm; (c) is the classification result of the SC (Spectral Clustering) algorithm; (d) is the classification result of the EGCSC (Efficient Graph Convolutional Subspace Clustering) algorithm; (e) is the classification result of the FCM (Fuzzy C-means) algorithm; (f) is the classification result of the NCSC (Superpixel Contracted Neighborhood Contrastive Subspace Clustering Network for Hyperspectral Images) algorithm; (g) is the classification result of the EKGCSC (Graph Convolutional Subspace Clustering: A Robust Subspace Clustering Framework for Hyperspectral Image) algorithm; and (h) is the classification result of the HyperGAE (Hypergraph-Structured Autoencoder for Unsupervised and Semisupervised Classification of Hyperspectral Images) algorithm. The classification results of the Image algorithm are shown in (i), (j), (s), (k), and (l).

[0048] Figure 5The classification results in the figure show that traditional clustering algorithms such as (b) K-means, (c) SC, and (e) FCM perform poorly because the models cannot handle the complex spectral information of hyperspectral images. For subspace-based clustering methods such as (d) EGCSC, (f) NCSC, and (g) EKGCSC, the limited number of extracted discriminative features results in a blocky distribution of classification results, failing to meet the requirements for fine-grained classification of hyperspectral images. Graph-based clustering methods such as (h) GR-Rsnet and (i) HyperGAE, as well as deep learning-based techniques such as (i) SDST and (k) S2GCL, do not perform as well in visual quality as the method proposed in this invention. This also demonstrates that the method proposed in this invention can extract higher-level features and has superior performance.

[0049] In addition, Normalized Information Content (NMI) and Purity were used as quantitative and qualitative evaluation metrics, respectively. NMI measures the similarity between two clustering results. Purity is a simple and transparent evaluation metric. Both range from 0 to 1, with values ​​closer to 1 indicating better algorithm performance. To ensure experimental accuracy, each experiment was conducted 10 times, and the mean and standard deviation of the 10 results were taken as the experimental outcome, as shown in Table 2-9.

[0050] Table 2. Purity (%) of various algorithms on the PU dataset

[0051] Table 3. Purity (%) of various algorithms on the PU dataset

[0052] Table 4. NMI (%) of various algorithms on the PU dataset

[0053] Table 5. NMI (%) of various algorithms on the PU dataset

[0054] Table 6. Purity (%) of various algorithms on the SA dataset

[0055] Table 7. Purity (%) of various algorithms on the SA dataset

[0056] Table 8. NMI (%) of various algorithms on the SA dataset

[0057] Table 9. NMI (%) of various algorithms on the SA dataset

[0058] In Table 2-9 above, This indicates that the algorithm failed due to insufficient memory caused by building the global graph.

[0059] In the validation results of the PU and SA datasets shown in Table 2-9, the method proposed in this invention achieved the highest NMI and Purity scores, proving that the proposed method can directly process the original hyperspectral images while simultaneously outputting clustering labels end-to-end. Furthermore, it surpasses existing algorithms in terms of accuracy and robustness in hyperspectral image clustering analysis, demonstrating higher practical value. On the PU dataset, when the number of clusters equals 9, the purity and NMI of this invention reach 77.38% and 68.82%, respectively. The purity is 1.6% higher than the state-of-the-art EKGCSC method, and the NMI is 2.26% higher than the state-of-the-art EKGCSC method.

[0060] In summary, this invention addresses the clustering problem of hyperspectral images by proposing an end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network. This method can directly process the original hyperspectral images and directly output the clustering labels, solving the problem of separating feature extraction from the clustering model and improving the model's efficiency and usability. The method uses radial basis functions (Gaussian distance) as a distance metric to create a dictionary of positive sample pairs for all samples, i.e., a homogeneous graph. It employs a graph contrastive loss function to learn the graph structure features of the hyperspectral images, extracting more general feature representations and improving the stability of the clustering algorithm.

[0061] It should be noted that the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention.

[0062] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0063] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings and the disclosure in carrying out the claimed invention. In the description of the invention, the word "comprising" does not exclude other components or steps, "a" or "an" does not exclude a plurality, and "a plurality" means two or more, unless otherwise explicitly specified. Furthermore, while different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce good results.

[0064] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. An end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network, characterized in that, include: Hyperspectral image samples are input into an autoencoder in batches to extract spectra. Spatial characteristics, and based on spectrum Spatial features are used to perform a reconstruction learning task, so that the autoencoder learns feature representations of hyperspectral image samples in an unsupervised manner; Based on the spectrum Spatial features are used to predict the clustering probability distribution using a clustering head. Based on the clustering probability distribution, a diversity enhancement learning task is performed to make the number of clusters predicted by the clustering head approach a preset value. A graph contrast learning task is also performed based on the nearest neighbor relationship between hyperspectral image samples to constrain the clustering probability distribution predicted by the clustering head, so that hyperspectral image samples that are the nearest neighbors are clustered consistently, and hyperspectral image samples that are not the nearest neighbors are clustered separately. based on the spectrum The spatial features perform a self-driven clustering learning task with the cluster probability distribution to pull the spectra closer a distance between the spatial features and their assigned cluster centers; Loss functions are constructed for the reconstruction learning task, the graph contrast learning task, the diversity enhancement learning task, and the self-driven clustering learning task, respectively. The loss functions are weighted and summed. The parameters of the autoencoder and the clustering head are optimized based on the weighted loss functions to obtain the trained multi-task self-driven clustering network. End-to-end hyperspectral image clustering is performed using the aforementioned multi-task self-driven clustering network.

2. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 1, characterized in that, The step of inputting hyperspectral image samples into the autoencoder in batches includes: constructing positive sample pairs for each hyperspectral image sample and forming a positive sample pair dictionary; and inputting the positive sample pairs in the positive sample pair dictionary into the autoencoder in batches.

3. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 1, characterized in that, The autoencoder includes an encoder and a decoder; The encoder includes multiple two-dimensional convolutional layers for extracting the spectrum of hyperspectral image samples. Spatial characteristics; The decoder is a transpose of the encoder, used for processing based on the spectrum. Spatial feature reconstruction of hyperspectral image samples; The reconstruction learning task is achieved by minimizing the mean square error between the hyperspectral image samples input to the encoder and the hyperspectral image samples reconstructed by the decoder.

4. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 3, characterized in that, The clustering head includes a fully connected layer and a Softmax activation function; The fully connected layer is used to transform the spectral The spatial features are mapped to a label space, and the Softmax activation function is used to convert the output of the fully connected layer to the cluster probability distribution.

5. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 1, characterized in that, The diversity enhancement learning task is specifically used for: Calculate the average probability vector of the cluster probability distribution of all hyperspectral image samples in each batch. By minimizing the variance of the average probability vector, the frequency of occurrence of each cluster category in the cluster probability distribution tends to be uniform, thereby making the number of clusters in the cluster probability distribution approach a preset value.

6. The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network according to claim 1, characterized in that, The graph comparison learning task is specifically used for: The similarity between hyperspectral image samples is calculated based on Gaussian distance, and a preset number of nearest neighbor samples and non-nearest neighbor samples are selected for each hyperspectral image sample based on the similarity. A graph contrast loss function is constructed to minimize the graph contrast learning task, and the clustering probability distribution predicted by the clustering head is constrained by minimizing the graph contrast loss function; wherein, the graph contrast loss function includes a first loss term and a second loss term; the first loss term is used to bring the clustering probability distribution of the nearest neighbor samples closer based on the similarity, and the second loss term is used to push away the clustering probability distribution of the non-nearest neighbor samples.

7. The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network according to claim 1, characterized in that, The self-driven clustering learning task is specifically used for: using the cluster probability distribution as soft labels, performing a weighted average of the spectral features of all hyperspectral image samples within a single batch to estimate a cluster center for each cluster class performing a weighted average of the spatial features to estimate a cluster center for each cluster class based on the cluster centers and the spectra spatial features construct a differentiable loss function for the self-driven clustering learning task, which is minimized to close the spectra spatial features construct a differentiable loss function for the self-driven clustering learning task, which is minimized to close the spectra 8. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 7, characterized in that, The loss function for the self-driven clustering learning task is: ; in, These are the learnable parameters of the encoder. The learnable parameters of the clustering head. For the spectrum Spatial features, This is the clustering probability distribution output by the clustering head. The estimated value of the cluster centers. Indicates matrix transpose. The number of hyperspectral image samples in a single batch. , For the first Clustering probability of a hyperspectral image sample The loss is calculated for the loss function of the self-driven clustering learning task.

9. The end-to-end hyperspectral image clustering method based on multi-task self-driven clustering network according to claim 6, characterized in that, The graph contrast loss function is: ; in, These are the learnable parameters of the encoder. The learnable parameters of the clustering head. For the first A sample of hyperspectral images Clustering probability, for The The clustering probability of the nearest neighbor samples. The total number of hyperspectral image samples. for The set of nearest neighbor samples, For the first The hyperspectral image sample and its first Gaussian distance between the nearest neighbor samples for The Clustering probability of non-nearest neighbor samples, The loss is calculated using the graph comparison loss function.

10. The end-to-end hyperspectral image clustering method based on a multi-task self-driven clustering network according to claim 5, characterized in that, The loss function for the diversity enhancement learning task is: ; in, These are the learnable parameters of the encoder. The learnable parameters of the clustering head. This is a preset value for the number of clusters. For vectors The Middle One element, , For the first Clustering probability of a hyperspectral image sample The number of hyperspectral image samples in a single batch. The loss is calculated using the loss function for the diversity enhancement learning task.