Abstract:
Accurate and rapid detection and counting of winter wheat seedlings are essential for obtaining key seedling information, including emergence density and emergence rate, and for supporting timely field management under complex field conditions. However, seedling targets are generally small, densely distributed, and easily occluded, while variations in soil background and illumination further reduce the reliability of conventional detection methods. This study proposed a lightweight detection and counting method based on an improved YOLOv8n model. Visible-light images were acquired from a winter wheat experimental field using near-ground Internet of Things (IoT) devices, unmanned aerial vehicles (UAVs), and smartphones. Images collected at four representative emergence stages, namely 5, 9, 14, and 20 days after sowing, covered newly emerged, one-leaf, two-leaf, and three-leaf seedlings under sunny and cloudy conditions. After image cleaning, stratified dataset partitioning, and data augmentation, a multi-source winter wheat seedling dataset containing 4,550 images was obtained, including 3,185 training images, 910 validation images, and 455 test images. A YOLOv8n-GC-S (ghost-convolutional block attention module-small object detection layer YOLOv8n) model was then developed. First, the original YOLOv8n backbone was replaced with the lightweight GhostNet backbone. GhostNet generated additional feature maps through low-cost linear transformations, thereby reducing redundant convolution operations and reducing the number of model parameters by 28.1%. Second, a convolutional block attention module (CBAM) was introduced between the backbone and neck. Channel and spatial attention were used to enhance seedling-related features and suppress interference from soil, crop residues, and other complex background information. Compared with the GhostNet-based lightweight model, the introduction of CBAM increased mAP@0.5 by 9.4 percentage points. Third, a small-object detection branch with a feature-map size of 160 × 160 was added to retain shallow spatial details and strengthen the representation of small-scale seedlings with weak visual features. Compared with the GhostNet-based lightweight model, this branch increased mAP@0.5 by 12.6 percentage points. Ablation experiments were conducted to evaluate the contribution of each modification, and the proposed model was also compared with mainstream object detection models under the same dataset and experimental conditions. The experimental results showed that the precision, recall, and mAP@0.5 of the YOLOv8n-GC-S model reached 92.1%, 80.0%, and 86.2%, respectively, which were 2.3, 5.9, and 2.9 percentage points higher than those of the baseline YOLOv8n model. The final model contained 2.8 million parameters and had a model weight file size of 5.7 MB, representing reductions of 12.5% and 8.1%, respectively, relative to the baseline model. Under cloudy conditions, the missed-detection rate decreased from 8.0% to 4.7%, whereas under sunny conditions it decreased from 12.7% to 7.8%. Across both illumination conditions, the average missed-detection rate decreased from 10.4% to 6.3%, corresponding to a reduction of 4.1 percentage points. Multi-temporal counting validation further showed good agreement between model-predicted and manually counted seedling numbers. The coefficient of determination (
R2) ranged from 0.88 to 0.94 across the four emergence stages, and the root mean square error (RMSE) ranged from 4.73 to 7.61 seedlings. The best counting agreement was obtained at the one-leaf stage, with an
R2 of 0.94 and an RMSE of 4.73 seedlings. In addition, emergence density and emergence rate were calculated from the model-detected seedling numbers. The model-estimated emergence rate was highly consistent with the manually measured emergence rate, with an
R2 of 0.93 and an RMSE of 2.52%. These results demonstrate that YOLOv8n-GC-S achieves a favorable balance between detection performance and lightweight design, improves the detection of small winter wheat seedlings under varying illumination and complex backgrounds, and can support seedling counting and quantitative emergence-rate assessment in field environments.