A hyperspectral image target detection method based on background adversarial learning
By constructing training set preparation networks TCGAN-BS and SRGAN, and combining them with an adaptive linear fusion strategy, the problems of spectral variability and background complexity in hyperspectral image target detection are solved, achieving high-precision target detection and background suppression.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA INFOMRAITON CONSULTING & DESIGNING INST CO LTD
- Filing Date
- 2026-04-02
- Publication Date
- 2026-07-24
AI Technical Summary
Existing hyperspectral image target detection technologies face problems such as spectral variability, extremely low target pixel ratio, complex background with limited annotation, curse of dimensionality, and difficulty in fusion of spatial and spectral features, which lead to a decline in detection accuracy and performance.
A hyperspectral image target detection method based on background adversarial learning is constructed, including a training set preparation network TCGAN-BS, a generative adversarial network for band selection and background pixel screening, an SRGAN network for background reconstruction and detection, and an adaptive linear fusion strategy to achieve spatial-spectral feature fusion.
It improves the accuracy of target detection and background suppression in hyperspectral images, enhances the prominence of targets and the accuracy of detection, and performs exceptionally well, especially in the absence of prior information.
Smart Images

Figure CN122454136A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hyperspectral remote sensing image processing technology, specifically a hyperspectral image target detection method based on background adversarial learning. Background Technology
[0002] Hyperspectral remote sensing technology combines spatial features of images with rich spectral features, exhibiting outstanding characteristics such as image-spectral integration and spectral continuity. Hyperspectral images (HSI) cover a wide range of spectral bands from visible light to infrared, providing diagnostic spectral feature information to distinguish different substances, which has led to widespread attention being paid to HSI processing. Hyperspectral target detection (HTD), as a core technology of modern remote sensing information processing, has become one of the most dynamic research directions in the field of Earth observation.
[0003] Hyperspectral Detection and Analysis (HTDA) refers to a technology that uses continuous spectral data of ground features acquired through hyperspectral imaging (HSI) to identify and locate specific targets in complex background environments using specific algorithm models. When the spectral characteristics of a target are known, the detection algorithm needs to distinguish the target from other ground features in the remote sensing image to determine the target's presence within each pixel. This method, which utilizes prior information from HSI to assist target detection, is called hyperspectral prior detection. Hyperspectral anomaly detection, on the other hand, does not require prior target spectral information; it identifies anomalous targets by analyzing the differences in pixel distribution between the HSI and the background. In recent years, HTD technology has been successfully applied in many fields. In the military and security field, the HYDICE system developed by the United States can achieve a camouflage identification accuracy of over 90% and a sensitivity for detecting chemical warfare agents at the ppm level. In environmental monitoring, the European Space Agency's MERIS sensor has achieved an 85% accuracy in monitoring algal blooms and a thickness resolution of 0.1 μm for detecting marine oil pollution. In precision agriculture, crop disease early warning systems based on AVIRIS data can detect disease signs 7-10 days in advance, with soil moisture inversion errors controlled within 5%. my country has also made significant progress in these application areas, such as using Gaofen-5 data to achieve quantitative monitoring of air pollutants and developing a precise crop growth assessment system based on Zhuhai-1 data. Of particular note is that, with the deepening of application demands, HTD technology is developing towards specialization and refinement, such as early detection of specific diseases and precise identification of trace pollutants. These applications place higher demands on detection algorithms.
[0004] Having gone through two important development stages—digital signal processing and artificial intelligence—HTD technology has accumulated fruitful research results. However, the inherent characteristics of HSI bring many challenges to target detection. First, spectral variability leads to significant differences in similar land features under different conditions, while different types of land features may have similar characteristics. Coupled with sensor noise and atmospheric interference, the reliability of spectral features is reduced. Second, the extremely low proportion and sparse distribution of target pixels, coupled with complex backgrounds but limited annotations, restricts the training effect of algorithms. Third, the curse of dimensionality and difficulties in fusion of spatial and spectral features brought about by high-dimensional data increase the difficulty of algorithm design. Finally, in practical applications, factors such as complex background interference, target camouflage, and temporal differences further reduce detection performance. In recent years, end-to-end deep learning (DL) technology with autonomous feature learning capabilities has rapidly emerged. This technology breaks through the dependence of traditional methods on manual feature design, automatically mining discriminative feature representations from massive amounts of data through deep neural networks, demonstrating groundbreaking performance and application prospects in the HSD field. This data-driven research paradigm is leading technological innovation in this field.
[0005] Constructing training samples that accurately reflect the data distribution characteristics, and designing deep networks and detection networks to deeply analyze the spectral and spatial features of HSI (High-Speed Interference Sensor) to achieve high-performance target highlighting and background suppression, is a current hot research topic in deep learning-based HTD (High-Density Detection) algorithms. Existing HTD algorithms based on GAN (Generative Approach) networks and autoencoders (AEs) achieve detection by learning the background distribution, effectively improving the problem of decreased detection accuracy caused by the large difference in the pixel ratio between the target and the background in HSI. Summary of the Invention
[0006] Purpose of the invention: The technical problem to be solved by the present invention is to provide a hyperspectral image target detection method based on background adversarial learning, which addresses the shortcomings of the existing technology.
[0007] To address the aforementioned technical problems, this invention discloses a hyperspectral image target detection method based on background adversarial learning, comprising the following steps:
[0008] Step 1: Construct the training set preparation network and the generative adversarial network (SRGAN: Super-Resolution Generative Adversarial Network) using adversarial loss, target feature attenuation constraint and out-of-class suppression constraint. The training set preparation network (TCGAN-BS) includes a band selection module and a background pixel filtering module. The band selection module contains a generative adversarial network.
[0009] Step 2: Input the three-dimensional random noise data and hyperspectral image into the generative adversarial network in the band selection module to obtain the corresponding band subsets of the hyperspectral image; and use local variance to estimate the noise level of each band, and select the bands with noise levels less than the threshold from each subset to form the final band selection result.
[0010] Step 3: Input the band selection results from the band selection module into the background pixel filtering module to filter out representative background pixels to form a background training set;
[0011] Step 4: Input the background training set prepared from the training set into the improved SRGAN (Super-Resolution Generative Adversarial Network) network for training;
[0012] Step 5: Input the hyperspectral image to be detected, i.e. the original image, into the trained SRGAN network to obtain the reconstructed background image. Obtain the residual image by performing pixel-by-pixel residual operation on the original image and the reconstructed background image.
[0013] Step 6: Input the residual image into the RX (Reed-Xiaoli) detector to achieve spectral detection, use guided filtering combined with attribute filtering to achieve spatial detection, and use adaptive linear fusion to achieve the fusion of spectral detection and spatial detection to obtain the final detection result that highlights the target and suppresses the background.
[0014] The adaptive linear fusion specifically involves adjusting the contribution ratio of spatial features and spectral features in the final detection through adaptive parameters to achieve the fusion of the two.
[0015] The band selection module includes a generative adversarial network, the generator of which consists of a three-layer fully connected network and batch normalization; the background pixel filtering module includes a feature extraction layer and a dictionary generation layer.
[0016] Furthermore, the specific steps for the band selection module in step 2 to obtain each band subset are as follows:
[0017] Step 2-1-1: The generator of the generative adversarial network consists of a three-layer fully connected network and batch normalization. It takes a random noise vector (three-dimensional random noise data) as input, extracts the depth features between bands, and achieves highly discriminative band clustering in complex scenes with mixed pixels or unknown ground objects based on the depth features.
[0018] Step 2-1-2: Implement real clustering using fuzzy C-Means: Generate a clustering probability matrix based on the similarity matrix of each band of the 3D random noise data, and perform soft partitioning of all bands according to the probability matrix to obtain several band subsets; use the band subsets as simulated clustering matrices and input them into the discriminator of the generative adversarial network to provide the discriminator with more effective supervision signals;
[0019] Step 2-1-3: Use adversarial loss to train the generator and discriminator. The trained generator is then used for each band subset.
[0020] Furthermore, the specific steps for obtaining the optimal band using local variance estimation in step 2 are as follows:
[0021] Step 2-2-1: First, determine the size of the window, that is, select a window of a suitable size as the basic unit for calculating local variance;
[0022] Step 2-2-2: For each band, iterate through each pixel and calculate the variance within a defined window around each pixel.
[0023] Step 2-2-3: To reduce fluctuations caused by estimation noise, a Gaussian filter is used to smooth the calculated local variance;
[0024] Step 2-2-4: Estimate the global noise level of the entire band by analyzing the histogram of local variance or calculating the statistical characteristics of local variance (median, mean, etc.).
[0025] Furthermore, the specific process of background pixel filtering by the background pixel filtering module in step 3 is as follows:
[0026] The background pixel filtering module's feature extraction layer and dictionary generation layer obtain a sparse dictionary representing the background through feature extraction and target masking. The sparse autoencoder layer and background subset extraction layer obtain a sparse coefficient matrix through feature mapping.
[0027] Step 3-1: The feature extraction layer extracts features from the band selection results to obtain sub-image features;
[0028] The feature extraction layer consists of two convolutional layers and a pooling layer. The convolutional layers extract HSI features through convolution operations. Convolutional kernels are used to perform convolution operations, and local weighted summation is performed on the extracted feature maps to obtain local feature maps. After the convolution operation, the ReLU activation function is used to introduce non-linearity. Subsequently, the pooling layer compresses the spatial dimension of the feature maps through downsampling operations to obtain the final local feature maps.
[0029] Step 3-2: The dictionary generation layer introduces a target masking mechanism. By masking the target region in the sub-image, it focuses on feature learning and modeling of background pixel information and generates a background dictionary through a sparse linear combination method.
[0030] Step 3-3: The sparse autoencoder layer uses the extracted sub-image features and the generated background dictionary as a basis. By solving the optimization problem under sparse constraints, the sparse coefficient matrix is calculated, so that the input data can be represented as a linear combination of the background dictionary and the sparse coefficient matrix, thus preserving the core information of the data.
[0031] Steps 3-4: The background subset extraction layer performs in-depth analysis on the non-zero coefficients in the sparse coefficient matrix, and selects the pixels that contribute significantly to the sparse representation and best reflect the overall characteristics of the background, thus forming a representative subset of background pixels.
[0032] Furthermore, step 3-1 specifically includes the following operations:
[0033] Step 3-1-1: During the feature extraction process, the input data is convolved using a preset convolution kernel to effectively capture the spatial relationships and feature patterns of local regions in the input data, thereby obtaining key local feature maps;
[0034] Step 3-1-2: After obtaining the linear feature map through convolution, the ReLU activation function is introduced to perform non-linear transformation, injecting non-linear characteristics into the key local feature map;
[0035] Step 3-1-3: Compress the spatial dimension of key local feature maps through downsampling operations to reduce computational complexity and enhance the robustness of features.
[0036] Furthermore, the specific steps for generating the background dictionary in step 3-2 are as follows:
[0037] Step 3-2-1: Utilize the feature compression capability of convolutional layers to reduce the number of channels of the input sub-image features from C dimensions to 1 dimension, thereby generating a spatial feature map that reflects spatial attention and intuitively shows the distribution of feature importance at different spatial locations.
[0038] Step 3-2-2: Apply the Sigmoid activation function to the spatial feature map to obtain a probability mask for distinguishing pixel categories. When the mask value approaches 0, the corresponding pixel is identified as a background pixel; when the mask value approaches 1, it is identified as a target pixel. Based on this, further target feature suppression operations are performed to reduce the interference of the target region on subsequent background modeling.
[0039] Step 3-2-3: Use a fully connected layer to perform dimensionality transformation on the spatial feature map processed by the Sigmoid activation function. First, flatten it into a one-dimensional vector, and then generate a dictionary specifically for background feature representation through mapping operations. This dictionary can capture the core feature patterns of the background region.
[0040] Step 3-2-4: Apply an activation function to the generated background dictionary. By introducing a nonlinear transformation, the dictionary can more flexibly adapt to the complex distribution of background features, thereby enhancing the feature representation capability of the background dictionary.
[0041] Furthermore, the specific process of training the sparse autoencoder layer in step 3-3 is as follows:
[0042] Step 3-3-1: Construct an encoder consisting of multiple fully connected layers to transform the input data into a sparse coefficient matrix through nonlinear mapping, thereby achieving feature compression and sparse representation of the original data;
[0043] Step 3-3-2: The decoder receives the sparse coefficient matrix as input and reconstructs it into data through a reverse mapping process, restoring the core feature information of the input data;
[0044] Step 3-3-3: To optimize model performance, a dual loss mechanism is introduced. The reconstruction loss calculates the difference between the input and reconstructed data, ensuring the reconstruction result accurately approximates the original data. The sparsity loss constrains the sparse coefficient matrix, forcing it to maintain its sparsity characteristics. During model training, the parameters of the sparse autoencoder (SAE) are optimized by minimizing the total loss function comprised of the reconstruction and sparsity losses.
[0045] Furthermore, the specific process of the improved SRGAN (including encoder and decoder) training phase in step 4 is as follows:
[0046] Step 4-1: The encoder maps the input background training samples, i.e. the input samples, to the latent feature space through a nonlinear mapping function containing learnable parameters. The learnable parameter weight matrix and bias vector are optimized and adjusted during the training process through the backpropagation algorithm to extract the essential features of the input data and represent the input samples as latent feature vectors in the low-dimensional latent space.
[0047] Step 4-2: The decoder reconstructs the latent feature vectors to have the same dimension and distribution as the original input data through a nonlinear mapping function, reconstructing the input samples so that they match the latent feature representations in the feature space;
[0048] Step 4-3: Introduce latent layer adversarial loss, reconstruction loss, target feature decay loss and out-of-class suppression loss to optimize training.
[0049] Furthermore, the loss functions in steps 4-3 are specifically expressed as follows:
[0050] Step 4-3-1: The encoder and decoder are trained using the mean squared error function as the reconstruction loss. By measuring the difference between the input data and the reconstruction result, the model is guided to learn accurate feature reconstruction capabilities.
[0051] Step 4-3-2: During training, fake samples generated by the latent layer are input into the discriminator, and a standard Gaussian distribution is introduced as a reference for comparison. The model is optimized by using the adversarial loss of the latent layer to enhance the approximation between the fake samples and the real distribution.
[0052] Step 4-3-3: To eliminate target spectra that may be mixed in with background samples, target feature attenuation loss is introduced. The spectral angle between each reconstructed spectral vector and the preset contrast target spectrum is calculated, and the smaller spectral angle is selected as the loss value to constrain the model to weaken target features in the background.
[0053] Step 4-3-4: Add out-of-class suppression constraint loss to the latent space to remove spectral vectors that deviate significantly from the background spectrum in the latent feature space, further optimize the background feature distribution, and improve the model's accurate representation of the background.
[0054] Furthermore, the spectral detection and spatial detection in step 5 are specifically as follows:
[0055] Spectral detection: The residual image is detected using an RX detector to obtain the results of the spectral detection stage;
[0056] Spatial detection stage: Bright connected components in specific regions of the residual image are removed by attribute opening operation, and dark connected components with the same attributes are removed by attribute closing operation. Small targets are preserved, large-scale background interference is suppressed and the background is homogenized. Then, guided filtering is performed to enhance the image, which preserves significant edges while smoothing texture and suppressing noise, thereby improving the geometric consistency and accuracy of the detection results.
[0057] Furthermore, the specific implementation of adaptive fusion in step 6 is as follows:
[0058] By adjusting the contribution ratio of spatial features and spectral features in the final detection through adaptive parameters, the fusion of the two is achieved. When the parameter is set to 0.5, the contributions of spectral detection and spatial detection are equal; if it is less than 0.5, it means that the contribution of spectral detection is lower than that of spatial detection; if it is greater than 0.5, it means that the contribution of spectral detection is higher than that of spatial detection.
[0059] Beneficial effects:
[0060] (1) The present invention constructs a training set preparation network TCGAN-BS. In the absence of prior information, firstly, to address the band redundancy problem, high-discriminative band clustering is achieved through adversarial learning based on GAN in the training set preparation stage, and a band subset is obtained by noise estimation. Then, to address the lack of prior knowledge and the complex HSI background, a background pixel filtering module inspired by sparse representation is constructed to generate a background training set.
[0061] (2) In the background learning stage, the present invention constructs a background spectral feature learning network based on GAN, and adds target feature attenuation constraint and out-of-class suppression constraint, which improves the ability of GAN to mine deep spectral features and detailed information of HSI and improves the background reconstruction effect.
[0062] (3) In the detection stage, the present invention constructs a spatial spectrum fusion detection network to make full use of the complex spectral information and spatial features of HSI.
[0063] (4) In the comparison results between the HTD algorithm involved in this invention and various detection algorithms, the detection accuracy on multiple benchmark datasets is the highest, and the corresponding detection maps also show better visual effects. It not only effectively improves the detection accuracy of HTD, but also has better target prominence and background suppression effects. Attached Figure Description
[0064] Figure 1 Here is the overall flowchart of this method.
[0065] Figure 2 A schematic diagram of the band selection module in TCGAN-BS
[0066] Figure 3 Flowchart of the background pixel filtering module in TCGAN-BS
[0067] Figure 4 Diagram of SRGAN network architecture
[0068] Figure 5 This is a schematic diagram of the detection module.
[0069] Figure 6 To validate the pseudo-color image and ground truth image of the dataset, as well as the detection results of different methods on the dataset. Detailed Implementation
[0070] As attached Figures 1 to 4 As shown in the flowchart, the hyperspectral image target detection method based on background adversarial learning according to the present invention specifically includes the following steps:
[0071] S1: Construct the training set preparation network TCGAN-BS. First, input the hyperspectral image X with M×N pixels and B bands into the clustering network (GAN) of the band selection module. The generator generates a simulated clustering matrix. Fuzzy C-Means is used to realize real band clustering and input into the discriminator of the clustering network to realize band clustering based on adversarial learning.
[0072] S11: The generator G takes a random noise vector as input. Assuming the number of clusters is M, the generator outputs a two-dimensional matrix. This simulates real-world band clustering.
[0073] Here, the element is the probability value of the b-th band being assigned to the m-th cluster, and the sum of the elements in each row of this matrix is 1;
[0074] S12: Achieving Real-World Clustering Using Fuzzy C-Means: For Spectral Images Fuzzy C-Means treats each band as a feature vector. Its goal is to The band is divided into M clusters with cluster centers, generating a cluster probability matrix U. The formula for updating the cluster centers is:
[0075]
[0076] in, v represents the probability that the i-th band belongs to the j-th cluster. j Let be the cluster center in the j-th cluster.
[0077] The clustering probability matrix is:
[0078]
[0079] Clustering is achieved by minimizing the following objective function:
[0080]
[0081] Where m is a fuzzy parameter with a value of 2. The Euclidean distance between the two;
[0082] S13: The generator and discriminator are trained using adversarial loss:
[0083]
[0084] The trained generator is used to generate clustered subsets of each band.
[0085] S2: Use local variance to estimate the noise level of each band in the sub-band, select the band with the lowest noise level in each sub-band and combine them into the final band selection result to achieve optimal band acquisition;
[0086] S21: Determine the window size. Select a window... A window of a specific size is used to calculate local variance;
[0087] S22: For each band, iterate through its individual pixels and calculate the variance within a defined window around it. The calculation formula is as follows:
[0088]
[0089] in, Indicates the location at coordinates The pixel value, where N is the number of pixels within the window. It is the average value of the pixels within the window;
[0090] S23: Use a Gaussian filter to smooth the calculated local variance and reduce fluctuations in the estimated noise;
[0091] S24: Estimate the global noise level of the entire band by analyzing the local variance histogram or calculating the statistical characteristics of the local variance, such as the median and mean.
[0092] S3: TCGAN-BS achieves background pixel selection through a background pixel selection module, which consists of a feature extraction layer, a dictionary generation layer, a sparse autoencoder layer, and a background subset extraction layer. A sparse dictionary representing the background is obtained through feature extraction, and then a sparse coefficient matrix is obtained through feature mapping using the SAE, thereby selecting representative background pixels. The sub-images obtained after TCGAN-BS band selection and background pixel selection are saved as the background training set. use;
[0093] S31: The feature extraction layer extracts representative and discriminative spatial and spectral features through convolution operations and max pooling;
[0094] S311: Using convolution kernels Perform convolution operation on the input sub-image Perform local weighted summation to extract local features:
[0095]
[0096] in, Is the convolution kernel at position The weights on input channel b and output channel c, where k is the size parameter of the convolution kernel. It is input In position Values on band b It is a bias term.
[0097] S312: After the convolution operation, the ReLU activation function is used to introduce nonlinearity:
[0098]
[0099] S313: Downsample the feature map F using max pooling:
[0100]
[0101] Where s is the pooling step size and R is the size of the pooling window;
[0102] S32: The dictionary generation layer uses a target mask to suppress the target and generates a background dictionary D. b This allows background pixels to be sparsely represented using this dictionary;
[0103] S321: Compress the number of channels from C to 1 using a convolutional layer to generate a spatial attention map E.
[0104]
[0105] S322: Use the Sigmoid activation function to map E to the range [0, 1] to obtain the probability mask M. If... Then this pixel is a background pixel. This is the target pixel:
[0106]
[0107] Perform target feature suppression:
[0108]
[0109] S323: Feature maps are processed through a fully connected layer. Flattened into a one-dimensional vector And map it to the background dictionary D b :
[0110]
[0111] in, It is the weight matrix of the fully connected layer. It is a bias term. It is the background dictionary with K generated dictionary atoms.
[0112] S324: Applying an activation function to the output background dictionary introduces non-linearity, enhancing the expressive power of the dictionary generation layer.
[0113]
[0114] S33: Sparse autoencoder layer from X and background dictionary D b Calculate the sparse coefficient matrix A, and represent X as D. b Linear combination of A and A:
[0115]
[0116] S331: Constructing encoder E using multiple fully connected layers S Map the input data X to A:
[0117]
[0118] in, It is the encoder's mapping function. These are the encoder parameters.
[0119] S332: Decoder S Map A to reconstructed data:
[0120]
[0121] in, It is the mapping function of the decoder. These are the parameters of the decoder.
[0122] S333: Using reconstruction loss to measure the input data X and the reconstructed data Differences between them:
[0123]
[0124] Use sparsity loss to enforce the sparsity of A:
[0125]
[0126] Minimize the total loss function Training SAE:
[0127]
[0128] in, It is a regularization parameter that controls the strength of sparsity;
[0129] S34: The background subset extraction layer selects the most representative subset of background pixels by analyzing the non-zero coefficients in A. :
[0130]
[0131] S4: Transfer the training set Inputting an improved SRGAN based on GAN (Generative Adversarial Network), the model is trained to generate a reconstructed background. To improve background reconstruction performance, latent layer adversarial loss, reconstruction loss, target feature attenuation loss, and out-of-class suppression loss are introduced.
[0132] S41: Input training samples The encoder E is mapped to the latent feature Z;
[0133] S42: Z is mapped by decoder De to reconstruct the background. ;
[0134] S43: Encoder E and decoder De are trained using latent layer adversarial loss, reconstruction loss, target feature decay loss and out-of-class suppression loss;
[0135] S431: Encoder E and decoder De are trained using the mean squared error function as the reconstruction loss:
[0136]
[0137] Where, x i Let the i-th pixel be the input training sample. To reconstruct the i-th pixel of the background, d l The number of bands for the input sample;
[0138] S432: Fake samples generated by latent layer Z and standard Gaussian distribution Z real It is sent to the discriminator D z Meanwhile, a standard Gaussian distribution N(0,1) is input as a comparison. Training is performed using a latent layer adversarial loss:
[0139]
[0140] S433: Target Feature Attenuation Loss aims to remove target spectra that may be mixed in with the background samples. The spectral angle between each reconstructed spectral vector and the contrasting target spectrum is calculated, and the smaller spectral angle is used as the loss.
[0141]
[0142] Where t is the contrast target spectrum obtained in the background screening step;
[0143] S434: An out-of-class suppression constraint loss is added to the latent space between encoder E and decoder De to remove spectral vectors that deviate significantly from the background spectrum in the latent feature space. This constraint is expressed as:
[0144]
[0145] Where, dz Let E be the dimension of the latent space, and let E denote the encoder E.
[0146] S5: By comparing the original hyperspectral image X with the reconstructed image The residual image is obtained by performing pixel-by-pixel residual calculation. The data is then input into the detection module. A Reed-Xiaoli detector is used for spectral detection, while morphological property filters and guided filters are used for spatial detection.
[0147] S51: Spectral detection is achieved using an RX detector; the residual image can be represented as... The spectral detection result is then achieved by the following formula:
[0148]
[0149] in yes The p-th pixel in and They are The mean and covariance matrices;
[0150] S52: During the spatial detection phase, apply attribute opening operations. Remove bright connected components with specific region attributes and apply attribute-closing operations. This process removes dark connected components with the same specific region, selectively preserves small target regions, suppresses large-scale background interference, and homogenizes the background region.
[0151]
[0152] Use guided filtering on background region D m Enhancements are performed to smooth textures and suppress noise while preserving significant edge features, thereby improving the geometric consistency and accuracy of detection results:
[0153]
[0154] S6: The final detection result D, which is obtained by adaptively fusing the spectral detection result T1 and the spatial detection result T2. F ;
[0155] S61: Adaptive parameters that utilize the contributions of spatial and spectral features to the final detection. To achieve integration. A value of 0.5 indicates that spectral detection and spatial detection contribute equally. When the value is less than 0.5, the contribution rate of spectral detection is lower than that of spatial detection, while When the value is greater than 0.5, the contribution rate of spectral detection is higher than that of spatial detection.
[0156] Specific Implementation Example 1:
[0158] The Texas Coast dataset consists of a series of scenes captured by AVIRIS sensors in the Texas coastal region. It has a size of 100×100 pixels, 204 spectral bands, and a spatial resolution of 17.2m. The targets to be detected are buildings of varying sizes, occupying 67 pixels. The Airport dataset, also 100×100 pixels, was collected by AVIRIS at San Diego Airport in California, covering the San Diego Airport area. It has a spatial size of 100×100 pixels, contains 224 spectral bands with a wavelength range of 370–2510 nm, and a spatial resolution of approximately 3.5m. A total of 189 bands were used. Three aircraft are the targets to be detected in the images, occupying 57 pixels.
[0159] Figure 5 The images show pseudo-color and ground truth images of two datasets, as well as detection results of different methods on both datasets. "Proposed" indicates the detection results corresponding to the method involved in this invention. As can be seen from the detection results, the method involved in this invention effectively preserves all target pixels with clear and sharp target edges, and almost completely eliminates background interference, resulting in very clear detection results.
[0160] Based on multiple datasets and in the absence of prior information, a GAN-based band clustering module was constructed during the training sample preparation phase to address the band redundancy problem and obtain the bands with the least noise interference in each category. Then, to address the lack of prior knowledge and the complexity of HSI backgrounds, a sparse representation-based background pixel filtering module was constructed, automatically generating a clean and representative background training set through sparsity constraints. In the background learning phase, a GAN-based background spectral feature learning network was constructed. By introducing target feature attenuation constraints and out-of-class sample suppression constraints, the network's ability to mine deep HSI spectral features was effectively improved. In the detection phase, a joint spatial-spectral detection strategy was used to fully utilize the rich spatial and spectral features of HSI. A systematic comparison with several advanced detection methods was conducted. Experimental results show that this method achieved the best detection accuracy on all four test datasets. Visualized detection results demonstrate that the algorithm excels in target enhancement and background suppression, significantly improving detection performance.
[0161] Figure 6The diagram displays pseudo-color images and ground truth images for two datasets, along with detection results from different methods on both datasets. ACGAN is a detection method using an auxiliary generative adversarial network, RGAE is a detection method based on graph-structured data reconstruction errors, and CSCR is a sparse collaborative representation detection method. The detection results show that the method described in this invention effectively preserves all target pixels with sharp and clear target edges, and almost completely eliminates background interference, resulting in very clear detection results.
[0162] The AUC values of different methods on the two experimental datasets are shown in the table below:
[0163] Table 1. AUC values of different methods
[0164] BS-SRGAN 0.99863 0.99919 LRX 0.7317 0.8737 UNRS 0.8259 0.9721 LSUNRSORAD 0.9080 0.9963 SRTD 0.9165 0.7994 CSCR 0.9945 0.9965 RGAE 0.9887 0.9821 ACGAN 0.99703 0.99115
[0165] Table 1 shows the AUC values of different methods on two experimental datasets. The detection AUC values of the method involved in this invention on the two datasets are 0.99863 and 0.99919, respectively, which are the highest among all methods and show a significant improvement. This indicates that the method involved in this invention has excellent detection performance.
[0166] Existing neural network-based detection algorithms typically achieve detection by modeling the background distribution, mitigating the performance degradation caused by the severe imbalance between target and background pixels in HSI (Highly Sensitive Intrusion) images. However, without prior knowledge, the inherent characteristics of HSI, such as complex backgrounds and large spectral differences, prevent the model from fully utilizing background spectral information, thus affecting background reconstruction results. Furthermore, the band redundancy of HSI significantly impacts the modeling performance of GANs, making it difficult for the network model to effectively retain core discriminative features during the feature learning stage, leading to significant degradation of background details in the reconstructed image. At the network structure level, traditional adversarial loss functions struggle to effectively discriminate complex background textures and spectral differences, easily generating samples that deviate from the true distribution, thereby reducing the network's performance in background reconstruction.
[0167] This method effectively addresses the challenges of training set preparation in the absence of prior information and the limitations imposed by band redundancy on neural network reconstruction performance. It constructs a one-stage training set preparation network based on adversarial learning. To address the insufficient feature extraction capabilities of GANs, a two-stage background spectral feature learning network SRGAN based on GAN adversarial learning and an adaptive spatial-spectral fusion detection module are built. For example, in the scenario of unknown mineral exploration, where prior spectral information about unknown minerals is unavailable, this method can detect anomalies even with missing prior information, resulting in a complete spectral reconstruction image.
[0168] This invention provides a hyperspectral image target detection method based on background adversarial learning. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.
Claims
1. A hyperspectral image target detection method based on background adversarial learning, characterized in that, Includes the following steps: Step 1: Construct the training set preparation network and the generative adversarial network SRGAN. The training set preparation network includes a band selection module and a background pixel filtering module. Step 2: Input the three-dimensional random noise data and hyperspectral image into the band selection module to obtain a two-dimensional matrix containing each band subset; and use local variance to estimate the noise level of each band, and select some bands with noise levels less than the threshold from each subset to form the final band selection result; Step 3: Input the band selection results from the band selection module into the background pixel filtering module to filter out representative background pixels to form a background training set; Step 4: Input the background training set (prepared from the network output) into the improved SRGAN network for training; Step 5: Input the hyperspectral image to be detected, i.e. the original image, into the trained SRGAN network to obtain the reconstructed background image. Obtain the residual image by performing pixel-by-pixel residual operation on the original image and the reconstructed background image. Step 6: Input the residual image into the RX detector to perform spectral detection and obtain the final detection result that highlights the target and suppresses the background.
2. The hyperspectral image target detection method based on background adversarial learning according to claim 1, characterized in that, The band selection module described in step 2 obtains a two-dimensional matrix containing various band subsets. The specific steps are as follows: Step 2-1-1: The generator extracts the depth features between bands of the random noise vector, performs band clustering based on the depth features, and simulates the real band clustering situation; Step 2-1-2: Implement true clustering using the fuzzy C-Means algorithm; Step 2-1-3: Use adversarial loss to train the generator and discriminator, and generate each band subset through the trained generator.
3. The hyperspectral image target detection method based on background adversarial learning according to claim 2, characterized in that, Step 2, which involves estimating the noise level of each band using local variance, specifically includes the following steps: Step 2-2-1: First, determine the window size; Step 2-2-2: For each band, iterate through each pixel and calculate the variance within a defined window around each pixel. Step 2-2-3: Use a Gaussian filter to smooth the calculated local variance; Step 2-2-4: Estimate the global noise level of the entire band by analyzing the histogram of local variance or calculating the statistical characteristics of local variance.
4. The hyperspectral image target detection method based on background adversarial learning according to claim 2, characterized in that, The specific process by which the background pixel filtering module performs background pixel filtering in step 3 is as follows: Step 3-1: The feature extraction layer extracts features from the band selection results to obtain sub-image features; Step 3-2: The dictionary generation layer introduces a target masking mechanism. By masking the target region in the sub-image, it focuses on feature learning and modeling of background pixel information and generates a background dictionary through a sparse linear combination method. Step 3-3: The sparse autoencoder layer uses the extracted sub-image features and the generated background dictionary as a basis. By solving the optimization problem under sparse constraints, the sparse coefficient matrix is calculated, so that the input data can be represented as a linear combination of the background dictionary and the sparse coefficient matrix, thus preserving the core information of the data. Steps 3-4: The background subset extraction layer performs in-depth analysis on the non-zero coefficients in the sparse coefficient matrix, selects the pixels in the sparse representation, and forms a representative subset of background pixels.
5. The hyperspectral image target detection method based on background adversarial learning according to claim 4, characterized in that, The specific steps for generating the background dictionary in step 3-2 are as follows: Step 3-2-1: Utilize the feature compression capability of convolutional layers to reduce the number of channels of the input sub-image features from C dimensions to 1 dimension, thereby generating a spatial feature map that can reflect spatial attention. Step 3-2-2: Apply the Sigmoid activation function to the spatial feature map to obtain a probability mask for distinguishing pixel categories. Based on this, further suppress the target features to reduce the interference of the target region on subsequent background modeling. Step 3-2-3: Use a fully connected layer to perform dimensionality transformation on the spatial feature map processed by the Sigmoid activation function. First, flatten it into a one-dimensional vector, and then generate a dictionary specifically for background feature representation through mapping operations. Step 3-2-4: Apply an activation function to the generated background dictionary to enhance its feature representation ability by introducing a nonlinear transformation.
6. The hyperspectral image target detection method based on background adversarial learning according to claim 4, characterized in that, The specific process of training the sparse autoencoder layer in step 3-3 is as follows: Step 3-3-1: Construct an encoder consisting of multiple fully connected layers to transform the input data into a sparse coefficient matrix through nonlinear mapping, thereby achieving feature compression and sparse representation of the original input data; Step 3-3-2: The decoder receives the sparse coefficient matrix as input and reconstructs it into data through a reverse mapping process, restoring the core feature information of the input data; Step 3-3-3: Introduce a dual loss mechanism to optimize the parameters of the sparse autoencoder by minimizing the total loss function composed of the reconstruction loss and the sparsity loss.
7. The hyperspectral image target detection method based on background adversarial learning according to claim 1, characterized in that, The training phase of the improved SRGAN network in step 4 specifically includes introducing latent layer adversarial loss, reconstruction loss, target feature decay loss, and out-of-class suppression loss to optimize training.
8. The hyperspectral image target detection method based on background adversarial learning according to claim 7, characterized in that, The layer adversarial loss, reconstruction loss, target feature attenuation loss, and out-of-class suppression loss are specifically as follows: The SRGAN network's encoder and decoder are trained using the mean squared error function as the reconstruction loss. By measuring the difference between the input data and the reconstruction result, the model is guided to learn accurate feature reconstruction capabilities. During training, fake samples generated by the latent layer are input into the discriminator, and a standard Gaussian distribution is introduced as a reference for comparison. The model is optimized by using the adversarial loss of the latent layer to enhance the approximation of the fake samples to the real distribution. The target feature attenuation loss is introduced. The spectral angle between each reconstructed spectral vector and the preset contrast target spectrum is calculated. The smaller spectral angle is selected as the loss value to constrain the model to weaken the target features in the background. Adding out-of-class suppression constraint loss to the latent space removes spectral vectors that deviate significantly from the background spectrum in the latent feature space, further optimizing the background feature distribution and improving the model's accurate representation of the background.
9. The hyperspectral image target detection method based on background adversarial learning according to claim 1, characterized in that, The specific steps of spectral detection and spatial detection in step 5 are as follows: Spectral detection: The residual image is detected using an RX detector to obtain the results of the spectral detection stage; Spatial detection stage: Bright connected components in specific regions of the residual image are removed by attribute opening operation, and dark connected components with the same attributes are removed by attribute closing operation. Small targets are preserved, large-scale background interference is suppressed and the background is homogenized. Then, guided filtering is performed to enhance the image, which preserves significant edges while smoothing texture and suppressing noise, thereby improving the geometric consistency and accuracy of the detection results.
10. The hyperspectral image target detection method based on background adversarial learning according to claim 1, characterized in that, Step 6 specifically includes: using guided filtering combined with attribute filtering to achieve spatial detection, and using adaptive linear fusion to achieve the fusion of spectral detection and spatial detection.