## 3 Methodology  
As presented in Figure 3, as an attention control mechanism-based remote sensing image building extraction network, the main structure of AGSC-Net is as follows. An  
Figure 1: Study area. (**a**) Province of the study area; (**b**) Remote Sensing Images of Yuan Village, Qian County, Shaanxi Province; (**c**) Yuan Village Building Label (The green pixels of the map represent the marking of the building contour).  
Figure 2: An example of data augmentation by rotating and flipping the Building Image Dataset of Typical Rural Areas in China.  
encoder-decoder structure based on the U-Net model is adopted to achieve end-to-end building extraction. The encoder gradually obtains semantically richer feature representations through convolution and pooling, while the decoder gradually restores spatial resolution to output prediction results consistent with the input image size [35]. This structure ensures the end-to-end trainability of the entire model. The encoder consists of 4 convolutional blocks, each containing 2 convolutional layers, 2 normalization layers and 2 ReLU activation function layers. The max-pooling layers in the model can extract the maximum values from local regions of the feature maps and reorganize them into new feature maps. The converter consists of 4 AG and Context Collaboration Network (CC-Net) modules from the \"skip connections\". Traditional FCNs take the global context of the entire input image but cannot distinguish features that are more important for building extraction [36]. Attention modules are introduced between the encoder and decoder to explicitly model building features. The AG module in AGSC-Net can reweight each feature map to enhance the feature response related to buildings and suppress irrelevant feature responses, thereby improving the representation capability for buildings [37].  
The jump connections directly pass the features of each encoder layer to the decoder. This connection allows the decoder end to obtain image features at different levels, which helps restore detailed information and mitigate the vanishing gradient problem in deep networks, making the model easier to optimize [38]. To obtain multiscale building features, AGSC-Net not only uses image pyramid pooling modules but also designs context collaboration networks to learn long-range dependencies between different building instances for more accurate localization. By constructing the feature converter with AG and CC-Net modules, the encoder features are converted before being passed to the decoder, which further enhances the representation capability of building features at the decoder end. Fully convolutional networks are utilized to achieve end-to-end training and prediction. Compared with the segmented processing flow in traditional methods, this end-to-end approach makes feature extraction more tailored to the final goal of building extraction and facilitates model training and deployment [39]. In summary, AGSC-Net integrates the advantages of encoder-decoder, attention mechanisms, multiscale context extraction and other modules to form an efficient network structure for remote sensing image building extraction. This structure retains the stable and efficient basic framework of UNet and significantly improves the expression capability of rural building features through attention mechanisms and multiscale fusion. The specific parameters of AGSC-Net are shown in Table 1.  
Figure 3: Framework of the proposed AGSC-Net. (a) Atrous Spatial Pyramid Pooling. (b) Self-Attention. (c) The proposed Context Collaboration Network (CC-Net).