A hyperspectral image anomaly detection method, device and medium

By training a two-stage detection and anti-similarity optimization coding network, a reconstructed background image of a hyperspectral image is constructed, which solves the problem of abnormal target contamination in background reconstruction and improves the accuracy and robustness of detection.

CN121505460BActive Publication Date: 2026-03-31NANCHANG HANGKONG UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing hyperspectral image anomaly detection methods have difficulty completely eliminating the contamination of anomalous targets during background reconstruction, leading to a decrease in background reconstruction accuracy and affecting detection performance.

Method used

A two-stage detection method is adopted. First, the target pixels are determined by preliminary detection and an initial background image is constructed. Then, the anti-similarity optimization coding network is trained under the constraints of reconstruction loss and anti-similarity loss to obtain the reconstructed background image. The anomaly detection image is obtained by calculating the difference between the hyperspectral image and the reconstructed background image.

Benefits of technology

It significantly reduces the pollution of background reconstruction by abnormal targets, improves the accuracy and robustness of target detection, and effectively meets the detection needs in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121505460B_ABST
    Figure CN121505460B_ABST
Patent Text Reader

Abstract

The application discloses a hyperspectral image anomaly detection method, device and medium, relates to the technical field of hyperspectral image processing, and comprises the following steps: acquiring a hyperspectral image, performing preliminary detection on the hyperspectral image to obtain a preliminary detection result, replacing the pixel value of each target pixel point in the hyperspectral image and the pixel value of a neighborhood pixel point to obtain an initial background image, taking the initial background image as input, training an anti-similarity optimization coding network under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model, and reconstructing the initial background image by using the trained model to obtain a reconstructed background image, calculating the difference between the hyperspectral image and the reconstructed background image to obtain a hyperspectral anomaly detection image. The application can significantly improve the accuracy and robustness of target detection, and better cope with detection requirements in various complex scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of hyperspectral image processing technology, and in particular to a method, device and medium for detecting anomalies in hyperspectral images. Background Technology

[0002] Hyperspectral imaging, a highly efficient imaging technology, provides high-resolution hyperspectral images that simultaneously acquire rich spectral and spatial information, offering unique solutions for multiple fields. Hyperspectral images contain numerous bands, typically hundreds or even thousands of consecutive bands, enabling them to provide diagnostic spectral characteristics of ground features. This characteristic makes hyperspectral imaging widely applicable in areas such as anomaly detection, environmental monitoring, resource exploration, food safety, and medical diagnosis.

[0003] Currently, anomaly detection methods based on background reconstruction are widely used and highly effective. The basic idea behind these methods is that most regions in a hyperspectral image can be represented linearly or non-linearly by a low-dimensional background subspace, while anomalous targets cannot be effectively reconstructed from this subspace. Therefore, anomalous targets are detected by analyzing the reconstruction error. However, these methods have a common drawback: it is difficult to completely eliminate contamination from anomalous targets when reconstructing the background. If anomalous targets are mixed into the background training samples used for reconstruction, the learned background subspace will be impure. This contamination leads to decreased background reconstruction accuracy and significantly weakens the reconstruction error of anomalous targets, ultimately degrading detection performance.

[0004] Therefore, it is necessary to design a hyperspectral image anomaly detection method that can significantly reduce the contamination of background reconstruction by anomalous targets, ensure the accuracy of background reconstruction, and thus effectively distinguish between background and target, ultimately achieving the goals of suppressing false alarms, reducing missed detections, and improving overall detection performance. Summary of the Invention

[0005] The purpose of this application is to provide a method, device and medium for anomaly detection in hyperspectral images, which can significantly improve the accuracy and robustness of target detection, so as to better meet the detection needs in various complex scenarios.

[0006] To achieve the above objectives, this application provides the following solution.

[0007] In a first aspect, this application provides a method for detecting anomalies in hyperspectral images, the method comprising:

[0008] Acquire hyperspectral images;

[0009] The hyperspectral image is subjected to preliminary detection to obtain preliminary detection results; the preliminary detection results are used to determine each pixel in the hyperspectral image as a target pixel belonging to the target or a background pixel not belonging to the target.

[0010] For each target pixel in the hyperspectral image, an average background pixel value is calculated based on the pixel value of the target pixel and the pixel values ​​of the corresponding neighboring pixels. The average background pixel value is then used to replace the pixel values ​​of the target pixel and the neighboring pixels to obtain an initial background image.

[0011] For any two target pixels in the hyperspectral image, the pixel values ​​of the two target pixels are extracted, and the similarity between the pixel values ​​of the two target pixels is calculated. If the similarity is greater than a preset similarity, one of the two target pixels is randomly removed to remove redundant target pixels and obtain the filtered target pixels.

[0012] Using the initial background image as input, an anti-similarity optimization coding network is trained under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model. The trained model is then used to reconstruct the initial background image to obtain a reconstructed background image. The reconstruction loss is the difference between the pixel values ​​of pixels in the predicted background image and the pixel values ​​of pixels in the initial background image. The anti-similarity loss is the difference between the pixel values ​​of pixels in the predicted background image and the pixel values ​​of the selected target pixels in the hyperspectral image. The predicted background image is the image obtained by the anti-similarity optimization coding network reconstructing the initial background image.

[0013] The difference between the hyperspectral image and the reconstructed background image is calculated to obtain the hyperspectral anomaly detection image.

[0014] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the above-described hyperspectral image anomaly detection method.

[0015] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described hyperspectral image anomaly detection method.

[0016] According to the specific embodiments provided in this application, this application has the following technical effects.

[0017] This application provides a method, device, and medium for anomaly detection in hyperspectral images. First, a preliminary detection is performed on the hyperspectral image to obtain preliminary detection results, identifying target pixels belonging to the target in the hyperspectral image. For each target pixel in the hyperspectral image, an average background pixel value is calculated based on the pixel value of the target pixel and the pixel values ​​of its corresponding neighboring pixels. This average background pixel value is then used to replace the pixel values ​​of the target pixel and its neighboring pixels to obtain an initial background image. Next, using this initial background image as input, an anti-similarity optimization coding network is trained under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model. This trained model is then used to reconstruct the initial background image to obtain a reconstructed background image. Finally, the difference between the hyperspectral image and the reconstructed background image is calculated to obtain a hyperspectral anomaly detection image. This application designs a two-stage detection system. First, preliminary detection identifies target pixels, enabling preliminary detection of targets of different sizes. These preliminarily detected targets are then removed to obtain an initial background image. Next, network learning is performed, incorporating reconstruction loss and inverse similarity loss. The reconstruction loss is the difference between the pixel values ​​of the predicted background image and those of the initial background image. The inverse similarity loss is the difference between the pixel values ​​of the predicted background image and the pixel values ​​of the filtered target pixels in the hyperspectral image (i.e., the remaining target pixels after removing redundant target pixels). This allows for further removal of targets from the reconstructed background image (i.e.,...). The process involves removing targets not detected in the initial detection and targets mistakenly generated during reconstruction to obtain a reconstructed background image. By removing targets twice, the reconstructed background image can be more effectively cleaned, minimizing the inclusion of target pixels and resulting in a "cleaner" background. This significantly reduces the contamination of the background reconstruction by abnormal targets. Finally, the difference between the hyperspectral image and the reconstructed background image is calculated to obtain the hyperspectral anomaly detection image, thus completing the target detection. This ultimately achieves the goals of suppressing false alarms, reducing missed detections, and improving overall detection performance, thereby significantly improving the accuracy and robustness of target detection to better meet the detection needs of various complex scenarios. Attached Figure Description

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

[0019] Figure 1 This is an application environment diagram for a hyperspectral image anomaly detection method provided in Embodiment 1 of this application.

[0020] Figure 2This is a flowchart illustrating a hyperspectral image anomaly detection method provided in Embodiment 1 of this application.

[0021] Figure 3 This is a schematic diagram of the technical route of a hyperspectral image anomaly detection method provided in Embodiment 1 of this application.

[0022] Figure 4 This is a schematic diagram of the anti-similarity optimization coding network provided in Embodiment 1 of this application.

[0023] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 2 of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] Example 1.

[0026] The hyperspectral image anomaly detection method provided in this application can be applied to, for example... Figure 1The application environment shown depicts a scenario where the terminal communicates with the server via a network. The data storage system stores the data the server needs to process. This data storage system can be configured independently, integrated into the server, or located in the cloud or on another server. The terminal can send an anomaly detection request to the server. Upon receiving the request, the server acquires a hyperspectral image, performs preliminary detection, and obtains preliminary detection results. For each target pixel in the hyperspectral image, the server calculates the average background pixel value based on the pixel value of the target pixel and the pixel values ​​of its neighboring pixels. This average background pixel value is then used to replace the pixel values ​​of the target pixel and its neighbors, resulting in an initial background image. For any two target pixels in the hyperspectral image, the server extracts their pixel values ​​and calculates the similarity between them. If the similarity is greater than a preset similarity, one of the two target pixels is randomly removed to eliminate redundant pixels, resulting in a filtered target pixel. Using the initial background image as input, the server trains an anti-similarity optimization coding network under the constraints of reconstruction loss and anti-similarity loss, obtaining a trained model. This trained model is then used to reconstruct the initial background image, resulting in a reconstructed background image. Finally, the server calculates the difference between the hyperspectral image and the reconstructed background image to obtain the hyperspectral anomaly detection image. The server can send the anomaly detection result, the hyperspectral anomaly detection image obtained in response to the anomaly detection request, back to the terminal.

[0027] In addition, in some embodiments, the hyperspectral image anomaly detection method can also be implemented by a server or a terminal alone. For example, the terminal can directly process the anomaly detection request to be processed, or the server can obtain the anomaly detection request to be processed from the data storage system and process it.

[0028] In one exemplary embodiment, such as Figure 2 As shown, a hyperspectral image anomaly detection method is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 The following steps are used as an example of a server in the example.

[0029] Step S1: Acquire a hyperspectral image.

[0030] Step S2: Perform preliminary detection on the hyperspectral image to obtain preliminary detection results; the preliminary detection results are used to determine each pixel in the hyperspectral image as a target pixel belonging to the target or a background pixel not belonging to the target.

[0031] Step S3: For each target pixel in the hyperspectral image, an average background pixel value is calculated based on the pixel value of the target pixel and the pixel values ​​of the corresponding neighboring pixels. The average background pixel value is then used to replace the pixel values ​​of the target pixel and the neighboring pixels to obtain an initial background image.

[0032] Step S4: For any two target pixels in the hyperspectral image, extract the pixel values ​​of the two target pixels and calculate the similarity between the pixel values ​​of the two target pixels. If the similarity is greater than a preset similarity, randomly remove one of the two target pixels to remove redundant target pixels and obtain the filtered target pixels.

[0033] Step S5: Using the initial background image as input, the anti-similarity optimization coding network is trained under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model. The trained model is then used to reconstruct the initial background image to obtain a reconstructed background image. The reconstruction loss is the difference between the pixel values ​​of the predicted background image and the pixel values ​​of the initial background image. The anti-similarity loss is the difference between the pixel values ​​of the predicted background image and the pixel values ​​of the selected target pixels in the hyperspectral image. The predicted background image is the image obtained by the anti-similarity optimization coding network reconstructing the initial background image.

[0034] Step S6: Calculate the difference between the hyperspectral image and the reconstructed background image to obtain a hyperspectral anomaly detection image.

[0035] By implementing steps S1 to S6 above, this embodiment first performs background replacement on the hyperspectral image based on the preliminary detection results obtained from the preliminary detection, to obtain an initial background image. Targets of different sizes are initially removed, and then the initial background image is reconstructed using an anti-similarity optimization coding network to obtain a reconstructed background image. Targets of different sizes are further removed, resulting in a "clean" background image that contains almost no targets of any size. Finally, the reconstructed background image is subtracted from the hyperspectral image to obtain a hyperspectral anomaly detection image containing targets of different sizes. This significantly improves the accuracy and robustness of target detection, better meeting the detection needs of various complex scenarios.

[0036] The following, combined with Figure 3 The hyperspectral image anomaly detection method used in this embodiment is described in detail, including the following steps.

[0037] (a) Input hyperspectral image.

[0038] This embodiment first acquires and inputs a three-dimensional hyperspectral image. X This hyperspectral image X The pixel value of each pixel is spectral data, including the pixel value of that pixel in each of multiple bands (i.e., reflectivity or radiance).

[0039] In this embodiment, a hyperspectral image is acquired.

[0040] (II) Preliminary detection of multi-scale targets.

[0041] Traditional methods are designed for targets at specific scales and lack the ability to adaptively detect anomalies across all scales, from "point-like" to "area-like" anomalies. To address this issue, this embodiment applies the input hyperspectral image... X The target in the image is initially detected at multiple scales. Specifically, two parallel statistical methods are used to detect targets at different scales, and the results are combined to obtain the initial detection results. S T .

[0042] At this point, in this embodiment, a preliminary detection is performed on the hyperspectral image to obtain a preliminary detection result. The preliminary detection result is used to determine each pixel in the hyperspectral image as a target pixel belonging to the target or a background pixel not belonging to the target, that is, to determine the type of each pixel in the hyperspectral image, including target pixels and background pixels.

[0043] The preliminary detection of hyperspectral images to obtain preliminary detection results includes the following steps.

[0044] (1) The hyperspectral image is subjected to anomaly detection using the sliding window method and the RX algorithm (Reed-Xiaoli Detector, a classic hyperspectral image anomaly detection algorithm) to obtain the first detection result. The first detection result is used to determine each pixel in the hyperspectral image as a target pixel belonging to the target or a background pixel not belonging to the target.

[0045] For the input hyperspectral image XMirror filling is performed, expanding outwards by 15 pixels (or other values) to facilitate subsequent processing of edge pixels in the hyperspectral image, resulting in a filled hyperspectral image. For each pixel in the hyperspectral image, a 31×31 (or other values, but ensuring the length or width of the small window minus 1 is twice the number of expanded pixels) small window is applied in the filled hyperspectral image using the sliding window method, centered on that pixel. The RX value of the small window corresponding to that pixel is calculated using the RX algorithm. By setting the RX threshold to 23 (or other values, manually determined based on the type of target to be detected), pixels with RX values ​​greater than the RX threshold are identified as target pixels; otherwise, they are considered background pixels, yielding the first detection result. S RX .

[0046] (2) For each pixel in the hyperspectral image, calculate the comprehensive Z score of the pixel. If the comprehensive Z score is greater than 0, the pixel is the target pixel. This is used to perform anomaly detection on the hyperspectral image and obtain the second detection result. The second detection result is used to determine each pixel in the hyperspectral image as either a target pixel belonging to the target or a background pixel not belonging to the target.

[0047] For each pixel in the hyperspectral image, the overall Z-score of the pixel is calculated. Specifically, for each band in the hyperspectral image, based on the pixel value in the band, the initial Z-score of the pixel in the band is calculated. If the initial Z-score is greater than the preset Z-score (e.g., 6.5, or other values ​​that need to be manually determined according to the type of target to be detected), then the pixel is the initial target pixel, and the Z-score of the pixel in the band is set to 1. Otherwise, the Z-score of the pixel in the band is set to 0. The Z-scores of the pixel in all bands are summed to obtain the overall Z-score of the pixel.

[0048] For the input hyperspectral image X Each band is filled with a reflection boundary, extending outwards ( - 1) / 2 ( For example, the size of the neighborhood window. =15 (of course, it can be replaced with other values, but it needs to be an odd number) pixels, and a ring of reflective boundary pixels is added to each band to obtain the hyperspectral image after the reflective boundary is filled.

[0049] Based on the pixel value of a pixel in the band, the initial Z-score of the pixel in the band is calculated. Specifically, this includes: using mean filtering to quickly calculate the local mean and local standard deviation of the neighborhood window corresponding to the pixel, obtaining the local mean and local standard deviation of the pixel in the band, and calculating the initial Z-score of the pixel in the band based on the pixel value, local mean, and local standard deviation of the pixel in the band. The larger the absolute value of the initial Z-score, the more the pixel deviates from the local background in the band.

[0050] Specifically, in terms of pixels ( , Centered on ) , Here, represents the row and column numbers of the pixel in the hyperspectral image, indicating the pixel's position within the hyperspectral image. After the reflection boundary is filled, the value in the hyperspectral image is taken as [value missing]. × The neighborhood window, as a pixel ( , For the corresponding neighborhood window, calculate the local mean of the pixel values ​​of all pixels within that neighborhood window. and local standard deviation Further calculations yielded the pixel points ( , In the band The initial Z-score.

[0051] The formula for calculating the initial Z-score is:

[0052] ;

[0053] in, The first hyperspectral image represents the One band; , and Indicates size is × The local mean, local variance, and local standard deviation of the neighborhood window; Pixels in the hyperspectral image after filling the reflection boundary In the band Pixel values; To avoid a small constant with a denominator of 0, we can take 10. -8 ; For pixels in a hyperspectral image ( , In the band The initial Z-score; For pixels in a hyperspectral image ( , In the band The pixel value.

[0054] After calculating the initial Z score, if the initial Z score is greater than the preset Z score, then the pixel is the initial target pixel, and the Z score of the pixel in the band is set to 1; otherwise, the Z score of the pixel in the band is set to 0.

[0055] The Z-score of a pixel is obtained by summing the Z-scores across all bands. The formula for calculating the comprehensive Z-score is as follows:

[0056] ;

[0057] in, For pixels in a hyperspectral image ( , The overall Z-score; B This represents the number of bands in the hyperspectral image. For pixels in a hyperspectral image ( , In the band The Z-score.

[0058] After obtaining the comprehensive Z-score for each pixel in the hyperspectral image, the comprehensive detection result is obtained. Z Then, based on the comprehensive test results Z Binarization is performed to obtain the second detection result. S ZS .

[0059] ;

[0060] The above formula shows that if any pixel in the hyperspectral image is in the comprehensive detection result Z If the overall Z-score is greater than 0, then the pixel is considered a target pixel, and this target pixel is included in the second detection result. S ZS The value in the value is 1; otherwise, the pixel is a background pixel, and this background pixel is included in the second detection result. S ZS The value in the range is 0, thus obtaining the second detection result. S ZS .

[0061] (3) The first and second test results are combined to obtain preliminary test results.

[0062] This embodiment will use the first detection result S RX Second test results S ZS Adding them together, or taking the union, yields the preliminary detection results. ST 。 At this point, the first detection result and the second detection result are fused to obtain a preliminary detection result, which specifically includes: for each pixel in the hyperspectral image, if the pixel is determined to be the target pixel based on the first detection result, or the pixel is determined to be the target pixel based on the second detection result, then the pixel is determined to be the target pixel, and a preliminary detection result is obtained.

[0063] Considering that it is quite difficult to accurately describe the characteristics of the entire target and effectively distinguish subtle differences within the target based on only a single spectral feature, this embodiment can further refine the preliminary detection results as an optional implementation. S T Anomaly correction is performed to remove linear errors. Specifically, an optimization method based on contour geometric constraints and proportional selection is used to improve the preliminary detection results. S T Contour detection is performed on the corresponding binary image to obtain the width of the minimum bounding rectangle of each connected region. With height And calculate the level ratio. and vertical ratio ,like and If any of the values ​​in the connected region exceeds the ratio threshold of 3 (or other values, which need to be manually determined based on the type of target to be detected), then the connected region is classified as background, and all target pixels in the connected region are removed from the initial detection results. S T Remove from the target pixels, that is, adjust all target pixels in the connected region to background pixels.

[0064] At this point, the first and second test results are merged to obtain preliminary test results, which specifically includes the following steps.

[0065] (3.1) For each pixel in the hyperspectral image, if the pixel is determined to be the target pixel based on the first detection result or the pixel is determined to be the target pixel based on the second detection result, then the pixel is determined to be the target pixel and the fused detection result is obtained.

[0066] (3.2) For each pixel in the hyperspectral image, if the pixel is determined to be the target pixel based on the detection result after fusion, the pixel value of the pixel is set to 1; otherwise, the pixel value of the pixel is set to 0, so as to binarize the hyperspectral image and obtain a binary image.

[0067] (3.3) Perform contour detection on the binary image to obtain multiple connected regions composed of target pixels.

[0068] (3.4) For each connected region, determine the width and height of the minimum bounding rectangle corresponding to the connected region. Based on the width and height, calculate the horizontal ratio and vertical ratio. If the horizontal ratio or vertical ratio is greater than the preset ratio (i.e., ratio threshold 3), then all target pixels in the connected region are recorded as pixels to be replaced. The horizontal ratio is the ratio of width to height, and the vertical ratio is the ratio of height to width.

[0069] (3.5) Adjust all target pixels that were recorded as pixels to be replaced in the fused detection results to background pixels to obtain preliminary detection results.

[0070] (iii) Construct the initial background image.

[0071] This embodiment obtains the initial background image through background replacement. X P Specifically, the pixel value of each target pixel in the hyperspectral image is replaced with the average background pixel value calculated based on its local neighborhood. An attenuation background replacement strategy is adopted to attenuate and replace the neighboring pixels that are suspected targets in the local neighborhood (i.e., suspected abnormal neighboring pixels with spectral characteristics similar to the target pixel) to obtain the initial background image, which is a pre-cleaned background image.

[0072] Specifically, based on the preliminary detection results, target attenuation processing is performed on the hyperspectral image: based on the preliminary detection results S TFor each target pixel, a local window (i.e., local neighborhood) of a predetermined size (e.g., 7×7) is constructed, with the target pixel as the center pixel. The spectral angle distance (SAD) between the pixel value of the target pixel and the pixel values ​​of each neighboring pixel (i.e., other pixels within the local window besides the target pixel) is calculated. The spectral angle distance corresponding to each neighboring pixel is obtained. A histogram is plotted on all the calculated spectral angle distances and divided into 10 groups (other values ​​can also be used). The pixel values ​​of the neighboring pixels in the group with the highest frequency are averaged to obtain the average background pixel value. Subsequently, the pixel value of the target pixel is directly replaced with the average background pixel value. For each neighboring pixel, it is determined whether the spectral angle distance corresponding to the neighboring pixel is less than a set threshold (e.g., 0.08) and whether the type of the neighboring pixel is background. If a pixel in the background is not marked as abnormal, then that pixel is recorded as the neighboring pixel to be replaced. Based on the spatial distance between the neighboring pixel to be replaced and the target pixel (specifically, Chebyshev distance can be used), the attenuation weight is calculated. The average background pixel value and the pixel value of the neighboring pixel to be replaced are weighted and fused based on the attenuation weight to obtain the fused pixel value. The fused pixel value is then used to directly replace the pixel value of the neighboring pixel to be replaced, so as to attenuate and replace the pixel value of the neighboring pixel to be replaced, achieve a smooth transition, and generate the initial background image.

[0073] The formula for calculating the merged pixel value is:

[0074] ;

[0075] in, These are the pixel values ​​after fusion; For decay weights, To calculate the attenuation coefficient, a value of 0.9 can be used. The Chebyshev distance is the distance between the neighboring pixels to be replaced and the target pixel. This represents the average background pixel value. The pixel value of the neighboring pixel to be replaced.

[0076] The sliding window method and the RX algorithm are beneficial for detecting small-scale targets, while the Z-score calculation is beneficial for detecting large-scale targets. Then, background replacement is used to replace all initially detected targets with the background to construct an initial background image.

[0077] In this embodiment, for each target pixel in the hyperspectral image, an average background pixel value is calculated based on the pixel value of the target pixel and the pixel values ​​of its neighboring pixels. The average background pixel value is then used to replace the pixel values ​​of the target pixel and its neighboring pixels to obtain an initial background image.

[0078] The process involves calculating an average background pixel value based on the pixel value of the target pixel and the pixel values ​​of its corresponding neighboring pixels. This average background pixel value is then used to replace the pixel values ​​of the target pixel and its neighboring pixels. Specifically, this includes: calculating the spectral angular distance between the pixel values ​​of the target pixel and its neighboring pixels for each neighboring pixel; performing histogram statistics on all spectral angular distances and dividing them into multiple groups; averaging the pixel values ​​of the neighboring pixels in the group with the highest frequency to obtain the average background pixel value; replacing the pixel value of the target pixel with the average background pixel value; for each neighboring pixel, determining whether the spectral angular distance is less than a set threshold and whether the neighboring pixel is a background pixel; if so, recording the neighboring pixel as a neighboring pixel to be replaced; for each neighboring pixel to be replaced, performing a weighted fusion of the average background pixel value and the pixel value of the neighboring pixel to be replaced to obtain a fused pixel value, and using this fused pixel value to replace the pixel value of the neighboring pixel to be replaced.

[0079] (iv) Construct the target dictionary D.

[0080] This embodiment uses similarity calculation to remove redundant target pixels to construct a target dictionary D, and specifically extracts the preliminary detection results. S T For each target pixel in the hyperspectral image, the extracted pixel value is normalized to obtain a normalized pixel value. For any two target pixels, the Euclidean distance between the normalized pixel values ​​of the two target pixels is calculated to obtain the similarity between the pixel values ​​of the two target pixels. The similarity threshold T is set to 0.9 (or can be replaced with other values). If the similarity between the pixel values ​​of two target pixels is greater than the similarity threshold, they are considered to be duplicate target pixels. Then, one of the two target pixels is randomly removed to remove similar target pixels, resulting in a filtered target pixel list. All filtered target pixels form the target dictionary D.

[0081] In this embodiment, for any two target pixels in the hyperspectral image, the pixel values ​​of the two target pixels in the hyperspectral image are extracted, and the similarity between the pixel values ​​of the two target pixels is calculated. If the similarity is greater than the preset similarity (i.e., the similarity threshold of 0.9), one target pixel is randomly removed from the two target pixels to remove redundant target pixels and obtain the filtered target pixels.

[0082] The calculation of the similarity between the pixel values ​​of two target pixels specifically includes: normalizing the pixel values ​​of the two target pixels to obtain normalized pixel values; and calculating the Euclidean distance between the normalized pixel values ​​of the two target pixels to obtain the similarity between the pixel values ​​of the two target pixels.

[0083] (v) Feed it into the anti-similarity optimization coding network.

[0084] Use the initial background image X P The image is fed into the anti-similarity optimization coding network for network learning. In this embodiment, an anti-similarity optimization coding network and a loss function consisting of reconstruction loss and anti-similarity loss are constructed, and the initial background image is fed into the anti-similarity optimization coding network. X P The predicted background image is obtained, and reconstruction loss and anti-similarity loss are calculated on the reconstructed predicted background image. The more similar it is to the initial background image, the smaller the reconstruction loss; the more similar it is to the selected target pixels in the target dictionary D, the larger the anti-similarity loss. The anti-similarity optimization encoding network is then trained to obtain the trained model. The initial background image is then fed into the trained model. X P This prompts the reconstruction of the background image. X S A more realistic background image.

[0085] In this embodiment, the initial background image is used as input, and the anti-similarity optimization coding network is trained under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model. The trained model is then used to reconstruct the initial background image to obtain a reconstructed background image. The reconstruction loss is the difference between the pixel values ​​of the predicted background image and the pixel values ​​of the initial background image. The anti-similarity loss is the difference between the pixel values ​​of the predicted background image and the pixel values ​​of the selected target pixels in the hyperspectral image. The predicted background image is the image obtained by the anti-similarity optimization coding network reconstructing the initial background image.

[0086] First, construct an anti-similarity optimization coding network, such as Figure 4As shown, the structure of this anti-similarity optimization coding network includes: (1) a series of convolutional layers (which can be two-dimensional convolutional layers with a kernel size of 3×3 and a kernel count of 64) and a ReLU activation function layer. (2) Encoder: consisting of a series of convolutional layers, normalization layers, ReLU activation function layers, convolutional layers, normalization layers, and addition layers. (3) Decoder: consisting of a series of convolutional layers, normalization layers, ReLU activation function layers, convolutional layers, normalization layers, and addition layers. (4) A series of convolutional layers, normalization layers, addition layers, and convolutional layers. The last convolutional layer is the output layer, with a kernel size of 3×3 and the number of kernels being the same as the number of output channels (the number of output channels is the same as the number of input channels, specifically the number of bands in the hyperspectral image).

[0087] In this embodiment, the anti-similarity optimization coding network includes a first convolutional layer, a first ReLU activation function layer, an encoder, a decoder, a second convolutional layer, a first normalization layer, a first addition layer, and a third convolutional layer connected in sequence. The output of the first ReLU activation function layer is also connected to the input of the first addition layer.

[0088] The encoder comprises a fourth convolutional layer, a second normalization layer, a second ReLU activation function layer, a fifth convolutional layer, a third normalization layer, and a second addition layer, connected in sequence. The output of the first ReLU activation function layer is also connected to the input of the second addition layer. The input of the fourth convolutional layer is the input of the encoder and is connected to the output of the first ReLU activation function layer. The output of the second addition layer is the output of the encoder and is connected to the input of the decoder.

[0089] The decoder consists of a sixth convolutional layer, a fourth normalization layer, a third ReLU activation function layer, a seventh convolutional layer, a fifth normalization layer, and a third addition layer, connected in sequence. The output of the second addition layer is also connected to the input of the third addition layer. The input of the sixth convolutional layer is the input of the decoder, connected to the output of the second addition layer. The output of the third addition layer is the output of the decoder, connected to the input of the second convolutional layer.

[0090] loss function L Losses from reconstruction and anti-similarity loss constitute.

[0091] Regarding the reconstruction losses Calculate and measure the predicted value and the true value The absolute error between them yields the reconstruction loss. Reconstruction losses The calculation formula is as follows:

[0092] ;

[0093] in, For reconstruction losses; To predict the width of the background image; To predict the height of the background image; To predict the first in the background image The pixel value of each pixel; For the initial background image, the first The pixel value of each pixel.

[0094] For anti-similarity loss The cosine similarity between the pixel values ​​of the reconstructed predicted background image and the pixel values ​​of the target pixels in the target dictionary D is calculated. A spectral loss of 1 is recorded if the cosine similarity is greater than the cosine similarity threshold of 0.9 (or other values ​​can be used); otherwise, a spectral loss of 0 is recorded. All spectral losses are then summed and averaged to obtain the inverse similarity loss. Anti-similarity loss The calculation formula is:

[0095] ;

[0096] ;

[0097] in, For anti-similarity loss; To predict the width of the background image; To predict the height of the background image; This represents the number of target pixels after filtering. To predict the first in the background image The pixel value of the i-th pixel is related to the i-th pixel in the hyperspectral image. Spectral loss between pixel values ​​of the target pixels after filtering; To predict the first in the background image The pixel value of the i-th pixel is related to the i-th pixel in the hyperspectral image. Cosine similarity between the pixel values ​​of the selected target pixels; To predict the first in the background image The pixel value of each pixel; The first in the hyperspectral image The pixel values ​​of the target pixels after filtering.

[0098] As an optional implementation, during training, the initial background image is divided into blocks to obtain multiple training data blocks. Then, an inverse similarity optimization coding network is used to obtain prediction data blocks corresponding to the training data blocks (equivalent to dividing the prediction background image into blocks to obtain multiple prediction data blocks). The loss is calculated using the training data blocks and the prediction data blocks. and These represent the width and height of each training data block, respectively, and in this embodiment, they can be set to 19×19.

[0099] It should be noted that the width defined in this embodiment is in the horizontal direction and the height is in the vertical direction. Therefore, the width can also be referred to as the length and the height as the width.

[0100] Based on the initial background image, an encoder is introduced for further detection. The encoder extracts low-dimensional feature representations, and the decoder reconstructs the background image. By comparing the similarity between the reconstructed pixels (i.e., the pixels in the predicted background image) and the filtered target pixels in the target dictionary D, targets that were not detected in the initial detection are discovered, and targets that were not detected in the initial detection are further removed.

[0101] The process involves using an initial background image as input and training an anti-similarity optimization coding network under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model. Specifically, this includes: using the initial background image as input to obtain a predicted background image using the anti-similarity optimization coding network; using the initial background image and the predicted background image as input to calculate the reconstruction loss and anti-similarity loss, and then calculating the sum of the reconstruction loss and anti-similarity loss to obtain the total loss; updating the anti-similarity optimization coding network using the total loss to obtain the updated model; determining whether the iteration termination condition has been met; if yes, using the updated model as the trained model; otherwise, using the updated model as the anti-similarity optimization coding network for the next iteration and returning to the step of "using the initial background image as input to obtain a predicted background image using the anti-similarity optimization coding network".

[0102] The iteration termination condition is that the number of iterations reaches the maximum number of iterations, or the absolute value of the difference between the total loss of the current iteration and the total loss of the previous iteration is less than a preset difference.

[0103] Specifically, the process of reconstructing the initial background image using the trained model to obtain the reconstructed background image includes: using the initial background image as input and using the trained model to obtain the reconstructed background image.

[0104] (vi) Calculate the residual between the input image and the target image to obtain the target.

[0105] This embodiment calculates and reconstructs the background image. X S With hyperspectral images X The background residuals are used to obtain the final detection results. X r Specifically, hyperspectral images X With reconstructed background image X SSubtracting the two yields the anomaly detection result. X r (i.e., hyperspectral anomaly detection image).

[0106] In this embodiment, the difference between the hyperspectral image and the reconstructed background image is calculated to obtain the hyperspectral anomaly detection image. The hyperspectral anomaly detection image is a grayscale image. The lighter the grayscale value, that is, the closer it is to white, the more likely it is to be the target.

[0107] This embodiment proposes a hyperspectral image anomaly detection method based on background purification and guided reconstruction. The main steps include: inputting a hyperspectral image; performing preliminary multi-scale target detection, locating potential anomalous target regions to provide guidance information, and correcting the anomalies of the preliminarily detected targets; constructing an initial background image, using an attenuation background replacement strategy to replace the pixel values ​​of the identified target pixels with the estimated average background pixel values, and attenuating the pixel values ​​of the neighboring pixels of the identified target pixels that are suspected targets, generating a preliminarily purified background image for background purification; constructing a target dictionary D; feeding it into an anti-similarity optimization coding network, using the initial background image as input, training the anti-similarity optimization coding network under the constraints of reconstruction loss and anti-similarity loss to obtain a trained model, and using the trained model to reconstruct the initial background image to obtain a reconstructed background image for guided reconstruction; calculating the residual between the input image and the target image, and calculating the difference between the hyperspectral image and the reconstructed background image to obtain a hyperspectral anomaly detection image. By leveraging the synergistic effect of background cleansing and guided reconstruction, the purity of the reconstructed background and the accuracy of anomaly detection are significantly improved. This embodiment proposes a staged detection strategy and optimized anti-similarity loss, effectively addressing the performance issues of existing hyperspectral image anomaly detection methods at different target scales. Particularly in small-scale target detection, it can better detect small-scale targets, significantly improving detection accuracy and robustness. Therefore, using this method for anomaly detection in hyperspectral images achieves higher accuracy and robustness than traditional methods.

[0108] Compared with related technologies, this embodiment has the following advantages.

[0109] (1) An efficient background purification strategy is proposed. The method of spectral angular distance statistics and typical background distance judgment is used to accurately estimate the representative average background pixel value and directly replace the pixel value of the target pixel. At the same time, for suspected abnormal neighboring pixels with similar spectral features to the target pixel, a decay-weighted fusion strategy is introduced to achieve a smooth transition. This effectively avoids the background distortion or edge artifacts caused by simple replacement in traditional methods, thus providing a cleaner and more realistic background input for the anti-similarity optimization coding network used for subsequent reconstruction.

[0110] (2) The subsequent anti-similarity optimization coding network is guided by the replaced initial background image for reconstruction. The reconstruction loss ensures that the network can accurately recover the background structure, while the anti-similarity loss uses the target dictionary information retained after replacement to force the reconstructed background to be far away from potential anomalous targets in terms of spectral features. This tight coupling between background replacement and guided reconstruction enables the network to effectively identify and highlight anomalous targets that may have been missed or have blurred edges in the initial replacement while reconstructing a clean background, thereby obtaining more accurate and complete anomaly detection results.

[0111] (3) By combining the RX algorithm (sensitive to small targets) and the Z-score comprehensive detection (effective for large targets), the accurate positioning and replacement of abnormal targets of different sizes can be achieved on the basis of multi-scale preliminary detection, thereby significantly improving the adaptability and robustness of subsequent reconstruction and detection links to targets of different sizes.

[0112] The following simulation experiments will further illustrate the effects of this embodiment.

[0113] Simulation test conditions: The hardware test platform used in this simulation test is: Intel Core i5-12490F processor with a main frequency of 3.00 GHz, 16GB of memory, and RTX 4070 graphics card; The software platform used in this simulation test is: Windows 11 Home Edition 64-bit operating system and Python 3.9 for simulation testing.

[0114] The simulation data used in this embodiment is Airport-4 from the ABU (Airport-Beach-Urban) database. The hyperspectral image size is 100×100 and the number of bands is 191.

[0115] The simulation experiment in this embodiment uses AUC (Area Under Curve) as the evaluation index and compares it with four existing methods.

[0116] The four existing methods are as follows.

[0117] (1) CRD: It comes from the paper "Collaborative representation for hyperspectral anomaly detection". The core of this existing method is to use the collaborative representation capability of background pixels to detect anomalies by optimizing the reconstruction error.

[0118] (2) LRASR: From the paper “Anomaly detection in hyperspectral images based on low-rank and sparse representation”, the core of this existing method is to model the background of hyperspectral images as a low-rank matrix, while the anomalous targets are regarded as sparse interference terms.

[0119] (3) BS 3 LNet: From the paper "BS 3 LNet: A New Blind-Spot Self-Supervised Learning Network for Hyperspectral Anomaly Detection. The core of this existing method lies in introducing a blind spot mechanism, which enables the network to reconstruct each pixel using only neighborhood information, thereby avoiding learning anomalous features, enhancing background modeling capabilities, and ultimately achieving anomaly separation through reconstruction errors.

[0120] (4) STAD: It comes from the paper "Exploring hyperspectral anomaly detection with human vision: A small target aware detector". The core of this existing method is to simulate the human visual system's perception mechanism of small targets and improve detection performance by enhancing the salience of small targets.

[0121] Table 1 Comparison of AUC between the method in this embodiment and existing methods

[0122]

[0123] As shown in Table 1, compared with existing open classification methods, the method in this embodiment has the highest overall accuracy. This result indicates that the method based on background purification and guided reconstruction has good detection rate and stability.

[0124] This embodiment proposes a two-stage collaborative method with anti-similarity loss for hyperspectral image anomaly detection. It adopts a staged detection strategy, which fully integrates the efficiency of statistical methods and the accurate detection capability of similarity optimization networks, thereby improving the accuracy and robustness of anomaly detection.

[0125] The hyperspectral image obtained in this embodiment can be a hyperspectral image obtained by taking pictures of an airport, and the target can be an aircraft. The above method can be used to detect aircraft in the airport and complete the abnormal target detection.

[0126] This application also provides an application scenario in which the above-described hyperspectral image anomaly detection method is applied. Specifically, the hyperspectral image anomaly detection method provided in this embodiment can be applied in a target recognition scenario. The target recognition scenario includes a recognition stage and a display stage. The recognition stage is used to perform anomaly detection on the hyperspectral image to obtain a hyperspectral anomaly detection image, which can reveal the target. The display stage is used to show the hyperspectral anomaly detection image to the user. The hyperspectral image anomaly detection method provided in this embodiment belongs to the recognition stage.

[0127] Example 2.

[0128] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 5 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a hyperspectral image anomaly detection method.

[0129] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0130] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the hyperspectral image anomaly detection method of embodiment 1.

[0131] Example 3.

[0132] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the hyperspectral image anomaly detection method of Embodiment 1.

[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0134] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0135] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A hyperspectral image anomaly detection method, characterized in that, The hyperspectral image anomaly detection method comprises: acquiring a hyperspectral image; performing preliminary detection on the hyperspectral image to obtain a preliminary detection result; the preliminary detection result is used to determine each pixel point in the hyperspectral image as a target pixel point belonging to a target or a background pixel point not belonging to the target; for each target pixel point in the hyperspectral image, based on the pixel value of the target pixel point and the pixel value of a neighborhood pixel point corresponding to the target pixel point, an average background pixel value is calculated, and the pixel value of the target pixel point and the pixel value of the neighborhood pixel point are replaced by using the average background pixel value to obtain an initial background image; for any two target pixel points in the hyperspectral image, the pixel values of the two target pixel points are extracted, and the similarity between the pixel values of the two target pixel points is calculated; if the similarity is greater than a preset similarity, one of the two target pixel points is randomly removed to remove a redundant target pixel point, to obtain a screened target pixel point; the initial background image is taken as input, an anti-similarity optimization encoding network is trained under the constraints of a reconstruction loss and an anti-similarity loss to obtain a trained model, and the initial background image is reconstructed by using the trained model to obtain a reconstructed background image; the reconstruction loss is the difference between the pixel value of a pixel point in a predicted background image and the pixel value of a pixel point in the initial background image, the anti-similarity loss is the difference between the pixel value of a pixel point in the predicted background image and the pixel value of a screened target pixel point in the hyperspectral image, and the predicted background image is an image obtained by reconstructing the initial background image by using the anti-similarity optimization encoding network; the difference between the hyperspectral image and the reconstructed background image is calculated to obtain a hyperspectral anomaly detection image; based on the pixel value of the target pixel point and the pixel value of the neighborhood pixel point corresponding to the target pixel point, an average background pixel value is calculated, and the pixel value of the target pixel point and the pixel value of the neighborhood pixel point are replaced by using the average background pixel value, specifically comprising: for each neighborhood pixel point corresponding to the target pixel point, the spectral angle distance between the pixel value of the target pixel point and the pixel value of the neighborhood pixel point is calculated to obtain the spectral angle distance corresponding to the neighborhood pixel point; all the spectral angle distances are histogram counted and divided into multiple groups, the pixel values of the neighborhood pixel points contained in the group with the highest frequency are averaged to obtain the average background pixel value; the pixel value of the target pixel point is replaced by using the average background pixel value; for each neighborhood pixel point, it is judged whether the spectral angle distance corresponding to the neighborhood pixel point is less than a set threshold value and whether the type of the neighborhood pixel point is a background pixel point; if yes, the neighborhood pixel point is recorded as a neighborhood pixel point to be replaced; For each of the to-be-replaced neighborhood pixel points, the average background pixel value and the pixel value of the to-be-replaced neighborhood pixel point are fused by weighting to obtain a fused pixel value, and the pixel value of the to-be-replaced neighborhood pixel point is replaced by the fused pixel value.

2. The hyperspectral image anomaly detection method of claim 1, wherein, The hyperspectral image is preliminarily detected to obtain a preliminary detection result, specifically including: The hyperspectral image is detected by using a sliding window method and an RX algorithm to obtain a first detection result; the first detection result is used to determine each pixel point in the hyperspectral image as a target pixel point belonging to a target or a background pixel point not belonging to the target; For each pixel point in the hyperspectral image, a comprehensive Z-score of the pixel point is calculated, and if the comprehensive Z-score is greater than 0, the pixel point is a target pixel point, so as to detect the hyperspectral image to obtain a second detection result; the second detection result is used to determine each pixel point in the hyperspectral image as a target pixel point belonging to a target or a background pixel point not belonging to the target; The first detection result and the second detection result are fused to obtain a preliminary detection result.

3. The hyperspectral image anomaly detection method of claim 2, wherein, The first detection result and the second detection result are fused to obtain a preliminary detection result, specifically including: For each pixel point in the hyperspectral image, if the pixel point is determined as a target pixel point based on the first detection result or the pixel point is determined as a target pixel point based on the second detection result, the pixel point is determined as a target pixel point to obtain a fused detection result; For each pixel point in the hyperspectral image, if the pixel point is determined as a target pixel point based on the fused detection result, the pixel value of the pixel point is set to 1, otherwise, the pixel value of the pixel point is set to 0, so as to binarize the hyperspectral image to obtain a binary image; The binary image is subjected to contour detection to obtain a plurality of connected regions composed of the target pixel points; For each connected region, the width and height of the minimum bounding rectangle corresponding to the connected region are determined, and based on the width and the height, a horizontal ratio and a vertical ratio are calculated, and if the horizontal ratio or the vertical ratio is greater than a preset ratio, all the target pixel points in the connected region are recorded as to-be-replaced pixel points; the horizontal ratio is the ratio of the width to the height, and the vertical ratio is the ratio of the height to the width; All the target pixel points recorded as to-be-replaced pixel points in the fused detection result are adjusted to background pixel points to obtain a preliminary detection result.

4. The hyperspectral image anomaly detection method of claim 1, wherein, The calculation formula of the fused pixel value is: ; wherein, is the fused pixel value; is the decay weight, is the decay coefficient, is the Chebyshev distance between the target pixel and the neighboring pixel to be replaced; is the average background pixel value; is the pixel value of the neighboring pixel to be replaced.

5. The hyperspectral image anomaly detection method of claim 1, wherein, The similarity between the pixel values of the two target pixel points is calculated, specifically including: The pixel values of the two target pixel points are normalized respectively to obtain normalized pixel values of the two target pixel points; The Euclidean distance between the normalized pixel values of the two target pixel points is calculated to obtain the similarity between the pixel values of the two target pixel points.

6. The hyperspectral image anomaly detection method of claim 1, wherein, The calculation formula of the reconstruction loss is: ; wherein, is a reconstruction loss; is a predicted width of the background image; is a predicted height of the background image; is a pixel value of a pixel point at the th position in the predicted background image; is a pixel value of a pixel point at the th position in the initial background image; The calculation formula of the inverse similarity loss is: ; ; wherein, is a reverse similarity loss; is a predicted width of the background image; is a predicted height of the background image; is a number of target pixel points after screening; is a spectral loss between a pixel value of a th pixel point in the predicted background image and a pixel value of a th target pixel point after screening in the hyperspectral image; is a cosine similarity between a pixel value of a th pixel point in the predicted background image and a pixel value of a th target pixel point after screening in the hyperspectral image; is a pixel value of a th pixel point in the predicted background image; is a pixel value of a th target pixel point after screening in the hyperspectral image.

7. The hyperspectral image anomaly detection method of claim 1, wherein, The reverse similarity optimization encoding network comprises a first convolutional layer, a first ReLU activation function layer, an encoder, a decoder, a second convolutional layer, a first normalization layer, a first addition layer and a third convolutional layer connected in sequence, and an output end of the first ReLU activation function layer is further connected to an input end of the first addition layer; The encoder comprises a fourth convolutional layer, a second normalization layer, a second ReLU activation function layer, a fifth convolutional layer, a third normalization layer and a second addition layer connected in sequence, and an output end of the first ReLU activation function layer is further connected to an input end of the second addition layer; The decoder comprises a sixth convolutional layer, a fourth normalization layer, a third ReLU activation function layer, a seventh convolutional layer, a fifth normalization layer and a third addition layer connected in sequence, and an output end of the second addition layer is further connected to an input end of the third addition layer.

8. A computer device comprising: A memory, a processor and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the hyperspectral image anomaly detection method of any one of claims 1-7.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the hyperspectral image anomaly detection method of any one of claims 1-7.

Citation Information

Patent Citations

  • Hyperspectral image anomaly detection method based on end-to-end RX

    CN114202539A

  • Hyperspectral anomaly detection method based on band screening joint feature encoder

    CN120032244A