The smart scythe: AI-powered weed detection in agriculture
Accurate discrimination between crops and weeds is essential for precision agriculture, particularly for reducing herbicide usage and improving input efficiency. In this study, a unified and controlled evaluation of five deep learning architectures as ResNet-50, ResNet-101, ViT-B/16, CLIP in zero-shot mode (CLIP-ZS), and CLIP with a fine-tuned MLP head (CLIP-MLP) was carried out across both performance and deployment dimensions. Experiments were conducted on the publicly available CropAndWeed (C&W) benchmark and a newly developed 2,500-image Indian agricultural dataset collected from Madhya Pradesh, enabling a systematic assessment of cross-domain generalisation. The results showed that ResNet-50 achieved the highest in-domain performance (72.5% accuracy; F1 = 0.73) with a well-balanced precision–recall profile, while also maintaining the lowest computational cost (~ 4.1 GFLOPs, ~ 28 ms inference). In contrast, ViT-B/16 exhibited reduced effectiveness under limited data conditions, confirming its dependence on large-scale training corpora. CLIP-ZS produced competitive performance (63.9% accuracy) without any task-specific training and recorded the highest recall (0.87), indicating strong sensitivity for weed detection. Further, CLIP-MLP improved classification balance and demonstrated superior cross-domain performance (~ 70% on Indian data), surpassing ResNet-50 and highlighting the benefit of large-scale vision–language pretraining for geographic transferability. Model interpretability was examined using Grad-CAM, and a normalised regional scoring framework was introduced to quantify attention across six anatomically defined regions. The Matthews Correlation Coefficient (MCC) was additionally reported for each model to provide a balanced single-value accuracy index robust to class imbalance. Across all architectures, attention was consistently concentrated on leaf blade and petiole regions, while soil and background features were largely suppressed, confirming that predictions were driven by biologically meaningful plant structures. However, CLIP-based models showed relatively higher sensitivity to contextual elements such as soil and shadow, reflecting their broader semantic representation. Overall, the study established a multi-dimensional benchmark integrating accuracy, interpretability, and computational efficiency. The findings indicated that ResNet-50 remains the most suitable architecture for near-term edge deployment, whereas CLIP-based models offer a promising pathway toward robust, geographically adaptable crop–weed classification systems.
Authors
- Ved Prakash Chaudhary (ORCID: https://orcid.org/0000-0002-1308-7534)
- Akshay Agarwal
- Rishi Chaudhary
Institutions
- Central Institute of Agricultural Engineering (IN)
- Shiv Nadar University (IN)
- Indian Institute of Science Education and Research, Bhopal (IN)
Publication Details
- Journal
- Scientific Reports
- Published
- 2026-08-25
- DOI
- https://doi.org/10.1038/s41598-026-59178-3
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Indian Institute of Science Education and Research Bhopal
- Indian Institute of Science Education and Research Mohali