DOI: 10.3390/a19110947 ISSN: 1999-4893

MangoXNet: Lightweight Hybrid Deep Learning with Explainable AI for Accurate Mango Leaf Disease Diagnosis in Smart Agriculture

R. Raja Subramanian, Sri Ram Ganesh M, M. Ali Fauzi, Deshinta Arrova Dewi

Diseases of mango leaves have the potential to greatly diminish agricultural yields, and the task of identifying these diseases from pictures captured in field is complicated by varying light levels, complex backgrounds, appearance of the disease, and image quality. While modern deep learning techniques have achieved good results in terms of accuracy of classification, most current techniques are either computationally intensive or offer a limited view into the relationship between compactness of the models, representation of local and global features, robustness, and interpretability. This paper presents MangoXNet, a novel lightweight hybrid CNN–Transformer framework for optimal classification of mango leaf diseases. The hybrid framework features a compact convolutional backbone: MobileNetV3Small, depthwise separable refinement, squeeze-and-excitation-based channel re-calibration, compact Transformer-based contextual encoding, and CNN–Transformer feature fusion. The main contribution of this study lies not in the introduction of separate components but in task-related integration of local and global feature representations into a compact model. The model achieves a classification accuracy of 99.83% on the MangoLeafBD dataset, together with macro-F1 and MCC scores of 99.80% and 99.78%, respectively. The model comprises 1.17 million parameters and occupies a size of 6.90 MB in storage, and the average inference time is estimated at 11.70 ms per image in the experiment. Moreover, performance of the model during fivefold cross-validation is found to be 99.44 ± 0.19%, a trait that proves stability of model performance across different validation folds. Explainability analysis using Grad-CAM and Grad-CAM along with LayerCAM methods helps to confirm that model predictions are mainly linked to leaf regions relevant to disease. Results achieved prove that it is possible to build a compact local–global representation model that has high classification ability without major increase in computational processing effort. However, the model’s validation on held-out test sets, different agricultural environments, and proper edge hardware should be performed in order to make sure the model can fit a broader scope of conditions.

More from our Archive