A dual-branch change detection method based on hyperspectral spatial and spectral information

Through a parallel dual-branch network, combined with depth-separable convolution and Transformer structure, the spatial and spectral features of hyperspectral images are extracted, which solves the problem of insufficient information fusion in the existing technology and improves the accuracy and robustness of change detection. .

CN118155082BActive Publication Date: 2024-09-03INSPUR OPTOELECTRONICS SATELLITE TECHNOLOGY (SHANDONG) CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410584676.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-09-03
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

It is difficult for the existing technology to fully utilize the spectral information and spatial information in hyperspectral images in change detection, resulting in insufficient detection accuracy and reliability. In particular, the serial structure of the convolutional neural network and Transformer fails to effectively integrate spatial and spectral features. leading to omissions or misjudgments.

Method used

A parallel dual-branch network is used. One branch is composed of depth-separable convolution and self-attention mechanism, and the other branch uses the Transformer structure to extract features through the spatial-spectral information fusion module, and combines the weighted contrast loss function to train the network to dynamically balance the two. branches to improve detection accuracy.

Benefits of technology

Through reasonable spatial and spectral information fusion, the accuracy and robustness of change detection are improved, overcoming the problem of inconsistent feature expression caused by the serial structure of the convolutional network and Transformer model, and providing a more comprehensive and accurate change detection algorithm. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118155082B
    Figure CN118155082B
Patent Text Reader

Abstract

The present invention relates to a dual-branch change detection method based on hyperspectral space and spectral information, belonging to the field of image processing technology. A parallel dual-branch network is used to process dual-phase hyperspectral image samples, one branch is a spatial attention module composed of deep separable convolution and self-attention mechanism, to obtain the spatial features of the dual phases, and the other branch is a spatial-spectral information fusion module that uses a Transformer structure to process hyperspectral images to obtain the spatial-spectral fusion features of the dual phases; the contrast loss of the two branches in the network is calculated separately, and the weighted sum is calculated to converge the network, and the sample pairs to be tested are predicted by the converged network to obtain the change detection results. The present invention makes full use of the capabilities of different model paradigms in spatial and spectral sequence feature extraction, greatly improves the accuracy and robustness of change detection, and provides a new and effective way for the research and application in the field of hyperspectral image change detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a dual-branch change detection method based on hyperspectral space and spectral information, which comprehensively utilizes the spatial information and spectral information of a hyperspectral image to improve the accuracy of change detection and belongs to the technical field of image processing and computer vision. Background Art

[0002] Change detection is an image processing and computer vision technology that aims to detect changes in the same scene at different time points or under different conditions. Change detection technology is usually used in remote sensing image analysis, monitoring systems, geographic information systems (GIS) and other fields. The basic idea of ​​change detection is to compare images at two or more time points to identify areas or objects that have changed. These changes can be caused by factors such as surface cover, land use, buildings, natural disasters, etc. Change detection has important application value in urban planning, environmental monitoring, agricultural management and other fields, and can help people better understand and manage surface changes.

[0003] With the rapid development of remote sensing satellites and imaging technology, the acquisition and collection of remote sensing data has become increasingly convenient. Hyperspectral images provide richer and more detailed spectral information and can capture more spectral characteristics of surface targets. Compared with traditional color or multispectral images, hyperspectral images record more band information at each pixel point, from continuous spectral data in the visible to infrared spectrum range, which can provide more detailed and accurate information on land object classification, environmental monitoring, and surface change analysis.

[0004] Deep learning methods have shown good performance in the field of change detection. However, due to the complex scenes in hyperspectral remote sensing images and unpredictable imaging conditions, the same type of objects have large spectral differences at different times and spatial positions. This spectral difference phenomenon seriously affects the accuracy of change detection. At the same time, convolutional neural networks are limited by their inherent network architecture and cannot mine sequence attributes or model the complex relationship between spectral features, failing to fully utilize the spectral information contained in hyperspectral images. Based on hyperspectral images, existing technologies mostly perform change detection from a single perspective, that is, by comparing hyperspectral images at different times or under different conditions, identifying changes in the surface. However, this method may ignore the rich correlation between spectral information and the role of spatial information. In fact, the relationship between spectral information and objects in hyperspectral images is usually complex and diverse, and the spatial correlation between objects may also affect the results of change detection. At the same time, existing technologies have tried to use convolutional networks and transformers for change detection at the same time, but most methods use convolutional networks to extract spatial features from images, and then input these features into transformers for global context modeling. Due to the nature of convolutional networks themselves, they are more suitable for processing image data, while transformer structures are more suitable for processing sequence data. The serial structure of convolutional networks and transformers in existing technologies does not fully consider the inconsistency of feature expression of the same feature in convolutional networks and transformers, and it is often difficult to fully integrate spatial and spectral information, which may lead to omissions or misjudgments, reducing the accuracy and reliability of change detection. To overcome this limitation, it is necessary to comprehensively consider the spectral and spatial information in hyperspectral images, and fully consider the results of convolutional networks and transformers, and develop a more comprehensive and accurate change detection algorithm to meet the needs of different application scenarios and improve the utilization value of remote sensing data. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a dual-branch change detection method based on hyperspectral space and spectral information, which provides a new and effective way for the research and application in the field of hyperspectral image change detection through a more reasonable fusion method of spatial and spectral information.

[0006] The technical solution adopted by the present invention is:

[0007] A dual-branch change detection method based on hyperspectral spatial and spectral information includes the following steps:

[0008] S1. Obtain hyperspectral images of the same area at two time points, take pixels as samples, construct a block sample at the center of each sample, and obtain block sample pairs corresponding to the same pixel points in the dual-phase hyperspectral images;

[0009] S2. Input the block sample pairs into the same parallel dual-branch network to obtain the dual-phase spatial features and spatial-spectral fusion features; one branch of the parallel dual-branch network is a spatial attention module composed of deep separable convolution and self-attention mechanism. After the block sample image is input, the spatial features obtained by deep separable convolution are further self-attention calculated to further enhance the discriminability of the spatial features, thereby obtaining spatial features containing more information; the other branch is a spatial-spectral information fusion module that uses the Transformer structure to process the hyperspectral image. After feature expansion and linear mapping, the block sample image first extracts spatial information in the spatial Transformer encoder, then rearranges the features, and then extracts the spectral information of the block sample image along the spectral channel in the spectral Transformer encoder, thereby obtaining spatial-spectral fusion features;

[0010] S3. Compare the obtained dual-phase feature changes, calculate the contrast loss of the two branches in the network respectively, and calculate the total loss by weighted sum to converge the network. The sample pair to be tested is predicted by the converged network to obtain the change detection result.

[0011] In the above method, the depth-separable convolution and self-attention calculation process in the spatial attention module described in step S2 are repeated twice.

[0012] The calculation process of depth-wise separable convolution includes depth-wise convolution and channel-wise convolution. Assuming the input image is X , the parameters of the depthwise separable convolution are K , the output feature map is Y spatial , formulated as follows:

[0013] For each input channel X c , respectively, with the corresponding depth convolution kernel K c Perform convolution operation to obtain the intermediate feature map M c , then the intermediate feature map M c The calculation can be expressed as:

[0014] ;

[0015] The intermediate feature maps of all depth convolutions M c Perform channel convolution operation and convert the number of channels C in Down to C out , and get the output feature map Yspatial ,Right now:

[0016] ,

[0017] in, K pointwise It is the convolution kernel of channel convolution, which is used to change the number of channels of the intermediate feature map from C in Down to C out .

[0018] The linear mapping process is shown in the following formula:

[0019] ,

[0020] in, w 1 is a trainable weight matrix of size n × wh ,and Contains the linear projection features of all spectral bands, 𝑛 represents the dimension of linear projection, input x Considered as a matrix, its size is wh × c ,in c , w and h are the number of channels, width and height of the block image respectively.

[0021] The linear mapping also includes a step of introducing position embedding information to mark the position of each block sample image. The process can be formulated as follows:

[0022] ,

[0023] in, p is with E The matrix with the same number of rows and columns is a random matrix of 𝑛×𝑐, representing the position embedding information, which changes and converges to the optimal value as the model is trained. Z 0 as the input to the spatial Transformer encoder.

[0024] The spatial Transformer encoder is composed of a multi-layer multi-head attention mechanism and a multi-layer perceptron, which is used to encode image features. The process can be formulated as follows:

[0025] ,

[0026] ,

[0027] Among them, 𝐿𝑁 represents the layer normalization operation, which is used to adjust the optimization space and ensure the stability of data distribution.Z d is the output of the spatial Transformer encoder, d Set to 2, that is Z 2 is the final output of the spatial Transformer encoder.

[0028] The spectral Transformer encoder has the same structure and the same calculation process as the spatial Transformer encoder, but due to feature rearrangement, the spectral Transformer encoder can extract spectral information of the block sample image along the spectral channel.

[0029] In the above method, the contrast loss calculation formula in step S3 is as follows:

[0030] ,

[0031] Among them, the label y i,j Indicates that the original image is located at i Line j The change labels corresponding to the pixels in the column, that is, the sample pair The corresponding label takes the value of 0 for the unchanged sample pair and takes the value of 1 for the changed sample pair. The loss function and They are used to measure the loss of unchanged and changed pixel pairs respectively. D i,j The Euclidean distance between the network output feature vectors representing the sample pair is calculated as follows:

[0032] ,

[0033] in, , , respectively represent the block sample images The network output result, loss function and The calculation is as follows:

[0034] ,

[0035] ,

[0036] in, is the prediction probability, which represents the probability that the current sample will change the corresponding pixel. for sigmoid function.

[0037] The total loss is calculated as follows:

[0038] ,

[0039] in, Loss spa and Loss spe They are contrast loss, which can be calculated using the contrast loss calculation method in step S3. The difference between the change detection results obtained by the features extracted by the spatial attention module and the spatial-spectral information fusion module and the true label is calculated respectively. The weighting factor l Dynamically adjust the network and perform dynamic learning through the network during training to make the network easier to converge.

[0040] When the network converges, the sample pairs The final predicted value of p With the pre-set threshold i The pixels with values ​​higher than the threshold are classified as changed pixels, and the other pixels are marked as unchanged pixels. X i,j Change detection prediction results , the prediction process formula is as follows:

[0041] ,

[0042] The final prediction value p are the predicted values ​​of the spatial attention module And the predicted value of the spatial-spectral information fusion module Obtained through exponential smoothing weighting, exponential smoothing can ensure the final forecast value p The value range is [0,1], the weighting factor is the same as the weighting factor in the loss function l Correspondingly, the process formula is as follows:

[0043] .

[0044] Another object of the present invention is to provide a dual-branch change detection system based on hyperspectral space and spectral information, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the dual-branch change detection method based on hyperspectral space and spectral information as described above is implemented.

[0045] A storage medium is a computer-readable storage medium, on which a computer program is stored for implementing the steps in the dual-branch change detection method based on hyperspectral space and spectral information as described above.

[0046] The beneficial effects of the present invention are:

[0047] (1) The method of the present invention combines the advantages of traditional convolutional neural networks and Transformer models, and proposes a dual-branch network that fuses the spatial information and spectral information of hyperspectral images in parallel. It fully utilizes the capabilities of different model paradigms in extracting spatial and spectral sequence features, overcomes the inconsistent feature expression problem caused by the serial structure of most convolutional networks and Transformer models, and obtains a more reasonable fusion structure of spatial information and spectral information.

[0048] (2) Through the combination of two branches, one branch uses deep separable convolution and attention mechanism to enhance the features of hyperspectral images from a spatial perspective, and the other branch uses the Transformer network to focus on the sequential properties of spectral information and mine spatial features from adjacent pixels. This can not only effectively capture the sequential properties of spectral features, but also extract spatial features from the relationship between adjacent pixels, thereby improving the accuracy and robustness of change detection;

[0049] (3) The dual-branch network trained with the weighted contrast loss function can also dynamically balance the contributions of the two branches, accelerate the convergence of the network, and further improve the performance of the algorithm. This method provides a new and effective way for the research and application of hyperspectral image change detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of the network model structure of the method of the present invention;

[0051] Figure 2 A schematic diagram of the network structure of the branch corresponding to the spatial attention module of the present invention;

[0052] Figure 3 Schematic diagram of the network structure of the corresponding branches of the spatial-spectral information fusion module of the present invention. DETAILED DESCRIPTION

[0053] The present invention is further described below with reference to specific embodiments.

[0054] Embodiment 1 A dual-branch change detection method based on hyperspectral spatial and spectral information comprises the following steps:

[0055] S1. Obtain the hyperspectral images of the same area at two time points, take the pixel points as samples, construct a block sample at the center of each sample, and obtain the block sample pairs corresponding to the same pixel points of the dual-phase hyperspectral images:

[0056] Change detection involves images of the same area at two time points to detect changes that occur between different time points. In the data preprocessing stage, the dual-phase hyperspectral image is represented as X 1 and X2 , which has the same spatial resolution 𝐻×𝑊 and the number of channels is C . Each pixel of the hyperspectral image is regarded as a sample, that is, a hyperspectral image with a resolution of 𝐻×𝑊 has a total of 𝐻𝑊 samples. In order to make each sample more representative, a block sample of size 𝑆×𝑆×C is constructed with each sample as the center, that is, each sample generates a block sample, and a total of 𝐻𝑊 block samples of size 𝑆×𝑆×C are formed, where 𝑆 is the length and width of the block image. In this embodiment, the value of 𝑆 is 13. In the training process, the dual-phase hyperspectral image is represented by a pair of block samples. i Line j The sample pairs corresponding to the pixel samples in the column are expressed as .

[0057] S2. Input the block sample pairs into the same parallel dual-branch network to obtain the dual-phase spatial features and spatial-spectral fusion features:

[0058] like Figure 1 As shown, the parallel dual-branch network includes two independent modules, namely the spatial attention module and the spatial-spectral information fusion module. Each module receives dual-phase hyperspectral image samples as a branch to accurately locate the change area from the spatial and spectral dimensions. The present invention reduces the computational cost by sharing network parameters in the parallel dual-branch network for processing images of different phases, that is, the same module in different branches has the same network layer, the same weight and bias, so that the dual-branch network has the same feature extraction capability, thereby accurately locating the differences and changes between dual-phase hyperspectral images.

[0059] like Figure 2 As shown in the figure, the spatial attention module consists of a deep separable convolution and a self-attention mechanism. The deep separable convolution can reduce the number of parameters and reduce the computational cost while integrating the spatial information extracted by the spatial convolution and the channel information learned by the 1×1 channel convolution to obtain spatial features that contain more information than ordinary convolution. After the block sample image is input, the spatial features obtained by the deep separable convolution are further subjected to self-attention calculation to further enhance the discriminability of the spatial features, thereby obtaining spatial features that contain more information. Assume that the input image is X , the parameters of the depthwise separable convolution are K , the output feature map is Y spatial , then the calculation process of depth-wise separable convolution can be divided into depth-wise convolution and channel-wise convolution, which can be formulated as follows:

[0060] For each input channel X c , respectively, with the corresponding depth convolution kernel Kc Perform convolution operation to obtain the intermediate feature map M c , then the intermediate feature map M c The calculation can be expressed as:

[0061] ,

[0062] The intermediate feature maps of all depth convolutions M c Perform channel convolution operation and convert the number of channels C in Down to C out , and get the output feature map Y spatial ,Right now:

[0063] ,

[0064] in, K pointwise It is the convolution kernel of channel convolution, which is used to change the number of channels of the intermediate feature map from C in Down to C out .

[0065] Then, the spatial features obtained by depthwise separable convolution are Y spatial Perform self-attention calculation to further enhance the discriminability of spatial features. The calculation of the self-attention mechanism follows the following formula:

[0066] ,

[0067] in, The spatial features are respectively Figure 2 In The calculation matrix obtained by linear mapping is, are the matrices to be calculated, corresponding to the query matrix (Query), key matrix (Key), and value matrix (Value). C is the scaling factor, according to The calculation results are confirmed. for softmax function.

[0068] like Figure 2 As shown, the present invention repeats the depthwise separable convolution and self-attention calculation process twice to obtain a more representative spatial feature representation. Through such a design, the present invention can obtain a more representative feature representation while keeping the model lightweight, thereby improving the performance of the model in the hyperspectral image change detection task.

[0069] like Figure 3 As shown in the figure, the spatial-spectral information fusion module uses the Transformer structure to process the hyperspectral image to fuse the spatial-spectral information. After feature expansion and linear mapping, the block sample image first extracts the spatial information in the spatial Transformer encoder, then the features are rearranged, and then the spectral information of the block sample image is extracted along the spectral channel in the spectral Transformer encoder to obtain the spatial-spectral fusion features.

[0070] The standard Transformer structure receives a one-dimensional sequence as input. In order to process three-dimensional hyperspectral images, the present invention transforms the input of this module into Expanding along the spatial dimension, we get In the present invention h and w Equal to the block sample image size S = 13. Since the resolution of the original input has been compressed into a one-dimensional spectral attribute, The partitioning method proposed in the present invention pays more attention to the current pixel and its adjacent pixels, and inputs a single pixel and its adjacent pixel sequence into the Transformer as data, thereby capturing the high-level spatial features of the hyperspectral image.

[0071] For the convenience of calculation, the present invention will input X ’ Considered as a matrix, its size is wh × c ,in c , w and h are the number of channels, width and height of the block sample image respectively. The block sample image is first linearly mapped and then encoded using the Transformer encoder. The linear mapping process is shown in the following formula:

[0072] ,

[0073] in, w 1 is a trainable weight matrix of size n × wh , x is the input, and It contains the linear projection features of all spectral bands, and 𝑛 represents the dimension of the linear projection. At the same time, the position of the block sample image in the original image has specific contextual information, which is crucial for the accuracy of hyperspectral change detection. Therefore, the present invention introduces position embedding information to mark the position of each block image. The process can be formulated as follows:

[0074] ,

[0075] in, p represents a random matrix of size 𝑛×𝑐, representing the position embedding information, which changes and converges to the optimal value as the model is trained. Z 0 is sent to the Transformer encoder composed of a multi-layer multi-head attention mechanism and a multi-layer perceptron to encode image features. The process can be formulated as follows:

[0076] ,

[0077] ,

[0078] Among them, 𝐿𝑁 represents the layer normalization operation, which is used to adjust the optimization space and ensure the stability of data distribution. Z d is the output of the spatial Transformer encoder, and d is set to 2, i.e. Z 2 is the final output of the spatial Transformer encoder.

[0079] The image features encoded by the spatial Transformer Z 2. Rearrange the features, that is, by transposing the matrix from Convert to , the features to be rearranged next Z’ 2 Input the spectral Transformer encoder. The spectral Transformer encoder has the same structure and the same calculation process as the spatial Transformer encoder. However, due to feature rearrangement, the spectral Transformer encoder can extract the spectral information of the block image along the spectral channel, and plays the role of extracting spectral information in the spatial-spectral information fusion module.

[0080] S3. Compare the obtained dual-phase feature changes, calculate the contrast loss of the two branches in the network respectively, and calculate the total loss by weighted sum to converge the network. The sample to be tested is predicted by the converged network to obtain the change detection result:

[0081] The spatial characteristics and spatial-spectral fusion characteristics of hyperspectral images in different phases are obtained respectively by using the spatial attention module and the spatial-spectral information fusion module. The present invention uses contrast loss to optimize the network model to make it converge and obtain reliable change detection results.

[0082] The contrast loss calculation formula is as follows:

[0083] ,

[0084] Among them, the label y i,j Indicates that the original image is located at i Line j The change labels corresponding to the pixels in the column, that is, the sample pair The corresponding label is 0 for unchanged sample pairs and 1 for changed sample pairs. Loss function and They are used to measure the loss of unchanged and changed pixel pairs respectively. D i,j The Euclidean distance between the network output feature vectors representing the sample pair is calculated as follows:

[0085] ,

[0086] in, , , respectively represent the block image samples The network output result. More specifically, the loss function and The calculation is as follows:

[0087] ,

[0088] ,

[0089] in, is the prediction probability, which represents the probability that the current sample will change the corresponding pixel. for sigmoid function.

[0090] Considering the different contributions of the two branches, the accuracy of change detection may be affected. In order to obtain the best detection result, the present invention introduces a weighting factor l , which is used to balance the contribution of the spatial attention module and the spatial-spectral information fusion module in change detection. The final loss is calculated as follows:

[0091] ,

[0092] in, Loss spa and Loss spe Both are contrast losses. They calculate the difference between the change detection results obtained by the features extracted by the spatial attention module and the spatial-spectral information fusion module and the true label. The weighting factor l Dynamically adjust the network, dynamically learn through the network during the training process, make the network easier to converge, and adjust the weighting factor in the test phase lTake the corresponding value when the network converges. In the training phase, after obtaining the final loss, the back propagation algorithm is used to update the network parameters, including the weights, biases, and linear mapping matrices of each connection layer. In the testing phase, only the forward propagation process is performed, and no network parameter update is involved.

[0093] When the network converges, the sample pairs The final predicted value of p With the pre-set threshold i The pixels with values ​​higher than the threshold are classified as changed pixels, and the other pixels are marked as unchanged pixels. X i,j Change detection prediction results , the present invention sets the change detection threshold i =0.6. The prediction process formula is as follows:

[0094] ,

[0095] The final prediction value p are the predicted values ​​of the spatial attention module And the predicted value of the spatial-spectral information fusion module Obtained through exponential smoothing weighting, exponential smoothing can ensure the final forecast value p The value range is [0,1], the weighting factor is the same as the weighting factor in the loss function l Correspondingly, the process formula is as follows:

[0096] ,

[0097] Get the detection results corresponding to each pixel The change detection result of the entire hyperspectral image is obtained.

[0098] Embodiment 2 This embodiment provides a hardware device for implementing a dual-branch change detection method based on hyperspectral spatial and spectral information.

[0099] A dual-branch change detection system based on hyperspectral space and spectral information includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the dual-branch change detection method based on hyperspectral space and spectral information as described in Example 1 above is implemented.

[0100] A storage medium is a computer-readable storage medium, on which a computer program is stored for implementing the steps in the dual-branch change detection method based on hyperspectral space and spectral information as described in Example 1 above.

[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A dual-branch change detection method based on hyperspectral spatial and spectral information, characterized in that: The steps include: S1. Obtain hyperspectral images of the same area at two time points, take pixels as samples, construct a block sample at the center of each sample, and obtain block sample pairs corresponding to the same pixel points in the dual-phase hyperspectral images; S2. Input the block sample pairs into the same parallel dual-branch network to obtain dual-phase spatial features and spatial-spectral fusion features; One branch of the parallel dual-branch network is a spatial attention module composed of a depthwise separable convolution and a self-attention mechanism. After the block sample image is input, the spatial features obtained by the depthwise separable convolution are further subjected to self-attention calculation to further enhance the discriminability of the spatial features, thereby obtaining spatial features containing more information; Another branch is the spatial-spectral information fusion module that uses the Transformer structure to process hyperspectral images. After feature expansion and linear mapping, the block sample image first extracts spatial information in the spatial Transformer encoder, then rearranges the features, and then extracts the spectral information of the block sample image along the spectral channel in the spectral Transformer encoder to obtain spatial-spectral fusion features. The calculation process of depth-wise separable convolution includes depth-wise convolution and channel-wise convolution. Assume the input image is X , the parameters of the depthwise separable convolution are K , the output feature map is Y spatial , formulated as follows: For each input channel X c , respectively, with the corresponding depth convolution kernel K c Perform convolution operation to obtain the intermediate feature map M c , then the intermediate feature map M c The calculation can be expressed as: ; The intermediate feature maps of all depth convolutions M c Perform channel convolution operation and convert the number of channels C in Down to C out , and get the output feature map Y spatial ,Right now: , in, K pointwise It is the convolution kernel of channel convolution, which is used to change the number of channels of the intermediate feature map from C in Down to C out ; S3. Compare the obtained feature changes of the two time phases, calculate the contrast loss of the two branches in the network respectively, and calculate the total loss by weighted sum to converge the network, and predict the sample pair to be tested with the converged network to obtain the change detection result; The contrast loss calculation formula is as follows: , Among them, the label y i,j Indicates that the original image is located at i Line j The change labels corresponding to the pixels in the column, that is, the sample pair The corresponding label takes the value of 0 for the unchanged sample pair and takes the value of 1 for the changed sample pair. The loss function and They are used to measure the loss of unchanged and changed pixel pairs respectively. D i,j The Euclidean distance between the network output feature vectors representing the sample pair is calculated as follows: , in, , Represents the block sample images respectively The network output result, loss function and The calculation is as follows: , , in, is the prediction probability, which represents the probability that the current sample will change the corresponding pixel. for sigmoid function; The total loss is calculated as follows: , in, Loss spa and Loss spe Both are contrast losses. They calculate the difference between the change detection results obtained by the features extracted by the spatial attention module and the spatial-spectral information fusion module and the true label. The weighting factor λ Dynamically adjust the network, dynamically learn through the network during the training process, make the network easier to converge, and adjust the weighting factor in the test phase λ Take the corresponding value when the network converges; When the network converges, the sample pairs The final predicted value of p With the pre-set threshold θ The pixels with values ​​higher than the threshold are classified as changed pixels, and the other pixels are marked as unchanged pixels. X i,j Change detection prediction results , the prediction process formula is as follows: , The final prediction value p are the predicted values ​​of the spatial attention module And the predicted value of the spatial-spectral information fusion module Obtained through exponential smoothing weighting, exponential smoothing can ensure the final forecast value p The value range is [0,1], the weighting factor is the same as the weighting factor in the loss function λ Correspondingly, the process formula is as follows: 。 2. The dual-branch change detection method based on hyperspectral spatial and spectral information according to claim 1 is characterized in that: The depthwise separable convolution and self-attention calculation process in the spatial attention module described in step S2 are repeated twice.

3. The dual-branch change detection method based on hyperspectral spatial and spectral information according to claim 1 is characterized in that: The linear mapping process is shown in the following formula: , in, w 1 is a trainable weight matrix of size n × wh ,and Contains the linear projection features of all spectral bands, n Represents the dimension of linear projection, input x Considered as a matrix, its size is wh × c ,in c , w and h are the number of channels, width and height of the block image respectively.

4. A dual-branch change detection method based on hyperspectral spatial and spectral information according to claim 1 or 3, characterized in that: The linear mapping also includes a step of introducing position embedding information to mark the position of each block sample image. The process can be formulated as follows: , in, p is with E Matrices with the same number of rows and columns are n × c The random matrix represents the position embedding information, which changes and converges to the optimal value as the model is trained. Z 0 as the input to the spatial Transformer encoder.

5. The dual-branch change detection method based on hyperspectral spatial and spectral information according to claim 1 is characterized in that: The spatial Transformer encoder is composed of a multi-layer multi-head attention mechanism and a multi-layer perceptron, which is used to encode image features. The process can be formulated as follows: , , in, LN Representation layer normalization operation, used to adjust the optimization space and ensure the stability of data distribution, Z d is the output of the spatial Transformer encoder, d Set to 2, that is Z 2 is the final output of the spatial Transformer encoder.

6. The dual-branch change detection method based on hyperspectral spatial and spectral information according to claim 1 is characterized in that: The spectral Transformer encoder has the same structure and the same calculation process as the spatial Transformer encoder, but due to feature rearrangement, the spectral Transformer encoder can extract spectral information of the block sample image along the spectral channel.

7. A dual-branch change detection system based on hyperspectral spatial and spectral information, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the dual-branch change detection method based on hyperspectral space and spectral information as described in any one of claims 1-6 is implemented.

8. A storage medium, which is a computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for implementing the steps in the dual-branch change detection method based on hyperspectral spatial and spectral information as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Power transmission corridor foreign matter detection method and system based on twin network

    CN112215085A

  • Hyperspectral image change detection method and system based on deep twin network

    CN115187861A

  • Building change detection method based on double-time-phase high-resolution remote sensing image

    CN115719447A

  • MROCNet model construction and multi-source remote sensing image change detection method and system

    CN116363526A

  • Light-weight structure sensing Transform network and VHR remote sensing image change detection method

    CN116778238A