Anomaly Detection Method for Hyperspectral Images of Spatial-Spectral Joint Remote Sensing

By performing band grouping preprocessing on hyperspectral images and reconstruction of the background of Transformer deep learning model, combining the detection results of the spectral domain and spatial domain, data redundancy and unsupervised problems in hyperspectral anomaly detection are solved, and detection accuracy and efficiency are improved.

CN116777832BActive Publication Date: 2025-07-11HARBIN INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310414342.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-18
Publication Date
2025-07-11
Estimated Expiration
2043-04-18

AI Technical Summary

Technical Problem

In hyperspectral anomaly detection, there are problems such as large data feature dimensions, large data volume, high data correlation and high redundancy, and the algorithm accuracy and efficiency are poor without supervision.

Method used

The spatial-spectral joint method is used to pre-process the hyperspectral image in band grouping, and the Transformer deep learning model is constructed to reconstruct the background. By reconstructing the background and the residual image of the original image, combining the abnormal detection results of the spectral domain and the spatial domain.

Benefits of technology

The accuracy and efficiency of abnormal detection of hyperspectral images are improved, especially when there are more background pixels than abnormal targets, small targets can be better detected.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116777832B_ABST
    Figure CN116777832B_ABST
Patent Text Reader

Abstract

Anomaly detection method for space-spectral joint remote sensing hyperspectral images, belonging to the technical field of hyperspectral image technology. The present invention aims to solve the problems existing in existing hyperspectral anomaly detection, such as large feature dimensions, large data volume, high data correlation, high redundancy, as well as poor accuracy and efficiency. It includes: performing preprocessing of band grouping on the data in the hyperspectral image; using the band-grouped hyperspectral data as input to construct a Transformer deep learning model to reconstruct the background of the hyperspectral image; adopting a space-spectral joint method to jointly detect the residual image between the reconstructed background image and the original hyperspectral image, respectively obtaining anomaly detection results in the spectral domain and the spatial domain, and linearly combining the anomaly detection results in the spectral domain and the spatial domain to obtain the anomaly detection result of the hyperspectral image. The present invention is used for anomaly detection of hyperspectral images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an anomaly detection method for space-spectral joint remote sensing hyperspectral images, belonging to the technical field of hyperspectral images. Background Technique

[0002] Hyperspectral occupies a very important position in the field of satellite remote sensing. With the continuous improvement of the resolution and spectral range of hyperspectral sensors, the number of bands of hyperspectral images has developed to the level of hundreds or thousands, providing very rich spectral information and attracting high attention in the agricultural and military fields. Hyperspectral data is a three-dimensional data cube, where two dimensions reflect spatial information and the other dimension provides rich spectral information through continuous spectral bands.

[0003] Hyperspectral anomaly detection is one of the important fields of hyperspectral image processing, and its purpose is to automatically detect abnormal pixels in hyperspectral images without prior knowledge. However, there are the following problems in hyperspectral anomaly detection:

[0004] 1. Due to the characteristics of hyperspectral data itself, such as large feature dimensions, large data volume, high data correlation, and high redundancy, corresponding preprocessing is required to obtain better anomaly detection results;

[0005] 2. Since hyperspectral anomaly detection is usually unsupervised, it is a challenging and meaningful problem to evaluate the accuracy and efficiency of the algorithm in the absence of effective supervision information. Summary of the Invention

[0006] The purpose of the present invention is to solve the problems existing in the existing hyperspectral anomaly detection, such as large feature dimensions, large data volume, high data correlation, high redundancy, and poor accuracy and efficiency, and provide an anomaly detection method for space-spectral joint remote sensing hyperspectral images.

[0007] The anomaly detection method for space-spectral joint remote sensing hyperspectral images of the present invention includes:

[0008] S1. Perform band grouping preprocessing on the hyperspectral data in the hyperspectral image;

[0009] S2. Take the band-grouped hyperspectral data as input, construct a Transformer deep learning model, and reconstruct the background of the hyperspectral image;

[0010] S3. Adopt a space-spectral joint method to jointly detect the residual image between the reconstructed background image and the original hyperspectral image, respectively obtain the anomaly detection results in the spectral domain and the spatial domain, and perform a linear combination of the anomaly detection results in the spectral domain and the spatial domain to obtain the anomaly detection result of the original hyperspectral image.

[0011] Preferably, the specific method for preprocessing the data in the hyperspectral image in S1 includes:

[0012] S1-1. The hyperspectral image is a collection of M×N vectors of B dimensions, expressed as:

[0013] Y∈R M×N×B , Y = {y1, y2,..., y M×N},

[0014] Perform normalization on the hyperspectral image Y, then divide by the maximum value of the hyperspectral data energy value, and then use the reshape function to transform it into a matrix of dimension {M×N, B};

[0015] S1-2. Sample the hyperspectral data every τ sampling points, and divide the hyperspectral image corresponding to the matrix with B bands obtained in S1-1 into τ time steps. The sequence length m of each time step is:

[0016] m = floor(B / τ), where floor(·) represents rounding down;

[0017] S1-3. Perform grouped preprocessing on the hyperspectral data to obtain hyperspectral data z, and the dimension of z is: (M×N, τ, m);

[0018] The result of the band grouping preprocessing is expressed as:

[0019]

[0020] Among them: represents the p-th spectral vector, z = [z (1) ,..., z (i) ,..., z (τ) is a sequence containing global information, i = 1, 2,..., i,..., τ.

[0021] Preferably, τ = 5, B = 128, m = 25.

[0022] Preferably, the specific method for reconstructing the background of the hyperspectral image in S2 includes:

[0023] S2-1. Perform one-dimensional convolutional feature extraction on the hyperspectral data after band grouping to obtain hyperspectral data with the number of channels changed;

[0024] S2-2. Perform positional encoding on the hyperspectral data with the number of channels changed obtained in S2-1, and then input it into the encoder of the Transformer deep learning model to reconstruct the background of the hyperspectral image.

[0025] Preferably, the encoder of the Transformer deep learning model includes: a plurality of identical layers, each layer including two sub-layers, namely a multi-head self-attention layer and a position-wise feed-forward layer;

[0026] The multi-head self-attention layer is used to focus on different parts of the input sequence at different granularity levels;

[0027] The position-wise feed-forward layer is used to apply a non-linear transformation to each position in the sequence.

[0028] Preferably, the specific method for the multi-head self-attention layer to focus on different parts of the input sequence at different granularity levels includes:

[0029] In the multi-head self-attention layer, a multi-head self-attention sub-layer simultaneously transforms the input into different query matrices key matrices and value matrices

[0030] where h = 1,..., H represents the number of attention heads, respectively represent the weight matrices of Q h , K h , V h , and are all parameters to be learned;

[0031] Obtain the scaled dot-product attention expression as:

[0032]

[0033] where d k represents the dimension of (Q h , K h , V h ),

[0034] The multi-head self-attention mechanism is:

[0035] MultiHead(Q h , K h , V h ) = Concat(head1,..., head h )W o

[0036] where, head i represents the scaled dot-product attention mechanism, and the dot-product attention mechanism is to calculate the scaled dot-product attention mechanism head i H times, then merge the outputs, and then multiply by the weight matrix W o .

[0037] Preferably, the position-wise element-wise feed-forward layer includes: two fully connected networks and a ReLU activation function.

[0038] Preferably, the method for reconstructing the background and obtaining the residual image between the reconstructed background and the original hyperspectral image in S3 includes:

[0039] Reconstruct the background image Between the reconstructed background image and the original hyperspectral image Y, obtain the residual image ΔY by point-by-point calculation:

[0040]

[0041] Preferably, the specific method for obtaining the spectral domain anomaly detection result in S3 includes:

[0042] In the spectral domain, process the residual image using the Mahalanobis distance to separate background pixels and anomaly pixels, and obtain the spectral domain anomaly detection result D spectral :

[0043] D spectral =(Δy i -μ) T Γ -1 (Δy i -μ)

[0044] where Δy i represents the i-th pixel value of ΔY, μ represents the mean of ΔY, and Γ -1 represents the covariance matrix of ΔY;

[0045] The specific method for obtaining the anomaly detection result in the spatial domain in S3 includes:

[0046]

[0047] where D spatial represents the anomaly detection result in the spatial domain, E represents the energy map, f open (E) represents the opening operation, and f close (E) represents the closing operation.

[0048] Preferably, the specific method for linearly combining the anomaly detection results in the spectral domain and the spatial domain to obtain the anomaly detection result of the hyperspectral image includes:

[0049] D final =λD spatial +(1 - λ)D spectral ,

[0050] where D final represents the anomaly detection result of the hyperspectral image, and λ represents the weight factor.

[0051] Advantages of the present invention: The anomaly detection method for spatial-spectral joint remote sensing hyperspectral images proposed by the present invention reconstructs the background of the hyperspectral image when the number of background pixels is more than the probability of the appearance of anomaly target pixels, and then processes the residual map between the reconstructed background and the original hyperspectral image through a spatial-spectral joint method for joint detection in the spatial domain and the spectral domain, improving the detection accuracy.

[0052] During the process of reconstructing the background of the hyperspectral image, first, a band grouping strategy is used to preprocess hundreds of bands in the hyperspectral image. Then, the grouped hyperspectral data is used as input. To improve the efficiency of training using a deep learning model in the next step, the Transformer deep learning model is introduced into the background reconstruction task to better learn the probability distribution of the background image and reconstruct the background image.

[0053] The anomaly detection method for spatial-spectral joint remote sensing hyperspectral images proposed by the present invention can improve the detection accuracy of small targets in the anomaly detection of remote sensing hyperspectral images and ensure the integrity of the detection results. Description of the Drawings

[0054] Figure 1 is a schematic diagram of preprocessing the data in the hyperspectral image by band grouping according to the present invention;

[0055] Figure 2 is a principle block diagram of reconstructing the background of the hyperspectral image according to the present invention;

[0056] Figure 3 is a schematic diagram of the structure of the encoder of the Transformer deep learning model;

[0057] Figure 4 is a principle block diagram of obtaining the anomaly detection result of the hyperspectral image by using a spatial-spectral joint method;

[0058] Figure 5 is a visual effect diagram of detection on the public dataset ABU. Detailed Embodiments

[0059] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0060] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other.

[0061] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, but it is not intended to limit the present invention.

[0062] Embodiment 1:

[0063] The following is combined with Figures 1-4 This embodiment is described to illustrate the abnormal detection method for the space-spectral joint remote sensing hyperspectral image of this embodiment. It includes:

[0064] S1. Perform band grouping preprocessing on the hyperspectral data in the hyperspectral image;

[0065] S2. Use the band-grouped hyperspectral data as input to construct a Transformer deep learning model to reconstruct the background of the hyperspectral image;

[0066] S3. Adopt a space-spectral joint method to jointly detect the residual image between the reconstructed background image and the original hyperspectral image, respectively obtain the abnormal detection results in the spectral domain and the spatial domain, and perform a linear combination of the abnormal detection results in the spectral domain and the spatial domain to obtain the abnormal detection result of the original hyperspectral image.

[0067] Furthermore, as Figure 1 shown, the specific method for performing band grouping preprocessing on the data in the hyperspectral image in S1 includes:

[0068] S1-1. The hyperspectral image is a set of vectors with M×N B dimensions, expressed as:

[0069] Y∈R M×N×B , Y = {y1, y2,..., y M×N},

[0070] Perform normalization processing on the hyperspectral image Y, then divide it by the maximum value of the hyperspectral data energy value, and then use the reshape function to transform it into a matrix with dimensions {M×N, B};

[0071] S1-2. Sample the hyperspectral data every τ sampling points, and divide the hyperspectral image corresponding to the matrix with B bands obtained in S1-1 into τ time steps. The sequence length m of each time step is:

[0072] m = floor(B / τ), where floor(·) represents rounding down;

[0073] S1-3. Perform grouping preprocessing on the hyperspectral data to obtain hyperspectral data z, and the dimension of z is: (M×N, τ, m);

[0074] The result of the band grouping preprocessing is expressed as:

[0075]

[0076] Wherein: represents the p-th spectral vector, z = [z (1) ,..., z (i) ,..., z (τ) is a sequence containing global information, i = 1, 2,..., i,..., τ.

[0077] Furthermore, τ = 5, B = 128, m = 25.

[0078] Furthermore, as Figure 2 shown, the specific method for reconstructing the background of the hyperspectral image in S2 includes:

[0079] S2-1. Perform one-dimensional convolutional feature extraction on the hyperspectral data after band grouping to obtain hyperspectral data with changed channel numbers;

[0080] S2-2. Perform positional encoding on the hyperspectral data with changed channel numbers obtained in S2-1, and then input it into the encoder of the Transformer deep learning model to reconstruct the background of the hyperspectral image.

[0081] Furthermore, as Figure 3 shown, the encoder of the Transformer deep learning model includes: a plurality of identical layers, each layer including two sub-layers, and the two sub-layers are a multi-head self-attention layer and a position-wise feed-forward layer respectively;

[0082] The multi-head self-attention layer is used to focus on different parts of the input sequence at different granularity levels;

[0083] The position-wise feed-forward layer is used to apply a non-linear transformation to each position in the sequence.

[0084] Furthermore, the specific method for the multi-head self-attention layer to focus on different parts of the input sequence at different granularity levels includes:

[0085] In the multi-head self-attention layer, a multi-head self-attention sub-layer simultaneously transforms the input into different query matrices key matrices and value matrices

[0086] where h = 1,..., H represents the number of attention heads, respectively represent the weight matrices of Q h , K h , V h , and all are parameters to be learned;

[0087] The expression for obtaining the scaled dot - product attention is as follows:

[0088]

[0089] where d k represents the dimension of (Q h , K h , V h ),

[0090] The multi - head self - attention mechanism is as follows:

[0091] MultiHead(Q h , K h , V h ) = Concat(head1,..., head h )W o

[0092] where, head i represents the scaled dot - product attention mechanism. The dot - product attention mechanism calculates the head i H times, then combines the outputs, and then multiplies by the weight matrix W o .

[0093] Furthermore, the position - wise feed - forward layer includes: two fully - connected networks and a ReLU activation function.

[0094] Furthermore, the method for reconstructing the background and obtaining the residual image between the reconstructed background and the original hyperspectral image in S3 includes:

[0095] The image of the reconstructed background and the original hyperspectral image Y, the residual image ΔY is obtained by point - by - point calculation:

[0096]

[0097] Furthermore, the specific method for obtaining the spectral - domain anomaly detection result in S3 includes:

[0098] In the spectral domain, the Mahalanobis distance is used to process the residual image to separate background pixels and anomaly pixels, and the spectral - domain anomaly detection result D spectral is obtained:

[0099] D spectral =(Δy i - μ) T Γ -1 (Δy i - μ)

[0100] where Δy irepresents the i-th pixel value of ΔY, μ represents the mean value of ΔY, and Γ -1 represents the covariance matrix of ΔY;

[0101] The specific method for obtaining the anomaly detection result in the spatial domain described in S3 includes:

[0102]

[0103] where D spatial represents the anomaly detection result in the spatial domain, E represents the energy map, and f open (E) represents the opening operation, and f close (E) represents the closing operation.

[0104] Furthermore, as Figure 4 shown, the specific method for obtaining the anomaly detection result of the hyperspectral image by linearly combining the anomaly detection results in the spectral domain and the spatial domain includes:

[0105] D final = λD spatial + (1 - λ)D spectral ,

[0106] where D final represents the anomaly detection result of the hyperspectral image, and λ represents the weight factor.

[0107] In this embodiment, the hyperspectral image usually has hundreds of bands, which makes it difficult for the subsequent deep learning network to be trained. In order to establish a stable background and effectively train the model, a spectral band grouping mechanism is adopted before network training. This mechanism samples every τ points in the hyperspectral curve. The grouped sequence is shorter than the original spectral curve, but contains all spectral bands and global information, making the training more effective and efficient.

[0108] In this embodiment, Transformer makes full use of the multi-head attention mechanism because the multi-head attention mechanism enables Transformer to model various dependencies between sequences, is suitable for processing long sequences and long-distance dependencies, and does not have problems such as gradient disappearance or gradient explosion like RNN; the self-attention mechanism in Transformer can perform parallel calculations on all positions, greatly improving the calculation efficiency, which all makes Transformer a good choice for sequence modeling.

[0109] Based on the fact that the probability of the occurrence of abnormal target pixels is much smaller than that of background pixels, this invention uses the excellent modeling ability of the Transformer deep learning model to learn the background distribution of hyperspectral images, better establish the background, so that the reconstructed image has a larger error in the spectral curve of the abnormal target, while the spectral curve of the background is more similar to the spectral curve corresponding to the original hyperspectral image. The reconstructed background is subtracted from the spectral curve of the corresponding pixels in the original hyperspectral image to obtain a residual image.

[0110] In this embodiment, in order to train the network more effectively, the training process should be carried out under some optimization conditions. There are two terms in the loss function of this invention. The first term is the reconstruction error between the original hyperspectral image and the reconstructed image, which is measured using the mean square error loss; the second term is to calculate the spectral angle distance (SAD) between each spectral vector of the original hyperspectral image and the reconstructed background. If the reconstructed spectral vector is more similar to the original spectral vector of the corresponding pixel, the value of SAD is smaller. Through a sufficient number of background samples, the model can better learn the background distribution. Compared with abnormal pixels, the reconstruction error of background pixels is smaller. In this way, the SAD value of the background will be smaller, while the SAD value of the abnormal target pixels will be larger, which will constrain the model to better reconstruct a spectral curve more similar to the input.

[0111] In this embodiment, this invention uses a spectral-spatial joint method to detect anomalies in the residual image. In the spectral domain, the Mahalanobis distance is used to process the residual image to separate background pixels and abnormal pixels. In the spatial domain, the abnormal pixels in the residual image have a larger energy value compared with background pixels. In the energy map, the opening operation and the closing operation are used to remove the bright connected components and connect the dark connected components respectively. Finally, the anomaly detection results in the spectral domain and the spatial domain are linearly combined to obtain the final detection result.

[0112] Example 2:

[0113] The following combines Figures 1-5 to illustrate this embodiment. The method for detecting anomalies in spatial-spectral joint remote sensing hyperspectral images described in this embodiment. Hyperspectral image preprocessing refers to the process of processing and optimizing the original data before analyzing the hyperspectral image. This process can improve the quality and usability of the data, thus better supporting image analysis and applications.

[0114] A hyperspectral image can be represented as a data cube with B bands, specifically represented as Y ∈ R M×N×B , Y = {y1, y2,..., y M×N}, that is, a set of M×N vectors with B dimensions. The hyperspectral band grouping strategy is a technique for processing hyperspectral images, aiming to reduce the number of bands in the hyperspectral image, which can reduce the number of parameters and the computational amount of the deep learning model, thereby improving the training efficiency and accuracy of the deep learning model. At the same time, this strategy can also reduce the noise and redundant information in the data, thereby improving the robustness and generalization ability of the model.

[0115] The band grouping strategy in the present invention can be regarded as a means of preprocessing. The specific implementation steps are as follows:

[0116] Normalize the entire image Y by dividing it by its maximum value, and reshape it into a matrix of {M×N, B}.

[0117] Sample the spectral curve corresponding to each pixel every τ points. This divides a spectral curve with B bands into τ time steps, and the sequence length of each time step is m = floor(B / τ), where floor means rounding down. Therefore, the dimension of the data Z input into the Transformer model is (M×N, τ, m). The specific representation of this band grouping mechanism is

[0118]

[0119] where, is the p-th spectral vector, and z = [z (1) , z (2) ,..., z (τ) is a sequence that contains global information and is shorter for the model. The schematic diagram of the band grouping mechanism is as Figure 1 shown. In the present invention, τ = 5, B = 128, and m = 25.

[0120] Hyperspectral anomaly detection is the process of identifying pixels or regions in a hyperspectral image that are significantly different from the background or expected spectral features. Anomalies may be caused by various factors, such as changes in material composition, surface texture, lighting conditions, or environmental factors, etc. The principle block diagram for reconstructing the background of a hyperspectral image is as Figure 2 shown.

[0121] Before inputting into the Transformer encoder, first use one-dimensional convolution to extract features and change the number of channels, from m channels to 256 channels.

[0122] After position encoding, input it into the encoder of the Transformer. The Transformer adopts an encoder-decoder structure, and the neural network based on the Transformer in the present invention only uses the encoder structure in the Transformer, as Figure 3As shown. The encoder consists of multiple identical layers, and each layer contains two sub-layers: a multi-head self-attention layer and a position-wise feed-forward layer. The self-attention layer allows the model to focus on different parts of the input sequence at different granularity levels, which is particularly helpful for capturing long-range dependencies and context information. The feed-forward layer independently applies a non-linear transformation to each position in the sequence, which helps to capture the interactions between more complex input tokens.

[0123] In the self-attention layer, a multi-head self-attention sub-layer simultaneously transforms the input into different query matrices key matrices and value matrices where h = 1, …, H, and H represents the number of attention heads, and are parameters to be learned. After these linear operations, the scaled dot-product attention calculation expression is:

[0124]

[0125] where d k is the dimension of Q, K, V. The multi-head attention mechanism ensures that the Transformer can notice information in different subspaces and capture richer feature information, and its formula is as follows

[0126] MultiHead(Q, K, V) = Concat(head1, ..., head h )W o

[0127] where head i = Attention(QW i Q , KW i K , VW i V ), and are both parameter matrices. head1, ..., head H will be concatenated together and linearly projected. After the attention output, a position-wise feed-forward layer is stacked on it, and this sub-layer consists of two fully-connected networks and a ReLU activation function. Finally, this sub-layer is followed by a fully-connected layer. The above is the structure of the encoder in the Transformer used in the present invention.

[0128] To make the training more effective, the training needs to be carried out under certain constraints. The loss function in the present invention is:

[0129]

[0130] In the above formula, the first term is the reconstruction error of corresponding pixels between the original hyperspectral image and the reconstructed image, which will be measured by the mean square error loss. The second term is to calculate the Spectral Angle Distance (SAD) of each spectral vector between the original hyperspectral image and the reconstructed image. SAD is defined as If the reconstructed spectral vector is similar to the original spectral vector at the corresponding pixel, then the value of SAD will be smaller. Through sufficient background samples, the model can better learn the background distribution, and compared with abnormal pixels, the reconstruction error of background pixels is smaller. In this way, the SAD of the background will decrease, while the SAD of abnormal pixels will increase, thus prompting the model to generate a reconstructed spectral vector more similar to the input spectral vector.

[0131] Adjust the relevant parameters for model training. In the present invention, λ1 = 1, λ2 = 0.02, learning rate lr = 0.005, epoch = 15, batchsize = 128.

[0132] In the present invention, the post - processing steps mainly include spectral - spatial joint hyperspectral anomaly detection. The specific process is as Figure 4 shown.

[0133] For the image after background reconstruction in step 2 and the residual image calculated point - by - point between it and the original image Y:

[0134] Perform processing.

[0135] In the spectral domain, the Mahalanobis distance is applied to separate abnormal pixels and the background. The calculation expression is as follows

[0136] D spectral =(Δy i - μ) T Γ -1 (Δy i - μ)

[0137] In the spatial domain, the energy e b (i,j) of the (i,j) - th point is the energy value of the b - th band at the (i,j) - th point in ΔY. By adding the energy values of each band at this point in ΔY, the spectral curve of the reconstructed background will be similar to the spectral curve of the original image, so the energy here is smaller; the spectral curve of abnormal pixels will be quite different from the spectral curve of the original image, that is, the difference is large, so the energy here is large. The energy map E can highlight abnormal targets and suppress the background. Apply morphological filters to the energy map E, mainly including opening operation and closing operation. The anomaly detection result in the spatial domain is expressed as follows

[0138]

[0139] f open (E) and f close (E) respectively represent the opening operation and the closing operation, which can better remove some small burrs and fill some small holes. The anomaly detection result in the spatial domain can be obtained after the opening and closing operations.

[0140] Finally, the anomaly detection results in the spectral domain and the spatial domain are linearly combined to obtain the final detection result. The expression is as follows

[0141] D final = λD spatial +(1 - λ)D spectral

[0142] λ is a weight factor. In the present invention, λ = 0.5 is taken.

[0143] The present invention was tested on the publicly available dataset Airport - Beach - Urban (ABU), and the anomaly detection results of some datasets are shown below. The comparison results of the AUC values of the present invention and other 4 classical methods are shown in Table 1.

[0144] Table 1

[0145] Method The present invention RX LRX CRD KIFD Airport-2 0.9741 0.8404 0.8986 0.9087 0.9728 Beach-3 0.9974 0.9998 0.9965 0.9998 0.9860 Urban-3 0.9853 0.9513 0.9739 0.9621 0.9517

[0146] The experimental results of the present invention were compared with those of other 4 methods using the evaluation metrics ROC and AUC. The AUCs of the 5 methods on three datasets are given in Table 1. It can be seen from Table 1 that the detection results of the present invention are excellent in the Airport - 2 and Urban - 3 datasets, while they are comparable to other methods in the Beach - 3 dataset. From Figure 5 The visual effect of the detection shows that the detection results in the present invention suppress the background and make the abnormal pixels more prominent. Therefore, the present invention has achieved excellent performance in hyperspectral anomaly detection and has a competitive detection ability.

[0147] Although the present invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the present invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed, as long as they do not deviate from the spirit and scope of the present invention as defined by the appended claims. It should be understood that the different dependent claims and the features described herein can be combined in a manner different from that described in the original claims. It should also be understood that the features described in connection with a single embodiment can be used in other described embodiments.

Claims

1. Anomaly detection method for hyperspectral images of space-spectral joint remote sensing, characterized in that, It includes: S1. Perform band grouping preprocessing on the hyperspectral data in the hyperspectral image; S2. Use the band-grouped hyperspectral data as input to construct a Transformer deep learning model to reconstruct the background of the hyperspectral image; S3. Adopt a spatial-spectral joint method to jointly detect the residual image between the reconstructed background image and the original hyperspectral image, respectively obtain the anomaly detection results in the spectral domain and the spatial domain, and linearly combine the anomaly detection results in the spectral domain and the spatial domain to obtain the anomaly detection result of the original hyperspectral image; The method for the residual image between the reconstructed background in S3 and the original hyperspectral image includes: Image of the reconstructed background Between the original hyperspectral image Y, a residual image ΔY is obtained by point-by-point calculation: The specific method for obtaining the anomaly detection result in the spectral domain in S3 includes: In the spectral domain, the Mahalanobis distance is used to process the residual image, separate background pixels and abnormal pixels, and obtain the spectral domain anomaly detection result D spectral : D spectral = (Δy i - μ) T Γ -1 (Δy i - μ) where, Δy i represents the i-th pixel value of ΔY, μ represents the mean value of ΔY, and Γ -1 represents the covariance matrix of ΔY; The specific method for obtaining the anomaly detection result in the spatial domain in S3 includes: Among them, D spatial represents the spatial domain anomaly detection result, E represents the energy map, and f open (E) represents the opening operation, and f close (E) represents the closing operation.

2. The anomaly detection method for the spatial-spectral joint remote sensing hyperspectral image according to claim 1, wherein, The specific method for performing band grouping preprocessing on the data in the hyperspectral image in S1 includes: S1-1. The hyperspectral image is a collection of M×N B-dimensional vectors, expressed as: Y ∈ R M×N×B , Y = {y1, y2,..., y M×N}, Perform normalization processing on the hyperspectral image Y, then divide it by the maximum value of the hyperspectral data energy value, and then use the reshape function to transform it into a matrix with dimensions {M×N, B}; S1-2. Sample the hyperspectral data every τ sampling points, and divide the hyperspectral image corresponding to the matrix with B bands obtained in S1-1 into τ time steps. The sequence length m of each time step is: m = floor(B / τ), where floor(·) represents rounding down; S1-3. Perform grouped preprocessing on the hyperspectral data to obtain hyperspectral data z, and the dimensions of z are: (M×N, τ, m); The band grouping preprocessing result is expressed as: Wherein: represents the p-th spectral vector, z = [z (1) ,..., z (i) ,..., z (τ) is a sequence containing global information, i = 1, 2,..., i,..., τ.

3. The anomaly detection method for the space-spectral joint remote sensing hyperspectral image according to claim 2, characterized in that τ = 5, B = 128, m = 25.

4. The anomaly detection method for the space-spectral joint remote sensing hyperspectral image according to claim 1, wherein The specific method for reconstructing the background of the hyperspectral image in S2 includes: S2-1. Perform one-dimensional convolutional feature extraction on the band-grouped hyperspectral data to obtain hyperspectral data with changed number of channels; S2-2. Perform positional encoding on the hyperspectral data with changed number of channels obtained in S2-1, and then input it into the encoder of the Transformer deep learning model to reconstruct the background of the hyperspectral image.

5. The anomaly detection method for the spatial-spectral joint remote sensing hyperspectral image according to claim 4, wherein The encoder of the Transformer deep learning model includes: multiple identical layers, and each layer includes two sub-layers, and the two sub-layers are a multi-head self-attention layer and a position-wise feed-forward layer respectively; The multi-head self-attention layer is used to focus on different parts of the input sequence at different granularity levels; The position-wise feed-forward layer is used to apply a non-linear transformation to each position in the sequence.

6. The anomaly detection method for the spatial-spectral joint remote sensing hyperspectral image according to claim 5, wherein, The specific method for the multi-head self-attention layer to focus on different parts of the input sequence at different granularity levels includes: In the multi-head self-attention layer, a multi-head self-attention sub-layer simultaneously transforms the input into different query matrices key matrices and value matrices where h = 1, ···, H represents the number of attention heads, representing Q h , K h , V h weight matrices respectively, all of which are parameters to be learned; Obtain the scaled dot-product attention expression as: Among them, d k represents the dimension of (Q h , K h , V h ), The multi-head self-attention mechanism is: MultiHead(Q h ,K h ,V h ) = Concat(head1,..., head h )W o Among them, head i = Attention(Q h W i Q , K h W i K , V h W i V ), i = 1, 2, …, h; head i represents the scaled dot - product attention mechanism. The dot - product attention mechanism calculates the scaled dot - product attention mechanism head i H times, then combines the outputs, and then multiplies by the weight matrix W o .

7. The anomaly detection method for the spatial-spectral joint remote sensing hyperspectral image according to claim 5, characterized in that The position-wise feed-forward layer includes: two fully-connected networks and a ReLU activation function.

8. The anomaly detection method for the spatial-spectral joint remote sensing hyperspectral image according to claim 1, wherein The specific method for linearly combining the anomaly detection results in the spectral domain and the spatial domain to obtain the anomaly detection result of the hyperspectral image includes: D final = λD spatial + (1 - λ)D spectral , Among them, D final represents the hyperspectral image anomaly detection result, and λ represents the weight sub.

Citation Information

Patent Citations

  • Rice grading method, device and equipment and storage medium

    CN114387226A

  • Hyperspectral image classification method based on double-path convolution and double attention and storage medium

    CN115272776A