# Edge-Guided Hierarchical Network for Building Change Detection in Remote Sensing Images
## 2 Methods
### Edge-Guided Module  
The encoder network performs multi-level feature extraction and differential feature extraction on remote sensing images, which are used to better extract discriminative features between changing and unchanging regions. In Section 2.3, the edge-extracted module extracts the change information of the target features by combining deep semantic features and shallow features. In order to further improve the edge detection performance of changing buildings and obtain finer features, the neural network uses edge features to guide the process of building change detection. Based on the above considerations, the edge-guided module (EGM) is designed in this section. There are four edge-guided modules in the EGHNet structure, which are located in the jump connection part of each resolution feature (as shown in the gray module in Figure 1). This module guides the network to improve the quality of the change detection results by fusing the edge features and change features of the target features, increasing the weight on the edge information in the change features of different resolutions, enhancing the salience of the change target features, and obtaining more discriminative features. Its specific structure is shown in Figure 3.  
The input of this module is divided into two parts, which are the extracted edge features \(F_{edge}\) and the bi-phasic spatial features \(F_{i1}^{i}\) and \(F_{i2}^{i}\) with different resolutions. Among them, the edge features \(F_{edge}\) are generated by the edge-extracted module EEM in the previous subsection; bi-temporal features \(F_{i1}^{i}\) and \(F_{i2}^{i}\). Use Equation (5) to compute the variation features at the corresponding resolution:  
\[F_{i}=\left|F_{i1}^{i}-F_{i2}^{i}\right| \tag{5}\]  
Meanwhile, the edge feature \(F_{edge}\) is downsampled by \(i-1\) times to generate a feature with the same size as the change feature. After that, the edge features are multiplied element-wise with the change feature \(F_{i}\) to obtain the edge weights, which are then added element-wise. Next, a \(1\times 1\) convolutional layer is used for channel alignment to obtain the fusion feature \(F^{\prime}_{i}\). The process is denoted as follows:  
\[F^{\prime}_{i}=Conv_{1\times 1}\Big{[}F_{i}\oplus\Big{(}F_{i}\odot Maxpooling \Big{(}F_{edge}\Big{)}\Big{)}\Big{]} \tag{6}\]  
where \(Conv_{1\times 1}\) denotes convolution operation, \(\oplus\) denotes element-by-element addition, \(\odot\) denotes Hadamard product whose operation is element-by-element multiplication, and \(Maxpooling\) denotes maximum pooling as the downsampling method. Through the above operation, the initial fusion of change features and edge features is realized, and the edge information in the deep features is given weights, which makes the network increase the attention to the edges. To further explore the intrinsic connections in the features, EGM introduces a channel attention mechanism to filter the feature channels so as to retrieve feature responses that are more beneficial for the change detection task. Specifically, EGM uses channel global maximum pooling (GMP) and global average pooling (GAP) to aggregate features \(F^{\prime}_{i}\), denoted respectively:  
\[F_{mi}=Maxpooling\Big{(}F^{\prime}_{i}\Big{)} \tag{7}\]  
\[F_{ai}=Avepooling\Big{(}F^{\prime}_{i}\Big{)} \tag{8}\]  
The features \(F_{mi}\) and \(F_{ai}\) obtained in both ways are then channel stacked and the attention values of each channel are obtained using convolution and Sigmoid functions. Finally, the EGM multiplies the channel attention values with the fused features \(F^{\prime}_{i}\) to obtain the final output \(F_{ei}\). The process is denoted as follows:  
\[F_{ei}=F^{\prime}_{i}\odot\sigma[Conv_{1\times 1}(Concat(F_{mi};F_{ai}))] \tag{9}\]  
Figure 3: Structure of Edge-Guided Module. where \(\odot\) denotes the Hadamard product, \(Conv_{1\times 1}\) denotes a convolutional layer with a convolutional kernel size of \(1\times 1\), and \(\sigma\) denotes the Sigmoid function. \(Concat(;)\) denotes stacking of two features by channel.