Hyperspectral image anomaly detection method and device, terminal and medium

By applying low rank and sparse constraints to hyperspectral image data, separation of background and abnormal tensors, the problem of poor detection effect in the prior art is solved, and the accuracy and success rate of abnormal detection are improved.

CN119090815AActive Publication Date: 2024-12-06SUN YAT SEN UNIV

Patent Information

Application Number
CN202411084379.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-12-06
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

The existing hyperspectral image detection methods have poor detection effects in complex environments, low accuracy of abnormal detection, and are difficult to perfectly match the actual distribution of background data.

Method used

By applying low rank constraints, sparse constraints and combined sparse constraints to hyperspectral image data, optimized models are constructed and iteratively solved, separated background tensors and exception tensors, and distinguished dictionary tensors and coefficient tensors using the low rank and sparseness of the background. to improve detection effect.

Benefits of technology

The accuracy and success rate of abnormal detection of hyperspectral images are improved, the problem of non-fitting distribution is effectively avoided, and the abnormal detection effect is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090815A_ABST
    Figure CN119090815A_ABST
Patent Text Reader

Abstract

The invention provides a hyperspectral image anomaly detection method and device, a terminal and a medium, and the method comprises the steps: obtaining to-be-detected hyperspectral image data, and exerting constraints on a dictionary tensor, a coefficient tensor and an anomaly tensor of the hyperspectral image data; constructing a corresponding optimization model on the basis of constraining each tensor; performing iterative solution on the model to obtain an abnormal tensor; and performing calculation based on the abnormal tensor to obtain an abnormal detection graph of the to-be-detected hyperspectral image. By implementing the method and the device, the anomaly detection has a better effect, and the condition that the distribution cannot fit the actual distribution of the background data can be effectively avoided; in addition, a more appropriate background dictionary can be constructed, a dictionary tensor and a coefficient tensor are effectively distinguished, the anomaly detection effect is further optimized, and the anomaly detection accuracy and success rate are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image detection, and in particular to a method, device, terminal and medium for detecting anomalies in a hyperspectral image. Background Art

[0002] A hyperspectral image is a three-dimensional cube with two spatial dimensions and one spectral dimension, and its spectral dimension consists of hundreds of continuous narrow bands. However, hyperspectral images are easily disturbed by noise due to factors such as the imaging environment and system hardware characteristics. Therefore, it is necessary to detect hyperspectral images to promptly discover abnormal problems in the images.

[0003] At present, the existing technology mainly uses statistical methods such as the Reed-Xiaoli (RX) algorithm. It assumes that the image background follows a Gaussian distribution. When a pixel is found to deviate from the distribution to a certain extent, the pixel is determined to be "abnormal". By calculating the above deviation degree for all pixels, an abnormality detection map is obtained. Although this method is easy to implement, in a complex environment, the self-designed distribution is difficult to perfectly match the actual distribution of the background data. Therefore, the detection effect of this method is poor and the accuracy of abnormality detection is low. Summary of the invention

[0004] The present invention provides a method, device, terminal and medium for detecting anomalies of a hyperspectral image, so as to solve the technical problems of poor detection effect and low anomaly detection accuracy in the prior art.

[0005] In order to solve the above technical problems, an embodiment of the present invention provides an abnormality detection method for a hyperspectral image, comprising:

[0006] Acquire the hyperspectral image data to be detected, and apply a low-rank constraint to the dictionary tensor of the hyperspectral image data, apply a sparse constraint to the coefficient tensor of the hyperspectral image data, and apply a joint sparse constraint to the anomaly tensor of the hyperspectral image data;

[0007] On the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor, constructing a corresponding optimization model according to the hyperspectral image data;

[0008] The optimization model is iteratively solved to obtain the anomaly tensor; and an anomaly detection map of the hyperspectral image to be detected is calculated based on the anomaly tensor.

[0009] As a preferred solution, the objective function of the optimization model is:

[0010]

[0011] in, is a hyperspectral image, is a dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the abnormal tensor, is a dictionary tensor with a low-rank constraint on the tensor nuclear norm, is the coefficient tensor with L1-norm-based sparsity constraint, ||ε|| 1,1,2 For the application of L 1,1,2 The exception tensor of the joint sparse constraint of the norm, λ and β parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor.

[0012] As a preferred solution, the iterative solution of the optimization model is specifically as follows:

[0013] The optimization model is transformed according to the following formula:

[0014]

[0015] in, and are auxiliary variables, For the one that imposes a sparse constraint based on the L1 norm, is a tensor with low rank constraints imposed on its nuclear norm

[0016] The transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method;

[0017] The unconstrained optimization problem is solved iteratively, and the auxiliary variables are updated in each iterative solution process. Auxiliary variables When the abnormal tensor, the coefficient tensor and the dictionary tensor meet a preset convergence condition, an abnormal tensor is obtained.

[0018] As a preferred solution, the transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method, specifically:

[0019] The conversion is performed according to the following formula:

[0020]

[0021] in, is the Lagrange multiplier, and μ is the penalty term coefficient.

[0022] As a preferred solution, the preset convergence condition includes that the residual of the variable update is less than a preset residual threshold;

[0023] The residual ∈ of the variable update is specifically:

[0024]

[0025] Where k is the number of iterations.

[0026] As a preferred solution, the anomaly detection map of the hyperspectral image to be detected is obtained by calculating based on the anomaly tensor, specifically:

[0027] The anomaly detection map of the hyperspectral image to be detected is calculated according to the following formula:

[0028] M(h,w)=||ε(h,w,:)||2;

[0029] Among them, M is the anomaly detection map matrix, h is the height index of the anomaly detection map, w is the width index of the anomaly detection map, and ε is the anomaly tensor.

[0030] As a preferred solution, the acquisition of the hyperspectral image data to be detected is specifically as follows:

[0031] Obtaining original hyperspectral images;

[0032] The original hyperspectral image is filtered by a minimum noise separation transform method to obtain a noise matrix;

[0033] The noise matrix is ​​processed by principal component analysis to obtain the characteristic value of the noise corresponding to each component;

[0034] Based on the noise eigenvalue and original eigenvalue corresponding to each component, the signal-to-noise ratio corresponding to each component is calculated;

[0035] Sorting is performed according to the signal-to-noise ratio, and the minimum noise component is separated to obtain the preprocessed hyperspectral image data to be detected.

[0036] Accordingly, an embodiment of the present invention further provides an abnormality detection device for a hyperspectral image, comprising a constraint applying module, a model building module and a detection module; wherein:

[0037] The constraint imposing module is used to obtain the hyperspectral image data to be detected, and to impose a low-rank constraint on the dictionary tensor of the hyperspectral image data, to impose a sparse constraint on the coefficient tensor of the hyperspectral image data, and to impose a joint sparse constraint on the anomaly tensor of the hyperspectral image data;

[0038] The model building module is used to build a corresponding optimization model according to the hyperspectral image data on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor;

[0039] The detection module is used to iteratively solve the optimization model to obtain the anomaly tensor; and calculate the anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor.

[0040] As a preferred solution, the objective function of the optimization model is:

[0041]

[0042] in, is a hyperspectral image, is a dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the abnormal tensor, is a dictionary tensor with a low-rank constraint on the tensor nuclear norm, is the coefficient tensor with L1-norm-based sparsity constraint, ||ε|| 1,1,2 For the application of L 1,1,2 The exception tensor of the joint sparse constraint of the norm, λ and β parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor.

[0043] As a preferred solution, the detection module iteratively solves the optimization model to obtain the abnormal tensor, specifically:

[0044] The detection module converts the optimization model according to the following formula:

[0045]

[0046] in, and are auxiliary variables, For the one that imposes a sparse constraint based on the L1 norm, is a tensor with low rank constraints imposed on its nuclear norm

[0047] The transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method;

[0048] The unconstrained optimization problem is solved iteratively, and the auxiliary variables are updated in each iterative solution process. Auxiliary variables When the abnormal tensor, the coefficient tensor and the dictionary tensor meet a preset convergence condition, an abnormal tensor is obtained.

[0049] As a preferred solution, the detection module converts the converted optimization model into an unconstrained optimization problem by using the augmented Lagrangian method, specifically:

[0050] The detection module performs the conversion according to the following formula:

[0051]

[0052] in, is the Lagrange multiplier, and μ is the penalty term coefficient.

[0053] As a preferred solution, the preset convergence condition includes that the residual of the variable update is less than a preset residual threshold;

[0054] The residual ∈ of the variable update is specifically:

[0055]

[0056] Where k is the number of iterations.

[0057] As a preferred solution, the detection module calculates an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor, specifically:

[0058] The detection module calculates the abnormality detection map of the hyperspectral image to be detected according to the following formula:

[0059] M(h,w)=||ε(h,w,:)||2;

[0060] Among them, M is the anomaly detection map matrix, h is the height index of the anomaly detection map, w is the width index of the anomaly detection map, and ε is the anomaly tensor.

[0061] As a preferred solution, the constraint imposing module obtains the hyperspectral image data to be detected, specifically:

[0062] The constraint imposing module acquires the original hyperspectral image;

[0063] The original hyperspectral image is filtered by a minimum noise separation transform method to obtain a noise matrix;

[0064] The noise matrix is ​​processed by principal component analysis to obtain the characteristic value of the noise corresponding to each component;

[0065] Based on the noise eigenvalue and original eigenvalue corresponding to each component, the signal-to-noise ratio corresponding to each component is calculated;

[0066] Sorting is performed according to the signal-to-noise ratio, and the minimum noise component is separated to obtain the preprocessed hyperspectral image data to be detected.

[0067] Correspondingly, an embodiment of the present invention further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for detecting anomalies in a hyperspectral image when executing the computer program.

[0068] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for detecting anomalies in hyperspectral images.

[0069] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0070] The embodiment of the present invention provides a method, device, terminal and medium for detecting anomalies of a hyperspectral image. The method comprises: obtaining hyperspectral image data to be detected, applying a low-rank constraint to a dictionary tensor of the hyperspectral image data, applying a sparse constraint to a coefficient tensor of the hyperspectral image data, and applying a joint sparse constraint to an anomaly tensor of the hyperspectral image data; on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor, constructing a corresponding optimization model according to the hyperspectral image data; iteratively solving the optimization model to obtain the anomaly tensor; and calculating an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor. In the implementation of the embodiment of the present application, the hyperspectral image is divided into a background tensor and an anomaly tensor, wherein the background is represented by a dictionary tensor and a coefficient tensor, and the strong spatial and spectral correlation of the background in the hyperspectral image, that is, the overall low rank of the data tensor, is utilized, so that the anomaly detection has a better effect and can effectively avoid the situation where the distribution cannot fit the actual distribution of the background data; in addition, by applying a low rank constraint to the dictionary tensor of the hyperspectral image data, applying a sparse constraint to the coefficient tensor of the hyperspectral image data, and applying a joint sparse constraint to the anomaly tensor of the hyperspectral image data, a more appropriate background dictionary can be constructed, the dictionary tensor and the coefficient tensor can be effectively distinguished, the effect of anomaly detection is further optimized, and the accuracy and success rate of anomaly detection are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 : A schematic diagram of a flow chart of an embodiment of the method for abnormality detection of hyperspectral images provided by the present invention.

[0072] Figure 2 : A schematic diagram of the principle of an embodiment of the anomaly detection method for hyperspectral images provided by the present invention.

[0073] Figure 3: A schematic structural diagram of an embodiment of the anomaly detection device for hyperspectral images provided by the present invention. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] Embodiment 1

[0076] Please refer to Figure 1 , Figure 1 A method for detecting anomalies in a hyperspectral image provided by an embodiment of the present invention includes steps S1 to S3; wherein:

[0077] Step S1, obtaining hyperspectral image data to be detected, applying a low-rank constraint to a dictionary tensor of the hyperspectral image data, applying a sparse constraint to a coefficient tensor of the hyperspectral image data, and applying a joint sparse constraint to an anomaly tensor of the hyperspectral image data.

[0078] In this embodiment, in order to include low-rank information of the background and distinguish the dictionary tensor from the coefficient tensor, low-rank constraints and sparse constraints can be applied to the dictionary tensor and the coefficient tensor respectively, so that the distinction between the two is improved. In addition, for anomalies, their probability of occurrence is low, and their small proportion in the image is mainly manifested in the spatial dimension. In the spectral dimension, the spectrum of the anomaly occupies most of the spectrum. Therefore, considering the above factors comprehensively, anomaly joint sparse constraints can be applied to it, which can help improve the success rate of detection.

[0079] As a preferred implementation manner, the obtaining of the hyperspectral image data to be detected is specifically as follows:

[0080] Get the original hyperspectral image; Figure 2 As shown, the original hyperspectral image is filtered by the minimum noise separation transformation method to obtain a noise matrix; the noise matrix is ​​processed by the principal component analysis method to obtain the eigenvalue of the noise corresponding to each component; based on the noise eigenvalue and the original eigenvalue corresponding to each component, the signal-to-noise ratio corresponding to each component is calculated; according to the signal-to-noise ratio sorting, the minimum noise component is separated to obtain the preprocessed hyperspectral image data to be detected.

[0081] By implementing this preferred embodiment, the original hyperspectral image is preprocessed by the minimum noise factorization transform (MNF) to weaken the influence of noise on subsequent detection steps, which can achieve the effect of reducing data dimensions to reduce the amount of calculation.

[0082] Specifically, the original hyperspectral image has noise and band redundancy, which will lead to a large amount of calculation. The spectral dimension is filtered using the minimum noise factorization method (MNF) to obtain the eigenvalue of the noise corresponding to each component. The noise eigenvalue corresponding to each component is calculated with the original eigenvalue to obtain the signal-to-noise ratio corresponding to each component, and the minimum noise component is finally separated according to the signal-to-noise ratio sorting. In this preferred embodiment, MNF converts the multi-band image into a new feature space. Compared with the principal component analysis method that sorts the main components according to the eigenvalue, NMF arranges the main components according to the signal-to-noise ratio, and reduces the impact of noise by excluding components with low signal-to-noise ratio. Since the main information of the original hyperspectral image is retained, while the computational complexity of the subsequent algorithm is reduced, the influence of noise in the original hyperspectral image is also removed, which can effectively help improve the accuracy of subsequent anomaly detection tasks and reduce the computational complexity. Among them, is a real number, indicating that each data element of the original hyperspectral image data tensor is a real number. H, W, and D are the three data dimensions of the original hyperspectral image, corresponding to the height, width, and spectral dimensions, respectively. d indicates that the spectral dimension of the original hyperspectral image is reduced from D to d after the MNF transformation.

[0083] Step S2, constructing a corresponding optimization model according to the hyperspectral image data on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor.

[0084] In this embodiment, anomaly detection of hyperspectral images is described as the following objective function, which is used as the objective function of the optimization model:

[0085]

[0086] in, is a hyperspectral image, is a dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the abnormal tensor, is a dictionary tensor with a low-rank constraint on the tensor nuclear norm, is the coefficient tensor with L1-norm-based sparsity constraint, ||ε|| 1,1,2 For the application of L 1,1,2The λ and β parameters are used to balance the abnormal tensor, the coefficient tensor and the dictionary tensor. m is set to a value much smaller than H and W to further reduce the amount of calculation.

[0087] As a preferred implementation, λ ranges from 0.1 to 1, and β is 5 times of λ. This setting ensures that the optimization model pays more attention to the low rank of the background dictionary and the joint sparsity of anomalies to achieve better detection results.

[0088] Step S3, iteratively solving the optimization model to obtain the anomaly tensor; and calculating the anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor.

[0089] In this embodiment, the optimization model is iteratively solved to obtain the abnormal tensor, specifically:

[0090] The optimization model is transformed according to the following formula:

[0091]

[0092] in, and are auxiliary variables, For the one that imposes a sparse constraint based on the L1 norm, is a tensor with low rank constraints imposed on its nuclear norm This formula introduces an auxiliary variable This enables each variable to be iterated separately.

[0093] Through the augmented Lagrangian method, the transformed optimization model is converted from a constrained optimization problem to an unconstrained optimization problem, which is convenient for subsequent decomposition into sub-problems for each variable for alternating solutions.

[0094] The transformed augmented Lagrangian function is:

[0095]

[0096] in, is the Lagrange multiplier, μ is the penalty term coefficient, which will gradually increase during the iterative solution process to make the iteration converge.

[0097] For this optimization problem, we can fix a variable, solve the optimization problem related to the variable and iterate the variable, and complete an update after alternately solving and iterating all variables. The optimization problem is solved when multiple updates are performed until convergence, and the update of some variables involves the threshold operator of the corresponding norm.

[0098] Therefore, the unconstrained optimization problem is solved iteratively, and the auxiliary variables are updated in each iterative solution process. Auxiliary variables When the abnormal tensor, the coefficient tensor and the dictionary tensor meet a preset convergence condition, an abnormal tensor is obtained.

[0099] About Update The related optimization sub-problems are solved as follows:

[0100]

[0101] Where TSVT is the tensor singular value threshold operator, where the input data of the algorithm The algorithm uses discrete Fourier transform (FFT) and inverse discrete Fourier transform (IFFT), and intermediately applies the singular value decomposition (SVD) of the matrix to each forward slice of the tensor.

[0102] About Update The related optimization sub-problems are solved as follows:

[0103]

[0104] This sub-problem is solved using the L1 threshold operator to obtain the final update result.

[0105] Regarding updating ε, the related optimization subproblems are solved as follows:

[0106]

[0107] The sub-problem is to use L 1,1,2 The threshold operator is solved to obtain the final update result. Where h∈{1,…,H},w∈{1,…,W},

[0108] About Update The related optimization sub-problems are solved as follows:

[0109]

[0110] This subproblem is solved by optimizing the optimization equation The derivative of , when the derivative is taken as zero, is solved. is the identity tensor, defined as the tensor whose first forward slice is the identity matrix, Express Take the transpose, which is defined as taking the transpose of each forward slice matrix of the tensor.

[0111] About Update The related optimization sub-problems are solved as follows:

[0112]

[0113] The solution to this subproblem is similar to updating The solution of the sub-problem.

[0114] On the Three Lagrange Multipliers The update of the penalty coefficient μ is as follows:

[0115]

[0116] μ k+1 min(ρμ k ,μ max );

[0117] The Lagrange multiplier and penalty coefficient are updated according to the augmented Lagrangian method, where each iteration increases by a multiple of ρ>1, and the growth of the penalty coefficient has a set upper bound μ max .

[0118] After each iteration, the residual ∈ of the variable update is calculated, and whether it is converged is determined based on whether it is less than a preset threshold ∈0. The residual ∈ of the variable update is specifically:

[0119]

[0120] Where k is the number of iterations.

[0121] After obtaining the anomaly tensor output by the learning background dictionary algorithm, the final anomaly detection map matrix M is obtained. The specific expression of M is:

[0122] M(h,w)=||ε(h,w,:)||2;

[0123] Among them, h is the height index of the anomaly detection map, w is the width index of the anomaly detection map, and ε is the anomaly tensor. h∈{1,…,H},w∈{1,…,W}, the value of each pixel in the M matrix represents the degree of abnormality of the pixel, and the pixel is judged whether it is an abnormal pixel according to the value of the abnormality degree, thereby completing the detection of anomalies in the hyperspectral image.

[0124] Furthermore, when the input data is When the hyperparameter m<<min(H, W), for the update For example, the main time-consuming part is the calculation of singular value decomposition and discrete Fourier transform, whose complexity is renew Similar to ε, they need and renew and All of them need to calculate tensor products, transposes, and inverse operations. Assuming the number of iterations required for the algorithm to converge is k, the overall time complexity of the solution algorithm is Therefore, sufficiently small d and m can effectively reduce the solution time. The detection capability and running time of this embodiment are verified by MATLAB R2022a on a personal computer equipped with an Intel Core i9-12900K 3.20-GHz central processor, 64GB memory and 64-bit Windows 10 system. And this embodiment is compared and verified on three data sets.

[0125] The first dataset is Pavia collected by the ROSIS sensor. The test image consists of 100×100 pixels and has 102 bands. The main background consists of water and bridges, and there are 71 abnormal pixels that constitute the car on the bridge. The second dataset is the airport data in the Airport-Beach-Urban (ABU) captured by AVIRIS. The hyperspectral image used for testing consists of 100×100 pixels and has 191 bands. 60 abnormal pixels constitute three aircraft that are distinguished from the grass. The third dataset is the urban data in the ABU imaged by AVIRIS. The image also has 100×100 pixels and 207 spectral bands. The fifth dataset has 191 bands and 155 abnormal pixels constitute small abnormal buildings in the city.

[0126] Regarding how to compare anomaly detection algorithms, there are methods for evaluating the detection effect by directly observing the difference between the detection graph and the true value graph, the receiver operating characteristic curve (ROC), box plots, and other visual detection effect evaluation methods. Among them, the ROC curve is a curve that describes how the detection rate (PD) changes with the change of the false alarm rate (PF) under different thresholds τ for judging whether a pixel is abnormal. The area under the ROC curve (AUC) is generally used. PD,PF ) to quantitatively compare and evaluate the detection effect of anomaly detection algorithms, except AUC PD,PF In addition, the area under the detection rate curve (AUC PD,τ ) and the area under the false alarm rate curve (AUC PF,τ ). The goal is to find a method that maintains a high detection rate while ensuring a low false positive rate.

[0127] In fact, for most methods, as the threshold for judging pixels as abnormal increases, the false alarm rate decreases, and the anomaly detection rate also decreases. PD,PF and AUC PD ,The closer the τ index is to 1, the better the AUC PF ,The closer the τ index is to 0, the better the method can distinguish anomalies from the background. In addition, AUC ODA variety of indicators are combined to provide a more comprehensive and meaningful evaluation of the effectiveness of anomaly detection methods, which are defined as follows:

[0128] AUC OD =AUC PD,PF +AUC PD,τ -AUC PF,τ ;

[0129] This embodiment selects eight technical solutions to compare with the solution of this embodiment, including the global RX algorithm (GRX), the local RX algorithm (LRX), the low-rank and sparse representation model (LRASR), the total variation low-rank representation model (GTVLRR), the tensor robust principal component analysis method (TPCA), the prior tensor approximation model (PTA), the principal component analysis-tensor low-rank sparse representation model (PCA-TLRSR) and the guided autoencoder method (GAED). Among them, GRX is an efficient and classic statistics-based model, and the LRX model is improved on the basis of GRX using a local window. LRASR and GTVLRR are models based on low-rank representation from the perspective of matrices. TPCA, PTA and PCA-TLRSR are models based on low-rank learning from the perspective of tensors, among which TPCA and PCA-TLRSR adopt the idea of ​​low-rank representation. GAED is an advanced anomaly detection method based on deep learning. Through AUC PD,PF and AUC OD The indicators and running time are used to quantitatively compare the detection performance of different methods.

[0130]

[0131] Table 1 AUC values ​​of different anomaly detection schemes on three real datasets

[0132] The AUC values ​​of each detection method are shown in Table 1. It can be seen that this technical solution has the highest AUC on all three data sets. PD,PF The values ​​all exceed 0.99, which shows that this embodiment has the characteristics of wide applicability and strong detection ability compared with the prior art.

[0133] On the ABU-airport and ABU-urban datasets, the AUC of this technical solution is PD,PF The value is much higher than other methods. On the Pavia dataset, the difference between this technical solution and the best method is only 0.003. OD The proposed scheme achieves the second best result on the datasets other than the ABU-airport dataset, and is comparable to the AUC of the optimal detection model. ODThe value difference does not exceed 0.1. The results on the ABU-airport dataset are comparable to those of many other methods. This shows that this solution has excellent comprehensive detection capabilities. Other models and algorithms may have certain advantages on a certain dataset, but this technical solution has a strong comprehensive detection capability on all datasets.

[0134]

[0135] Table 2 Running time of different anomaly detection schemes on three real datasets (unit: seconds)

[0136] Table 2 shows the operation time of each method on three data sets. It can be seen that, except for GRX, the technical solution of the embodiment has the shortest calculation time, and the solution time for data of different sizes is controlled within 3-5 seconds. The running time of the LRX algorithm is approximately 1.5-2 times that of this solution, and the LRASR model is approximately 2 times. GTVLRR has the longest running time, which is 15-20 times that of this solution. The PTA model is approximately 2-3 times, and the running time of the PCA-TLRSR model is also relatively short, which is 1.5 times that of this solution. The GAED method based on deep learning is approximately 5 times. The calculation time will continue to increase with the increase of the scale of the data dimension and the amount of tasks. This solution balances the running time well while effectively detecting anomalies, and controls the calculation time within an appropriate range. This solution has the second lowest calculation time, and the detection capability is significantly higher than the fastest GRX algorithm. According to the time complexity characteristics of the solution algorithm, MNF is used to reduce the dimensionality of the data after denoising, and the dimension of the dictionary and coefficients is set to m<<min(H,W), so that the calculation time is greatly reduced and anomalies can be detected quickly.

[0137] The technical solution of this embodiment has three predefined hyperparameters. The two regularization parameters λ and β are used to balance the low-rank terms that characterize the background dictionary, the sparse terms that characterize the coefficients, and the joint sparse terms that characterize the anomalies. The different values ​​of λ and β mean that the optimization model emphasizes different constraints during the solution process. The values ​​of λ and β are respectively derived from the sets of commonly used values ​​{0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5} and {0.1, 0.5, 1, 2, 4, 6, 8, 10}. It can be seen that on each data set, when the parameters λ and β take different parameter combinations, there are many sets of parameters that enable the background dictionary learning model to achieve good detection results and achieve a higher AUC. PD,PFvalues, the stability of ABU-airport and ABU-urban is particularly obvious. For the Pavia data set, it can be found that when the parameter combination is distributed in the diagonal area and λ is relatively small, the detection effect is almost the best among all parameter combinations. That is, when λ is in the range of 0.1 to 1, and β is about 5 times of λ, the technical solution can best exert its detection capability. Such parameter settings mean that the joint sparsity of the anomaly tensor and the low rank of the background dictionary tensor are more important than the sparsity of the coefficient tensor, which is in line with the actual situation. The technical solution of this embodiment has enough parameter combinations to enable the model to achieve good detection results, which proves that the background dictionary learning model is robust, insensitive to hyperparameters, and for different data sets, the optimal parameter combination range is relatively fixed, which is convenient for the actual application of the calculation scheme in different scenarios.

[0138] Another hyperparameter is the tensor and The spatial dimension m of , which affects the size of the background and coefficients as well as the running time of the model solution. Fixing λ and β and changing m from 2 to 12, it can be seen that on the three datasets, as m increases, AUC PD,PF The change is small, and the detection effect is better when m is small. Among them, the detection effect of ABU-airport is relatively stable when m changes, and the AUC PD,PF The value decreases, and the AUC increases with the increase of m on the Pavia dataset PD,PF The value of m has a downward trend. Experiments have shown that m can take a smaller value, that is, when the background and coefficient data scale is small, it can still maintain a good detection effect. When m is too large, the detection effect may be reduced. The calculation time required for model solution decreases as m becomes smaller, so the value of the hyperparameter m can be between 2 and 6, which can reduce the running time while ensuring the detection effect. The hyperparameter m also has a relatively wide selection range, which further shows that the method is robust.

[0139] Accordingly, refer to Figure 3 The embodiment of the present invention also provides an abnormality detection device for a hyperspectral image, comprising a constraint applying module 101, a model building module 102 and a detection module 103; wherein,

[0140] The constraint applying module 101 is used to obtain the hyperspectral image data to be detected, and to apply a low-rank constraint to the dictionary tensor of the hyperspectral image data, to apply a sparse constraint to the coefficient tensor of the hyperspectral image data, and to apply a joint sparse constraint to the anomaly tensor of the hyperspectral image data;

[0141] The model building module 102 is used to build a corresponding optimization model according to the hyperspectral image data on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor;

[0142] The detection module 103 is used to iteratively solve the optimization model to obtain the anomaly tensor; and calculate the anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor.

[0143] As a preferred solution, the objective function of the optimization model is:

[0144]

[0145] in, is a hyperspectral image, is a dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the abnormal tensor, is a dictionary tensor with a low-rank constraint on the tensor nuclear norm, is the coefficient tensor with L1-norm-based sparsity constraint, ||ε|| 1,1,2 For the application of L 1,1,2 The exception tensor of the joint sparse constraint of the norm, λ and β parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor.

[0146] As a preferred solution, the detection module 103 iteratively solves the optimization model to obtain the abnormal tensor, specifically:

[0147] The detection module 103 converts the optimization model according to the following formula:

[0148]

[0149] in, and are auxiliary variables, For the one that imposes a sparse constraint based on the L1 norm, is a tensor with low rank constraints imposed on its nuclear norm

[0150] The transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method;

[0151] The unconstrained optimization problem is solved iteratively, and the auxiliary variables are updated in each iterative solution process. Auxiliary variables When the abnormal tensor, the coefficient tensor and the dictionary tensor meet a preset convergence condition, an abnormal tensor is obtained.

[0152] As a preferred solution, the detection module 103 converts the converted optimization model into an unconstrained optimization problem by using the augmented Lagrangian method, specifically:

[0153] The detection module 103 performs conversion according to the following formula:

[0154]

[0155] in, is the Lagrange multiplier, and μ is the penalty term coefficient.

[0156] As a preferred solution, the preset convergence condition includes that the residual of the variable update is less than a preset residual threshold;

[0157] The residual ∈ of the variable update is specifically:

[0158]

[0159] Where k is the number of iterations.

[0160] As a preferred solution, the detection module 103 calculates an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor, specifically:

[0161] The detection module 103 calculates the abnormality detection map of the hyperspectral image to be detected according to the following formula:

[0162] M(h,w)=||ε(h,w,:)||2;

[0163] Among them, M is the anomaly detection map matrix, h is the height index of the anomaly detection map, w is the width index of the anomaly detection map, and ε is the anomaly tensor.

[0164] As a preferred solution, the constraint imposing module 101 obtains the hyperspectral image data to be detected, specifically:

[0165] The constraint imposing module 101 acquires an original hyperspectral image;

[0166] The original hyperspectral image is filtered by a minimum noise separation transform method to obtain a noise matrix;

[0167] The noise matrix is ​​processed by principal component analysis to obtain the characteristic value of the noise corresponding to each component;

[0168] Based on the noise eigenvalue and original eigenvalue corresponding to each component, the signal-to-noise ratio corresponding to each component is calculated;

[0169] Sorting is performed according to the signal-to-noise ratio, and the minimum noise component is separated to obtain the preprocessed hyperspectral image data to be detected.

[0170] Correspondingly, an embodiment of the present invention further provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for detecting anomalies in a hyperspectral image when executing the computer program.

[0171] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal, and various interfaces and lines are used to connect various parts of the entire terminal.

[0172] The memory can be used to store the computer program, and the processor realizes various functions of the terminal by running or executing the computer program stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0173] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the method for detecting anomalies in hyperspectral images.

[0174] Wherein, if the module integrated in the anomaly detection device of the hyperspectral image is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium.

[0175] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0176] The embodiment of the present invention provides a method, device, terminal and medium for detecting anomalies of a hyperspectral image. The method comprises: obtaining hyperspectral image data to be detected, applying a low-rank constraint to a dictionary tensor of the hyperspectral image data, applying a sparse constraint to a coefficient tensor of the hyperspectral image data, and applying a joint sparse constraint to an anomaly tensor of the hyperspectral image data; on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor, constructing a corresponding optimization model according to the hyperspectral image data; iteratively solving the optimization model to obtain the anomaly tensor; and calculating an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor. In the implementation of the embodiment of the present application, the hyperspectral image is divided into a background tensor and an anomaly tensor, wherein the background is represented by a dictionary tensor and a coefficient tensor, and the strong spatial and spectral correlation of the background in the hyperspectral image, that is, the overall low rank of the data tensor, is utilized, so that the anomaly detection has a better effect and can effectively avoid the situation where the distribution cannot fit the actual distribution of the background data; in addition, by applying a low rank constraint to the dictionary tensor of the hyperspectral image data, applying a sparse constraint to the coefficient tensor of the hyperspectral image data, and applying a joint sparse constraint to the anomaly tensor of the hyperspectral image data, a more appropriate background dictionary can be constructed, the dictionary tensor and the coefficient tensor can be effectively distinguished, the effect of anomaly detection is further optimized, and the accuracy and success rate of anomaly detection are improved.

[0177] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for detecting anomalies in hyperspectral images, characterized in that: include: Acquire the hyperspectral image data to be detected, and apply a low-rank constraint to the dictionary tensor of the hyperspectral image data, apply a sparse constraint to the coefficient tensor of the hyperspectral image data, and apply a joint sparse constraint to the anomaly tensor of the hyperspectral image data; On the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor, constructing a corresponding optimization model according to the hyperspectral image data; The optimization model is iteratively solved to obtain the anomaly tensor; and an anomaly detection map of the hyperspectral image to be detected is calculated based on the anomaly tensor.

2. The method for detecting anomalies in a hyperspectral image according to claim 1, wherein: The objective function of the optimization model is: in, is a hyperspectral image, is a dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the abnormal tensor, is a dictionary tensor with a low-rank constraint on the tensor nuclear norm, is the coefficient tensor with L1-norm-based sparsity constraint, ||ε|| 1,1,2 For the application of L 1,1,2 The exception tensor of the joint sparse constraint of the norm, λ and β parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor.

3. The method for detecting anomalies in a hyperspectral image according to claim 2, wherein: The optimization model is iteratively solved to obtain the abnormal tensor, specifically: The optimization model is transformed according to the following formula: in, and are auxiliary variables, For the one that imposes a sparse constraint based on the L1 norm, is a tensor with low rank constraints imposed on its nuclear norm The transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method; The unconstrained optimization problem is solved iteratively, and the auxiliary variables are updated in each iterative solution process. Auxiliary variables When the abnormal tensor, the coefficient tensor and the dictionary tensor meet a preset convergence condition, an abnormal tensor is obtained.

4. The method for detecting anomalies in a hyperspectral image according to claim 3, wherein: The transformed optimization model is converted into an unconstrained optimization problem by using the augmented Lagrangian method, specifically: The conversion is performed according to the following formula: in, is the Lagrange multiplier, and μ is the penalty term coefficient.

5. The method for detecting anomalies in a hyperspectral image according to claim 3, wherein: The preset convergence condition includes that the residual of the variable update is less than a preset residual threshold; The residual of the variable update ∈ Specifically: Where k is the number of iterations.

6. The method for detecting anomalies in a hyperspectral image according to claim 1, wherein: The anomaly detection map of the hyperspectral image to be detected is obtained by calculating the anomaly tensor, specifically: The anomaly detection map of the hyperspectral image to be detected is calculated according to the following formula: M(h,w)=||ε(h,w,:)||2; Among them, M is the anomaly detection map matrix, h is the height index of the anomaly detection map, w is the width index of the anomaly detection map, and ε is the anomaly tensor.

7. The method for detecting anomalies in a hyperspectral image according to claim 1, wherein: The obtaining of the hyperspectral image data to be detected is specifically as follows: Obtaining original hyperspectral images; The original hyperspectral image is filtered by a minimum noise separation transform method to obtain a noise matrix; The noise matrix is ​​processed by principal component analysis to obtain the characteristic value of the noise corresponding to each component; Based on the noise eigenvalue and original eigenvalue corresponding to each component, the signal-to-noise ratio corresponding to each component is calculated; Sorting is performed according to the signal-to-noise ratio, and the minimum noise component is separated to obtain the preprocessed hyperspectral image data to be detected.

8. A device for detecting abnormalities in a hyperspectral image, characterized in that: It includes a constraint imposing module, a model building module and a detection module; among which, The constraint imposing module is used to obtain the hyperspectral image data to be detected, and to impose a low-rank constraint on the dictionary tensor of the hyperspectral image data, to impose a sparse constraint on the coefficient tensor of the hyperspectral image data, and to impose a joint sparse constraint on the anomaly tensor of the hyperspectral image data; The model building module is used to build a corresponding optimization model according to the hyperspectral image data on the basis of constraining the dictionary tensor, the coefficient tensor and the anomaly tensor; The detection module is used to iteratively solve the optimization model to obtain the anomaly tensor; and calculate the anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor.

9. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for detecting anomalies in a hyperspectral image according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for abnormality detection of hyperspectral images according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hyperspectral anomaly detection method based on multilevel tensor prior constraint

    CN114331976A

  • Hyperspectral image anomaly detection method, device, equipment and medium

    CN117115653A

  • Satellite-borne hyperspectral image anomaly detection method based on joint low-rank tensor approximation

    CN117764935A

Cited By

  • Abnormality detection method and device for image data and storage medium

    CN120852791A