Abstract
Early identification of bean leaf diseases, particularly Angular Leaf Spot and Bean Rust, is vital for ensuring crop productivity and global food security, especially within smallholder farming systems where disease outbreaks can rapidly escalate and cause severe yield losses. Conventional disease identification through visual inspection is labor-intensive, subjective, and highly dependent on expert knowledge, making it impractical for large-scale agricultural monitoring. Although recent deep learning-based approaches have demonstrated impressive accuracy in plant disease classification, their inherent “black-box” nature significantly limits real-world adoption, as farmers and agronomists often lack the ability to understand, trust, or act upon unexplained predictions. To address these challenges, this study proposes an automated and explainable disease diagnostic framework based on a Vision Transformer (ViT-B/16) architecture optimized through transfer learning from ImageNet. Unlike traditional convolutional neural networks that primarily focus on localized features, the Vision Transformer processes images as a sequence of flattened patches and leverages self-attention mechanisms to capture long-range dependencies and global contextual patterns across the entire leaf surface. This global representation enables the model to detect subtle and spatially distributed disease symptoms that are often overlooked by CNN-based approaches. To further enhance transparency and interpretability, GradCAM + + is integrated into the framework as an explainable artificial intelligence (XAI) mechanism. This method generates class-specific heatmaps that visually highlight the exact pathological regions influencing the model’s predictions, thereby establishing a human-interpretable validation loop for farmers, agronomists, and domain experts. The proposed framework was evaluated on the publicly available I-Bean dataset, achieving a validation accuracy of 97.52% along with strong precision, recall, and F1-score performance. The generated GradCAM + + visualizations consistently demonstrate the model’s sensitivity to true diseased regions, reinforcing both the reliability and trustworthiness of its predictions. By combining high-capacity global feature learning with visual explainability, the proposed approach offers a scalable, transparent, and practical solution for real-world precision agriculture. This framework not only enhances diagnostic accuracy but also bridges the critical gap between model performance and user trust, enabling informed decision-making and timely disease management in modern farming environments.
Data availability
[https://dx.doi.org/10.21227/4k7y-vs03]
References
Wang, Y., Wang, Q., Su, Y., Jing, B. & Feng, M. Detection of kidney bean leaf spot disease based on a hybrid deep learning model. Sci. Rep. 15 (1), 11185. https://doi.org/10.1038/s41598-025-93742-7 (2025).
Karthik, R., Aswin, R., Geetha, K. S. & Suganthi, K. An explainable deep learning network with transformer and custom CNN for bean leaf disease classification. IEEE Access https://doi.org/10.1109/ACCESS.2025.3546017 (2025).
Dubey, A. K. et al. Predicting yellow mosaic disease severity in yardlong bean using visible imaging coupled with machine learning model. Sci. Rep. 15(1), 24886. https://doi.org/10.1038/s41598-025-09176-8 (2025).
Dolatabadian, A. et al. Image-based crop disease detection using machine learning. Plant Pathol. 74(1), 18–38. https://doi.org/10.1111/ppa.14006 (2025).
Bouacida, I., Farou, B., Djakhdjakha, L., Seridi, H. & Kurulay, M. Innovative deep learning approach for cross-crop plant disease detection: A generalized method for identifying unhealthy leaves. Inf. Process. Agric. 12(1), 54–67. https://doi.org/10.1016/j.inpa.2024.03.002 (2025).
Ghannam, N. E., Zein, E., Fathy, O. M., Mancy, H. & D. R., & Enhanced Detection of Bean Leaf Diseases Using a Stacked CNN Ensemble with Transfer Learning. Int. J. Intell. Eng. Syst. 18 (1). https://doi.org/10.22266/ijies2025.0229.22 (2025).
Tarabye, H. H., Aboelyousr, A. G. & Ali, E. A. YOLOv5s for field plant disorders detection: Challenges and insights from a comparative analysis of green bean and faba bean. Egypt. J. Agron. 47(2), 279–291. https://doi.org/10.21608/agro.2025.313737.1496 (2025).
Chen, H. et al. YOLOv8-RBean: Runner bean leaf disease detection model based on YOLOv8. Agronomy 15(4), 944. https://doi.org/10.3390/agronomy15040944 (2025).
Tamim, M. U., Hamim, S. A., Malik, S., Mridha, M. F. & Mahmood, S. InsightNet: A deep learning framework for enhanced plant disease detection and explainable insights. Plant Direct 9(5), e70076. https://doi.org/10.1002/pld3.70076 (2025).
Raghuram, K. & Borah, M. D. A hybrid learning model for tomato plant disease detection using deep reinforcement learning with transfer learning. Procedia Comput. Sci. 252, 341–354. https://doi.org/10.1016/j.procs.2024.12.036 (2025).
Li, L., Yang, J. & Guan, H. A recognition method for Adzuki bean rust disease based on spectral processing and deep learning model. Agriculture 15(12), 1246. https://doi.org/10.3390/agriculture15121246 (2025).
Papan, P. et al. Artificial intelligence-based detection of Cercospora leaf spot disease severity in mung bean. Chil. J. Agric. Res. 85(3), 396–404. https://doi.org/10.4067/s0718-58392025000300396 (2025).
Khadeer, K., Khan, K. S., Bharathi, M. & Srinivas, T. A. S. From pixels to protection: Deep learning approaches for plant leaf disease detection. Journal of Computer Networks and Virtualization 3(1), 8–14 (2025).
Muchtar, K. et al. Edge AI-based detection for defective coffee beans using deep learning and Streamlit framework. IEEE Access https://doi.org/10.1109/ACCESS.2025.3561189 (2025).
Balaji, G. N., Parthasarathy, G., Kovendan, A. K. P. & Jha, A. Using deep learning for plant disease detection and classification. Nat. Environ. Pollut. Technol. https://doi.org/10.46488/NEPT.2025.v24i02.B4260 (2025).
Krishna, M. S. et al. Plant leaf disease detection using deep learning: A multi-dataset approach. J 8(1), 4. https://doi.org/10.3390/j8010004 (2025).
Shehu, H. A., Ackley, A., Marvellous, M. & Eteng, O. E. Early detection of tomato leaf diseases using transformers and transfer learning. Eur. J. Agron. 168, 127625. https://doi.org/10.1016/j.eja.2025.127625 (2025).
Gomez, D. et al. Advancing common bean (Phaseolus vulgaris L.) disease detection with YOLO driven deep learning to enhance agricultural AI. Sci. Rep. 14(1), 15596. https://doi.org/10.1038/s41598-024-66281-w (2024).
Karantoumanis, E., Balafas, V., Louta, M. & Ploskas, N. Real-time disease detection on bean leaves from a small image dataset using data augmentation and deep learning methods. Soft. Comput. 28 (21), 12929–12941. https://doi.org/10.1007/s00500-024-10348-3 (2024).
Katumba, A. et al. Leveraging edge computing and deep learning for the real-time identification of bean plant pathologies. Smart Agric. Technol. 9, 100627. https://doi.org/10.1016/j.atech.2024.100627 (2024).
Girmaw, D. W. & Muluneh, T. W. Deep convolutional neural network model for classifying common bean leaf diseases. Discover Artif. Intell. 4(1), 96. https://doi.org/10.1007/s44163-024-00212-6 (2024).
Rodríguez-Lira, D. C. et al. Comparative analysis of YOLO models for bean leaf disease detection in natural environments. Agriengineering 6(4), 4585–4603 (2024).
Girmaw, D. W., Salau, A. O., Mamo, B. S. & Molla, T. L. A novel deep learning model for cabbage leaf disease detection and classification. Discover Appl. Sci. 6(10), 521. https://doi.org/10.1007/s42452-024-06233-1 (2024).
Ma, X., Zhang, X., Guan, H. & Wang, L. Recognition method of crop disease based on image fusion and deep learning model. Agronomy https://doi.org/10.3390/agronomy14071518 (2024).
Hasan, M. et al. Comprehensive smartphone image dataset for bean and cowpea plant leaf disease detection and freshness assessment from Bangladesh vegetable fields. Data Brief 57, 111023. https://doi.org/10.1016/j.dib.2024.111023 (2024).
Mahadevan, K., Punitha, A. & Suresh, J. Automatic recognition of Rice Plant leaf diseases detection using deep neural network with improved threshold neural network. e-Prime 8, 100534. https://doi.org/10.1016/j.prime.2024.100534 (2024).
Bidarakundi, P. M. & Kumar, B. M. A Coffee Leaf Disease Detection via Deep Learning Algorithms. In 2024 International Conference on Trends in Quantum Computing and Emerging Business Technologies (pp. 1–5). IEEE. (2024)., March https://doi.org/10.1109/TQCEBT59414.2024.10545110
Hassan, E. Enhancing coffee bean classification: A comparative analysis of pre-trained deep learning models. Neural Comput. Appl. 36(16), 9023–9052. https://doi.org/10.1007/s00521-024-09623-z (2024).
Chaki, J. & Ghosh, D. Deep learning in leaf disease detection (2014–2024): A visualization-based bibliometric analysis. IEEE Access https://doi.org/10.1109/ACCESS.2024.3425897 (2024).
Serttaş, S. & Deniz, E. Disease detection in bean leaves using deep learning. Commun. Fac. Sci. Univ. Ankara Ser. A2-A3 Phys. Sci. Eng. 65 (2), 115–129. https://doi.org/10.33769/aupse.1247233 (2023).
Mahenge, M. P. J. et al. Artificial intelligence and deep learning based technologies for emerging disease recognition and pest prediction in beans (phaseolus vulgaris L.): A systematic review. Afr. J. Agric. Res. 19(3), 260–271. https://doi.org/10.5897/AJAR2022.16226 (2023).
Singh, V., Chug, A. & Singh, A. P. Classification of beans leaf diseases using fine tuned cnn model. Procedia Comput. Sci. 218, 348–356. https://doi.org/10.1016/j.procs.2023.01.017 (2023).
Moupojou, E. et al. FieldPlant: A dataset of field plant images for plant disease detection and classification with deep learning. IEEE Access 11, 35398–35410. https://doi.org/10.1109/ACCESS.2023.3263042 (2023).
Suma, S. A. et al. Beans disease detection using convolutional neural network. In 2023 4th International Conference on Big Data Analytics and Practices (IBDAP) (pp. 1–5). IEEE. (2023)., August https://doi.org/10.1109/IBDAP58581.2023.10271983
Senbato, A. & Ayalew, T. Developing Common Bacteria Blight Disease Detection Model for Common Bean Using Deep Learning Approach. (2023). https://doi.org/10.21203/rs.3.rs-3512095/v1
Upadhyay, N. & Gupta, N. Detecting fungi-affected multi-crop disease on heterogeneous region dataset using modified ResNeXt approach. Environ. Monit. Assess. 196(7), 610. https://doi.org/10.1007/s10661-024-12790-0 (2024).
Upadhyay, N. & Bhargava, A. Artificial intelligence in agriculture: Applications, approaches, and adversities across pre-harvesting, harvesting, and post-harvesting phases. Iran. J. Comput. Sci. https://doi.org/10.1007/s42044-025-00264-6 (2025).
Upadhyay, N. & Gupta, N. Seglearner: A segmentation based approach for predicting disease severity in infected leaves. Multimedia Tools Appl. https://doi.org/10.1007/s11042-025-20838-7 (2025).
Upadhyay, N., Sharma, D. K. & Bhargava, A. 3sw-net: A feature fusion network for semantic weed detection in precision agriculture. Food Anal. Methods 18(10), 2241–2257. https://doi.org/10.1007/s12161-025-02852-5 (2025).
Funding
Open access funding provided by Symbiosis International (Deemed University). This research received no external funding.
Author information
Authors and Affiliations
Contributions
PSP and SNT: Problem Formulation and MethodologyAS and DS: Implementation and VisualizationMVV PK and KB: Original Draft and Supervision.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
The authors declare that they have no conflict of interest.
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Potharaju, S., Singh, A., Singh, D. et al. An explainable vision transformer model with transfer learning for accurate bean leaf disease classification. Sci Rep (2026). https://doi.org/10.1038/s41598-026-41723-9
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-026-41723-9