Submitted:
09 June 2025
Posted:
09 June 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Data Collection and Preprocessing
2.2. Training (Faster R-CNN)
2.3. Training (Transformer)
2.4. Post Segmentation with Segment Anything
2.5. Testing
3. Results
3.1. Overall Results
3.2. Case Studies of Weed Recognition in Typical Challenging Images
4. Discussion
5. Conclusions
Supplementary Materials
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| R-CNN | Region-based Convolutional Neural Network |
| DETR | Detection Transformer |
| SAM | Segment Anything Model |
| AR | Average Recall |
| AP | Average Precision |
References
- Cervantes-Godoy, D.; Dewbre, J. Economic importance of agriculture for poverty reduction. 2010.
- Beckman, J.; Countryman, A.M. The importance of agriculture in the economy: impacts from COVID-19. American journal of agricultural economics 2021, 103, 1595–1611. [Google Scholar] [CrossRef] [PubMed]
- Newman, C.; Singhal, S.; Tarp, F. Introduction to understanding agricultural development and change: Learning from Vietnam. 2020, 94, 101930. [Google Scholar] [CrossRef]
- USDA Economic Research Service. U.S. lettuce production shifts regionally by season. 2023.
- Kim, M.J.; Moon, Y.; Tou, J.C.; Mou, B.; Waterland, N.L. Nutritional value, bioactive compounds and health benefits of lettuce (Lactuca sativa L.). Journal of Food Composition and Analysis 2016, 49, 19–34. [Google Scholar] [CrossRef]
- Harker, K.N.; O'Donovan, J.T. Recent weed control, weed management, and integrated weed management. Weed Technology 2013, 27, 1–11. [Google Scholar] [CrossRef]
- Kubiak, A.; Wolna-Maruwka, A.; Niewiadomska, A.; Pilarska, A.A. The problem of weed infestation of agricultural plantations vs. the assumptions of the European biodiversity strategy. Agronomy 2022, 12, 1808. [Google Scholar] [CrossRef]
- Beck, L.; Wanstall, J. Noxious and troublesome weeds of New Mexico. New Mexico State University, College of Agriculture, Consumer and Environmental Sciences, Las Cruces 2021.
- Abbas, T.; Zahir, Z.A.; Naveed, M.; Kremer, R.J. Limitations of existing weed control practices necessitate development of alternative techniques based on biological approaches. Advances in Agronomy 2018, 147, 239–280. [Google Scholar]
- Liu, B.; Bruch, R. Weed detection for selective spraying: a review. Current Robotics Reports 2020, 1, 19–26. [Google Scholar] [CrossRef]
- Wang, P.; Tang, Y.; Luo, F.; Wang, L.; Li, C.; Niu, Q.; Li, H. Weed25: A deep learning dataset for weed identification. Frontiers in Plant Science 2022, 13, 1053329. [Google Scholar] [CrossRef] [PubMed]
- Subeesh, A.; Bhole, S.; Singh, K.; Chandel, N.S.; Rajwade, Y.A.; Rao, K.; Kumar, S.; Jat, D. Deep convolutional neural network models for weed detection in polyhouse grown bell peppers. Artificial Intelligence in Agriculture 2022, 6, 47–54. [Google Scholar] [CrossRef]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the Proceedings of the IEEE conference on computer vision and pattern recognition, 2014; pp. 580-587.
- Farhadi, A.; Redmon, J. Yolov3: An incremental improvement. In Proceedings of the Computer vision and pattern recognition, 2018; pp. 1-6.
- Jocher, G.; Stoken, A.; Borovec, J.; Changyu, L.; Hogan, A.; Diaconu, L.; Ingham, F.; Poznanski, J.; Fang, J.; Yu, L. ultralytics/yolov5: v3. 1-bug fixes and performance improvements. Zenodo 2020.
- Jiang, K.; Afzaal, U.; Lee, J. Transformer-based weed segmentation for grass management. Sensors 2022, 23, 65. [Google Scholar] [CrossRef] [PubMed]
- Wang, Y.; Zhang, S.; Dai, B.; Yang, S.; Song, H. Fine-grained weed recognition using Swin Transformer and two-stage transfer learning. Frontiers in Plant Science 2023, 14, 1134932. [Google Scholar] [CrossRef] [PubMed]
- Kirillov, A.; Mintun, E.; Ravi, N.; Mao, H.; Rolland, C.; Gustafson, L.; Xiao, T.; Whitehead, S.; Berg, A.C.; Lo, W.-Y. Segment anything. In Proceedings of the Proceedings of the IEEE/CVF International Conference on Computer Vision, 2023; pp. 4015-4026.
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence 2016, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Carion, N.; Massa, F.; Synnaeve, G.; Usunier, N.; Kirillov, A.; Zagoruyko, S. End-to-end object detection with transformers. In Proceedings of the European conference on computer vision, 2020; pp. 213-229.
- Vaswani, A. Attention is all you need. Advances in Neural Information Processing Systems 2017.
- Tzutalin, D. Labelimg. git code. Available online: https://github.com/tzutalin/labelImg (accessed on.
- Everingham, M.; Van Gool, L.; Williams, C.K.; Winn, J.; Zisserman, A. The pascal visual object classes (voc) challenge. International journal of computer vision 2010, 88, 303–338. [Google Scholar] [CrossRef]
- Pezoa, F.; Reutter, J.L.; Suarez, F.; Ugarte, M.; Vrgoč, D. Foundations of JSON schema. In Proceedings of the Proceedings of the 25th international conference on World Wide Web, 2016; pp. 263-273.
- Spinellis, D. Git. IEEE software 2012, 29, 100–101. [Google Scholar] [CrossRef]
- Wu, Y.; Kirillov, A.; Massa, F.; Lo, W.-Y.; Girshick, R. Detectron2. 2019.
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L. Pytorch: An imperative style, high-performance deep learning library. Advances in neural information processing systems 2019, 32. [Google Scholar]
- Alexandrova, S.; Tatlock, Z.; Cakmak, M. RoboFlow: A flow-based visual programming language for mobile manipulation tasks. In Proceedings of the 2015 IEEE International Conference on Robotics and Automation (ICRA), 2015; pp. 5537-5544.
- Solawetz, J. How to Train Detectron2 on Custom Object Detection Data. Roboflow 2021. [Google Scholar]
- Skalski, P. How to Train RT-DETR on a Custom Dataset with Transformers2024, 2024.
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the Proceedings of the IEEE conference on computer vision and pattern recognition, 2016; pp. 770-778.
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 2020. arXiv:2010.11929 2020.


| Method | ARCombined | APCombined | ARLettuce | APLettuce | ARWeed | APWeed |
|---|---|---|---|---|---|---|
| Faster R-CNN | 97.4 | 92.8 | 98.7 | 96.4 | 96.2 | 89.1 |
| DETR | 87.9 | 86.3 | 88.4 | 87.8 | 87.5 | 84.8 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).