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

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.

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2025-04-30
DOI
https://doi.org/10.5281/zenodo.17151399
Primary Topic
Geochemistry and Geologic Mapping
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Zenodo (CERN European Organization for Nuclear Research)
Geochemistry and Geologic Mapping
article

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

article en

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.

Zenodo (CERN European Organization for Nuclear Research)
American University (US), University of Alabama in Huntsville (US)
Zero hunger
Openalex Percentile: Top 35%
Geochemistry and Geologic Mapping
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.