## 5 Ablation Experiments  
The following three ablation experiments are set up: (a) only containing the U-shaped convolutional neural network (UNet) architecture, (b) an improved network (UNet + AG) \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **OA** & **P** & **R** & **F1** & **IoU** \\ \hline SegNet & 0.898 & 0.843 & 0.859 & 0.851 & 0.741 \\ AGs-UNet & 0.898 & 0.836 & 0.853 & 0.844 & 0.730 \\ C3 Net & 0.896 & 0.830 & 0.864 & 0.847 & 0.734 \\ CSA-UNet & 0.900 & 0.846 & 0.863 & 0.855 & 0.746 \\ AGSC-Net & 0.901 & 0.847 & 0.863 & 0.855 & 0.747 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Quantitative accuracy comparison of different methods on the Building Image Dataset of Typical Rural Areas in China. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **OA** & **P** & **R** & **F1** & **IoU** \\ \hline SegNet & 0.881 & 0.828 & 0.829 & 0.828 & 0.707 \\ AGs-UNet & 0.878 & 0.811 & 0.827 & 0.819 & 0.694 \\ C3 Net & 0.856 & 0.800 & 0.832 & 0.816 & 0.689 \\ CSA-UNet & 0.884 & 0.824 & 0.846 & 0.835 & 0.717 \\ AGSC-Net & 0.886 & 0.837 & 0.833 & 0.835 & 0.717 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Quantitative accuracy comparison of different methods on the China Rural Building UAV Imagery Dataset. with AG modules based on UNet, and (c) the complete model (AGSC-Net) with both AG and context collaboration (CC-Net) modules. Under the same computer software and hardware environment and hyperparameter settings, the above three models were trained for 200 epochs. After training, we selected the same images from the validation set of the Building Image Dataset of Typical Rural Areas in China for model effect verification to ensure fair comparison under the same conditions for each experiment. Figure 12 displays the visualization results of the three models on test sets of three different scenarios. The first row is a scene with sparse small building targets. The UNet model has significant building omission problems, while the UNet + AG model has some commission errors regarding small, scattered buildings. The second row is a complex rural building scene. The UNet model has many omissions of building edges, while the building edges extracted by the AGSC-Net model are smoother, indicating that the AG module effectively enhances the ability to identify building edges. The third row shows a scene with considerable vegetation interference. In this case, the detection effects of UNet and UNet + AG are poor, resulting in many misjudgments. The AGSC-Net model correctly excludes vegetation interference and accurately extracts buildings. The results prove that AGSC-Net can effectively suppress background interference and accurately extract buildings through the multilevel attention mechanism of the AG and CC-Net modules and the extracted multidimensional features. This study also verified the positive effects of the AG and CC-Net modules on building extraction through quantitative analysis, providing references for constructing more accurate building extraction models. As indicated in Table 4, compared with the baseline UNet model, the UNet + AG model with AG modules improved the detection precision (P) by 0.17 percentage points, mainly because the AG module enhanced the model's ability to identify building edges. Compared with the UNet + AG model, the complete AGSC-Net model improved the detection precision (P) by 0.64 percentage points, and recall and other metrics were further improved. Especially in complex scenes with rich background  
Figure 12: Comparison of ablation experimental results. The first two columns are aerial images and ground truth, respectively. Columns 3–5 are building extraction results. The green and black pixels of the maps represent the predictions of true positive and true negative, respectively. interference, AGSC-Net significantly reduced commission errors.