Automotive Parts Defect Detection Based on YOLOv7
Abstract
:1. Introduction
- (1)
- To enhance the detection accuracy of automobile part defects, we propose a new detection network (MEBA-YOLO). This network utilizes a unique fusion and attention mechanism built on YOLOv7.
- (2)
- To achieve exceptional results for detecting defects in automobile parts, we introduce a model incorporating the AlphaIoU loss function. This function significantly increases accuracy for detecting complex and small defects, marking a significant advancement in the field.
- (3)
- Our proposed method offers real-time defect detection on production lines, which aids with the immediate identification of defects in automobile parts. This contribution is crucial for enhancing vehicle safety.
2. Related Work
2.1. Defect Detection
- (1)
- Two-stage networks, represented by Faster R-CNN (Region-CNN) [17];
- (2)
2.2. Feature Fusion Strategy
2.3. Challenges of Defect Detection in Automotive Parts
3. Method
3.1. BiFPN-Based Feature Fusion Network
3.2. Attention Mechanism
3.3. Loss Function
4. Experiments and Results
4.1. Implementation Details
- (1)
- Training strategy: The experimental environment utilizes PyTorch 1.91+CPU as the software framework, with Python 3.8 as the programming language. The model training hardware environment includes a GPU model NVIDIA GeForce RTX 3070 with 8 GB memory, and CUDA version 11.1 is utilized to accelerate model training.
- (2)
- Evaluation: In this experiment, precision (P), recall (R), average precision (), mean average precision (), and frames per second () are primarily selected as the evaluation indexes. The formulas for P, R, , and are as follows:
4.2. Datasets
4.3. Ablation Study
4.3.1. Impact of Attention Mechanisms
4.3.2. Effect of Loss Function Hyperparameters
4.3.3. Ablation Experiments with Different Modules
4.3.4. Comparison of Detection Effects
4.3.5. Comparison and Generalization Experiments
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Minaee, S.; Boykov, Y.; Porikli, F.; Plaza, A.; Kehtarnavaz, N.; Terzopoulos, D. Image segmentation using deep learning: A survey. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 3523–3542. [Google Scholar] [CrossRef]
- Yan, H.; Cai, J.-F.; Zhao, Y.; Jiang, Z.; Zhang, Y.; Ren, H.; Zhang, Y.; Li, H.; Long, Y. A lightweight high-resolution algorithm based on deep learning for layer-wise defect detection in laser powder bed fusion. Meas. Sci. Technol. 2023, 35, 025604. [Google Scholar] [CrossRef]
- Li, Z.; Zhang, Y.; Fu, X.; Wang, C. Metal surface defect detection based on improved yolov5. In Proceedings of the 2023 3rd International Symposium on Computer Technology and Information Science (ISCTIS), Chengdu, China, 16–18 June 2023; pp. 1147–1150. [Google Scholar]
- Kumar, A. Computer-vision-based fabric defect detection: A survey. IEEE Trans. Ind. Electron. 2008, 55, 348–363. [Google Scholar] [CrossRef]
- Kim, K.J.; Lee, J.-W. Light-weight design and structure analysis of automotive wheel carrier by using finite element analysis. Int. J. Precis. Eng. Manuf. 2022, 23, 79–85. [Google Scholar] [CrossRef]
- Xu, J.; Xi, N.; Zhang, C.; Shi, Q.; Gregory, J. Real-time 3d shape inspection system of automotive parts based on structured light pattern. Opt. Laser Technol. 2011, 43, 1–8. [Google Scholar] [CrossRef]
- Ho, C.-C.; Hernandez, M.A.B.; Chen, Y.-F.; Lin, C.-J.; Chen, C.-S. Deep residual neural network-based defect detection on complex backgrounds. IEEE Trans. Instrum. Meas. 2022, 71, 5005210. [Google Scholar] [CrossRef]
- Yu, X.; Lyu, W.; Wang, C.; Guo, Q.; Zhou, D.; Xu, W. Progressive refined redistribution pyramid network for defect detection in complex scenarios. Knowl.-Based Syst. 2023, 260, 110176. [Google Scholar] [CrossRef]
- Yang, L.; Fan, J.; Huo, B.; Li, E.; Liu, Y. A nondestructive automatic defect detection method with pixelwise segmentation. Knowl.-Based Syst. 2022, 242, 108338. [Google Scholar] [CrossRef]
- Zou, X.; Zhao, J.; Li, Y.; Holmes, M. In-line detection of apple defects using three color cameras system. Comput. Electron. Agric. 2010, 70, 129–134. [Google Scholar]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 24–27 June 2014; pp. 580–587. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NE, USA, 26 June–1 July 2016; pp. 779–788. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part I 14. Springer: Cham, Switzerland, 2016; pp. 21–37. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolo9000: Better, faster, stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.-Y.; Liao, H.-Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 1137–1149. [Google Scholar] [CrossRef] [PubMed]
- Cha, Y.-J.; Choi, W.; Suh, G.; Mahmoudkhani, S.; Büyüköztürk, O. Autonomous structural visual inspection using region-based deep learning for detecting multiple damage types. Comput.-Aided Civ. Infrastruct. Eng. 2018, 33, 731–747. [Google Scholar] [CrossRef]
- Tao, X.; Zhang, D.; Wang, Z.; Liu, X.; Zhang, H.; Xu, D. Detection of power line insulator defects using aerial images analyzed with convolutional neural networks. IEEE Trans. Syst. Man Cybern. Syst. 2018, 50, 1486–1498. [Google Scholar] [CrossRef]
- He, Y.; Song, K.; Meng, Q.; Yan, Y. An end-to-end steel surface defect detection approach via fusing multiple hierarchical features. IEEE Trans. Instrum. Meas. 2019, 69, 1493–1504. [Google Scholar] [CrossRef]
- Cheng, J.C.; Wang, M. Automated detection of sewer pipe defects in closed-circuit television images using deep learning techniques. Autom. Constr. 2018, 95, 155–171. [Google Scholar] [CrossRef]
- Lei, H.; Wang, B.; Wu, H.; Wang, A. Defect detection for polymeric polarizer based on faster r-cnn. J. Inf. Hiding Multim. Signal Process. 2018, 9, 1414–1420. [Google Scholar]
- Zhao, Z.; Zhen, Z.; Zhang, L.; Qi, Y.; Kong, Y.; Zhang, K. Insulator detection method in inspection image based on improved faster r-cnn. Energies 2019, 12, 1204. [Google Scholar] [CrossRef]
- Neuhauser, F.M.; Bachmann, G.; Hora, P. Surface defect classification and detection on extruded aluminum profiles using convolutional neural networks. Int. J. Mater. Form. 2020, 13, 591–603. [Google Scholar] [CrossRef]
- Sun, X.; Gu, J.; Huang, R.; Zou, R.; Palomares, B.G. Surface defects recognition of wheel hub based on improved faster r-cnn. Electronics 2019, 8, 481. [Google Scholar] [CrossRef]
- Chen, J.; Liu, Z.; Wang, H.; Núñez, A.; Han, Z. Automatic defect detection of fasteners on the catenary support device using deep convolutional neural network. IEEE Trans. Instrum. Meas. 2017, 67, 257–269. [Google Scholar] [CrossRef]
- Li, Y.; Huang, H.; Xie, Q.; Yao, L.; Chen, Q. Research on a surface defect detection algorithm based on mobilenet-ssd. Appl. Sci. 2018, 8, 1678. [Google Scholar] [CrossRef]
- Zhang, C.; Chang, C.-C.; Jamshidi, M. Concrete bridge surface damage detection using a single-stage detector. Comput.-Aided Civ. Infrastruct. Eng. 2020, 35, 389–409. [Google Scholar] [CrossRef]
- Zheng, Q.; Wang, L.; Wang, F. Small object detection in traffic scene based on improved convolutional neural network. Comput. Eng. 2020, 46, 26–33. [Google Scholar]
- Ju, M.; Luo, J.; Wang, Z.; Luo, H. Multi-scale target detection algorithm based on attention mechanism. Acta Opt. Sin. 2020, 466, 132–140. [Google Scholar]
- Cui, Z.; Qin, Y.; Zhong, Y.; Cao, Z.; Yang, H. Target Detection in High-Resolution Sar Image via Iterating Outliers and Recursing Saliency Depth. Remote Sens. 2021, 13, 4315. [Google Scholar] [CrossRef]
- Liu, J.; Jia, R.; Li, W.; Ma, F.; Abdullah, H.M.; Ma, H.; Mohamed, M.A. High precision detection algorithm based on improved retinanet for defect recognition of transmission lines. Energy Rep. 2020, 6, 2430–2440. [Google Scholar] [CrossRef]
- Liu, J.; Liang, H.; Cui, X.; Zhong, M.; Li, C. SSD visual target detector based on feature integration and feature enhancement. J. Comput. Eng. Appl. 2022, 58, 150–159. [Google Scholar] [CrossRef]
- Li, Z.; Zhou, F. Fssd: Feature fusion single shot multibox detector. arXiv 2017, arXiv:1712.00960. [Google Scholar]
- Shi, W.; Bao, S.; Tan, D. Ffessd: An accurate and efficient single-shot detector for target detection. Appl. Sci. 2019, 9, 4276. [Google Scholar] [CrossRef]
- Zhao, P.; Xie, L.; Peng, L. Deep small object detection algorithm integrating attention mechanism. J. Front. Comput. Sci. Technol. 2022, 16, 927–937. [Google Scholar]
- Ren, J.; Ren, R.; Green, M.; Huang, X. Defect detection from X-ray images using a three-stage deep learning algorithm. In Proceedings of the 2019 IEEE Canadian Conference of Electrical and Computer Engineering (CCECE), Edmonton, AB, Canada, 5–8 May 2019; pp. 1–4. [Google Scholar]
- Du, W.; Shen, H.; Fu, J.; Zhang, G.; He, Q. Approaches for improvement of the X-ray image defect detection of automobile casting aluminum parts based on deep learning. NDT E Int. 2019, 107, 102144. [Google Scholar]
- Tsai, D.-M.; Fan, S.-K.S.; Chou, Y.-H. Auto-annotated deep segmentation for surface defect detection. IEEE Trans. Instrum. Meas. 2021, 70, 1–10. [Google Scholar] [CrossRef]
- Shin, S.; Jin, C.; Yu, J.; Rhee, S. Real-time detection of weld defects for automated welding process base on deep neural network. Metals 2020, 10, 389. [Google Scholar] [CrossRef]
- Block, S.B.; da Silva, R.D.; Dorini, L.B.; Minetto, R. Inspection of imprint defects in stamped metal surfaces using deep learning and tracking. IEEE Trans. Ind. Electron. 2020, 68, 4498–4507. [Google Scholar] [CrossRef]
- Chen, X.; Chen, J.; Han, X.; Zhao, C.; Zhang, D.; Zhu, K.; Su, Y. A light-weighted cnn model for wafer structural defect detection. IEEE Access 2020, 8, 24006–24018. [Google Scholar] [CrossRef]
- Huang, S.-C.; Le, T.-H.; Jaw, D.-W. Dsnet: Joint semantic learning for object detection in inclement weather conditions. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 43, 2623–2633. [Google Scholar] [CrossRef]
- He, J.; Erfani, S.; Ma, X.; Bailey, J.; Chi, Y.; Hua, X.-S. Alpha-iou: A family of power intersection over union losses for bounding box regression. Adv. Neural Inf. Process. Syst. 2021, 34, 20230–20242. [Google Scholar]
Method | FPS | GFLPS | Params | ||||||
---|---|---|---|---|---|---|---|---|---|
SE | 88.2 | 94.8 | 88.2 | 99.5 | 94.5 | 93.1 | 16.7 | 103.5 | 36.8 |
SimAM | 90.1 | 92.3 | 89.0 | 98.4 | 96.5 | 93.3 | 38.0 | 103.2 | 36.5 |
ECA | 86.9 | 95.2 | 90.6 | 99.6 | 95.1 | 93.5 | 38.6 | 103.3 | 36.5 |
1 | 85.0 | 94.0 | 84.2 | 99.6 | 95.0 | 91.6 |
2 | 83.5 | 94.5 | 85.8 | 99.6 | 95.6 | 91.8 |
3 | 88.6 | 93.5 | 88.6 | 99.5 | 95.5 | 93.1 |
4 | 84.3 | 94.2 | 83.8 | 99.6 | 95.2 | 91.6 |
Test | Mosaic-9 | BiFPN | ECA | Alpha-CIoU | R | P | FPS | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | 84.7 | 85.2 | 82.3 | 99.5 | 92.1 | 88.7 | 89.8 | 86.1 | 19 | ||||
2 | ✓ | 85.3 | 94.4 | 84.6 | 99.6 | 96.3 | 91.9 | 92.5 | 87.5 | 19 | |||
3 | ✓ | 87.3 | 94.9 | 83.7 | 99.6 | 94.3 | 92.0 | 93.0 | 89.0 | 30 | |||
4 | ✓ | 86.9 | 95.2 | 90.6 | 99.6 | 95.1 | 93.5 | 89.1 | 88.8 | 39 | |||
5 | ✓ | 88.6 | 93.5 | 88.6 | 99.5 | 95.5 | 93.1 | 90.1 | 87.8 | 30 | |||
6 | ✓ | ✓ | 90.2 | 94.8 | 88.0 | 99.6 | 95.1 | 93.6 | 91.0 | 90.3 | 29 | ||
7 | ✓ | ✓ | ✓ | 91.0 | 95.2 | 89.3 | 99.6 | 95.0 | 94.1 | 94.7 | 89.5 | 46 | |
8 | ✓ | ✓ | ✓ | ✓ | 91.1 | 95.5 | 88.5 | 99.6 | 95.4 | 94.2 | 95.7 | 93.0 | 48 |
Method | Precision/% | Recall/% | mAP/% | FPS/s |
---|---|---|---|---|
Faster-RCNN | 63.1 | 65.3 | 67.3 | 18 |
SSD | 62.5 | 60.3 | 62.6 | 26 |
YOLOv4 | 61.5 | 61.6 | 62.4 | 31 |
YOLOv5 | 60.7 | 64.5 | 62.7 | 70 |
YOLOv7 | 68.3 | 65.8 | 68.0 | 48 |
YOLOv8 | 66.1 | 68.3 | 71.7 | 126 |
MBEA-YOLOv7 | 68.8 | 71.5 | 75.5 | 76 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Huang, H.; Zhu, K. Automotive Parts Defect Detection Based on YOLOv7. Electronics 2024, 13, 1817. https://doi.org/10.3390/electronics13101817
Huang H, Zhu K. Automotive Parts Defect Detection Based on YOLOv7. Electronics. 2024; 13(10):1817. https://doi.org/10.3390/electronics13101817
Chicago/Turabian StyleHuang, Hao, and Kai Zhu. 2024. "Automotive Parts Defect Detection Based on YOLOv7" Electronics 13, no. 10: 1817. https://doi.org/10.3390/electronics13101817
APA StyleHuang, H., & Zhu, K. (2024). Automotive Parts Defect Detection Based on YOLOv7. Electronics, 13(10), 1817. https://doi.org/10.3390/electronics13101817