Hyperspectral anomaly detection method based on matching pursuit generative adversarial network
By using deep convolutional generative adversarial networks and matching pursuit algorithms in hyperspectral anomaly detection, the problems of reduced detection performance and insufficient feature extraction capabilities in traditional methods are solved, and more efficient anomaly detection results are achieved.
Patent Information
- Application Number
- CN202111305120.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-05
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2041-11-05
AI Technical Summary
The detection performance of traditional hyperspectral anomaly detection algorithms decreases when there is a lot of noise and irregular distribution of abnormal points. It also lacks prior information and insufficient feature extraction capabilities, resulting in poor detection results.
The deep convolutional generative adversarial network (DCGAN) and matching pursuit algorithm are used to enhance background prior information and feature extraction capabilities by generating pseudo-hyperspectral image data sets and extracting atomic spectrum vectors, reducing feature redundancy and improving detection accuracy.
It significantly improves the accuracy and anti-noise performance of hyperspectral anomaly detection, enhances feature extraction capabilities, reduces the amount of calculation, and improves the accuracy of the detection index AUC.
Smart Images

Figure CN114037842B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image processing, and in particular relates to a hyperspectral image anomaly detection method, which can be used for mineral exploration, environmental monitoring, disaster prediction, precision agriculture and national defense. Background Art
[0002] Hyperspectral images are high-dimensional images containing hundreds of spectral channels collected by spectral imagers. Therefore, each pixel is a continuous spectral curve, and specific bands can be selected or extracted as needed to highlight the target features. Due to its rich spectral, spatial and temporal information, hyperspectral images have been widely used in mineral exploration, environmental monitoring, disaster prediction and precision agriculture.
[0003] In anomaly detection data, the size of the abnormal target is significantly smaller than that of the background class. The abnormal target is usually some man-made camouflage and exists in the ground scene with a small probability. In the field of remote sensing, the abnormal target pixels usually have obvious spatial or spectral differences from the surrounding background pixels, and this spatial or spectral difference can be used for anomaly detection. The purpose of hyperspectral anomaly detection is to identify objects that are significantly different from their surrounding background in space or spectrum without any prior knowledge of the background and target. It has great application value in many aspects such as disaster prediction, environmental monitoring, urban traffic investigation and military camouflage target detection.
[0004] Traditional hyperspectral anomaly detection algorithms mainly include RX (Reed, Xiaoli Yu), KRX (Kernel Reed, Xiaoli Yu), LRX (Local Reed, Xiaoli Yu), and CRD (Collaborative Representation-based Detector). Among them, the RX algorithm is the most classic. It is a global anomaly detection algorithm. This method first calculates the mean vector and covariance matrix for all pixels in the image. In the process of calculating each pixel, the mean vector and covariance matrix are the same; then, a value is calculated for each pixel. The larger the value, the greater the possibility that this pixel is an abnormal pixel. Since the premise of the RX algorithm is to assume that the pixels of the hyperspectral image obey the Gaussian distribution, it will show poor results in some cases, and has poor anti-noise performance and lack of prior information. When the image is noisy and the distribution of abnormal points is irregular, the detection performance will decrease. At the same time, most traditional hyperspectral anomaly detection algorithms use artificially designed feature operators to extract feature information, but the artificially designed feature operators are insufficient in extracting feature information, and the extracted feature information is often insufficient and incomplete.
[0005] In order to solve the shortcomings of traditional algorithms, in order to better fully mine data features from raw data and reduce feature redundancy. In recent years, the use of convolutional neural network algorithms based on deep models for anomaly detection of hyperspectral images has received increasing attention. Hyperspectral anomaly detection methods based on deep models mainly include methods based on autoencoders and methods based on generative adversarial networks. Among them, the hyperspectral anomaly detection algorithm based on generative adversarial networks is the most commonly used. Generative adversarial networks are a generative model that includes a generator and a discriminator. The generator is used to generate pseudo samples similar to the distribution of training sample data, and the discriminator is used to distinguish the true and false of input data, that is, to distinguish whether the input data is training sample data or pseudo sample data generated by the generator. The generator and the discriminator compete with each other in an adversarial manner, so the generative adversarial network can fit the training sample data with a lower error and generate realistic pseudo sample data. Therefore, the generative adversarial network can be used for background pixel reconstruction of hyperspectral images to solve the problems of lack of prior information and insufficient information extraction ability in hyperspectral anomaly detection. Summary of the invention
[0006] The purpose of the present invention is to provide a hyperspectral anomaly detection method based on matching pursuit generative adversarial network to solve the problems of insufficient ability of existing technologies to extract feature information from hyperspectral images and lack of prior information for hyperspectral anomaly detection, and to improve the detection effect.
[0007] To achieve the above object, the technical solution of the present invention is implemented as follows:
[0008] (1) Obtain the background spectrum vector:
[0009] 1a) Normalize each hyperspectral image X with m rows, n columns and q channels in the hyperspectral anomaly dataset A, and use the KRX algorithm to calculate the pixel x of each normalized hyperspectral image X'. i The abnormal probability value of each pixel in each normalized hyperspectral image X' is obtained;
[0010] 1b) Arrange all elements in the abnormal probability matrix from small to large, and select the abnormal probability value corresponding to half of all elements as the background threshold H;
[0011] 1c) According to the background threshold H and the abnormal probability value of each pixel in the image, the abnormal probability value of the pixel of the normalized hyperspectral image X' is set to 1 or 0, that is, the abnormal probability value of the pixel in the normalized hyperspectral image X' is set to 1 if it is greater than the background threshold H, otherwise, it is set to 0, and the first 128-dimensional spectral vectors of the normalized hyperspectral image X', which are assumed to be labeled 0, are extracted to form a background spectral vector matrix;
[0012] (2) Generate pseudo hyperspectral image dataset B using the background spectral vector matrix:
[0013] 2a) Concatenate the background spectral vector matrices of the same type to obtain a large background spectral vector matrix of the same type, and randomly select 128 spectral vectors from the matrix to form a 128*128 image. Iterate 1000 times to obtain 1000 different 128*128 images.
[0014] 2b) The generated 1000 images of each type are used as the real training sample dataset of that type. 64 images are randomly selected from these 1000 images each time and input into the deep convolutional generative adversarial network DCGAN. The stochastic gradient descent method SGD is used to train them. The training is iterated for 2000 times. The final converged model is selected to generate a pseudo hyperspectral image dataset B. B is a 64*128*128 vector matrix, where B contains 64 images of the same type, and each image contains 128 128-dimensional spectral vectors.
[0015] (3) Calculate the residual matrix Z of the normalized hyperspectral image X′:
[0016] 3a) Compare each spectral vector in each normalized hyperspectral image X′ with each spectral vector in the vector matrix B, select the spectral vector that minimizes the residual of each spectral vector from B to form the vector matrix G, and subtract it from the corresponding hyperspectral image X′ to obtain the difference matrix Y, and calculate the mean vector μ1 of the difference matrix Y;
[0017] 3b) Subtract the mean vector μ1 from each pixel in the difference matrix Y to obtain a new difference matrix Y′, and perform a modulus-to-1 operation on each spectral vector in Y′ to obtain a normalized residual matrix Z of each hyperspectral image X′;
[0018] (4) Calculate the mean vector μ2 of the residual matrix Z of each normalized hyperspectral image X′, and perform matching pursuit between the mean vector μ2 and each spectral vector in the residual matrix Z to obtain the atomic spectral vector set U and inner product set V of Z:
[0019] U={u1,u2,...,u l , ..., u s},
[0020] V = {v1, v2, ..., v l , ..., v s},
[0021] Among them, u l represents the maximum spectral vector selected each time during the matching pursuit process, v lIt represents the maximum inner product value selected each time in the matching pursuit process, 1≤l≤s, s is the total number of selected atomic spectrum vectors;
[0022] (5) Use the atomic spectrum vector set U and the inner product set V to update each normalized hyperspectral image X′ to obtain the hyperspectral image P after matching pursuit processing. Each element in P is:
[0023] p i =x i -v1·u1-v2·u2-…-v s ·u s ,
[0024] Among them, x i represents each spectral vector in the normalized hyperspectral image X′, p i Represents the residual vector, 1≤i≤m*n.
[0025] (6) According to the residual vector p i , use the RX algorithm to calculate the mean vector μ3 and covariance matrix C3 of the hyperspectral image P after matching pursuit processing, and calculate the abnormal probability value E of each pixel in P based on μ3 and C3 i :
[0026] E i =(p i -μ3) T C3 -1 (p i -μ3)
[0027] Where T represents transpose;
[0028] (7) All E i Arrange from small to large, select The abnormal probability value at each position is used as the binarization threshold H1, and the abnormal probability value E of each spectral vector in P is i Compare with the binary threshold H1 to get the final anomaly detection result:
[0029] If E i ≥H i , then E i =1, indicating that the pixel is an abnormal pixel;
[0030] If E i <H i , then E i =0, indicating that the pixel is a background pixel.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] 1. The present invention adopts deep convolutional generative adversarial network DCGAN to extract background features. Compared with the method of using convolutional neural network to extract target features and background features at the same time, it increases background prior information and reduces feature redundancy problems. At the same time, it can fit the real training samples with a smaller error, so that the generated pseudo samples have a high degree of similarity with the real training samples, weaken the background, enhance the abnormal area, and can quickly and accurately detect the target in the abnormal area.
[0033] 2. The present invention utilizes a matching pursuit algorithm to extract abnormal target features from numerous features of abnormal images. Compared with the prior art method of obtaining abnormal targets by calculating abnormal probabilities using manually designed features, the present invention not only enhances the feature extraction capability, but also can quickly extract effective abnormal target features from abnormal images, thereby reducing feature redundancy and the amount of calculation, and improving the accuracy of the detection index AUC. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flowchart of the implementation process of the present invention.
[0035] Figure 2 The figures are the anomaly detection results on five different images using the present invention and four existing methods. DETAILED DESCRIPTION
[0036] In order to make the purpose and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0037] Reference Figure 1 The invention discloses a hyperspectral anomaly detection method based on matching pursuit generative adversarial network, comprising the following steps:
[0038] Step 1: Normalize the hyperspectral image X.
[0039] Assume that the number of rows of the hyperspectral image X is m, the number of columns is n, the number of spectral channels is q, each pixel is a spectral curve of length q, and the total number of pixels in the hyperspectral image is: M = m × n.
[0040] Since hyperspectral images not only have a large number of bands, but also the values in each band are different from the values of ordinary images in the range of 0 to 255. The values of hyperspectral images are negative and there are also positive numbers of thousands. Therefore, it is necessary to normalize the values of hyperspectral images to 0 to 255.
[0041] This step considers the band from the perspective of the image, for the image with a spectral dimension greater than 128, extract the information of the first 128 dimensions of each hyperspectral image; for the image with a spectral dimension less than 128, select the information of all dimensions to find the information of each pixel x in the hyperspectral image X. i The maximum value x max and the minimum value x min , and finally apply the formula: The normalized hyperspectral image X′ is obtained.
[0042] Step 2: Apply the KRX algorithm to calculate the abnormal probability value of each pixel in the normalized hyperspectral image X′ and obtain the abnormal probability matrix.
[0043] The RX detection algorithm assumes that the image obeys the Gaussian distribution. However, in real applications, many hyperspectral images do not completely obey the Gaussian distribution, or do not obey the Gaussian distribution. For such images, the detection effect of the RX algorithm is poor. In order to solve this problem, the KRX algorithm is used to transform the original data by increasing the dimension using its kernel function. In the process of transformation, the KRX algorithm can make full use of the relationship between each pixel, expand the data information, and make the hyperspectral data content richer. The algorithm is stable and performs well on most data sets. This step uses the KRX algorithm to obtain the assumed label of the hyperspectral image, which is implemented as follows:
[0044] 2.1) Calculate the mean vector μ of the normalized hyperspectral image X′ bφ and the covariance matrix C bφ , the formula is as follows:
[0045]
[0046]
[0047] in, is the pixel spectrum vector mapped to the high-dimensional feature space through nonlinear mapping, and T is the transpose;
[0048] 2.2) Using the mean vector μ bφ and the covariance matrix C bφ Calculate each pixel x i The abnormal probability value
[0049]
[0050] in, is the pixel spectrum vector that is mapped to the high-dimensional feature space through nonlinear mapping;
[0051] 2.3) Arrange the abnormal probability value of each pixel according to the corresponding pixel position to obtain the abnormal probability matrix of the normalized hyperspectral image X′.
[0052] Step 3: Select background spectrum vectors to form a background spectrum vector matrix.
[0053] 3.1) Select the background threshold H, that is, arrange all elements in the abnormal probability matrix from small to large, and select the abnormal probability value corresponding to half of all elements as the background threshold H;
[0054] 3.2) The pixel abnormal probability value in the normalized hyperspectral image data X′ Compared with the background threshold H, the abnormal probability value of the pixel of the normalized hyperspectral image X′ is set to 1 or 0 to obtain the assumed label of the normalized hyperspectral image X′:
[0055] if but
[0056] if but
[0057] 3.3) Extract the first 128-dimensional spectral vectors of the normalized hyperspectral image X′ with the assumed label of 0 to form a background spectral vector matrix. The number of rows of the spectral vector matrix is the number of selected background spectral vectors, and the number of columns is the dimension of the spectral vector.
[0058] Step 4: Create a real training sample dataset.
[0059] There are three technical solutions for making real training sample data sets: one is to make their own data sets for each hyperspectral image; the second is to make their own data sets for each type of hyperspectral image; the third is to mix all hyperspectral images together to make a data set. This example adopts but is not limited to the second solution, which is implemented as follows:
[0060] 4.1) Concatenate the background spectrum vector matrices of the same type in step 3 to obtain a large background spectrum vector matrix of the same type;
[0061] 4.2) Randomly select 128 spectral vectors from the large background spectral vector matrix to form a 128*128 size picture, repeat 1000 times to obtain 1000 pictures, and use these 1000 pictures as the real training sample data set of this type.
[0062] Step 5: Create a pseudo hyperspectral image dataset B.
[0063] 5.1) Select 1000 pictures of the same type from the real training sample data set, and randomly select 64 pictures from these 1000 pictures each time and input them into the deep convolutional generative adversarial network DCGAN. The DCGAN network consists of two parts: the generator and the discriminator. Both the generator and the discriminator are stacked modules consisting of a convolutional layer with a convolution kernel size of 5*5 and a stride of 2, a batch normalization BN layer, and a leaky Relu activation function;
[0064] 5.2) Use stochastic gradient descent method SGD to train the DCGAN network:
[0065] 5.2a) Update the parameters of the generator
[0066] First, fix the parameters of the discriminator, input Gaussian noise into the generator, use the generator in the DCGAN network to generate 64 pseudo samples with 128 rows, 128 columns, and 1 spectral channel, and select 64 of the 1000 randomly generated pictures of the same type in step 4.1) as real training samples;
[0067] Then, the pseudo sample and the real training sample are input into the DCGAN discriminator, and the probability value of the pseudo sample being the real image is output, the probability value range is 0-1, and the loss function L of the generator is used. G , use the stochastic gradient descent method SGD to calculate the gradient, and use the back propagation algorithm to update the parameters of the generator, L G The formula is:
[0068] L G =E z~p(z) (-D(G(z)))
[0069] Where z represents random Gaussian noise, p(z) represents the data distribution of z, G(z) represents the pseudo sample generated by the generator network, and D(G(z)) represents the probability of the discriminator network judging whether the generated data is real. If the data distribution of the pseudo sample and the real training sample are close, the probability value is close to 1, indicating that the generated pseudo sample is more real. On the contrary, if the data distribution of the pseudo sample and the real training sample is very different, the probability value is close to 0, indicating that the generated pseudo sample is less real.
[0070] 5.2b) Update the parameters of the discriminator
[0071] First, fix the generator parameters in 5.2a), input the pseudo samples generated in 5.2a) and the real training samples into the DCGAN discriminator, output the probability value of the pseudo sample being a real image, the probability value range is 0-1, and use the discriminator's loss function L D, use the stochastic gradient descent method SGD to calculate the gradient, use the back propagation algorithm to update the parameters of the discriminator, and repeat the above process 5 times, where L D =E x~p(x) (-D(x))+E z~p(z) (D(G(z))), z and x represent random Gaussian noise and real samples, p(z) and p(x) represent the data distribution of z and real samples, G(z) represents the pseudo samples generated by the generator network, and D(x) and D(G(z)) represent the probabilities of the discriminator network judging whether the real data and pseudo samples are real;
[0072] 5.2c) Repeat 5.2a) and 5.2b) 2000 times to complete the training of the deep convolutional generative adversarial network DCGAN, and obtain the trained DCGAN model and generated images;
[0073] 5.3) Select the best converged model from the trained DCGAN models, and use the pictures generated by it as the pseudo hyperspectral image dataset B, where B contains 64 pictures of the same type, each picture contains 128 128-dimensional spectral vectors, that is, B is a 64*128*128 vector matrix.
[0074] Step 6: Calculate the residual matrix Z of the normalized hyperspectral image X′.
[0075] 6.1) Each spectral vector x in the normalized hyperspectral image X′ i Compare the difference with each spectral vector in the vector matrix B, and select from B such that each spectral vector x i The spectrum vector G(x) with the smallest residual imin ), and then subtract it from the corresponding hyperspectral image X′ to obtain the difference matrix Y, where the i-th spectral vector y in the difference matrix Y is i The formula is as follows:
[0076] y i =x i -G(x imin )
[0077] 6.2) Calculate the mean vector μ1 of the difference matrix Y;
[0078]
[0079] Among them, y i is the i-th spectral vector in the difference matrix Y, 1≤i≤M, M=m*n;
[0080] 6.3) Subtract the mean vector μ1 from each spectral vector in the difference matrix Y to obtain a new difference matrix Y′;
[0081] yi ′=y i -μ1
[0082] Among them, y i ′ is represented by the values of q spectral dimensions as y i ′={c1,c2,…,c j , …, c q}, c j Denote each spectral vector y in the new difference matrix Y′ i ′ is the value of the jth dimension in , and q represents the number of spectral dimensions;
[0083] 6.4) For each spectral vector y′ in the new difference matrix Y′ i , perform the modulus conversion to 1 and obtain the normalized residual matrix Z of the hyperspectral image X′, where the i-th spectral vector of the residual matrix Z is represented by z i , z i The value of the jth dimension of is d j ;
[0084] z i ={d1, d2, ..., d j , …, d q}
[0085]
[0086]
[0087] Among them, L i is the i-th spectral vector y in the new difference matrix Y′ i The modulus value of ′.
[0088] Step 7: Use matching pursuit on the residual matrix Z of the normalized hyperspectral image X′.
[0089] 7.1) Set the modulus threshold H2 of the spectral vector as the condition for stopping the update of the spectral vector in matching pursuit. In this example, the modulus threshold H2 is set to 0.5;
[0090] 7.2) Calculate the mean vector μ2 for the residual matrix Z:
[0091]
[0092] Among them, z i Represents the i-th spectral vector in the residual matrix Z of the normalized hyperspectral image X′, 1≤i≤M, M=m*n:
[0093] 7.3) Traverse all spectral vectors z in the residual matrix Z i , and do the inner product with the mean vector μ2 to get the spectrum vector zi The corresponding value w i :
[0094] w i =z i μ2 T
[0095] Where T represents transpose;
[0096] 7.4) Select the spectral vector z that maximizes the inner product from the residual matrix Z imax , calculate the residual vector Rf, Rf = z i -w i × imax , and replace the original spectral vector z with the obtained residual vector Rf i , to update the spectrum vector;
[0097] 7.5) At the beginning of the next iteration, the spectral vector with the largest inner product with the residual vector Rf is found among the remaining spectral vectors, and 7.2)-7.4) are repeated until the modulus of Rf is less than the set modulus threshold H2, and the atomic spectral vector set U and inner product set V of Z are obtained:
[0098] U={u1,u2,...,u l , ..., u s}
[0099] V = {v1, v2, ..., v l , ..., v s}
[0100] Among them, u l represents the maximum spectral vector selected each time during the matching pursuit process, v l It represents the maximum inner product value selected each time in the matching pursuit process, 1≤l≤s, s is the total number of selected atomic spectrum vectors;
[0101] 7.6) Use the atomic spectral vector set U and the inner product set V to update each hyperspectral image X′ to obtain a hyperspectral image P after matching pursuit processing, where each element p in P i for:
[0102] p i =x i -v1·u1-v2·u2-…-v s ·u s
[0103] Among them, x i Represents each spectral vector in each hyperspectral image X′, p iRepresents the i-th residual vector in the hyperspectral image P after matching pursuit processing, 1≤i≤m*n.
[0104] Step 8: Use the RX algorithm to calculate the abnormal probability value of each pixel in the hyperspectral image P, compare it with the binarization threshold H1, and obtain the final anomaly detection result.
[0105] 8.1) According to the residual vector p i , calculate the mean vector μ3 of the hyperspectral image P,
[0106]
[0107] 8.2) According to the residual vector p i And the mean vector μ3, calculate the covariance matrix C3 of the hyperspectral image P:
[0108]
[0109] Where T represents transpose;
[0110] 8.3) Calculate the abnormal probability value E of each pixel in the hyperspectral image P based on the mean vector μ3 and the covariance matrix C3 i :
[0111] E i =(p i -μ3) T C3 -1 (p i -μ3);
[0112] 8.4) Set all abnormal probability values E i Arrange from small to large, select The abnormal probability value at each position is used as the binarization threshold H1, and the abnormal probability value E of each spectral vector in the hyperspectral image P is i Compare with the binarization threshold H1:
[0113] If E i ≥H1, then E i =1, indicating that the pixel is an abnormal pixel;
[0114] If E i i =0, indicating that the pixel is a background pixel;
[0115] At this point, the final anomaly detection result is obtained.
[0116] The effect of the present invention can be further illustrated by the following simulation experiment:
[0117] 1. Experimental Dataset
[0118] The ABU dataset is used as the dataset for hyperspectral anomaly detection. The ABU dataset is divided into three scene types: urban, beach, and airport. There are 5 hyperspectral images for urban scenes, 4 hyperspectral images for beach scenes, and 4 hyperspectral images for airport scenes. The size of each image and the number of spectral bands are shown in Table 1.
[0119] The measurement indicator of the hyperspectral anomaly detection result is the AUC (Area Under Curve) value. The AUC value is defined as the area enclosed by the ROC curve and the coordinate axis, and the AUC value range is between 0 and 1. The closer the AUC value is to 1, the higher the authenticity of the detection method; conversely, the lower the authenticity of the detection method.
[0120] Table 1. Hyperspectral image data parameters
[0121]
[0122]
[0123] 2. Simulation Experiment Content
[0124] Simulation experiment 1: Under the same experimental conditions, this method and four existing technologies: RX, KRX, LRX, CRD, are used to perform experimental verification on the ABU dataset, and the area AUC value and average AUC value under the ROC curve and the coordinate axis are calculated. The results are shown in Table 2.
[0125] Table 2. AUC values of each algorithm on the ABU dataset
[0126] Dataset RX KRX LRX CRD The present invention urban1 0.99068 0.98181 0.98013 0.98885 0.99502 urban2 0.99464 0.98016 0.94706 0.90645 0.99935 urban3 0.95242 0.93676 0.94726 0.96008 0.97223 urban4 0.98869 0.96898 0.95938 0.92703 0.99523 urban5 0.9694 0.96939 0.93383 0.93463 0.97257 beach1 0.98188 0.98256 0.97268 0.99044 0.98905 beach2 0.91044 0.91683 0.89812 0.9155 0.93633 beach3 0.99985 0.99608 0.98973 0.99942 0.99996 beach4 0.95378 0.9787 0.97113 0.93552 0.97800 airport1 0.82198 0.94432 0.88994 0.9164 0.91415 airport2 0.84142 0.9754 0.90564 0.78594 0.9494 airport3 0.92876 0.93761 0.83916 0.92361 0.94701 airport4 0.95255 0.98959 0.90017 0.80127 0.98281 average value 0.955115 0.966015 0.933402 0.921934 0.971622
[0127] It can be seen from Table 2 that the AUC values of the method of the present invention on most hyperspectral images in the ABU dataset are higher than the AUC values of the four prior arts RX, KRX, LRX and CRD on these hyperspectral images, and the average AUC value on the entire ABU dataset exceeds that of the four prior arts RX, KRX, LRX and CRD, achieving the best effect.
[0128] Simulation experiment 2: Randomly select several hyperspectral images of different types from the ABU dataset, and use this method and four existing technologies: RX, KRX, LRX and CRD, under the same experimental conditions, to perform anomaly detection on these images. This example selects five hyperspectral images of airport1, airport2, airport4, beach2, and urban3. The anomaly detection results of various methods on these five hyperspectral images are shown in the following figure. Figure 2 As shown, where:
[0129] Figure 2 Column (a) is five hyperspectral images to be detected, column (b) is the true labels of the five hyperspectral images, column (c) is the anomaly detection result diagram using the RX algorithm on the five hyperspectral images, column (d) is the anomaly detection result diagram using the KRX algorithm on the five hyperspectral images, column (e) is the anomaly detection result diagram using the LRX algorithm on the five hyperspectral images, column (f) is the anomaly detection result diagram using the CRD algorithm on the five hyperspectral images, and column (g) is the anomaly detection result diagram using the method of the present invention on the five hyperspectral images.
[0130] from Figure 2 It can be seen that compared with the other four existing technologies, the detection effect of the method of the present invention on abnormal targets is more significant and accurate, and has stable performance.
[0131] The above description is only a specific example of the present invention and does not constitute any limitation to the present invention. It is obvious that for professionals in this field, after understanding the content and principles of the present invention, it is possible to make various modifications and changes in form and details without departing from the principles and structures of the present invention. However, these modifications and changes based on the ideas of the present invention are still within the scope of protection of the claims of the present invention.
Claims
1. A hyperspectral anomaly detection method based on matching pursuit generative adversarial network, characterized in that: include: (1) Obtain the background spectrum vector: 1a) Each hyperspectral image X with m rows, n columns and q channels in the hyperspectral anomaly dataset A is normalized, and the KRX algorithm is used to calculate the pixel x of each normalized hyperspectral image X′. i The abnormal probability value of each pixel in each normalized hyperspectral image X′ is obtained; 1b) Arrange all elements in the abnormal probability matrix from small to large, and select the abnormal probability value corresponding to half of all elements as the background threshold H; 1c) According to the background threshold H and the abnormal probability value of each pixel in the image, the abnormal probability value of the pixel in the normalized hyperspectral image X′ is set to 1 or 0, that is, the abnormal probability value of the pixel in the normalized hyperspectral image X′ is set to 1 if it is greater than the background threshold H, otherwise, it is set to 0, and the first 128-dimensional spectral vectors of the normalized hyperspectral image X′ with the assumed label of 0 are extracted to form a background spectral vector matrix; (2) Generate pseudo hyperspectral image dataset B using the background spectral vector matrix: 2a) Concatenate the background spectral vector matrices of the same type to obtain a large background spectral vector matrix of the same type, and randomly select 128 spectral vectors from the matrix to form a 128*128 image. Iterate 1000 times to obtain 1000 different 128*128 images. 2b) The generated 1000 images of each type are used as the real training sample dataset of that type. 64 images are randomly selected from these 1000 images each time and input into the deep convolutional generative adversarial network DCGAN. The stochastic gradient descent method SGD is used to train them. The training is iterated for 2000 times. The final converged model is selected to generate a pseudo hyperspectral image dataset B. B is a 64*128*128 vector matrix, where B contains 64 images of the same type, and each image contains 128 128-dimensional spectral vectors. (3) Calculate the residual matrix Z of the normalized hyperspectral image X′: 3a) Compare each spectral vector in each normalized hyperspectral image X′ with each spectral vector in the vector matrix B, select the spectral vector that minimizes the residual of each spectral vector from B to form the vector matrix G, and subtract it from the corresponding hyperspectral image X′ to obtain the difference matrix Y, and calculate the mean vector μ1 of the difference matrix Y; 3b) Subtract the mean vector μ1 from each pixel in the difference matrix Y to obtain a new difference matrix Y′, and perform a modulus-to-1 operation on each spectral vector in Y′ to obtain a normalized residual matrix Z of each hyperspectral image X′; (4) Calculate the mean vector μ2 of the residual matrix Z of each normalized hyperspectral image X′, and perform matching pursuit between the mean vector μ2 and each spectral vector in the residual matrix Z to obtain the atomic spectral vector set U and inner product set V of Z: U={u1,u2,...,u l ,...,u s } V={v1,v2,...,v l ,...,v s }, Among them, u l represents the maximum spectral vector selected each time during the matching pursuit process, v l It represents the maximum inner product value selected each time in the matching pursuit process, 1≤l≤s, s is the total number of selected atomic spectrum vectors; (5) Use the atomic spectrum vector set U and the inner product set V to update each normalized hyperspectral image X′ to obtain the hyperspectral image P after matching pursuit processing. Each element in P is: p i =x i -v1·u1-v2·u2-…-v s ·she is s , Among them, x i represents each spectral vector in the normalized hyperspectral image X′, p i Represents the residual vector, 1≤i≤m*n; (6) According to the residual vector p i , use the RX algorithm to calculate the mean vector μ3 and covariance matrix C3 of the hyperspectral image P after matching pursuit processing, and calculate the abnormal probability value E of each pixel in P based on μ3 and C3 i : E i =(p i -μ3) T C3 -1 (p i -μ3) Where T represents transpose; (7) All E i Arrange from small to large, select The abnormal probability value at each position is used as the binarization threshold H1, and the abnormal probability value E of each spectral vector in P is i Compare with the binary threshold H1 to get the final anomaly detection result: If E i ≥H i , then E i =1, indicating that the pixel is an abnormal pixel; If E i <H i , then E i =0, indicating that the pixel is a background pixel.
2. The method according to claim 1, wherein: In 1a), the KRX algorithm is used to calculate the value of each pixel x in each normalized hyperspectral image X′. i The abnormal probability value is as follows: in, Represents each pixel x i The abnormal probability value at is the pixel spectrum vector that is nonlinearly mapped to the high-dimensional feature space. and are the spectral vector mean and covariance matrix of the high-dimensional feature space respectively, and T is the transpose.
3. The method according to claim 1, wherein: In 2b), the stochastic gradient descent method SGD is used to train the deep convolutional generative adversarial network DCGAN, which is implemented as follows: 2b1) Update the parameters of the generator First, the parameters of the discriminator are fixed, and the generator in the DCGAN network is used to generate 64 pseudo samples with 128 rows, 128 columns, and 1 spectral channel. 64 images of the same type randomly generated in 2a) are selected as real training samples; Then, the pseudo sample and the real training sample are input into the DCGAN discriminator, and the probability value of the pseudo sample being the real image is output, the probability value range is 0-1, and the loss function L of the generator is used. G , use the stochastic gradient descent method SGD to calculate the gradient, and use the back propagation algorithm to update the parameters of the generator, L G The formula is: L G =E z~p(z) (-D(G(z))) Where z represents random Gaussian noise, p(z) represents the data distribution of z, G(z) represents the pseudo sample generated by the generator network, and D(G(z)) represents the probability of the discriminator network judging whether the generated data is real. If the data distribution of the pseudo sample and the real training sample are close, the probability value is close to 1, indicating that the generated pseudo sample is more real. On the contrary, if the data distribution of the pseudo sample and the real training sample is very different, the probability value is close to 0, indicating that the generated pseudo sample is less real. 2b2) Update the parameters of the discriminator First, fix the generator parameters in 2b1), input the pseudo samples and real samples generated in 2b1) into the DCGAN discriminator, output the probability value of the pseudo sample being a real image, the probability value range is 0-1, and use the loss function L of the discriminator D , use the stochastic gradient descent method SGD to calculate the gradient, use the back propagation algorithm to update the parameters of the discriminator, and repeat the above process 5 times, where L D =E x~p(x) (-D(x))+E z~p(z) (D(G(z))), z and x represent random Gaussian noise and real samples, p(z) and p(x) represent the data distribution of z and real samples, G(z) represents the pseudo samples generated by the generator network, and D(x) and D(G(z)) represent the probabilities of the discriminator network judging whether the real data and pseudo samples are real; 2b3) Repeat 2b1) and 2b2) 2000 times to complete the training of the deep convolutional generative adversarial network DCGAN.
4. The method according to claim 1, wherein: 3a) The mean vector μ1 of the difference matrix Y is calculated as follows: Among them, y i is the i-th spectral vector in the difference matrix Y, 1≤i≤M, M=m*n.
5. The method according to claim 1, wherein: (4) calculates the mean vector μ2 of the residual matrix Z of each normalized hyperspectral image X′, and the formula is as follows: Among them, z i represents the i-th spectral vector in the residual matrix Z of the normalized hyperspectral image X′, 1≤i≤M, M=m*n.
6. The method according to claim 1, wherein: In (4), the mean vector μ2 is matched with each spectral vector in the residual matrix Z to achieve the following: 4a) Traverse all spectral vectors z in the residual matrix Z i , and do the inner product with the mean vector μ2 to get the spectrum vector z i The corresponding value w i : wi=z i ·µ2 T Where T represents transpose, 1≤i≤m*n; 4b) Select the spectral vector z that maximizes the inner product from the residual matrix Z imax , calculate the residual vector Rf; Rf=z i -w i ×z imax Where Rf represents the residual vector; 4c) At the beginning of the next iteration, the spectral vector with the largest inner product with the residual vector Rf is searched among the remaining spectral vectors, and 4a) and 4b) are repeated until the modulus of Rf is less than the set modulus threshold H2.
7. The method according to claim 1, wherein: (6) The RX algorithm is used to calculate the mean vector μ3 and covariance matrix C3 of the hyperspectral image P after matching pursuit processing. The formula is as follows: Wherein, pi represents the i-th spectral vector in the hyperspectral image P after matching pursuit processing, 1≤i≤M, M=m*n.
