《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (3): 1016-1024.DOI: 10.11772/j.issn.1001-9081.2024040424
• 前沿与综合应用 • 上一篇
收稿日期:
2024-04-10
修回日期:
2024-08-01
接受日期:
2024-08-02
发布日期:
2025-03-17
出版日期:
2025-03-10
通讯作者:
王泉
作者简介:
曹心雨(1999—),男,江苏新沂人,硕士研究生,主要研究方向:车联网、边缘计算基金资助:
Quan WANG1,2(), Xinyu CAO1, Qidong CHEN2
Received:
2024-04-10
Revised:
2024-08-01
Accepted:
2024-08-02
Online:
2025-03-17
Published:
2025-03-10
Contact:
Quan WANG
About author:
CAO Xinyu, born in 1999, M. S. candidate. His research interests include internet of vehicles, edge computing.Supported by:
摘要:
车路协同旨在通过信息交换和协作实现智能高效的交通管理,其中高精度、轻量化且易于部署的路侧视角下的车辆与行人检测至关重要。因此,提出基于改进YOLOv8的轻量化交通目标检测模型。首先,引入FasterNet中的FasterBlock替换原始C2f中的某些瓶颈组件,以减少浮点运算量(GFLOPs)和参数量,降低整体模型的复杂性;其次,在模型的颈部网络采用兼顾速度和精度的GSConv(Group Shuffle Convolution)替代原有的卷积核,并引入SlimNeck特征融合模块,使每个特征层能够同时考虑深层特征的语义信息和浅层特征的细节;再次,使用MPDIoU(Minimum Point Distance based Intersection over Union)替换原有的损失函数,以提高模型的边界框回归性能;最后,通过通道剪枝修剪模型网络中的冗余连接,以减小模型规模并提高检测速度。实验结果表明,经过改进和剪枝的模型与原始YOLOv8s相比,精度提升了1.0个百分点,平均精度均值(mAP)提升了1.2个百分点,计算量和参数量分别降低了70.1%和69.4%。并且,在边缘设备Atlas 200I DK A2(算力4 TOPS,功耗9 W)的条件下,所提模型达到了58.03 frame/s的检测速度。
中图分类号:
王泉, 曹心雨, 陈祺东. 面向车路协同的路侧交通目标检测模型及部署[J]. 计算机应用, 2025, 45(3): 1016-1024.
Quan WANG, Xinyu CAO, Qidong CHEN. Roadside traffic object detection model and deployment for vehicle-road collaboration[J]. Journal of Computer Applications, 2025, 45(3): 1016-1024.
剪枝率/% | P/% | GFLOPs | Params/106 | FPS/(frame·s-1) |
---|---|---|---|---|
0 | 97.3 | 21.4 | 9.1 | 422 |
10 | 96.2 | 19.2 | 8.0 | 476 |
20 | 97.1 | 17.1 | 6.6 | 529 |
30 | 97.2 | 14.9 | 5.6 | 548 |
40 | 96.8 | 12.7 | 4.5 | 573 |
50 | 97.1 | 10.6 | 4.1 | 600 |
60 | 96.7 | 8.5 | 3.4 | 633 |
70 | 89.2 | 6.3 | 2.7 | 756 |
80 | 77.3 | 4.2 | 2.1 | 985 |
90 | 50.2 | 2.0 | 1.4 | 1 136 |
表1 不同剪枝率下改进后模型的性能对比
Tab. 1 Performance comparison of improved models under different pruning rates
剪枝率/% | P/% | GFLOPs | Params/106 | FPS/(frame·s-1) |
---|---|---|---|---|
0 | 97.3 | 21.4 | 9.1 | 422 |
10 | 96.2 | 19.2 | 8.0 | 476 |
20 | 97.1 | 17.1 | 6.6 | 529 |
30 | 97.2 | 14.9 | 5.6 | 548 |
40 | 96.8 | 12.7 | 4.5 | 573 |
50 | 97.1 | 10.6 | 4.1 | 600 |
60 | 96.7 | 8.5 | 3.4 | 633 |
70 | 89.2 | 6.3 | 2.7 | 756 |
80 | 77.3 | 4.2 | 2.1 | 985 |
90 | 50.2 | 2.0 | 1.4 | 1 136 |
模型 | P/% | mAP/% | GFLOPs | Params/106 |
---|---|---|---|---|
SSD[ | 62.5 | 52.2 | 62.7 | 24.2 |
Faster R-CNN[ | 73.4 | 76.4 | 370.1 | 137.2 |
YOLOv4-tiny[ | 83.4 | 78.1 | 11.7 | 6.4 |
YOLOv5s | 93.1 | 95.8 | 15.8 | 7.0 |
YOLOv7-tiny[ | 90.6 | 88.9 | 13.2 | 6.1 |
YOLOv8s | 95.7 | 97.1 | 28.4 | 11.1 |
YOLOv8-FasterNet | 93.5 | 95.6 | 21.7 | 8.6 |
YOLOv8-RevCol | 95.1 | 96.6 | 21.2 | 8.2 |
YOLOv8-Embedded | 97.3 | 98.4 | 21.4 | 9.1 |
YOLOv8-Embedded+60%剪枝 | 96.7 | 98.3 | 8.5 | 3.4 |
表2 部分目标检测模型的性能对比
Tab. 2 Performance comparison of some object detection models
模型 | P/% | mAP/% | GFLOPs | Params/106 |
---|---|---|---|---|
SSD[ | 62.5 | 52.2 | 62.7 | 24.2 |
Faster R-CNN[ | 73.4 | 76.4 | 370.1 | 137.2 |
YOLOv4-tiny[ | 83.4 | 78.1 | 11.7 | 6.4 |
YOLOv5s | 93.1 | 95.8 | 15.8 | 7.0 |
YOLOv7-tiny[ | 90.6 | 88.9 | 13.2 | 6.1 |
YOLOv8s | 95.7 | 97.1 | 28.4 | 11.1 |
YOLOv8-FasterNet | 93.5 | 95.6 | 21.7 | 8.6 |
YOLOv8-RevCol | 95.1 | 96.6 | 21.2 | 8.2 |
YOLOv8-Embedded | 97.3 | 98.4 | 21.4 | 9.1 |
YOLOv8-Embedded+60%剪枝 | 96.7 | 98.3 | 8.5 | 3.4 |
模型 | C2f-Faster | SlimNeck | MPDIoU | 60%剪枝 | P/% | mAP/% | GFLOPs | FPS/(frame·s-1) |
---|---|---|---|---|---|---|---|---|
YOLOv8s | 95.7 | 97.1 | 28.4 | 422 | ||||
A | √ | 95.2 | 97.2 | 24.2 | 437 | |||
B | √ | 95.5 | 97.3 | 25.6 | 430 | |||
C | √ | 95.8 | 97.5 | 28.4 | 420 | |||
D | √ | √ | 95.1 | 97.9 | 21.4 | 447 | ||
E | √ | √ | √ | 97.3 | 98.4 | 21.4 | 446 | |
F | √ | √ | √ | √ | 96.7 | 98.3 | 8.5 | 633 |
表3 消融实验结果
Tab. 3 Ablation experimental results
模型 | C2f-Faster | SlimNeck | MPDIoU | 60%剪枝 | P/% | mAP/% | GFLOPs | FPS/(frame·s-1) |
---|---|---|---|---|---|---|---|---|
YOLOv8s | 95.7 | 97.1 | 28.4 | 422 | ||||
A | √ | 95.2 | 97.2 | 24.2 | 437 | |||
B | √ | 95.5 | 97.3 | 25.6 | 430 | |||
C | √ | 95.8 | 97.5 | 28.4 | 420 | |||
D | √ | √ | 95.1 | 97.9 | 21.4 | 447 | ||
E | √ | √ | √ | 97.3 | 98.4 | 21.4 | 446 | |
F | √ | √ | √ | √ | 96.7 | 98.3 | 8.5 | 633 |
模型 | 剪枝率/% | 模型大小/MB | FPS/(frame·s-1) | |
---|---|---|---|---|
.onnx | .om | |||
YOLOv8s | 0 | 42.6 | 22.3 | 46.90 |
YOLOv8-Embedded | 0 | 31.4 | 17.7 | 50.90 |
30 | 18.2 | 12.2 | 47.63 | |
40 | 14.0 | 10.2 | 49.54 | |
50 | 12.4 | 9.3 | 54.38 | |
60 | 9.7 | 7.9 | 58.03 |
表4 模型部署到嵌入式设备后的性能
Tab. 4 Model performance after deployment to embedded device
模型 | 剪枝率/% | 模型大小/MB | FPS/(frame·s-1) | |
---|---|---|---|---|
.onnx | .om | |||
YOLOv8s | 0 | 42.6 | 22.3 | 46.90 |
YOLOv8-Embedded | 0 | 31.4 | 17.7 | 50.90 |
30 | 18.2 | 12.2 | 47.63 | |
40 | 14.0 | 10.2 | 49.54 | |
50 | 12.4 | 9.3 | 54.38 | |
60 | 9.7 | 7.9 | 58.03 |
1 | 李炳萱. 面向路侧感知的车辆与行人检测及跟踪算法研究[D]. 北京:北京交通大学, 2023: 1-2. |
LI B X. Research on vehicle and pedestrian detection and tracking algorithms for roadside sensing[D]. Beijing: Beijing Jiaotong University, 2023: 1-2. | |
2 | 周庆,任明武. 一种基于YOLOX改进的路侧目标检测方法[J]. 计算机与数字工程, 2023, 51(10): 2323-2329. |
ZHOU Q, REN M W. An improved roadside object detection method based on YOLOX[J]. Computer and Digital Engineering, 2023, 51(10): 2323-2329. | |
3 | REDMON J, DIVVALA S K, GIRSHICK R, et al. You only look once: unified, real-time object detection[C]// Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2016: 779-788. |
4 | 刘子洋,徐慧英,朱信忠,等. Bi-YOLO:一种基于YOLOv8n改进的轻量化目标检测算法[J]. 计算机工程与科学, 2024, 46(8): 1444-1454. |
LIU Z Y, XU H Y, ZHU X Z, et al. Bi-YOLO: an improved lightweight object detection algorithm based on YOLOv8n[J]. Computer Engineering and Science, 2024, 46(8): 1444-1454. | |
5 | 杨睿宁,惠飞,金鑫,等. 改进YOLOv5s的复杂交通场景路侧目标检测算法[J]. 计算机工程与应用, 2023, 59(16): 159-169. |
YANG R N, HUI F, JIN X, et al. Roadside target detection algorithm for complex traffic scene based on improved YOLOv5s[J]. Computer Engineering and Applications, 2023, 59(16): 159-169. | |
6 | ZHANG Y F, REN W, ZHANG Z, et al. Focal and efficient IOU loss for accurate bounding box regression[J]. Neurocomputing, 2022, 506: 146-157. |
7 | ZHENG Z, WANG P, LIU W, et al. Distance-IoU loss: faster and better learning for bounding box regression[C]// Proceedings of the 34th 2020 AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2020: 12993-13000. |
8 | 罗江宏,袁梓麒,易志雄. 基于改进的YOLOv5城市道路车辆行人检测方法[J]. 电子制作, 2023, 31(19): 67-72. |
LUO J H, YUAN Z Q, YI Z X. An improved YOLOv5 method for vehicle and pedestrian detection on urban roads[J]. Practical Electronics, 2023, 31(19): 67-72. | |
9 | HUANG L, HUANG W, GONG H, et al. PEFNet: position enhancement faster network for object detection in roadside perception system[J]. IEEE Access, 2023, 11: 73007-73023. |
10 | CHEN J, KAO S H, HE H, et al. Run, don’t walk: chasing higher FLOPS for faster neural networks[C]// Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2023:12021-12031. |
11 | LI H, LI J, WEI H, et al. Slim-neck by GSConv: a better design paradigm of detector architectures for autonomous vehicles[J]. Journal of Real-Time Image Processing, 2024, 21: No.62. |
12 | MA S, XU Y. MPDIoU: a loss for efficient and accurate bounding box regression[EB/OL]. [2024-07-14]. . |
13 | ZHU C, HE Y, SAVVIDES M. Feature selective anchor-free module for single-shot object detection[C]// Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2019:840-849. |
14 | MITICHE I, MORISON G, NESBITT A, et al. Classification of partial discharge signals by combining adaptive local iterative filtering and entropy features[J]. Sensors, 2018, 18(2): No.406. |
15 | ZHANG X, ZHOU X, LIN M, et al. ShuffleNet: an extremely efficient convolutional neural network for mobile devices[C]// Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2018: 6848-6856. |
16 | HAN K, WANG Y, TIAN Q, et al. GhostNet: more features from cheap operations[C]// Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2020: 1577-1586. |
17 | LIU Z, LI J, SHEN Z, et al. Learning efficient convolutional networks through network slimming[C]// Proceedings of the 2017 IEEE International Conference on Computer Vision. Piscataway: IEEE, 2017: 2755-2763. |
18 | WU D, LV S, JIANG M, et al. Using channel pruning-based YOLO v4 deep learning algorithm for the real-time and accurate detection of apple flowers in natural environments[J]. Computers and Electronics in Agriculture, 2020, 178: No.105742. |
19 | WANG D, HE D. Channel pruned YOLO V5s-based deep learning approach for rapid and accurate apple fruitlet detection before fruit thinning[J]. Biosystems Engineering, 2021, 210: 271-281. |
20 | FANG G, MA X, SONG M, et al. DepGraph: towards any structural pruning[C]// Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2023: 16091-16101. |
21 | CHEN X, ZHU J, JIANG J, et al. Tight compression: compressing CNN model tightly through unstructured pruning and simulated annealing based permutation[C]// Proceedings of the 57th ACM/EDAC/IEEE Design Automation Conference. Piscataway: IEEE, 2020: No.243. |
22 | SITU Z, TENG S, LIAO X, et al. Real-time sewer defect detection based on YOLO network, transfer learning, and channel pruning algorithm[J]. Journal of Civil Structural Health Monitoring, 2024, 14(1): 41-57. |
23 | 许兴时,王云飞,华志新,等. 融合YOLOv5s与通道剪枝算法的奶牛轻量化个体识别方法(英文)[J]. 农业工程学报, 2023, 39(15): 152-162. |
XU X S, WANG Y F, HUA Z X, et al. Light-weight recognition network for dairy cows based on the fusion of YOLOv5s and channel pruning algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering, 2023, 39(15): 152-162. | |
24 | YANG F. An improved YOLO v3 algorithm for remote Sensing image target detection[J]. Journal of Physics: Conference Series, 2021, 2132: No.012028. |
25 | LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multiBox detector[C]// Proceedings of the 2016 European Conference on Computer Vision, LNCS 9905. Cham: Springer, 2016: 21-37. |
26 | REN S, HE K, GIRSHICK R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149. |
27 | BOCHKOVSKIY A, WANG C, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection[EB/OL]. [2024-04-23].. |
28 | WANG C Y, BOCHKOVSKIY A, LIAO H Y M. YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]// Proceedings of the 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE, 2023: 7464-7475. |
29 | CAI Y, ZHOU Y, HAN Q, et al. Reversible column networks[EB/OL]. [2024-02-01]. . |
[1] | 余松森, 林智凡, 薛国鹏, 徐建宇. 基于改进YOLOv8的轻量级大幅面瓷砖缺陷检测算法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 647-654. |
[2] | 桂佳扬, 王顺吉, 周正康, 唐加山. 基于改进YOLOv8n的隧道内异物检测算法[J]. 《计算机应用》唯一官方网站, 2025, 45(2): 655-661. |
[3] | 李钟华, 白云起, 王雪津, 黄雷雷, 林初俊, 廖诗宇. 基于图像增强的低照度人脸检测[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2588-2594. |
[4] | 邓凯丽, 魏伟波, 潘振宽. 改进掩码自编码器的工业缺陷检测方法[J]. 《计算机应用》唯一官方网站, 2024, 44(8): 2595-2603. |
[5] | 孔哲, 李寒, 甘少伟, 孔明茹, 何冰涛, 郭子钰, 金督程, 邱兆文. 基于非对称多解码器和注意力模块的三维肾脏影像结构分割模型[J]. 《计算机应用》唯一官方网站, 2024, 44(7): 2216-2224. |
[6] | 程小辉, 黄云天, 张瑞芳. 基于多尺度和加权坐标注意力的轻量化红外道路场景检测模型[J]. 《计算机应用》唯一官方网站, 2024, 44(6): 1927-1934. |
[7] | 耿焕同, 刘振宇, 蒋骏, 范子辰, 李嘉兴. 基于改进YOLOv8的嵌入式道路裂缝检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(5): 1613-1618. |
[8] | 张俊娜, 王欣新, 李天泽, 赵晓焱, 袁培燕. 基于动态服务缓存辅助的任务卸载方法[J]. 《计算机应用》唯一官方网站, 2024, 44(5): 1493-1500. |
[9] | 赵晓焱, 韩威, 张俊娜, 袁培燕. 基于异步深度强化学习的车联网协作卸载策略[J]. 《计算机应用》唯一官方网站, 2024, 44(5): 1501-1510. |
[10] | 李威, 陈玲, 徐修远, 朱敏, 郭际香, 周凯, 牛颢, 张煜宸, 易珊烨, 章毅, 罗凤鸣. 基于多任务学习的间质性肺病分割算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1285-1293. |
[11] | 陈天华, 朱家煊, 印杰. 基于注意力机制的鸟类识别算法[J]. 《计算机应用》唯一官方网站, 2024, 44(4): 1114-1120. |
[12] | 张明, 付乐, 王海峰. 面向边缘计算的并发数据流接转控制模型[J]. 《计算机应用》唯一官方网站, 2024, 44(12): 3876-3883. |
[13] | 李大海, 李冰涛, 王振东. 基于改进YOLOv8的水下目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3610-3616. |
[14] | 刘涛, 鞠事宏, 高一萌. 基于改进YOLOv8n的无人机视角下小目标检测算法[J]. 《计算机应用》唯一官方网站, 2024, 44(11): 3603-3609. |
[15] | 赵徐炎, 崔允贺, 蒋朝惠, 钱清, 申国伟, 郭春, 李显超. CHAIN:基于重合支配的边缘计算节点放置算法[J]. 《计算机应用》唯一官方网站, 2023, 43(9): 2812-2818. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||