A Method for Semantic Segmentation and Contour Extraction of Resistance Spot Weld Joints Based on CLIPSeg-SAM2
DOI:
https://doi.org/10.54097/njq9d182Keywords:
Resistance Spot Welding, Semantic Segmentation, CLIPSeg, SAM2, Contour extractionAbstract
Aiming at the difficulty of surface contour extraction of resistance spot welding joints under complex working conditions and the low accuracy of image recognition under small sample data sets, a semantic segmentation and contour extraction method of resistance spot welding joints based on CLIPSeg-SAM2 is proposed. Firstly, the resistance spot welding process test was carried out to establish a small sample data set. Then, the CLIPSeg is fine-tuned using the resistance spot welding joint data set, and the segmentation ability of visual-linguistic alignment is driven by text prompts to achieve pixel-level positioning of the joint semantic region. Finally, the joint semantic positioning is used as a priori to drive SAM2 for fine segmentation and contour extraction, so as to achieve a complete closed-loop from visual-linguistic coarse positioning to pixel-level contour extraction. The experimental results show that the mPA of CLIPSeg-SAM2 model reaches 85.34 % and the mloU reaches 93.72 %. The proposed method is helpful to realize the automatic positioning and quality monitoring of the welding area in the connection process of precision valve parts by resistance spot welding, and has good engineering application value.
Downloads
References
[1] Xia, Y. J., Li, Y. B., Lou, M., et al. (2020). Recent advances and analysis of quality monitoring and control technologies for RSW. China Mechanical Engineering, 31(1), 100–125.
[2] Dai, W., Li, D., Tang, D., et al. (2021). Deep learning assisted vision inspection of resistance spot welds. Journal of Manufacturing Processes, 62, 262–274. https://doi.org/10. 1016/j. jmapro.2020.12.015.
[3] Qian, W. C., Dong, S. H., Sun, M., et al. (2025). Advances in intelligent defect recognition method for oil and gas pipeline weld X-ray image. Petroleum Science, 22(4), 2061–2078. https:// doi.org/10.1016/j.petsci.2025.12.020.
[4] Lin, Z. Q., Ma, Y. W., Xia, Y. J., et al. (2023). Advances in forming and joining processes of lightweight high-strength thin-walled vehicle structures. Journal of Mechanical Engineering, 59(20), 1–17. https://doi.org/ 10.3901/ JME. 2023. 20. 001.
[5] Vasan, V., Sridharan, N. V., Balasundaram, R. J., et al. (2024). Ensemble-based deep learning model for welding defect detection and classification. Engineering Applications of Artificial Intelligence, 136, 108961. https://doi. org/ 10. 1016/ j. engappai.2024.108961.
[6] Zhao, L. Y., & Wu, Y. Q. (2022). Research progress of surface defect detection methods based on machine vision. Chinese Journal of Scientific Instrument, 43(1), 198–219.
[7] Wang, S. Q., Chen, G. K., & Yao, K. X. (2026). Fillet weld identification method based on improved correlation filtering. Welding & Joining, (3), 58–64, 98.
[8] Luo, G. L., Zhang, C. L., Wan, F., et al. (2026). Research on intelligent welding seam recognition method for welding robots based on improved CenterNet algorithm. Machinery Design & Manufacture, (5), 317–322.
[9] Zhao, E. X., He, Y. Y., Shen, K., et al. (2023). Casting CT image segmentation algorithm based on deep learning. Chinese Journal of Scientific Instrument, 44(11), 176–184.
[10] Song, L., Zhang, P., Chen, K., Li, Z., Yan, H., & Huang, Y. (2025). From classical algorithms to deep learning: a review of machine vision for monitoring welding dynamics. The International Journal of Advanced Manufacturing Technology, 140(11), 5885–5929.
[11] Mohammed, A., & Hussain, M. (2025, May 27). Advances and challenges in deep learning for automated welding defect detection: A technical survey. IEEE Access.
[12] Zhang, H. P., Liu, X. Y., Zhao, F. Z., et al. (2025). Improved YOLO-based image segmentation method for AEC welding cup profile. Journal of Shanghai University of Engineering Science, 39(3), 366–374.
[13] He, T., Zhang, C. J., Xiong, C., et al. (2026). Defect detection method of soft-pack lithium batteries based on Faster R-CNN. Hot Working Technology, 55(11), 126–132.
[14] Wang, Y. F., Du, H. Z., Hu, Y. B., et al. (2025). Precise localization and segmentation method for resistance spot welding defects based on multi-scale feature fusion network. Chinese Journal of Scientific Instrument, 46(7), 202–213.
[15] Wen, H. Y., Wang, X. P., & Yu, X. H. (2026). Application status and prospects of vision-language models in welding defect detection. Transactions of the China Welding Institution, 47(6), 75–85.
[16] Xiong, X., Wu, W., Du, J., et al. (n.d.). A Method for Surface Defect Detection in Resistance Spot Welding Based on an Improved DeepLabv3+ Model. China Mechanical Engineering, 1–10.
[17] Lüddecke, T., & Ecker, A. (2022). Image segmentation using text and image prompts. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (pp. 7086–7096). https://doi. org/10.1109/ CVPR 52688. 2022.00695.
[18] Ravi, N., Gabeur, V., Hu, Y. T., Hu, R., Ryali, C., Ma, T., Khedr, H., et al. (2025). SAM 2: Segment anything in images and videos. In International Conference on Learning Representations. https://doi.org/10.48550/arXiv.2408.09575.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Frontiers in Computing and Intelligent Systems

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

