# Stacked Ensembles Powering Smart Farming for Imbalanced Sugarcane Disease Detection
## 3 Results
### Binary and Multi-Classification of Imbalanced Disease Classes: Deep Methods Trained from Scratch  
In binary and multi-classification tasks, we train, validate, and test the data, as given in Tables 2 and 3. The sample distributions for all classes are provided in the tables. Figures 5 and 6 summarize the performance of different deep learning models for the multi-class and binary classification tasks, respectively. Figure 5 illustrates the results of the multi-classification models trained from scratch on the CNN, RNN, LSTM, and GRU. The models are evaluated using the accuracy, macro average F1-score, and weighted average F1-score metrics. The CNN model significantly outperformed the RNN, LSTM, and GRU across all metrics, with CA of 0.9067 and a 0.8710 macro average F1-score, demonstrating its superiority in capturing features in the multi-class dataset. In contrast, the RNN (CA: 0.4333 macro average F1-score: 0.3022) and LSTM (CA: 0.4380 macro average F1-score: 0.2736) showed significantly lower scores, while the GRU had noticeably better performance, with CA of 0.6363 and a 0.5510 macro average F1-score, but it was still far from the CNN's performance. This may be due to their sequential processing nature, which makes these models less effective for this type of data. Figure 6 depicts the performance of binary classification based on the CNN (as the best algorithm), trained also from scratch. It achieved CA of 0.9889 and a macro average F1-score of 0.9560. The runs were performed over 60 epochs with early stopping for the binary and multi-class CNN models, as shown in Figure 7. The evaluation metrics included the precision, recall, and F1-score metrics for healthy and unhealthy classes. The CNN model achieved excellent performance, with high scores across all metrics for both classes. The slightly higher variance observed in the healthy class suggests that additional fine-tuning may further enhance its generalization capabilities. These results highlight the robustness of the CNN when trained on complex and imbalanced datasets such as that of sugarcane used in this study. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Class** & **Training (64\%)** & **Validation (16\%)** & **Test (20\%)** & **Total Samples** \\ \hline Healthy & 275 & 69 & 86 & 430 \\ Dried & 219 & 55 & 69 & 343 \\ Banded Chlorosis & 302 & 75 & 94 & 471 \\ Brown Spot & 1101 & 276 & 345 & 1722 \\ Brown Rust & 201 & 50 & 63 & 314 \\ Grassy Shoot & 222 & 55 & 69 & 346 \\ Pokkah Boeng & 190 & 48 & 59 & 297 \\ Sett Rot & 418 & 104 & 130 & 652 \\ Viral Disease & 424 & 106 & 133 & 663 \\ Yellow Leaf & 764 & 191 & 239 & 1194 \\ Smut & 202 & 51 & 63 & 316 \\ Total & 4318 & 1080 & 1350 & 6748 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Multi-classification data distribution. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Class** & **Training (64\%)** & **Validation (16\%)** & **Test (20\%)** & **Total Samples** \\ \hline Healthy & 275 & 69 & 86 & 430 \\ Unhealthy & 4043 & 1011 & 1264 & 6318 \\ Total & 4318 & 1080 & 1350 & 6748 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Binary classification data distribution. The performance metrics for the RNN, LSTM, and GRU across all classes, as illustrated in Figure 8, highlight the variations in their ability to classify different categories. The RNN  
Figure 5: Deep learning model performance (training from scratch) for multi-class classification. The models include the CNN, RNN, LSTM, and GRU, evaluated using the accuracy, macro average F1-score, and weighted average F1-score metrics. Figure 6: Binary classification performance based on CNN (training from scratch). The evaluation includes healthy and unhealthy classes with the precision, recall, and F1-score metrics. Figure 7: Training and validation accuracy for binary and multi-class CNN over epochs.