Skip to Content
You are currently on the new version of our website. Access the old version .
  • Proceeding Paper
  • Open Access

20 July 2026

6 Pages

Enhancing Agricultural Efficiency: Integrating YOLOv5 and SORT Tracker for Precise Weed and Cabbage Detection †

,
,
and
1
Mathematical Analysis and Differential Equations—(MADE), Faculty of Applied Mathematics and Informatics, Technical University of Sofia, 1000 Sofia, Bulgaria
2
Mathematics Department, Applied Informatics and Statistics Faculty, University of National and World Economy, 1700 Sofia, Bulgaria
3
Mechatronics Department, Institute of Mechanics, Bulgarian Academy of Sciences, 1113 Sofia, Bulgaria
4
Mathematical Modelling and Numerical Methods—(MMNM), Faculty of Applied Mathematics and Informatics, Technical University of Sofia,1000 Sofia, Bulgaria

Abstract

This paper presents an innovative approach to agricultural management by integrating YOLOv5 for real-time detection and a modified SORT tracker for tracking two critical classes in agriculture: cabbage and weed. By deploying YOLOv5 on each video frame and updating the SORT tracker with current detections, we uniquely identify every cabbage and weed plant, allowing for precise monitoring and analysis. This method not only enables the collection of detailed data on the area covered by cabbage and weeds but also facilitates the calculation of free area, providing invaluable insights for optimizing crop management and reducing weed-related losses.

1. Introduction

The challenge of effective weed control in agricultural settings is critical for ensuring crop health and maximizing yield. Conventional weed management methods, such as chemical herbicides and manual labor, while effective, pose significant concerns related to environmental sustainability, economic viability, and human health risks. The need for innovative, sustainable, and efficient weed management strategies is apparent, prompting the exploration of advanced technological solutions.
Recent advancements in robotics and artificial intelligence have led to the development of mobile agricultural robots equipped with deep learning capabilities. These robots offer a promising alternative to traditional weed control methods. Equipped with high-resolution cameras and sophisticated sensors, mobile robots can navigate through fields, identifying and distinguishing between crops and weeds with high precision.
The core of this innovation lies in the application of Convolutional Neural Networks (CNNs), a class of deep learning algorithms renowned for their ability to process and classify visual imagery. By training CNNs on vast datasets of agricultural images, mobile robots can learn to recognize various plant species, enabling them to target weeds selectively without harming the surrounding crops [1,2].
This precision targeting not only reduces the dependency on chemical herbicides but also minimizes physical damage to crops, thereby supporting healthier crop growth and contributing to higher yields. Moreover, the automation of weed detection and removal processes significantly reduces the labor requirements and operational costs associated with manual weed control, making it an economically viable solution for large-scale agricultural operations [3].
The application of mobile robots for weed control also offers adaptability and scalability. These robots can be programmed to deal with various crop types and growth stages, as well as different weed species. Furthermore, their deployment can be scaled according to the size of the agricultural operation, from small farms to large agricultural fields, providing a flexible and efficient solution for weed management [4].

3. Methodology

In the prevailing methodologies, object detection algorithms are typically employed to process entire video recordings, subsequent to which an object tracking mechanism is iteratively applied to all identified detections, as illustrated in (Figure 1a) [8,9,10]. In our distinct approach, depicted in Figure 1b, it is imperative for the object tracking algorithm to be operational on each current frame, thereby facilitating immediate interventions on each detected weed. To this end, we deploy an object detection model configured with a batch size of one for every frame, concurrently updating our object tracking framework. Moreover, we aggregate all bounding boxes associated with plant detections. Upon the completion of the video analysis, the largest bounding box for each unique plant identifier is selected. This assembled data constitutes our statistical dataset, encompassing both plants and weeds, which serves as the basis for calculating the ratio of the area occupied by beneficial plants relative to the areas that remain unweeded and the extents of bare soil. This dataset holds potential for diverse applications, including the analysis of plant growth dynamics and other agronomical assessments.
Figure 1. (a) Traditional usage of object detectors and trackers for recorded videos. (b) Modification of the usage of an object detector and tracker for video streams.

4. Implementation

Essential to the construction of machine learning algorithms is the availability of high-quality data. Researchers often encounter issues such as insufficient data, data not available in the desired format, low-quality data, and data cluttered with irrelevant attributes.
Footage of cabbages and weeds is initially captured in video form. These videos are then processed into still images by extracting one frame out of every ten. Each image is meticulously annotated using the VoTT v1.7.0 (Visual Object Tagging Tool), an open-source software that assists in labeling images for object detection as is shown in Figure 2 [11].
Figure 2. Annotating cabbage and weed dataset.
In support of developing a mobile robot aimed at the automated removal of weeds, a targeted dataset featuring cabbages and weeds is assembled. The robot is designed to function within cabbage fields. The dataset is prepared by filming a sequence that captures both cabbages and weeds under a variety of environmental conditions, such as different growth stages of the cabbage, varying camera angles, and different lighting conditions.

5. Results and Discussion

5.1. Accuracy of Detection and Tracking Performance

Our experimental results demonstrate that the integration of YOLOv5 and the SORT tracker achieves real-time performance on a laptop with mid-range specifications. The YOLOv5 model, renowned for its speed and accuracy in object detection, successfully identifies cabbage and weed in each frame of the video. The SORT tracker, when used in conjunction with YOLOv5, ensures that even when the object detector misses some detections, the tracker smooths these gaps by maintaining the identity of objects across frames.

5.2. Detection Precision and Recall

The YOLOv5 model trained on our dataset, which includes annotated images of cabbages and weeds, achieves a high precision and recall. This implies that the model can effectively distinguish between cabbages and weeds, reducing the likelihood of false positives and negatives. The detection performance metrics indicate that our model can reliably identify the targeted classes under various conditions.

5.3. Tracking Robustness

The SORT tracker enhances the robustness of the detection system. By associating detected objects across successive frames, the tracker provides continuous identification of cabbages and weeds, ensuring consistent tracking even without transient occlusions or rapid movements. This continuity is crucial for accurate monitoring and analysis over time.

5.4. Data Analysis on Cabbage and Weed Areas

The data collected through this approach offers detailed insights into crop management. By analyzing the bounding boxes of cabbages and weeds, we can calculate the area covered by each category. This information allows us to quantify the ratio of weed-covered areas to cabbage-covered areas, providing valuable feedback for optimizing weed management strategies. The ability to identify and quantify free areas also aids in understanding the spatial distribution of crops and weeds, which is essential for planning interventions and maximizing crop yield.

5.5. Comparison with Traditional Methods

Compared to traditional weed control methods, our approach offers several advantages. Conventional methods, such as manual weeding and chemical herbicides, are labor-intensive, environmentally harmful, and often less precise. Automated methods using YOLO v5 and SORT provide a scalable and efficient alternative, reducing the need for manual labor and minimizing the use of chemicals. Furthermore, the real-time data collection and analysis capabilities of our system enable more informed decision-making and timely interventions, enhancing overall agricultural efficiency.

6. Conclusions and Future Work

6.1. Summary of Contributions and Benefits

This paper presents a novel approach to agricultural weed and crop management by integrating YOLO v5 for real-time detection and SORT for tracking. Our system effectively identifies and tracks cabbages and weeds, offering a precise and automated solution for monitoring and managing crop fields. The results indicate that this method is capable of real-time operation on mid-range laptops, demonstrating its practicality and efficiency. The ability to work with small datasets highlights the system’s robustness and adaptability to varying conditions.

6.2. Potential Improvements and Future Directions

Future work will focus on expanding the dataset to include images captured under different weather conditions and at various growth stages of the vegetables. This will enhance the model’s generalizability and performance across a wider range of scenarios. Additionally, we aim to test the system with vegetables and fruits that are ready for harvesting to further validate its effectiveness. Continued development will also involve integrating this detection and tracking system with robotic weed control mechanisms, enabling fully autonomous agricultural robots capable of not only identifying but also removing weeds.

6.3. Broader Implications for Precision Agriculture

The integration of advanced object detection and tracking algorithms in agricultural robots represents a significant step towards precision agriculture. By providing real-time, accurate, and detailed data on crop and weed distribution, our system supports more sustainable and efficient farming practices. This technology has the potential to reduce dependency on chemical herbicides, lower labor costs, and increase crop yields, contributing to more sustainable and profitable agricultural operations. The broader adoption of such technologies could revolutionize agricultural practices, promoting healthier crops and more environmentally friendly farming methods.

Author Contributions

Conceptualization, I.I. and V.K.; methodology, I.I. and K.P.; software, V.K. and M.I.; validation, I.I., V.K. and K.P.; formal analysis, I.I.; investigation, V.K. and K.P.; resources, M.I.; data curation, V.K.; writing—original draft preparation, V.K.; writing—review and editing, I.I. and M.I.; visualization, M.I.; supervision, I.I. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The data supporting the findings of this study are not publicly available due to privacy and internal research restrictions. Data may be available from the corresponding author upon reasonable request.

Acknowledgments

The authors would like to thank the Research and Development Sector at the Technical University of Sofia for the financial support.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Young, S.; Pierce, S.; Singh, D.; Burgos, N.; Vangessel, M. Plant species identification using deep learning: Implications for weed management. Weed Sci. 2017, 65, 733–742. [Google Scholar]
  2. Milioto, A.; Lottes, P.; Stachniss, C. Real-time semantic segmentation of crop and weed for precision agriculture robots leveraging background knowledge in CNNs. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), Brisbane, Australia, 21–25 May 2018; pp. 2229–2235. [Google Scholar]
  3. Haug, S.; Michaels, A.; Biber, P.; Ostermann, J. CropWeedNet: A lightweight convolutional neural network for weed and crop classification. Agronomy 2019, 9, 658. [Google Scholar]
  4. Fennimore, S.A.; Slaughter, D.C.; Siemens, M.C.; Bargmann, J.; Smith, R.F. Robotic weed removal. Weed Technol. 2016, 30, 657–665. [Google Scholar] [CrossRef] [Scilit]
  5. Sun, Z.; Yang, H.; Zhang, Z.; Liu, J.; Zhang, X. An improved YOLOv5-based tapping trajectory detection method for natural rubber trees. Agriculture 2022, 12, 1309. [Google Scholar] [CrossRef] [Scilit]
  6. Razzok, M.; Badri, A.; El Mourabit, I.; Ruichek, Y.; Sahel, A. Pedestrian detection and tracking system based on Deep-SORT, YOLOv5 and new data association metrics. Information 2023, 14, 218. [Google Scholar] [CrossRef] [Scilit]
  7. Xie, T.; Yao, X. Smart logistics warehouse moving-object tracking based on YOLOv5 and DeepSORT. Appl. Sci. 2023, 13, 9895. [Google Scholar] [CrossRef] [Scilit]
  8. Fedorov, A.; Nikolskaia, K.; Ivanov, S.; Shepelev, V.; Minbaleev, A. Traffic flow estimation with data from a video surveillance camera. J. Big Data 2019, 6, 73. [Google Scholar] [CrossRef] [Scilit]
  9. Bathija, A.; Sharma, G. Visual object detection and tracking using YOLO and SORT. Int. J. Eng. Res. Technol. (IJERT) 2019, 8, 705–708. [Google Scholar]
  10. Algiriyage, N.; Doyle, E.E.; Johnston, D.; Prasanna, R.; Stock, K.; Punchihewa, M.; Jayawardhana, S. Towards real-time traffic flow estimation using YOLO and SORT from surveillance video footage. In Proceedings of the 18th International Conference on Information Systems for Crisis Response and Management, Blacksburg, VA, USA, 23 May 2021; pp. 40–48. [Google Scholar]
  11. Kotev, V.; Ivanov, I.; Komitov, G.; Stanchev, G.; Kostadinov, K. Object detection and tracking approach to control of a mobile agriculture robot. In Proceedings of the International Conference Automatics and Informatics (ICAI), Varna, Bulgaria, 5–7 October 2023; pp. 201–204. [Google Scholar]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.