# Stacked Ensembles Powering Smart Farming for Imbalanced Sugarcane Disease Detection
## 4 Discussion  
The results of this study highlight the effectiveness of DL models, particularly CNNs, in both binary and multi-classification tasks on an imbalanced sugarcane disease dataset. Stratified sampling was used to address class imbalances and ensure the proportional representation of all classes in the training, validation, and testing splits. This methodology enhanced the model's generalization capabilities and improved the performance across all metrics. For the multi-classification case, the CNN model outperformed the RNN, LSTM, and GRU in all evaluation metrics, as shown in Figure 5. The CNN excels in extracting hierarchical features from static images. This confirms that disease identification in sugarcane is primarily a spatial problem rather than a sequential one, reinforcing the necessity of using architectures specifically designed for image-based tasks. It effectively captures spatial features, while sequential models like the RNN, LSTM, and GRU fit better for temporal dependencies, making them less suited for image-based datasets. The GRU model exhibited the best performance among the sequential models, albeit significantly lower than that of the CNN. Figure 11: Timing results for SqueezeNet feature extraction and various ML and DL methods. Figure 12: Timing results for DeepLoc feature extraction and various ML and DL methods. In binary classification, the CNN demonstrated exceptional performance, with overall test accuracy of 98.89% and a weighted average F1-score of 98.92%. As highlighted in Figure 6, the unhealthy class yielded an F1-score of 99.41%, outperforming the healthy class (91.80%). This discrepancy can be attributed to the significantly larger sample size of the unhealthy class. Additional strategies, such as hyperparameter tuning and the inclusion of more diverse healthy samples, could further improve the performance of the CNN in this category. The results of our best embedding model (InceptionV3) with the stacking ensemble also outperformed other pre-trained models on the same sugarcane dataset. In [45], EfficientNet-b6 was the best performing pre-trained model, whereas, in [46], DeiT3-Small had the best performance. Both of these studies tested a wide variety of pre-trained models, but only the best-performing models were chosen for comparison. The difference in performance between the models is highlighted in Table 7, and it demonstrates the superiority of the approach that was used in this work, as combining embedding from InceptionV3 and stacking yielded noticeably better results. The embedding-based methodologies InceptionV3, SqueezeNet, and DeepLoc demonstrated the capacity to enhance the classification of the imbalanced sugarcane disease classes. Among these, InceptionV3 yielded the best results, achieving an average AUC of 0.9979 and F1-score of 0.9562 when paired with a stacking model. The stacking ensemble consistently outperformed other classifiers, showcasing its robustness in leveraging high-dimensional features. SqueezeNet, while slightly less accurate, proved to be a resource-efficient alternative, particularly for scenarios where computational efficiency is a priority. However, DeepLoc embeddings exhibited competitive performance for simpler classes but failed for complex and underrepresented classes, such as smut and pokkah boeng, due to their visual similarities with other leaf conditions, resulting in overlapping feature distributions. This highlights the need for additional strategies such as domain-specific preprocessing, feature enhancement techniques, or the inclusion of additional sensor-based data. Other approaches, such as multi-spectral imaging or textural analysis, could further aid in differentiating these challenging classes, as the current study suggests that a feature space alone may not be sufficient in highly ambiguous cases.