A Vision Transformer with Locality Bias for Coffee Leaf Disease Detection on Small Datasets
Accurate identification of coffee leaf diseases is crucial for maintaining crop health and yield, yet deep learning models often struggle in agricultural settings due to limited annotated data. Vision Transformers (ViTs), though powerful on large datasets, perform poorly on small datasets due to their lack of spatial inductive bias. In this paper, we adapt a locality-biased ViT architecture-combining Shifted Patch Tokenization (SPT) and Locality Self-Attention (LSA)-to improve classification of coffee leaf diseases from a small dataset of 1,200 labeled images across five classes. Experimental results show that the enhanced ViT improves top- 1 accuracy by 4.0 % and top- 5 accuracy by 1.7 % over the baseline ViT, closely mirroring performance gains reported in previous studies. Our model also outperforms standard CNNs (e.g., ResNet18, EfficientNetB0) by up to <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{4. 2 \%}$</tex> in F1-score, demonstrating that incorporating locality bias allows ViTs to better generalize on fine-grained disease patterns in data-constrained scenarios.
Authors
- Quoc-Trinh Vo (ORCID: https://orcid.org/0000-0001-8603-4209)
- Cao Vu Bui (ORCID: https://orcid.org/0009-0000-7766-943X)
Institutions
- FPT University (VN)
Publication Details
- Published
- 2025-07-25
- DOI
- https://doi.org/10.1109/atigb66719.2025.11142197
- Citations
- 1
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 1.75