# Using Artificial Neural Network Models to Assess Hurricane Damage through Transfer Learning
## 4 Results and Discussion
### Metrics and Prediction Skills
#### 4.1.2 Object Detection Metrics  
The training metrics used to track the progress of the object detection models deal with the associated loss parameters for distinct training operations--the three major operationsbeing classification, localization, and regularization. Classification loss is associated with the determination of the target object class [34]. Classification loss is represented as a combination of the cross-entropy loss from Equation (1) and the SoftMax activation function in Equation (6)  
\[\sigma(z)_{j}=\frac{e^{z_{j}}}{\sum_{k=1}^{K}e^{z_{k}}} \tag{6}\]  
where \(z\) is a vector input containing \(K\) elements corresponding to the possible object classes, \(j\) is the index variable for the input vector \(z\), and \(z_{j}\) is the \(j\)-th element of \(z\). The denominator of Equation (6) contains the normalization term that ensures \(\sigma(z)_{j}\) is a valid probability distribution where all \(j\) elements sum to 1, allowing the predicted object classes to be converted to probabilities before computing the cross-entropy loss [33]. The localization loss is associated with bounding box regression to pinpoint the target object through training another head with an independent loss function [34]. This loss function must account for given samples/instances of bounding box coordinates represented as \(y_{i}\) and the target coordinates of the ground-truth bounding box represented as \(\hat{y_{i}}\) in Equation (7). This localization loss is characterized as a Mean Square Error (MSE).  
\[\text{MSE}=\frac{\sum_{i=1}^{n}(y_{i}-\hat{y_{i}})^{2}}{n}. \tag{7}\]  
The third type of loss, regularization loss, aims to reduce overfitting in the neural network by penalizing certain values of the weights in each layer. The result is a constrained range of values for these weights that purportedly reduces the memory capacity of the model without sacrificing model performance. Regularization is formulated in two distinct fashions (and usually implemented as a combination of both) with L1 and L2 regularization. L1 and L2 are shown in Equation (8) with the weight value \(w\), total number of weights in a given layer \(n\), and the regularization hyperparameter \(\lambda\)  
\[\text{L1}=\text{MSE}+\lambda\sum_{i=1}^{n}|w_{i}|_{,}\] \[\text{L2}=\text{MSE}+\lambda\sum_{i=1}^{n}w_{i}^{2}. \tag{8}\]  
It is clear from Equation (8) that L1 is a function of a scaled sum of the magnitude of each weight value, and L2 is a function of a scaled sum of each weight value squared.  
Finally, the total loss function is used as a generalized metric for evaluating the training performance. It is a weighted sum of the classification loss, the localization loss, and the regularization loss parameters that are calculated by the model. The model weights for classification loss and localization loss were kept equal at a value of 1.0 while the regularization loss weight was set to a much smaller fraction of the previous weights. This was standard for configuring the training of all three damage detection models. It should be added that there are two opposed structures for the heads being trained to evaluate the loss parameters mentioned above: the convolution head and fully connected head. The former is more appropriate and has better results for the classification task, while the latter is more advantageous at conducting bounding box regression [35].