Road vehicle detection method based on improved YOLO v3 model and deep-SORT algorithm
-
摘要: 针对道路车辆实时检测遮挡严重与小目标车辆漏检率高的问题,提出了基于改进YOLO v3模型和Deep-SORT算法的车辆检测方法;为提高模型对道路车辆的检测能力,采用K-means++聚类算法对目标候选框进行聚类分析,选择合适的Anchor box数量,并在网络浅层增加了特征提取层,可提取到更精细的车辆特征;为加强网络对远近不同目标的鲁棒性,在保留原YOLO v3模型输出层的同时,增加了一层输出层,将52像素×52像素输出特征图经过上采样后得到104像素×104像素特征图,并将其与浅层同尺寸特征图进行拼接,实现车辆目标的检测;为了降低目标遮挡对检测效果的影响,提高对视频上下帧之间关联信息的关注度,将改进YOLO v3模型和Deep-SORT算法相结合,以此来弥补两者之间的不足。试验结果表明:改进YOLO v3模型有效地提高了车辆检测的性能,与在网络浅层增加特征提取层的模型相比,平均精度提高了1.4%,与增加一层输出层的模型相比,平均精确度提高了0.8%,说明改进YOLO v3模型提取的特征表达能力更强,增强了网络对小目标的检测能力;改进YOLO v3模型在引入Deep-SORT算法后,查准率和召回率分别达到90.16%和91.34%,相比改进YOLO v3模型,查准率和召回率分别提高了1.48%和4.20%,同时保证了检测速度,对于不同大小目标的检测具有良好的鲁棒性。
-
关键词:
- 交通图像识别 /
- 卷积神经网络 /
- 车辆检测 /
- YOLO v3模型 /
- Deep-SORT算法 /
- K-means++聚类算法
Abstract: A vehicle detection method based on the improved YOLO v3 model and deep-SORT algorithm was proposed to address the problems of serious occlusion and high misdetection rate of small target vehicles in the real-time detection of road vehicles. To improve the detection ability of the model for road vehicle, the K-means++ clustering algorithm was used to cluster the target candidate boxes, the appropriate number of anchor boxes was selected, and a feature extraction layer to the shallow layer of the network was added to extract more refined vehicle features. The robustness of the network for different distant targets was enhanced by retaining the original YOLO v3 model's output layer but adding another layer to it. After the 52 pixel×52 pixel output feature map was upsampled, a 104 pixel×104 pixel feature map was obtained, which was spliced with a shallow layer feature map of the same size to achieve the vehicle target detection. To reduce the influence of target occlusion on the detection and improve the attention to the association information between the upper and lower frames of the video, the YOLO v3 model was improved and combined with the deep-SORT algorithm to compensate for their shortcomings. Experimental results show that the improved YOLO v3 model can enhance the vehicle detection performance. Compared with the model adding feature extraction layer in the shallow layer of the network, the average accuracy improves by 1.4%, and compared with the model adding one output layer, the average accuracy improves by 0.8%. It indicates that the improved YOLO v3 model has a stronger feature expression ability and enhances the network's ability to detect small targets. After the deep-SORT algorithm is introduced into the improved YOLO v3 model, the precision and recall are 90.16% and 91.34%, respectively. Compared with the improved YOLO v3 model, the precision and recall increase by 1.48% and 4.20%, respectively. At the same time, the detection speed is maintained, and the detection of different-sized targets is highly robust. 4 tabs, 5 figs, 32 refs. -
表 1 网络训练参数设置
Table 1. Network training parameter settings
名称 参数 训练样本数量 32 权重衰减系数 0.000 5 学习速率变化因子 0.9 模型最大迭代次数 30 000 初始学习率 0.001 表 2 改进YOLO v3模型与YOLO v3模型性能比较
Table 2. Performance comparison between improved YOLO v3 and YOLO v3 model
模型 平均精确度/% 每秒检测帧数 YOLO v3 82.7 39 对比模型1 84.1 33 对比模型2 83.5 36 改进YOLO v3 85.4 32 表 3 检测方法性能比较
Table 3. Performance comparison of detection methods
方法 实际车辆数 正确检测数量 误检数量 漏检数量 p/% r/% 改进YOLO v3模型 163 142 18 21 88.68 87.14 改进YOLO v3模型+Deep-SORT算法 163 149 16 14 90.16 91.34 -
[1] KACHACH R, CAÑAS J M. Hybrid three-dimensional and support vector machine approach for automatic vehicle tracking and classification using a single camera[J]. Journal of Electronic Imaging, 2016, 25(3): 033021. doi: 10.1117/1.JEI.25.3.033021 [2] DANELLJAN M, HAGER G, KHAN F, et al. Discriminative scale space tracking[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(8): 1561-1575. doi: 10.1109/TPAMI.2016.2609928 [3] WEI Yun, TIAN Qing, GUO Jian-hua, et al. Multi-vehicle detection algorithm through combining Harr and HOG features[J]. Mathematics and Computers in Simulation, 2019, 155: 130-145. doi: 10.1016/j.matcom.2017.12.011 [4] 杨娟, 曹浩宇, 汪荣贵, 等. 基于语义DCNN特征融合的细粒度车型识别模型[J]. 计算机辅助设计与图形学学报, 2019, 31(1): 141-157. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201901018.htmYANG Juan, CAO Hao-yu, WANG Rong-gui, et al. Fine-grained car recognition model based on semantic DCNN features fusion[J]. Journal of Computer-Aided Design and Computer Graphics, 2019, 31(1): 141-157. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201901018.htm [5] 余烨, 傅云翔, 杨昌东, 等. 基于FR-ResNet的车辆型号精细识别研究[J/OL]. 自动化学报, (2019-04-03)[2020-12-22]. DOI: 10.16383/j.aas.c180539.YU Ye, FU Yun-xiang, YANG Chang-dong, et al. Fine-grained car model recognition based on FR-ResNet[J/OL]. Acta Automatica Sinica, (2019-04-03)[2020-12-22]. DOI: 10.16383/j.aas.c180539.(in Chinese) [6] 凌艳, 陈莹. 多尺度上下文信息增强的显著目标检测全卷积网络[J]. 计算机辅助设计与图形学学报, 2019, 31(11): 2007- 2016. https://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201911015.htmLING Yan, CHEN Ying. Salient object detection with multiscale context enhanced fully convolution network[J]. Journal of Computer-Aided Design and Computer Graphics, 2019, 31(11): 2007-2016. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JSJF201911015.htm [7] 鞠默然, 罗海波, 王仲博, 等. 改进的YOLO v3算法及其在小目标检测中的应用[J]. 光学学报, 2019, 39(7): 253-260. https://www.cnki.com.cn/Article/CJFDTOTAL-GXXB201907028.htmJU Mo-ran, LUO Hai-bo, WANG Zhong-bo, et al. Improved YOLO v3 algorithm and its application in small target detection[J]. Acta Optica Sinica, 2019, 39(7): 253-260. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-GXXB201907028.htm [8] LI Su-hao, LIN Jin-zhao, LI Guo-quan, et al. Vehicle type detection based on deep learning in traffic scene[J]. Procedia Computer Science, 2018, 131: 564-572. doi: 10.1016/j.procs.2018.04.281 [9] 曹磊, 王强, 史润佳, 等. 基于改进RPN的Faster-RCNN网络SAR图像车辆目标检测方法[J]. 东南大学学报(自然科学版), 2021, 51(1): 87-91.CAO Lei, WANG Qiang, SHI Run-jia, et al. Method for vehicle target detection on SAR image based on improved RPN in Faster-RCNN[J]. Journal of Southeast University (Natural Science Edition), 2021, 51(1): 87-91. (in Chinese) [10] 李琳辉, 伦智梅, 连静, 等. 基于卷积神经网络的道路车辆检测方法[J]. 吉林大学学报(工学版), 2017, 47(2): 384-391. https://www.cnki.com.cn/Article/CJFDTOTAL-JLGY201702006.htmLI Lin-hui, LUN Zhi-mei, LIAN Jing, et al. Convolution neural network-based vehicle detection method[J]. Journal of Jilin University (Engineering and Technology Edition), 2017, 47(2): 384-391. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-JLGY201702006.htm [11] LEE W J, DONG S P, DONG W K, et al. A vehicle detection using selective multi-stage features in convolutional neural networks[C]//IEEE. 17th International Conference on Control, Automation and Systems. New York: IEEE, 2017: 1-3. [12] ALIREZA A, LUIS G, CRISTIANO P, et al. Multimodal vehicle detection: fusing 3D-LIDAR and color camera data[J]. Pattern Recognition Letters, 2018, 115: 20-29. doi: 10.1016/j.patrec.2017.09.038 [13] DAI Xue-rui. HybridNet: a fast vehicle detection system for autonomous driving[J]. Signal Processing: Image Communication, 2019, 70: 79-88. doi: 10.1016/j.image.2018.09.002 [14] LUO Ji-qing, FANG Hu-sheng, SHAO Fa-ming, et al. Multi-scale traffic vehicle detection based on faster R-CNN with NAS optimization and feature enrichment[J]. Defence Technology, 2021, DOI: 10.1016/j.dt.2020.10.006. [15] 邹伟, 殷国栋, 刘昊吉, 等. 基于多模态特征融合的自主驾驶车辆低辨识目标检测方法[J/OL]. 中国机械工程, (2020-06-24)[2020-12-22]. https://kns.cnki.net/kcms/detail/42.1294.TH.20200624.1308.008.html.ZOU Wei, YIN Guo-dong, LIU Hao-ji, et al. Low-observable targets detection method for autonomous vehicles based on multi-modal feature fusion[J/OL]. China Mechanical Engineering, (2020-06-24)[2020-12-22]. https://kns.cnki.net/kcms/detail/42.1294.TH.20200624.1308.008.html. (in Chinese) [16] 汪昱东, 郭继昌, 王天保. 一种改进的雾天图像行人和车辆检测算法[J]. 西安电子科技大学学报, 2020, 47(4): 70-77. https://www.cnki.com.cn/Article/CJFDTOTAL-XDKD202004013.htmWANG Yu-dong, GUO Ji-chang, WANG Tian-bao. Algorithm for foggy-image pedestrian and vehicle detection[J]. Journal of Xidian University, 2020, 47(4): 70-77. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-XDKD202004013.htm [17] GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]//IEEE. 27th IEEE Conference on Computer Vision and Pattern Recognition, New York: IEEE, 2014: 580-587. [18] GIRSHICK R. Fast R-CNN[C]//IEEE. 15th IEEE International Conference on Computer Vision, New York: IEEE, 2015: 1440-1448. [19] REN Shao-qing, HE Kai-ming, 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. doi: 10.1109/TPAMI.2016.2577031 [20] REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection[C]//IEEE. 29th IEEE Conference on Computer Vision and Pattern Recognition, New York: IEEE, 2016: 779-788. [21] REDMON J, FARHADI A. YOLO9000: better, faster, stronger[C]//IEEE. 30th IEEE Conference on Computer Vision and Pattern Recognition. New York: IEEE, 2017: 6517-6525. [22] REDMON J, FARHADI A. YOLOv3: an incremental improvement[R]. Ithaca: Cornell University, 2018. [23] LIU WEI, ANGUELOV D, ERHAN D, et al. SSD: single shotmultibox detector[C]//Springer. 14th European Conference on Computer Vision. Berlin: Springer, 2016: 21-37. [24] 周苏, 支雪磊, 林飞滨, 等. 基于车载视频图像的车辆检测与跟踪算法[J]. 同济大学学报(自然科学版), 2019, 47(S1): 191-198. https://www.cnki.com.cn/Article/CJFDTOTAL-TJDZ2019S1036.htmZHOU Su, ZHI Xue-lei, LIN Fei-bin, et al. Research on vehicle detection and tracking algorithm based on onboard video images[J]. Journal of Tongji University (Natural Science Edition), 2019, 47(S1): 191-198. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-TJDZ2019S1036.htm [25] 金立生, 郭柏苍, 王芳荣, 等. 基于改进YOLOv3的车辆前方动态多目标检测算法[J/OL]. 吉林大学学报(工学版), (2020-12-17)[2020-12-22]. https://doi.org/10.13229/j.cnki.jdxbgxb20200588.JIN Li-sheng, GUO Bai-cang, WANG Fang-rong. Dynamic multiple object algorithm for vehicle forward based on improved YOLOv3[J/OL]. Journal of Jilin University (Engineering and Technology Edition), (2020-12-17)[2020-12-22]. https://doi.org/10.13229/j.cnki.jdxbgxb20200588. (in Chinese) [26] 李珣, 刘瑶, 李鹏飞, 等. 基于Darknet框架下YOLO v2算法的车辆多目标检测方法[J]. 交通运输工程学报, 2018, 18(6): 142-158. doi: 10.3969/j.issn.1671-1637.2018.06.015LI Xun, LIU Yao, LI Peng-fei, et al. Vehicle multi-target detection method based on YOLO v2 algorithm under darknet framework[J]. Journal of Traffic and Transportation Engineering, 2018, 18(6): 142-158. (in Chinese) doi: 10.3969/j.issn.1671-1637.2018.06.015 [27] 黎洲, 黄妙华. 基于YOLO_v2模型的车辆实时检测[J]. 中国机械工程, 2018, 29(15): 1869-1874. doi: 10.3969/j.issn.1004-132X.2018.15.015LI Zhou, HUANG Miao-hua. Vehicle detections based on YOLO_v2 in real-time[J]. China Mechanical Engineering, 2018, 29(15): 1869-1874. (in Chinese) doi: 10.3969/j.issn.1004-132X.2018.15.015 [28] 刘军, 后士浩, 张凯, 等. 基于增强Tiny YOLOV3算法的车辆实时检测与跟踪[J]. 农业工程学报, 2019, 35(8): 118-125. https://www.cnki.com.cn/Article/CJFDTOTAL-NYGU201908014.htmLIU Jun, HOU Shi-hao, ZHANG Kai, et al. Real-time vehicle detection and tracking based on enhanced Tiny YOLOV3 algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering, 2019, 35(8): 118-125. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-NYGU201908014.htm [29] SRI J S, ESTHER R P. Little YOLO-SPP: a delicate real-time vehicle detection algorithm[J]. Optik, 2021, 225: 165818. doi: 10.1016/j.ijleo.2020.165818 [30] 柳长源, 王琪, 毕晓君. 多目标小尺度车辆目标检测方法的研究[J/OL]. 控制与决策, (2020-09-03)[2020-12-22]. https://doi.org/10.13195/j.kzyjc.2020.0635.LIU Chang-yuan, WANG Qi, BI Xiao-juan. Research on multi-target and small-scale vehicle target detection method[J/OL]. Control and Decision, (2020-09-03)[2020-12-22]. https://doi.org/10.13195/j.kzyjc.2020.0635. (in Chinese) [31] LIN T Y, MAIRE M, BELONGIE S, et al. Microsoft COCO: common objects in context[C]//Springer. 13th European Conference on Computer Vision, 2014. Berlin: Springer, 2014: 740-755. [32] 王宇宁, 庞智恒, 袁德明. 基于YOLO算法的车辆实时检测[J]. 武汉理工大学学报, 2016, 38(10): 42-46. https://www.cnki.com.cn/Article/CJFDTOTAL-WHGY201610009.htmWANG Yu-ning, PANG Zhi-heng, YUAN De-ming. Vehicle detection based on YOLO in real time[J]. Journal of Wuhan University of Technology, 2016, 38(10): 42-46. (in Chinese) https://www.cnki.com.cn/Article/CJFDTOTAL-WHGY201610009.htm