# Attention to Fires: Multi-Channel Deep Learning Models for Wildfire Severity Prediction
## 3 Double-Step Deep-Learning Framework (DSF)
### Backbone Architectures  
The binary-class and the regression backbones can be implemented with a custom encoder-decoder neural network. The network in the binary-class backbone is set up with a sigmoid activation function in the output layer to generate the one-layered probability map. In contrast, for the regression backbone, we do not use any activation function in the last stage as the output values may range in [0, 4]. Therefore, to get the final result with the five severity scale, we clip the network output within this range and round the values to the nearest integer. As the target damage severity level is an ordinal categorical variable with increasing severity as the numerical value grows, we chose a regression backbone instead of a second classification backbone to enforce such behavior. By using loss functions such as the MSE, errors are penalized differently: classifying a completely destroyed (target severity 4) area as not affected (predicted severity 0) is different compared to classifying the same area as a severely damaged one (predicted severity 3). Thus, the adoption of a second classification backbone would result in the absence of ordinal information during the learning process of the backbone under analysis. We propose four different alternative modules as backbone architectures. Specifically, we selected the U-Net [42] as baseline and some variations, namely, U-Net++ [67], SegU-Net [68], and Attention-U-Net. The last alternative introduces a Spatial Attention block in the U-Net model. When choosing one among the proposed backbone architectures, the same architecture is used for both binary-class and regression backbones, ending up with four alternative models. In the next sections, we refer to them with the names Double-Step U-Net (DS-UNet), Double-Step U-Net++ (DS-UNet++), Double-Step SegU-Net (DS-SegU), and Double-Step AttU-Net (DS-AttU). Figure 2: Loss function selection experiments. For each configuration (right column) the binary and regression losses are connected with a line of the same color. **DS-UNet. ** This is the state-of-the-art solution to address the severity prediction from [50]. Such architecture is exactly reproduced by our framework when choosing the DS-UNet configuration. **DS-UNet++. ** This configuration maintains the same working principles of the previous one, differing only by the selected neural network. Specifically, U-Net++ enhances the structure of the standard U-Net by adding convolutional layers in correspondence of the skip connections between the encoder and the decoder. **DS-SegU. ** This configuration exploits one more variation of the standard U-Net, inspired by another standard encoder-decoder architecture, SegNet [69]. As its main feature, this network connects encoder and decoder via pooling indices, proper of SegNet architecture, and skip-connections typical of the U-Net. **DS-AttU. ** Finally, this last configuration introduces an attention-based CNN. In particular, AttentionUNet presents the same structure of the U-Net in the formulation proposed in [70] with the addition of up to four spatial attention layers inspired from the work in [71]. The operation of the Attention layer is exemplified in Figure 3 in a U-Net-like architecture with four scale levels, i.e., four encoder/decoder blocks joined with the skip connections. The layer of the scale \(s\) operates on the low-level feature vector \(x_{s}^{l}\) of the corresponding scale of the encoder and on the high-level one \(x_{s+1}^{h}\) from the decoder at scale \(s+1\), such that both of them have the same dimensions \(H\times W\times C\). The two signals are merged in a series of convolutional operations ending up in an attention map \(\alpha\) of dimension \(H\times W\) made of values between 0 and 1. Such operation is repeated 2 times in parallel, merging the results in one resulting map to improve stability and robustness of the result before applying to form the feature map of the level after.