作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (11): 377-391. doi: 10.19678/j.issn.1000-3428.0069125

• 开发研究与工程应用 • 上一篇    下一篇

改进YOLOv8的城市车辆目标检测算法

许德刚1,2,3,*(), 王双臣1, 尹柯栋1, 王再庆1   

  1. 1. 河南工业大学信息科学与工程学院, 河南 郑州 450001
    2. 河南工业大学粮食信息处理与控制教育部重点实验室, 河南 郑州 450001
    3. 湖南工程学院计算机与通信学院, 湖南 湘潭 411104
  • 收稿日期:2023-12-28 修回日期:2024-04-24 出版日期:2025-11-15 发布日期:2024-08-22
  • 通讯作者: 许德刚
  • 基金资助:
    国家重点研发计划(2017YFD0401003-4); 湖南省自然科学基金(2021JJ50114)

Improved YOLOv8 Urban Vehicle Target Detection Algorithm

XU Degang1,2,3,*(), WANG Shuangchen1, YIN Kedong1, WANG Zaiqing1   

  1. 1. School of Information Science and Engineering, Henan University of Technology, Zhengzhou 450001, Henan, China
    2. Key Laboratory of Food Information Processing and Control, Ministry of Education, Henan University of Technology, Zhengzhou 450001, Henan, China
    3. School of Computer and Communication, Hunan Institute of Engineering, Xiangtan 411104, Hunan, China
  • Received:2023-12-28 Revised:2024-04-24 Online:2025-11-15 Published:2024-08-22
  • Contact: XU Degang

摘要:

为了解决城市车辆目标检测算法中存在检测效果差、误检漏检率高、泛化能力弱的问题, 提出一种改进YOLOv8的城市车辆目标检测算法。首先, 在主干网络尾部融入高效多尺度注意力(EMA)机制, 有助于模型更好地捕捉目标车辆的细节特征, 结合160×160像素尺寸的小目标检测层来加强对小目标的检测能力, 通过维度交互进一步聚合像素级特征, 增强对目标车辆的挖掘能力。其次, 为轻量化网络设计了一种多尺度轻量化卷积(MLConv)模块, 并基于MLConv重构了C2f模块, 提高模型的特征提取能力。最后, 为抑制低质量图像产生的有害梯度, 采用WIoU损失函数替代完全交并比(CIoU)损失函数, 优化网络的边界框损失, 提升模型的收敛速度和回归精度。在Streets车辆数据集上进行验证, 结果表明, 改进算法的mAP@0.5、mAP@0.5∶0.95和召回率相较于基准模型YOLOv8n分别提升了1.9、1.4和2.4百分点。在国内车辆数据集和VisDrone2019小目标数据集上进行验证, 改进算法的各项性能指标都有不同程度的提升, 充分证明了改进算法具有良好的泛化性和鲁棒性。与其他主流算法相比, 改进算法同样表现出了更高的准确率和召回率, 表明该算法对于城市车辆目标检测具有更好的性能。

关键词: 车辆目标检测, YOLOv8n模型, 注意力机制, 轻量化, 加权交并比损失函数

Abstract:

To solve the problems of poor detection effect, high misdetection and omission rate, and weak generalization ability of urban vehicle target detection algorithms, this study proposes an improved YOLOv8 urban vehicle target detection algorithm. First, an Efficient Multi-scale Attention (EMA) mechanism is incorporated into the tail of the backbone network, which helps the model better capture the detailed features of a target vehicle. Combined with a 160×160 pixel small-target detection layer, it enhances the detection capability of small targets and aggregates pixel-level features through dimensional interaction to enhance the mining capability of the target vehicle. Second, the study designs a new Multi-scale Lightweight Convolution (MLConv) module for the lightweight network, and the C2f module is reconstructed based on MLConv, which significantly improves the feature extraction capability of the model. Finally, to suppress the harmful gradients generated by low-quality images, the study uses the Wise-Intersection over Union (WIoU) loss function instead of the Complete Intersection over Union (CIoU) to optimize the network's bounding box loss and improve the model's convergence speed and regression accuracy. On the Streets vehicle dataset, the algorithm improves mAP@0.5, mAP@0.5∶0.95, and recall by 1.9, 1.4 and 2.4 percentage points respectively, compared with the YOLOv8n benchmark model. In validations on a domestic vehicle dataset and the VisDrone2019 small target dataset, these performance indexes improve to different degrees, proving that the improved algorithm has good generalization and robustness. Compared with other mainstream algorithms, the improved algorithm exhibits higher accuracy and detection rate, indicating that the algorithm performs better in urban vehicle target detection.

Key words: vehicle target detection, YOLOv8n model, attention mechanism, lightweight, Wise-Intersection over Union (WIoU) loss function