X-DEP: An Explainability-Aware Development and Evaluation Pipeline for Transparent Mango Disease Detection Using Deep CNNs
Abstract
The application of deep learning models in agricultural disease detection is often limited by the lack of interpretability in their predictions. Although explainable artificial intelligence (XAI) techniques such as Local Interpretable Model-Agnostic Explanations (LIME) provide visual explanations of model predictions, they are commonly applied after model training and evaluation. In this study, we propose X-DEP, an explainability-aware development and evaluation pipeline that integrates predictive performance analysis and XAI diagnostics into a common model development workflow. Rather than modifying the convolutional neural network (CNN) training objective, X-DEP uses explanation outputs as complementary diagnostic evidence for model comparison, failure analysis, and model-selection decisions. The pipeline was evaluated on the MangoDHDS dataset, comprising 1,500 images across five classes, using four pretrained CNN architectures: VGG16, ResNet50, DenseNet121, and MobileNetV2. In the comparative benchmark, VGG16 achieved the highest mean classification accuracy of 92.00%, with macro-precision, macro-recall, and macro-F1 scores of 0.925, 0.924, and 0.925, respectively. DenseNet121 and MobileNetV2 achieved mean accuracies of 87.56% and 86.67%, respectively, whereas ResNet50 achieved 63.56%. Class-wise analysis and LIME visualizations revealed differences in disease recognition and explanation patterns that were not fully captured by aggregate accuracy. In a separate ablation study, the LIME-informed feedback configuration, which incorporated HSV-based lesion-region cropping and background suppression, improved test accuracy from 91.73% to 92.89% and macro-F1 from 0.909 to 0.918. These findings highlight the potential value of integrating predictive evaluation with explanation-based diagnostics to inform agricultural vision model development.
Keywords
Funding
This research received no external funding.
References
- Terra Cultiva. (2025). World ranking: Mangoes, guavas and mangosteens—Production 2024. Data source: FAOSTAT, Food and Agriculture Organization of the United Nations. Available at: https://terra-cultiva.com/en/rankings/mangoes-guavas-and-mangosteens/production/ (accessed on 25 December 2025).
- Radhakrishnan, M.; Monish, N.; Dev, P.S.; Kesavan, N.; Thomas, N.S. Implementation of Explainable AI in Deep Learning Methods for Multiclass Classification of Plant Diseases in Mango Leaves. Electronic Letters on Computer Vision and Image Analysis 2025, 24(1), 104–117. https://doi.org/10.5565/rev/elcvia.2009.
- Thaseentaj, S.; Ilango, S.S. Mango leaf disease classification with transfer learning, feature localization, and visual explanations. International Journal of Intelligent Engineering and Systems 2024, 17, 1042–1048. https://doi.org/10.22266/ijies2024.0831.78.
- Patil, S.B.; Bodhe, S.K. Leaf disease severity measurement using image processing. International Journal of Engineering and Technology 2011, 3(5), 297–301.
- Mahmud, B.U.; Al Mamun, A.; Hossen, M.J.; Hong, G.Y.; Jahan, B. Light-weight deep learning model for accelerating the classification of mango-leaf disease. Emerging Science Journal 2024, 8(1), 28–42. https://doi.org/10.28991/ESJ-2024-08-01-03.
- Alhammad, S.M.; Khafaga, D.S.; El-hady, W.M.; Samy, F.M.; Hosny, K.M. Deep learning and explainable AI for classification of potato leaf diseases. Frontiers in Artificial Intelligence 2025, 7, 1449329. https://doi.org/10.3389/frai.2024.1449329.
- Hossain, M.A.; Sakib, S.; Abdullah, H.M.; Arman, S.E. Deep learning for mango leaf disease identification: A vision transformer perspective. Heliyon 2024, 10(17), e36361. https://doi.org/10.1016/j.heliyon.2024.e36361
- Ferentinos, K.P. Deep learning models for plant disease detection and diagnosis. Computers and Electronics in Agriculture 2018, 145, 311–318. https://doi.org/10.1016/j.compag.2018.01.009.
- Too, E.C.; Yujian, L.; Njuki, S.; Yingchun, L. A comparative study of fine-tuning deep learning models for plant disease identification. Computers and Electronics in Agriculture 2019, 161, 272–279. https://doi.org/10.1016/j.compag.2018.03.032.
- Porfírio, R.P.; Madeira, R.N.; Santos, P.A. Exploring explainable AI techniques for plant disease classification in digital agriculture. Procedia Computer Science 2025, 265, 175–182. https://doi.org/10.1016/j.procs.2025.07.170.
- Thakur, P.S.; Singh, P.; et al. Explainable vision transformer enabled convolutional neural network for plant disease identification: PlantXViT. arXiv preprint arXiv:2207.07919 2022.
- Chouhan, S.S.; Singh, N. Real-time plant disease detection using mobilenetv2. Procedia Computer Science 2020, 167, 2286–2294. https://doi.org/10.1016/j.procs.2020.03.283.
- Jackulin, C.; Murugavalli, S. A comprehensive review on detection of plant disease using machine learning and deep learning approaches. Measurement: Sensors 2022, 24, 100441. https://doi.org/10.1016/j.measen.2022.100441.
- Sladojević, S.; Arsenović, M.; Anderla, A.; Culibrk, D.; Stefanović, D. Deep neural networks based recognition of plant diseases by leaf image classification. Computational Intelligence and Neuroscience 2016, 2016, 3289801, 11 pages. https://doi.org/10.1155/2016/3289801.
- Brahimi, M.; Boukhalfa, K.; Moussaoui, A. Deep learning for tomato diseases: Classification and symptoms visualization. Applied Artificial Intelligence 2017, 31, 299–315. https://doi.org/10.1080/08839514.2017.1315516.
- Maharana, K.; Mondal, S.; Nemade, B. A review: Data pre-processing and data augmentation techniques. Global Transitions Proceedings 2022, 3, 91–99. https://doi.org/10.1016/j.gltp.2022.04.020.
- Simonyan, K.; Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 2014.
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016, pp. 770–778. https://doi.org/10.1109/CVPR.2016.90.
- Huang, G.; Liu, Z.; Van Der Maaten, L.; Weinberger, K.Q. Densely connected convolutional networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017, pp. 4700–4708. https://doi.org/10.1109/CVPR.2017.243.
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.-C. MobileNetV2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2018, pp. 4510–4520. https://doi.org/10.1109/CVPR.2018.00474.
- Ahmed, A.; Team, O.T.R. Architecture of DenseNet-121. Available online: https://iq.opengenus.org/architecture-of-densenet121/ (accessed on 25 December 2025).
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. MobileNets: Efficient convolutional neural networks for mobile vision applications. arXiv 2017, arXiv:1704.04861. https://arxiv.org/abs/1704.04861.
- Barhate, P.; Barhate, B.; Joshi, M. MangoDHDS: A dataset of diseased and healthy mangoes of 1.5 K images. Mendeley Data 2025, V1. https://doi.org/10.17632/b4nrw5hyyc.1.
- Sokolova, M.; Lapalme, G. A systematic analysis of performance measures for classification tasks. Information Processing & Management 2009, 45(4), 427–437. https://doi.org/10.1016/j.ipm.2009.03.002.
- Grandini, M.; Bagli, E.; Visani, G. Metrics for multi-class classification: An overview. arXiv 2020, arXiv:2008.05756. https://doi.org/10.48550/arXiv.2008.05756.
- Masoud, A. Understanding Micro, Macro, and Weighted Averages for Scikit-learn Metrics in Multi-class Classification. Available online: https://tinyurl.com/4pytd5pv (accessed on 25 December 2025).
- Powers, D.M.W. Evaluation: From precision, recall and F-measure to ROC, informedness, markedness and correlation. Journal of Machine Learning Technologies 2011, 2(1), 37–63.
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual explanations from deep networks via gradient-based localization. International Journal of Computer Vision 2019, 128, 336–359. https://doi.org/10.1007/s11263-019-01228-7.
- Ribeiro, M.T.; Singh, S.; Guestrin, C. “Why should I trust you?”: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD ’16); Association for Computing Machinery: New York, NY, USA, 2016; pp. 1135–1144. https://doi.org/10.1145/2939672.2939778.
- Prabhu, O.; T, M.; Shetty, S. An investigation on advances in transfer learning and explainable AI for mango leaf disease detection. Smart Agricultural Technology 2025, 12, 101348. https://doi.org/10.1016/j.atech.2025.101348.
- Nasar, M.; Kausar, M.A.; Nayyer, M.A.; Kumar, V.; Anwer, M.A. The explainable AI for mango leaf disease detection: Bridging the gap between model accuracy and farmers usability. Indian Journal of Horticulture 2025, 82(3), 354–358. https://doi.org/10.58993/ijh/2025.82.3.16.
- Ergün, E. Attention-enhanced hybrid deep learning model for robust mango leaf disease classification via ConvNeXt and vision transformer fusion. Frontiers in Plant Science. 2025, 16, 1638520. https://doi.org/10.3389/fpls.2025.1638520.