Hyperspectral anomaly detection method and system based on global and local feature learning, and medium
By employing global and local feature learning methods, and utilizing convolutional layers, residual blocks, and graph convolutional modules to extract hyperspectral data features, this approach addresses the issue of background modeling in existing methods being unsuitable for different scenarios, thereby achieving high-precision anomaly detection.
Patent Information
- Application Number
- CN202411882606.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing hyperspectral anomaly detection methods struggle to effectively utilize local and global information from hyperspectral data during background modeling, and their parameter settings are not adapted to different scenarios, resulting in limited detection accuracy.
Two convolutional layers are used to extract latent features. Local features are obtained through residual blocks and convolution operations. Global features are obtained by combining graph convolution modules and global average pooling. Low-rank representation features are extracted through memory matrices. Finally, adaptive fusion is performed to obtain reconstructed hyperspectral data, and anomaly detection is performed using residual images.
It improves the precision and accuracy of anomaly detection, effectively mines the low-rank attributes of hyperspectral images, enhances the model's representation and generalization capabilities, and accurately locates anomalous regions.
Smart Images

Figure CN119919799B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of hyperspectral anomaly detection, and particularly relates to a hyperspectral anomaly detection method and system based on global and local feature learning and a medium. BACKGROUND
[0002] Hyperspectral image has rich spectral and spatial information, and each pixel has a continuous spectral curve. Based on this characteristic, hyperspectral image analysis can be widely applied to mineral search, environmental monitoring, and maritime search and rescue. Among them, hyperspectral anomaly target detection is a key technology, and the purpose is to find out the target with large difference from the surrounding environment by analyzing the given data. In the past few decades, researchers have proposed many anomaly detection methods, which can be divided into statistical-based methods, representation-based methods and deep learning-based methods.
[0003] Statistical modeling-based methods assume a distribution and then use distance metrics for anomaly detection. RX algorithm is a classical algorithm based on statistical model, which assumes that the background obeys multivariate normal distribution, and then calculates the Mahalanobis distance between each pixel and the background for anomaly detection. However, in actual scenarios, it is difficult to model complex backgrounds with a single distribution assumption, so the detection accuracy of such methods is usually limited.
[0004] Representation model-based algorithms use a set of bases or matrix decomposition for anomaly detection. CRD (Collaborative Representation-based Detector) algorithm represents the pixel to be detected by surrounding pixels, and then detects anomalies by representation error. LRASR (Low-Rank and Sparse Reconstruction) algorithm considers that the background has low rank, and the anomaly target is sparsely distributed in the background, and detects anomalies by low-rank representation model. However, representation-based algorithms need to manually set a large number of parameters, and the parameters often differ greatly for different scene data, so it is difficult to apply them to actual tasks.
[0005] Deep learning-based methods use deep networks to extract discriminative features or reconstruct the background for anomaly detection. Among them, autoencoder-based algorithms are the mainstream of such algorithms, and it is generally believed that the main feature learned in the network learning process is the background feature, so the anomaly target will have a larger reconstruction error. AuTo-AD algorithm does not effectively utilize the prior information of hyperspectral data, such as low rank, so there is room for improvement in detection performance. Therefore, when reconstructing the background based on deep learning algorithms, the local and global information of hyperspectral images is not fully exploited, and the prior characteristics of hyperspectral data are not considered. SUMMARY
[0006] Therefore, it is necessary to propose a hyperspectral anomaly detection method and system based on global and local feature learning and a storage medium in view of the above problems.
[0007] A hyperspectral anomaly detection method based on global and local feature learning, the method comprising:
[0008] Collecting hyperspectral data, extracting features of the hyperspectral data by using two convolutional layers, and obtaining latent layer features;
[0009] After the latent layer features pass through a convolutional layer, local features are extracted by two residual blocks and a convolution operation.
[0010] Global average pooling is performed on the latent layer features to obtain down-sampling features, and after a graph convolution module outputs features based on global information of the down-sampling features, global features are obtained by a convolutional layer and a skip connection operation.
[0011] Relevant features are obtained by a similarity matrix between the latent layer features and a memory matrix, and after linear transformation of the relevant features, the relevant features are multiplied by the latent layer features to obtain low-rank representation features.
[0012] The local features, the global features, and the low-rank representation features are adaptively fused to obtain fused features.
[0013] The fused features pass through a convolutional layer to obtain first layer output features, and then a convolution and batch normalization operation are performed on the first layer output features to obtain reconstructed hyperspectral data.
[0014] A residual image is determined according to a difference between the hyperspectral data and the reconstructed hyperspectral data, anomaly detection is performed on the residual image, and a final two-dimensional detection map is obtained.
[0015] The collecting of the hyperspectral data, the extraction of the features of the hyperspectral data by using two convolutional layers, and the obtaining of the latent layer features specifically comprise:
[0016] Collecting hyperspectral data, obtaining first features extracted by a first convolutional layer according to X1=LeakyReLu(BN(Conv 3×3 (x))), wherein X1 is the first features, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3×3 convolution operation, and X is the hyperspectral data.
[0017] Obtaining second features extracted by a second convolutional layer according to X e 2=LeakyReLu(BN(Conv3×3 (X1))) to obtain a latent feature of the first feature, wherein X e is the latent feature, Sigmoid(·) is a Sigmoid activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution, and X1 is the first feature.
[0018] The latent feature is extracted through two residual blocks and a convolution operation after passing through a convolution layer, and specifically includes:
[0019] The latent feature is extracted through X 1_1 = LeakyLeLu(BN((Conv 3×3 (X e ))) to obtain a second feature extracted by the convolution layer, wherein X 1_1 is the second feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, X e is the latent feature.
[0020] The local feature of the second feature is extracted through X l = Conv 3×3 (Res(Res(x l_1 )), wherein X l is the local feature, Conv 3×3 (·) is a 3*3 convolution operation, Res(·) is a residual block, and X 1_1 is the second feature.
[0021] The latent feature is subjected to a global average pooling operation to obtain a down-sampling feature, and after obtaining a graph convolution module output feature according to global information of the down-sampling feature, a global feature is obtained through a convolution layer and a skip connection operation, and specifically includes:
[0022] The latent feature is subjected to a global average pooling operation to obtain a down-sampling feature.
[0023] After the down-sampling feature is subjected to a tensor transformation operation, an adjacency matrix is obtained through matrix multiplication of the down-sampling feature.
[0024] An adaptive weight of the adjacency matrix is obtained by using an activation function, the adaptive weight is subjected to matrix multiplication with the down-sampling feature, and then added to the down-sampling feature, and a graph convolution module output feature is obtained through two linear layers.
[0025] The graph convolution module output feature is up-sampled to obtain an up-sampled feature, and the up-sampled feature is added to the graph convolution module output feature through a jump connection operation after passing through a convolution layer to obtain a global feature.
[0026] The up-sampling operation on the graph convolution module output feature to obtain the up-sampled feature, and the up-sampled feature is added to the graph convolution module output feature through a jump connection operation after passing through a convolution layer to obtain a global feature, specifically includes:
[0027] The graph convolution module output feature is up-sampled to obtain an up-sampled feature, and the up-sampled feature is added to the graph convolution module output feature through a jump connection operation after passing through a convolution layer to obtain a global feature. g = LeakyReLu(BN(Conv 1×1 (Up(X gcn )))) + X e Obtain a global feature, wherein X g is a global feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 1×1 is a 1x1 convolution operation, Up(·) is an up-sampling operation, X gcn is a graph convolution module output feature, and X e is a latent feature.
[0028] The related feature is linearly transformed and multiplied with the latent feature to obtain a low-rank representation feature, specifically including:
[0029] The latent feature is mapped into a vector through a global average pooling operation.
[0030] The vector is compressed through a linear layer.
[0031] The related feature is obtained according to the similarity matrix between the compressed vector and the memory matrix.
[0032] The related feature is linearly transformed through a linear layer and multiplied with the latent feature to obtain a low-rank representation feature.
[0033] The local feature, global feature and low-rank representation feature are adaptively fused to obtain a fusion feature, specifically including:
[0034] According to M' = Sigmoid(Spc(Spa(Conv 3×3 (X s )+X l +X gacquiring adaptive weights of the fusion feature, wherein M' is the adaptive weights of the fusion feature, Sigmoid(·) is a Sigmoid activation function, Spa(·) is a spatial attention module, Spc(·) is a spectral attention module, Conv 3×3 (·) is a 3*3 convolution operation, X s is a spectral low-rank feature, X l is a local feature, and X g is a global feature.
[0035] based on the adaptive weights of the fusion feature, adaptively fusing the local feature, the global feature and the low-rank representation feature according to X f = Conv 1×1 (X l ⊙M' + X g ⊙(1-M')) to obtain a fusion feature, wherein X f is the fusion feature, Conv 1×1 (·) is a 1*1 convolution operation, X l is a local feature, M' is the adaptive weights of the fusion feature, X g is a global feature.
[0036] wherein the fusion feature is subjected to a convolution layer to obtain first layer output features, and the first layer output features are subjected to convolution and batch normalization operation once to obtain reconstructed hyperspectral data, and the method specifically comprises:
[0037] the fusion feature is subjected to to obtain the first layer output features, wherein is the first layer output features, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, X f is the fusion feature.
[0038] the first layer output features are obtained according to , wherein is the reconstructed hyperspectral data, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, is the first layer output features.
[0039] A hyperspectral anomaly detection system for global and local feature learning, the system comprising:
[0040] a latent feature acquisition module configured to collect hyperspectral data, extract features from the hyperspectral data by using two convolution layers, and obtain latent features.
[0041] The local feature extraction module is configured to extract local features from the latent features through two residual blocks and a convolution operation after the latent features pass through a convolution layer.
[0042] The global feature acquisition module is configured to obtain down-sampling features by performing a global average pooling operation on the latent features, and obtain global features by performing a convolution layer and a skip connection operation on the graph convolution module output features obtained according to global information of the down-sampling features.
[0043] The low-rank representation feature acquisition module is configured to obtain relevant features by a similarity matrix between the latent features and a memory matrix, and obtain low-rank representation features by performing linear transformation on the relevant features and element multiplication with the latent features.
[0044] The fusion module is configured to adaptively fuse the local features, the global features and the low-rank representation features to obtain fusion features.
[0045] The reconstructed hyperspectral data acquisition module is configured to obtain first layer output features by performing a convolution layer on the fusion features, and obtain reconstructed hyperspectral data by performing a convolution and a batch normalization operation on the first layer output features.
[0046] The anomaly detection module is configured to determine a residual image according to a difference between the hyperspectral data and the reconstructed hyperspectral data, perform anomaly detection on the residual image, and obtain a final two-dimensional detection map.
[0047] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to make the processor perform the steps of the method.
[0048] The embodiment of the present application has the following beneficial effects:
[0049] The present application firstly extracts latent features of hyperspectral data through two convolution layers. Further, the local features are extracted from the latent features through two residual blocks and a convolution operation after the latent features pass through a convolution layer, wherein the residual blocks can retain the information of the latent features, and the convolution operation further extracts the local features, which helps to enhance the representation ability and generalization ability of the model.
[0050] Meanwhile, the global average pooling operation is performed on the latent features to obtain down-sampling features, the graph convolution module output features are obtained by the graph convolution module according to the global information of the down-sampling features, so as to improve the anomaly detection precision, and the global features are obtained by performing a convolution layer and a skip connection operation on the graph convolution module output features. The skip connection operation can retain the information of the input features, and the combination of the graph convolution module and the skip connection operation can more effectively extract the global features.
[0051] Meanwhile, the similarity matrix between the latent layer feature and the memory matrix can reflect the similarity between the latent layer feature and the memory matrix, so that the relevant feature is extracted, and the sensitivity of the model to the specific feature is enhanced. The relevant feature is linearly transformed to adjust the dimension and distribution of the feature, and then multiplied by the latent layer feature to fuse the information of the relevant feature and the latent layer feature, so as to obtain the low-rank representation feature, effectively mine the low-rank property of the hyperspectral image, and improve the accuracy of the background modeling.
[0052] Further, the local feature, the global feature and the low-rank representation feature are adaptively fused to obtain more comprehensive and accurate fused features. The fused features pass through a convolution layer to obtain first layer output features, and then the first layer output features are subjected to convolution and batch normalization operation to obtain reconstructed hyperspectral data. Finally, a residual image is determined according to the difference between the hyperspectral data and the reconstructed hyperspectral data, and the residual image can reflect the difference between the hyperspectral data and the reconstructed hyperspectral data, so as to highlight the abnormal area. Abnormal detection on the residual image can accurately locate the abnormal area to obtain a final two-dimensional detection map, improving the abnormal detection precision. BRIEF DESCRIPTION OF DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.
[0054] Among them:
[0055] Figure 1 A flowchart of an embodiment of a hyperspectral anomaly detection method provided by the present application for global and local feature learning;
[0056] Figure 2 A flowchart of another embodiment of a hyperspectral anomaly detection method provided by the present application for global and local feature learning;
[0057] Figure 3 A structural diagram of an embodiment of a hyperspectral anomaly detection system provided by the present application for global and local feature learning;
[0058] Figure 4 A structural diagram of an embodiment of a feature fusion module provided by the present application;
[0059] Figure 5 A structural diagram of an embodiment of a spatial attention module provided by the present application;
[0060] Figure 6A structural schematic diagram of an embodiment of the spectral attention module provided by the present application is shown in the figure.
[0061] Figure 7 A structural schematic diagram of another embodiment of the hyperspectral anomaly detection system provided by the present application is shown in the figure.
[0062] Figure 8 A structural schematic diagram of an embodiment of the medium provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be clearly and completely described with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0064] As shown in the figure, Figure 1 Figure 1 A flowchart of an embodiment of the hyperspectral anomaly detection method provided by the present application is shown in the figure. The hyperspectral anomaly detection method includes:
[0065] S101: Collect hyperspectral data, and use two convolution layers to extract features of the hyperspectral data to obtain latent features.
[0066] Exemplarily, the hyperspectral data is collected, and two convolution layers are used to extract features of the hyperspectral data to obtain latent features. Specifically, the first feature extracted by the first convolution layer is obtained according to the formula shown in the figure:
[0067] X1=·LeakyReLu(BN(Conv 3×3 (x)));
[0068] Wherein, X1 is the first feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3×3 convolution operation, and X is the hyperspectral data.
[0069] Further, the latent feature of the first feature is obtained according to the formula shown in the figure:
[0070] X e =Sigmoid(BN(Conv 3×3 ((X1)));
[0071] Wherein, X e Sigmoid(·) is a Sigmoid activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, and X1 is the first feature.
[0072] S102: After the latent feature passes through a convolution layer, local features are extracted through two residual blocks and a convolution operation.
[0073] By way of example, the second feature extracted by the convolution layer is obtained by the following formula:
[0074] X 1_1 = LeakyLeLu(BN((Conv 3×3 (x e ))));.
[0075] where X 1_1 is the second feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, and X e is the latent feature.
[0076] Further, the local features of the second feature are extracted by the following formula:
[0077] X l = Conv 3×3 (Res(Res(X l_1 ))
[0078] where X l is the local feature, Conv 3×3 (·) is a 3x3 convolution operation, Res(·) is a residual block, and X 1_1 is the second feature.
[0079] S103: The latent feature is subjected to a global average pooling operation to obtain a down-sampled feature. After obtaining the graph convolution module output feature according to the global information of the down-sampled feature, a global feature is obtained through a convolution layer and a skip connection operation.
[0080] By way of example, the latent feature is subjected to a global average pooling operation to obtain a down-sampled feature. After the down-sampled feature is subjected to a tensor transformation operation, an adjacency matrix is obtained through matrix multiplication of itself. An adaptive weight of the adjacency matrix is obtained using an activation function. After matrix multiplication of the adaptive weight and the down-sampled feature, the adaptive weight is added to the down-sampled feature. Then, a graph convolution module output feature is obtained through two linear layers.
[0081] Further, the output feature of the graph convolution module is up-sampled to obtain an up-sampled feature. After the up-sampled feature passes through a convolution layer, the latent feature is added to the output feature of the graph convolution module through a jump connection operation to obtain a global feature. Specifically, the global feature is obtained by the output feature of the graph convolution module through the following formula:
[0082] X g =LeakyReLu(BN(Conv 1×1 (Up(X gcn ))))+X e ;
[0083] wherein, X g is the global feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 1×1 is a 1x1 convolution operation, Up(·) is an up-sampling operation, X gcn is the output feature of the graph convolution module, and X e is the latent feature.
[0084] S104: Obtain a relevant feature between the latent feature and a similarity matrix of a memory matrix. After linear transformation of the relevant feature, the latent feature is multiplied by the relevant feature to obtain a low-rank representation feature.
[0085] For example, the latent feature is mapped into a vector through a global average pooling operation. The vector is compressed through a linear layer. The relevant feature is obtained according to the similarity matrix between the compressed vector and the memory matrix. After linear transformation of the relevant feature through a linear layer, the latent feature is multiplied by the relevant feature to obtain the low-rank representation feature.
[0086] S105: The local feature, the global feature, and the low-rank representation feature are adaptively fused to obtain a fusion feature.
[0087] For example, the adaptive weight of the fusion feature is obtained according to the following formula:
[0088] M' = Sigmoid(Spc(Spa(Conv 3×3 (X s )+X l +X g )));
[0089] wherein, M' is the adaptive weight of the fusion feature, used to adjust the proportion of the local branch and the global branch, Sigmoid(·) is a Sigmoid activation function, Spa(·) is a spatial attention module, Spc(·) is a spectral attention module, Conv 3×3 (·) is a 3x3 convolution operation, X sX is a low-rank feature of the spectrum l X is a local feature g X is a global feature
[0090] Further, based on the adaptive weight of the fusion feature, the local feature, the global feature and the low-rank representation feature are adaptively fused according to the formula shown below to obtain the fusion feature:
[0091] X f = Conv 1×1 (X l ⊙M‘+X g ⊙(1-M‘));
[0092] Wherein, X f is a fusion feature, Conv 1×1 is a 1x1 convolution operation, X l is a local feature, M' is an adaptive weight of the fusion feature, X g is a global feature.
[0093] S106: The fusion feature is subjected to a convolution layer to obtain first layer output feature, and the first layer output feature is subjected to convolution and batch normalization operation to obtain reconstructed hyperspectral data.
[0094] Exemplarily, the first layer output feature is obtained according to the formula shown below:
[0095]
[0096] Wherein, is a first layer output feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, X f is a fusion feature;
[0097] Further, the reconstructed hyperspectral data of the first layer output feature is obtained according to the formula shown below:
[0098]
[0099] Wherein, is a reconstructed hyperspectral data, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, is a first layer output feature.
[0100] S107: Determine the residual image according to the difference between the hyperspectral data and the reconstructed hyperspectral data, and perform anomaly detection on the residual image to obtain the final two-dimensional detection map.
[0101] Exemplarily, the Mahalanobis distance is used for anomaly detection on the residual image, as shown in the following formula:
[0102]
[0103] p i =(x i -μ)Γ -1 (x i -μ)
[0104] Wherein, X r is a residual image, μ is the mean of X r , Γ is the covariance matrix of X r , is the final two-dimensional detection map, x i is the i-th pixel in x r .
[0105] From the above description, it can be known that the present application firstly extracts the latent layer features of hyperspectral data step by step through two convolutional layers.Further, after the latent layer features pass through a convolutional layer, local features are extracted through two residual blocks and a convolution operation, wherein the residual blocks can retain the information of the latent layer features, and the convolution operation further extracts local features, which helps to enhance the representation ability and generalization ability of the model.
[0106] Meanwhile, the global average pooling operation is performed on the latent layer features to obtain down-sampling features, and the graph convolution module outputs features according to the global information of the down-sampling features, so as to improve the anomaly detection accuracy, and the graph convolution module output features pass through a convolutional layer and a skip connection operation to obtain global features. The skip connection operation can retain the information of the input features, and the combination of the graph convolution module and the skip connection operation can more effectively extract global features.
[0107] Meanwhile, the similarity matrix between the latent layer features and the memory matrix can reflect the similarity between the latent layer features and the memory matrix, so as to extract relevant features and enhance the sensitivity of the model to specific features. After linear transformation of the relevant features to adjust the dimension and distribution of the features, the relevant features and the latent layer features are multiplied to fuse the information of the relevant features and the latent layer features, so as to obtain low-rank representation features, effectively mine the low-rank properties of hyperspectral images, and improve the accuracy of background modeling.
[0108] Further, the local features, global features and low rank representation features are adaptively fused to obtain more comprehensive and accurate fusion features. The fusion features are subjected to a convolution layer to obtain first layer output features, and the first layer output features are subjected to convolution and batch normalization operation to obtain reconstructed hyperspectral data. Finally, a residual image is determined according to the difference between the hyperspectral data and the reconstructed hyperspectral data, and the residual image can reflect the difference between the hyperspectral data and the reconstructed hyperspectral data, thereby highlighting the abnormal area. Abnormal detection on the residual image can accurately locate the abnormal area to obtain a final two-dimensional detection map, thereby improving the abnormal detection accuracy.
[0109] As shown in Figure 2 , Figure 2 FIG. 1 is a flowchart of a global and local feature learning hyperspectral anomaly detection method according to an embodiment of the present application. The method comprises the following steps.
[0110] S201: Collecting hyperspectral data, and extracting features of the hyperspectral data by using two convolution layers to obtain latent features.
[0111] For example, referring to Figure 3 , Figure 3 FIG. 2 is a structure diagram of a global and local feature learning hyperspectral anomaly detection system according to an embodiment of the present application. The first feature extracted by the first convolution layer is obtained according to the following formula.
[0112] X1=LeakyReLu(BN(Conv 3×3 (X)));
[0113] wherein, is the first feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, is the hyperspectral data.
[0114] Further, the latent features of the first features are obtained according to the following formula.
[0115] X e =Sigmoid(BN(Conv 3×3 (X1)));
[0116] wherein, is the latent feature, Sigmoid(·) is a Sigmoid activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution, and X1 is the first feature.
[0117] S202: After the latent features pass through a convolutional layer, local features are extracted through two residual blocks and one convolutional operation.
[0118] For example, in conjunction with reference Figure 3 , First, the data passes through a convolutional layer (which includes a 3×3 convolution, a BN layer, and LeakyReLU). The second feature extracted by the convolutional layer is obtained using the formula shown below:
[0119] X 1_1 =LeakyLeLu(BN((Conv 3×3 (X e ))));
[0120] Among them, X 1_1 For the second feature, LeakyReLu(·) is the LeakyReLu activation function, BN(·) is the batch normalization operation, and Conv... 3×3 (·) represents a 3×3 convolution operation, X e This is a feature of the latent layer.
[0121] Furthermore, the second feature is processed through two residual blocks, and then subjected to a 3×3 convolution operation to obtain local features. The residual block consists of a 1×1 convolution operation, a BN layer, a LeakyReLU layer, and another 1×1 convolution operation. Skip connections are used to map the features. The local features of the second feature are extracted using the following formula:
[0122] X l =Conv 3×3 (Res(Res(X l_1 )));
[0123] in, For local features, Conv 3×3 (·) represents a 3×3 convolution operation, and Res(·) represents the residual block. This is the second characteristic.
[0124] S203: Perform global average pooling on the latent features to obtain downsampled features.
[0125] For example, in conjunction with reference Figure 3 characteristics of the deep layer First, perform global average pooling to obtain the downsampled feature X. avg ∈ (H / 2)×(W / 2)×48 As shown in the formula below:
[0126] X avg =GAP(X) e );
[0127] wherein GAP(·) is a global average pooling, X avg is a down-sampling feature, X e is a latent feature.
[0128] S204: After the tensor transformation operation of the down-sampling feature, the adjacency matrix is obtained through the matrix multiplication of the down-sampling feature itself.
[0129] Exemplarily, the graph convolution module is used for the down-sampling feature to capture global information. The down-sampling feature is first subjected to a Reshape operation, and then subjected to matrix multiplication to obtain an adjacency matrix, as shown in the following formula:
[0130]
[0131] wherein, is a down-sampling feature X avg is a feature after the Reshape operation, is an adjacency matrix, is a down-sampling feature X avg is a transpose quantity of the feature after the Reshape operation.
[0132] S205: The adaptive weight of the adjacency matrix is obtained by using an activation function, and the adaptive weight is subjected to matrix multiplication with the down-sampling feature, and then added to the down-sampling feature, and then the graph convolution module output feature is obtained through two linear layers.
[0133] Exemplarily, the Softmax activation function is used to obtain the adaptive weight, and the adaptive weight is multiplied with the down-sampling feature and then added. Finally, the graph convolution module output feature is obtained through two linear layers, as shown in the following formula:
[0134]
[0135] wherein X gcn is a graph convolution module output feature, and Softmax(·) are matrix multiplication and Softmax activation function respectively, and φ(·) is a linear layer, a normalization layer and a ReLu activation layer.
[0136] S206: The up-sampling operation is performed on the graph convolution module output feature to obtain an up-sampling feature, and the latent feature is added to the graph convolution module output feature through a jump connection operation after the up-sampling feature passes through a convolution layer, so as to obtain a global feature.
[0137] Exemplarily, the up-sampling operation is performed on the graph convolution module output feature, and then the latent feature is added to the graph convolution module output feature through a jump connection operation after the up-sampling feature passes through a convolution layer (the convolution layer includes a 1×1 convolution operation, a BN layer and a LeakyReLu activation function), so as to obtain a global feature The above process is represented as:
[0138] X g = LeakyReLu(BN(Conv 1×1 (Up(X gcn )))) + X e ;
[0139] wherein X g is a global feature, X gcn is a graph convolution module output feature, Conv 1×1 is a 1x1 convolution operation, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 1×1 is a 1x1 convolution operation, and Up(·) is an up-sampling operation. The present application uses a nearest neighbor difference value to perform up-sampling.
[0140] S207: Map the latent layer feature into a vector through a global average pooling operation.
[0141] Illustratively, the latent layer feature is first mapped into a vector Z through global average pooling as follows:
[0142] Z = GAP(X e );
[0143] wherein Z is a vector, GAP(·) is global average pooling, and X e is a latent layer feature.
[0144] S208: Compress the vector through a linear layer.
[0145] Illustratively, the vector Z is compressed through a linear layer to obtain a compressed vector Z' as follows:
[0146] Z' = φ(z);
[0147] wherein Z' is a compressed vector, φ(·) is a linear layer, a normalization layer, and a ReLu activation layer, and Z is a vector.
[0148] S209: Obtain a related feature according to a similarity matrix between the compressed vector and a memory matrix.
[0149] Illustratively, the similarity between the compressed vector Z' and the memory matrix is calculated, and a related feature Z'' is obtained using the similarity matrix as follows:
[0150]
[0151] Wherein, Z" is a relevant feature, M is a memory matrix, representing a recorded spectrum low-rank vector, Z' is a compressed vector, Softmax(·) is a Softmax activation function, is matrix multiplication.
[0152] S210: After linear transformation of the relevant features through a linear layer, element multiplication is performed with the latent layer features to obtain low-rank representation features.
[0153] Exemplarily, the vector obtained through the linear layer is output. Finally, the low-rank representation features X s are obtained through element multiplication.
[0154] X s =φ(Z″)⊙X e ;
[0155] Wherein, X s is a low-rank representation feature, φ(·) is a linear layer, a normalization layer and a ReLu activation layer, Z" is a relevant feature, X e is a latent layer feature, and is element multiplication.
[0156] S211: Self-adaptive fusion is performed on the local features, global features and low-rank representation features to obtain fused features.
[0157] Exemplarily, the feature fusion module under the guidance of the spectrum is used to perform self-adaptive fusion on the local features global features and low-rank representation features , and fused features are obtained.
[0158] Specifically, referring to Figure 3 , Figure 4 , Figure 4 is a structural schematic diagram of an embodiment of the feature fusion module provided by the application. First, 3x3 convolution is used to process X s , and then X l and X g are added. Next, the above results are sequentially sent to the spatial attention module and the spectral attention module to obtain adaptive weights of the fused features, and the above process is represented as:
[0159] M'=Sigmoid(Spc(Spa(Conv 3×3 (X s )+X l +X g )));
[0160] Where M' is the adaptive weight of the fused features, used to adjust the proportion of local and global branches, Sigmoid(·) is the Sigmoid activation function, Spa(·) is the spatial attention module, Spc(·) is the spectral attention module, and Conv 3×3 (·) represents a 3×3 convolution operation, X s As a low-rank spectral feature, X l For local features, X g This is a global feature.
[0161] Furthermore, by using adaptive weights and X respectively l and X g Multiply the results. Finally, use a 1×1 convolution operation to output the fused features. The above process can be represented as follows:
[0162] X f =Conv 1×1 (X l ⊙M'+X g ⊙(1-M'));
[0163] Among them, X f For fusion features, Conv 1×1 For a 1×1 convolution operation, X l X represents local features, X' represents the adaptive weights of the fused features, and X' represents the weights of the M' fusion features. g This is a global feature.
[0164] It should be noted that the spatial attention module, such as Figure 5 As shown, Figure 5 This is a schematic diagram of an embodiment of the spatial attention module provided by the present invention. The input features are subjected to average pooling and max pooling operations along the spectral direction, and then the two features are concatenated, followed by a 3×3 convolution operation and element-wise multiplied with the input.
[0165] Spectral attention module such as Figure 6 As shown, Figure 6 This is a schematic diagram of an embodiment of the spectral attention module provided by the present invention. The input features are subjected to average pooling and max pooling operations along the spatial direction, and then passed through a 1×1 convolution operation, a ReLU activation function, and another 1×1 convolution operation. Next, the two features are added together and passed through a 1×1 convolution operation, and finally multiplied element-wise with the input to obtain the output features.
[0166] S212: Pass the fused features through a convolutional layer to obtain the first layer output features, and then perform a convolution and batch normalization operation on the first layer output features to obtain the reconstructed hyperspectral data.
[0167] For example, fusion features After two convolutional layers, the reconstructed hyperspectral data is obtained The kernel size of the first layer and the second layer is 3x3, the first layer convolutional layer adopts LeakyReLu as the activation function, and the second layer convolutional layer directly outputs the reconstructed hyperspectral data after the batch normalization layer, and the above process is represented as:
[0168] wherein, is the reconstructed hyperspectral data, is the output feature of the first layer, LeakyReLu(·) is the LeakyReLu activation function, BN(·) is the batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, X f is the fusion feature, is the reconstructed hyperspectral data.
[0169] S213: Determine the residual image according to the difference between the hyperspectral data and the reconstructed hyperspectral data, perform anomaly detection on the residual image, and obtain the final two-dimensional detection map.
[0170] Exemplarily, the Mahalanobis distance is used to perform anomaly detection on the residual image, as shown in the following formula:
[0171] p i =(x i -μ)Γ -1 (x i -μ)
[0172] wherein, X r is the residual image, μ is the mean of X r , Γ is the covariance matrix of X r , and is the final two-dimensional detection map, x i is the i-th pixel in x r .
[0173] The effect of the present application is further described in combination with a simulation experiment as follows:
[0174] 1. Simulation conditions:
[0175] The hardware environment of the simulation experiment of the present application is Intel Core i5-12400 CPU, 16-GB random access memory (RAM), NVIDIA 3090 GPU and Microsoft Windows 10 operating system; the simulation software is MATLAB R2022a and Python 3.7.
[0176] 2. Experimental Content: To demonstrate the effectiveness of the hyperspectral anomaly detection method based on global and local feature learning, this invention uses three publicly available datasets to verify the algorithm's effectiveness and conducts simulation experiments. Table 1 shows the AUC values of different algorithms on the three datasets.
[0177] Table 1. AUC values of different algorithms on three datasets.
[0178] Algorithm First data set Second data set Third data set RX 0.8404 0.9526 0.9538 LRX 0.9722 0.9903 0.9597 CRD 0.9681 0.9445 0.9407 2S-GLRT 0.9873 0.9183 0.9868 AuTo-AD 0.8866 0.9820 0.9778 LREN 0.9548 0.8362 0.8868 GAED 0.9623 0.9691 0.9354 RGAE 0.7487 0.7502 0.9041 Algorithm of the invention 0.9891 0.9933 0.9977
[0179] Simulation experiments show that the present invention can achieve good detection results.
[0180] like Figure 7 As shown, Figure 7 This is a schematic diagram of another embodiment of a hyperspectral anomaly detection system based on global and local feature learning provided by the present invention. A hyperspectral anomaly detection system 10 based on global and local feature learning, the system comprising:
[0181] The latent layer feature acquisition module 11 is used to collect hyperspectral data and extract features from the hyperspectral data using two convolutional layers to obtain latent layer features.
[0182] The local feature extraction module 12 is used to extract local features after the latent features pass through a convolutional layer, through two residual blocks and one convolution operation.
[0183] The global feature acquisition module 13 is used to perform global average pooling on the latent features to obtain downsampled features. After obtaining the output features of the graph convolution module based on the global information of the downsampled features, the global features are obtained through a convolutional layer and skip connection operations.
[0184] The low-rank representation feature acquisition module 14 is used to obtain relevant features through the similarity matrix between the latent features and the memory matrix, and after linear transformation of the relevant features, element-wise multiplication with the latent features to obtain the low-rank representation features.
[0185] The fusion module 15 is used to adaptively fuse local features, global features, and low-rank representation features to obtain fused features.
[0186] The reconstructed hyperspectral data acquisition module 16 is used to pass the fused features through a convolutional layer to obtain the first layer output features, and then perform a convolution and batch normalization operation on the first layer output features to obtain the reconstructed hyperspectral data.
[0187] The anomaly detection module 17 is used to determine the residual image based on the difference between the hyperspectral data and the reconstructed hyperspectral data, perform anomaly detection on the residual image, and obtain the final two-dimensional detection image.
[0188] Exemplarily, in the latent feature acquisition module 11, hyperspectral data is collected, and a first feature extracted by a first convolutional layer is acquired according to X1=LeakyReLu(BN(Conv 3×3 ((X))) where X1 is the first feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, and X is the hyperspectral data.
[0189] A latent feature of the first feature is acquired according to X e =Sigmoid(BN(Conv 3×3 (X1))) where X e is the latent feature, Sigmoid(·) is a Sigmoid activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution, and X1 is the first feature.
[0190] In the local feature extraction module 12, the latent feature is used to acquire a second feature extracted by a convolutional layer through X 1_1 =LeakyLeLu(BN((Conv 3×3 (X e ))) where X 1_1 is the second feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3*3 convolution operation, and X e is the latent feature; and a local feature of the second feature is extracted through X l =Conv 3×3 (Res(Res(x l_1 ))) where X l is the local feature, Conv 3×3 (·) is a 3*3 convolution operation, Res(·) is a residual block, and X 1_1 is the second feature.
[0191] In the global feature acquisition module 13, a global average pooling operation is performed on the latent feature to obtain a down-sampling feature; after a tensor transformation operation is performed on the down-sampling feature, an adjacency matrix is acquired through matrix multiplication of the down-sampling feature itself; an adaptive weight of the adjacency matrix is acquired by using an activation function, the adaptive weight is multiplied with the down-sampling feature, and then added to the down-sampling feature, and a graph convolution module output feature is acquired through two linear layers; an up-sampling operation is performed on the graph convolution module output feature to obtain an up-sampling feature, and the latent feature is added to the graph convolution module output feature through a jump connection operation after the up-sampling feature passes through a convolutional layer, so as to acquire a global feature.
[0192] In the low-rank representation feature acquisition module 14, the latent layer feature is mapped into a vector through a global average pooling operation; the vector is compressed through a linear layer; relevant features are acquired according to a similarity matrix between the compressed vector and a memory matrix; and the relevant features are linearly transformed through a linear layer, and then multiplied with the latent layer feature to acquire low-rank representation features.
[0193] In the fusion module 15, adaptive weights of fusion features are acquired according to M' = Sigmoid (Spc (Spa (Conv 3×3 (X s )+X1+X g ))), wherein M' is the adaptive weights of the fusion features, Sigmoid(·) is a Sigmoid activation function, Spa(·) is a spatial attention module, Spc(·) is a spectral attention module, Conv 3×3 (·) is a 3 × 3 convolution operation, X s is a spectral low-rank feature, X l is a local feature, and X g is a global feature; based on the adaptive weights of the fusion features, the local feature, the global feature, and the low-rank representation feature are adaptively fused according to X f = Conv 1×1 (X l ⊙M' + X g ⊙(1-M')) to acquire fusion features, wherein X f is the fusion features, Conv 1×1 is a 1 × 1 convolution operation, X l is a local feature, M' is the adaptive weights of the fusion features, X g is a global feature.
[0194] In the reconstructed hyperspectral data acquisition module 16, the fusion features are acquired according to to acquire first layer output features, wherein is the first layer output features, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3 × 3 convolution operation, X f is the fusion features; and the reconstructed hyperspectral data of the first layer output features is acquired according to , wherein is the reconstructed hyperspectral data, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3 × 3 convolution operation, is the first layer output features.
[0195] In the anomaly detection module 17, a residual image is determined according to the difference between the hyperspectral data and the reconstructed hyperspectral data, anomaly detection is performed on the residual image, and a final two-dimensional detection image is obtained.
[0196] As Figure 8 shown, Figure 8 An embodiment of the medium provided by the application is shown in a structural diagram. The storage medium 20 stores at least one computer program 21, and the computer program 21 is executed by a processor to implement the method shown in Figure 1 、 Figure 2 The detailed method can be referred to the above, and will not be described here. In an embodiment, the storage medium 20 can be a storage chip, a hard disk or a mobile hard disk or an optical disc, or other readable and writable storage tools, and can also be a server and the like.
[0197] In addition, the processes depicted in the drawings do not necessarily have to be implemented in the specific order shown or in a continuous order to achieve the desired results. In some embodiments, multi-task processing and parallel processing are also possible or can be advantageous.
[0198] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the difference from other embodiments. Especially, the device, equipment and non-volatile computer readable storage medium embodiments are described relatively simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiment.
[0199] The device, equipment, non-volatile computer readable storage medium and method provided by the embodiments of the present application are corresponding, so the device, equipment and non-volatile computer storage medium also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding device, equipment and non-volatile computer storage medium will not be described here.
[0200] The system, device, module or unit described in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0201] For the sake of description, the above-described apparatus is described with various units in function for convenience. Of course, the functions of the units can be implemented in one or more software and / or hardware in implementing the specification. It is to be understood that the embodiments of the specification can be provided as a method, a system, or a computer program product. Therefore, the embodiments of the specification can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the specification can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
[0202] The specification is described with reference to flowcharts and / or block diagrams of methods, apparatus (system) and computer program products according to embodiments of the specification. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and combinations of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device that implements the flow Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flow or flows and / or block or blocks.
[0203] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction apparatus, which implements the flow Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flow or flows and / or block or blocks.
[0204] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the flow Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the functions specified in the flow or flows and / or block or blocks.
[0205] In a typical configuration, the computing device includes one or more processors (CPU), input / output interface, network interface, and memory.
[0206] Memory can include, without being limited to, non- transitory computer-readable media, random access memory (RAM), and / or read-only memory (ROM), such as flash memory, among others. Memory is an example of computer-readable media.
[0207] Computer-readable media includes permanent and non- permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules, or other data. Examples of computer-readable media include, without being limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disks (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. According to the definition provided herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves.
[0208] It is also important to note that the terms "comprises", "comprising", or other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0209] The description can be described in the general context of computer- executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. Computer-executable instructions, associated data structures, and program modules represent examples of the program code means for executing steps of the methods disclosed herein. The manner in which the computer-executable instructions are executed includes the use of a
[0210] The various embodiments in the specification are described in progressive manner, and the same or similar parts among the various embodiments can be mutually referred to, and each embodiment focuses on the difference from other embodiments. In particular, the system embodiments are described more simply because they are basically similar to the method embodiments, and the relevant parts can be referred to the part of the method embodiments.
[0211] The above only describes the preferred embodiments of the present application, and of course cannot limit the scope of the present application, and any equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A hyperspectral anomaly detection method of global and local feature learning, characterized in that, The method comprises: Collecting hyperspectral data, extracting features of the hyperspectral data by using two convolution layers, and obtaining latent layer features; After the latent layer features pass through a convolution layer, local features are extracted by two residual blocks and a convolution operation; Global average pooling is performed on the latent layer features to obtain down-sampling features, and global features are obtained by a convolution layer and a skip connection operation after the global information of the down-sampling features is obtained; Relevant features are obtained through a similarity matrix between the latent layer features and a memory matrix, the relevant features are linearly transformed, and then multiplied by the latent layer features to obtain low-rank representation features; The local features, global features and low-rank representation features are adaptively fused to obtain fused features; The fused features pass through a convolution layer to obtain first layer output features, and then a convolution and batch normalization operation is performed on the first layer output features to obtain reconstructed hyperspectral data; A residual image is determined according to the difference between the hyperspectral data and the reconstructed hyperspectral data, and anomaly detection is performed on the residual image to obtain a final two-dimensional detection map.
2. The method of claim 1, wherein, The method comprises: Collect hyperspectral data, according to X1=LeakvReLu(BN(Conv 3×3 (x))) to obtain the first feature extracted by the first convolutional layer, wherein X1 is the first feature, LeakvReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, and x is the hyperspectral data; According to X e = Sigmoid(BN(Com 3×3 (X1))) obtains the latent feature of the first feature, wherein X e is the latent feature, Sigmoid(·) is a Sigmoid activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution, and X1 is the first feature.
3. The method of claim 2, wherein, After the latent layer features pass through a convolution layer, local features are extracted by two residual blocks and a convolution operation; The latent feature is obtained by X 1_1 = LeakvLeLu(BN((Conv 3×3 (x e )))) where X 1_1 is the second feature, LeakvLeLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, and X e is the latent feature. By x l = Com 3×3 (Res(Res(X l_1 ))) extract local features of the second features, wherein x l is a local feature, Conv 3×3 (·) is a 3x3 convolution operation, Res(·) is a residual block, and X 1_1 is the second feature.
4. The method of claim 1, wherein, Global average pooling is performed on the latent layer features to obtain down-sampling features, and global features are obtained by a convolution layer and a skip connection operation after the global information of the down-sampling features is obtained; The latent layer features are subjected to a global average pooling operation to obtain down-sampling features; After the down-sampling features are subjected to a tensor transformation operation, an adjacency matrix is obtained by matrix multiplication of the down-sampling features themselves; An adaptive weight of the adjacency matrix is obtained by using an activation function, the adaptive weight is subjected to matrix multiplication with the down-sampling features, and then added to the down-sampling features, and a graph convolution module output feature is obtained by two linear layers; The graph convolution module output feature is subjected to an up-sampling operation to obtain an up-sampling feature, and the latent layer features are added to the graph convolution module output feature by a skip connection operation after the up-sampling feature passes through a convolution layer, to obtain global features.
5. The method of claim 4, wherein, The method comprises: The graph convolution module output feature passes through X g = LeakyReLu(BN(Conv 1×1 gcn )) + X e to obtain global features, wherein X g is the global feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 1×1 is a 1×1 convolution operation, Up(·) is an up-sampling operation, X gcn is a graph convolution module output feature, and X e is a latent layer feature. 6. The method of claim 1, wherein, The latent layer features are mapped into a vector by a global average pooling operation; The vector is compressed by a linear layer; Relevant features are obtained according to a similarity matrix between the compressed vector and a memory matrix; The low-rank representation feature is obtained by multiplying the relevant feature obtained by linear transformation of the relevant feature through a linear layer with the latent layer feature.
7. The method of claim 1, wherein, The adaptive fusion of the local feature, the global feature and the low-rank representation feature is used to obtain a fusion feature, and the fusion feature is obtained by: According to M'=Sigmoid(Spc(Spa(Conv 3×3 (X s )+X l +X g ))) to obtain adaptive weights of the fusion features, wherein M' is the adaptive weights of the fusion features, Sigmoid(·) is a Sigmoid activation function, Spa(·) is a spatial attention module, Spc(·) is a spectral attention module, Conv 3×3 (·) is a 3x3 convolution operation, X s is a spectral low-rank feature, X l is a local feature, and X g is a global feature; Based on the adaptive weight of the fusion feature, according to X f = Conv 1×1 (X l ⊙M‘+X g ⊙(1-M‘)) adaptively fuses the local feature, the global feature and the low-rank representation feature to obtain a fusion feature, wherein X f is the fusion feature, Conv 1×1 is a 1×1 convolution operation, X l is the local feature, M‘ is the adaptive weight of the fusion feature, X g is the global feature.
8. The method of claim 7, wherein, The first layer output feature is obtained by passing the fusion feature through a convolution layer, and the reconstructed hyperspectral data is obtained by performing convolution and batch normalization on the first layer output feature. The fusion feature is obtained according to obtaining a first layer output feature, wherein, for the first layer output feature, LeakyReLu(·) is a LeakyReLu activation function, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, X f is a fusion feature; According to reconstructed hyperspectral data of the first layer output features is obtained, wherein, for reconstructed hyperspectral data, BN(·) is a batch normalization operation, Conv 3×3 (·) is a 3x3 convolution operation, is the first layer output features.
9. A hyperspectral anomaly detection system based on global and local feature learning, the system comprising: a latent layer feature acquisition module configured to collect hyperspectral data, extract features from the hyperspectral data by using two convolution layers, and obtain a latent layer feature; a local feature extraction module configured to extract a local feature from the latent layer feature by using a convolution layer, two residual blocks and a convolution operation; a global feature acquisition module configured to perform a global average pooling operation on the latent layer feature to obtain a down-sampled feature, obtain a graph convolution module output feature based on global information of the down-sampled feature, and obtain a global feature by using a convolution layer and a skip connection operation; a low-rank representation feature acquisition module configured to obtain a relevant feature from a similarity matrix between the latent layer feature and a memory matrix, perform linear transformation on the relevant feature, multiply the relevant feature with the latent layer feature element by element, and obtain a low-rank representation feature; a fusion module configured to adaptively fuse the local feature, the global feature and the low-rank representation feature to obtain a fusion feature; a reconstructed hyperspectral data acquisition module configured to obtain a first layer output feature by passing the fusion feature through a convolution layer, and obtain reconstructed hyperspectral data by performing convolution and batch normalization on the first layer output feature; an anomaly detection module configured to determine a residual image based on a difference between the hyperspectral data and the reconstructed hyperspectral data, perform anomaly detection on the residual image, and obtain a final two-dimensional detection map.
10. A computer-readable storage medium storing a computer program, wherein the computer program is executed by a processor to cause the processor to perform the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Adaptive image steganalysis method and system based on deep convolutional neural network
CN111507884A
Hyperspectral remote sensing image anomaly detection method based on deep learning
CN117274800A