Megaweeds: an Experimental Study on Weed Detection with YOLOv7 Using a Novel Dataset
摘要
Modern agriculture must address growing food demand, labor shortages, and environmental concerns. Precision agriculture (PA), which involves crop monitoring and automation, offers solutions. A key element of PA is crop and weed detection, often achieved with deep learning. This study applies YOLOv7, an object detection model, to this task. While most approaches pre-train YOLOv7 on the general COCO dataset, COCO lacks plant images. Therefore, we built the MegaWeeds (MW) dataset, which contains seven existing datasets for weed and crop detection with a total of 18,287 images (and 19,317 label files). Performance was tested using the Lincolnbeet dataset of sugar beets and weeds, comparing models pre-trained on COCO and MW. Results showed similar mean average precision scores, i.e. 78.7% (COCO pretrained) and 78.6% (MW pretrained). Nonetheless, pretraining with MW proved advantageous by enabling faster convergence and better zero-shot detection than COCO. The study surpassed earlier YOLOv7 results on the same dataset and demonstrated that domain-specific pretraining shortens transfer learning and enhances detection efficiency.