Instance-level localization and similarity-aware contrastive learning for robust plant disease classification
Introduction Plant disease classification in real-field images remains challenging due to complex backgrounds, overlapping leaves, multiple symptomatic regions, and visually similar disease categories. Conventional image based classifiers may therefore learn mixed representations in which disease-specific cues are confused with healthy tissue, background information, or co-occurring symptoms. Method To address these challenges, this paper proposes an instance-aware and similarity-aware framework for plant disease classification. The proposed method first localizes disease using a lightweight YOLOv8n detector trained with coarse localization labels. Then patches corresponding to the localized regions are extracted and provided as input to hybrid CNN–Transformer architecture, where ResNet-18 captures fine-grained local lesion features and the transformer branch models broader contextual dependencies. These complementary representations are integrated through cross-attention fusion and projected into a shared embedding space. To improve inter-class separability, dynamically updated class prototypes are used to identify visually confusable disease pairs, and a Similarity-Weighted Contrastive Loss is introduced to put separation pressure on confused class boundaries. A decorrelation regularization term is further incorporated to reduce redundancy in the learned embeddings. Result Experiments on the re-annotated DiaMOS Plant leaf dataset, evaluated under a source-image-level partitioning protocol that keeps all patches from the same field image within a single data partition, show that the proposed framework achieves 97.49 ± 0.73% accuracy and 94.82 ± 0.81% macro F1-score on a locked hold-out test set, significantly outperforming reimplemented baseline methods evaluated under the same experimental protocol ( p < 0.001). Discussion Embedding-space visualization using t-SNE and the normalized confusion matrix further demonstrate improved class separation and reliable prediction behavior across the four disease categories.
Authors
- Amr Munshi (ORCID: https://orcid.org/0000-0002-4002-3755)
- Muhammad I. Masud (ORCID: https://orcid.org/0000-0001-6538-2984)
- Mohsin Murad (ORCID: https://orcid.org/0000-0002-1924-1424)
- Majid Alotaibi (ORCID: https://orcid.org/0000-0003-3655-2619)
- Sultan Daud Khan (ORCID: https://orcid.org/0000-0002-7406-8441)
- Hira Batool (ORCID: https://orcid.org/0009-0000-2741-5175)
Institutions
- Umm al-Qura University (SA)
- National University of Computer and Emerging Sciences (PK)
- University of Business and Technology (SA)
- Sohar University (OM)
Publication Details
- Journal
- Frontiers in Artificial Intelligence
- Published
- 2026-10-29
- DOI
- https://doi.org/10.3389/frai.2026.1913825
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00