## 2 Methodology
### Multi-Take Learning Module  
Due to the downsampling operations in the UNet++ network, image content details and spatial location information often are missed in the result; in particular, buildings are segmented with poor boundaries. To improve the accuracy of boundaries, here, we introduced the building edge geometric information into the proposed network as the constraints to guide the network to produce precise boundaries, which is trained by the multi-task learning based on the distance class map defined in this part. As shown in the multi-task learning part of Figure 1, two convolutional layers \(L_{DC}\) and \(L_{Seg}\) are added to the AEUNet++ to balance semantic properties and the boundary geometric properties, where \(L_{DC}\) is used to predict the distance class to the edges of building, and the segmentation of buildings is predicted by \(L_{Seg}\).  
Building masks and boundary maps (as shown in Figure 5) are usually used to incorporate building geometric information into the network, while both of them have their own advantages and shortcomings. If using the boundary maps, due to spectral variation, limited spatial resolution, noise pixels, and the fact that edges only occupy a tiny part of the whole image, it is difficult for the network to produce accurate closed outlines that fit the boundaries of the buildings well. Furthermore, the boundary maps cannot judge whether pixels are inside or outside buildings. Using the building mask maps can yield a better result, but it cannot represent boundaries of adjacent buildings. To solve these problems, we introduced the distance class map to represent the building labels in the proposed AEUNet++. As shown in Figure 5, the signed distance function is firstly introduced to represent the distances of pixels between the boundaries' pixels, and then extracted as output representation constraints. The value of the signed-distance function for a pixel denotes the distance between the pixel and its nearest boundary pixel, and positive and negative values indicate whether the pixel is inside or outside the building, respectively. For convenience, the distance is truncated at a given threshold, and the truncated signed-distance function can be described as:  
\[Dist(i)=\delta_{d}\text{min}(\min_{j\in\text{X}}d(i,j),d) \tag{5}\]  
where \(i\) denotes a pixel in an image, x denotes the set of pixels belonging to the building boundaries, and \(\min_{j\in\text{X}}d(i,j)\) is the Euclidean distance between the pixel \(i\) and its nearest boundary pixel \(j\). \(d\) is a threshold, and \(\delta_{d}\) denotes a sign function to indicate that the pixel is inside or outside the building; if \(\delta_{d}=1\), pixel \(i\) is inside the building mask, while \(\delta_{d}=-1\) represents that pixel \(i\) is outside the building mask.  
In this paper, to facilitate training of the network, we defined the distance class map by uniformly quantizing the truncated signed-distance \(Dist(i)\) to a limited number of classes at equal intervals. As shown in Figure 5d, different values represent different distance classes. In this case, the boundary prediction is converted into the multi-label segmentation task, because pixels are assigned to finely divided classes based on their distance to boundaries instead of a small number of coarse classes (e.g., building and non-building). The distance class maps guide the network to differentiate regions with different spatial relations to building masks.