A web-based application for cotton leaf disease classification using vision transformer

Jashim, Farhan Bin and Refat, Fajle Rabbi and Karim, Mohammad Hasnatul and Mahmud, Farhad Uddin and Ashrafi, Fariha (2025) A web-based application for cotton leaf disease classification using vision transformer. International Journal of Science and Research Archive, 15 (2). pp. 1405-1416. ISSN 2582-8185

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

Download ( 914kB)

Abstract

Cotton leaf diseases particularly threaten crop productivity, making early detection a vital yet challenging task due to subtle visual symptoms, a scarcity of labeled datasets, and the absence of diagnostic tools suitable for field use. Traditional deep learning methods often struggle with generalization across varying agricultural conditions and require extensive computational resources. To address these challenges, this study proposes a novel framework for classifying cotton leaf diseases using Vision Transformer (ViT) architecture, specifically the Swin Transformer, integrated into a real-time, web-based diagnostic application. The system was trained and evaluated using two publicly available datasets: SAR-CLD-2024, which contains 2,137 images across seven disease classes, and a severity-based dataset consisting of 980 images categorized into four disease types with subclass labels. To mitigate class imbalance, extensive data augmentation was employed. In this study, we employed Generalized Low Rank Modeling (GLRM) for dimensionality reduction and Infomax-GAN for feature selection, enhancing model performance and interpretability. We benchmarked four ViT models—LeViT, BEiT, DeiT, and Swin Transformer—using accuracy, precision, recall, F1-score, and PR-AUC as metrics. The Swin Transformer achieved the highest accuracy, 99.70% on the SAR-CLD-2024 dataset and 98.84% on the severity-based dataset. Our web application enables users to upload images and receive real-time diagnostic feedback, offering a practical solution for precision agriculture. This study's novelty lies in integrating hierarchical transformer-based classification with advanced feature selection and practical deployment, creating a robust tool for early detection of cotton leaf diseases in agriculture.

Item Type: Article
Official URL: https://doi.org/10.30574/ijsra.2025.15.2.1501
Uncontrolled Keywords: Cotton Leaf Disease; Vision Transformer; Agriculture; Sustainable Farming; Swim Transformer
Depositing User: Editor IJSRA
Date Deposited: 25 Jul 2025 17:03
Related URLs:
URI: https://eprint.scholarsrepository.com/id/eprint/2016