Lightweight detection method for corn seedlings and weeds under natural environment based on improved YOLO11n
-
-
Abstract
Corn is one of the most important crops for national food security. However, weed is a major influencing factor of biological stress on corn growth. They compete with corn seedlings for water, nutrients, and light, serve as hosts for pests and pathogens, thereby causing declines in both crop yield and quality. Conventional weed control strategies rely typically on manual identification or extensive herbicide application, both of which are associated with low efficiency, resource waste, and environmental pollution. Existing detection models for corn seedlings and weeds often suffer from large parameter counts, high computational costs, and low accuracy in complex agricultural environments, leading to the false positives and missed detections. In this study, a lightweight detection framework named YOLO11-SAW was developed using YOLO11n. The high accuracy and inference efficiency were achieved well-suitable for deployment on edge devices. Specifically, three aspects were proposed for the improved YOLO11n: backbone feature extraction, neck feature fusion, and the loss function for bounding box regression. 1) C3STR module was constructed to combine the C3 module with the Swin Transformer at the end of the backbone network. Global contextual dependencies were better captured to distinguish corn seedlings from weeds in scenarios with the overlapping leaves, target occlusion, dense distribution, and complex soil backgrounds. 2) Neck structure was augmented with the Alterable Kernel Convolution (AKConv) module. The learnable offsets were introduced to replace conventional convolution. The adaptability to multi-scale and deformed weed targets were enhanced after modification to simultaneously reduce both floating-point operations (FLOPs) and model parameters. 3) A bounding box regression was refined to introduce the WIoUv3 loss function. Training instability caused by fixed gradient magnitudes was alleviated to enhance the suppression of low-quality samples. The high-quality samples were consequently promoted the convergence stability and localization accuracy. A series of comparative experiments were conducted to evaluate the effectiveness of the improved model on a self-constructed corn seedling and weed dataset. The YOLO11-SAW was compared with several representative models under unified experiment, including Faster R-CNN, Swin Transformer, RT-DETR-L, and multiple YOLO-series models. It was found that the YOLO11-SAW outperformed existing models in both detection accuracy and computational efficiency. Compared with the baseline YOLO11n model, YOLO11-SAW improved Precision by 1.71 percentage points and Recall by 2.18 percentage points, with mAP0.5 and mAP0.5:0.95 reaching 96.40% and 76.17%, respectively, indicating strong detection and localization. In terms of model complexity, the parameters, floating-point operations and model size of YOLO11-SAW are 1.97M, 8.0G and 4.3MB respectively. In addition, an inference speed of 202.77 frames per second (FPS) was fully met the real-time requirements of intelligent agricultural applications. In summary, the YOLO11-SAW model can real-time and accurately detect the corn seedlings and weeds in complex agricultural environments. The findings can provide practical technical support to deploy the mobile robots and variable-rate spraying on edge devices in smart agriculture.
-
-