Journal of Shanghai University(Natural Science Edition) ›› 0, Vol. ›› Issue (): 94-105.doi: 10.12066/j.issn.1007-2861.2411

Previous Articles     Next Articles

Lightweight traffic-light detection algorithm based on improved YOLOv5s

CAI Guanhong1, LI Guoping1, WANG Guozhong1, TENG Guowei2   

  1. 1. School of Electronic and Electrical Engineering, Shanghai University of Engineering Science, Shanghai 201620, China; 2. School of Communication and Information Engineering, Shanghai University, Shanghai 200444, China
  • Received:2022-03-15 Published:2024-02-28
  • Supported by:
    国家重点研发计划资助项目 (2019YFB1802700)

Abstract: A lightweight traffic-light detection algorithm based on improved YOLOv5s is proposed to solve the issue of numerous network model parameters and poor real-time performance of current traffic-light detection algorithms. First, a lightweight network, Mo- bileNetv3, is used to replace the original backbone network, and the attention mechanism is introduced to reduce the number of model parameters on the premise of minimal impact on detection accuracy. Next, the depth separable convolution is used to replace the traditional standard convolution in the neck network to further reduce the number of model parameters. Subsequently, the detection layer for detecting large targets is deleted based on the small scale of traffic lights. Finally, the frame regression loss function is improved to improve the frame detection accuracy. The network is pruned to compress and accelerate the model to be deployed on the embedded platform in real time. The experimental results show that the proposed algorithm can achieve a detection speed of 48.1 frame/s on the embedded platform NVIDIA Jetson Xavier NX, which sacrifices 1.5% mAP compared with the original YOLOv5s. However, the model size is compressed by 54.3%, and the detection speed is increased by 2.6 times, which can satisfy the needs of real-time traffic-light detection on traffic roads.

Key words: traffic-light detection, lightweight model, YOLOv5s, MobileNetv3, channel pruning

CLC Number: