Model Deteksi Gulma dan Tanaman Jagung Berbasis YOLOv5n untuk Sistem Pertanian Presisi
Abstract
Weed infestation is one of the main challenges in maize cultivation because it can reduce crop growth and productivity through competition for nutrients, water, light, and growing space. An automatic detection system is therefore needed to support precision agriculture, particularly for selective weed control. This study aimed to develop and evaluate a YOLOv5n-based detection model for identifying maize plants and weeds in agricultural field images. The dataset used in this study was obtained from the Weed Classification dataset available on Kaggle. Image annotation was performed using bounding boxes with two object classes, namely maize and weed. The dataset was divided into training, validation, and testing subsets using an 80:10:10 ratio. Model training was conducted on Google Colab for 100 epochs using an image size of 640 × 640 pixels and the YOLOv5n architecture. Model performance was evaluated using precision, recall, F1-score, and mAP@50. The results showed that the YOLOv5n model achieved an average precision of 0.894, recall of 0.923, F1-score of 0.908, and mAP@50 of 0.936. The maize class obtained a higher mAP@50 of 0.976, while the weed class achieved an mAP@50 of 0.897. These results indicate that YOLOv5n can effectively detect maize plants and weeds and has the potential to support precision agriculture applications, particularly selective spraying systems.
Downloads
References
Allmendinger, A., Saltık, A.O., Peteinatos, G.G., Stein, A., Gerhards, R. 2025. Assessing the capability of YOLO- and transformer-based object detectors for real-time weed detection. Precis. Agric. 26. https://doi.org/10.1007/s11119-025-10246-0
Chen, J., Wang, H., Zhang, H., Luo, T., Wei, D., Long, T., Wang, Z. 2022. Weed detection in sesame fields using a YOLO model with an enhanced attention mechanism and feature fusion. Comput. Electron. Agric. 202, 107412. https://doi.org/10.1016/j.compag.2022.107412
Darbyshire, M., Salazar-Gomez, A., Gao, J., Sklar, E.I., Parsons, S. 2023. Towards practical object detection for weed spraying in precision agriculture. Front. Plant Sci. 14. https://doi.org/10.3389/fpls.2023.1183277
Fan, X., Sun, T., Chai, X., Zhou, J. 2024. YOLO-WDNet: A lightweight and accurate model for weeds detection in cotton field. Comput. Electron. Agric. 225, 109317. https://doi.org/10.1016/j.compag.2024.109317
Hasan, A.S.M.M., Diepeveen, D., Laga, H., Jones, M.G.K., Sohel, F. 2023. Object-Level Benchmark for Deep Learning-Based Detection and Classification of Weed Species. https://doi.org/10.2139/ssrn.4511105
Hu, K., Wang, Z., Coleman, G., Bender, A., Yao, T., Zeng, S., Song, D., Schumann, A., Walsh, M. 2023. Deep learning techniques for in-crop weed recognition in large-scale grain production systems: a review. Precis. Agric. 25, 1–29. https://doi.org/10.1007/s11119-023-10073-1
Li, H., Guo, C., Yang, Z., Chai, J., Shi, Y., Liu, J., Zhang, K., Liu, D., Xu, Y. 2022. Design of field real-time target spraying system based on improved YOLOv5. Front. Plant Sci. 13. https://doi.org/10.3389/fpls.2022.1072631
Loshchilov, I., Hutter, F. 2017. Fixing Weight Decay Regularization in Adam. CoRR abs/1711.05101.
Olsen, A., Konovalov, D.A., Philippa, B., Ridd, P., Wood, J.C., Johns, J., Banks, W., Girgenti, B., Kenny, O., Whinney, J., Calvert, B., Azghadi, M.R., White, R.D. 2019. DeepWeeds: A Multiclass Weed Species Image Dataset for Deep Learning. Sci. Rep. 9. https://doi.org/10.1038/s41598-018-38343-3
Picon, A., San-Emeterio, M.G., Bereciartua-Perez, A., Klukas, C., Eggers, T., Navarra-Mestre, R. 2022. Deep learning-based segmentation of multiple species of weeds and corn crop using synthetic and real image datasets. Comput. Electron. Agric. 194, 106719. https://doi.org/10.1016/j.compag.2022.106719
Wang, J., Qi, Z., Wang, Y., Liu, Y. 2025. A lightweight weed detection model for cotton fields based on an improved YOLOv8n. Sci. Rep. 15. https://doi.org/10.1038/s41598-024-84748-8

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

