A hyperspectral anomaly detection method and computer device
The global and local features of high-spectral images are extracted through deep learning network joint training and self-attention mechanism, and the problems of unreasonable background assumptions and unoptimized feature extraction and detection in the existing algorithm are solved, achieving efficient and accurate anomaly detection.
Patent Information
- Application Number
- CN202211298268.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-22
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-10-22
AI Technical Summary
The existing hyperspectral image anomaly detection algorithm assumes that the background conforms to the Gaussian distribution is unreasonable, resulting in low accuracy of background estimation and high error detection rate of detection results. The feature extraction and abnormal detection parts of the deep neural network are not jointly optimized, which is very computationally expensive and takes a long time.
The deep learning network is used for joint training, and the global related features and local features of the high-spectral image are extracted in combination with the adversarial autoencoder and the self-attention mechanism. The abnormal score values are output through the hyperplane learning layer, thereby realizing the joint optimization of the feature extraction network and the abnormal detection network.
The accuracy and efficiency of abnormal detection are improved, the separability between abnormal regions and background regions is enhanced, and the hyperspectral image information is fully utilized to achieve better detection effects.
Smart Images

Figure CN115661069B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a hyperspectral anomaly detection method and a computer device. Background Art
[0002] A hyperspectral image is a three-dimensional image matrix that can simultaneously contain the spectral and spatial characteristics of the target. It has high spectral resolution and powerful spatial-spectral information expression capabilities, and has a wide range of applications in areas such as object classification, change detection, and target detection. Depending on whether the spectral information of the target is known, target detection in hyperspectral images can be divided into matching target detection and anomaly detection. Anomaly detection in hyperspectral images can classify pixels in the image into two categories: anomalies and background without using prior information about the target. Generally, prior information about the target is difficult to obtain, so anomaly detection in hyperspectral images is more widely used. The classic anomaly detection algorithm, the RX algorithm, is a method based on background modeling. This algorithm assumes that the background of the hyperspectral image conforms to a Gaussian distribution and uses the mean and covariance matrix of the entire image to establish a statistical model of the background. It then detects anomalies by measuring the Mahalanobis distance between the spectrum of the pixel to be tested and the background spectral distribution. The CRD algorithm is an anomaly detection algorithm based on collaborative expression. It constructs a background dictionary using a sliding double window and expresses each pixel using a linear combination of elements in the background dictionary. Because the background and anomalies belong to different clusters, the re-expression of background pixels will be due to anomaly pixels. Therefore, the residual between the re-expressed image and the original image is the anomaly. The existing SAFL algorithm is a deep learning-based algorithm that uses an adversarial autoencoder to extract spectral features from hyperspectral images. It then fuses the spectral features using a band fusion method to obtain spatial features. The spatial features are then used to enhance anomaly targets in the original hyperspectral image. Finally, the RX detector formula is used to solve for outliers in the hyperspectral image, resulting in a detection result image for the hyperspectral image.
[0003] However, the RX algorithm assumes that the background of the hyperspectral image conforms to a Gaussian distribution, an assumption that is overly idealistic. In reality, the background of hyperspectral images does not strictly follow a Gaussian distribution. Furthermore, when the background is complex, it may be composed of multiple different distributions. In these cases, assuming the hyperspectral image background is an ideal Gaussian distribution is unreasonable, resulting in low background estimation accuracy, a high false positive rate, and poor detection precision. When the CRD algorithm constructs a background dictionary using a sliding double window, the window size must be manually pre-set. Due to a lack of prior knowledge of the target, the optimal window size cannot be known in advance, which can have a certain impact on detection results. Furthermore, when constructing the background dictionary, local information is utilized without considering global information, resulting in low feature utilization and low background reliability. This method also suffers from the drawbacks of high computational complexity and long time consumption due to the need for repeated calculations. The SALF algorithm uses a deep neural network to extract features from hyperspectral images. It only uses the RX detector for anomaly detection on the final feature map. The objective function trained by the deep neural network does not jointly optimize the feature extraction part and the subsequent anomaly detector part, making the feature extraction part and the anomaly detection part essentially separated, resulting in the deep neural network being unable to maximize its advantages. Summary of the Invention
[0004] (1) Technical issues to be resolved
[0005] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a hyperspectral anomaly detection method and a computer device.
[0006] (2) Technical solution
[0007] In order to achieve the above objectives, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, an embodiment of the present invention provides a hyperspectral anomaly detection method, the method comprising:
[0009] S1. Acquire the hyperspectral image to be processed;
[0010] S2. Inputting the hyperspectral image to be processed into a trained deep learning network to obtain a detection result;
[0011] The trained deep learning network includes a feature extraction network and an anomaly detection network;
[0012] The feature extraction network is used to extract global correlation features and local features of the hyperspectral image to be processed to obtain a feature map of the hyperspectral image;
[0013] The anomaly detection network is used to obtain an anomaly score value for each pixel in the hyperspectral image based on the feature map of the hyperspectral image;
[0014] Among them, the feature extraction network and the anomaly detection network in the deep learning network are jointly trained with the training data of the hyperspectral image in advance to obtain the trained deep learning network.
[0015] Preferably,
[0016] The feature extraction network includes:
[0017] An adversarial autoencoder (AAE) is used to generate a reconstructed image based on the hyperspectral image input to the feature extraction network, and to generate a residual image based on the hyperspectral image input to the feature extraction network and the reconstructed image;
[0018] A self-attention mechanism module is used to output global correlation features of the hyperspectral image based on the residual image and the hyperspectral image of the input feature extraction network, and obtain a feature map Z containing the global correlation features;
[0019] The global correlation feature of the hyperspectral image is: the correlation between each pixel and all pixels in the hyperspectral image;
[0020] The local feature extraction network is used to extract local features based on the feature map Z containing the global correlation features, and output a feature map of the hyperspectral image that combines the global correlation features and the local features.
[0021] Preferably, before S1, it also includes:
[0022] S00, obtaining training data of hyperspectral images;
[0023] S01, inputting the training data of the hyperspectral image into an adversarial autoencoder AAE in a deep learning network, wherein the adversarial autoencoder AAE performs encoding-decoding processing on the training data of the hyperspectral image to obtain a reconstructed image of the training data of the hyperspectral image;
[0024] S02. Obtaining a corresponding residual image based on the training data of the hyperspectral image and the reconstructed image;
[0025] S03, inputting the residual image and the training data of the hyperspectral image into a self-attention mechanism module, wherein the self-attention mechanism module uses a self-attention mechanism to extract global correlation features of the training data of the hyperspectral image and obtain a feature map Z containing the global correlation features;
[0026] S04, inputting the feature map Z containing the global correlation features into a local feature extraction network, which extracts local features of the training data of the hyperspectral image and outputs a feature map of the hyperspectral image that combines the global correlation features and the local features;
[0027] S05, inputting the feature map of the hyperspectral image into an anomaly detection network, and outputting an anomaly score value for each pixel in the feature map of the hyperspectral image;
[0028] The anomaly detection network is a hyperplane learning layer;
[0029] S06. Repeat S01-S06 until the pre-set loss function in the anomaly detection network converges to obtain a trained deep learning network.
[0030] Preferably,
[0031] The adversarial autoencoder AAE includes: an encoder E, a decoder De, a feature discriminator Dz, and a residual unit;
[0032] Among them, the encoder E is used to map the hyperspectral image input into the adversarial autoencoder AAE to the hidden layer space to obtain the latent variable z;
[0033] In the AAE encoding-decoding process, the reconstruction loss function uses huber loss;
[0034] The feature discriminator Dz is used to constrain the data distribution of the latent variable z using the loss function Wgan-gp so that it satisfies the Gaussian distribution;
[0035] Wherein, the loss function Wgan-gp is:
[0036]
[0037] in, is Gaussian sampling data;
[0038] P gauss is the Gaussian distribution to which the Gaussian sampling data belongs;
[0039] P E is the data distribution in the hidden space;
[0040] represent Output result after Dz;
[0041] Dz(z) represents the output result of the latent variable z through Dz;
[0042] t is defined along P gauss and P E The straight line space P between the sampling point pairs t Uniform sampling of
[0043] E[*] represents the mathematical expectation function;
[0044] The decoder De is used to reconstruct the latent variable z to obtain the reconstructed image;
[0045] The residual unit is used to obtain a residual image by performing a residual operation on the hyperspectral image and the reconstructed image in the input adversarial autoencoder AAE;
[0046] in,
[0047]
[0048] Where X is the hyperspectral image input to the adversarial autoencoder AAE;
[0049] To reconstruct the image;
[0050] R is the residual image.
[0051] Preferably, the S03 specifically includes:
[0052] Inputting the residual image and the training data of the hyperspectral image into a self-attention mechanism module, the self-attention mechanism module adopts the self-attention mechanism to obtain the global correlation features of the training data of the hyperspectral image according to formula (1);
[0053] The formula (1) is:
[0054]
[0055] Among them, Softmax() is a normalization method;
[0056] g(X) is the characteristic representation function;
[0057] is the Hadama product of R and X;
[0058] is the transpose of the Hadama product of R and X;
[0059] Then, a feature map Z containing the global correlation features is obtained according to the global correlation features and the residual connection;
[0060] Where Z = W z Y+X;
[0061] W z is the weight matrix of the residual connection.
[0062] Preferably,
[0063] The local feature extraction network consists of a two-dimensional convolution layer with a convolution kernel size of 1×1 and a three-dimensional convolution layer with a convolution kernel size of 3×3×3;
[0064] The two-dimensional convolutional layer is used to extract the spectral features at each pixel position for the feature map Z containing the global correlation features;
[0065] The three-dimensional convolution layer is used to extract spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image for the feature map Z containing the global correlation features.
[0066] Preferably,
[0067] The local features include:
[0068] The two-dimensional convolution layer extracts the spectral features at each pixel position for the feature map Z containing the global correlation features;
[0069] The three-dimensional convolution layer extracts spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image based on the feature map Z containing the global correlation features.
[0070] Preferably,
[0071] The anomaly detection network is used to output an anomaly score value for each pixel in the hyperspectral image based on the feature map of the input hyperspectral image;
[0072] Among them, a i =ωx i c +b;
[0073] a i is the abnormal score value of the i-th pixel in the hyperspectral image;
[0074] ω is the weight parameter of the hyperplane learning layer;
[0075] x i c is the vector at the i-th pixel point of the feature map of the hyperspectral image;
[0076] b is the bias parameter of the hyperplane learning layer;
[0077] ωx c +b=0 is the hyperplane represented by this layer.
[0078] Preferably,
[0079] The pre-set loss function is:
[0080]
[0081] Among them, L ocsvm is a pre-set loss function; v∈(0,1) is a parameter that balances maximizing the distance between the hyperplane and the origin and the number of data allowed to pass through the hyperplane; Ψ(*) represents the feature extraction network; N is the number of pixels in the hyperspectral image.
[0082] On the other hand, this embodiment further provides a computer device, comprising a memory, a processor, and a bus, wherein the processor is connected to the memory via the bus;
[0083] The memory is used to store a program, and the processor is used to run the program, wherein the program executes any of the above-mentioned hyperspectral anomaly detection methods when it is run.
[0084] (3) Beneficial effects
[0085] The beneficial effects of the present invention are as follows: a hyperspectral anomaly detection method and a computer device of the present invention adopt an adversarial autoencoder to obtain a residual image, enhance possible abnormal areas, and thus increase the separability of abnormal areas from background areas; based on the self-attention mechanism, the present invention proposes a feature extraction network that can simultaneously extract global correlation features and local features in hyperspectral images, making more effective use of the information in the hyperspectral images, and the extracted features include global correlation features, spectral features, and local spatial features; the anomaly detection method constructed by the present invention realizes the joint training and optimization of the feature extraction network and the anomaly detection network, obtains a feature extraction network for the anomaly detection task, and maps the original hyperspectral image to a feature space with better separability between anomalies and background. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Figure 1 This is a flow chart of a hyperspectral anomaly detection method of the present invention;
[0087] Figure 2 Schematic diagram of a practical application of a hyperspectral anomaly detection method of the present invention;
[0088] Figure 3(a) shows the original hyperspectral image of San Diego Airport;
[0089] Figure 3(b) is the ground truth map of the anomaly targets in the San Diego Airport image;
[0090] Figure 3(c) is the detection result obtained by using the RX anomaly detection algorithm to detect anomalies in the hyperspectral image in Figure 3(a);
[0091] Figure 3(d) is the detection result obtained by using the CRD anomaly detection algorithm to detect anomalies in the hyperspectral image in Figure 3(a);
[0092] Figure 3(e) is the detection result obtained by using the LREN anomaly detection algorithm to detect anomalies in the hyperspectral image in Figure 3(a);
[0093] FIG3( f ) is a diagram showing the detection results obtained by performing anomaly detection on the hyperspectral image in FIG3( a ) using the method of the present invention;
[0094] FIG4( a ) is a ROC curve corresponding to the RX anomaly detection algorithm, the CRD anomaly detection algorithm, the deep learning LREN algorithm, and the method of the present invention;
[0095] Figure 4(b) is a bar chart of the AUC values corresponding to the RX anomaly detection algorithm, the CRD anomaly detection algorithm, the deep learning LREN algorithm, and the method of the present invention. DETAILED DESCRIPTION
[0096] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation methods in conjunction with the accompanying drawings.
[0097] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.
[0098] See also Figure 1 This embodiment provides a hyperspectral anomaly detection method, the method comprising:
[0099] S1. Obtain the hyperspectral image to be processed.
[0100] S2. Input the hyperspectral image to be processed into a trained deep learning network to obtain a detection result.
[0101] See also Figure 2 , the trained deep learning network described in this embodiment includes a feature extraction network and an anomaly detection network.
[0102] The feature extraction network is used to extract global correlation features and local features of the hyperspectral image to be processed to obtain a feature map of the hyperspectral image.
[0103] The anomaly detection network is used to obtain an anomaly score value for each pixel in the hyperspectral image based on the feature map of the hyperspectral image.
[0104] Among them, the anomaly score value of a pixel point represents the probability that the pixel point belongs to an abnormal target.
[0105] Among them, the feature extraction network and the anomaly detection network in the deep learning network are jointly trained with the training data of the hyperspectral image in advance to obtain the trained deep learning network.
[0106] In practical applications of this embodiment, the feature extraction network includes:
[0107] An adversarial autoencoder (AAE) is used to generate a reconstructed image based on the hyperspectral image of the input feature extraction network, and to generate a residual image based on the hyperspectral image of the input feature extraction network and the reconstructed image.
[0108] The self-attention mechanism module is used to output global correlation features of the hyperspectral image based on the residual image and the hyperspectral image of the input feature extraction network, and obtain a feature map Z containing the global correlation features.
[0109] The global correlation feature of the hyperspectral image is the correlation between each pixel and all pixels in the hyperspectral image.
[0110] The local feature extraction network is used to extract local features based on the feature map Z containing the global correlation features, and output a feature map of the hyperspectral image that combines the global correlation features and the local features.
[0111] Specifically, before S1, it also includes:
[0112] S00. Obtain training data of hyperspectral images.
[0113] S01. Input the training data of the hyperspectral image into the adversarial autoencoder AAE in the deep learning network. The adversarial autoencoder AAE performs encoding-decoding processing on the training data of the hyperspectral image to obtain a reconstructed image of the training data of the hyperspectral image.
[0114] S02. Obtain a corresponding residual image based on the training data of the hyperspectral image and the reconstructed image.
[0115] S03. Inputting the residual image and the training data of the hyperspectral image into a self-attention mechanism module. The self-attention mechanism module uses a self-attention mechanism to extract global correlation features of the training data of the hyperspectral image and obtain a feature map Z containing the global correlation features.
[0116] S04. Inputting the feature map Z containing the global correlation features into a local feature extraction network. The local feature extraction network extracts local features of the training data of the hyperspectral image and outputs a feature map of the hyperspectral image that combines the global correlation features and the local features.
[0117] S05: Inputting the feature map of the hyperspectral image into an anomaly detection network, and outputting an anomaly score value for each pixel in the feature map of the hyperspectral image.
[0118] The anomaly detection network is a hyperplane learning layer.
[0119] S06. Repeat S01-S06 until the pre-set loss function in the anomaly detection network converges to obtain a trained deep learning network.
[0120] In the specific application of this embodiment, the adversarial autoencoder AAE includes: an encoder E, a decoder De, a feature discriminator Dz, and a residual unit.
[0121] Among them, the encoder E is used to map the hyperspectral image in the input adversarial autoencoder AAE to the hidden layer space to obtain the latent variable z.
[0122] In the AAE encoding-decoding process, the reconstruction loss function uses huber loss.
[0123] The feature discriminator Dz is used to constrain the data distribution of the latent variable z using the loss function Wgan-gp so that it satisfies the Gaussian distribution.
[0124] Wherein, the loss function Wgan-gp is:
[0125]
[0126] in, is Gaussian sampling data.
[0127] P gauss is the Gaussian distribution to which the Gaussian sampled data belongs.
[0128] P E is the data distribution in the hidden space.
[0129] represent Output result after Dz.
[0130] Dz(z) represents the output result of the latent variable z through Dz.
[0131] t is defined along P gauss and P E The straight line space P between the sampling point pairs t Uniform sampling of .
[0132] E[*] represents the mathematical expectation function.
[0133] The decoder De is used to reconstruct the latent variable z to obtain the reconstructed image.
[0134] The residual unit is used to obtain a residual image by performing a residual operation on the hyperspectral image and the reconstructed image in the input adversarial autoencoder AAE.
[0135] in,
[0136]
[0137] Where X is the hyperspectral image input to the adversarial autoencoder AAE.
[0138] is the reconstructed image; R is the residual image.
[0139] In this embodiment, the S03 specifically includes:
[0140] The residual image and the training data of the hyperspectral image are input into a self-attention mechanism module, and the self-attention mechanism module adopts the self-attention mechanism to obtain the global correlation features of the training data of the hyperspectral image according to formula (1).
[0141] The formula (1) is:
[0142]
[0143] Among them, Softmax() is a normalization method.
[0144] g(X) is the characteristic representation function.
[0145] is the Hadama product of R and X.
[0146] is the transpose of the Hadama product of R and X.
[0147] Then, a feature map Z containing the global correlation features is obtained based on the global correlation features and the residual connection.
[0148] Where Z = W z Y+X.
[0149] W z is the weight matrix of the residual connection.
[0150] For example, the size of the hyperspectral image and residual image R in the input adversarial autoencoder AAE is converted to k×N and then input into the self-attention mechanism module, that is,
[0151] Then calculate the Hadama product of the two to get the abnormal enhancement map The possible abnormal areas in V are enhanced compared with those in X.
[0152] Overall global correlation features It can be expressed as:
[0153]
[0154] Finally, with the residual connection, the output of the self-attention mechanism module It can be expressed as:
[0155] Z=W z Y+X.
[0156] Among them, W z is the weight matrix of the residual connection.
[0157] The local feature extraction network consists of a two-dimensional convolution layer with a convolution kernel size of 1×1 and a three-dimensional convolution layer with a convolution kernel size of 3×3×3.
[0158] The two-dimensional convolutional layer is used to extract the spectral features at each pixel position for the feature map Z containing the global correlation features.
[0159] The three-dimensional convolution layer is used to extract spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image for the feature map Z containing the global correlation features.
[0160] The local features include:
[0161] The two-dimensional convolutional layer extracts the spectral features at each pixel position for the feature map Z containing the global correlation features.
[0162] The three-dimensional convolution layer extracts spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image based on the feature map Z containing the global correlation features.
[0163] The anomaly detection network is used to output an anomaly score value for each pixel in the hyperspectral image based on the feature map of the input hyperspectral image.
[0164] Among them, a i =ωx i c +b.
[0165] a i is the abnormal score value of the i-th pixel in the hyperspectral image.
[0166] ω is the weight parameter of the hyperplane learning layer.
[0167] x i c is the vector at the i-th pixel of the feature map of the hyperspectral image.
[0168] b is the bias parameter of the hyperplane learning layer.
[0169] ωx c +b=0 is the hyperplane represented by this layer.
[0170] In this embodiment, the preset loss function is:
[0171]
[0172] Among them, L ocsvm is a predefined loss function; v∈(0,1) is a parameter that balances maximizing the distance between the hyperplane and the origin with the number of data points allowed to cross the hyperplane; Ψ(*) represents the feature extraction network; and N is the number of pixels in the hyperspectral image. In this embodiment, the predefined loss function drives the optimization of both the hyperplane parameters and the feature extraction network parameters. Since ω, b, and Ψ all exist as network parameters, the error backpropagation algorithm is used during training to minimize the loss function.
[0173] In the hyperspectral anomaly detection method of this embodiment, during the training process, the hyperplane learning layer and the feature extraction network are continuously jointly trained and optimized according to the loss function to obtain the final trained deep learning network.
[0174] A hyperspectral anomaly detection method and computer device of the present invention use an adversarial autoencoder to obtain a residual image, enhance possible abnormal areas, and thus increase the separability of abnormal areas from background areas; based on the self-attention mechanism, the present invention proposes a feature extraction network that can simultaneously extract global correlation features and local features in hyperspectral images, making more effective use of the information in the hyperspectral images. The extracted features include global correlation features, spectral features, and local spatial features; the anomaly detection method constructed by the present invention realizes the joint training and optimization of the feature extraction network and the anomaly detection network, obtains a feature extraction network for the anomaly detection task, and maps the original hyperspectral image to a feature space with better separability between anomalies and background.
[0175] The effect of the hyperspectral anomaly detection method in this embodiment can be further illustrated by combining the simulation experiments below.
[0176] Simulation conditions
[0177] It is carried out based on NVIDIA 1080Ti GPU, Intel(R) Core(TM) i9-7920U CPU, Pytorch deep learning framework and Matlab 2018b software environment.
[0178] Simulation content and result analysis
[0179] Simulation 1, using the existing traditional algorithms RX anomaly detection algorithm, CRD anomaly detection algorithm, deep learning algorithm LREN algorithm and the method of the present invention to perform anomaly detection on the hyperspectral image respectively, and the detection results are shown in Figure 3. Among them: Figure 3 (a) is the original hyperspectral image of San Diego Airport, and the data size of this image is 90×90×189; Figure 3 (b) is the true value image of the abnormal target of the San Diego Airport image, and the data size of this image is 90×90. The black part in the image is the background, and the white part is the abnormal target; Figure 3 (c) is the detection result image obtained by the RX anomaly detection algorithm for anomaly detection of the hyperspectral image in Figure 3 (a); Figure 3 (d) is the detection result image obtained by the CRD anomaly detection algorithm for anomaly detection of the hyperspectral image in Figure 3 (a); Figure 3 (e) is the detection result image obtained by the LREN anomaly detection algorithm for anomaly detection of the hyperspectral image in Figure 3 (a); Figure 3 (f) is the detection result image obtained by the method of the present invention for anomaly detection of the hyperspectral image in Figure 3 (a);
[0180] from Figures 3(a)-3(f) It can be seen that compared with the method proposed in this embodiment, the existing technology is not accurate enough in detecting anomalies, there are many false alarms in the detection results, and even abnormal targets cannot be detected. The method of the present invention has a good detection result for anomalies, can accurately detect aircraft, and achieves a good effect of suppressing background-highlighting anomalies. The algorithm is superior to other algorithms.
[0181] In Simulation 2, the detection results of the existing RX anomaly detection algorithm, the CRD anomaly detection algorithm, the deep learning LREN algorithm, and the proposed method were compared with the ground truth map of the anomaly targets in the detected hyperspectral image. The corresponding ROC curves for the existing RX anomaly detection algorithm, the CRD anomaly detection algorithm, the deep learning LREN algorithm, and the proposed method were plotted, and the corresponding AUC values were calculated. Figure 4(a) shows the ROC curves for the four methods; Figure 4(b) shows a bar chart of the AUC values for the four methods.
[0182] from Figure 4(a) and 4(b) It can be seen that compared with the three existing methods, the ROC curve of the present invention reaches 1 first and has the highest AUC value, indicating that the algorithm of the present invention has the best and most accurate detection effect on abnormal targets.
[0183] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0184] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, apparatus, and computer program products according to embodiments of the invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.
[0185] It should be noted that, in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims enumerating several means, several of these means may be embodied by one and the same hardware. The use of the words first, second, third etc. is for convenience only and does not indicate any order. These words may be understood as part of the component name.
[0186] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0187] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments after learning the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0188] Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if such modifications and variations fall within the scope of the claims and their equivalents, the present invention shall also include such modifications and variations.
Claims
1. A hyperspectral anomaly detection method, characterized in that: The method comprises: S1. Acquire the hyperspectral image to be processed; S2. Inputting the hyperspectral image to be processed into a trained deep learning network to obtain a detection result; The trained deep learning network includes a feature extraction network and an anomaly detection network; The feature extraction network is used to extract global correlation features and local features of the hyperspectral image to be processed to obtain a feature map of the hyperspectral image; The anomaly detection network is used to obtain an anomaly score value for each pixel in the hyperspectral image based on the feature map of the hyperspectral image; The feature extraction network and the anomaly detection network in the deep learning network are jointly trained using the training data of the hyperspectral image in advance to obtain a trained deep learning network; The feature extraction network includes: An adversarial autoencoder (AAE) is used to generate a reconstructed image based on the hyperspectral image input to the feature extraction network, and to generate a residual image based on the hyperspectral image input to the feature extraction network and the reconstructed image; A self-attention mechanism module is used to output global correlation features of the hyperspectral image based on the residual image and the hyperspectral image of the input feature extraction network, and obtain a feature map Z containing the global correlation features; The global correlation feature of the hyperspectral image is: the correlation between each pixel and all pixels in the hyperspectral image; A local feature extraction network is used to extract the local feature from the feature map Z containing the global correlation features. Extract local features and output a feature map of the hyperspectral image that combines global correlation features and local features; Before S1, it also included: S00, obtaining training data of hyperspectral images; S01, inputting the training data of the hyperspectral image into an adversarial autoencoder AAE in a deep learning network, wherein the adversarial autoencoder AAE performs encoding-decoding processing on the training data of the hyperspectral image to obtain a reconstructed image of the training data of the hyperspectral image; S02. Obtaining a corresponding residual image based on the training data of the hyperspectral image and the reconstructed image; S03, inputting the residual image and the training data of the hyperspectral image into a self-attention mechanism module, wherein the self-attention mechanism module uses a self-attention mechanism to extract global correlation features of the training data of the hyperspectral image and obtain a feature map Z containing the global correlation features; S04, inputting the feature map Z containing the global correlation features into a local feature extraction network, which extracts local features of the training data of the hyperspectral image and outputs a feature map of the hyperspectral image that combines the global correlation features and the local features; S05, inputting the feature map of the hyperspectral image into an anomaly detection network, and outputting an anomaly score value for each pixel in the feature map of the hyperspectral image; The anomaly detection network is a hyperplane learning layer; S06. Repeat S01-S06 until the pre-set loss function in the anomaly detection network converges to obtain a trained deep learning network.
2. The method according to claim 1, characterized in that The adversarial autoencoder AAE includes: an encoder E, a decoder De, a feature discriminator Dz, and a residual unit; Among them, the encoder E is used to map the hyperspectral image input into the adversarial autoencoder AAE to the hidden layer space to obtain the latent variable z; In the AAE encoding-decoding process, the reconstruction loss function uses huberloss; The feature discriminator Dz is used to constrain the data distribution of the latent variable z using the loss function Wgan-gp so that it satisfies the Gaussian distribution; Wherein, the loss function Wgan-gp is: in, is Gaussian sampling data; P gauss is the Gaussian distribution to which the Gaussian sampling data belongs; P E is the data distribution in the hidden space; represent Output result after Dz; Dz(z) represents the output result of the latent variable z through Dz; t is defined along P gauss and P E The straight line space P between the sampling point pairs t Uniform sampling of E[*] represents the mathematical expectation function; The decoder De is used to reconstruct the latent variable z to obtain the reconstructed image; The residual unit is used to obtain a residual image by performing a residual operation on the hyperspectral image and the reconstructed image in the input adversarial autoencoder AAE; in, Where X is the hyperspectral image input to the adversarial autoencoder AAE; To reconstruct the image; R is the residual image.
3. The method according to claim 2, characterized in that The S03 specifically includes: Inputting the residual image and the training data of the hyperspectral image into a self-attention mechanism module, the self-attention mechanism module adopts the self-attention mechanism to obtain the global correlation features of the training data of the hyperspectral image according to formula (1); The formula (1) is: Among them, Softmax() is a normalization method; g(X) is the characteristic representation function; is the Hadamard product of R and X; is the transpose of the Hadamard product of R and X; Then, a feature map Z containing the global correlation features is obtained according to the global correlation features and the residual connection; Where Z = W z Y+X; W z is the weight matrix of the residual connection.
4. The method according to claim 3, characterized in that The local feature extraction network consists of a two-dimensional convolution layer with a convolution kernel size of 1×1 and a three-dimensional convolution layer with a convolution kernel size of 3×3×3; The two-dimensional convolutional layer is used to extract the spectral features at each pixel position for the feature map Z containing the global correlation features; The three-dimensional convolution layer is used to extract spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image for the feature map Z containing the global correlation features.
5. The method according to claim 4, characterized in that The local features include: The two-dimensional convolution layer extracts the spectral features at each pixel position for the feature map Z containing the global correlation features; The three-dimensional convolution layer extracts spatial features of adjacent pixels in a 3×3×3 space in the hyperspectral image based on the feature map Z containing the global correlation features.
6. The method according to claim 5, characterized in that The anomaly detection network is used to output an anomaly score value for each pixel in the hyperspectral image based on the feature map of the input hyperspectral image; Among them, a i =ωx i c +b; a i is the abnormal score value of the i-th pixel in the hyperspectral image; ω is the weight parameter of the hyperplane learning layer; x i c is the vector at the i-th pixel point of the feature map of the hyperspectral image; b is the bias parameter of the hyperplane learning layer; ωx c +b=0 is the hyperplane represented by this layer.
7. The method according to claim 6, characterized in that The pre-set loss function is: Among them, L ocsvm is a pre-set loss function; v∈(0,1) is a parameter that balances maximizing the distance between the hyperplane and the origin and the number of data allowed to pass through the hyperplane; Ψ(*) represents the feature extraction network; N is the number of pixels in the hyperspectral image.
8. A computer device, characterized in that: comprising a memory, a processor and a bus, wherein the processor is connected to the memory via the bus; The memory is used to store a program, and the processor is used to run the program, wherein the hyperspectral anomaly detection method according to any one of claims 1 to 7 is executed when the program is run.
Citation Information
Patent Citations
Hyperspectral anomaly detection method and system based on manifold constraint self-coding network
CN110298235A
Hyperspectral image anomaly detection method
CN113111755A