A hyperspectral remote sensing image anomaly target detection method based on a dual-decoder dual-Transformer background enhancement reconstruction network
By using a dual-decoder, dual-Transformer network structure, combined with an anomaly stripping and masking auxiliary branch and a background content cross-guidance module, the problem of background reconstruction and anomaly detection in hyperspectral remote sensing images is solved, achieving higher accuracy in anomaly target detection.
Patent Information
- Application Number
- CN202510009762.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-01-03
AI Technical Summary
Existing methods for anomaly detection in hyperspectral remote sensing images are ineffective at extracting anomaly information and reconstructing high-quality background information, resulting in insufficient detection accuracy.
A background enhancement and reconstruction network based on dual decoders and dual Transformers is adopted. By designing a dual decoding structure, an anomaly stripping and shielding auxiliary branch module, a background content cross-guided Transformer module, and a collaborative optimization loss module, the focus on background and anomalies is dynamically adjusted to enhance the reconstruction of background information and the detection of abnormal targets.
It significantly improves the accuracy of anomaly detection in hyperspectral remote sensing images, enabling better separation of background and anomalous targets and enhancing detection performance.
Smart Images

Figure CN119810666B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image anomaly target detection technology, specifically, it relates to the problem and solution of anomaly target detection in hyperspectral remote sensing images based on a dual-decoding dual-Transformer background enhancement and reconstruction network. Background Technology
[0002] Hyperspectral remote sensing is an Earth observation technique that acquires observational data on the reflection or radiation of surface objects across multiple spectral bands, enabling accurate analysis and identification of surface features. Anomaly detection in hyperspectral remote sensing images refers to identifying anomalous targets with spectral characteristics significantly different from the background, in the absence of prior information about the target. Hyperspectral images (HSI) possess the ability to identify and locate fine spectral features of ground objects, making them crucial in remote sensing observation and widely used in Earth sciences, remote sensing, agriculture, military, and environmental monitoring. In this task, the lack of prior knowledge about the target and background makes accurately detecting anomalous targets from the background a key challenge. To address this problem, researchers have proposed various methods to model the background and use different strategies to detect anomalous targets that deviate from the background pattern.
[0003] Existing anomaly detection methods are mainly divided into three categories: statistical theory-based methods, representation learning-based methods, and deep learning-based methods. Statistical theory-based anomaly detection methods typically model the background using the statistical features of HSI (Hyperspective of Intrusive Objects). This method assumes that the background follows a multivariate Gaussian distribution and detects anomalies using Mahalanobis distance. However, due to the complexity of HSI backgrounds and interference from various factors, constructing a model consistent with real-world scenarios is very challenging. In contrast, representation-based methods reconstruct background pixels from a dictionary, while anomaly pixels cannot be effectively reconstructed; the reconstruction error is used to detect anomalies. This category includes sparse representation (SR) and cooperative representation (CR). SR methods assume that normal samples can be represented by a small number of atoms, while anomaly samples cannot be reconstructed in this way; CR methods emphasize the cooperative relationships between dictionary atoms, evaluating whether pixels can be represented by linear combinations of adjacent pixels. Based on this characteristic, a collaborative representation learning-based anomaly detection (CRD) method has been proposed.
[0004] Deep learning-based HAD methods enhance the ability to identify background and anomalous targets by extracting deep features. Commonly used methods are divided into similarity-based models and reconstruction-based models. Similarity-based models typically use convolutional neural networks (CNNs) as the core framework, selecting a large number of pixel pairs from labeled hyperspectral images during training. Reconstruction-based unsupervised deep learning techniques have good effectiveness and adaptability in anomaly detection tasks. Common network structures include autoencoders (AEs) and generative adversarial networks (GANs). For example, Jiang et al. proposed a weakly supervised GAN based on spectral constraints to enhance the ability to identify anomalous targets. The AE method reconstructs the background through the encoding and decoding process and uses the reconstruction error to detect anomalies. To improve robustness, a fully self-integrating autoencoder (Auto-AD) was developed, combined with adaptive weighted loss to suppress anomalies. The guided autoencoder (GAED) proposed by Xiang et al. enhances the background representation ability. Self-supervised anomaly detection techniques have also attracted attention. PDBSNet and BS3LNet use blind spot networks to reduce the feature representation of anomalous targets, and the self-supervised multi-scale network (MSNet) proposed by Liu et al. combines multi-scale feature extraction to handle anomalies of different scales.
[0005] In recent years, deep learning has made significant progress in computer vision and remote sensing. However, existing methods cannot fully extract effective anomaly information from hyperspectral remote sensing images for separation, and they also struggle to reconstruct high-quality background information. Therefore, we propose a dual-decoder, dual-Transformer background enhancement and reconstruction network to capture more useful information. By leveraging the spatial dependencies of the background at each stage of the network's encoding and decoding structure, we further improve the accuracy of anomaly detection results. Summary of the Invention
[0006] The purpose of this invention is to solve the reconstruction mapping problem caused by anomalies in the feature encoding-decoding mechanism during hyperspectral remote sensing image reconstruction. Specifically, it proposes a dual-decoder, dual-Transformer background enhancement reconstruction network that dynamically adjusts its focus on background and anomalies, reducing the spatial dependence of anomaly pixel correlation and fully utilizing hyperspectral information at each stage. Its core consists of the following four parts:
[0007] 1. Dual decoders
[0008] Conventional U-shaped networks typically include an encoder, a decoder, and regular skip connections. While skip connections can partially alleviate feature loss, they can still lead to significant information loss when processing complex hyperspectral data. To enhance information extraction, a simple approach is to increase network depth by stacking convolutional blocks, which provides powerful semantic information extraction capabilities. However, this operation inevitably encounters the problem of equivalent reconstruction of anomalous targets during background generation, resulting in inaccurate estimation of the background image and a decrease in anomalous target detection capabilities. Furthermore, the single path in the decoding stage faces challenges in generating robust feature maps. Therefore, we designed a dual-decoding structure that maintains feature sharing between upper and lower layers while obtaining more accurate background information free of anomalous targets.
[0009] This invention designs a dual-decoding network backbone based on a U-shaped network, consisting of two parallel decoding subnets. First, the hyperspectral remote sensing image (HSI) is represented as... Here, H, W, and C represent height, width, and the number of spectral bands, respectively. The upper encoder takes the raw hyperspectral image as input and passes it through a 3×3 convolutional layer to change the number of channels from C to N. Then, the feature map is processed through two Swin Transformer modules, a 1×1 convolutional layer, and a downsampling layer for shallow feature extraction. The downsampling layer is a 2×2 stride convolutional layer, which halves the spatial resolution of the feature map while doubling the number of channels. The size of the feature map at different nodes becomes... Meanwhile, the underlying layer of the model is a single SwinTransformer module, which further extracts features while maintaining the number of channels and spatial resolution of the feature map unchanged. Then, symmetrical to the encoder, the upper decoder employs two 2×2 stride deconvolutional layers, a 1×1 convolutional layer, and a Swing layer. n Transforme r The module performs deep feature map representation learning. After decoding, the size of the feature map is returned as H×W×C.
[0010] The lower-level decoder uses mapped input uniform noise, which is then processed by a background feature fusion module and an upsampling layer to obtain a feature map. Then, feature maps from the upper encoding and decoding stages are passed to the lower decoder via skip connections for feature interaction, allowing the lower decoder to reference more contextual information during reconstruction. After this stage, the feature maps finally generate a realistic hyperspectral background space.
[0011] 2. Abnormal stripping and shielding of auxiliary branch modules
[0012] In hyperspectral anomaly detection, traditional deep learning methods may lack sufficient ability to effectively distinguish between anomalies and background, thus hindering the reconstruction of anomalous targets during background reconstruction. To enhance the differentiation between background and anomaly features and to minimize the model's focus on anomalies, this invention proposes an anomaly stripping and shielding auxiliary branch module. This branch aims to strip the anomaly portion from the reconstruction process through constraints, thereby promoting the model's better focus on learning and reconstructing background features. This branch module mainly includes the following:
[0013] 1) Background Anomaly Separation: The preceding stage of the entire branch uses a convolutional autoencoder to capture features and reconstruct the background, providing the model with a global feature flow of the background. Each encoding block consists of a 3×3 convolution (stride = 2) and a 1×1 convolution (BN and LeakReLU). The input to each encoding block can be represented as:
[0014] E i =Conv 3×3 ((Conv 1×1 (E i-1 ))
[0015] Where 0 < i < 5. The decoding block consists of an upsampling layer and a 1×1 convolution (BN and LeakReLU), combined with skip connections to preserve shallow features. The input to the decoding process can be represented as:
[0016] D i =Concat[E i-1 Conv 1×1 (Upsample(D i-1 ))]
[0017] The independent paths of the convolutional autoencoder provide the model with a new reconstruction perspective and globally separate the background from the anomalies. With each training iteration, the anomalies are progressively stripped away, resulting in a coarse-to-fine sparse matrix of anomaly targets. The entire residual is calculated as follows:
[0018]
[0019] In the formula (·) i,j,: Let be the spectral vector at position (i, j).
[0020] 2) Anomaly feature masking
[0021] After obtaining the separated feature maps, an anomaly masking mechanism is further introduced to eliminate the feature space mapping of anomalous target information. In the anomaly masking stage, we divide the process into three parts to achieve hierarchical suppression of anomalies. First, we use a parallel structure of two sets of large convolutional kernels: a single 5×5 convolutional kernel and a cascaded structure of a 5×5 convolutional kernel and a 7×7 convolutional kernel. The large convolutional kernels provide a wider receptive field, focusing on a larger background region, thereby weakening and dispersing the anomalous information into the feature map S3.
[0022] S3 = Concat[DwConv] 5×5 (S),DwConv 7×7 (DwConv 5×5 (S))]
[0023] The resulting feature maps are then processed using a combination of average pooling (MEP) and max pooling (MAP). In this process, average pooling helps the model focus on globally consistent background information, while max pooling selects local background information, effectively guiding anomalous targets away from the focus of global information. A 1×1 convolution and activation function are then applied to obtain background selections W1 and W2.
[0024] To further optimize the suppression of anomalous features, we introduce a channel attention mechanism to dynamically adjust the weights of each channel, particularly applying lower weights to channels containing anomalous features. Finally, the channel attention output is element-wise multiplied with the feature information of the parallel convolutional structure, thereby achieving suppression and optimization of anomalous features across multiple dimensions. In this way, anomalous information is effectively weakened at the channel, spatial, and scale levels, resulting in output feature maps that are more focused on background information, while also providing richer background information for subsequent anomaly suppression during the decoding process.
[0025] 3. Background content cross-guides the Transformer module
[0026] The Transformer model has been applied to hyperspectral anomaly detection due to its excellent global feature modeling capabilities. While it excels in acquiring comprehensive data information, it still suffers from limitations such as insensitivity to local details and insufficient robustness to complex backgrounds. To address these limitations and enhance the model's ability to distinguish between background and anomalous targets during training, a novel Transformer module—the background content cross-guided Transformer module—is proposed.
[0027] First, the module applies conditional location embeddings to the input of the lower-level decoder through a 3×3 depthwise convolutional layer. Then, the entire module is divided into a decoding multi-head self-attention branch and an encoding multi-head self-attention branch. Linear transformations are performed on the input lower-level decoded information X1 and encoded information X2 to obtain the query, key, and value:
[0028]
[0029] in, These represent the projection weights of the query, key, and value, respectively.
[0030] After mapping, the decoding multi-head attention branch performs background smoothing restoration by capturing deep features of the spectral dimension of the decoded information. The obtained Q1, K1, and V1 are then processed using a non-overlapping window (using a size of M×M) to obtain... They were then divided into multiple heads along the channel dimension.
[0031] In the multi-head attention branch, the focus is on fine-grained background reconstruction of the encoded information. Before non-overlapping window partitioning, K2 and V2 are each passed through a 3×3 depthwise convolutional layer, which yields...
[0032] The attention output from the decoding branch is used as the query Q and the key k after window partitioning. This is then used to cross-guide attention calculation with the attention value from the encoding branch. The attention is then rearranged and integrated using linear layers. The final attention is as follows:
[0033]
[0034] Finally, Att Out The input is transmitted through a feedforward network. CGA jointly processes the inputs of the encoder and decoder, leveraging the information exchange between them to enhance background confidence and reduce local spatial dependencies of anomalies.
[0035] 4. Collaborative Optimization Loss Module
[0036] During training, the overall goal of the network is to make the background pixels in the generated image as consistent as possible with those in the original hyperspectral image, while effectively suppressing the reconstruction of anomalous regions. To this end, this method employs a background-first mapping approach, assigning higher confidence to background pixels while reducing the weight of anomalous target pixels, thereby minimizing the impact of anomalous regions on the loss function and achieving the effect of suppressing anomalous targets. To evaluate the reconstruction performance, MSE loss and SmoothL1 loss are combined. MSE loss primarily calculates the pixel differences between the original hyperspectral image and the reconstructed image, focusing on subtle pixel-level errors, while SmoothL1 loss introduces structural smoothness constraints to ensure accurate reconstruction of background regions.
[0037] In practical image reconstruction tasks, key structural information and anomalous features are typically concentrated in the high-frequency range. Traditional pixel-level losses (such as MSE and SmoothL1) neglect this important information in the frequency domain, making it difficult for the model to distinguish between background and anomalous regions. Therefore, a novel frequency domain loss function is introduced. This function transforms the image to the frequency domain and compares the frequency distribution differences between the reconstructed and original images, thereby enhancing the model's sensitivity to high-frequency anomalous information. The final frequency domain loss function calculates the differences in the frequency domain and assigns different weights based on frequency, mitigating the influence of anomalous regions and better focusing on the reconstruction of background regions. The overall loss function is shown below:
[0038]
[0039] In short, our strategy is to introduce a frequency domain loss function to help the model pay more attention to the background region while suppressing the interference of anomalous regions on the quality of the reconstructed background. Attached Figure Description
[0040] Figure 1 A schematic diagram of the hyperspectral anomaly detection model of the dual-decoder dual-Transformer background enhancement and reconstruction network for the invention;
[0041] Figure 2 A schematic diagram of the dual decoder in the invention's model;
[0042] Figure 3 This is a schematic diagram of the abnormal stripping shielding auxiliary branch of the invention;
[0043] Figure 4 A schematic diagram of the Transformer module is provided to illustrate the background content of the invention.
[0044] Figure 5 This is a schematic diagram of background feature fusion.
[0045] Figure 6 The dataset used in the invention and its corresponding real-world location;
[0046] Figure 7 Visualization results of anomaly detection using the method of the present invention and the comparison method in various typical scenarios of the dataset;
[0047] Figure 8 The ROC curves of the method of this invention and the comparison method are shown in various typical scenarios of the dataset; Detailed Implementation
[0048] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0049] Step 1: Input the preprocessed data and the generated uniform noise into the encoder for feature extraction;
[0050] Step 2: Pass the background features obtained from the anomaly stripping and shielding module into the lower-level decoder;
[0051] Step 3: Input the encoder and lower-layer background decoder features into the background content-guided Transformer module;
[0052] Step 4: Constrain the obtained generation error using a collaborative optimization loss function;
[0053] Step 5: The information processed by the upper and lower layer decoders is improved using the background feature fusion module to obtain the final prediction map;
[0054] Furthermore, step 1 specifically includes the following steps:
[0055] Step 1-1: Normalize the hyperspectral remote sensing image dataset to facilitate data processing by the model and improve computational efficiency. Simultaneously, construct uniform noise to prepare for background feature modeling.
[0056] Steps 1-2: As Figure 1 The diagram illustrates the hyperspectral remote sensing image anomaly detection model using the dual-decoder, dual-Transformer background enhancement and reconstruction network of the invention. The processed image data is input into the encoder, and a 3×3 convolutional layer changes the number of channels from C to N. Then, the feature map undergoes shallow feature extraction through two Swing Transformer modules, a 1×1 convolutional layer, and a downsampling layer. The downsampling layer is a 2×2 stride convolutional layer, which halves the spatial resolution of the feature map while doubling the number of channels. The size of the feature maps at different nodes becomes... Then, skip connections are used to feed the encoded features into the upper-layer decoder to avoid information loss. The dual-decoding structure is as follows: Figure 2 As shown. Simultaneously, we input the noise into the lower-level decoder for feature extraction.
[0057] Furthermore, step 2 specifically includes the following steps:
[0058] Step 2-1: As Figure 3 As shown, the raw hyperspectral data is input into the entire anomaly stripping and masking auxiliary branch. The preceding stage of this branch uses a convolutional autoencoder to capture features and reconstruct the background, providing the model with a global feature flow of the background. The encoding block consists of a 3×3 convolution (stride = 2), a 1×1 convolution, layer normalization, and an activation function. The corresponding decoding block consists of a 3×3 deconvolution layer, a 1×1 convolution, layer normalization, and an activation function. The resulting anomaly residual can be expressed as:
[0059]
[0060] Step 2-2: After processing the feature map and obtaining its separated representation, the receptive field can be significantly expanded by using a large convolutional kernel to eliminate the adverse effects of abnormal target information in the feature space, thus obtaining a preliminary feature map in which the abnormality is masked.
[0061] S3 = Concat[DwConv] 5×5 (S),DwConv 7×7 (DwConv 5×5 (S))]
[0062] Specifically, in the anomaly masking stage, we progressively suppress anomalous targets in a hierarchical manner, ensuring that the model can focus on learning and inferring normal patterns. Next, we input the obtained feature maps into a processing module that combines average pooling (MEP) and max pooling (MAP). Through this combined pooling operation, anomalous information no longer dominates the global features but is effectively suppressed, making the background a more prominent focus.
[0063] [W1, W2] = Sigmoid(Conv 1×1 [MAE(S3),MAX(S3)])
[0064] Subsequently, we applied channel attention to background selections W1 and W2 to refine and select background information in later steps. Finally, the channel attention output was element-wise multiplied with the feature information from the parallel convolutional structure, thereby achieving suppression and optimization of anomalous features across multiple dimensions and obtaining supplementary information. This operation helps to further optimize the feature map, ensuring that the model can more accurately identify and process background areas, thereby improving the overall reconstruction and recognition results.
[0065] Furthermore, step 3 specifically includes the following steps:
[0066] Step 3-1: As Figure 4 As shown, we will use the feature map X of the lower-level decoder of the image. i and supplementary information The results are summed, and then the Transformer is adaptively learned using background content cross-referencing. The decoding multi-head attention branch performs background smoothing recovery by capturing the spectral dimension depth features of the decoded information. The obtained Q1, K1, and V1 are then processed using a non-overlapping window (using a size of M×M) to obtain... They are then divided into multiple heads along the channel dimension, as shown below:
[0067]
[0068] Here, h represents the number of attention heads used in the segmentation. In this process, different attention heads can focus on the correlations between different bands, thus achieving a refined background representation in the spectral dimension. Then, a multi-head self-attention mechanism is calculated for each head, ensuring that the model can more accurately describe local details in the background.
[0069]
[0070] Step 3-2: Calculate using the same method. To apply greater weight to the decoupled background information, the attention from the decoding branch is then cross-guided for attention calculation. The multi-head attention is then integrated through rearrangement to finally obtain the synthesized attention output.
[0071]
[0072] The final output attention result will focus on background features, weaken the influence of anomalies, and prepare for subsequent background feature fusion.
[0073] Furthermore, step 4 specifically includes the following steps:
[0074] Step 4-1: For the generated background image, we model the frequency domain information of the image by introducing a frequency domain loss function during training. This is because abnormal targets often have obvious high-frequency components. By applying a small weight suppression to the high-frequency components, the model can focus more on the reconstruction of the background region, as shown below.
[0075]
[0076] in ω These are weighting coefficients used to impose constraints in the frequency domain.
[0077] Step 4-2: To further achieve effective suppression of anomalous targets while ensuring accurate reconstruction of the background region, we combined three loss functions. Ultimately, the optimization objective is to minimize the sum of these loss functions, so that the generated image more closely approximates the real hyperspectral image while maintaining the consistency of the background region.
[0078]
[0079] in This represents the mean square error function. Represents the smoothing loss function. This represents the frequency domain loss function.
[0080] Furthermore, step 5 specifically includes the following steps:
[0081] Step 5-1: As Figure 5 As shown, in this background feature fusion module, the outputs from the lower-layer decoder and the upper-layer decoder are first concatenated along the channel dimension. Then, the fused feature map is processed using a spatial attention mechanism to enhance the information interaction between different spaces and highlight key information. Next, the output processed by deep attention is added to the spatial attention output. After deep attention refinement, it is element-wise multiplied with the spatial attention feature map, suppressing abnormal interference while enhancing important background information, generating a final clean background.
[0082] Step 5-2: Using the obtained background image and combining it with the original observation image, the final detection result is obtained by calculating the reconstruction error between the two:
[0083]
[0084] Finally, the obtained exploration map was compared with the actual surface values to verify the results.
[0085] The Pavia dataset used in this experiment comes from an airborne sensor called the Reflection Optical Systems Imaging Spectroradiometer (ROSIS), with a spatial resolution of 1.3m and a wavelength range of 430-860nm. The image size is 100×100 pixels, with 102 spectral bands and containing 71 anomalies. The San Diego dataset was captured by the Airborne Visible / Infrared Imaging Spectroradiometer (AVIRIS) sensor in San Diego, California, USA, with a spatial resolution of 3.5m and a wavelength range of 370-2510nm. The two Texas Coast city datasets were captured in 2010 by the AVIRIS sensor on the Texas coast, USA. Both scenes have a spatial resolution of 17.2m and 100×100 pixels. The first scene contains 67 anomalous pixels and 204 spectral bands, with a wavelength range of 450-1350nm. Buildings of different sizes are considered anomalous. The second scene has 207 bands, and all bands were used in each experiment. These two HSIs are referred to as TC-1 and TC-2. The Gainesville dataset represents an urban scene captured by an AVIRIS airborne sensor in Gainesville, Florida, USA. 191 bands were retained for experiments after removing water-absorbing and signal-to-noise ratio bands from the raw data. The Salinas dataset is a background sub-image selected from the Salinas scene. See [link to data and actual surface locations of anomalous targets] for details. Figure 6 .
[0086] In the data-driven approach, ten representative anomaly detection methods were compared, including GRX, CRD, FrFE, RCRD, PCA-TLRSR, LEBSR, GAED, Auto-AD, PDBSNet, and MSNet. GRX is a probability distribution-based method; CRD, RCRD, and PCA-TLRSR are representation-based methods; FrFE uses frequency domain transformation to detect anomalies; LEBSR detects anomalies by learning background endmembers; and GAED, Auto-AD, PDBSNet, and MSNet reconstruct the background in a self-supervised manner. The present invention is compared with each of these ten methods, and the visualization and detection results are as follows: Figure 7 and Figure 8 As shown, the method of the present invention uses the area under the curve (AUC) to quantitatively evaluate and analyze the method of the present invention and several other anomaly detection methods. The AUC value ranges from 0 to 1. The closer the value is to 1, the better the performance of the detection method.
[0087] Table 1 Comparison of AUC values for anomaly detection in hyperspectral remote sensing images
[0088]
[0089] The results are shown in Table 1. The experimental results show that the proposed method is significantly better than the comparison algorithm in terms of detection performance, which fully verifies the superiority of the proposed method.
[0090] The visualization results of the six datasets in the typical scenarios are shown in the figure below. Figure 7 and Figure 8 As shown, while CRD and RCRD methods present a relatively complete background, this makes it difficult to distinguish anomalies from the background. FrFE and PCA-TLRSR also produce many erroneous anomaly results during detection. Although LEBSR and Auto-AD can detect anomalous targets on all datasets, the background is still quite noticeable. In contrast, GAED, PDBSNet, and MSNet methods can detect anomalies better. Compared with other methods, this invention not only successfully detects anomalous targets but also effectively separates anomalies from the background, significantly improving detection accuracy and achieving good background suppression.
[0091] To further qualitatively analyze the detection performance of different methods, ROC curves for different methods were plotted, such as... Figure 8 As shown. For better visualization, they are displayed on a logarithmic scale. Overall, the present invention outperforms other methods in ROC curve performance, significantly demonstrating the performance advantages of the method described herein.
Claims
1. A method for detecting abnormal targets in hyperspectral remote sensing images based on a dual-decoder, dual-Transformer background enhancement and reconstruction network, characterized in that, Includes the following steps: S1. Construct a dual decoder for feature refinement: Select the observed hyperspectral remote sensing image as the original data, and at the same time generate uniform noise image data that strictly follows a uniform distribution to ensure that the probability of each pixel value is equal. Normalize the original data and use an encoder to extract features from the image. The image encoder and the upper-layer decoder feature extractor use the Swing Transformer module as the feature extractor to extract high-level semantic information. The lower-layer decoder uses the background content cross-guided Transformer module as the feature extractor to obtain the reconstructed clean background. S2. Constructing an anomaly stripping and masking branch: An additional auxiliary branch for anomaly separation is designed to extract anomaly features and use them as supplementary input to the fused feature maps of each decoding stage; specifically, it includes the following steps: S2.1: Using the original hyperspectral remote sensing image data as input, it is fed into the entire anomaly stripping and masking auxiliary branch network. The previous stage of the entire branch uses a convolutional autoencoder to capture features and complete background reconstruction, providing the model with a global feature information flow of the background. The encoding block consists of a 3×3 convolution and a 1×1 convolution, layer normalization, and an activation function. The corresponding decoding block consists of a 3×3 deconvolution layer and a 1×1 convolution, layer normalization, and an activation function. The generated anomaly residual is represented as follows: After processing the feature map and obtaining its separated representation, S2.2 expands the receptive field by using a large convolutional kernel to eliminate the adverse effects of abnormal target information in the feature space, thus obtaining a preliminary feature map of the abnormal target being masked. S3=Concat[DwConv 5×5 (S),DwConv 7×7 (DwConv 5×5 (S))] Specifically, in the anomaly masking stage, anomalous targets are gradually suppressed in a hierarchical manner to ensure that the model can focus on background learning and inference. Next, the obtained feature map is input into a processing module that combines average pooling (MEP) and max pooling (MAP). Through this combined pooling operation, anomalous target information can be effectively suppressed, promoting the effective reconstruction of the background image. [W1,W2]=Sigmoid(Conv 1×1 [MAE(S3),MAX(S3)]) S2.3 Subsequently, the obtained background selection features W1 and W2 are refined using channel attention to control the background information. Finally, the channel attention output is element-wise multiplied with the feature information of the parallel convolutional structure, thereby achieving suppression and optimization of anomalous features in multiple dimensions and obtaining supplementary information. S3. Construct a background content cross-guided Transformer module: Embed a background content cross-guided Transformer module in the lower-level decoder to guide attention to background semantic information and enhance the model's ability to capture and learn complex abnormal patterns. S4. Construct a collaborative optimization loss function: Combine frequency domain loss, MSE loss and SmoothL1 loss to punish anomalous targets from multiple dimensions, while strengthening the ability to suppress anomalous targets. Use this loss function to optimize and adjust the network model throughout the training process to improve the robustness and training stability of the model. S5. The features output by the encoder and decoder are fused using the background feature fusion module to restore the reconstructed background image to its original spatial resolution and number of channels, thus obtaining an accurate background image. Then, combined with the original hyperspectral remote sensing image, the reconstruction error is calculated to obtain the final detection map.
2. The method for detecting abnormal targets in hyperspectral remote sensing images based on a dual-decoder dual-Transformer background enhancement and reconstruction network according to claim 1, characterized in that, Step S1 includes the following steps: S1.1 normalizes the hyperspectral remote sensing image dataset used to improve computational efficiency and constructs uniform noise for background image modeling. S1.2 inputs the processed image data into the encoder. After passing through a 3×3 convolutional layer, the number of channels is adjusted from C to N. Then, the feature map undergoes shallow feature extraction via two Swing Transformer modules, a 1×1 convolutional layer, and a downsampling layer. The downsampling layer is a 2×2 stride convolutional layer, whose function is to halve the spatial resolution of the feature map, effectively doubling the number of channels. The size of the feature mapping at different nodes is adjusted accordingly. E i,j In this context, i and j represent the number of encoders and the number of internal feature extractor layers, respectively. Skip connections are then used to feed the encoded features into the upper-layer decoder to avoid information loss, while noise is input into the lower-layer decoder for feature extraction.
3. The method for detecting abnormal targets in hyperspectral remote sensing images based on a dual-decoder dual-Transformer background enhancement and reconstruction network as described in claim 1, characterized in that, Step S3 includes the following steps: S3.1 The feature map X of the lower layer decoder of the image i and supplementary information The results are summed, and then the Transformer is adaptively learned using background content cross-references. The multi-head attention branch of the decoded information performs background smoothing recovery by capturing the spectral dimension and depth features of the decoded information. The resulting Q1, K1, and V1 are then processed using a non-overlapping window of size M×M. They are then divided into multiple heads along the channel dimension, as shown below: Where h represents the number of heads. In this process, different attention heads focus on the correlation between different bands, thereby performing a fine background representation in the spectral dimension. Then, a multi-head self-attention mechanism is calculated for each head to ensure that the model can more accurately describe the local details in the background. S3.2 The encoded multi-head self-attention is calculated using the same method. To apply greater weight to the decoupled background information, the attention from the decoding branch is then cross-guided for attention calculation. By rearranging and integrating the multi-head attention, a synthesized attention output is finally obtained. The final output attention Att Out This will focus on background features, weaken the influence of abnormal targets, and enhance the accuracy of subsequent background feature fusion.
4. The method for detecting abnormal targets in hyperspectral remote sensing images based on a dual-decoder dual-Transformer background enhancement and reconstruction network as described in claim 1, characterized in that, Step S4 includes the following steps: S4.1 For the generated background image, a frequency domain loss function is introduced during training to model the frequency domain information of the image; as shown below: Where ω is the weighting coefficient, used to apply anomaly constraints in the frequency domain; S4.2 combines three loss functions, with the optimization objective being to minimize the sum of these loss functions to make the generated image more closely resemble the real hyperspectral image while maintaining the consistency of the background region. in This represents the mean square error function. Represents the smoothing loss function. This represents the frequency domain loss function.
5. The method for detecting abnormal targets in hyperspectral remote sensing images based on a dual-decoder dual-Transformer background enhancement and reconstruction network as described in claim 1, characterized in that, Step S5 includes the following steps: The outputs from the lower and upper decoders are passed to the background feature fusion module. First, they are concatenated along the channel dimensions. Then, the fused feature maps are processed using a spatial attention mechanism to enhance information interaction between different spaces. Finally, the output processed by deep attention is added to the spatial attention output, and element-wise multiplied with the spatial attention feature map to restore the original dimensions, generating the final clean background. The obtained background is used to calculate the reconstruction error to obtain the final detection result, and finally the obtained detection map is verified with the actual surface value.
Citation Information
Patent Citations
Hyperspectral image anomaly detection method based on full convolution auto-encoder
CN112598636A
Remote sensing hyperspectral reconstruction method and system based on spectrum self-attention mechanism
CN116091640A