Abstract
Accurate recognition of traffic lights is essential for ensuring the safety of passengers and pedestrians, especially in the context of self-driving car technology. However, traffic lights present challenges due to their small size and limited recognition accuracy. This paper proposes an enhanced version of the YOLOv5l algorithm specifically designed for traffic light recognition. First, the K-means++ clustering algorithm is employed to generate the prior frame. Second, the SiLU activation function in the basic convolution module is replaced with the adaptive Meta-ACONC activation function, significantly improving the model’s detection accuracy. Third, the coordinate attention mechanism is integrated into the trunk feature extraction network to incorporate coordinate information into the channel, thereby enhancing the network’s sensitivity to small target positions and mitigating the ambiguity caused by increased network depth. Finally, the network’s detection scale is improved by removing the original 20 × 20 large target detection head, leading to an improved accuracy and speed for detecting small targets. The proposed approach is evaluated on self-created traffic light datasets, and compared with the original YOLOv5l model; the improved YOLOv5l model achieves a 7.1% increase in mAP@0.5, reaching 83.3%, effectively meeting the requirements for traffic light detection and recognition.
摘要
准确识别交通信号灯对于确保乘客和行人的安全至关重要, 尤其在自动驾驶领域。然而交通信号灯属于小目标, 识别难度大, 识别精度低。针对此问题, 本文提出了一种改进YOLOv5l的交通信号灯识别方法。首先, 引入K-means++聚类算法生成先验框。其次, 将基础卷积模块中的SiLU激活函数替换成自适应激活函数Meta-ACONC, 有效提升了模型的检测精度。然后, 在主干特征提取网络中加入坐标注意力机制, 使坐标信息融入通道之中, 防止随着网络深度的增加而使位置信息越来越模糊, 提升网络对小目标位置信息的敏感度。最后, 对网络检测尺度进行改进, 删除原始20×20的大目标检测头, 提升小目标的检测精度和识别速度。本文所提出的方法在自制的交通信号灯数据集上进行了实验, 改进后的YOLOv5l模型相比于原始YOLOv5l模型, mAP@0.5提高了7.1%, 达到了83.3%, 有效满足了交通信号灯检测和识别的要求。
Similar content being viewed by others
References
JIN T, WANG C X, WANG B, et al. Traffic lights recognition based on concatenated filtering method [J]. Journal of Shanghai Jiaotong University, 2012, 46(9): 1355–1360 (in Chinese).
GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]//2014 IEEE Conference on Computer Vision and Pattern Recognition. Columbus: IEEE, 2014: 580–587.
GIRSHICK R. Fast R-CNN [C]//2015 IEEE International Conference on Computer Vision. Santiago: IEEE, 2015: 1440–1448.
REN S Q, HE K M, GIRSHICK R, et al. Faster RCNN: Towards real-time object detection with region proposal networks [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137–1149.
REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: Unified, real-time object detection [C]//2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 779–788.
REDMON J, FARHADI A. YOLO9000: better, faster, stronger [C]//2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu: IEEE, 2017: 6517–6525.
REDMON J, FARHADI A. YOLOv3: An incremental improvement [DB/OL]. (2018-04-08). https://arxiv.org/abs/1804.02767
BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: Optimal speed and accuracy of object detection [DB/OL]. (2020-04-23). http://arxiv.org/abs/2004.10934
LIN T Y, GOYAL P, GIRSHICK R, et al. Focal loss for dense object detection [J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(2): 318–327.
LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot MultiBox detector [M]//Computer vision - ECCV 2016. Cham: Springer, 2016: 21–37.
LI D P, RENX M, YAN NN. Real-time detection of insulator drop string based on UAV aerial photography [J]. Journal of Shanghai Jiao Tong University, 2022, 56(8): 994–1003 (in Chinese).
MAO T. Traffic signal detection algorithm based on YOLO [J]. Digital Technology & Application, 2021, 39(6): 97–99 (in Chinese).
Guo H X. Object detection in traffic scene based on deep learning [D]. Xuzhou: China University of Mining and Technology, 2021 (in Chinese).
DENG T M, TAN S Q, PU L Z. Traffic light recognition method based on improved YOLOv5s[J]. Computer Engineering, 2022, 48(9): 55–62 (in Chinese).
ZHU K, CHEN C F. Traffic sign recognition under fog weather based on YOLOv5 [J]. Electronic Measurement Technology, 2023, 46(8): 31–37 (in Chinese).
LI W, ZHANG G, CUI L, et al. Lightweight traffic sign recognition model based on coordinate attention [J]. Journal of Computer Applications, 2023, 43(2): 608–614 (in Chinese).
HU J P, WANG H S, DAI X B, et al. Real-time detection algorithm for small-target traffic signs based on improved YOLOv5 [J]. Computer Engineering and Applications, 2023, 59(2): 185–193 (in Chinese).
QIAN W, WANG G Z, LI G P. Improved YOLOv5 traffic light real-time detection robust algorithm [J]. Journal of Frontiers of Computer Science & Technologyy, 2022, 16(1): 231–241 (in Chinese).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of Interest The authors declare that they have no potential conflict of interest.
Additional information
Foundation item: the Science and Technology Development Project of Jilin Province (No. YDZJ202201ZYTS555), and the Science & Technology Research Project of the Education Department of Jilin Province (No. JJKH20220244KJ)
Rights and permissions
About this article
Cite this article
Dong, R., Shi, C. Traffic Light Recognition Based on Improved YOLOv5l. J. Shanghai Jiaotong Univ. (Sci.) (2024). https://doi.org/10.1007/s12204-024-2712-5
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s12204-024-2712-5