高级检索+

基于改进YOLOv8n的轻量化草坪异质杂草检测算法

Detecting lawn heterogeneous weed using lightweight improved YOLOv8n

  • 摘要: 为提高自然环境下草坪异质杂草的检测效率和准确性,提出一种基于YOLOv8n模型的轻量化检测算法YOLOv8-LDB。首先,在主干网络中,使用可变形卷积DCNv2(deformable ConvNets v2)结合c2f卷积层,增强模型特征提取能力,提高模型的精确度和鲁棒性。其次,在颈部网络引入加权双向特征金字塔网络(bidirectional feature pyramid network,BiFPN),提升不同尺度的特征融合能力与泛化能力。最后使用Inner-IoU(Inner intersection over union)损失函数,优化预测框的损失计算,进一步提升模型的稳定性。试验结果表明,YOLOv8-LDB模型平均精度均值较原始模型提升了3.2个百分点,在保持总体精度提升的同时,模型的参数量、浮点运算量和模型大小分别降低了32.7%、13.6%、31.8%,检测速度由80.4帧/s提高到87.1帧/s,提高了模型的推理效率。该研究结果可为自然环境下草坪异质杂草的实时检测提供更强的支持。

     

    Abstract: Green lawns can play a crucial role in the landscape and ecological environments with the rapid urbanization in China. However, there is an ever-increasing demand for the daily maintenance of lawns. Among them, the heterogeneous weeds can often compete with the native grass for nutrients and growing space in lawns, leading to the low overall quality of urban greenery. The aesthetic appeal of the lawn can also be diminished after premature aging. Thereby, the accurate and rapid detection of the weed can be required for deep learning and computer vision. This study aims to improve the efficiency and accuracy of the detection of heterogeneous weeds in natural environments. A lightweight algorithm was also proposed using the original YOLOv8n model. Firstly, the deformable convolutional network v2 (DCNv2) was employed to combine with the c2f convolutional layers in the backbone network. The offsets were then introduced to enhance the feature extraction of the improved model. Different regular shapes of the heterogeneous weeds were captured after optimization. Additionally, a modulation mechanism was incorporated to control the contribution of each sampling point to the output. The precision and robustness were then improved to focus more on the target regions, thereby reducing the interference from background noise. Secondly, a bidirectional feature pyramid network (BiFPN) was introduced in the neck network. Multi-scale features were efficiently fused using bidirectional cross-scale connections and weighted feature fusion. The targets were detected at varying scales. Furthermore, the BiFPN significantly reduced the computational overhead, compared with the traditional feature pyramid network (FPN). The redundant connections were also eliminated to incorporate the lightweight weighting mechanisms. The efficiency and generalization of feature fusion were also improved after feature fusion. Lastly, the traditional intersection over union (IoU) loss function was replaced with the inner-IoU (inner intersection over union) loss function. The objective function of the bounding box regression was then optimized to learn the target location information, thereby improving the convergence speed and detection performance. More precise guidance was realized for the improved model. The experimental results show that the improved YOLOv8-LDB model reduced the number of parameters, the computational cost, and the model size by 32.7%, 13.6%, and 31.8%, respectively, compared with the original YOLOv8n. While the mean average precision (mAP) increased by 3.2 percentage points. The performance of the improved YOLOv8-LDB model was better than that of the seven commonly used network models (including Faster-RCNN, SSD, YOLOv5s, YOLOv5n, YOLOv7n, YOLOv10n, and YOLOv11n), in terms of the precision, parameter count, computational cost, and model size. The mean average precision was improved by 21.6, 9.6, 1.6, 7.7, 2.4, 4.1, and 3.3 percentage points, respectively. Additionally, the detection speed increased from 80.4 to 87.1 frames per second. The inference efficiency was also enhanced for the real-time detection of heterogeneous weeds in natural environments. The YOLOv8-LDB algorithm demonstrated superior performance across multiple metrics. Automatic sprayers and weeding robots can be integrated to realize variable-rate precision spraying and targeted weed control. The automation level of lawn management can also be further advanced in the future. The lightweight improved model can be expected to find wide applications in smart city greening and precision agriculture. The findings can also provide technical support to protect the sustainable ecological environment in urban areas.

     

/

返回文章
返回