## 4 Experiments
### Class Imbalance Experiments
reason, in this first experiment, we experimentally analyze the effect of batch size together with two class weighing techniques. In this section, we analyze the performance of the proposed model, without the NDVI layer, using different techniques to counter the effect due to the unbalanced dataset. In particular, we use the two different types of \(\alpha_{c}\) weights of the loss function (see Equation (4)) described below, to try to counter the effect of the unbalancing of the classes we have in the dataset, and then we compare it with a weight \(\alpha_{c}=1\) for all classes (no weights). As bottom-up pathway of the proposed (3+2)D FPN, in these experiments we use a ResNet1 01. In Table 2, we have some results from the model which uses only the cross-entropy defined in Equation (4) but without the \(\alpha_{c}\) weight (no weights) and we compare it with the weighting scheme (batch weights) which is based on \"Effective Number of samples\" within each batch [25] assigned to the \(\alpha_{c}\) weight, and with weighting strategies based on the total number of samples present in each class (global weights) even assigned to the \(\alpha_{c}\) weight. The weighting scheme proposed in [25], counts for each batch of the training set, the number of actual samples \(n_{c}\) in each class \(c\). The effective weight used in each batch is defined using a simple formula \(\alpha_{c}=(1-\beta)/(1-\beta^{n_{c}})\), where \(\beta\in[0,1)\) is a hyper-parameter. In _global weights_, we use a weight \(\alpha_{c}=\max_{c}(n_{c})/\sqrt{n_{c}})\) for each class, computed using the entire training set. Analyzing the overall accuracy (OA), Kappa, weighted Recall (w.R), Precision (w.P) and F-measure (w.F1) in Table 2 and the graphs in Figure 7, we can see that loss function weighting techniques do not lead to any advantage on this dataset. On the other hand, it should be noted that the batch size (see the second column labeled _batch_ in Table 2) has a great influence on the result and then a very small batch size allows to obtain the best results. From Table 1) we see that the class that has the lowest number of pixels (column #pix) on the validation set is the _asparagus_ class. While in Figure 7 the effect of the weight \(\alpha_{c}\) of the loss function and the effect of the batch size can be analyzed as a function of the number of samples for each class. Analyzing, for example, the _asparagus_ class when the weight \(\alpha_{c}=1\) for all the classes (plot on the top of Figure 7) we can see that the best results are obtained when we use a small back size. As a consequence of these experiments, in the other experiments we do not use the weight \(\alpha_{c}\). \begin{table}
\begin{tabular}{l r r r r r r} \hline \hline
**Weight** & **Batch** & **OA** & **Kappa** & **w. R** & **w. P** & **w. F1** \\ \hline batch & 2 & 91.98 & **0.920** & 91.98 & 91.78 & 91.82 \\ batch & 4 & 91.64 & 0.894 & 91.64 & 91.18 & 91.30 \\ batch & 8 & 90.55 & 0.879 & 90.55 & 89.84 & 90.00 \\ batch & 16 & 89.39 & 0.865 & 89.39 & 89.09 & 89.14 \\ batch & 32 & 85.82 & 0.820 & 85.82 & 85.16 & 85.31 \\ \hline global & 2 & 93.17 & 0.913 & 93.17 & 92.89 & 92.96 \\ global & 4 & 92.10 & 0.899 & 92.10 & 91.54 & 91.62 \\ global & 8 & 91.06 & 0.886 & 91.06 & 90.40 & 90.43 \\ global & 16 & 90.34 & 0.877 & 90.34 & 89.86 & 89.97 \\ global & 32 & 87.22 & 0.837 & 87.22 & 86.48 & 86.59 \\ \hline no & 2 & **93.71** & **0.920** & **93.71** & **93.41** & **93.56** \\ no & 4 & 92.33 & 0.902 & 92.33 & 91.71 & 91.73 \\ no & 8 & 91.21 & 0.887 & 91.21 & 90.35 & 90.44 \\ no & 16 & 90.54 & 0.879 & 90.54 & 90.00 & 90.07 \\ no & 32 & 87.56 & 0.840 & 87.56 & 86.69 & 86.54 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Results on Munich validation set to test the effects of the batch size training parameter and three different ways to weight the loss function. Overall accuracy (OA), Kappa and the weighted average measures Recall (R), Precision (P) and F-measure are used to compare two different techniques to handle unbalanced datasets while the batch size is varied between 2 and 32.