Manuscript Offprint

arXiv:2609.07893

Explainable Temporal Attention-based Defect Detection For Fillet Joints in Real-Time Gas Metal Arc Welding Based on Multi-modal Data

Mobina Mobaraki, Mahyar Asadi, Klaske Van Heusden, Guy A. Dumont

Abstract

Deep learning is an efficient technique to monitor the real-time welding process, reducing post-welding repairs and production delays. This paper leverages the monitoring capability by proposing a multi-modal temporal attention-based deep learning defect detection model for internal defects that are challenging to detect, including porosity, lack of penetration and fusion, undercut, and cold lap during Gas Metal Arc Welding in fillet joints. The model is trained on collected welding images and sound data from an industrial collaborative welding robot. The results show that the attention module can improve the F1 Score to 0.99. We use explainable Artificial Intelligence to interpret the proposed models' behavior and dataset distribution, determining potential important areas in image and sound spectrograms and preferred modality to detect each defect. This improves trust and reliability in Artificial Intelligence-driven welding inspection.

Keywords: Explainable Defect Detection, Multi-modality, Gas Metal Arc Welding, Fillet joints, Deep Learning, Temporal Attention Models

1. Introduction

Real-time defect detection is necessary to improve the efficiency of robotic welding [1, 2]. To detect defects, some studies used design feature-based models [3] to manually extract geometrical features of the molten pool. These approaches extract predefined, low-dimensional image features and struggle to adapt to the differences in the welding torch structure! [4] and dynamic changes of arc morphology in Gas Metal Arc Welding (GMAW) [5]. Especially, fillet welds in GMAW-S (short-circuiting) mode present rapidly changing conditions due to high-frequency arc cycles and quick-freezing weld puddles, challenging the design feature-based methods and necessitating more adaptive techniques. [6].

More robust alternatives are deep learning-based methods including Convolutional Neural Networks (CNNs) [7] that progressively extract high-dimensional features from the raw data through multiple convolutional layers. However, they face challenges in real-time processing of welding data [8, 9, 10] due to their limited ability to store long-term spatiotemporal information. Loss of information from previous time steps can reduce the defect detection performance.

As a solution, an attention mechanism can be integrated into CNNs. Attention mechanisms are inspired by the human nervous system to prioritize salient information. They enhance the efficiency of CNNs by assigning attention weights and prioritizing the previous temporal information [11]. These mechanisms determine the matching between the extracted features and task-specific representation vector and convert them to attention weights through a distribution function (Softmax) [12]. Channel attention is a subset of attention technique that applies attention weights on the channels of data sequence [13]. In welding applications, channel attention focuses on critical spatial information from weld pool images [14], such as pool shape, size, and surface patterns, as well as temporal information from acoustic spectrograms [13, 15]. This incorporates subtle changes in weld pool dynamics and acoustic signatures over a longer period of time, enhancing defect detection performance compared to conventional CNNs without attention.

Channel attention can be used to emphasize the important welding features with respect to time, frequency, and modality. Firstly, the temporal features are vital to detect the real-time hardly-detectable internal defects such as porosity [8] and partial penetration [16]. As an example, a previous study [16] found the correlation between variations in arc voltage and molten metal's geometry to determine the level of penetration. Channel attention can reduce the side effects of arc disturbances by focusing on the important time steps. Secondly, the attention mechanism can emphasize the interesting regions in the frequency band of the arc sound signal based on the characteristics of each defect [17]. Thirdly, fusing the data from multiple sources can provide larger amount of information [18, 19]. Channel attention can elaborate on information from sources with less noise interference and redundancy.

Failure to scientifically interpret the defect detection models results in an inability to fix the issue in case of failure [20], lack of trust by the users [21], and consequently limiting the application in safety-sensitive tasks such as welding [22]. Explainable Artificial Intelligence (XAI) is a solution to make a deep learning model's decision more transparent. In case of not-reliably deployable models, XAI identifies failures and enable researchers to focus on low-confidence cases that may indicate small defects. In case of reliably deployable ones, XAI improves trust.

XAI techniques are divided into Global (GX) and Local (LX) Explainability, with the former focusing on model's learning and the latter focusing on model's assessment. CAM [23] methods as subsets of LX, highlight the important regions on the images by using backpropagation gradient and feature map of the convolutional layer [24]. For the Classic CAM (C-CAM) approach, users need to make structural changes on the deployed models.

Advanced CAM techniques such as GradCAM [20] and GradCAM++ [25] have been proposed to explain the model without altering the structure. Grad CAM calculates the weights for the explanation map by back-propagating the predictions of the last fully connected layer. Unlike other CAMs, Grad CAM is applicable to CNNs with multi-modal inputs [20]. GradCAM++ is an enhanced version of GradCAM that determines the weights as the predetermined class scores.

In welding applications, Zhao et al. [17] used Grad CAM to explain their defect detection model in laser welding by determining the areas of their model's interest in acoustic data. With 98.25 % accuracy, they claimed that lack of penetration is associated with higher frequency range (15 - 20 kHz), while normal penetration and burn through are linked to mid-range (6-10 kHz) and low-range (2 - 6 kHz) frequencies, respectively. Liu et al. [22] also used CAM based on Multi-Scale Fusion Features (CAM- MSFF) to provide an accurate (98.76 %) and human-comprehensible defect detection than the conventional CNNs in TIG welding. They analyzed the distribution of their data using t-SNE. Despite the limited studies to explain defect detection in Tungsten Inert Gas (TIG) and laser welding, to the best of our knowledge, there is no study to interpret defect detection in GMAW. GMAW has more unstable arc with more obscuring elements (consumable electrode, spatter, and smoke) compared to laser welding and TIG [26]. This paper aims to fill this gap using GradCAM, GradCAM++, and XGradCAM to interpret the defect detection models as well as t-SNE and manual feature analysis to interpret the welding dataset in GMAW.

In our recent study, we compared the performance of the vision-based, sound-based, and multi-modal CNNs to detect five target defects including lack of penetration (LOP), lack of fusion (LOF), porosity (Por), undercut (U), and cold lap (C) in fillet joints during a real-time GMAW process showing that multi-modal defect detection improves the F1 Score to classify the mentioned defects by 3.53 %, 58.62 %, 30.14 %, 11.76 %, and 46.67 %, respectively. In this work, we first propose a temporal multi-modal defect detection model. Second, we apply an attention technique to focus on the important temporal and frequency features to improve the defect detection performance and compare the results with the normal multi-modal results from our previous work. Third, we analyze the spatial and temporal-frequency behavior of our proposed defect detection models in GMAW in order to understand the important features to detect each target defect. We use Class Activation Map (CAM) [23] techniques to interpret our models behavior as well as T-distributed stochastic neighbor embedding (t-SNE) [27] and manual feature analysis to interpret the distribution of our welding dataset. The summary of our main contributions are as follows.

  • Enhanced defect detection by adding temporal features: For a more accurate and robust defect detection, we consider the effect of time in the data and improve the F1 Score by 7.95 %, 6.52 %, 4.21 %, 4.21 %, and 12.5 % to detect LOP, LOF, porosity, undercut, and cold lap, respectively.

  • Enhanced defect detection using attention techniques: To improve the performance of defect detection models, we focus on the most useful data within a period of time and frequency and improve the performance of the defect detection model by 4.21 % and 1.02 % for LOP and LOF, respectively, leading to an F1 Score of 0.99 for all the five target defects with a minimum additional computational cost of 0.1 GFLOPs.

  • Interpretability of defect detection models: We explain our proposed defect detection models with XAI techniques including GradCAM, GradCAM++, and XGradCAM and determine the speculative important areas in image and sound data to detect each defect.

  • Interpretability of defect detection dataset: We explain our dataset with t-SNE and manual feature analysis and determine the preferred modality to detect each defect.

References (14)

  • fine-grained representation learning in multiple domains, in: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2015, pp. 4913–4922
  • Neural Machine Translation by Jointly Learning to Align and Translate
  • J. 69 (8) (1990) 289
  • Visual explanations from deep networks via gradient-based localization, in: Proceedings of the IEEE international conference on computer vision, 2017, pp. 618–626
  • Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 2921–2929
  • 2018 IEEE winter conference on applications of computer vision (WACV), IEEE, 2018, pp. 839–847
  • A generative convolutional neural network-based line-of-sight/non-line-of-sight classifier for global navigation satellite systems by transforming multivariate time-series data into images, Engineering Applications of Artificial Intelligence 145 (2025) 110160
  • A tutorial, IEEE Signal Processing Magazine 38 (5) (2021) 67–83
  • Proceedings of the IEEE conference on computer vision and pattern recognition, 2016, pp. 770–778
  • Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018, pp. 6546–6555
  • A video vision transformer, in: Proceedings of the IEEE/CVF international conference on computer vision, 2021, pp. 6836–6846
  • Design techniques and insights, arXiv preprint arXiv:2403.19882 (opens arXiv in a new tab)
  • Visual analysis of class separation measures and dataset characteristics, Computers & Graphics 96 (2021) 48–60
  • CVPR Workshops, 2019, pp. 25–28