Explainable vision transformers for real‑time chili and onion leaf disease identification and diagnosis

Rahman, Hamdadur and Imran, Hasan Md and Hossain, Amira and Siddiqui, Md Ismail Hossain and Sakib, Anamul Haque (2025) Explainable vision transformers for real‑time chili and onion leaf disease identification and diagnosis. International Journal of Science and Research Archive, 15 (1). pp. 1823-1833. ISSN 2582-8185

[thumbnail of IJSRA-2025-1163.pdf] Article PDF
IJSRA-2025-1163.pdf - Published Version
Available under License Creative Commons Attribution Non-commercial Share Alike.

Download ( 849kB)

Abstract

Early identification of leaf diseases in chili and onion crops is crucial for maintaining agricultural productivity and reducing economic losses. This study proposes a transformer-based deep learning framework for the multi-class classification of common leaf diseases affecting chili and onion plants. It addresses challenges related to intra-class similarity, complex backgrounds, and variations in real-world imaging. We collected a curated dataset consisting of 13,989 high-resolution images—10,987 of chili leaves and 4,502 of onion leaves—from actual agricultural environments in Karnataka, India. This dataset covers nine disease classes, including Cercospora, purple blotch, Iris yellow spot virus, and powdery mildew. To enhance model generalization, we applied extensive preprocessing techniques, including resizing, normalization, augmentation, and noise injection. We evaluated four state-of-the-art transformer architectures: MaxViT, Swin Transformer, Hornet, and EfficientFormer. Among these, MaxViT achieved the highest performance, with classification accuracies of 95.75% on the onion dataset and 90.86% on the chili dataset, along with high F1 scores, Matthews Correlation Coefficient (MCC), and Precision-Recall Area Under Curve (PR-AUC) values. To enable practical use in the field, we developed a real-time web application using Django. This application allows users to upload leaf images and receive instant predictions, supplemented by Grad-CAM-based visual explanations. This integration of explainable AI (XAI) enhances transparency and builds trust among end-users, such as farmers and agronomists. The results highlight the effectiveness of transformer-based models for agricultural disease diagnosis and provide a scalable, interpretable, and deployable solution for precision farming.

Item Type: Article
Official URL: https://doi.org/10.30574/ijsra.2025.15.1.1163
Uncontrolled Keywords: Plant disease; Vision transformer; Explainable AI; Chili leaves; Onion leaves; Agricultural monitoring
Depositing User: Editor IJSRA
Date Deposited: 22 Jul 2025 23:43
Related URLs:
URI: https://eprint.scholarsrepository.com/id/eprint/1722