Resistance Spot Welding Defect Detection Based on Visual Inspection: Improved Faster R-CNN Model
Abstract
:1. Introduction
2. Proposed Approaches
2.1. Welding Spot Localization and Classification Using Faster R-CNN
2.2. Optimizations on Anchor Box, RPN Box Selection, and Training Loss
2.3. Neural Network Pruning
Algorithm 1 Structured Pruning of Faster RCNN model |
1: Input: Pretrained CNN model M, pruning thresholds {1/8, 1/4, 1/2}, layers {L1, L2, …, Ln} Excluding first and last layers 2: Output: Pruning configuration and Pruned model M’ 3: Initialize pruned model M’ ← M 4: for each threshold do 5: Remove portion of parameters in M’ 6: Fine-tune M’ on training data 7: Evaluate performance of M’ 8: for each layer do 9: Temporarily remove layer Li from M’ 10: Fine-tune M’ on training data 11: Evaluate performance of M’ 12: if Performance improves then 13: Permanently remove layer Li from M’ 14: else 15: Restore layer Li in M’ 16: end if 17: end for 18: Save the pruning configuration and the pruned model of the best performance 19: end for 20: Take the best model from as M’ 21: Return Pruned model M’ |
3. Experiments and Discussions
3.1. Dataset and Evaluation Metric
3.1.1. Dataset Preparation
3.1.2. Evaluation Metrics
3.2. Experimental Results and Discussions
3.2.1. Comparison Between the Proposed Model and Typical Model
3.2.2. Study of Neural Network Pruning
4. Conclusions
- (1)
- scientific contribution
- (2)
- Novelty
- (3)
- Limitation
- (4)
- Future work
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zhou, K.; Yao, P. Overview of recent advances of process analysis and quality control in resistance spot welding. Mech. Syst. Signal Process. 2019, 124, 170–198. [Google Scholar] [CrossRef]
- Wang, J.; Zhang, Z.; Bai, Z.; Zhang, S.; Qin, R.; Huang, J.; Wen, G. On-line defect recognition of MIG lap welding for stainless steel sheet based on weld image and CMT voltage: Feature fusion and attention weights visualization. J. Manuf. Process. 2023, 108, 430–444. [Google Scholar] [CrossRef]
- Hong, Y.; He, X.; Xu, J.; Yuan, R.; Lin, K.; Chang, B.; Du, D. AF-FTTSnet: An end-to-end two-stream convolutional neural network for online quality monitoring of robotic welding. J. Manuf. Syst. 2024, 74, 422–434. [Google Scholar] [CrossRef]
- Dai, W.; Li, D.; Tang, D.; Jiang, Q.; Wang, D.; Wang, H.; Peng, Y. Deep learning assisted vision inspection of resistance spot welds. J. Manuf. Process. 2021, 62, 262–274. [Google Scholar] [CrossRef]
- Honarvar, F.; Varvani-Farahani, A. A review of ultrasonic testing applications in additive manufacturing: Defect evaluation, material characterization, and process control. Ultrasonics 2020, 108, 106227. [Google Scholar] [CrossRef] [PubMed]
- Mirmahdi, E.; Afshari, D.; Ivanaki, M.K. A Review of Ultrasonic Testing Applications in Spot Welding: Defect Evaluation in Experimental and Simulation Results. Trans. Indian Inst. Met. 2023, 76, 1381–1392. Available online: https://link.springer.com/article/10.1007/s12666-022-02738-8 (accessed on 17 October 2024). [CrossRef]
- Yang, L.; Chuai, R.; Cai, G.; Xue, D.; Li, J.; Liu, K.; Liu, C. Ultrasonic Non-Destructive Testing and Evaluation of Stainless-Steel Resistance Spot Welding Based on Spiral C-Scan Technique. Sensors 2024, 24, 4771. Available online: https://www.mdpi.com/1424-8220/24/15/4771 (accessed on 17 October 2024). [CrossRef]
- Posilovic, L. Generative Adversarial Networks for Ultrasound Image Synthesis and Analysis in Nondestructive Evaluation. Ph.D. Thesis, University of Zagreb, Zagreb, Croatia, 2022. [Google Scholar]
- Juengert, A.; Werz, M.; Gr. Maev, R.; Brauns, M.; Labud, P. Nondestructive Testing of Welds. In Handbook of Nondestructive Evaluation 4.0; Springer: Berlin/Heidelberg, Germany, 2022; Available online: https://link.springer.com/referenceworkentry/10.1007/978-3-030-73206-6_2 (accessed on 17 October 2024).
- Maeda, K.; Suzuki, R.; Suga, T.; Kawahito, Y. Investigating Delayed Cracking Behaviour in Laser Welds of High Strength Steel Sheets Using an X-ray Transmission In-Situ Observation System. Sci. Technol. Weld. Join. 2020, 25, 377–382. Available online: https://www.tandfonline.com/doi/abs/10.1080/13621718.2020.1714873 (accessed on 17 October 2024). [CrossRef]
- Butsykin, S.; Gordynets, A.; Kiselev, A.; Slobodyan, M. Evaluation of the Reliability of Resistance Spot Welding Control via on-Line Monitoring of Dynamic Resistance. J. Intell. Manuf. 2023, 34, 3109–3129. Available online: https://link.springer.com/article/10.1007/s10845-022-01987-0 (accessed on 17 October 2024). [CrossRef]
- Wang, L.; Hou, Y.; Zhang, H.; Zhao, J.; Xi, T.; Qi, X.; Li, Y. A New Measurement Method for the Dynamic Resistance Signal During the Resistance Spot Welding Process. Meas. Sci. Technol. 2016, 27, 095009. Available online: https://iopscience.iop.org/article/10.1088/0957-0233/27/9/095009/meta (accessed on 17 October 2024). [CrossRef]
- Safari, M.; Mostaan, H.; Yadegari Kh, H.; Asgari, D. Effects of Process Parameters on Tensile-Shear Strength and Failure Mode of Resistance Spot Welds of AISI 201 Stainless Steel. Int. J. Adv. Manuf. Technol. 2017, 89, 1853–1863. Available online: https://link.springer.com/article/10.1007/s00170-016-9222-z (accessed on 17 October 2024). [CrossRef]
- Radakovic, D.J.; Tumuluru, M. Predicting Resistance Spot Weld Failure Modes in Shear Tension Tests of Advanced High-Strength Automotive Steels. Available online: https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=dc0e4de080d7199c22fc171b82c61cea04f0d5da (accessed on 17 October 2024).
- Tsukada, K.; Miyake, K.; Harada, D.; Sakai, K.; Kiwa, T. Magnetic Nondestructive Test for Resistance Spot Welds Using Magnetic Flux Penetration and Eddy Current Methods. J. Nondestruct. Eval. 2013, 32, 286–293. Available online: https://link.springer.com/article/10.1007/s10921-013-0181-0 (accessed on 17 October 2024). [CrossRef]
- Dahmene, F.; Yaacoubi, S.; Mountassir, M.E.; Bouzenad, A.E.; Rabaey, P.; Masmoudi, M.; Nennig, P.; Dupuy, T.; Benlatreche, Y.; Taram, A. On the Nondestructive Testing and Monitoring of Cracks in Resistance Spot Welds: Recent Gained Experience. Weld. World 2022, 66, 629–641. Available online: https://link.springer.com/article/10.1007/s40194-022-01249-w (accessed on 17 October 2024). [CrossRef]
- Sak, H.; Senior, A.; Rao, K.; Beaufays, F. Fast and Accurate Recurrent Neural Network Acoustic Models for Speech Recognition. 2015. Available online: https://www.isca-archive.org/interspeech_2015/sak15_interspeech.pdf (accessed on 17 October 2024).
- Ye, S.; Guo, Z.; Zheng, P.; Wang, L.; Lin, C. A Vision Inspection System for the Defects of Resistance Spot Welding Based on Neural Network. In Computer Vision Systems; Springer: Berlin/Heidelberg, Germany, 2017; Available online: https://link.springer.com/chapter/10.1007/978-3-319-68345-4_14 (accessed on 17 October 2024).
- Yang, Y.; Zheng, P.; He, H.; Zheng, T.; Wang, L.; He, S. An Evaluation Method of Acceptable and Failed Spot Welding Products Based on Image Classification with Transfer Learning Technique. In Proceedings of the Proceedings of the 2nd International Conference on Computer Science and Application Engineering, Hohhot, China, 22–24 October 2018; Association for Computing Machinery: New York, NY, USA, 2018; pp. 1–6. [Google Scholar]
- Jaderberg, M.; Simonyan, K.; Zisserman, A.; Kavukcuoglu, K. Spatial Transformer Networks. In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 7–12 December 2015; Curran Associates, Inc.: North Adams, MA, USA, 2015; Volume 28. Available online: https://proceedings.neurips.cc/paper_files/paper/2015/hash/33ceb07bf4eeb3da587e268d663aba1a-Abstract.html (accessed on 4 February 2016).
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You Only Look Once: Unified, Real-Time Object Detection. arXiv 2016, arXiv:1506.02640. [Google Scholar] [CrossRef]
- [1512.02325] SSD: Single Shot MultiBox Detector. Available online: https://arxiv.org/abs/1512.02325 (accessed on 17 October 2024).
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. arXiv 2018, arXiv:1708.02002. [Google Scholar] [CrossRef]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. arXiv 2014, arXiv:1311.2524. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. In Computer Vision—ECCV 2014, Proceedings of the 13th European Conference, Zurich, Switzerland, 6–12 September 2014, Proceedings, Part III 13; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2014; Volume 8691, pp. 346–361. [Google Scholar]
- Girshick, R. Fast R-CNN. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. arXiv 2016, arXiv:1506.01497. [Google Scholar] [CrossRef]
- Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature Pyramid Networks for Object Detection. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 936–944. [Google Scholar]
- Cao, H.; Dirnberger, L.; Bernardini, D.; Piazza, C.; Caccamo, M. 6IMPOSE: Bridging the Reality Gap in 6D Pose Estimation for Robotic Grasping. arXiv 2023, arXiv:2208.14288. [Google Scholar] [CrossRef] [PubMed]
- 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. Available online: https://www.researchgate.net/publication/327705107_Research_on_a_Surface_Defect_Detection_Algorithm_Based_on_MobileNet-SSD (accessed on 17 October 2024). [CrossRef]
- Wang, H.; Li, M.; Wan, Z. Rail surface defect detection based on improved Mask R-CNN. Comput. Electr. Eng. 2022, 102, 108269. [Google Scholar] [CrossRef]
- Luo, W.; Luo, J.; Yang, Z. FPC surface defect detection based on improved Faster R-CNN with decoupled RPN. In Proceedings of the 2020 Chinese Automation Congress (CAC), Shanghai, China, 6–8 November 2020; pp. 7035–7039. [Google Scholar]
- Oh, S.; Jung, M.; Lim, C.; Shin, S. Automatic Detection of Welding Defects Using Faster R-CNN. Appl. Sci. 2020, 10, 8629. [Google Scholar] [CrossRef]
- Simonyan, K.; Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv 2015, arXiv:1409.1556. [Google Scholar] [CrossRef]
- Gkioxari, G.; Girshick, R.; Malik, J. Contextual Action Recognition with R*CNN. arXiv 2016, arXiv:1505.01197. [Google Scholar] [CrossRef]
- Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2017, arXiv:1412.6980. [Google Scholar] [CrossRef]
- Lecun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. Available online: https://ieeexplore.ieee.org/document/7005506 (accessed on 29 October 2024). [CrossRef]
- Li, C.; Li, L.; Jiang, H.; Weng, K.; Geng, Y.; Li, L.; Ke, Z.; Li, Q.; Cheng, M.; Nie, W.; et al. YOLOv6: A Single-Stage Object Detection Framework for Industrial Applications. arXiv 2022, arXiv:2209.02976. [Google Scholar] [CrossRef]
- Zhu, L.; Wang, X.; Ke, Z.; Zhang, W.; Lau, R. BiFormer: Vision Transformer with Bi-Level Routing Attention. arXiv 2023, arXiv:2303.08810. [Google Scholar] [CrossRef]
Type | Algorithm |
---|---|
One stage | Transformer [20], YOLO [21], SSD [22], RetinaNet [23] |
Two stage | R-CNN [24], SPPNet [25], Fast R-CNN [26], Faster R-CNN [27], FPN [28] |
Name | CL | PL | AL | Parameter | mAP | fps |
---|---|---|---|---|---|---|
VGG-16 | 13 | 5 | ReLU | 14.7 M | 73.2% | 5 |
ZF | 5 | 2 | ReLU | 3.17 M | 62.1% | 17 |
Model | mAP | Time/s | ||
SSD | 79.13% | 0.727 | ||
CNN-Lenet5 | 84.69% | 0.837 | ||
Classical Faster RCNN | 90.11% | 0.983 | ||
The proposed model | 92.50% | 0.969 | ||
Models | mAP@0.5 | Parameters (M) | GFLOPs | FPS |
SPP [38] | 83.42 | 12.77 | 27.3 | 162 |
SPPF | 83.50 | 12.87 | 27.3 | 104 |
SimSPPF [39] | 83.18 | 12.74 | 27.2 | 121 |
YOLO-BiFPN | 88.90 | 9.65 | 28.8 | 118 |
YOLOv8-SE | 89.32 | 7.40 | 30.1 | 97 |
YOLO-CBAM | 90.55 | 7.39 | 25.6 | 90 |
YOLO-EMA | 89.30 | 8.28 | 25.2 | 68 |
Biform [40] | 91.3 | 8.13 | 25.7 | 59 |
LSK attention | 91.1 | 10.15 | 26.0 | 73 |
Our proposed model | 90.13 | 11.39 | 25.8 | 66 (15 ms) |
Number | Experiment | Parameter | Ts/frame | Ps/Frame | mAP |
---|---|---|---|---|---|
1 | Faster R-CNN | 57.8 M | 0.043 | 0.031 | 89.8% |
2 | 1/2 Network-wide pruning | 14.6 M | 0.021 | 0.008 | 88.7% |
3 | 1/4 Network-wide pruning | 3.7 M | 0.008 | 0.004 | 86.5% |
4 | 1/8 Network-wide pruning | 0.9 M | 0.005 | 0.002 | 85.1% |
5 | Delete the 4th Conv Layer | 56.5 M | 0.041 | 0.030 | 90.7% |
6 | 1/2 connected layer pruning | 26.3 M | 0.026 | 0.020 | 91.2% |
7 | Delete the 4th ConvLayer and 1/2 connected layer pruning | 25.5 M | 0.025 | 0.018 | 92.5% |
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. |
© 2025 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
Liu, W.; Hu, J.; Qi, J. Resistance Spot Welding Defect Detection Based on Visual Inspection: Improved Faster R-CNN Model. Machines 2025, 13, 33. https://doi.org/10.3390/machines13010033
Liu W, Hu J, Qi J. Resistance Spot Welding Defect Detection Based on Visual Inspection: Improved Faster R-CNN Model. Machines. 2025; 13(1):33. https://doi.org/10.3390/machines13010033
Chicago/Turabian StyleLiu, Weijie, Jie Hu, and Jin Qi. 2025. "Resistance Spot Welding Defect Detection Based on Visual Inspection: Improved Faster R-CNN Model" Machines 13, no. 1: 33. https://doi.org/10.3390/machines13010033
APA StyleLiu, W., Hu, J., & Qi, J. (2025). Resistance Spot Welding Defect Detection Based on Visual Inspection: Improved Faster R-CNN Model. Machines, 13(1), 33. https://doi.org/10.3390/machines13010033