## 4 Methodology  
Figure 7 illustrates the overall and complete workflow of our study. It consists of multiple sections which are summarized as:  
1. Data Preparation: In the first part of the process, the Train, Tier3, and Hold groups of the xBD dataset which were used for training and validation steps, respectively, were augmented. The Test group was directly used for validation without any augmentation.
2. Damage Assessment: The second part included two sub-sections, the Localization and Classification models. UNet was used as the base architecture in both models. The weights of the trained Localization model were transferred to the Classification models. The outputs of this section were used for evaluating the performance of our proposed model.
3. Transferability Analysis: In order to further study the generalization power and robustness of our proposed models, the trained models were used on another new dataset, i.e., Bam city, and the damage assessment maps were compared with the corresponding ground truth.  
Figures 8 and 9 present the overall architecture of the proposed deep learning models. Our methodology for overcoming the building damage assessment task consisted of two major stages: (1) building segmentation in the first stage (Localization) and (2) per building damage assessment in the second stage (Classification or Damage Assessment). In both stages, the UNet model was the main architecture that handled the segmentation task. For the building localization stage, a single branch UNet, supplemented with only the pre-disaster images, was utilized to produce building segmentation masks (see Figure 8). After building footprint localization, pre- and post-disaster images were fed into parallel UNets of a dual-branch model in the second stage, as illustrated in Figure 9. The extracted deep features from both branches were concatenated with each other to enter the segmentation head of the model, which handled the final multi-class segmentation task. In order to further improve the capabilities of the networks and enhance their performance, various strategies have been implemented. For the first time, we introduced the Selective Kernel Module (SKM) into UNet architecture for the task of localization and classification of building damages after natural disasters. The SKM introduced an adaptive receptive field learning procedure, which improved the quality of extracted features. The details of the proposed framework and components are described in the following sub-sections.  
Figure 6: Augmentation techniques were applied to input images for further regularizing the model. On the left, pre- and post-disaster images are displayed, and other images are the outputs of specific augmentations.  
Figure 8: Schematic diagram of a UNet for our building localization stage, which shows different components of our UNet model, including encoder and decoder paths, skip connections, and pre-trained backbones. The output of this model is a binary segmentation map of building footprints.  
Figure 7: The overall workflow of our study consists of three major parts: (1) Data Preparation, (2) Damage assessment, which includes Localization and Classification models, and (3) Transferability Analysis.