## 2 Materials and Methods
### Experiments  
Training neural networks is a complex and computationally intensive task, which requires proper data preparation steps and hyperparameters selection. This section presents the experiments performed, detailing the training and the evaluation procedures adopted. As introduced in Section 2.2, the satellite acquisitions were divided into seven folds. The grouping criteria was chosen by considering geographical distance among the position of the acquisitions, in order to include in the same fold geographically close regions that could share similar morphology and land cover aspects, such as vegetation types, infrastructures, and agricultural areas. The models' performances were evaluated through a cross-validation approach, using the Root Mean Squared Error as the evaluation metric. At each iteration, five folds are used as the training set, one as the validation set, and the remaining fold as the test set. The validation set is used to assess the model's performance for the early stopping regularization criteria, discussed later in this section. A common prerequisite in supervised learning algorithms is that the training, validation and test data arise from the same distribution and are independent and identically distributed [53]. Therefore, in order to work properly, a validation set should resemble the data distribution of the test set. However, as shown in Figure 1, each fold presents a unique distribution of severity levels. In a real situation, there is no chance to know the distribution of severity levels a priori. Therefore, the choice fell on a fold which contains all \begin{table}
\begin{tabular}{l c} \hline \hline
**Software/Library** & **Version** \\ \hline python & 3.6.9 \\ numpy & 1.18.2 \\ pandas & 1.0.3 \\ xrd & 1.2.0 \\ matplotlib & 3.2.1 \\ scikit-learn & 0.22.2 \\ scikit-image & 0.16.2 \\ OpenCV & 4.2.0 \\ PyTorch & 1.4.0 \\ torchvision & 0.5.0 \\ CUDA & 10.1 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Software packages and versions installed. severity levels and which could generalise the most, presenting a distribution of severity levels which tends mostly to a uniform distribution. Considering all those aspects, we chose the \"fucsa\" fold as the validation set for each test set, except for itself: in that case, we chose the \"green\" fold. To improve models generalization, data augmentation was applied on the training set of each fold. During the training process, synthetic data was generated at each epoch from the 480 \(\times\) 480 tiles by randomly applying four transformations in sequence to each image: random rotation, random horizontal flip, random vertical flip, and random shear. Each transformation has a specific probability to be applied. Rotation and shear effects were performed with randomly generated angles within specific ranges, differently for each image in each epoch. For reproducibility purposes, random generation operations were performed using the same seed in each training. The transformations and their respective parameters are shown in Table 3.  
All the training phases were performed using Adam optimizer with a learning rate of \(1\times 10^{-4}\), 50 epochs and a batch size of 8. Two different models were considered in this study:  
* the single U-Net: it is trained for the regression task. The Mean Squared Error (MSE) was used as a loss function. This model will be referred to as the baseline;
* the Double-Step U-Net: it is trained in two steps: First, only the Binary Classification U-Net is trained with Dice loss function [54], keeping the weights of the regression model frozen. Second, the Regression U-Net was trained with Mean Squared Error (MSE) loss function. In this second step, the weights of the binary classification model are frozen. To validate the approach, an ablation study will be presented. First, the performance obtained by the Binary U-Net on each fold will be reported. Then, the choice to link the two networks consecutively will be justified comparing Double-Step U-Net with the simplified Parallel U-Net model.