Hyperspectral anomaly detection method based on attention mechanism and adaptive fusion

By constructing differential features based on attention mechanisms and adaptive fusion, and combining them with multi-scale dilated convolution, low-frequency features are filtered and purified, and high-frequency features are adaptively fused. This solves the performance problem of existing hyperspectral anomaly detection methods in complex scenarios and achieves more efficient anomaly detection.

CN122391848APending Publication Date: 2026-07-14WUXI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUXI UNIV
Filing Date
2026-03-20
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing hyperspectral anomaly detection methods struggle to effectively combine local details with global contextual information in complex scenarios. Statistical detection methods are prone to assumption failure, representation modeling methods are susceptible to anomalies and noise contamination in the dictionary, and deep learning-based methods lack cross-branch interaction and adaptive fusion mechanisms, resulting in poor detection performance.

Method used

A hyperspectral anomaly detection method based on attention mechanism and adaptive fusion is adopted. Differential features are constructed by pooling upsampling difference, contextual features are extracted by multi-scale dilated convolution, low-frequency features are purified by attention map screening and sparse selection, and high-frequency features are fused by adaptive weight.

Benefits of technology

It improves the sensitivity to small-scale or weak anomalies, enhances the ability to reconstruct spectrally consistent backgrounds, suppresses anomalies and noise, and improves the accuracy and robustness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122391848A_ABST
    Figure CN122391848A_ABST
Patent Text Reader

Abstract

The application discloses a hyperspectral anomaly detection method based on attention mechanism and adaptive fusion. High-frequency features of a hyperspectral image are obtained; multi-scale low-frequency features are calculated and obtained; projection features are obtained through linear mapping; projection features are obtained through linear mapping; attention maps are calculated and obtained; an optimized attention map is obtained through sparse selection mechanism; the attention map is multiplied by to obtain a fusion feature map weighted by an attention mechanism; and reconstructed low-frequency features are obtained; multi-scale high-frequency features,, are obtained; high-frequency splicing features are obtained by splicing and, adaptive weights are calculated and obtained; adaptive fusion high-frequency features are obtained by adaptive fusion of and the adaptive weights; the high-frequency features are calculated and obtained as, and enhanced high-frequency features are calculated and obtained; and finally, a hyperspectral anomaly detection result map is obtained by.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing, specifically relating to a hyperspectral anomaly detection method based on attention mechanism and adaptive fusion. Background Technology

[0002] Hyperspectral imaging (HSI) can simultaneously acquire reflectance measurements across tens to hundreds of narrow, continuous spectral bands and precisely align these measurements with pixel-level spatial locations. The resulting data forms a three-dimensional data cube containing integrated spectral and spatial information. This characteristic significantly improves the accuracy of material differentiation and characterization. Therefore, HSI has irreplaceable value in many fields such as agricultural monitoring, forest management, mineral exploration, ecological assessment, and land cover mapping. Compared with traditional multispectral methods, HSI provides higher spectral resolution and can reveal minute spectral differences in materials within a narrow wavelength range.

[0003] Over the past few decades, researchers have proposed numerous hyperspectral anomaly detection methods to address problems in various applications. Existing anomaly detection algorithms can be broadly categorized into three types: statistical detection-based, representation modeling-based, and deep learning-based methods.

[0004] In statistical detection methods, Molero et al. investigated the Local Reed-Xiaoli (LRX) method. LRX is a parameter estimation method that constructs a local background model and calculates the Mahalanobis distance between the target pixel and its surrounding background to identify anomalous targets. However, in complex scenes, the distribution assumptions upon which statistical methods rely are often difficult to satisfy. Furthermore, these methods are typically relatively simple and struggle to effectively combine local details with global contextual information, thus limiting the separability of anomalies from the background.

[0005] In representation-based modeling methods, Li et al. proposed a hyperspectral anomaly detection method based on cooperative representation (CR), which achieves adaptive background modeling through linear representation of neighboring pixels and distance-weighted constraints. This method outperforms RX and its variants while maintaining low computational cost. Wu et al. proposed an improved cooperative representation detector based on a non-global dictionary (RCRD), achieving more reliable anomaly detection through feature-level cooperative representation and adaptive weighting mechanisms. Its core assumption is that anomalous pixels are difficult to effectively represent by the background distribution. However, the dictionary constructed by representation modeling methods may contain anomalous components or background noise, making the background dictionary impure and thus reducing detection performance. In complex scenes or with heavy noise, anomalies are more likely to be misrepresented as background, leading to missed detections and false positives.

[0006] In deep learning-based methods, Wang et al. introduced a dual-branch network based on Haar wavelet decomposition and proposed a structural similarity index-weighted Mahalanobis distance to enhance structural and spectral representations, thereby improving hyperspectral anomaly detection performance. Zhao et al. proposed a multi-scale frequency-guided two-stream network (MFTNet), which decomposes features into a high-frequency anomaly branch and a low-frequency background branch, improving detection performance by enhancing, reconstructing, and fusing the branch results. However, existing deep learning methods still lack sufficient cross-branch interaction mechanisms and mechanisms for adaptive fusion and selection of low-frequency and high-frequency representations, resulting in insufficient mining of spatial and spectral information.

[0007] As mentioned above, statistical detection methods rely on background distribution assumptions, which are prone to failure in complex scenarios and are difficult to balance local and global information. Representation modeling methods can adaptively model the background, but the dictionary is prone to anomalies and noise, leading to missed detections and false alarms. Deep learning-based methods have stronger overall performance, but they generally lack cross-branch interaction and adaptive fusion selection mechanisms, and spatial and spectral information is still insufficient. Summary of the Invention

[0008] In view of this, the main objective of the present invention is to provide a hyperspectral anomaly detection method based on attention mechanism and adaptive fusion.

[0009] To achieve the above objectives, the technical solution of the present invention is implemented as follows: This invention provides a hyperspectral anomaly detection method based on attention mechanism and adaptive fusion. The method is as follows: Step 1: Obtain hyperspectral images high frequency characteristics ; Step 2, according to the above Obtain first-scale low-frequency features With second-scale low-frequency features , will the Obtain the query projection matrix through linear mapping , will the Linear mapping yields the key projection matrix AND-value projection matrix ; Step 3, through the above and Multiplication to obtain attention graph Regarding the above Sparse selection mechanism Obtain the optimized attention map , will the and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. Through the Obtain the reconstructed low-frequency features ; Step 4, through the above Obtain high-frequency features at the first scale Second-scale high-frequency features High-frequency features at the third scale , will the and High-frequency splicing features are obtained through splicing. , will the Obtain adaptive weights ; Step 5: Place the above and Adaptive fusion to obtain adaptive fusion high-frequency features , will the and Obtaining intermediate high-frequency features , will the By obtaining enhanced high-frequency features ; Step Six: Through the aforementioned and Obtain hyperspectral anomaly detection results image .

[0010] Preferably, step one specifically involves: processing the hyperspectral image. Pooling upsampling is used to obtain differential features ,pass First-scale spatial features are obtained through dilated convolution. With second-scale spatial features According to the above and Obtaining low-frequency features ,pass and Differential acquisition of high-frequency features .

[0011] Preferably, step one specifically includes the following steps: (101) The hyperspectral image is processed according to the following formula. Pooling upsampling is used to obtain differential features for (1) in, Indicates size is upsampling operation, Indicates the window size is Maximum pooling operation; (102) According to the following formula, through First-scale spatial features are obtained through dilated convolution. With second-scale spatial features for (2) in, Indicates an expansion rate of 3 Dilation convolution operation, Indicates an expansion rate of 2 Dilation convolution operation, express Convolution operation; (103) According to the following formula, and By obtaining low-frequency characteristics for (3) in, express Convolution operation; (104) According to the following formula, through and Differential acquisition of high-frequency features for (4).

[0012] Preferably, step two specifically includes the following steps: (201) According to the following formula, based on the stated Obtain first-scale low-frequency features With second-scale low-frequency features for (5) in, express Convolution operation; (202) According to the following formula, the... Obtain the query projection matrix through linear mapping , will the Linear mapping yields the key projection matrix AND-value projection matrix for (6) in, This represents a linear projection operation. This indicates that the operation is divided according to the channel dimension. The representation layer normalization function.

[0013] Preferably, step three specifically includes the following steps: (301) According to the following formula, through and Multiplication to obtain attention graph for (7) in, express and The channel dimension, ; (302) According to the following formula, for Sparse selection mechanism Obtain the optimized attention map for (8) in, This indicates the sparse selection mechanism operation. This indicates a normalization operation; (303) According to the following formula, and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. for (9) in, This represents matrix multiplication calculation; (304) According to the following formula, through Obtain the reconstructed low-frequency features for (10) in, This represents the LeakyReLU activation function operation. This indicates a batch normalization operation. This indicates a splicing operation.

[0014] Preferably, step four is implemented through the following steps: (401) According to the following formula, through Obtain high-frequency features at the first scale Second-scale high-frequency features High-frequency features at the third scale for (11); (402) According to the following formula, and High-frequency splicing features are obtained through splicing. for (12); (403) According to the following formula, Obtain adaptive weights for (13) in, This indicates a fully connected layer operation. This represents the global max pooling operation. This represents the Sigmoid activation function.

[0015] Preferably, step five is implemented through the following steps: (501) According to the following formula, and Adaptive fusion to obtain adaptive fusion high-frequency features for (14) in, ; (502) According to the following formula, and Obtained intermediate high-frequency features for (15); (503) According to the following formula, By obtaining enhanced high-frequency features for (16).

[0016] Preferably, step six is ​​implemented through the following steps: (601) According to the following formula, it will eventually pass and Obtain hyperspectral anomaly detection results image for (17) in, for Norm operations For learnable parameters, .

[0017] Compared with existing technologies, this invention proposes a hyperspectral anomaly detection method based on attention mechanism and feature fusion: First, differential features are constructed through pooling upsampling difference, and context is extracted by combining multi-scale dilated convolution to achieve preliminary decomposition of low and high frequencies; then, in the low-frequency branch, the multi-scale low-frequency features are projected into Q / K / V to calculate the attention map, and an attention map is introduced... Sparse selection filters and purifies the attention distribution to obtain more focused attention weights. It applies attention mechanism weighting to the fused features to highlight spectrally consistent backgrounds, suppress anomalies and noise, and complete background reconstruction. In the high-frequency branch, multi-scale high-frequency features are spliced ​​together and adaptively fused using learned adaptive weights to achieve high-frequency focusing enhancement and improve sensitivity to small-scale or weak anomalies. Finally, the low-frequency reconstructed features are fused with the adaptively fused high-frequency features for joint discrimination, and the anomaly detection result map is output. Attached Figure Description

[0018] Figure 1 This is a flowchart of the present invention; Figure 2 The original hyperspectral image input for this invention; Figure 3 These are the reconstructed low-frequency features in this invention; Figure 4 This refers to the enhanced high-frequency features in this invention; Figure 5 This is a graph showing the hyperspectral anomaly detection results in this invention; Detailed Implementation Plan To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0019] This invention provides a hyperspectral anomaly detection method based on attention mechanism and adaptive fusion, such as... Figure 1 As shown, the method is as follows: Step 1: Obtain the hyperspectral image Obtaining differential features ,pass Extracting multi-scale spatial features , ,Will , By obtaining low-frequency characteristics ,pass and Differential acquisition of high-frequency features ; Step one is specifically implemented through the following steps: (101) The hyperspectral image is processed according to the following formula. Obtaining differential features for (1) in, Indicates size is upsampling operation, Indicates the window size is Maximum pooling operation; Specifically, the loaded original hyperspectral image was of Los Angeles, USA, with a resolution of 100×100 pixels and a total of 205 bands. All bands were used in the experiment. The background included the ground and shadows, and the anomalous targets were two aircraft. and The step size is 1, and its output channel dimension is 205; (102) According to the following formula, through Extracting multi-scale spatial features , for (2) in, Indicates an expansion rate of 3 Dilation convolution operation, Indicates an expansion rate of 2 Dilation convolution operation, express Convolution operation; Specifically, and The step size is 1, and the padding is 6 and 2 respectively. The output channel is 205; (103) According to the following formula, , By obtaining low-frequency characteristics for (3) in, express Convolution operation; Specifically, through right and Achieve channel-dimension invariant feature fusion. The channel dimension remains 205; (104) According to the following formula, through and Differential acquisition of high-frequency features for (4); Specifically, through and Obtain by performing a difference operation Its channel dimension remains 205; Step 2, By obtaining multi-scale low-frequency features , ,Will Linear mapping to obtain projected features ,Will Linear mapping to obtain projected features , ; Step two is specifically implemented through the following steps: (201) According to the following formula, By obtaining multi-scale low-frequency features , for (5) in, express Convolution operation; Specifically, The step size is 1, and the padding size is 2. and All output channels are 205. and The dimensions are all ; (202) According to the following formula, Linear mapping to obtain projected features ,Will Linear mapping to obtain projected features , for (6) in, This represents a linear projection operation. This indicates that the operation is divided according to the channel dimension. Indicates the layer normalization function; Specifically, in Before that, first and Perform flattening operations separately, with the output dimension being... ,go through The dimensions of the operation do not change, therefore The dimension is ,pass The result obtained after layer normalization operation , The dimension is still 1 ; Step 3, through and Multiplication to obtain attention graph ,right Sparse selection mechanism Obtain the optimized attention map ,Will and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. .pass Obtain the reconstructed low-frequency features ; Step three is specifically implemented through the following steps: (301) According to the following formula, through and Multiplication to obtain attention graph for (7) in, express and Channel dimension; Specifically, express and The correlation between each patch determines how attention weights are allocated. In the same dimension, express The 11th element and The correlation between the third element in the data; the smaller the value, the weaker the correlation. The third element is irrelevant to the current calculation; (302) According to the following formula, for Sparse selection mechanism Obtain the optimized attention map for (8) in, This indicates the sparse selection mechanism operation. This indicates a normalization operation; Specifically, to further suppress the interference of irrelevant features on attention distribution, in Introduction Operation, that is, on the same dimension, for For each line, only keep the following: The largest element in the ratio, the rest are represented by... Fill, then through The normalization operation normalizes all values ​​to a normal value. Within the range, all suppressed elements are set to 0; (303) According to the following formula, and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. for (9) in, This represents matrix multiplication calculation; Specifically, Compared to It can highlight more key related elements, while further suppressing The influence of irrelevant elements; (304) According to the following formula, through Obtain the reconstructed low-frequency features for (10) in, This represents the LeakyReLU activation function operation. This indicates a batch normalization operation. Indicates a splicing operation; Specifically, The output channel dimension of the operation is 410. The channel dimension is integrated to 205, with a step size and padding of 1. Figure 3 These are the reconstructed low-frequency features; Step 4, through Obtaining multi-scale high-frequency features , , ,Will , High-frequency splicing features are obtained through splicing. ,Will Obtain adaptive weights ,pass and Obtain two feature tensors , ; Step four is specifically implemented through the following steps: (401) According to the following formula, through Obtaining multi-scale high-frequency features , , for (11); Specifically, after multi-scale operations, , , The channel dimension remains 205. Contains rich spatial context information, and This contains more high-frequency detailed feature information; (402) According to the following formula, , High-frequency splicing features are obtained through splicing. for (12); Specifically, The output channel dimension of the operation is 410; (403) According to the following formula, Obtain adaptive weights for (13) in, This indicates a fully connected layer operation. This represents the global max pooling operation. This represents the Sigmoid activation function; Specifically, The output dimension is ,Then The normalization operation normalizes all values ​​to a normal value. Within the range, the obtained adaptive weights Distribution For example, if we keep two decimal places, then the first 10... The values ​​are respectively ; Step 5: and Adaptive fusion to obtain adaptive fusion high-frequency features ,Will and The obtained high-frequency features are ,Will By obtaining enhanced high-frequency features ; Step five is specifically implemented through the following steps: (501) According to the following formula, and Adaptive fusion to obtain adaptive fusion high-frequency features for (14) in, ; Specifically, yes The complementary weights, in order to further fuse high-frequency features through adaptive weights, for example, retain two decimal places, and the first 10... The values ​​are respectively Then the first 10 The values ​​are respectively ; (502) According to the following formula, and The obtained high-frequency features are for (15); Specifically, The output channel dimension of the operation is 410. The channel dimension is integrated into 205, with both its step size and padding set to 1. (503) According to the following formula, By obtaining enhanced high-frequency features for (16); Specifically, right The fusion process is performed with a step size and a fill factor of 1. Figure 4 For enhanced high-frequency features; Step Six: Final Pass and Obtain hyperspectral anomaly detection results image ; Step six is ​​specifically implemented through the following steps: (601) According to the following formula, it will eventually pass and Obtain hyperspectral anomaly detection results image for (17) in, for Norm operations These are learnable parameters; Specifically, Norm operations involve first finding the difference point-by-point along the channel dimension, then summing the squares of all the differences and taking the square root. When set to 0.5, for and The optimal merging of two corresponding pixel positions is achieved by, for example, retaining the last four decimal places. and The pixel position is hour, and The values ​​are respectively and , Figure 5 Image of hyperspectral anomaly detection results , Figure 5 The two highlighted positions are the abnormal targets.

[0020] 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.

[0021] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A hyperspectral anomaly detection method based on attention mechanism and adaptive fusion, characterized in that, The method is as follows: Step 1: Obtain hyperspectral images high frequency characteristics ; Step 2, according to the above Obtain first-scale low-frequency features With second-scale low-frequency features , will the Obtain the query projection matrix through linear mapping , will the Linear mapping yields the key projection matrix AND-value projection matrix ; Step 3, through the above and Multiplication to obtain attention graph Regarding the above Sparse selection mechanism Obtain the optimized attention map , will the and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. Through the Obtain the reconstructed low-frequency features ; Step 4, through the above Obtain high-frequency features at the first scale Second-scale high-frequency features High-frequency features at the third scale , will the and High-frequency splicing features are obtained through splicing. , will the Obtain adaptive weights ; Step 5: Place the above and Adaptive fusion to obtain adaptive fusion high-frequency features , will the and Obtaining intermediate high-frequency features , will the By obtaining enhanced high-frequency features ; Step Six: Through the aforementioned and Obtain hyperspectral anomaly detection results image .

2. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 1, characterized in that, Step one specifically involves: extracting the hyperspectral image. Pooling upsampling is used to obtain differential features ,pass First-scale spatial features are obtained through dilated convolution. With second-scale spatial features According to the above and Obtaining low-frequency features ,pass and Differential acquisition of high-frequency features .

3. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 2, characterized in that, Step one, specifically, involves the following steps: (101) The hyperspectral image is processed according to the following formula. Pooling upsampling is used to obtain differential features for (1) in, Indicates size is upsampling operation, Indicates the window size is Maximum pooling operation; (102) According to the following formula, through First-scale spatial features are obtained through dilated convolution. With second-scale spatial features for (2) in, Indicates an expansion rate of 3 Dilation convolution operation, Indicates an expansion rate of 2 Dilation convolution operation, express Convolution operation; (103) According to the following formula, and By obtaining low-frequency characteristics for (3) in, express Convolution operation; (104) According to the following formula, through and Differential acquisition of high-frequency features for (4)。 4. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to any one of claims 1-3, characterized in that, Step two, specifically, involves the following steps: (201) According to the following formula, based on the stated Obtain first-scale low-frequency features With second-scale low-frequency features for (5) in, express Convolution operation; (202) According to the following formula, the... Obtain the query projection matrix through linear mapping , will the Linear mapping yields the key projection matrix AND-value projection matrix for (6) in, This represents a linear projection operation. This indicates that the operation is divided according to the channel dimension. The representation layer normalization function.

5. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 4, characterized in that, Step three, specifically, involves the following steps: (301) According to the following formula, through and Multiplication to obtain attention graph for (7) in, express and The channel dimension, ; (302) According to the following formula, for Sparse selection mechanism Obtain the optimized attention map for (8) in, This indicates the sparse selection mechanism operation. This indicates a normalization operation; (303) According to the following formula, and Multiplication yields a weighted fusion feature map obtained through an attention mechanism. for (9) in, This represents matrix multiplication calculation; (304) According to the following formula, through Obtain the reconstructed low-frequency features for (10) in, This represents the LeakyReLU activation function operation. This indicates a batch normalization operation. This indicates a splicing operation.

6. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 5, characterized in that, Step four is implemented through the following steps: (401) According to the following formula, through Obtain high-frequency features at the first scale Second-scale high-frequency features High-frequency features at the third scale for (11); (402) According to the following formula, and High-frequency splicing features are obtained through splicing. for (12); (403) According to the following formula, Obtain adaptive weights for (13) in, This indicates a fully connected layer operation. This represents the global max pooling operation. This represents the Sigmoid activation function.

7. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 6, characterized in that, Step five is implemented through the following steps: (501) According to the following formula, and Adaptive fusion to obtain adaptive fusion high-frequency features for (14) in, ; (502) According to the following formula, and Obtained intermediate high-frequency features for (15); (503) According to the following formula, By obtaining enhanced high-frequency features for (16)。 8. The hyperspectral anomaly detection method based on attention mechanism and adaptive fusion according to claim 7, characterized in that, Step six is ​​implemented through the following steps: (601) According to the following formula, it will eventually pass and Obtain hyperspectral anomaly detection results image for (17) in, for Norm operations For learnable parameters, .