# Road Obstacle Detection Method Based on Improved YOLOv5
###### Abstract
Additionally, specialized applications have led to the development of robust obstacle avoidance systems to address emergent hazards [32; 33; 34; 35]. While these algorithmic improvements have yielded promising results, real-world scenarios present obstacles of varying shapes and sizes. As such, proposed algorithms must be adaptable to handle obstacles with significant differences in size. In recent years, with the continuous optimization and updating of single-stage target detection algorithms, these methods have gradually become competitive with two-stage algorithms in terms of detection speed and accuracy. In some application scenarios, single-phase algorithms even outperform two-phase algorithms in terms of efficiency and precision. However, obstacle detection in real-world road environments still faces significant challenges, particularly regarding high accuracy and minimizing missed detection. To address these issues, this paper proposes a YOLOv5-EC3F algorithm aimed at achieving a low false-negative (leakage) detection rate. The algorithm is designed to effectively handle road obstacles with scale variations, thus providing valuable support for road monitoring and warning systems. To achieve this objective, a customized dataset was constructed specifically for road obstacle detection tasks, providing essential data for subsequent algorithm training and evaluation. Through extensive training and testing on this dataset, this study demonstrates the effectiveness and efficiency of the YOLOv5-EC3F algorithm in real-world environments. The results are expected to offer reliable technical support for road safety monitoring and maintenance. The specific improvements made to the YOLOv5 algorithm are as follows:  
1. The attention mechanism module is introduced to enhance feature extraction efficiency and expand the receptive field with the same convolutional kernel. This allows the model to capture subtle texture and edge information, leading to the acquisition of richer target features. 2. An effective multi-scale feature fusion module is added to perform multi-scale feature extraction and fusion on the input feature map. This strengthens the connection between different levels of information and enhances the spatial texture details. 3. The SPPF structure is modified, and the C3 SPPF module is proposed to improve the model's ability to understand contextual information and enhance its multi-scale adaptability. This modification boosts the performance and generalization of the algorithm. The remainder of this manuscript is systematically organized as follows: Section 2 delineates the foundational architecture of the YOLOv5 algorithm. In Section 3, the comprehensive framework of the YOLOv5-EC3F algorithm is elaborated upon, with particular emphasis on the structural intricacies of the EMFF and C3 SPPF modules. Section 4 details the experimental methodology employed, utilizing a proprietary dataset, and presents the corresponding results alongside a comparative analysis with existing methodologies. Finally, Section 5 engages in a critical discussion regarding the outcomes of the study and offers a synthesis of the findings presented in this paper and highlights prospective avenues for future research.