Explainable vision transformer for coffee leaf nutrient deficiency detection with rule-based treatment recommendation
Coffee is a worldwide significant agricultural commodity, but nutritional deficits in coffee leaves impair plant health and output, necessitating early and correct diagnosis. Existing deep learning algorithms confront limitations such as common deficiency symptoms, limited datasets, and poor interpretability. This study presents an Explainable Vision Transformer (XViT)-based system for detecting coffee leaf nutrient deficiencies and making rule-based treatment recommendations. The approach improves data variety by preprocessing and class-wise augmentation, whereas XViT collects global and detailed visual patterns for classification. An expert-defined rule-based module makes suitable treatment recommendations, while Grad-CAM visualization enhances model clarity by emphasizing key symptom locations. Experimental results show that the proposed XViT model regularly outperforms baseline architectures such as ResNet-50, EfficientNet-B4, and ConvNeXt. On the initial dataset, XViT achieved 94% precision, 91% recall, 92% F1-score, and accuracy of 94 ± 0.37%, whereas augmentation improved accuracy to 96 ± 0.29%. The rule-based recommendation module achieved 100% rule coverage, 100% rule consistency, a 93.72% end-to-end recommendation success rate, and a Cohen’s Kappa agreement of 0.93 among agricultural specialists. Grad-CAM study indicated that the model concentrates on significant symptom regions linked with nutrient deficits, hence increasing transparency and reliability. Overall, the proposed framework for precision coffee nutrient management is accurate, explainable, and practical since it combines deep learning-based diagnosis with expert-guided treatment.
Authors
- Fikadu Berie Adugna
Institutions
- University of Gondar (ET)
Publication Details
- Journal
- Discover Artificial Intelligence
- Published
- 2026-09-05
- DOI
- https://doi.org/10.1007/s44163-026-02160-9
- Primary Topic
- Coffee research and impacts
- Type
- article
- Field-Weighted Citation Impact
- 0.00