Enhanced YOLOv5s-Based Algorithm for Industrial Part Detection

Yingjian Fang,Qingxiao Wu,Sicong Li,Jian Guan,Yunge Cui
DOI: https://doi.org/10.3390/s24041183
IF: 3.9
2024-02-12
Sensors
Abstract:In complex industrial environments, accurate recognition and localization of industrial targets are crucial. This study aims to improve the precision and accuracy of object detection in industrial scenarios by effectively fusing feature information at different scales and levels, and introducing edge detection head algorithms and attention mechanisms. We propose an improved YOLOv5-based algorithm for industrial object detection. Our improved algorithm incorporates the Crossing Bidirectional Feature Pyramid (CBiFPN), effectively addressing the information loss issue in multi-scale and multi-level feature fusion. Therefore, our method can enhance detection performance for objects of varying sizes. Concurrently, we have integrated the attention mechanism (C3_CA) into YOLOv5s to augment feature expression capabilities. Furthermore, we introduce the Edge Detection Head (EDH) method, which is adept at tackling detection challenges in scenes with occluded objects and cluttered backgrounds by merging edge information and amplifying it within the features. Experiments conducted on the modified ITODD dataset demonstrate that the original YOLOv5s algorithm achieves 82.11% and 60.98% on mAP@0.5 and mAP@0.5:0.95, respectively, with its precision and recall being 86.8% and 74.75%, respectively. The performance of the modified YOLOv5s algorithm on mAP@0.5 and mAP@0.5:0.95 has been improved by 1.23% and 1.44%, respectively, and the precision and recall have been enhanced by 3.68% and 1.06%, respectively. The results show that our method significantly boosts the accuracy and robustness of industrial target recognition and localization.
engineering, electrical & electronic,chemistry, analytical,instruments & instrumentation
What problem does this paper attempt to address?
The problem that this paper attempts to solve is: **In a complex industrial environment, how to improve the accuracy and robustness of object detection, especially for the recognition and localization of industrial parts**. ### Specific problem background and challenges: 1. **Poor image quality**: Due to the poor lighting conditions in the industrial production environment (such as the low light in the production line or material bin), the obtained image quality is not good. 2. **Object diversity**: Industrial parts have various shapes, which increases the difficulty of accurately identifying them from images. 3. **Large pose changes**: The placement angles of parts in the material bin are different, resulting in different features of the same workpiece in the image. 4. **Lack of texture and color information**: Industrial objects usually lack obvious texture and color information, and these information are the distinguishing features commonly used in traditional object detection methods. 5. **Occlusion and random stacking**: There are random stacking and occlusion phenomena among industrial parts, which further reduces the feature information of the target, reduces the detection accuracy and increases the algorithm complexity. ### Solutions: To meet the above challenges, the paper proposes an improved algorithm based on the YOLOv5s model. The main improvement points include the following aspects: 1. **Introducing CBiFPN (Cross Bidirectional Feature Pyramid)**: - By optimizing the transmission and fusion of low - level and high - level information, it effectively reduces the information loss in multi - scale and multi - level feature fusion. - It improves the detection performance for targets of different sizes. 2. **Integrating C3_CA attention mechanism**: - The channel attention is decomposed into two one - dimensional feature encoding processes, and the features are aggregated along two spatial directions respectively. - The generated direction - aware and position - sensitive attention maps can be complementarily applied to the input feature map, enhancing the focus on industrial targets while ignoring the background information features. 3. **Introducing Edge Detection Head (EDH)**: - By fusing edge information into the features, it enhances the detection ability for occluded targets and cluttered background scenes. - It uses the Sobel operator to extract edge information and generates the final edge probability map through the sigmoid function: \[ G_x=\begin{bmatrix} - 1&0&+1\\ - 2&0&+2\\ - 1&0&+1 \end{bmatrix}*I \] \[ G_y=\begin{bmatrix} - 1&- 2&- 1\\ 0&0&0\\ +1&+2&+1 \end{bmatrix}*I \] \[ G = \sqrt{G_x^2+G_y^2} \] 4. **Adding a large - target detection head**: - In view of the large size characteristics of industrial targets, a large - target detection head with a 10×10 receptive field is added, and four - sized feature maps of 10×10, 20×20, 40×40 and 80×80 are designed to detect extra - large, large, medium and small targets. ### Experimental results: - Tested on the modified ITODD dataset, the performance of the original YOLOv5s algorithm in mAP@0.5 and mAP@0.5:0.95 is 82.11% and 60.98% respectively, and the improved algorithm has increased by 1.23% and 1.44% respectively. - The precision and recall have been increased from 86.8% and 74.75% to 90.48% and 75.81% respectively. ### Summary: The paper solves the multiple challenges faced by object detection in the industrial environment by improving the YOLOv5s model, and significantly improves the accuracy and robustness of industrial target recognition and localization.