要解决一个深层次的骨干网问题,一个大模型,移动终端上的推理速度慢,针对小目标检测精度低、交通灯难以实时准确检测识别等问题,提出了一种基于改进YOLOv4的交通灯识别方法。利用轻量级ShuffleNetv2网络代替YOLOv4的CSPDarkNet53网络来满足移动终端的需求。应用改进的k均值聚类算法来生成锚盒,以避免异常值和初始值的敏感性问题。添加了一种名为CS2A的新颖注意力机制,以增强有效特征的提取能力。将多种数据扩充方法结合起来,提高模型的泛化能力。最终,可以实现交通灯的检测和识别。选择S2TLD数据集进行训练和测试,并且可以证明,识别精度和模型尺寸都得到了极大的优化。同时,选择自制的数据集进行训练和测试。与常规YOLOv4算法相比,该算法对交通灯状态信息的识别准确率提高了1.79%,模型尺寸减少了81.97%。选择合适的场景进行实车测试,结果表明,该算法的检测速度提高了16%,与常规YOLOv4相比,对小目标的识别效果提高了37%。
To resolve the issues of a deep backbone network, a large model, slow reasoning speed on a mobile terminal, low detection accuracy for small targets and difficulties detecting and recognizing traffic lights in real time and accurately with YOLOv4, a traffic lights recognition method based on improved YOLOv4 is proposed. The
lightweight ShuffleNetv2 network is utilized to replace the CSPDarkNet53 network of YOLOv4 to satisfy the requirements of a mobile terminal. The reformed k-means clustering algorithm is applied to generate anchor boxes for avoiding the sensitivity issue of outliers and initial values. A novel attention mechanism named CS2A is added to enhance the extraction capability of effective features. Multiple data augmentation methods are combined to improve the generalization ability of the model. Ultimately, the detection and recognition of traffic lights can be realized. The S2TLD dataset is selected for training and testing, and it can be proved that the recognition accuracy and model size are greatly optimized. Meanwhile, a self-made dataset is selected for training and testing. Compared with the conventional YOLOv4, the recognition accuracy of the proposed algorithm for traffic lights\' state information increases by 1.79%, and the model size decreases by 81.97%. Appropriate scenes are selected for real-vehicle testing and the results demonstrate that the detection speed of the presented algorithm increases by 16%, and the recognition effect for small targets increases by 37% in comparison with conventional YOLOv4.