Weed detection and recognition in complex wheat fields based on an improved YOLOv7 - Wang, Kaixin; Hu, Xihong; Zheng, Huiwen; Lan, Maoyang; Liu, Changjiang; Liu, Yihui; Zhong, Lei; Li, Hai; Tan, Suiyan (Frontiers in Plant Science, 2024)
The precise detection of weeds in the field is the premise of implementing weed management. However, the similar color, morphology and occlusion between wheat and weeds pose a challenge to the detection of weeds. In this study, a CSCW-YOLOv7 based on an improved YOLOv7 architecture was proposed to identify five types of weeds in complex wheat field. First, a dataset was constructed for five weeds that commonly found, namely Descurainia Sophia, Thistle, Golden Saxifrage, Shepherdspurse Herb and Artemisia Argyi. Second, wheat weed detection model called CSCW-YOLOv7 was proposed to achieve the accurate identification and classification of wheat weeds. In the CSCW -YOLOv7, the CARAFE operator was introduced as an up-sampling algorithm to improve the recognition of small targets. Then, the SE network was added to the ELAN module in the backbone network and the concatenation layer in the feature fusion module to enhance important weed features and suppress irrelevant features. In addition, the CoT module, a transformer-based architectural design, was used to capture global information and enhance self-attention by mining contextual information between neighboring keys. Finally, the Wise Intersection over Union (WIoU) loss function introducing a dynamic nonmonotonic focusing mechanism was employed to better predict the bounding boxes of the occluded weed. The ablation experiment results showed that CSCW-YOLOv7 achieved the best performance among the other models. The accuracy, recall, and mAP values of CSCW-YOLOv7 were 97.7%, 98%, and 94.4%, respectively. Compared with the baseline YOLOv7, the improved CSCW-YOLOv7 obtained precision, recall and mAP increase of 1.8%, 1% and 2.1%, respectively. Meanwhile, the parameters were compressed by 10.7% with 3.8 MB reduction, resulting in an 10% decrease in FLOPs. Grad CAM visualization method suggested that CSCW-YOLOv7 can learn a more representative set of features that helped better locate the weeds of different scale in complex field environment. In addition, the performance of the CSCW-YOLOv7 was compared to the widely used deep learning models, and results indicated that CSCW-YOLOv7 exhibit better ability in distinguish the overlapped weeds and small-scale weeds. The overall results suggest that CSCW-YOLOv7 is a promising tool for detection of weed and has great potentials for field applications.