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

计算机工程 ›› 2025, Vol. 51 ›› Issue (5): 314-325. doi: 10.19678/j.issn.1000-3428.0069122

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

基于改进YOLOv8的轻量化车辆检测网络

陈梓延1,2, 王晓龙3, 何迪1,2, 安国成3   

  1. 1. 上海交通大学电子信息与电气工程学院, 上海 200240;
    2. 上海交通大学感知科学与工程学院北斗导航与位置服务上海市重点实验室, 上海 200240;
    3. 上海华讯网络系统有限公司行业数智事业部, 四川 成都 610074
  • 收稿日期:2023-12-28 修回日期:2024-03-04 出版日期:2025-05-15 发布日期:2024-06-04
  • 通讯作者: 王晓龙,E-mail:wxlong@eccom.com.cn E-mail:wxlong@eccom.com.cn
  • 基金资助:
    “十四五”国家重点研发计划(2023YFC3006700);国家自然科学基金(61971278,62231010)。

Lightweight Vehicle Detection Network Based on Improved YOLOv8

CHEN Ziyan1,2, WANG Xiaolong3, HE Di1,2, AN Guocheng3   

  1. 1. School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai 200240, China;
    2. Shanghai Key Laboratory of Beidou Navigation and Location Services, School of Perception Science and Engineering, Shanghai Jiao Tong University, Shanghai 200240, China;
    3. Artificial Intelligence Research Institute of Shanghai Huaxun Network System Co., Ltd., Chengdu 610074, Sichuan, China
  • Received:2023-12-28 Revised:2024-03-04 Online:2025-05-15 Published:2024-06-04

摘要: 现有的高精度车辆检测模型参数与计算量过高,无法在交通智能设备上良好运行,而轻量化的车辆检测模型精度普遍较低,不适用于实际任务。为此,提出一种改进YOLOv8的轻量化车辆检测网络,将主干网络替换为计算量和内存访问更小的FasterNet网络,并且将颈部的双向特征金字塔网络替换为加权双向特征金字塔网络(BiFPN),简化特征融合过程。同时,引入一种融合注意力机制的动态检测头,实现检测头和注意力的无冗余结合;此外,针对完全交并比(CIoU)在检测精度和收敛速度上的缺陷,提出一种尺度不变交并比(SIoU)结合归一化高斯Wasserstein距离(NWD)的回归损失算法。最后,为尽量减小模型对边缘设备的算力需求,进行基于幅值的层自适应稀疏化剪枝,进一步压缩模型大小。实验结果表明,提出的改进模型相较于原模型YOLOv8s,在精度上升1.5百分点的情况下,参数量降低78.9%,计算量下降67.4%,模型尺寸降低77.8%,达到了比较优秀的轻量化效果,具有很强的实用性。

关键词: YOLOv8模型, 车辆检测, 轻量化, FasterNet网络, 归一化高斯Wasserstein距离

Abstract: The current high-precision vehicle detection model faces challenges due to its excessive parameterization and computational demands, making it unsuitable for efficient operation on intelligent transportation devices. Conversely, lightweight vehicle detection models often sacrifice accuracy, rendering them unsuitable for practical tasks. In response, an improved lightweight vehicle detection network based on YOLOv8 is proposed. This enhancement involves substituting the main network with the FasterNet architecture, which reduces the computational and memory access requirements. Additionally, we replace the Bidirectional Feature Pyramid Network (BiFPN) in the neck with a weighted bidirectional feature pyramid network to simplify the feature fusion process. Simultaneously, we introduce a dynamic detection head with a fusion attention mechanism to achieve nonredundant integration of the detection head and attention. Furthermore, we address the deficiencies of the Complete Intersection over Union (CIoU) in terms of detection accuracy and convergence speed by proposing a regression loss algorithm that incorporates the Scale-invariant Intersection over Union (SIoU) combined with the Normalized Gaussian Wasserstein Distance (NWD). Finally, to minimize the computational demands on edge devices, we implement amplitude-based layer-wise adaptive sparsity pruning, which further compresses the model size. Experimental results demonstrate that the proposed improved model, compared with the original YOLOv8s model, achieves a 1.5 percentage points increase in accuracy, a 78.9% reduction in parameter count, a 67.4% decrease in computational demands, and a 77.8% reduction in model size. This demonstrates the outstanding lightweight effectiveness and practical utility of the proposed model.

Key words: YOLOv8 model, vehicle detection, lightweight, FasterNet network, Normalized Gaussian Wasserstein Distance(NWD)

中图分类号: