DOI: 10.3390/agriculture16131437 ISSN: 2077-0472

A Weed Location Method Based on MCS-YOLOv8 and Adaptive Filtering

Xiaobo Zhuang, Jianya Zhang, Dabiao Yang, Liming Gao, Jing Jin

To address the challenges of large morphological variations of weed targets, background interference in close-range agricultural images, and limited computational resources for visual perception models, this paper proposes a sequential visual perception method for weed recognition and short-range 3D localization in controlled or semi-controlled close-range precision weeding scenarios. The proposed method consists of two main stages: weed detection and 3D localization. In the detection stage, a lightweight MCS-YOLOv8 model is constructed based on YOLOv8n. MobileNetV3 is introduced to reduce the number of parameters and computational complexity, while CBAM and Shape-IoU are adopted to enhance weed-related feature representation and improve bounding-box regression for irregular weed targets. In the localization stage, RAFT-Stereo is used as the initial disparity estimator, and a detection-guided adaptive WLS depth optimization strategy is designed by using the detection bounding boxes and confidence scores. This strategy refines the target-region depth information and supports short-range 3D coordinate estimation. Experimental results show that MCS-YOLOv8 contains 1.6 M parameters and requires 4.3 GFLOPs. Its mAP@0.5 and mAP@0.5:0.95 reached 94.1% and 65.0%, respectively, which were 2.0 and 2.7 percentage points higher than those of the YOLOv8n baseline. Meanwhile, the number of parameters and FLOPs were reduced by approximately 46.7% and 46.9%, respectively. In the 3D localization experiments under controlled conditions, the mean absolute errors in the X, Y, and Z directions were 2.2 mm, 2.6 mm, and 3.2 mm, respectively, with an average 3D Euclidean error of approximately 4.7 mm. Dynamic target experiments further demonstrated that the proposed pipeline could complete indoor dynamic target recognition, 3D coordinate updating, and laser pointing verification under controlled conditions. The results indicate that the proposed method shows effective weed detection and short-range 3D localization performance under controlled agricultural close-range imaging conditions, and can provide a reference for visual perception and end-effector pointing in controlled or semi-controlled close-range precision weeding equipment.

More from our Archive