Hyperspectral image anomaly detection method, device and equipment and readable storage medium

By constructing training sample pairs and iterations of hyperspectral images, the initial reconstruction network is determined, training sample pairs and iterations of differential images are generated, differential images are generated, and the first and second distances of pixels are calculated. This solves the problem of anomalous pixel reconstruction in unsupervised and semi-supervised learning, improves the anomaly detection rate, and reduces the false alarm rate.

CN116503320BActive Publication Date: 2026-02-17AEROSPACE INFORMATION RES INST CAS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310179710.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-14
Publication Date
2026-02-17
Estimated Expiration
2043-02-14

AI Technical Summary

Technical Problem

Existing unsupervised and semi-supervised learning methods may reconstruct anomalous pixels in the reconstruction network, leading to reduced anomaly detection accuracy and increased false alarm rate. This is especially true when there are limited unlabeled samples, making it difficult to guarantee the anomaly detection rate and reduce the false alarm rate.

Method used

By determining the training sample pairs and iteration number of the hyperspectral image, an initial reconstruction network is constructed. The network weights are updated using an adaptive momentum stochastic optimization algorithm to generate a difference image. The first and second distances of the pixels are calculated to determine the anomaly score and achieve anomaly detection.

Benefits of technology

With limited unlabeled samples, the spatial-spectral joint information of hyperspectral images is fully utilized to construct training samples and generate an excellent background generator, which weakens the expression of abnormal features, improves the anomaly detection rate and reduces the false alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116503320B_ABST
    Figure CN116503320B_ABST
Patent Text Reader

Abstract

The application provides a hyperspectral image anomaly detection method, device and equipment and a readable storage medium. The method comprises the following steps: determining a training sample pair corresponding to an input hyperspectral image and an iteration number; determining a training reconstruction network according to an initial reconstruction network, a target function, the training sample pair and the iteration number; determining a difference image based on the input hyperspectral image and the training reconstruction network; determining an anomaly score of each pixel in the difference image according to a first distance and a second distance of each pixel in the difference image; and determining an anomaly detection result of the input hyperspectral image based on the anomaly score. The application solves the problem that a reconstruction network based on unsupervised and semi-supervised learning may reconstruct abnormal pixels, and ensures the anomaly detection rate and reduces the false alarm rate under the premise of using limited unlabeled samples.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hyperspectral image anomaly detection technology, and in particular to a hyperspectral image anomaly detection method, apparatus, device, and readable storage medium. Background Technology

[0002] Existing unsupervised learning methods do not require labeled data; instead, they use the entire hyperspectral image as training samples. However, a well-trained background generation model can reduce anomaly reconstruction errors, thus affecting the final detection accuracy. Meanwhile, the performance of semi-supervised learning models depends on the purity of the selected background samples, and the designed selection strategy increases the overall complexity of the algorithm. Furthermore, models employing input-output identity mapping reconstruction strategies may reconstruct some anomalous pixels, which will limit the model's detection performance. Therefore, the challenge lies in addressing the issue of unsupervised and semi-supervised learning-based reconstruction networks potentially reconstructing anomalous pixels, while maintaining anomaly detection rate and reducing false alarm rate using a limited number of unlabeled samples. Summary of the Invention

[0003] This invention provides a method, apparatus, device, and readable storage medium for anomaly detection in hyperspectral images, which addresses the problem that reconstruction networks based on unsupervised and semi-supervised learning may reconstruct anomalous pixels, and ensures anomaly detection rate and reduces false alarm rate when using a limited number of unlabeled samples.

[0004] This invention provides a method for detecting anomalies in hyperspectral images, comprising:

[0005] Determine the training sample pairs and iteration number corresponding to the input hyperspectral image;

[0006] The training reconstruction network is determined based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations.

[0007] Based on the input hyperspectral image and the trained reconstruction network, a difference image is determined;

[0008] Based on the first distance and the second distance of each pixel in the difference image, the anomaly score of each pixel in the difference image is determined;

[0009] The anomaly detection result of the input hyperspectral image is determined based on the anomaly score.

[0010] According to the present invention, a method for detecting anomalies in hyperspectral images, wherein determining the training sample pair corresponding to the input hyperspectral image includes:

[0011] Determine the image patch spatial size, selection ratio, and candidate window spatial size;

[0012] A first image block is selected centered on each pixel in the input hyperspectral image, and candidate pixels are selected in the first image block based on the selection ratio to construct a binary mask;

[0013] A candidate window is selected centered on the candidate pixel, a substitute pixel is selected within the candidate window, and a second image block is determined based on the substitute pixel.

[0014] Training sample pairs are determined based on the binary mask, the first image block, and the second image block.

[0015] According to a hyperspectral image anomaly detection method provided by the present invention, the hyperspectral image anomaly detection method further includes:

[0016] The initial reconstruction network consists of convolutional layers, each of which comprises a convolutional kernel, a batch normalization function, and a linear rectified function.

[0017] The residual network module is determined based on the convolutional layer, the learned weight parameters, and the batch normalization function.

[0018] Based on the input hyperspectral image, the linear rectified function, and the residual network module, the output of the initial reconstruction network is determined.

[0019] According to the present invention, a hyperspectral image anomaly detection method is provided, wherein determining the training reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations includes:

[0020] The network weights are updated based on the adaptive momentum stochastic optimization algorithm and the objective function.

[0021] The training and reconstruction network is determined based on the number of iterations and the updated network weights.

[0022] According to the present invention, a hyperspectral image anomaly detection method is provided, wherein determining the difference image based on the input hyperspectral image and the trained reconstruction network includes:

[0023] The input hyperspectral image is input into the trained reconstruction network to obtain the reconstructed image;

[0024] The difference between the input hyperspectral image and the reconstructed image is used to obtain a difference image.

[0025] According to a hyperspectral image anomaly detection method provided by the present invention, determining the anomaly score of each pixel in the differential image based on a first distance and a second distance in the differential image includes:

[0026] Determine the mean and covariance matrix of each pixel in the difference image;

[0027] Based on the mean and covariance matrix of each pixel in the difference image, a first distance and a second distance are determined for each pixel in the difference image, and the sum of the first distance and the second distance is taken as the anomaly score of each pixel in the difference image.

[0028] The present invention also provides a hyperspectral image anomaly detection device, comprising:

[0029] The training sample pair determination module is used to determine the training sample pairs and the number of iterations corresponding to the input hyperspectral image;

[0030] The training and reconstruction network determination module is used to determine the training and reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations.

[0031] The differential image determination module is used to determine the differential image based on the input hyperspectral image and the trained reconstruction network;

[0032] An anomaly score determination module is used to determine the anomaly score of each pixel in the difference image based on the first distance and the second distance of each pixel in the difference image;

[0033] An anomaly detection result determination module is used to determine the anomaly detection result of the input hyperspectral image based on the anomaly score.

[0034] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the hyperspectral image anomaly detection method as described above.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the hyperspectral image anomaly detection method as described above.

[0036] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the hyperspectral image anomaly detection method as described above.

[0037] The present invention provides a hyperspectral image anomaly detection method, apparatus, device, and readable storage medium. It determines the training sample pairs and iteration number corresponding to the input hyperspectral image, and then determines the training reconstruction network based on the initial reconstruction network, objective function, training sample pairs, and iteration number. Based on the input hyperspectral image and the training reconstruction network, a difference image is determined. The anomaly score of each pixel in the difference image is determined based on the first and second distances between pixels in the difference image. Finally, the anomaly detection result of the input hyperspectral image is determined based on the anomaly scores. Compared with existing technologies, the present invention can fully utilize the joint spatial-spectral information in hyperspectral images, constructing training samples and training a superior background generator through a self-supervised learning paradigm. Since the information of each pixel is reconstructed using spatial context information, the network's feature representation of anomalies is weakened. This achieves the effect of ensuring anomaly detection rate and reducing false alarm rate while using a limited number of unlabeled samples. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0039] Figure 1 This is one of the flowcharts of the hyperspectral image anomaly detection method provided by the present invention;

[0040] Figure 2 This is the second flowchart of the hyperspectral image anomaly detection method provided by the present invention;

[0041] Figure 3 This is the third flowchart of the hyperspectral image anomaly detection method provided by the present invention;

[0042] Figure 4 This is a schematic diagram of the structure of the hyperspectral image anomaly detection device provided by the present invention;

[0043] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0044] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0045] The following is combined with Figures 1-3 The present invention describes a hyperspectral image anomaly detection method.

[0046] Please refer to Figure 1 This invention provides a method for detecting anomalies in hyperspectral images, comprising:

[0047] Step 100: Determine the training sample pairs and iteration number corresponding to the input hyperspectral image;

[0048] Specifically, the hyperspectral image anomaly detection method provided in this embodiment is applied to anomaly detection in hyperspectral remote sensing images, such as... Figure 2 As shown, the process of obtaining training sample pairs includes: taking each pixel x in the input hyperspectral image as an example. i Select image patch centered The first image patch set P is formed o ={P o1 , ..., P oi , ..., P oN};exist The selection ratio is R. s The candidate pixels are rounded up, and a binary mask m is constructed. i ∈{0,1} P×P×L In a binary mask, the position of a 1 represents the position of a candidate pixel, forming a set of binary mask image patches M = {m1, ..., m}. i , ..., m N A candidate window is selected centered on the candidate pixel. A pixel is randomly selected within the candidate window to replace the central candidate pixel, resulting in an image block with the candidate pixel information erased. Forming the second image patch set P r ={P r1 , ..., P ri , ..., P rN The second image patch set (the image patch set with candidate pixel spectral information removed) P r The first set of image patches (the original set of image patches) P o And the set of binary masked image patches M is used to construct training sample pairs (P) r P o The number of iterations (M) includes the initial iteration count n0_iter and the total iteration count n_iter. The current iteration count can be represented as n c _iter.

[0049] Step 200: Determine the training reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations;

[0050] Specifically, the network model training process is as follows: 1. Input training sample pairs (P) r P o 1. Set the iteration count (n_iter) and the initial iteration count (n0_iter); 2. Build the reconstruction network and design the optimization objective function; 3. The current iteration count is equal to the initial iteration count; 4. Use the Adam (Adaptive Momentum) algorithm to update the network weights according to the objective function of the reconstruction network; 5. Update the current iteration count; 6. Determine whether the current iteration count is equal to the set iteration count. If yes, go to step 7; otherwise, go to step 4; Step 7: Output the trained reconstruction network, which is the trained reconstruction network in this embodiment.

[0051] Step 300: Determine the difference image based on the input hyperspectral image and the trained reconstruction network;

[0052] Specifically, the process of processing hyperspectral images to achieve anomaly detection includes: 1. Inputting a hyperspectral image, including the image patch spatial size, the selection ratio of candidate pixels, the spatial size of the candidate window, the number of iterations, and the initial number of iterations; 2. Obtaining an image patch set; 3. Constructing a training sample pair from the image patch set with candidate pixel spectral information removed, the original image patch set, and the binary mask image patch set; 4. Training the network model as described in the above embodiment; 5. Inputting the input hyperspectral image into the trained reconstruction network to obtain a reconstructed image; 6. Subtracting the original image from the reconstructed image to obtain a difference image. The core content of this embodiment is steps 5 and 6.

[0053] Step 400: Determine the anomaly score of each pixel in the difference image based on the first distance and the second distance of each pixel in the difference image;

[0054] Specifically, after obtaining the difference image in the above embodiment, the mean and covariance matrix of all pixels in the difference image are calculated. Simultaneously, a first distance and a second distance between pixels in the difference image are calculated, and the sum of the first and second distances is used as the anomaly score for each pixel in the input hyperspectral image.

[0055] Step 500: Determine the anomaly detection result of the input hyperspectral image based on the anomaly score.

[0056] Specifically, the sum of the first distance and the second distance is used as the anomaly score D(r1) for each pixel in the input hyperspectral image, where D(r1) = LD(r1). i )+MD(r i Finally, the anomaly detection result D of the input hyperspectral image is output. f Df ={D(r1), ...,D(r)} i ), ..., D(r) N )}.

[0057] This embodiment determines the training sample pairs and iteration number corresponding to the input hyperspectral image, and then determines the training reconstruction network based on the initial reconstruction network, objective function, training sample pairs, and iteration number. Based on the input hyperspectral image and the training reconstruction network, a difference image is determined. The anomaly score of each pixel in the difference image is determined based on the first and second distances between pixels. The anomaly detection result of the input hyperspectral image is then determined based on the anomaly scores. Compared with existing technologies, this invention can fully utilize the joint spatial-spectral information in hyperspectral images, constructing training samples and training a superior background generator through a self-supervised learning paradigm. Since the information of each pixel is reconstructed using spatial context information, the network's feature representation of anomalies is weakened, achieving the effect of ensuring anomaly detection rate and reducing false alarm rate while using a limited number of unlabeled samples.

[0058] Please refer to Figure 3 In one embodiment, the hyperspectral image anomaly detection method provided in this application may further include:

[0059] Step 110: Determine the image patch spatial size, selection ratio, and candidate window spatial size;

[0060] Step 120: Select a first image block centered on each pixel in the input hyperspectral image, select candidate pixels in the first image block based on the selection ratio, and construct a binary mask;

[0061] Step 130: Select a candidate window centered on the candidate pixel, select a replacement pixel within the candidate window, and determine a second image block based on the replacement pixel;

[0062] Step 140: Based on the binary mask, the first image block, and the second image block, determine the training sample pair.

[0063] Specifically, the process of obtaining training sample pairs includes: 1. Output: Obtaining a set of image patches (X, P, R). s ,W), where X is the input hyperspectral image in this embodiment, P is the image patch spatial size in this embodiment, and R s 1. The selection ratio of candidate pixels in this embodiment is given by W, where W is the spatial size of the candidate window in this embodiment; 2. Start iterating through each pixel of the hyperspectral image; 3. Using each pixel x in the input hyperspectral image... i Select image patch centered That is, for the first image block in this embodiment, the four sides of X need to be mirrored and extended in advance; 4. In The selection ratio is R. s The candidate pixels are selected, and a binary mask m is constructed. i ∈{0,1} P×P×L Here, position 1 indicates the position of the candidate pixel; 5. Select a candidate window (size W×W) centered on the candidate pixel; 6. Randomly select a pixel within the candidate window to replace the central candidate pixel, resulting in an image block with the candidate pixel information erased. That is, the second image block in this embodiment; 7. End the loop.

[0064] Output: Original image patch set P o ={P o1 , ..., P oi , ..., P oN}, the set of image patches P from which the spectral information of candidate pixels has been removed r ={P r1 , ..., P ri , ..., P rN}, the set of binary mask image blocks M = {m1, ..., m} i , ..., m N}, the set of image patches P from which the spectral information of candidate pixels has been removed r Original image patch set P o And the set of binary masked image patches M is used to construct training sample pairs (P) r P o The number of iterations (M) includes the initial iteration count n0_iter and the total iteration count n_iter. The current iteration count can be represented as n c _iter.

[0065] This embodiment determines training sample pairs by using the original image patch set, the image patch set with candidate pixel information removed, and the binary mask image patch set, thus laying the data foundation for anomaly detection in hyperspectral images.

[0066] In one embodiment, the hyperspectral image anomaly detection method provided in this application may further include:

[0067] Step 10: The initial reconstruction network consists of convolutional layers, each of which comprises a convolutional kernel, a batch normalization function, and a linear rectified function.

[0068] Step 20: Determine the residual network module based on the convolutional layer, the learned weight parameters, and the batch normalization function;

[0069] Step 30: Based on the input hyperspectral image, the linear rectified function, and the residual network module, determine the output of the initial reconstruction network.

[0070] Specifically, the reconstruction network G mainly consists of nested residual networks. The seven convolutional layers have 3×3 kernels and contain two residual network modules, each with two convolutional layers followed by a Batch Normalization (BN) function. The first layer also ends with a ReLU (Rectified Linear Unit) function. The residual network module is represented as follows: Among them, W C ={W C W c ′} and W RC These are the learnable weight parameters of the convolutional layer and the residual network module, respectively. If the input to the reconstruction network G is a set of image patches... Image block P in ri The output can then be represented as in, The entire process is now denoted as G(W). G P r ) = P b ,in, It is to reconstruct all the learnable weight parameters of network G. It is a set of output image patches.

[0071] This embodiment determines the output of the initial reconstruction network by inputting a hyperspectral image, a linear rectified function, and a residual network module, thus laying the model foundation for anomaly detection in hyperspectral images.

[0072] In one embodiment, the hyperspectral image anomaly detection method provided in this application may further include:

[0073] Step 210: Update the network weights based on the adaptive momentum stochastic optimization algorithm and the objective function;

[0074] Step 220: Determine the training and reconstruction network based on the number of iterations and the updated network weights.

[0075] Specifically, the network model is reconstructed and trained using train_net((P) r P o The process is as follows: 1. Input: Training sample pairs (P, M), n_iter, n0_iter) r P o 1. M), iteration count n_iter, initial iteration count n0_iter; 2. Construct the reconstruction network G and design the optimization objective function L. self3. The current iteration number is equal to the initial iteration number n. c _iter = n0_iter; 4. Using the Adam algorithm, i.e., the adaptive momentum stochastic optimization algorithm in this embodiment, update the network weights W according to the objective function of the reconstructed network. G 5. Update the current iteration count, let n c _iter=n c _iter+1; 6. Determine: The current iteration number equals the set iteration number. If yes, go to step 7; otherwise, go to step 4; Step 7. Output: The trained reconstructed network G t (W G * ), which is the training and reconstruction network in this embodiment.

[0076] This embodiment updates the network weights based on the adaptive momentum stochastic optimization algorithm and the objective function. According to the number of iterations and the updated network weights, the trained reconstruction network is determined, thus establishing a trained reconstruction network model for anomaly detection in hyperspectral images.

[0077] In one embodiment, the hyperspectral image anomaly detection method provided in this application may further include:

[0078] Step 310: Input the input hyperspectral image into the trained reconstruction network to obtain the reconstructed image;

[0079] Step 320: Subtract the input hyperspectral image from the reconstructed image to obtain a difference image.

[0080] Specifically, the hyperspectral image anomaly detection method provided in this embodiment processes the hyperspectral image to achieve anomaly detection. The process includes: 1. Inputting a hyperspectral image X, image patch spatial size P, and candidate pixel selection ratio R. s The candidate window's spatial size W, the number of iterations n_iter, and the initial number of iterations n0_iter; 2. The step of obtaining the image patch set, P r P o M = get_patches(X, P, R) s , W); 3. Image patch set P with candidate pixel spectral information erased r Original image patch set P o And the set of binary masked image patches M is used to construct training sample pairs (P) r P o , M); 4. Perform the network model training steps as described in the above embodiments, G t =train_net((P r P o, M), n_iter, n0_iter); 5. Input the input hyperspectral image X into the trained reconstruction network G t In the process, the reconstructed image X is obtained. s X s =G t (W G * 6. Combine the original image X and the reconstructed image X. s By taking the difference, we obtain the difference image R, where R = XX. s The core content of this embodiment is steps 5 and 6.

[0081] In this embodiment, the input hyperspectral image is input into the training reconstruction network to obtain the reconstructed image. The difference between the input hyperspectral image and the reconstructed image is obtained to obtain the difference image, which lays the data foundation for anomaly detection of hyperspectral images.

[0082] In one embodiment, the hyperspectral image anomaly detection method provided in this application may further include:

[0083] Step 410: Determine the mean and covariance matrix of each pixel in the difference image;

[0084] Step 420: Based on the mean and covariance matrix of each pixel in the difference image, determine the first distance and the second distance of each pixel in the difference image, and use the sum of the first distance and the second distance as the anomaly score of each pixel in the difference image.

[0085] Specifically, after obtaining the difference image R in the above embodiment, all pixels of the difference image R are calculated. mean μ r The covariance matrix C r The mean μ is calculated using Formula 1. r The covariance matrix C is calculated using Formula 2. r Simultaneously, the pixel r in the difference image R is calculated using Formula 3. i The L2 distance (i.e., the first distance in this embodiment) is used to calculate the pixel r in the difference image R using Formula 4. i The Mahalanobis distance (i.e., the second distance in this embodiment) is calculated, and the sum of the two is used as the anomaly score D(r1) for each pixel in the image, where D(r1) = LD(r1). i )+MD(r i Finally, the anomaly detection result D of the input hyperspectral image is output. f D f ={D(r1), ...,D(r)} i ), ..., D(r) N )}.

[0086]

[0087]

[0088] LD(r i )=||r i ||2 Formula 3

[0089]

[0090] This embodiment determines the mean and covariance matrix of each pixel in the difference image, and then determines the anomaly score of each pixel in the difference image based on the mean and covariance matrix of each pixel in the difference image, thus establishing a quantitative basis for anomaly detection in hyperspectral images.

[0091] The hyperspectral image anomaly detection device provided by the present invention is described below. The hyperspectral image anomaly detection device described below can be referred to in correspondence with the hyperspectral image anomaly detection method described above.

[0092] Please refer to Figure 4 The present invention also provides a hyperspectral image anomaly detection device, comprising:

[0093] The training sample pair determination module 401 is used to determine the training sample pairs and the number of iterations corresponding to the input hyperspectral image;

[0094] The training reconstruction network determination module 402 is used to determine the training reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations.

[0095] The differential image determination module 403 is used to determine the differential image based on the input hyperspectral image and the trained reconstruction network;

[0096] Anomaly score determination module 404 is used to determine the anomaly score of each pixel in the difference image based on the first distance and the second distance of each pixel in the difference image;

[0097] Anomaly detection result determination module 405 is used to determine the anomaly detection result of the input hyperspectral image based on the anomaly score.

[0098] Optionally, the training sample pair determination module includes:

[0099] The first determining unit is used to determine the image patch spatial size, selection ratio, and candidate window spatial size;

[0100] The first selection unit is used to select a first image block centered on each pixel in the input hyperspectral image, select candidate pixels in the first image block based on the selection ratio, and construct a binary mask.

[0101] The second selection unit is used to select a candidate window centered on the candidate pixel, select a substitute pixel within the candidate window, and determine a second image block based on the substitute pixel.

[0102] The training sample pair determination unit is used to determine training sample pairs based on the binary mask, the first image block, and the second image block.

[0103] Optionally, the hyperspectral image anomaly detection device further includes:

[0104] The initial reconstruction network consists of convolutional layers, each of which comprises a convolutional kernel, a batch normalization function, and a linear rectified function.

[0105] The residual network module determination module is used to determine the residual network module based on the convolutional layer, the learned weight parameters, and the batch normalization function;

[0106] The output determination module of the initial reconstruction network is used to determine the output of the initial reconstruction network based on the input hyperspectral image, the linear rectified function, and the residual network module.

[0107] Optionally, the training and reconstruction network determination module includes:

[0108] The network weight update unit is used to update the network weights based on the adaptive momentum stochastic optimization algorithm and the objective function.

[0109] The training and reconstruction network determination unit is used to determine the training and reconstruction network based on the number of iterations and the updated network weights.

[0110] Optionally, the differential image determination module includes:

[0111] The image reconstruction determination unit is used to input the input hyperspectral image into the trained reconstruction network to obtain the reconstructed image;

[0112] The differential image determination unit is used to subtract the input hyperspectral image from the reconstructed image to obtain a differential image.

[0113] Optionally, the abnormal score determination module includes:

[0114] The second determining unit is used to determine the mean and covariance matrix of each pixel in the difference image;

[0115] The distance determination unit is used to determine a first distance and a second distance for each pixel in the difference image based on the mean and covariance matrix of each pixel in the difference image, and to use the sum of the first distance and the second distance as the anomaly score of each pixel in the difference image.

[0116] Figure 5An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a hyperspectral image anomaly detection method.

[0117] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the hyperspectral image anomaly detection method provided by the above methods.

[0119] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the hyperspectral image anomaly detection methods provided by the methods described above.

[0120] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0121] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for detecting anomalies in hyperspectral images, characterized in that, include: Determine the training sample pairs and the number of iterations corresponding to the input hyperspectral image; The training reconstruction network is determined based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations. Based on the input hyperspectral image and the trained reconstruction network, a difference image is determined; Based on the first distance and the second distance of each pixel in the difference image, the anomaly score of each pixel in the difference image is determined; The anomaly detection result of the input hyperspectral image is determined based on the anomaly score; The process of determining the training sample pair corresponding to the input hyperspectral image includes: determining the spatial size of the image patch, the selection ratio, and the spatial size of the candidate window; selecting a first image patch centered on each pixel in the input hyperspectral image, selecting candidate pixels in the first image patch based on the selection ratio, and constructing a binary mask; selecting a candidate window centered on the candidate pixels, selecting substitute pixels within the candidate window, and determining a second image patch based on the substitute pixels; and determining the training sample pair based on the binary mask, the first image patch, and the second image patch. The step of determining the outlier score of each pixel in the difference image based on the first distance and the second distance of each pixel in the difference image includes: determining the mean and covariance matrix of each pixel in the difference image; determining the first distance and the second distance of each pixel in the difference image based on the mean and covariance matrix of each pixel in the difference image; and taking the sum of the first distance and the second distance as the outlier score of each pixel in the difference image.

2. The hyperspectral image anomaly detection method according to claim 1, characterized in that, The hyperspectral image anomaly detection method further includes: The initial reconstruction network consists of convolutional layers, each of which comprises a convolutional kernel, a batch normalization function, and a linear rectified function. The residual network module is determined based on the convolutional layer, the learned weight parameters, and the batch normalization function. Based on the input hyperspectral image, the linear rectified function, and the residual network module, the output of the initial reconstruction network is determined.

3. The hyperspectral image anomaly detection method according to claim 1, characterized in that, The step of determining the training reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations includes: The network weights are updated based on the adaptive momentum stochastic optimization algorithm and the objective function. The training and reconstruction network is determined based on the number of iterations and the updated network weights.

4. The hyperspectral image anomaly detection method according to claim 1, characterized in that, The step of determining the difference image based on the input hyperspectral image and the trained reconstruction network includes: The input hyperspectral image is input into the trained reconstruction network to obtain the reconstructed image; The difference between the input hyperspectral image and the reconstructed image is used to obtain a difference image.

5. A hyperspectral image anomaly detection device, characterized in that, include: The training sample pair determination module is used to determine the training sample pairs and the number of iterations corresponding to the input hyperspectral image; The process of determining the training sample pair corresponding to the input hyperspectral image includes: determining the spatial size of the image patch, the selection ratio, and the spatial size of the candidate window; selecting a first image patch centered on each pixel in the input hyperspectral image, selecting candidate pixels in the first image patch based on the selection ratio, and constructing a binary mask; selecting a candidate window centered on the candidate pixels, selecting substitute pixels within the candidate window, and determining a second image patch based on the substitute pixels; and determining the training sample pair based on the binary mask, the first image patch, and the second image patch. The training and reconstruction network determination module is used to determine the training and reconstruction network based on the initial reconstruction network, the objective function, the training sample pairs, and the number of iterations. The differential image determination module is used to determine the differential image based on the input hyperspectral image and the trained reconstruction network; An anomaly score determination module is used to determine the anomaly score of each pixel in the difference image based on a first distance and a second distance between each pixel in the difference image. The determination of the anomaly score based on the first distance and the second distance between each pixel in the difference image includes: determining the mean and covariance matrix of each pixel in the difference image; determining the first distance and the second distance between each pixel in the difference image based on the mean and covariance matrix; and using the sum of the first distance and the second distance as the anomaly score of each pixel in the difference image. An anomaly detection result determination module is used to determine the anomaly detection result of the input hyperspectral image based on the anomaly score.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the hyperspectral image anomaly detection method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the hyperspectral image anomaly detection method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the hyperspectral image anomaly detection method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Image anomaly detection method based on variational auto-encoder

    CN111598881A

  • Region of interest weighted anomaly detection

    US20200104990A1