Hostname: page-component-76d6cb85b7-6jg5l Total loading time: 0 Render date: 2026-07-10T21:11:54.347Z Has data issue: false hasContentIssue false

CD-YOLO-based deep learning method for weed detection in vegetables

Published online by Cambridge University Press:  21 November 2025

Wenpeng Zhu
Affiliation:
Intern, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China Visiting Student, National Engineering Research Center of Biomaterials, Nanjing Forestry University, Nanjing, China
Qiuyu Zu
Affiliation:
Research Assistant, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China
Jinxu Wang
Affiliation:
Research Assistant, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China
Teng Liu
Affiliation:
Research Assistant, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China
Aniruddha Maity
Affiliation:
Assistant Professor, Department of Crop, Soil and Environmental Sciences, Auburn University, Auburn, AL, USA
Jihong Sun
Affiliation:
Research Assistant, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China
Mian Li
Affiliation:
Research Assistant, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong, China
Xiaojun Jin*
Affiliation:
Associate Professor, National Engineering Research Center of Biomaterials, Nanjing Forestry University, Nanjing, China
Jialin Yu*
Affiliation:
Professor and Principal Investigator, Peking University Institute of Advanced Agricultural Sciences, Shandong Laboratory of Advanced Agricultural Sciences in Weifang, Shandong
*
Corresponding authors: Xiaojun Jin; Email: xjin@njfu.edu.cn; Jialin Yu; Email: jialin.yu@pku-iaas.edu.cn
Corresponding authors: Xiaojun Jin; Email: xjin@njfu.edu.cn; Jialin Yu; Email: jialin.yu@pku-iaas.edu.cn
Rights & Permissions [Opens in a new window]

Abstract

Computer vision–based precision weed control has proven effective in reducing herbicide usage, lowering weed management costs, and enhancing sustainability in modern agriculture. However, developing deep learning models remains challenging due to the effort required for weed dataset annotation and the difficulty of identifying weeds at different stages and densities in complex field conditions. To address these challenges, this study introduces an indirect weed detection method that combines deep learning and image processing techniques. The proposed approach first employs an object detection network to identify and label crops within the images. Subsequently, image processing techniques are applied to segment the remaining green pixels, thereby enabling indirect detection of weeds. Furthermore, a novel detection network—CD-YOLOv10n (You Only Look Once version 10 nano)—was developed based on the YOLOv10 framework to optimize computational efficiency. Redesigning the backbone (C2f-DBB) and integrating an optimized upsampling module (DySample) permitted the network to achieve higher detection accuracy while maintaining a lightweight structure. Specifically, the model achieved a mean average precision (mAP50) of 98.1%, which is a 1.4% percentage-point increase compared with the YOLOv10n baseline, a relevant improvement given the already strong baseline performance. At the same time, compared with YOLOv10n, its GFLOPs (giga floating-point operations per second) were reduced by 22.62%, and the number of parameters decreased by 15.87%. These innovations make CD-YOLOv10n highly suitable for deployment on resource-constrained platforms.

Information

Type
Research Article
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2025. Published by Cambridge University Press on behalf of Weed Science Society of America
Figure 0

Table 1. Number of images used for training, validation, and testing.

Figure 1

Figure 1. CD-YOLOv10n architecture.

Figure 2

Table 2. The hyperparameters for deep learning training.a

Figure 3

Table 3. Performance improvements achieved through the replacement of each component.

Figure 4

Table 4. Results of ablation experiments.

Figure 5

Figure 2. Training accuracy (mAP50) versus epoch (0–100) for YOLOv10n and CD-YOLOv10n. The x axis shows training epochs, and the y axis shows mAP50. Curves are averaged across epochs and smoothed with a three-epoch moving average for clarity.

Figure 6

Figure 3. Training loss versus epoch (0–100) for YOLOv10n and CD-YOLOv10n. Loss represents the weighted sum of box regression, objectness, and classification components. Lower values indicate more accurate bounding box regression.

Figure 7

Figure 4. Vegetable detection results of YOLOv10n and CD-YOLOv10n on challenging field scenes. Columns show the original image, YOLOv10n output, and CD-YOLOv10n output. Smaller inset boxes highlight regions where the two models differ, with bounding boxes indicating predictions in difficult areas.

Figure 8

Figure 5. Vegetable detection and weed segmentation results. Columns show the original image, CD-YOLOv10n detection (vegetable bounding boxes), and the segmentation output where green pixels outside the boxes are classified as weeds.

Figure 9

Table 5. Performance comparison of detection models.a