Explainable deep learning approaches for classifying welding defects—integrating CNN architectures with XAI
摘要
Welding operations are used in industrial and construction projects for creating durable, high-strength structures and machinery. Traditional inspection methods for identifying welding defects, such as porosity, overweld, undercut, and underfill, are often labor-intensive and prone to human error. This study investigates the application of deep learning techniques, specifically convolutional neural networks (CNNs), to automate the classification of welding defects. Five pre-trained CNN architectures—DenseNet121, MobileNet, Xception, VGG16, and NASNet-Mobile—are finetuned on a large dataset of welding images, developed as part of the work. Data augmentation techniques are applied to address class imbalance and improve model generalization. Of all the models, DenseNet121 achieves the highest accuracy of 98.88%, demonstrating its superior performance. The other models also exhibit very good performance, highlighting the efficacy of CNN-based approaches in delivering scalable, consistent, and efficient solutions for welding defect detection. Further, five-fold cross-validation is also implemented to validate results. In addition, advanced explainable AI (XAI) methods are applied to enhance model interpretability. Specifically, Grad-CAM is implemented with computed confidence scores to visually and quantitatively validate the model focus on defect regions. Further, LIME and SHAP are used to provide both local and global explanations of the model’s predictions, with the aim of making the decision-making process transparent and easily understandable.
Graphical abstractExplainable deep learning models for welding defect classification