Anomaly Detection Method, Device, Terminal and Medium for Hyperspectral Images

By applying low rank and sparse constraints to hyperspectral image data, the optimization model is constructed for iterative solution, which solves the problem of low accuracy of abnormal detection of hyperspectral images in the prior art, and achieves a more efficient abnormal detection effect.

CN119090815BActive Publication Date: 2025-05-30SUN YAT SEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art has poor detection effect in abnormality detection of hyperspectral images, and the accuracy of abnormality detection is low, especially in complex environments, it is difficult to effectively distinguish background and abnormality.

Method used

By applying low rank constraints to the dictionary tensor of hyperspectral image data, sparse constraints to the coefficient tensors, combined sparse constraints are applied to the anomaly tensors, optimization models are constructed and iteratively solved to obtain the anomaly tensors, and anomaly detection diagram is generated.

Benefits of technology

The accuracy and success rate of abnormal detection of hyperspectral images are improved, and the problem of the inconsistency of background data distribution and actual distribution are effectively avoided, and the detection effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090815B_ABST
    Figure CN119090815B_ABST
Patent Text Reader

Abstract

The present invention provides a method, apparatus, terminal and medium for anomaly detection of hyperspectral images. The method includes: acquiring hyperspectral image data to be detected, and imposing constraints on the dictionary tensor, coefficient tensor and anomaly tensor of the hyperspectral image data; constructing corresponding optimization models on the basis of imposing constraints on each tensor; performing iterative solution on the models to obtain the anomaly tensor; and calculating an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor. By implementing the present invention, the anomaly detection has a better effect, and the situation where the distribution cannot fit the actual distribution of the background data can be effectively avoided; in addition, a more suitable 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.
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 particularly to an anomaly detection method, device, terminal and medium for hyperspectral images. 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 susceptible to noise interference under the influence of factors such as imaging environment and system hardware characteristics. Therefore, it is necessary to detect hyperspectral images to timely discover abnormal problems existing in the images.

[0003] Currently, the existing technology mainly adopts statistical methods such as the Reed-Xiaoli (RX) algorithm. It assumes that the image background follows a Gaussian distribution. When it is found that a certain pixel deviates from this distribution to a certain extent, this pixel is determined to be "abnormal". By calculating the deviation degree for each pixel respectively, an anomaly detection map is obtained. Although this method is easy to implement, in a complex environment, it is difficult for the self-designed distribution to perfectly fit the actual distribution of the background data. Therefore, the detection effect of this method is poor and the anomaly detection accuracy is low. Summary of the Invention

[0004] The present invention provides an anomaly detection method, device, terminal and medium for hyperspectral images to solve the technical problems of poor detection effect and low anomaly detection accuracy in the existing technology.

[0005] To solve the above technical problems, an embodiment of the present invention provides an anomaly detection method for hyperspectral images, including:

[0006] Obtain hyperspectral image data to be detected, 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, construct a corresponding optimization model according to the hyperspectral image data;

[0008] Iteratively solve the optimization model to obtain the anomaly tensor; and calculate an anomaly detection map of the hyperspectral image to be detected based on the anomaly tensor.

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

[0010]

[0011] Wherein, is a hyperspectral image, is a dictionary tensor, is a coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, and ε is the anomaly tensor, is the dictionary tensor with the low-rank constraint imposed by the tensor nuclear norm, is the coefficient tensor with the sparse constraint imposed based on the L 1 norm, ||ε|| 1,1,2 is the anomaly tensor with the joint sparse constraint imposed based on the L 1,1,2 norm, and the λ and β parameters are used to balance the anomaly 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] where, and are both auxiliary variables, is the one with the sparse constraint imposed based on the L 1 norm and the sparse constraint imposed based on the L 1 norm, is the one with the low-rank constraint imposed by the tensor nuclear norm

[0016] Through the augmented Lagrangian method, the transformed optimization model is converted into an unconstrained optimization problem;

[0017] The unconstrained optimization problem is iteratively solved, and the auxiliary variables auxiliary variables the anomaly tensor, the coefficient tensor, and the dictionary tensor are updated. When the preset convergence condition is satisfied, the anomaly tensor is obtained.

[0018] As a preferred solution, the transformation of the transformed optimization model into an unconstrained optimization problem through the augmented Lagrangian method is specifically as follows:

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

[0020]

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

[0022] As a preferred solution, the preset convergence condition includes that the residual of 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 calculated based on the anomaly tensor is 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] where 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:

[0031] Acquire the original hyperspectral image;

[0032] Perform filtering on the original hyperspectral image by the minimum noise separation transform method to obtain a noise matrix;

[0033] Process the noise matrix by the principal component analysis method to obtain the eigenvalues of the noise corresponding to each component;

[0034] Based on the noise eigenvalues and the original eigenvalues corresponding to each component, calculate the signal-to-noise ratio corresponding to each component;

[0035] Sort according to the signal-to-noise ratio, separate the minimum noise component, and obtain the preprocessed hyperspectral image data to be detected.

[0036] Correspondingly, an embodiment of the present invention further provides an anomaly detection device for hyperspectral images, including a constraint application module, a model construction module, and a detection module; where

[0037] The constraint application module is used to acquire the hyperspectral image data to be detected, 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;

[0038] The model construction module is used to construct 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 an 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] Where, is the hyperspectral image, is the dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the anomaly tensor, is the dictionary tensor with a low-rank constraint imposed by the tensor nuclear norm, is the coefficient tensor with a sparse constraint imposed based on the L 1 norm, ||ε|| 1,1,2 is the anomaly tensor with a joint sparse constraint imposed based on the L 1,1,2 norm, and the λ and β parameters are used to balance the anomaly tensor, the coefficient tensor and the dictionary tensor.

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

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

[0045]

[0046] Where, and are both auxiliary variables, is the one with a sparse constraint imposed based on the L 1 norm and a sparse constraint imposed based on the L 1 norm, is the one with a low-rank constraint imposed by the tensor nuclear norm

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

[0048] Iteratively solve the unconstrained optimization problem, and update the auxiliary variables auxiliary variable The abnormal tensor, the coefficient tensor, and the dictionary tensor obtain the abnormal tensor when satisfying a preset convergence condition.

[0049] As a preferred solution, the detection module converts the optimized model after conversion into an unconstrained optimization problem through the augmented Lagrangian method, specifically:

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

[0051]

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

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

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

[0055]

[0056] where k is the iteration number.

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

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

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

[0060] where 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 abnormal tensor.

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

[0062] The constraint application module obtains the original hyperspectral image;

[0063] Performs filtering processing on the original hyperspectral image through the minimum noise separation transform method to obtain a noise matrix;

[0064] Uses the principal component analysis method to process the noise matrix to obtain the eigenvalues of the noise corresponding to each component;

[0065] Based on the noise eigenvalues and the original eigenvalues corresponding to each component, calculates the signal-to-noise ratio corresponding to each component;

[0066] Sort according to the signal-to-noise ratio, separate the minimum noise component, and 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. When the processor executes the computer program, the abnormal detection method of the hyperspectral image is implemented.

[0068] Correspondingly, an embodiment of the present invention further provides a computer-readable storage medium. The computer-readable storage medium includes a stored computer program. When the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the abnormal detection method of the hyperspectral image.

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

[0070] The embodiments of the present invention provide an abnormal detection method, device, terminal and medium for hyperspectral images. The abnormal detection method includes: obtaining hyperspectral image data to be detected, 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 abnormal tensor of the hyperspectral image data; on the basis of constraining the dictionary tensor, the coefficient tensor and the abnormal tensor, constructing a corresponding optimization model according to the hyperspectral image data; iteratively solving the optimization model to obtain the abnormal tensor; and calculating an abnormal detection map of the hyperspectral image to be detected based on the abnormal tensor. Implementing the embodiments of the present application divides the hyperspectral image into a background tensor and an abnormal tensor, where the background is represented by the dictionary tensor and the coefficient tensor, making use of the characteristics of strong spatial and spectral correlation of the background in the hyperspectral image, that is, the low-rankness of the overall data tensor, so that the abnormal detection has a better effect and can effectively avoid the situation where the distribution does not 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 abnormal tensor of the hyperspectral image data, a more suitable background dictionary can be constructed, effectively distinguishing the dictionary tensor and the coefficient tensor, further optimizing the effect of abnormal detection, and improving the accuracy and success rate of abnormal detection. Description of the Drawings

[0071] Figure 1 : A flowchart of an embodiment of the abnormal detection method for hyperspectral images provided by the present invention.

[0072] Figure 2: Schematic diagram of the principle of an embodiment of the hyperspectral image anomaly detection method provided by the present invention.

[0073] Figure 3 : Schematic diagram of the structure of an embodiment of the hyperspectral image anomaly detection device provided by the present invention. Detailed implementation manners

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

[0075] Embodiment 1

[0076] Please refer to Figure 1 , Figure 1 A hyperspectral image anomaly detection method provided by an embodiment of the present invention, including steps S1 to S3; wherein,

[0077] Step S1, obtaining the hyperspectral image data to be detected, 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.

[0078] In this embodiment, in order to include the low-rank information of the background and distinguish the dictionary tensor and the coefficient tensor, a low-rank constraint and a sparse constraint can be respectively applied to the dictionary tensor and the coefficient tensor to improve the distinguishability between the two. In addition, for anomalies, their occurrence probability is low, and the property that their proportion in the image is small is mainly manifested in the spatial dimension. In the spectral dimension, the spectra of anomalies occupy most of the spectra. Therefore, considering the above factors comprehensively, a joint sparse constraint for anomalies can be applied, 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:

[0080] Obtaining the original hyperspectral image; as Figure 2 shown, filtering the original hyperspectral image by the minimum noise separation transform method to obtain a noise matrix; processing the noise matrix by the principal component analysis method to obtain the eigenvalues of the noise corresponding to each component; calculating the signal-to-noise ratio corresponding to each component based on the noise eigenvalues and the original eigenvalues corresponding to each component; separating the minimum noise component according to the signal-to-noise ratio ranking to obtain the preprocessed hyperspectral image data to be detected.

[0081] Implementing this preferred embodiment, preprocessing the original hyperspectral image using the Minimum Noise Fraction (MNF) transformation to weaken the impact of noise on subsequent detection steps can achieve the effect of reducing the data dimension to decrease the computational complexity.

[0082] Specifically, for the original hyperspectral image, it has noise and band redundancy, which can lead to a large computational load. In this embodiment, for the original hyperspectral image data the spectral dimension is filtered using the Minimum Noise Fraction (MNF) transformation to obtain the eigenvalue of the noise corresponding to each component. The signal-to-noise ratio (SNR) corresponding to each component is calculated by computing the noise eigenvalue corresponding to each component and the original eigenvalue, and finally, the minimum noise component is separated according to the SNR ranking. In this preferred embodiment, MNF transforms the multi-band image into a new feature space. Compared with the principal component analysis method that ranks the main components according to the eigenvalues, NMF ranks the main components according to the SNR, and reduces the impact of noise by excluding the components with low SNR. Since the main information of the original hyperspectral image is retained, while reducing the computational complexity of subsequent algorithms, it also removes the impact of noise in the original hyperspectral image, which can effectively help improve the accuracy and reduce the computational complexity of subsequent anomaly detection tasks. 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 height, width, and the number of spectral dimensions respectively. d represents that the spectral dimension of the original hyperspectral image after MNF transformation is reduced from D to d.

[0083] Step S2, based on the constraints on the dictionary tensor, the coefficient tensor, and the anomaly tensor, construct a corresponding optimization model according to the hyperspectral image data.

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

[0085]

[0086] Among them, is the hyperspectral image, is the dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the anomaly tensor, is the dictionary tensor with a low-rank constraint imposed by the tensor nuclear norm, is the coefficient tensor with a sparse constraint imposed based on the L 1 norm, ||ε|| 1,1,2 is the anomaly tensor with a constraint imposed based on the L 1,1,2Anomaly tensor with joint sparse constraint of norm, and λ and β parameters are used to balance the anomaly tensor, the coefficient tensor and the dictionary tensor. m is set to be much smaller than the values of H and W to further reduce the computational amount.

[0087] As a preferred embodiment, λ ranges from 0.1 to 1, and β is 5 times that 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, thus achieving better detection effects.

[0088] Step S3, 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.

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

[0090] Convert the optimization model according to the following formula:

[0091]

[0092] Where and are both auxiliary variables, is the one with sparse constraint based on L 1 norm, and 1 is the one with sparse constraint based on L norm, is the one with low rank constraint of tensor nuclear norm This formula introduces the auxiliary variable

[0093] so that each variable can be iterated separately.

[0094] 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 solution.

[0094] The transformed augmented Lagrangian function is:

[0095]

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

[0097] For this optimization problem, by fixing one variable, solving the optimization problem related to this variable and iterating this variable, and alternatingly solving and iterating all variables to complete one update, and solving this optimization problem when converging after multiple updates. 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 during each iterative solution process. auxiliary variable When the abnormal tensor, the coefficient tensor, and the dictionary tensor satisfy the preset convergence condition, the abnormal tensor is obtained.

[0099] Regarding the update The solution of its related optimization sub-problem is as follows:

[0100]

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

[0102] Regarding the update The solution of its related optimization sub-problem is as follows:

[0103]

[0104] This sub-problem uses L 1 The threshold operator is used to solve the final update result.

[0105] Regarding the update of ε, the solution of its related optimization sub-problem is as follows:

[0106]

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

[0108] Regarding the update The solution of its related optimization sub-problem is as follows:

[0109]

[0110] This sub-problem uses the derivative of the optimization equation with respect to When the derivative is taken to be zero. Where is the identity tensor, defined as the tensor whose first forward slice is the identity matrix, represents taking the transpose of The transpose is defined as taking the transpose of each forward slice matrix of the tensor.

[0111] Regarding the update The solution to its related optimization sub - problem is as follows:

[0112]

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

[0114] Regarding the update of the three Lagrange multipliers and the penalty term coefficient μ is as follows:

[0115]

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

[0117] Update the Lagrange multipliers and the penalty term coefficient according to the augmented Lagrange method, where ρ > 1 is multiplied by a factor at each iteration, and the growth of the penalty term coefficient has a set upper bound μ max .

[0118] After updating the variables at each iteration, calculate the residual ∈ of the variable update. Determine whether to converge according to 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 abnormal tensor output according to the learning background dictionary algorithm, the final abnormal detection map matrix M is obtained. The expression of M is specifically:

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

[0123] where h is the height index of the abnormal detection map, w is the width index of the abnormal detection map, and ε is the abnormal tensor. h ∈ {1, …, H}, w ∈ {1, …, W}. The value of each pixel in the M matrix represents the degree of abnormality of that pixel. Determine whether the pixel is an abnormal pixel according to the magnitude of the degree - of - abnormality value, thus completing the detection of abnormalities in the hyperspectral image.

[0124] Furthermore, when the input data is and the hyperparameter m << min(H, W), for the update , the main time - consuming part is the calculation of singular value decomposition and discrete Fourier transform, and its complexity is The update and ε have similarities and respectively require and update and both require calculating the tensor product, transpose, and inverse operations. Let the number of iterations required for the algorithm to converge be k, then the overall time complexity of the solution algorithm is Therefore, small enough d and m can effectively reduce the solution time. The detection ability and running time of this embodiment are verified using MATLAB R2022a on a personal computer equipped with an Intel Core i9-12900K 3.20-GHz central processing unit, 64 GB of memory, and a 64-bit Windows 10 system. And this embodiment is verified by comparison on three datasets.

[0125] The first dataset is Pavia collected by the ROSIS sensor. The test image consists of 100×100 pixels, has 102 bands, the main background consists of water and bridges, and there are 71 abnormal pixels forming cars on the bridge. The second dataset is the airport data in Airport - Beach - Urban (ABU) captured by AVIRIS. The hyperspectral image for testing consists of 100×100 pixels, has 191 bands, and 60 abnormal pixels form three airplanes different from the grassland. The third dataset is the urban data in 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 form small abnormal buildings in the city.

[0126] Regarding how to compare anomaly detection algorithms, there are evaluation methods for visualizing detection effects such as directly observing the differences between the detection map and the ground truth map, the receiver operating characteristic curve (ROC), and box plots. Among them, the ROC curve is a curve that describes how the probability of detection (PD) changes with the false alarm rate (PF) under different thresholds τ for judging whether a pixel is abnormal. Generally, the area under the ROC curve (AUC PD,PF ) is used to quantitatively compare and evaluate the detection effects of anomaly detection algorithms. In addition to AUC PD,PF , there are also the area under the probability of detection curve (AUC PD,τ ) and the area under the false alarm rate curve (AUC PF,τ ). The goal is to find a method that can both maintain a high probability of detection and ensure a low false alarm rate.

[0127] In fact, for most methods, as the threshold for judging a pixel as abnormal increases and the false alarm rate decreases, the anomaly detection rate also decreases. Therefore, AUC PD,PF and AUC PD , the closer the τ index is to 1, the AUC PF, the closer the τ index is to 0, the better the method can distinguish anomalies in the background. In addition, AUC OD combines multiple indicators respectively and can conduct a more comprehensive and meaningful evaluation of the effectiveness of anomaly detection methods, and its definition is as follows:

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

[0129] In this embodiment, eight technical solutions are selected for comparison 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 classical statistic-based model, and the LRX model is an improvement based on GRX using a local window. LRASR and GTVLRR are low-rank representation-based models from the perspective of matrices. TPCA, PTA, and PCA-TLRSR are low-rank learning-based models from the perspective of tensors, where TPCA and PCA-TLRSR adopt the idea of low-rank representation. GAED is an advanced deep learning-based anomaly detection method. The detection performances of different methods are quantitatively compared through the AUC PD,PF and AUC OD indicators and the running time.

[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 the technical solution of this embodiment has the highest AUC PD,PF value on all three datasets, all exceeding 0.99. It can be seen that this embodiment has the characteristics of wide applicability and strong detection ability compared with the prior art.

[0133] On the datasets ABU-airport and ABU-urban, the AUC PD,PF value of the technical solution of this embodiment is much higher than that of other methods. On the dataset Pavia, the technical solution of this embodiment only differs from the optimal method by 0.003. For the AUC OD value, this solution achieves the sub-optimal on the datasets except the ABU-airport dataset, and the AUC ODThe difference in value 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,PFFor the values, the stability of ABU - airport and ABU - urban is particularly obvious. For the Pavia dataset, it can be found that when the parameter combinations are distributed in the diagonal region and λ is small, the detection effect is almost optimal 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 of the present invention can best exert its detection ability. Such parameter settings mean that the joint sparsity of the abnormal tensor and the low - rank property 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 effects, which proves that the background dictionary learning model is robust, insensitive to hyperparameters, and for different datasets, the range of optimal parameter combinations is relatively fixed, facilitating the practical application of this calculation scheme in different scenarios.

[0138] Another hyperparameter is the spatial dimension m of the tensors and , which affects the sizes of the background and coefficients as well as the running time of model solving. Fixing λ and β and taking m values from 2 to 12, it can be seen that on the three datasets, as m increases, the AUC PD,PF changes little, and the detection effect is better when m is small. Among them, on ABU - airport, the detection effect remains relatively stable when m changes, on ABU - urban, the AUC PD,PF value decreases when m is greater than 8, and on the Pavia dataset, the AUC PD,PF value shows a downward trend as m increases. Experiments prove that m can take relatively small values, that is, when the data scales of the background and coefficients are small, good detection effects can still be maintained. When m takes too large values, it may cause a reduction in the detection effect. The computational time required for model solving decreases as m becomes smaller. Therefore, the value of the hyperparameter m can be between 2 and 6, reducing the running time while ensuring the detection effect. The hyperparameter m also has a relatively wide selection range, which further indicates that this method is robust.

[0139] Correspondingly, referring to Figure 3 , the embodiment of the present invention also provides an abnormal detection device for hyperspectral images, including a constraint application module 101, a model construction module 102, and a detection module 103; wherein,

[0140] The constraint application module 101 is configured to obtain the hyperspectral image data to be detected, 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 abnormal tensor of the hyperspectral image data;

[0141] The model construction module 102 is configured to construct 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 configured to iteratively solve the optimization model to obtain the anomaly tensor; and calculate an 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] where is the hyperspectral image, is the dictionary tensor, is the coefficient tensor, represents the background part in the hyperspectral image, * is the tensor product operation, ε is the anomaly tensor, is the dictionary tensor with a low-rank constraint imposed by the tensor nuclear norm, is the coefficient tensor with a sparse constraint imposed based on the L 1 norm, ||ε|| 1,1,2 is the anomaly tensor with a joint sparse constraint imposed based on the L 1,1,2 norm, and the λ and β parameters are used to balance the anomaly 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 anomaly tensor, specifically:

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

[0148]

[0149] where and are both auxiliary variables, is the one with a sparse constraint imposed based on the L 1 norm and a sparse constraint imposed based on the L 1 norm, is the one with a low-rank constraint imposed by the tensor nuclear norm

[0150] Through the augmented Lagrangian method, the transformed optimization model is converted into an unconstrained optimization problem;

[0151] Iteratively solve the unconstrained optimization problem and update the auxiliary variables Auxiliary variable The abnormal tensor, the coefficient tensor, and the dictionary tensor obtain the abnormal tensor when meeting the preset convergence condition.

[0152] As a preferred solution, the detection module 103 converts the optimized model after conversion into an unconstrained optimization problem through the augmented Lagrangian method, specifically:[[]]

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

[0154]

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

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

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

[0158]

[0159] where k is the iteration number.

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

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

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

[0163] where 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 abnormal tensor.

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

[0165] The constraint application module 101 obtains the original hyperspectral image;

[0166] Performs filtering processing on the original hyperspectral image through the minimum noise separation transform method to obtain a noise matrix;

[0167] Uses the principal component analysis method to process the noise matrix to obtain the eigenvalues of the noise corresponding to each component;

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

[0169] Sort according to the signal-to-noise ratio, separate the minimum noise component, and 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. When the processor executes the computer program, the abnormal detection method of the hyperspectral image is implemented.

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

[0172] The memory can be used to store the computer program. 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 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic 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. The computer-readable storage medium includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the abnormal detection method for the hyperspectral image.

[0174] Among them, if the modules integrated in the abnormal detection device for the hyperspectral image are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above embodiment methods of the present invention, it can also be completed by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

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

[0176] An embodiment of the present invention provides a method, apparatus, terminal, and medium for anomaly detection of hyperspectral images. The anomaly detection method includes: obtaining hyperspectral image data to be detected, imposing a low-rank constraint on the dictionary tensor of the hyperspectral image data, imposing a sparse constraint on the coefficient tensor of the hyperspectral image data, and imposing a joint sparse constraint on the anomaly tensor of the hyperspectral image data; on the basis of imposing constraints on 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. Implementing the embodiments of the present application divides the hyperspectral image into a background tensor and an anomaly tensor, where the background is represented by the dictionary tensor and the coefficient tensor, taking advantage of the strong spatial and spectral correlation of the background in the hyperspectral image, that is, the low-rank property of the overall data tensor, making the anomaly detection have a better effect and effectively avoiding the situation where the distribution does not fit the actual distribution of the background data; in addition, by imposing a low-rank constraint on the dictionary tensor of the hyperspectral image data, imposing a sparse constraint on the coefficient tensor of the hyperspectral image data, and imposing a joint sparse constraint on the anomaly tensor of the hyperspectral image data, a more suitable background dictionary can be constructed, effectively distinguishing the dictionary tensor and the coefficient tensor, further optimizing the effect of anomaly detection and improving the accuracy and success rate of anomaly detection.

[0177] The specific embodiments described above further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only for the specific embodiments of the present invention and is not used to limit the protection scope of the present invention. In particular, it is pointed out that for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope 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; 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; The optimization model is iteratively solved to obtain the abnormal tensor, specifically: The optimization model is transformed according to the following formula: ; ; 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, and are auxiliary variables, For the sparse constraint based on L1 norm, the sparse constraint based on L1 norm is imposed. , is a tensor with low rank constraints imposed on its nuclear norm , For the application of L 1,1,2 Anomaly tensors for joint sparsity constraints of norms; 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 , the abnormal tensor, the coefficient tensor and the dictionary tensor, and when a preset convergence condition is satisfied, an abnormal tensor is obtained; During the update process, The optimization subproblem of is solved as follows: ; Where TSVT is the tensor singular value threshold operator, k is the number of iterations, is the penalty term coefficient, is the Lagrange multiplier; The optimization subproblem of is solved as follows: ; The optimization subproblem of is solved as follows: ; The optimization subproblem of is solved as follows: The optimization subproblem of is solved as follows: ; Lagrange multipliers and the penalty coefficient The updates are as follows: ; ; ; ; in, and Parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor, The upper bound set for the growth of the penalty term coefficient, For the growth multiple, is the unit 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 dictionary tensor with a low-rank constraint on the tensor nuclear norm, is a coefficient tensor with an L1-norm-based sparsity constraint.

3. The method for detecting anomalies in a hyperspectral image according to claim 1, 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, is the penalty coefficient.

4. The method for detecting anomalies in a hyperspectral image according to claim 1, 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.

5. 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: ; Wherein, M is the anomaly detection map matrix, h is the height index of the anomaly detection map, and w is the width index of the anomaly detection map. is an exception tensor.

6. 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.

7. 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; The detection module iteratively solves the optimization model to obtain the abnormal tensor, which is specifically: The detection module converts the optimization model according to the following formula: ; ; 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, and are auxiliary variables, For the sparse constraint based on L1 norm, the sparse constraint based on L1 norm is imposed. , is a tensor with low rank constraints imposed on its nuclear norm , For the application of L 1,1,2 Anomaly tensors for joint sparsity constraints of norms; 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 , the abnormal tensor, the coefficient tensor and the dictionary tensor, and when a preset convergence condition is satisfied, an abnormal tensor is obtained; During the update process, The optimization subproblem of is solved as follows: ; Where TSVT is the tensor singular value threshold operator, k is the number of iterations, is the penalty term coefficient, is the Lagrange multiplier; The optimization subproblem of is solved as follows: ; The optimization subproblem of is solved as follows: ; The optimization subproblem of is solved as follows: The optimization subproblem of is solved as follows: ; Lagrange multipliers and the penalty coefficient The updates are as follows: ; ; ; ; in, and Parameters are used to balance the exception tensor, the coefficient tensor and the dictionary tensor, The upper bound set for the growth of the penalty term coefficient, For the growth multiple, is the unit tensor.

8. 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 6 is implemented.

9. 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 detecting anomalies in a hyperspectral image according to any one of claims 1 to 6.