# Evaluation of YOLO Object Detectors for Weed Detection in Different Turfgrass Scenarios
## 2 Materials and Methods  
### YOLO and YOLOv5, YOLOv6, YOLOv7, YOLOv8 Detectors  
YOLO is an SSD; its first version was released in 2015 [22]. YOLO performs object detection by dividing the input image into m \(\times\) m grids of equal dimensions. Each grid cell is responsible for detecting an object if the object's center of the thing falls inside the cell. Each cell can predict a fixed number of bounding boxes, each with an accompanying confidence score. Each prediction comprises five values (x, y, w, h, and a confidence score). Here, x, y, w, and h are the center of the bounding box, width, and height, respectively. After predicting a bounding box, YOLO uses Intersection Over Union (IOU) to choose the most representative bounding box of an object in the grid cell, and non-max suppression is used to remove the excess bounding boxes. After the first YOLO release, YOLOv2 and YOLOv3 were published in 2016 [30] and 2017 [31], respectively. Then, [PERSON] released YOLOv4 in 2020 [32]. In this experiment, YOLOv5 [33], YOLOv6 [34], YOLOv7 [35], and YOLOv8 [36] models were used and evaluated for weed detection in multiple turfgrass contexts. YOLOv5 was introduced by [PERSON] shortly after the release of YOLOv4 and is entirely based on the PyTorch framework. YOLOv6 and YOLOv7 detection models were released in June and July 2022, respectively. Finally, YOLOv8 was published by Ultralytics in January 2023. YOLOv5 combines a cross-stage partial network (CSPNet) [37] and Darknet as a backbone. It uses a path aggregation network (PANet) [38] as a neck and adaptive feature pooling to enhance object location accuracy. The YOLOv5 head generates three different sizes of feature maps to achieve multi-scale [31] prediction. YOLOv5 outperforms YOLO's previous version in terms of accuracy of detection while maintaining a slightly slower inference speed [39]. Real-time weed detection requires a high detection speed, accuracy, and compact model size as YOLOv5 provides higher inference efficiency on resource-poor edge devices [40]. A YOLOv5 object detection application programming interface (API) was used. YOLOv5 offers five different model scales: YOLOv5n (nano), YOLOv5s (small), YOLOv5m (medium), YOLOv5l (large), and YOLOv5x (extra-large), which are compound-scaled variants of the same architecture. Table 1 shows more detailed information about the YOLOv5 models. YOLOv6 (and the newer versions YOLOv7 and YOLOv8) perform anchor-free detection to obtain a higher inference speed. YOLOv6 utilizes an EfficientRep backbone based on RepVGG [41] to increases the parallelism. PAN [42] is boosted with RepBlocks or CSPStackRep [37]. Task alignment learning approach from TOOD [43] is employed for label assignment and VariFocal [44] and an SIoU or GIoU [45,46] is used for classification and regression loss computation. RepOptimizer [47] quantization and channel-wise distillation [48] contribute to improve higher detection speed. YOLOv6 achieved an AP of 52.5% and AP50 of 70% at around 50 FPS on the MS COCO dataset test 2017 and an mAP of 43.1% on the COCO va1 2017 dataset. YOLOv6 provides different model scales for various applications: YOLOv6n (nano), YOLOv6s (small), YOLOv6m (medium), and YOLOv6l (large) [49]. YOLOv7 improves accuracy without affecting the inference speed. It introduces the extended efficient layer aggregation network (E-ELAN) [50] as an improved version of ELAN computational block. The E-ELAN enables efficient learning without losing the gradient path. YOLOv7 is a concatenation-based architecture that scales network depth and width according to concatenating layer ratios, reducing hardware usage while ensuring efficiency at different scales. YOLOv7 relies on re-parameterized convolutions (RepConv) [41] and employs coarse label assignment for the auxiliary head and acceptable label assignment for the lead head. Additional innovations include batch normalization in conv-bn-activation, YOLOR inspired implicit knowledge YOLOR [51] and exponential moving average for the final inference model.