# Multi-Scale Twin Networks for Coastal Zone Change Detection in Remote Sensing Imagery
## 3 Principles and Methods
### Edge Feature Extraction
Specifically, the input feature map first enters a spatial attention module, undergoing a series of convolution operations with batch normalization and ReLU activation applied after each convolution in order to extract the preliminary features. Next, the feature map is gradually reduced in spatial resolution by maximum pooling to extract features at different scales. During this process, the input feature maps are passed through skip connections twice to transmit the original features to subsequent stages for feature fusion. Subsequently, the feature map is gradually restored to the original resolution via two  
Figure 2: Illustration of our high-frequency attention module (HFAM). transposed convolution operations and concatenated with the skip-connected features to further enhance multi-scale feature fusion. Next, an attention mask is generated using convolution and a Sigmoid function, which performs element-wise multiplication with the input feature map to highlight salient regions. Finally, the original input feature map is summed with the weighted features to produce the spatial attention map. This is mathematically represented as:  
\[Mask=F\odot \tag{1}\]  
\[M_{c}=F\oplus(F\otimes Mask) \tag{2}\]  
where \(\odot\) denotes convolution operation, \(\oplus\) denotes element-by-element addition, and \(\otimes\) denotes element-by-element multiplication. Figure 3 shows examples of our self-constructed coastal zone change detection dataset and the corresponding edge feature maps obtained after HFAM processing. The edge feature map examples are presented in the form of heatmaps, highlighting the areas of the feature map that the model focuses on during the edge feature extraction stage. For the high-frequency enhancement module, high-frequency information is initially extracted from the spatial attention map \(M_{c}\) using the Sobel operator to obtain a high-frequency feature map \(M_{s}\). Considering the diversity of the shapes of the changing regions in the coastal zone, we adopt eight Sobel operators with different orientations, as shown in Figure 4. This approach captures edge features more effectively and extracts rich high-frequency information, thus enhancing the model's ability to recognize changing regions with diverse shapes. In addition, the multi-directional edge features enhance the robustness of the model, effectively suppressing noise and improving the accuracy of change detection. Figure 3: Schematic diagram of the edge features. Secondly, the spatial attention map \(M_{c}\) is first subjected to global maximum pooling, and the pooling result is passed through two fully convolutional layers followed by a Sigmoid activation function. The result is then multiplied element-wise with the spatial attention map \(M_{c}\) to obtain the intermediate feature maps \(F^{\prime}\). Next, the high-frequency feature maps \(M_{s}\) are fused with the intermediate feature maps \(F^{\prime}\) along the channel axis. Finally, the feature maps are resized to match the input size via \(1\times 1\) convolution to produce the output feature maps \(M_{H}\). This is mathematically represented by the following formula:  
\[F^{\prime}=M_{c}\otimes\sigma(\odot(\odot(\mathrm{Maxpool}(M_{c})))) \tag{3}\]  
\[M_{s}=\mathrm{Sobel}(M_{c}) \tag{4}\]  
\[M_{H}=\odot(F^{\prime}\otimes M_{s}) \tag{5}\]  
where \(\sigma\) denotes the Sigmoid function [20], Maxpool denotes maximum pooling, and Sobel denotes the Sobel operator, which denotes the connection along the channel. By combining spatial attention and high-frequency enhancement, the HFAM effectively captures the edge changes in complex scenes, particularly excelling at handling scenes with irregular boundaries. This approach not only improves the model's ability to detect fine-grained changes but also strengthens the global representation of the feature map, reducing interference from irrelevant background regions and thereby improving the overall detection performance.