MaizeFormerX: a lightweight vision transformer with cross-scale attention for explainable maize leaf disease diagnosis
Early detection of maize leaf diseases is essential to prevent yield losses. Existing vision-based models face challenges in real-world environments due to data imbalance, lighting variations, and interpretability. This study presents MaizeFormerX, a lightweight Vision Transformer designed for cross-domain, explainable maize disease detection on resource-limited settings. MaizeFormerX employs multi-scale patch embeddings and a Cross-Scale Attention Fusion (CSAF) module to capture both detailed lesion textures and larger disease patterns. The CSAF output is processed through a transformer encoder stack using multi-head self-attention to model long-range dependencies. Robust preprocessing and dataset-specific augmentations were applied to improve feature extraction and address class imbalances in the Dataverse, Tanzania, and Plagues Maiz datasets. For interpretability, Grad-CAM was used for pixel-level saliency mapping in an efficient web application. When benchmarked against MobileViT, EfficientFormer, TinyViT, and Swin Transformer, MaizeFormerX achieved 97.8% accuracy on Dataverse, 97.5% on Tanzania, and 96.9% on Plagues Maiz, outperforming Swin Transformer V2 by 2–3%. Cross-domain testing yielded 88.9% accuracy when trained on Dataverse and tested on Tanzania, surpassing baseline performance by 3–6%. Class-wise analysis revealed F1 scores over 98% for Healthy and MLB classes with 6× augmentation, and over 97% for MSV. Ablation studies highlighted the significance of the cross-scale attention module for high MCC during domain shifts. This study introduces a precise, explainable, and efficient image-based method for classifying maize diseases, which could aid in more targeted crop management, reduce unnecessary agrochemical use, and promote sustainable maize production in future decision-support environments.
Authors
- Rezaul Haque (ORCID: https://orcid.org/0000-0002-9922-8632)
- Md. Redwan Ahmed (ORCID: https://orcid.org/0009-0007-4042-2936)
- Sd Maria Khatun Shuvra
- M. Murugappan
- Rahman Swapno
- Md Shafiq Ullah
- Md Najmul Gony
- S. M. Masfequier
- V. Saravanan
- Gomesh Nair
- Md Mostafizur Rahman
- Muhammad E. H. Chowdhury
Institutions
- Vels University (IN)
- American International Group (United States) (US)
- Maharishi International University (US)
- University of California, Irvine (US)
- Grand Canyon University (US)
- Kuwait College of Science and Technology (KW)
- Deutsch Amerikanisches Institut Saarland (DE)
- Bangladesh University of Business and Technology (BD)
- Qatar University (QA)
- Xi’an Jiaotong-Liverpool University (CN)
- East West University (BD)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-03-26
- DOI
- https://doi.org/10.1038/s41598-026-44550-0
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00