Hyperspectral target detection method and device, computer device and storage medium

CN118411600BActive Publication Date: 2026-09-22NAT UNIV OF DEFENSE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410478545.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2026-09-22
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

尽管这些基于深度学习的检测器取得了优异的检测性能,但仍受限于扩充的目标与背景样本的质量,这可能会给模型带来知识的偏差

Benefits of technology

[0035]上述高光谱目标检测方法、装置、计算机设备和存储介质,通过将像元光谱构建为光谱图,并对其进行数据增强,得到对应的增强光谱图,然后使用光谱图Transformer提取光谱图与增强图的局部-全局特征并通过一组原型向量对特征进行聚类,通过最大化语义相似的光谱图聚类簇的相似性并使语义与其不相同的光谱图聚类簇远离它们以使模型具备鉴别光谱差异的能力,利用聚类一致性损失保持光谱图与其增强图聚类的一致性,以帮助模型更好地进行光谱鉴别性学习,在检测时,经过光谱鉴别性学习的光谱图Transformer同时区分待检测像素与先验目标的光谱之间的异同,以突出目标并抑制背景。采用本方法能够更好地鉴别光谱之间的差异,提高高光谱目标检测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118411600B_ABST
    Figure CN118411600B_ABST
Patent Text Reader

Abstract

The application relates to a hyperspectral target detection method and device, computer equipment and a storage medium. The method comprises the following steps: representing each spectral image sample as a spectral graph, and performing data enhancement on each spectral graph to obtain an enhanced spectral graph; performing local-global feature extraction on the spectral graph and the enhanced spectral graph corresponding to the same batch of spectral image samples by two spectral graph Transformers which are of the same structure and share parameters, and outputting a first feature set and a second feature set; clustering the first feature set and the second feature set respectively, and calculating a clustering contrast loss according to the clustering results; training the two spectral graph Transformers according to the clustering contrast loss and a clustering consistency loss; inputting a prior target spectrum and a to-be-detected pixel spectrum into the two trained models respectively to obtain corresponding output features, and obtaining a target detection result according to the similarity of the output features. The method can improve the hyperspectral target detection precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hyperspectral target detection technology, and in particular to a hyperspectral target detection method, apparatus, computer equipment, and storage medium. Background Technology

[0002] Hyperspectral remote sensing is a cutting-edge technology in remote sensing science, capable of both imaging and spectral measurement, representing a significant breakthrough in remote sensing technology. Each pixel in a hyperspectral image corresponds to a nearly continuous spectral curve, reflecting diagnostic differences in spectral absorption of substances and providing rich spectral information for the accurate extraction of ground object information. Hyperspectral target detection, as one of the advantageous applications of hyperspectral imaging, has attracted widespread attention and has been widely used in mineral exploration, camouflage identification, medical diagnosis, and environmental monitoring.

[0003] Hyperspectral images possess rich spectral information. Unlike traditional target detection methods that utilize spatial texture and morphological information of ground features for target recognition, hyperspectral target detection uses the spectral features of objects of interest for precise target identification. Hyperspectral target detection aims to focus on objects of interest within the scene being detected, treating all other components as background. However, prior knowledge for hyperspectral target detection typically consists only of the spectral features of the objects of interest, lacking category label information for the scene. Furthermore, the complexity of the background (which may contain multiple material categories) and the inherent variations in the spectra of the same material pose challenges to hyperspectral target detection. The main challenge of hyperspectral target detection lies in accurately identifying and locating targets from complex backgrounds based on prior target spectra while effectively suppressing background noise.

[0004] To utilize the spectral characteristics of materials for detecting targets of interest in hyperspectral scenes, numerous hyperspectral target detection methods have been developed over the past few decades, such as Constrained Energy Minimization (CEM), Adaptive Coherence / Cosine Estimator (ACE), and Orthogonal Subspace Projection (OSP). These methods require carefully designed manual feature extraction methods and prior assumptions, and struggle to leverage the nonlinear characteristics of the spectrum, exhibiting poor adaptability to complex detection scenarios. To utilize the nonlinear relationships between spectral bands, these hyperspectral target detection methods have been extended to corresponding kernel-based nonlinear versions, such as Kernel Constrained Energy Minimization (KCEM), Kernel Adaptive Coherence Estimation (KACE), and Kernel Orthogonal Subspace Projection (KOSP). Kernel-based hyperspectral target detection methods implicitly map data to a high-dimensional kernel feature space using appropriate kernel functions, enabling good data separation. However, kernel-based hyperspectral target detection methods rely on the assumption that the data becomes linearly separable after transformation into a high-dimensional kernel feature space. To avoid making any explicit assumptions about the statistical distribution of the data, representation-based hyperspectral target detection methods have emerged. Examples include sparse representation-based target detectors (STD), joint sparse and cooperative representation-based HTD methods (CSCR), and hyperspectral target detection decomposition models based on background dictionary learning (DM-BDL). Although representation-based hyperspectral target detection methods can achieve good detection results, it is difficult to obtain a pure background dictionary due to factors such as noise, and the optimal number of dictionary atoms in matrix decomposition may vary for different data, requiring manual empirical setting, which greatly limits their ability to adapt to different scenarios.

[0005] In recent years, thanks to the excellent nonlinear feature representation and advanced semantic feature extraction capabilities of deep neural networks, they have attracted widespread attention from researchers in fields such as hyperspectral classification, unmixing, super-resolution, and change detection, providing new directions for hyperspectral object detection. However, the extreme scarcity of prior information for hyperspectral object detection poses a challenge to deep learning-based hyperspectral object detection methods. Some researchers have approached this from the perspective of transfer learning, hoping to overcome the inability to train detectors in a supervised manner due to the lack of prior information. Examples include HTD (CNND) based on convolutional neural networks, HTD (MLSN) based on meta-learning and connected networks, sensor-independent HTD (SIHTD), and hyperspectral image spectral-spatial joint object detection methods based on transfer learning. However, the transfer of model knowledge learned on datasets with known label information in the source domain to the target domain detection scene using transfer learning is limited by the adaptability of the model knowledge to the detection scene, resulting in poor object detection performance. In addition to using transfer learning, some researchers have supplemented the model training by synthesizing augmented target and background samples. Examples include a deep convolutional neural network method for HTD (HTD-Net), a two-stream convolutional neural network-based HTD method (TSCNTD), a Siamese Transformer network for HTD (STTD), and a spectral aggregation and separation network with target band random mask (TBRM) for hyperspectral target detection (SASN). While these deep learning-based detectors have achieved excellent detection performance, they are still limited by the quality of the augmented target and background samples, which may introduce knowledge bias into the model. Summary of the Invention

[0006] Therefore, it is necessary to provide a hyperspectral target detection method, apparatus, computer equipment, and storage medium to address the aforementioned technical problems.

[0007] A hyperspectral target detection method, the method comprising:

[0008] Acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks;

[0009] Each spectral image sample is represented as a spectral map, and data augmentation is performed on each spectral map to obtain the corresponding augmented spectral map; the spectral map includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent;

[0010] Local-global feature extraction is performed on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples by pre-constructed first spectral map Transformer and second spectral map Transformer with the same structure and shared parameters, respectively, and the output is a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder.

[0011] Clustering is performed on the first feature set and the second feature set according to the pre-set first prototype group and second prototype group respectively to obtain the first clustering similarity matrix and the second clustering similarity matrix. The loss of the current spectral image is calculated based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix. The clustering contrast loss is obtained based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples. The row vector of each clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column prototype belongs. Each column vector corresponds to a cluster.

[0012] The first spectral map Transformer and the second spectral map Transformer are trained based on the cluster contrast loss and the cluster consistency loss to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set.

[0013] The target spectral image to be detected is acquired. The prior target spectrum and the spectrum of the target pixel in the target spectral image are respectively input into the trained first spectral image Transformer and second spectral image Transformer to obtain the corresponding output features. The target detection result is obtained based on the similarity between the output features.

[0014] A hyperspectral target detection device, the device comprising:

[0015] The sample acquisition module is used to acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks;

[0016] The spectral enhancement module is used to represent each spectral image sample as a spectral image, and to perform data enhancement on each spectral image to obtain a corresponding enhanced spectral image; the spectral image includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent;

[0017] The feature extraction module is used to perform local-global feature extraction on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples using a pre-constructed first spectral map Transformer and a second spectral map Transformer with the same structure and shared parameters, respectively, and outputs a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder;

[0018] The clustering comparison module is used to cluster the first feature set and the second feature set according to the pre-set first prototype group and the second prototype group respectively, to obtain a first clustering similarity matrix and a second clustering similarity matrix. Based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix, the loss of the current spectral image is calculated. Based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples, the clustering comparison loss is obtained. Each row vector of the clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column's corresponding prototype belongs, and each column vector corresponds to one cluster.

[0019] The network training module is used to train the first spectral map Transformer and the second spectral map Transformer based on the cluster contrast loss and the cluster consistency loss, to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set.

[0020] The target detection module is used to acquire the spectral image to be detected, input the prior target spectrum and the spectrum of the pixel to be detected in the spectral image to the trained first spectral image Transformer and second spectral image Transformer respectively, to obtain the corresponding output features, and obtain the target detection result based on the similarity between the output features.

[0021] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0022] Acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks;

[0023] Each spectral image sample is represented as a spectral map, and data augmentation is performed on each spectral map to obtain the corresponding augmented spectral map; the spectral map includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent;

[0024] Local-global feature extraction is performed on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples by pre-constructed first spectral map Transformer and second spectral map Transformer with the same structure and shared parameters, respectively, and the output is a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder.

[0025] Clustering is performed on the first feature set and the second feature set according to the pre-set first prototype group and second prototype group respectively to obtain the first clustering similarity matrix and the second clustering similarity matrix. The loss of the current spectral image is calculated based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix. The clustering contrast loss is obtained based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples. The row vector of each clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column prototype belongs. Each column vector corresponds to a cluster.

[0026] The first spectral map Transformer and the second spectral map Transformer are trained based on the cluster contrast loss and the cluster consistency loss to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set.

[0027] The target spectral image to be detected is acquired. The prior target spectrum and the spectrum of the target pixel in the target spectral image are respectively input into the trained first spectral image Transformer and second spectral image Transformer to obtain the corresponding output features. The target detection result is obtained based on the similarity between the output features.

[0028] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0029] Acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks;

[0030] Each spectral image sample is represented as a spectral map, and data augmentation is performed on each spectral map to obtain the corresponding augmented spectral map; the spectral map includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent;

[0031] Local-global feature extraction is performed on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples by pre-constructed first spectral map Transformer and second spectral map Transformer with the same structure and shared parameters, respectively, and the output is a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder.

[0032] Clustering is performed on the first feature set and the second feature set according to the pre-set first prototype group and second prototype group respectively to obtain the first clustering similarity matrix and the second clustering similarity matrix. The loss of the current spectral image is calculated based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix. The clustering contrast loss is obtained based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples. The row vector of each clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column prototype belongs. Each column vector corresponds to a cluster.

[0033] The first spectral map Transformer and the second spectral map Transformer are trained based on the cluster contrast loss and the cluster consistency loss to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set.

[0034] The target spectral image to be detected is acquired. The prior target spectrum and the spectrum of the target pixel in the target spectral image are respectively input into the trained first spectral image Transformer and second spectral image Transformer to obtain the corresponding output features. The target detection result is obtained based on the similarity between the output features.

[0035] The aforementioned hyperspectral target detection method, apparatus, computer equipment, and storage medium construct a spectral map from pixel spectra and perform data augmentation to obtain a corresponding enhanced spectral map. Then, a spectral map Transformer is used to extract local-global features from the spectral map and the enhanced map, and these features are clustered using a set of prototype vectors. By maximizing the similarity of semantically similar spectral map clusters and distancing semantically dissimilar spectral map clusters from them, the model gains the ability to discriminate spectral differences. Cluster consistency loss is used to maintain the consistency between the spectral map and its enhanced map clusters, helping the model to better learn spectral discriminative learning. During detection, the spectral map Transformer, after spectral discriminative learning, simultaneously distinguishes the differences between the spectra of the pixel to be detected and those of the prior target, highlighting the target and suppressing the background. This method can better discriminate spectral differences and improve the accuracy of hyperspectral target detection. Attached Figure Description

[0036] Figure 1 This is a flowchart illustrating a hyperspectral target detection method in one embodiment;

[0037] Figure 2 This is a flowchart illustrating SGCCA in one embodiment;

[0038] Figure 3 This is a schematic diagram of the spectral transformer structure in one embodiment;

[0039] Figure 4 This is a schematic diagram of the Transformer encoder in one embodiment;

[0040] Figure 5 This is a schematic diagram illustrating the detection performance of SGCCA and seven contrasting methods on the San Diego A dataset in one embodiment. (a) shows a 3D ROC diagram, and (b) shows the 2D ROC curve (P...). D ,P F (c) is the 2D-ROC curve (P) F ,τ) Schematic diagram;

[0041] Figure 6 This is a schematic diagram illustrating the detection performance of SGCCA and seven contrasting methods on the San Diego B dataset in one embodiment. (a) shows a 3-D ROC diagram, and (b) shows the 2-D ROC curve (P...). D ,P F (c) is the 2D-ROC curve (P) F ,τ) Schematic diagram;

[0042] Figure 7This is a schematic diagram illustrating the detection performance of SGCCA and seven contrasting methods on the Urban dataset in one embodiment. (a) shows a 3-D ROC diagram, and (b) shows the 2-D ROC curve (P...). D ,P F (c) is the 2D-ROC curve (P) F ,τ) Schematic diagram;

[0043] Figure 8 This is a schematic diagram illustrating the detection performance of SGCCA and seven contrasting methods on the MUUFL Gulfport dataset in one embodiment. (a) shows a 3D ROC diagram, and (b) shows the 2D ROC curve (P...). D ,P F (c) is the 2D-ROC curve (P) F ,τ) Schematic diagram;

[0044] Figure 9 The diagram shows the target-background separability box plots of the target detection results of SGCCA and seven contrast methods on four hyperspectral image datasets in one embodiment. (a) is a target-background separability box plot on the San Diego A dataset, (b) is a target-background separability box plot on the San Diego B dataset, (c) is a target-background separability box plot on the Urban dataset, and (d) is a target-background separability box plot on the MUUFL Gulfport dataset.

[0045] Figure 10 This is a structural block diagram of a hyperspectral target detection device in one embodiment;

[0046] Figure 11 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] In one embodiment, such as Figure 1 As shown, a hyperspectral target detection method is provided, including the following steps:

[0049] Step 102: Obtain spectral image samples from the same batch.

[0050] Each spectral image sample comprises several pixel spectra, and each pixel spectrum is divided into multiple spectral blocks. For the original hyperspectral image... Spectrum of each pixel Divided into n spectral blocks Spectral block characteristics

[0051] Step 104: Represent each spectral image sample as a spectral map, perform data augmentation on each spectral map, and obtain the corresponding augmented spectral map.

[0052] A spectral graph consists of nodes and edges. Nodes are spectral patches in a spectral image sample; edges represent adjacent spectral patches. Given n spectral patches... Consider n nodes in the spectral map, where each node's feature is the feature of its corresponding spectral patch. If two spectral patches are adjacent in the original pixel spectrum, then the corresponding nodes on the spectral map are connected by an edge, which can be represented as:

[0053]

[0054] in, It is a node 1-hop neighbor set.

[0055] The goal of spectral graph data augmentation is to create novel and realistically plausible augmented spectral graph data without affecting the semantics of the spectral graph. For a batch of spectral graph data G∈{G1,G2,…,G…} M}, which has M spectral maps. For each spectral map, nodes are randomly dropped, edges are perturbed, and nodes are masked. For a given spectral map G... i Discarding nodes randomly discards some nodes and their corresponding edges. Edge perturbation disrupts the spectral graph structure by randomly adding or deleting a certain proportion of edges. Masking nodes replace a certain proportion of node features with values ​​sampled from a random normal distribution. After spectral graph data augmentation, a batch of augmented spectral graphs G'∈{G′1,G'2,…,G'} can be obtained. M After spectral data enhancement, G i and G′ i These can be considered as a pair of positive samples. Furthermore, training the model using data-augmented spectral data not only enhances the model's generalization ability but also enables the model to better capture the essential semantic information in the spectral data.

[0056] like Figure 2The flowchart shown is for SGCCA (Spectral Graph Contrast Clustering Assignment Method for Hyperspectral Target Detection using Graph Transformer). It mainly includes three parts: Spectral Graph Construction and Data Augmentation, Spectral Discriminative Learning, and Detection. SGCCA first constructs a spectral graph from the pixel spectra, aiming to leverage the structure and characteristics of the graph so that the designed Spectral Graph Transformer can extract more discriminative local-global spectral features. Then, data augmentation is performed on the constructed spectral graph, which can be used to construct training samples for spectral discriminative learning. The original spectral graph and its corresponding augmented spectral graph should be clustered into the same cluster in the clustering space; this is crucial for the model to avoid mining explicit target and background samples. Spectral discriminative learning maximizes the similarity of semantically similar clusters while maintaining their clustering agreement by exchanging the cluster assignments of the predicted spectral graphs and keeping other semantically different clusters away from them, thus enabling the model to discriminate spectral differences. Target detection involves extracting representations of the prior target spectrum and the target pixel spectrum from a trained spectral map Transformer with spectral discrimination capabilities. The target detection result is obtained based on the cosine distance between the target pixel spectrum representation and the prior target spectrum representation.

[0057] Step 106: Using a pre-constructed first spectral map Transformer and a second spectral map Transformer with the same structure and shared parameters, local-global feature extraction is performed on the spectral map and enhanced spectral map corresponding to the same batch of spectral image samples, respectively, and the first feature set corresponding to multiple first features and the second feature set corresponding to multiple second features are output.

[0058] Each spectral graph Transformer includes a graph convolutional network and a Transformer encoder.

[0059] Step 108: Cluster the first feature set and the second feature set according to the pre-set first prototype group and the second prototype group respectively to obtain the first clustering similarity matrix and the second clustering similarity matrix. Calculate the loss of the current spectral image based on the distance between the current column vector of the first clustering similarity matrix and the corresponding and non-corresponding column vectors of the second clustering similarity matrix. Obtain the clustering contrast loss based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples.

[0060] Each row vector of the clustering similarity matrix includes the probability that the output feature of the corresponding spectral map Transformer is assigned to the cluster to which the prototype in the current column belongs, and each column vector corresponds to a cluster.

[0061] To train a model capable of discriminating spectral differences without relying on displayed target and background samples, a spectral discriminative learning method based on spectral graph contrastive clustering assignment is proposed, enabling unsupervised learning of spectral discrimination capabilities. Spectral graph contrastive clustering assignment maintains cluster consistency by exchanging predicted cluster assignments while maximizing the similarity of semantically similar spectral graph clusters and distancing other semantically similar spectral graph clusters from them, thus better discriminating differences between spectra.

[0062] Step 110: Train the first spectral map Transformer and the second spectral map Transformer according to the cluster contrast loss and the cluster consistency loss to obtain the trained first spectral map Transformer and the second spectral map Transformer.

[0063] The cluster consistency loss is obtained by averaging the cross-entropy of the cluster assignments of the first and second feature sets.

[0064] Step 112: Obtain the spectral image to be detected. Input the prior target spectrum and the spectrum of the pixel to be detected in the spectral image to the trained first spectral image Transformer and second spectral image Transformer respectively to obtain the corresponding output features. Obtain the target detection result based on the similarity between the output features.

[0065] In the aforementioned hyperspectral target detection method, pixel spectra are constructed into spectral maps, which are then augmented to obtain corresponding augmented spectral maps. A spectral map Transformer is then used to extract local-global features from the spectral map and the augmented map, and these features are clustered using a set of prototype vectors. By maximizing the similarity of semantically similar spectral map clusters and distancing semantically dissimilar clusters, the model gains the ability to discriminate spectral differences. Cluster consistency loss is used to maintain the consistency between the spectral map and its augmented map clusters, helping the model to better learn spectral discriminative learning. During detection, the spectral map Transformer, after spectral discriminative learning, simultaneously distinguishes the differences between the spectra of the pixel to be detected and those of the prior target, highlighting the target and suppressing the background. This method can better discriminate spectral differences and improve the accuracy of hyperspectral target detection.

[0066] In one embodiment, such as Figure 3 As shown, a schematic diagram of a spectral graph Transformer is provided. The spectral graph Transformer includes a three-layer graph convolutional network and a two-layer Transformer encoder. The three-layer graph convolutional network aggregates the features of the first-order or higher-order neighbor nodes of each node in the input spectral graph to obtain the local feature sequence of the input spectral graph. A CLS label is added to the feature vector of each node in the local feature sequence and a positional encoding is added. The two-layer Transformer encoder performs global feature extraction on the local feature sequence to obtain the output features corresponding to the input spectral graph. The three-layer graph convolutional network is connected in sequence, and the input of the third-layer graph convolutional network is the fusion feature of the output of the second-layer graph convolutional network and the output of the first-layer graph convolutional network. The input of the second-layer graph convolutional network is the fusion feature of the output of the first-layer graph convolutional network and the input spectral graph.

[0067] In this embodiment, let G = (V, E) represent an undirected graph, where V = {v...} i} i=1,...,N Let E = {e_{n}} be a set of nodes with N nodes. ij} i,j=1,...,N Let G represent the set of edges between nodes. The adjacency matrix of G is... The degree matrix is ​​D = ∑ j A ij The feature matrix of a node is X = {x1, x2, ..., xn}. N},in It is node v i The node features. Generally, graph neural networks follow a learning pattern of iteratively updating node representations by aggregating the representations of a node's first-order or higher-order neighbors. For graph convolutional networks, the aggregation operation on graph nodes can be formalized as:

[0068]

[0069] Where σ represents a nonlinear activation function, It is the degree matrix of an undirected graph G with self-connections. Let I be the adjacency matrix of an undirected graph G with self-joins, and W be the identity matrix. (l) It is a trainable weight matrix.

[0070] like Figure 4 The diagram shows the structure of a Transformer encoder, which consists of a multi-head self-attention module and a feedforward network. The feedforward network includes two linear transformations with a ReLU activation function in between. Multi-head self-attention is achieved by running h self-attention operations, called "heads," in parallel and projecting their cascaded outputs onto the input node feature sequence. The query Q is obtained by projecting the learnable feature matrix. i Key K i Sum V i This process can be represented as:

[0071]

[0072] in, It is used to project the input sequence into a query Q. i , key K i Sum V i The learnable projection matrix. For each head, compute the query Q. i With key K i The dot product is calculated, and the resulting dot product value is divided by... Scaling is performed, and then the value V is obtained through the softmax function. i The weights are then compared with the value V. i Multiplication yields the self-attention of the embedded node feature sequence. This process can be formalized as:

[0073]

[0074] Finally, projecting their cascaded outputs yields the output of the multi-head self-attention module, which can be expressed as:

[0075] MSA(z)=[SA1(Q1,K1,V1);SA2(Q2,K2,V2);…;SA h (Q h ,K h V h )]E MSA

[0076] in, is the feature matrix of the projection concatenation output, and h is the number of self-attention operations used in parallel. To make the total computational cost of multi-head attention similar to that of full-dimensional single-head attention, d is generally used. k Set to d / h.

[0077] Specifically, in Figure 3 In this model, graph convolutional networks iteratively update node representations by aggregating the representations of first-order or higher-order neighbors. Since the features of nodes in a spectral graph are spectral patches in the original spectrum, iteratively updating node representations by aggregating the representations of first-order or higher-order neighbors through graph convolution can capture local spectral details. Before feeding the node embeddings obtained after three layers of graph convolution into the Transformer encoder, a learnable CLS tag is attached to the node embeddings and positional encoding is added. The output embeddings at the corresponding positions obtained after the CLS tag passes through the Transformer encoder serve as the overall representation of the spectral graph. The positional encoding uses different frequencies of the sine and cosine functions, i.e.:

[0078]

[0079]

[0080] Where pos is the position, i represents the dimension, and d GCN This is the dimension of the node embeddings after three layers of graph convolution. Thanks to the self-attention mechanism in the Transformer encoder, the CLS marker can interact with all node embeddings, thus obtaining global spectral information. After spectral graph construction and spectral graph data augmentation, G∈{G1,G2,…,G} M} and G'∈{G′1,G′2,…,G′ M The data are fed into a spectral Transformer to extract their representations; this process can be represented as:

[0081] Y = f θ (G)

[0082] Y' = f θ (G')

[0083] Among them, f θ (·) represents the spectral transformer, where θ is a learnable parameter in the spectral transformer. It is the output of the original spectrum after passing through the spectrum Transformer. It is the output of the spectral image data augmentation sample after passing through the spectral image Transformer, d GT It is the feature dimension output by the spectral graph Transformer.

[0084] In one embodiment, the clustering comparison loss is:

[0085]

[0086] Among them, L contrast For cluster contrast loss, K is the number of row vectors in the cluster similarity matrix, l i For the spectrum G i The loss, l′ i To enhance the spectrum G′ i The loss is denoted by i, where i is the number of the spectral image and its corresponding enhanced spectral image, i∈[1,M], and M is the number of column vectors in the cluster similarity matrix.

[0087] In this embodiment, as Figure 2 As shown, for a batch of spectra G∈{G1,G2,…,G...} with a size of M, M}, whose spectral data enhancement samples are G'∈{G′1,G′2,…,G′ M}, G i and G′ i The spectral images are fed into the weight-sharing Transformer and projection head to extract their features, resulting in... and Where d is the dimension output by the projection head. Since a batch of spectral maps may contain multiple spectral maps belonging to the same semantics, the spectral maps and their augmented sample features Z and Z' can be clustered into k clusters, with the center point of each cluster consisting of a set of learnable prototypes. This is represented as follows. After clustering assignment, a clustering similarity matrix can be obtained, assigning features Z and Z' to each prototype. and For clustering similarity matrices Q and Q', their row vectors q i With q' i The features z of the spectral plot and its enhanced view are respectively represented. i With z' i The probability assigned to each prototype. Each column of the clustering similarity matrices Q and Q' represents a cluster, let... and Let Q and Q' represent the k-th columns of the clustering similarity matrices Q and Q', respectively. We hope that the spectral graph G... i and its enhanced view G′ i They all cluster into the same cluster because of the spectral graph G i and its enhanced view G′ i The essential semantic information should be the same. This allows us to consider clusters... and For a pair of positive samples, the cosine distance can be used to measure the similarity between the cluster pairs, i.e.

[0088] To maximize the similarity of semantically similar spectral graph clusters and keep other semantically similar spectral graph clusters away from them, for a given spectral graph G... i The loss is defined as:

[0089]

[0090] Where, τ p The temperature parameter controls the softness. To learn the similarity between all positive sample pairs at the spectral cluster level, the cluster contrast loss is calculated at each spectral cluster, which can be formalized as:

[0091] In one embodiment, the clustering consistency loss is:

[0092]

[0093] Among them, L consistency The cluster consistency loss is M, where M is the number of column vectors in the cluster similarity matrix. For z i The probability of belonging to the cluster centered on the k-th prototype. z' i The probability z of belonging to the cluster centered on the k-th prototype. i For the spectrum G i The first feature output by the Transformer after inputting the first spectral image, z' i To enhance the spectrum G′ i The second feature output by the Transformer after inputting the second spectral image.

[0094] In this embodiment, to maintain the consistency of cluster assignments for Z and Z', we added a regularization term for the cluster consistency loss, L. consistency This is achieved by minimizing the average cross-entropy of the Z and Z' cluster assignments. Specifically... By calculating z i (z' i The similarity between z and the prototype k yields z. i (z' i The probability assigned to the cluster centered on prototype k is:

[0095]

[0096] Where, τ cThis is the temperature parameter that controls cluster consistency. Ultimately, by simultaneously optimizing the cluster contrast loss and the cluster consistency loss, the model gains the ability to distinguish between spectral similarities and dissimilarities. The overall objective function consists of the cluster contrast loss and the cluster consistency loss, i.e., L = L contrast +L consistency .

[0097] In one specific embodiment, the experiments were conducted on three real-world datasets, including four hyperspectral images captured in different scenes. These datasets included the San Diego dataset, the Urban dataset, and the MUUFL Gulfport dataset. In the experiments, a total of seven state-of-the-art hyperspectral object detection methods were compared with SGCCA. The seven comparison methods included: two classic hyperspectral object detection methods: CEM and OSP; two representation-based methods: CSCR and DM-BDL; and three deep learning-based methods: MLSN, a detector based on an unconstrained linear mixture model and a hierarchical denoising autoencoder (denoted as ULMMDL), and a hyperspectral object detection method based on self-supervised spectral level contrastive learning (SCLHTD).

[0098] The implementation of SGCCA consists of three parts: spectral map construction, spectral map data augmentation, and spectral discriminative learning through spectral map contrastive clustering assignment. When constructing the spectral maps, for the Sandiego A and Sandiego B hyperspectral images with 189 bands, the constructed spectral maps have 7 nodes, each node's feature is that the pixel spectrum is evenly divided into 7 spectral blocks of dimension 27; for the Urban hyperspectral image with 204 bands, the constructed spectral maps have 6 nodes, each node's feature is that the pixel spectrum is evenly divided into 6 spectral blocks of dimension 34; and for the MUUFL Gulfport hyperspectral image with 64 bands, the constructed spectral maps have 4 nodes, each node's feature is that the pixel spectrum is evenly divided into 4 spectral blocks of dimension 16. Considering the detector's time consumption, the number of nodes in each spectral map is minimized during construction. When performing graph augmentation on the constructed spectral maps, for each spectral map, one of the following is randomly applied: Drop Node, Permute Edge, and Mask Nodes, to generate multiple views of the spectral maps. For spectral discriminative learning via spectral map-based comparative clustering assignments, the training epoch, learning rate, temperature coefficient, and number of prototypes k were set to 10, 0.001, 0.07, and 10, respectively, for the dataset used in the experiments. The spectral map Transformer used to extract local-global spectral features consists of a three-layer graph convolutional network and a two-layer Transformer encoder, with an output feature dimension d. GT The value is set to 64. Multi-head self-attention in the Transformer encoder is achieved by running h=4 self-attention operations, called "heads," in parallel and projecting their cascaded outputs. It's important to note that to aid in the initial optimization of the model, the prototype is frozen in the first epoch to focus on learning the representation of the spectrogram first. It is then optimized as the model progresses. The contrastive approach follows the settings recommended in existing methods.

[0099] To quantitatively compare the target detection and background suppression capabilities of the detector, such as Figure 5-8 As shown, the 3-D ROC and 2-D ROC curves (P) of SGCCA and seven contrast methods on the San Diego A, San Diego B, Urban, and MUUFL Gulfport datasets are provided, corresponding to their detection results. D ,P F ) and 2D-ROC curve (P F The diagram illustrates the target detection performance of the detector under low false alarm probability, using a 2-D ROC curve (P). D,P F The x-axis of the graph is displayed on a logarithmic scale. As can be seen from the graph, SGCCA achieves 100% target detection accuracy with the lowest false alarm probability compared to the contrast method. In the 2-D ROC curve (P... F In τ), SGCCA, compared to the comparison method, has (P) F The 2-D ROC curve of the τ) is closer to the lower left corner, and its background suppression ability is significantly better than the seven contrast methods in the experiment, demonstrating excellent background suppression capabilities. This is attributed to SGCCA's ability to obtain a more discriminative ability for spectral differences through spectral image comparison and clustering assignment. Since very close ROC curves cannot visually distinguish which detector performs better, the 2-D ROC curve (P) is more suitable for comparison. D ,P F ) and 2-D ROC curve (P F The area under the curve of τ) and It is used to accurately compare the target detection and background suppression performance of detectors.

[0100] Table 1 provides SGCCA and seven state-of-the-art comparison methods on four hyperspectral datasets. and The specific numerical value. Optimal. and The data is indicated in bold. As shown in Table 1, SGCCA consistently achieves the highest scores on the San Diego A, San Diego B, Urban, and MUUFL Gulfport datasets. With low The effectiveness of SGCCA in hyperspectral target detection and its excellent target detection and background suppression capabilities were verified. SGCCA maximizes the similarity of semantically similar spectral clusters while maintaining the consistency between the spectral map and its augmented view clusters, and keeps other semantically different spectral clusters away from them. This allows the model to better distinguish the differences between the spectrum of the pixel to be detected and the prior target spectrum, thus enabling better target detection and background suppression. Like SGCCA, ULMMDL does not require explicit target and background samples for training and also achieved competitive target detection accuracy on the experimental dataset. ULMMDL enhances the consistency of the target spectrum in the target spectral image through a designed hierarchical denoising autoencoder (HDAE), mitigating intra-class differences in the target spectrum in the hyperspectral image, allowing ULMMDL to detect targets well based on the prior target spectrum. However, ULMMDL's background suppression capability is poor, and in detection scenarios with complex background environments, it is difficult to mitigate intra-class differences in the target spectrum with simple HDAE, leading to a decrease in target detection accuracy. For example, its performance on the MUUFL Gulfport dataset with complex background environments is poor. Thanks to its excellent spectral difference discrimination capability, SGCCA remains highly competitive in target detection and background suppression performance in scenes with complex backgrounds.

[0101] Table 1 Comparison of AUC values ​​of different hyperspectral target detection methods on four hyperspectral images

[0102]

[0103] To demonstrate the separation performance of different detectors for the target and background, a target-background separability box plot is used to illustrate the separation performance of different detectors for the target and background. Figure 9 This section displays target-background separability boxplots of target detection results from SGCCA and seven contrastive methods on four hyperspectral image datasets. In the target-background separability boxplots, target and background pixels with statistically distributed values ​​are placed in the boxes, after removing the highest and lowest 10% of data from each target and background category. The target-background separability boxplot not only reflects the separability of the target and background in the detection results but also allows observation of the distribution range of the target and background pixel detection values. Figure 9As can be seen, SGCCA suppresses the detected background pixels to a very low level on all four datasets tested, demonstrating excellent background suppression capabilities. Furthermore, SGCCA effectively separates the target from the background. Particularly on the MUUFL Gulfport dataset, which features complex background scenes, SGCCA demonstrates good separation between the target and background, while CEM, OSP, CSCR, and ULMMDL fail to separate the target well. This competitive separability indicates that spectral discriminative learning through spectral map comparison and clustering assignment enables the model to effectively learn spectral difference discrimination capabilities.

[0104] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0105] In one embodiment, such as Figure 10 As shown, a hyperspectral target detection device is provided, comprising:

[0106] The sample acquisition module 1002 is used to acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks.

[0107] The spectral enhancement module 1004 is used to represent each spectral image sample as a spectral image, perform data enhancement on each spectral image, and obtain the corresponding enhanced spectral image. The spectral image includes nodes and edges; nodes are spectral blocks in the spectral image sample; edges indicate that two spectral blocks are adjacent.

[0108] The feature extraction module 1006 is used to perform local-global feature extraction on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples through a pre-constructed first spectral map Transformer and a second spectral map Transformer with the same structure and shared parameters, respectively, and output a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder.

[0109] The clustering comparison module 1008 is used to cluster the first feature set and the second feature set according to the pre-set first prototype group and the second prototype group respectively, to obtain the first clustering similarity matrix and the second clustering similarity matrix. Based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix, the loss of the current spectral image is calculated. Based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples, the clustering comparison loss is obtained. The row vector of each clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column's corresponding prototype belongs. Each column vector corresponds to one cluster.

[0110] The network training module 1010 is used to train the first spectral map Transformer and the second spectral map Transformer based on the cluster contrast loss and the cluster consistency loss, so as to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set.

[0111] The target detection module 1012 is used to acquire the spectral image to be detected. The prior target spectrum and the spectrum of the pixel to be detected in the spectral image to be detected are respectively input into the trained first spectral image Transformer and second spectral image Transformer to obtain the corresponding output features. The target detection result is obtained based on the similarity between the output features.

[0112] In one embodiment, the spectral graph Transformer includes a three-layer graph convolutional network and a two-layer Transformer encoder. The three-layer graph convolutional network aggregates the features of the first-order or higher-order neighbor nodes of each node in the input spectral graph to obtain the local feature sequence of the input spectral graph. A CLS label is added to the feature vector of each node in the local feature sequence and a positional encoding is added. The two-layer Transformer encoder performs global feature extraction on the local feature sequence to obtain the output features corresponding to the input spectral graph.

[0113] In one embodiment, three graph convolutional networks are connected in series, and the input of the third graph convolutional network is the fusion feature of the output of the second graph convolutional network and the output of the first graph convolutional network, while the input of the second graph convolutional network is the fusion feature of the output of the first graph convolutional network and the input spectral map.

[0114] In one embodiment, the clustering comparison loss is:

[0115]

[0116] Among them, Lcontrast For cluster contrast loss, K is the number of row vectors in the cluster similarity matrix, l i For the spectrum G i The loss, l′ i To enhance the spectrum G′ i The loss is denoted by i, where i is the number of the spectral image and its corresponding enhanced spectral image, i∈[1,M], and M is the number of column vectors in the cluster similarity matrix.

[0117] In one embodiment, the clustering consistency loss is:

[0118]

[0119] Among them, L consistency The cluster consistency loss is M, where M is the number of column vectors in the cluster similarity matrix. For z i The probability of belonging to the cluster centered on the k-th prototype. For z′ i The probability z of belonging to the cluster centered on the k-th prototype. i For the spectrum G i The first feature output by the Transformer after inputting the first spectral image, z′ i To enhance the spectrum G′ i The second feature output by the Transformer after inputting the second spectral image.

[0120] In one embodiment, data augmentation is performed on each spectral map to obtain a corresponding augmented spectral map, which includes randomly discarding nodes, perturbing edges, or masking nodes in each spectral map to obtain a corresponding augmented spectral map.

[0121] Specific limitations regarding the hyperspectral target detection device can be found in the limitations of the hyperspectral target detection method described above, and will not be repeated here. Each module in the aforementioned hyperspectral target detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0122] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 11As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a hyperspectral target detection method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0123] Those skilled in the art will understand that Figure 11 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0124] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.

[0125] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.

[0126] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0127] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0128] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this invention should be determined by the appended claims.

Claims

1. A hyperspectral target detection method, characterized in that, The method includes: Acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks; Each spectral image sample is represented as a spectral map, and data augmentation is performed on each spectral map to obtain the corresponding augmented spectral map; the spectral map includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent; Local-global feature extraction is performed on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples by pre-constructed first spectral map Transformer and second spectral map Transformer with the same structure and shared parameters, respectively, and the output is a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder. Clustering is performed on the first feature set and the second feature set according to the pre-set first prototype group and second prototype group respectively to obtain the first clustering similarity matrix and the second clustering similarity matrix. The loss of the current spectral image is calculated based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix. The clustering contrast loss is obtained based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples. The row vector of each clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column prototype belongs. Each column vector corresponds to a cluster. The first spectral map Transformer and the second spectral map Transformer are trained based on the cluster contrast loss and the cluster consistency loss to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set. The target spectral image to be detected is acquired. The prior target spectrum and the spectrum of the target pixel in the target spectral image are respectively input into the trained first spectral image Transformer and second spectral image Transformer to obtain the corresponding output features. The target detection result is obtained based on the similarity between the output features.

2. The method according to claim 1, characterized in that, The spectral graph Transformer includes a three-layer graph convolutional network and a two-layer Transformer encoder; The three-layer graph convolutional network aggregates the features of the first-order or higher-order neighbor nodes of each node in the input spectral map to obtain the local feature sequence of the input spectral map. Append a CLS tag and add positional encoding to the feature vector of each node in the local feature sequence; The two-layer Transformer encoder performs global feature extraction on the local feature sequence to obtain the output features corresponding to the input spectral map.

3. The method according to claim 2, characterized in that, The three graph convolutional networks are connected in series, and the input of the third graph convolutional network is the fusion feature of the output of the second graph convolutional network and the output of the first graph convolutional network. The input of the second graph convolutional network is the fusion feature of the output of the first graph convolutional network and the input spectral map.

4. The method according to claim 1, characterized in that, The clustering comparison loss is: in, For cluster contrast loss, The number of row vectors in the clustering similarity matrix. Spectrum The loss, To enhance the spectrum The loss, The spectra and their corresponding enhanced spectra are numbered. , This represents the number of column vectors in the cluster similarity matrix.

5. The method according to claim 1, characterized in that, The clustering consistency loss is: in, For cluster consistency loss, The number of column vectors in the clustering similarity matrix. for Belongs to the first The probability of a cluster centered on a prototype. for Belongs to the first The probability of a cluster centered on a prototype. Spectrum The first feature output by the Transformer after inputting the first spectral image. To enhance the spectrum The second feature output by the Transformer after inputting the second spectral image.

6. The method according to claim 1, characterized in that, The process of data augmentation for each spectral image to obtain the corresponding augmented spectral image includes: For each spectral map, nodes are randomly discarded, edge perturbed, or nodes are masked to obtain the corresponding enhanced spectral map.

7. A hyperspectral target detection device, characterized in that, The device includes: The sample acquisition module is used to acquire spectral image samples from the same batch; each spectral image sample includes several pixel spectra; each pixel spectrum is divided into multiple spectral blocks; The spectral enhancement module is used to represent each spectral image sample as a spectral image, and to perform data enhancement on each spectral image to obtain a corresponding enhanced spectral image; the spectral image includes nodes and edges; the nodes are spectral blocks in the spectral image sample; the edges indicate that two spectral blocks are adjacent; The feature extraction module is used to perform local-global feature extraction on the spectral maps and enhanced spectral maps corresponding to the same batch of spectral image samples using a pre-constructed first spectral map Transformer and a second spectral map Transformer with the same structure and shared parameters, respectively, and outputs a first feature set corresponding to multiple first features and a second feature set corresponding to multiple second features; each spectral map Transformer includes a graph convolutional network and a Transformer encoder; The clustering comparison module is used to cluster the first feature set and the second feature set according to the pre-set first prototype group and the second prototype group respectively, to obtain a first clustering similarity matrix and a second clustering similarity matrix. Based on the distance between the current column vector of the first clustering similarity matrix and the corresponding column vector and non-corresponding column vector of the second clustering similarity matrix, the loss of the current spectral image is calculated. Based on the loss of the corresponding spectral image and the enhanced spectral image of the same batch of spectral image samples, the clustering comparison loss is obtained. Each row vector of the clustering similarity matrix includes the probability that the output feature of the corresponding spectral image Transformer is assigned to the cluster to which the current column's corresponding prototype belongs, and each column vector corresponds to one cluster. The network training module is used to train the first spectral map Transformer and the second spectral map Transformer based on the cluster contrast loss and the cluster consistency loss, to obtain the trained first spectral map Transformer and the second spectral map Transformer; the cluster consistency loss is obtained by the average cross-entropy of the clustering assignment of the first feature set and the second feature set. The target detection module is used to acquire the spectral image to be detected, input the prior target spectrum and the spectrum of the pixel to be detected in the spectral image to the trained first spectral image Transformer and second spectral image Transformer respectively, to obtain the corresponding output features, and obtain the target detection result based on the similarity between the output features.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.