A method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion

By adopting twin hybrid attention mechanism and multi-scale feature fusion network in remote sensing image detection, the problems of multi-scale feature extraction and edge details are solved, and the accuracy and accuracy of building change detection are improved.

CN118212532BActive Publication Date: 2024-12-10XIDIAN UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410522360.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2024-12-10
Estimated Expiration
2044-04-28

AI Technical Summary

Technical Problem

The existing remote sensing image building change detection methods fail to effectively learn multi-scale features, resulting in the problem of scale change not being effectively solved, and it is difficult to distinguish between constant and changing areas under the influence of light and shadow, resulting in the loss of detection accuracy and edge details.

Method used

Using a network based on twin hybrid attention mechanism and multi-scale feature fusion, multi-scale feature extraction module, multi-scale feature fusion module and hollow coordinate attention upsampling module are used to extract and fuse multi-scale features to enhance the global image information of the model. Capture capability to avoid information redundancy and noise interference.

Benefits of technology

It improves the accuracy and accuracy of building change detection, enhances feature extraction and fusion quality, improves the prediction effect of changing edges and small target objects, and reduces the complexity and calculation amount of model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118212532B_ABST
    Figure CN118212532B_ABST
Patent Text Reader

Abstract

A method for extracting building change areas in dual-phase remote sensing images based on a twin hybrid attention mechanism and multi-scale feature fusion, preprocessing the acquired remote sensing image building change detection data set and dividing it into a training set, a validation set and a test set; constructing a remote sensing image building change detection network; inputting the training set and the validation set into the remote sensing image building change detection network in turn for training and verification, and saving the weight parameter file; inputting the test set into the trained remote sensing image building change detection network for testing, loading the weight parameter file, and outputting the remote sensing image building change detection result; the present invention can effectively perform feature fusion and jointly extract multi-scale features by introducing a hybrid attention feature extraction module, a multi-scale feature fusion module and a hole coordinate attention upsampling module, and has the advantages of fully extracting feature information, avoiding information redundancy and noise interference, and enhancing the model's ability to capture global image information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of extracting building change regions in remote sensing images, and in particular relates to a method for extracting building change regions in dual-phase remote sensing images based on a twin hybrid attention mechanism and multi-scale feature fusion. Background Art

[0002] With the continuous acceleration of urbanization, urban landforms have undergone great changes, especially in the field of architecture. Architecture is an important carrier of urban development. Real-time and accurate monitoring of architectural change information can provide scientific basis and reference for key areas such as ecological environment protection, natural resource management, and urban expansion analysis, and identify and analyze urban architectural changes in different periods, providing profound insights for the decision-making process.

[0003] Remote sensing technology, as an important means of obtaining surface information, has long provided effective support for land cover monitoring, agricultural surveys, disaster assessments, and even national defense security. High-resolution remote sensing images contain rich spatial information and detailed features, which can be used to detect changes in specific ground objects. Therefore, how to use multi-temporal high-resolution remote sensing images to automatically and efficiently detect building changes has become a research hotspot that has attracted much attention.

[0004] As remote sensing images gradually shift from medium and low resolution to high spectral and high resolution, the texture, spectrum, shape and contour features contained in remote sensing images are becoming increasingly rich. However, traditional change detection methods based on pixels and feature levels can only analyze the surface features of remote sensing images and cannot fully utilize the deep features contained in remote sensing images. In recent years, deep learning technology, especially deep convolutional neural networks, has made breakthrough progress in many tasks such as scene classification and target extraction of remote sensing images with its powerful feature extraction capabilities. Researchers have begun to try to apply deep convolutional neural networks for semantic segmentation to remote sensing image building change detection. By inputting dual-phase remote sensing images into the deep learning model, after sufficient training, the building change areas in the two phases of images can be quickly and accurately detected, greatly improving the efficiency and accuracy of change detection.

[0005] In their paper "Research on the framework of remote sensing image change detection method based on twin network and typical semantic segmentation model" (Land and Resources Informationization, April 2021, Issue 2, pp. 15-21), authors including Wu Wenhui and Lei Tianjie designed a highly generalized remote sensing image change detection framework. This framework can flexibly use a variety of classic semantic segmentation models (such as U-Net, DeepLabv3+, etc.) for change detection tasks. The specific steps of this method are as follows: The semantic segmentation model is divided into two parts: the backbone network (feature extractor) and the head network. The backbone network is replaced by a twin network structure, which realizes the extraction of input image features by sharing parameters, while the head network adopts the original semantic segmentation model structure. In U-Net, the decoder uses multi-level feature map correlation maps for fusion calculation; for SemanticFPN, FPN uses multi-level feature map correlation maps for fusion calculation; DeepLab V3 does not have a multi-level feature fusion process; in DeepLab V3+, the decoder module uses shallow features after dimensionality reduction and deep features after ASPP for fusion. This design modifies the existing typical semantic segmentation model into a form suitable for solving the change detection problem. The disadvantages of this method are: weak feature extraction ability and poor prediction effect for change edges and small objects.

[0006] In their paper "Remote Sensing Image Target Detection Method Based on Multi-scale Feature Fusion" (Computer Science, Vol. 51, Issue 3, September 2023, Pages 165-173), Zhang Yang, Xia Ying and other authors proposed a remote sensing image target detection method based on multi-scale feature fusion based on YOLOv5. The specific steps of this method are as follows: First, the lightweight upsampling feature pyramid network LUPPN module is embedded into the benchmark model. This module can use fewer parameters to fuse multi-scale feature information; second, the Res-MHSA module is embedded into the benchmark model. This module can enhance the network's ability to discriminate features and improve detection accuracy; finally, in the benchmark model, by fusing the LUPPN module and the Res-MHSA module, the target is located and identified, and the detection effect is improved. The disadvantage of this method is that since the lightweight upsampling operator uses fewer network parameters to upsample the feature map, this may cause some detail information to be lost during the fusion process, limiting the ability to accurately extract and fuse features.

[0007] In their paper "MFSFNet: Multi-Scale Feature Subtraction Fusion Network for Remote Sensing Image Change Detection" (Remote Sensing, Vol. 15, Issue 15, August 2023, p. 3740), authors including Zhiqi Huang and HongjianYou proposed a method based on a multi-scale feature subtraction fusion network (MFSFNet) for remote sensing image change detection. The specific steps of this method are as follows: First, the feature extraction backbone network is initialized using the pre-trained ConvNeXt V2-Atto model; second, the boundaries and multi-scale features of the changed area are extracted through the multi-scale feature subtraction fusion method; finally, the extracted features are classified by a classifier to achieve change detection. The shortcomings of this method are: it fails to utilize complementary information to fully extract features, and the feature subtraction fusion network increases the complexity of the model.

[0008] Advances in deep learning-based change detection techniques have led to significant research progress. However, existing methods for detecting building changes in remote sensing images have the following shortcomings:

[0009] First, since different focus areas / objects in remote sensing images have different sizes and shapes, the scales of focus areas and boundaries may vary greatly in different images. Most methods fail to effectively learn multi-scale features to adjust the above scale variation problem.

[0010] Second, common methods apply attention to each temporal image separately to enhance its individual features, while ignoring the importance of multi-scale feature combinations; due to the influence of light and shadow, most methods cannot alleviate pseudo-changes well, resulting in poor performance in distinguishing unchanged and changed areas; in addition, fusing multi-scale features without effectively utilizing complementary information will lead to the loss of key edge details.

[0011] 3. The building change detection method based on the encoder-decoder neural network extracts deeper image features, but continuous downsampling may lead to insufficient spatial location information, resulting in incomplete detection of changed areas and rough building edges; based on the improvement of the single-phase semantic segmentation network, the dual-phase images are spliced ​​into one input, so that the early layers of the network cannot fully extract the information features of the original image. Due to the repeated use of the pooling layer for image downsampling, obvious information loss will occur, thus affecting the accuracy. Summary of the invention

[0012] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to provide a method for extracting building change areas in dual-phase remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion. By introducing a hybrid attention feature extraction module, a multi-scale feature fusion module and a hole coordinate attention upsampling module, it can effectively perform feature fusion and jointly extract multi-scale features. It has the advantages of fully extracting feature information, avoiding information redundancy and noise interference, and enhancing the model's ability to capture global image information.

[0013] In order to achieve the above object, the technical solution adopted by the present invention is:

[0014] A method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion, comprising the following steps:

[0015] Step 1, obtain a remote sensing image building change detection dataset, preprocess the remote sensing image building change detection dataset, and divide it into a training set, a validation set, and a test set;

[0016] Step 2: construct a remote sensing image building change detection network;

[0017] Step 3, inputting the training set and verification set obtained in step 1 into the remote sensing image building change detection network constructed in step 2 for training and verification, obtaining a trained remote sensing image building change detection network, and saving a weight parameter file;

[0018] Step 4: Input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3 for testing, load the weight parameter file trained in step 3, and output the remote sensing image building change detection result.

[0019] The specific method of step 1 is:

[0020] Step 1.1, collect remote sensing image building change detection dataset;

[0021] Step 1.2, cropping the data image of the remote sensing image building change detection dataset collected in step 1.1;

[0022] Step 1.3, divide the cropped remote sensing image building change detection dataset into a training set, a validation set, and a test set.

[0023] The remote sensing image building change detection network in the step 2 includes: a building change feature extraction network based on a twin hybrid attention mechanism, a multi-scale building change feature fusion network and a change detection network based on hole coordinate attention upsampling; wherein, the building change feature extraction network based on the twin hybrid attention mechanism fuses the self-attention mechanism (SelfAttention, SA) and the dual attention mechanism (Dual Attention, DA) to form a hybrid attention feature extraction module HAFE, which is used to extract multi-scale features to ensure the structural consistency of the changed buildings; the multi-scale building change feature fusion network adopts a multi-scale feature fusion module MSFF to fuse features from adjacent stages and fully extract feature information; the change detection network based on hole coordinate attention upsampling adopts a hole coordinate attention upsampling module DCAU to enhance the model's ability to capture global image information while retaining the sensitivity of coordinate attention to spatial position.

[0024] The specific construction method of the remote sensing image building change detection network in step 2 is:

[0025] Step 2.1, construct a hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism;

[0026] First, position block embedding is used to embed the continuous block information and position information into the smallest text unit. The self-attention mechanism SA embeds Q and K T Mapped to a weighted sum, where the weight is determined by each Q i and its corresponding K i The softmax function between is determined and then multiplied by V to enhance the perception of global change information; the output is:

[0027]

[0028] Where I represents the input image, T represents the output unit, Conv7×7(·) and Conv3×3(·) represent 7×7 and 3×3 convolution operations respectively. represents element multiplication, σ(·) represents the activation function, and the Query (Q) vector, Key (K) vector, and Value (V) vector are three vectors created for each input vector of the encoder. i , K i and V i It is the input of the self-attention mechanism SA;

[0029] The dual attention mechanism DA includes a multi-scale separable convolution module (Depth-wise Separable, DS) and an improved squeeze-excitation (Improved SE, ISE) attention mechanism module; the multi-scale separable convolution module DS uses convolution kernels of different sizes to match the sizes of different objects; the details are as follows:

[0030] The input feature map enters two 3×3 depth-wise separable convolutions, two 5×5 depth-wise separable convolutions, a 1×1 convolution and a pooling layer, and then the output features are fused and input into the improved squeeze-excitation ISE attention mechanism module;

[0031] The improved squeeze-excitation ISE attention mechanism module consists of channel and spatial squeeze-excitation units for target feature recalibration; the channel part emphasizes the information channel through channel dimension reduction and global averaging, and the spatial part generates a spatial attention map through spatial dimension reduction and global pooling; the output of the improved squeeze-excitation ISE attention mechanism module is merged with the output of the multi-scale separation convolution module DS by addition, focusing the complementary spatial channel attention across scales into a single unified block;

[0032] The twin network consists of two branches with the same structure and weights. The two branches process the input image simultaneously, effectively extract different features, and capture the changes between the dual-phase images by measuring the similarity between the outputs of the two branches. Based on the twin network, the hybrid attention feature extraction module HAFE operates in two ways and four stages to extract the multi-scale change features of the front and back remote sensing images. In the initial stage, stage 1 and stage 2, there are two layers of self-attention mechanism SA and one layer of dual attention mechanism DA, while in the deep stage, stage 3 and stage 4, there is a combination of one layer of self-attention mechanism SA and two layers of dual attention mechanism DA, which are calculated as follows:

[0033]

[0034] Where SA(·) and DA(·) represent the calculation of the self-attention mechanism SA and the dual-attention mechanism DA respectively; F out represents the output characteristics of a single stage; N represents the total number of stack operations in a stage, with a maximum value of 3; Q i , K i and V i is the input of SA, I DA is the input of DA, i∈{1, 2} and j∈{2, 3} represent the specific attention mechanism associated with the hybrid attention layer;

[0035] Step 2.2, construct a multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network:

[0036] The stages 2 and 3 of the hybrid attention feature extraction module HAFE have two adjacent stages, so the multi-scale feature fusion module MSFF corresponding to stages 2 and 3 has three input branches; let F k ∈R H×W×C represents the feature map of stage k, and F k-1 ∈R 2H×2W×(C / 2) and F k+1 ∈R (H / 2)×(W / 2)×2C It is the feature map output from its shallower stage and deeper stage adjacent stage; and adjusts the dimension of feature maps of different scales;

[0037] Use 1×1 convolution to transform F k-1 and F k+1 The number of channels of F is changed to C; then, F is convolved by a 3×3 convolution with a stride of 2. k-1 Downsample and use bilinear interpolation to adjust F k+1 Upsample to change its spatial size to H×W; obtain a multi-scale feature map F' of the same size k-1 、F' k and F' k+1 ∈R H×W×C ; Merge by element summing:

[0038] F=F′ k-1 +F′ k +F′ k+1 (3)

[0039] Use global average pooling (GAP) to fuse global information and generate channel-dimensional features s∈R 1×C ; The cth element of s is calculated as:

[0040]

[0041] Among them, F c is the cth channel of F;

[0042] Create a compact feature z∈R through a 1×1 convolution 1×d , which is equivalent to a fully connected layer:

[0043] z =ΦFc(s)=δ(B(Ws)) (5)

[0044] Where δ and B represent the PReLU activation function and batch normalization (BN) operation respectively, W∈R d×C , d is:

[0045]

[0046] Where r is the reduction ratio and L is the minimum value of d;

[0047] Use three parallel convolutions to reconstruct three C-dimensional vectors v k -1, v k and v k+1 ∈R 1×C , and perform softmax calculation on each element to obtain the attention vector s k-1 ,s k ,s k+1 ∈R 1×C ;s i The cth element of is calculated as follows:

[0048]

[0049] Among them, v i,c Indicates v i The c-th element of , i∈{k-1, k, k+1}, c∈{1, 2, …, C};

[0050] Perform weighted summation on the multi-scale features and calculate the fusion feature F according to the following formula: S ∈R H×W×C ;

[0051]

[0052] Among them, F s,c and F i,c Yes F s and F i For stage 1 and stage 4 with only one adjacent stage, the corresponding MSFF module has only two input branches, and other details remain the same;

[0053] Step 2.3, construct the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling:

[0054] In the DCAU module, F k-1 is the shared weight output of the low-level hybrid attention feature extraction module HAFE, F k represents the k-th multi-scale feature fusion module MSFF, F k+1 It represents the output feature of its adjacent deep features, that is, when k = 3, F k+1 represents the feature output of the (k+1)th multi-scale feature fusion module MSFF. When k∈{1,2}, F k+1 represents the output of the (k+1)th hole coordinate attention upsampling module DCAU;

[0055] F k-1 The low-level feature map is obtained through a 1×1 and a 3×3 convolution; F kBranch 1 undergoes a 1×1 and a 3×3 convolution, and branch 2 undergoes a 1×1 convolution and bilinear interpolation upsampling F. k+1 Merge and input into the parallel hole convolution module;

[0056] The parallel dilated convolution module is as follows: H×W×C As input, the channel attention is decomposed into 1-dimensional feature encodings in both horizontal and vertical directions, namely (H, 1) and (1, W), which can be formulated as:

[0057]

[0058] in, and are the output of the cth channel at height h and width w, z h ∈R C×H , z w ∈R C×W ;x c is the cth channel of X;

[0059] The feature maps generated by formula (9) are connected, and a new sub-feature map is obtained by 3×3 dilated convolution with four different expansion rates (1, 2, 3, 4). Then, it is concatenated with the feature map concatenated by formula (9) to obtain a new feature map. Subsequently, the feature map is divided into two separate tensors: f h ∈R d×H and f w ∈R d×W ;f h and f w Through two 1×1 convolutions, they are transformed into tensors with the same number of channels as the input X; finally, the attention weight map is used to enhance the representation of the input features; these enhanced input features are sent to the hole coordinate attention DCA and generate a hole coordinate-aware attention map, which is multiplied by F k The low-level feature map obtained by branch 1 is used to enhance its feature representation;

[0060] Finally, the low-level features and the upsampled deep features are combined by element-wise addition to obtain the output features.

[0061] The specific method of step 3 is:

[0062] Step 3.1, set the training parameters, input the remote sensing images in the training set obtained in step 1 into the remote sensing image building change detection network constructed in step 2, save the weight parameter file as "best_loss.pth", and use the binary cross entropy loss function BCEWithLogitsLoss with Sigmoid as the loss function;

[0063] The binary cross entropy loss function with Sigmoid

[0064] BCEWithLogitsLoss is as follows:

[0065]

[0066] in, is the Sigmoid function, log is the natural logarithm, p i represents a sample, x i Represents the probability of being predicted as a positive example, y i Represents sample x i The true label of , in the binary classification problem, y i Usually 0 or 1, indicating that the sample x i Whether it belongs to the category of positive examples;

[0067] Step 3.2: Input the training set and validation set in step 1 into the constructed remote sensing image building change detection network in sequence; the specific steps are:

[0068] Firstly, the image data in the training set and the validation set are input into the hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism to extract the multi-scale change features of the before and after remote sensing images; secondly, the result of the feature extraction network is input into the multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network to merge the feature information from adjacent stages; finally, the result of the feature fusion network is input into the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling to enhance the model's ability to capture the global information of the image and obtain the final feature map.

[0069] The specific method of step 4 is:

[0070] Step 4.1, input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3, and load the remote sensing image building change detection network weight parameter file "best_loss.pth" trained in step 3.1;

[0071] Step 4.2, perform remote sensing image building change detection on the images in the test set to obtain the change range of the building;

[0072] Step 4.3, output the detection results of the remote sensing image building change detection network and save the label file.

[0073] Compared with the prior art, the present invention has the following beneficial effects:

[0074] (1) The hybrid attention feature extraction module (HAFE) designed by the present invention integrates the self-attention mechanism (SA) and the dual attention mechanism (DA) to effectively extract complementary multi-scale features. The self-attention mechanism SA establishes long-range dependencies between multi-scale features, and the dual attention mechanism DA enhances the representation ability of the model by capturing the spatial and channel dependencies in the input data. Through the integration of the self-attention mechanism SA and the dual attention mechanism DA, the change information of buildings of different scales can be comprehensively analyzed, multi-scale features can be effectively learned, the prediction effect of changing edges and small target objects can be improved, and the detection accuracy can be improved.

[0075] (2) The multi-scale feature fusion module (MSFF) designed by the present invention can fuse feature information with different abstraction levels or scales obtained at different stages. Shallow features can enhance details, while deep features can enhance semantic information. Shallow and deep multi-scale features are combined to supplement the information contained in the current scale. In addition, this module introduces less convolution, avoiding the problem of information loss caused by continuous downsampling.

[0076] (3) The Dilated Coordinate Attention Upsampling module (DCAU) designed by the present invention improves the limitations of Coordinate Attention (CA) and enables it to capture a wider range of contextual information. Dilated Coordinate Attention (DCA) uses dilated convolution to enhance the model's ability to capture global image information while retaining the sensitivity of coordinate attention to spatial position. It significantly reduces the redundant introduction of lower-level features during feature extraction, reduces the complexity of the model, avoids excessive parameters and computation, and thus accelerates the training process.

[0077] In summary, compared with the existing building change detection technology for remote sensing images, the twin hybrid attention mechanism and multi-scale feature fusion network designed in the present invention extract and fuse multi-scale feature information from dual-phase images, enhance the feature extraction capability, and improve the precision and accuracy of building change detection. The present invention has the advantages of good feature extraction and fusion quality and high change detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 The figure is a flow chart of the implementation method of the present invention.

[0079] Figure 2 A schematic diagram of the remote sensing image building change detection network structure constructed for the present invention.

[0080] Figure 3 Schematic diagram of the hybrid attention feature extraction module HAFE constructed for the present invention.

[0081] Figure 4 Schematic diagram of the multi-scale feature fusion module MSFF constructed in the present invention.

[0082] Figure 5 Schematic diagram of the hole coordinate attention upsampling module DCAU constructed for the present invention.

[0083] Figure 6 The prediction result of the remote sensing image building change detection network constructed by the present invention, wherein: Figure 6 (a) is the remote sensing image at time T1, Figure 6 (b) is the remote sensing image at time T2, Figure 6 (c) is the label image, Figure 6 (d) is the test result. DETAILED DESCRIPTION

[0084] The technical solution and effects of the present invention are further described below in conjunction with the accompanying drawings.

[0085] like Figure 1 As shown, the present invention proposes a method for extracting building change areas in dual-temporal remote sensing images based on a twin hybrid attention mechanism and multi-scale feature fusion. The method includes the following steps: first, collect a public data set, then process the data set, and use the processed data set as a new data set. Then, build a network model and train it. Finally, input the test image into the network to obtain a building change detection result map. Specifically:

[0086] A method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion, comprising the following steps:

[0087] Step 1, obtain a remote sensing image building change detection dataset, preprocess the remote sensing image building change detection dataset, and divide it into a training set, a validation set, and a test set;

[0088] Step 1.1, collect the public dataset LEVIR-CD for remote sensing image building change detection. The image size of this dataset is 1024×1024 pixels, and it includes training set, validation set and test set. Each subset contains three folders, namely: image before change, image after change and label image;

[0089] Step 1.2, considering the computing power of the computer, the data image is cropped and its size is cropped to 256×256;

[0090] Step 1.3: randomly divide the processed data set into training set, validation set and test set in a ratio of 7:1:2, where the training set has 7120 images, the validation set has 1024 images and the test set has 2048 images.

[0091] Step 2: construct a remote sensing image building change detection network;

[0092] The remote sensing image building change detection network structure designed by the present invention includes three main parts: feature extraction, feature fusion and upsampling; Figure 2 As shown in the figure, the feature extraction part is designed as a hybrid attention feature extraction module (HAFE), which integrates the self-attention mechanism (SA) and the dual attention mechanism (DA) to effectively extract multi-scale features and ensure the structural consistency of the changing buildings; the feature fusion part adopts the multi-scale feature fusion module (MSFF) to fuse the features from adjacent stages, fully extract feature information, and avoid information redundancy and noise interference; the upsampling part adopts the dilated coordinate attention upsampling module (DCAU), which not only enhances the model's ability to capture the global information of the image, but also retains the sensitivity of the coordinate attention to the spatial position.

[0093] Step 2.1, construct a hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism;

[0094] The extraction of multi-scale features plays a vital role in accurately expressing the changing features of buildings in remote sensing images. The self-attention mechanism (SA) allows features at different positions in the input image to interact with each other and learn weights, which can capture global contextual information and establish semantic and contextual relationships between dual-time images. However, comparing the similarities between all labels or features may lead to redundancy and computational inefficiency. The dual attention mechanism (DA) integrates the global dependencies of local and multi-scale shapes, enabling the model to analyze the spatial relationships and similarities between different positions, improve the perception of building shapes and their relative positions, and enhance segmentation. Therefore, the self-attention mechanism SA and the dual attention mechanism DA are integrated in a hybrid attention mode. The self-attention mechanism SA is used to initially establish the long-term dependencies of the changing buildings, while the dual attention mechanism DA obtains the spatial relationships and correlations between different positions, extracts multi-scale change features, and ensures the structural consistency of the changing buildings. A hybrid attention mechanism (HAFE) module is jointly constructed.

[0095] The construction method of the hybrid attention feature extraction module HAFE is:

[0096] like Figure 3 As shown in (a), we first use position block embedding to embed the continuous block information and position information into the smallest text unit, and the self-attention mechanism SA embeds Q and K T Mapped to a weighted sum, where the weight is determined by each Q i and its corresponding K i The softmax function between is determined and then multiplied by V to enhance the perception of global change information; the output is:

[0097]

[0098] Where I represents the input image, T represents the output unit, Conv7×7(·) and Conv3×3(·) represent 7×7 and 3×3 convolution operations respectively. represents element multiplication, σ(·) represents the activation function, and the Query (Q) vector, Key (K) vector, and Value (V) vector are three vectors created for each input vector of the encoder. i , K i and V i It is the input of the self-attention mechanism SA.

[0099] However, the relative positions and interactions between dual-temporal remote sensing images are crucial. Using only the self-attention mechanism SA may not be able to capture the relationship between the relative positions of different buildings. Figure 3 As shown in (b), the dual attention mechanism DA includes a multi-scale separation convolution module (Depth-wise Separable, DS) and an improved squeeze-excitation (Improved SE, ISE) attention mechanism module; the multi-scale separation convolution module DS uses convolution kernels of different sizes, such as 3×3 and 5×5, to match the sizes of different objects. The details are as follows:

[0100] The input feature map enters two 3×3 depthwise separable convolutions, two 5×5 depthwise separable convolutions, a 1×1 convolution and a pooling layer, and then the output features are fused and input into the improved squeeze-excitation ISE attention mechanism module. This multi-scale filtering adapts to scale changes and optimizes feature extraction of objects of different sizes.

[0101] The improved squeeze-excitation ISE attention mechanism module consists of channel and spatial squeeze-excitation units for target feature recalibration; the channel part emphasizes the information channel through channel dimension reduction and global averaging, and the spatial part generates a spatial attention map through spatial dimension reduction and global pooling to highlight important areas and achieve adaptive, input-specific recalibration, thereby optimizing information flow. The fusion of optimized multi-scale filtering and recalibrated attention bridges the gap between fine-grained pixel complexity and broader channel characteristics. The output of the improved squeeze-excitation ISE attention mechanism module is merged with the output of the multi-scale separation convolution module DS by addition. This two-stage method focuses the complementary spatial channel attention across scales in a single unified block.

[0102] Using two independent coordinate positioning processes, the HAFE module can capture the fine-grained details of buildings and accurately identify the positioning problem of building change information in dual-time images.

[0103] The twin network consists of two branches with the same structure and weights. These two branches can process the input image at the same time and effectively extract different features. By measuring the similarity between the outputs of the two branches, the network can capture the changes between the dual-phase images; Figure 2 As shown in the figure, based on the twin network, the hybrid attention feature extraction module HAFE operates in two ways and four stages to extract the multi-scale change features of the front and back remote sensing images. In the initial stages, stages 1 and 2, there are two layers of self-attention mechanisms SA and one layer of dual attention mechanisms DA. In the deep stages, stages 3 and 4, there is a combination of one layer of self-attention mechanism SA and two layers of dual attention mechanisms DA. The calculation is as follows:

[0104]

[0105] Where SA(·) and DA(·) represent the calculation of the self-attention mechanism SA and the dual-attention mechanism DA respectively; F out represents the output characteristics of a single stage; N represents the total number of stack operations in a stage, with a maximum value of 3; Q i , K i and V i is the input of SA, I DA is the input of DA, i∈{1, 2} and j∈{2, 3} represent the specific attention mechanism associated with the hybrid attention layer; in stage 1 and stage 2 (initial stage), more SA is used to emphasize the main structural information and establish long-term correlations between buildings; in stage 3 and stage 4 (deep stage), the feature map is biased towards high-level semantic information, and a higher degree of DA is required to calculate the relative positions between changing buildings. Therefore, the hybrid attention feature extraction module HAFE fully integrates features from different scales and ensures the structural consistency of multi-scale features.

[0106] Step 2.2, construct a multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network:

[0107] Multi-scale feature fusion is a commonly used technique in machine vision tasks. Previous work often uses convolution to obtain multi-scale components of the input image, and then inputs them into a multi-stream network for feature extraction and fusion. The features obtained through different stages have different levels of abstraction or scales. Fusion of features at other scales can supplement the information contained in the current scale. Shallow features can enhance details, while deep features can enrich semantic information. In view of this, a multi-scale feature fusion module (MSFF) is designed to merge feature information from adjacent stages. To avoid information redundancy and noise interference, only features from adjacent stages are fused.

[0108] The construction method of the multi-scale feature fusion module MSFF is:

[0109] like Figure 2 As shown, stage 2 and stage 3 (intermediate level) of the hybrid attention feature extraction module HAFE have two adjacent levels, so the multi-scale feature fusion module MSFF corresponding to stage 2 and stage 3 has three input branches; Figure 4 As shown, let F k ∈R H×W×C represents the feature map of stage k, and F k-1 ∈R 2H×2W×(C / 2) and F k+1 ∈R (H / 2)×(W / 2)×2CIt is the feature map output from its shallower stage k-1 and the deeper stage adjacent stage; in order to facilitate subsequent fusion, the dimensions of feature maps of different scales need to be adjusted;

[0110] Use 1×1 convolution to transform F k-1 and F k+1 The number of channels of F is changed to C; then, F is convolved by a 3×3 convolution with a stride of 2. k-1 Downsample and use bilinear interpolation to adjust F k+1 Upsample to change its spatial size to H×W; obtain a multi-scale feature map F' of the same size k-1 、F' k and F' k+1 ∈R H×W×C ; Merge by element summing:

[0111] F=F′ k-1 +F′ k +F′ k+1 (3)

[0112] Use global average pooling (GAP) to fuse global information and generate channel-dimensional features s∈R 1×C ; Specifically, the cth element of s is calculated as:

[0113]

[0114] Among them, F c is the cth channel of F;

[0115] Create a compact feature z∈R through a 1×1 convolution 1×d , which is equivalent to a fully connected layer:

[0116] z=ΦFc(s)=δ(B(Ws)) (5)

[0117] Where δ and B represent the PReLU activation function and batch normalization (BN) operation respectively, W∈R d×C , d is:

[0118]

[0119] Where r is the reduction ratio and L is the minimum value of d;

[0120] Use three parallel convolutions to reconstruct three C-dimensional vectors v k-1 、v k and v k+1 ∈R 1×C , and perform softmax calculation on each element to obtain the attention vector s k-1 ,s k ,s k+1 ∈R1×C ;Specifically, s i The cth element of is calculated as follows:

[0121]

[0122] Among them, v i,c Indicates v i The c-th element of , i∈{k-1, k, k+1}, c∈{1, 2, …, C};

[0123] Perform weighted summation on the multi-scale features and calculate the fusion feature F according to the following formula: S ∈R H×W×C ;

[0124]

[0125] Among them, F s,c and F i,c Yes F s and F i The cth channel of ; therefore, the proposed MSFF module uses soft attention to achieve feature fusion across different scales. For stage 1 and stage 4, since they have only one neighboring stage, the corresponding MSFF module has only two input branches, while other details remain the same.

[0126] Step 2.3, construct the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling:

[0127] The upsampling part aims to generate a feature map that can accurately distinguish between changes and unchanged features by gradually integrating different levels of features from deep to shallow. As in the upsampling method used in UNet, redundant information from lower-level features may be introduced and affect the accuracy of the feature map. Coordinate Attention (CA) can be used to highlight local features in an image, but it may not be enough to capture broader contextual information, especially when the target object spans a large spatial range. Dilated Coordinate Attention (DCA) uses dilated convolution to enhance the model's ability to capture global information of the image while retaining the sensitivity of coordinate attention to spatial position. To this end, the Dilated Coordinate Attention Up-sample module (DCAU) is designed to consider both local details and global contextual information.

[0128] The construction method of the hole coordinate attention upsampling module DCAU is:

[0129] like Figure 5As shown in the figure, the designed DCAU module is shown, where F k-1 is the shared weight output of the low-level hybrid attention feature extraction module HAFE, F k represents the k-th multi-scale feature fusion module MSFF, F k+1 It represents the output feature of its adjacent deep features, that is, when k = 3, F k+1 represents the feature output of the (k+1)th multi-scale feature fusion module MSFF. When k∈{1,2}, F k+1 represents the output of the (k+1)th hole coordinate attention upsampling module DCAU;

[0130] F k-1 The low-level feature map is obtained through a 1×1 and a 3×3 convolution; F k Branch 1 undergoes a 1×1 and a 3×3 convolution, and branch 2 undergoes a 1×1 convolution and bilinear interpolation upsampling F. k+1 Merge and input into the parallel hole convolution module;

[0131] The parallel dilated convolution module is as follows: H×W×C As input, the channel attention is decomposed into 1-dimensional feature encodings in both horizontal and vertical directions, namely (H, 1) and (1, W), which can be formulated as:

[0132]

[0133] in, and are the output of the cth channel at height h and width w, z h ∈R C×H , z w ∈R C×W ;x c is the cth channel of X; in addition to cross-channel information, it can also capture sensitive information about direction and position, improving the accuracy of positioning and identifying areas of interest.

[0134] The feature maps generated by formula (9) are connected, and a new sub-feature map is obtained by 3×3 dilated convolution with four different expansion rates (1, 2, 3, 4). Then, it is concatenated with the feature map concatenated by formula (9) to obtain a new feature map. Subsequently, the feature map is divided into two separate tensors: f h ∈R d×H and f w ∈R d×W ;f h and f wThrough two 1×1 convolutions, they are transformed into tensors with the same number of channels as the input X; finally, the attention weight map is used to enhance the representation of the input features; the features of these enhanced input feature connections are sent to the hole coordinate attention DCA and generate a hole coordinate-aware attention map, which is multiplied by F k The low-level feature map obtained by branch 1 is used to enhance its feature representation;

[0135] Finally, the low-level features and the upsampled deep features are combined by element-wise addition to obtain the output features.

[0136] Step 3, input the training set and verification set obtained in step 1 into the remote sensing image building change detection network constructed in step 2 for training and verification, obtain the trained remote sensing image building change detection network, and save the weight parameter file;

[0137] The specific method of step 3 is:

[0138] Step 3.1, set the training parameters, input the remote sensing images in the training set obtained in step 1 into the remote sensing image building change detection network constructed in step 2, set the batch-size to 8, train for 200 rounds, and the initial learning rate to 0.0001. Each time, randomly and non-repeatedly select 8 pairs of remote sensing images obtained in the previous and next two periods from the training set and input them into the network; the weight parameter file is saved as "best_loss.pth", and the loss function uses the binary cross entropy loss function BCEWithLogitsLoss with Sigmoid;

[0139] The binary cross entropy loss function with Sigmoid

[0140] BCEWithLogitsLoss is as follows:

[0141]

[0142] in, is the Sigmoid function, log is the natural logarithm, p i represents a sample, x i Represents the probability of being predicted as a positive example, y i Represents sample x i The true label of , in the binary classification problem, y i Usually 0 or 1, indicating that the sample x i Whether it belongs to the category of positive examples;

[0143] Step 3.2: Input the training set and validation set in step 1 into the constructed remote sensing image building change detection network in sequence; the specific steps are:

[0144] Firstly, the image data in the training set and the validation set are input into the hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism to extract the multi-scale change features of the before and after remote sensing images; secondly, the result of the feature extraction network is input into the multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network to merge the feature information from adjacent stages; finally, the result of the feature fusion network is input into the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling to enhance the model's ability to capture the global information of the image and obtain the final feature map.

[0145] Step 4: Input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3 for testing, load the weight parameter file trained in step 3, and output the remote sensing image building change detection result.

[0146] The specific method of step 4 is:

[0147] Step 4.1, input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3, and load the remote sensing image building change detection network weight parameter file "best_loss.pth" trained in step 3.1;

[0148] Step 4.2, perform remote sensing image building change detection on the images in the test set to obtain the change range of the building;

[0149] Step 4.3, output the detection results of the remote sensing image building change detection network and save it as a label file in ".png" format.

[0150] The present invention proposes a method for extracting building change areas in dual-phase remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion, which solves the problem that the method of extracting and analyzing building change information from remote sensing images fails to make full use of multi-scale feature information, resulting in the loss of important features, inaccurate detection of change range, and poor quality of boundary area fusion.

[0151] Finally, if Figure 6 As shown, the prediction results of the remote sensing image building change detection network constructed by the present invention are further described. Figure 6 (a) is the remote sensing image at time T1, Figure 6 (b) is the remote sensing image at time T2, Figure 6 (c) is the label image, Figure 6(d) is the detection result of the method of the present invention. It can be seen from the figure that, compared with the original labeled image, the method of the present invention for remote sensing image building change detection can largely solve the problem of feature information loss and poor fusion quality, significantly improve the edge roughness phenomenon, and effectively avoid the misdetection and missed detection of small buildings, thereby enhancing the ability of feature extraction.

[0152] Application prospects of the present invention

[0153] Building change detection technology plays a vital role in the fields of urban planning and land resources management. With the continuous advancement of urbanization, the renewal and expansion of urban buildings are becoming more and more frequent. These changes not only have a profound impact on the management of land resources and the implementation of urban planning, but may also induce illegal construction activities, thereby threatening the lives and safety of the public.

[0154] In view of the shortcomings of current building change detection technology, the present invention designs a method for extracting building change areas in dual-phase remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion. This method aims to solve the problem that traditional technologies fail to fully utilize multi-scale feature information, resulting in the loss of important features, inaccurate detection of change ranges, and poor fusion quality in boundary areas. By combining the hybrid attention mechanism, the multi-scale feature fusion module, and the hole coordinate attention upsampling module, the building change detection network designed by the present invention can fully mine multi-scale feature information while ensuring high accuracy, and effectively extract complementary multi-scale features.

[0155] The present invention has broad application prospects. First, it can provide solid data support for urban planning and land resource management, assist relevant departments in real-time monitoring of building changes, and thus guide urban development and land use. Secondly, it is also of great significance to monitor and control illegal phenomena such as illegal buildings, which helps to protect people's lives and urban stability. In addition, the technology can also play a role in environmental protection, disaster warning and other fields, providing more support and guarantee for urban management and social development.

Claims

1. A method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion, characterized in that: The following steps are involved: Step 1, obtain a remote sensing image building change detection dataset, preprocess the remote sensing image building change detection dataset, and divide it into a training set, a validation set, and a test set; Step 2: construct a remote sensing image building change detection network; The remote sensing image building change detection network includes: a building change feature extraction network based on a twin hybrid attention mechanism, a multi-scale building change feature fusion network and a change detection network based on void coordinate attention upsampling; wherein, the building change feature extraction network based on the twin hybrid attention mechanism fuses the self-attention mechanism (SelfAttention, SA) and the dual attention mechanism (Dual Attention, DA) to form a hybrid attention feature extraction module HAFE, which is used to extract multi-scale features and ensure the structural consistency of the changed building; the multi-scale building change feature fusion network adopts a multi-scale feature fusion module MSFF to fuse features from adjacent stages and fully extract feature information; the change detection network based on void coordinate attention upsampling adopts a void coordinate attention upsampling module DCAU to enhance the model's ability to capture global image information while retaining the sensitivity of coordinate attention to spatial position; the specific construction method is: Step 2.1, construct a hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism; First, we use position block embedding to embed the continuous block information and position information into the smallest text unit. The self-attention mechanism SA embeds Q and K T Mapped to a weighted sum, where the weight is determined by each Q i and its corresponding K i The softmax function between is determined and then multiplied by V to enhance the perception of global change information; the output is: Where I represents the input image, T represents the output unit, Conv7×7(·) and Conv3×3(·) represent 7×7 and 3×3 convolution operations respectively. represents element multiplication, σ(·) represents the activation function, and the Query (Q) vector, Key (K) vector, and Value (V) vector are three vectors created for each input vector of the encoder. i , K i and V i It is the input of the self-attention mechanism SA; The dual attention mechanism DA includes a multi-scale separable convolution module (Depth-wise Separable, DS) and an improved squeeze-excitation (Improved SE, ISE) attention mechanism module; the multi-scale separable convolution module DS uses convolution kernels of different sizes to match the sizes of different objects; the details are as follows: The input feature map enters two 3×3 depth-wise separable convolutions, two 5×5 depth-wise separable convolutions, a 1×1 convolution and a pooling layer, and then the output features are fused and input into the improved squeeze-excitation ISE attention mechanism module; The improved squeeze-excitation ISE attention mechanism module consists of channel and spatial squeeze-excitation units for target feature recalibration; the channel part emphasizes the information channel through channel dimension reduction and global averaging, and the spatial part generates a spatial attention map through spatial dimension reduction and global pooling; the output of the improved squeeze-excitation ISE attention mechanism module is merged with the output of the multi-scale separation convolution module DS by addition, focusing the complementary spatial channel attention across scales into a single unified block; The twin network consists of two branches with the same structure and weights. The two branches process the input image simultaneously, effectively extract different features, and capture the changes between the dual-phase images by measuring the similarity between the outputs of the two branches. Based on the twin network, the hybrid attention feature extraction module HAFE operates in two ways and four stages to extract the multi-scale change features of the front and back remote sensing images. In the initial stage, stage 1 and stage 2, there are two layers of self-attention mechanism SA and one layer of dual attention mechanism DA, while in the deep stage, stage 3 and stage 4, there is a combination of one layer of self-attention mechanism SA and two layers of dual attention mechanism DA, which are calculated as follows: Where SA(·) and DA(·) represent the calculation of self-attention mechanism SA and dual-attention mechanism DA respectively; F out represents the output characteristics of a single stage; N represents the total number of stack operations in a stage, with a maximum value of 3; Q i , K i and V i is the input of SA, I DA is the input of DA, i∈{1, 2} and j∈{2, 3} represent the specific attention mechanism associated with the hybrid attention layer; Step 2.2, construct a multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network: The stages 2 and 3 of the hybrid attention feature extraction module HAFE have two adjacent stages, so the multi-scale feature fusion module MSFF corresponding to stages 2 and 3 has three input branches; let F k ∈R H×W×C represents the feature map of stage k, and F k-1 ∈R 2H×2W×(C / 2) and F k+1 ∈R (H / 2)×(W / 2)×2C It is the feature map output from its shallower stage and deeper stage adjacent stage; and adjusts the dimension of feature maps of different scales; Use 1×1 convolution to transform F k-1 and F k+1 The number of channels of F is changed to C; then, F is convolved by a 3×3 convolution with a stride of 2. k-1 Downsample and use bilinear interpolation to adjust F k+1 Upsample to change its spatial size to H×W; obtain a multi-scale feature map F' of the same size k-1 、F' k and F' k+1 ∈R H×W×C ; Merge by element summing: F=F′ k-1 +F′ k +F′ k+1 (3) Use global average pooling (GAP) to fuse global information and generate channel-dimensional features s∈R 1×C ; The cth element of s is calculated as: Among them, F c is the cth channel of F; Create a compact feature z∈R through a 1×1 convolution 1×d , which is equivalent to a fully connected layer: z =ΦFc(s)=δ(B(Ws)) (5) Where δ and B represent the PReLU activation function and batch normalization (BN) operation respectively, W∈R d×C , d is: Where r is the reduction ratio and L is the minimum value of d; Use three parallel convolutions to reconstruct three C-dimensional vectors v k-1 、v k and v k+1 ∈R 1×C , and perform softmax calculation on each element to obtain the attention vector s k-1 ,s k ,s k+1 ∈R 1×C ;s i The cth element of is calculated as follows: Among them, v i,c Indicates v i The c-th element of , i∈{k-1, k, k+1}, c∈{1, 2, …, C}; Perform weighted summation on the multi-scale features and calculate the fusion feature F according to the following formula: S ∈R H×W×C ; Among them, F s,c and F i,c Yes F s and F i For stage 1 and stage 4 with only one adjacent stage, the corresponding MSFF module has only two input branches, and other details remain the same; Step 2.3, construct the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling: In the DCAU module, F k-1 is the shared weight output of the low-level hybrid attention feature extraction module HAFE, F k represents the k-th multi-scale feature fusion module MSFF, F k+1 It represents the output feature of its adjacent deep features, that is, when k = 3, F k+1 represents the feature output of the (k+1)th multi-scale feature fusion module MSFF. When k∈{1,2}, F k+1 represents the output of the (k+1)th hole coordinate attention upsampling module DCAU; F k-1 The low-level feature map is obtained through a 1×1 and a 3×3 convolution; F k Branch 1 undergoes a 1×1 and a 3×3 convolution, and branch 2 undergoes a 1×1 convolution and bilinear interpolation upsampling F. k+1 Merge and input into the parallel hole convolution module; The parallel dilated convolution module is as follows: H×W×C As input, the channel attention is decomposed into 1-dimensional feature encodings in both horizontal and vertical directions, namely (H, 1) and (1, W), which can be formulated as: in, and are the output of the cth channel at height h and width w, z h ∈R C×H , z w ∈R C×W ;x c is the cth channel of X; The feature maps generated by formula (9) are connected, and a new sub-feature map is obtained by 3×3 dilated convolution with four different expansion rates (1, 2, 3, 4). Then, it is concatenated with the feature map concatenated by formula (9) to obtain a new feature map. Subsequently, the feature map is divided into two separate tensors: f h ∈R d×H and f w ∈R d×W ;f h and f w Through two 1×1 convolutions, they are transformed into tensors with the same number of channels as the input X; finally, the attention weight map is used to enhance the representation of the input features; these enhanced input features are sent to the hole coordinate attention DCA and generate a hole coordinate-aware attention map, which is multiplied by F k The low-level feature map obtained by branch 1 is used to enhance its feature representation; Finally, the low-level features and the upsampled deep features are combined by element-wise addition to obtain the output features; Step 3, inputting the training set and verification set obtained in step 1 into the remote sensing image building change detection network constructed in step 2 for training and verification, obtaining a trained remote sensing image building change detection network, and saving a weight parameter file; Step 4: Input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3 for testing, load the weight parameter file trained in step 3, and output the remote sensing image building change detection result.

2. According to claim 1, a method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion is characterized in that: The specific method of step 1 is: Step 1.1, collect remote sensing image building change detection dataset; Step 1.2, cropping the data image of the remote sensing image building change detection dataset collected in step 1.1; Step 1.3, divide the cropped remote sensing image building change detection dataset into a training set, a validation set, and a test set.

3. According to claim 1, a method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion is characterized in that: The specific method of step 3 is: Step 3.1, set the training parameters, input the remote sensing images in the training set obtained in step 1 into the remote sensing image building change detection network constructed in step 2, save the weight parameter file as "best_loss.pth", and use the binary cross entropy loss function BCEWithLogitsLoss with Sigmoid as the loss function; The binary cross entropy loss function BCEWithLogitsLoss with Sigmoid is as follows: in, is the Sigmoid function, log is the natural logarithm, p i represents a sample, x i Represents the probability of being predicted as a positive example, y i Represents sample x i The true label of , in the binary classification problem, y i Usually 0 or 1, indicating that the sample x i Whether it belongs to the category of positive examples; Step 3.2: Input the training set and validation set in step 1 into the constructed remote sensing image building change detection network in sequence; the specific steps are: Firstly, the image data in the training set and the validation set are input into the hybrid attention feature extraction module HAFE of the building change feature extraction network based on the twin hybrid attention mechanism to extract the multi-scale change features of the before and after remote sensing images; secondly, the result of the feature extraction network is input into the multi-scale feature fusion module MSFF based on the multi-scale building change feature fusion network to merge the feature information from adjacent stages; finally, the result of the feature fusion network is input into the hole coordinate attention upsampling module DCAU of the change detection network based on hole coordinate attention upsampling to enhance the model's ability to capture the global information of the image and obtain the final feature map.

4. According to claim 1, a method for extracting building change areas in dual-temporal remote sensing images based on twin hybrid attention mechanism and multi-scale feature fusion, characterized in that: The specific method of step 4 is: Step 4.1, input the test set obtained in step 1 into the remote sensing image building change detection network trained in step 3, and load the remote sensing image building change detection network weight parameter file "best_loss.pth" trained in step 3.1; Step 4.2, perform remote sensing image building change detection on the images in the test set to obtain the change range of the building; Step 4.3, output the detection results of the remote sensing image building change detection network and save the label file.