Traffic sign recognition is crucial for assisted driving and autonomous driving technologies,contributing to improved road safety,reduced traffic congestion,and smart city development.This paper aims to address the shortcomings of the existing YOLOv5 s algorithm in traffic sign recognition by improving its feature extraction and multi-scale feature fusion capabilities,thereby enhancing its performance.Firstly,to address the limitations of convolutional neural networks in capturing long-range dependencies and constructing global contexts,attention mechanisms are introduced to improve feature extraction capabilities.Experiments show that on the TT100 K dataset,the algorithm with self-attention mechanisms improves m AP50 and m AP50-95 indices by 1.2% and 1.3%,respectively.Generalization experiments on the SW_TT00K dataset,simulating real environments,demonstrate that the algorithm with attention mechanisms exhibits better robustness across different scenarios.Secondly,to further improve the feature extraction capabilities of the YOLOv5 s algorithm,a multi-head self-attention mechanism is employed to enhance convolution operators,constructing the ACSP module and combining the spatial attention mechanism with the feature pyramid SA-PAN module to improve small traffic sign recognition.Ultimately,on the TT100 K dataset,the improved algorithm achieves 7% and 3.4% increase in m AP50 and m AP50-95 indices,respectively,compared to the YOLOv5 s algorithm.Finally,to meet the real-time requirements of traffic sign recognition and edge device deployment,the algorithm is subject to lightweight improvement.A new unit module,D-Ghost,is designed in combination with depth-wise separable convolution compression and guided by knowledge distillation algorithms.Experimental results show that the new algorithm has nearly the same inference time as the YOLOv5 s algorithm but achieves a 4.6% and 2.1% improvement in m AP50 and m AP50-95 indices on the TT100 K dataset,respectively.In conclusion,the improved algorithm proposed in this paper has significant advantages in traffic sign recognition tasks. |