Next Article in Journal
Ensemble-Based Model-Agnostic Meta-Learning with Operational Grouping for Intelligent Sensory Systems
Previous Article in Journal
Enhanced DWT for Denoising Heartbeat Signal in Non-Invasive Detection
Previous Article in Special Issue
Self-Organizing Wireless Sensor Networks Solving the Coverage Problem: Game-Theoretic Learning Automata and Cellular Automata-Based Approaches
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Resistance Welding Quality Through Artificial Intelligence Techniques

by
Luis Alonso Domínguez-Molina
,
Edgar Rivas-Araiza
,
Juan Carlos Jauregui-Correa
,
Jose Luis Gonzalez-Cordoba
,
Jesús Carlos Pedraza-Ortega
and
Andras Takacs
*
Facultad de Ingeniería, Universidad Autónoma de Querétaro, Querétaro 76010, México
*
Author to whom correspondence should be addressed.
Sensors 2025, 25(6), 1744; https://doi.org/10.3390/s25061744
Submission received: 26 January 2025 / Revised: 18 February 2025 / Accepted: 19 February 2025 / Published: 12 March 2025
(This article belongs to the Special Issue Wireless Sensor Networks for Condition Monitoring)

Abstract

:
Quality assessment of the resistance spot welding process (RSW) is vital during manufacturing. Evaluating the quality without altering the joint material’s physical and mechanical properties has gained interest. This study uses a trained computer vision model to propose a cheap, non-destructive quality-evaluation methodology. The methodology connects the welding input and during-process parameters with the output visual quality information. A manual resistance spot welding machine was used to monitor and record the process input and output parameters to generate the dataset for training. The welding current, welding time, and electrode pressure data were correlated with the welding spot nugget’s quality, mechanical characteristics, and thermal and visible images. Six machine learning models were trained on visible and thermographic images to classify the weld’s quality and connect the quality characteristics (pull force and welding diameter) and the manufacturing process parameters with the visible and thermographic images of the weld. Finally, a cross-validation method validated the robustness of these models. The results indicate that the welding time and the angle between electrodes are highly influential parameters on the mechanical strength of the joint. Additionally, models using visible images of the welding spot exhibited superior performance compared to thermal images.

1. Introduction

Resistance spot welding (RSW) is a manufacturing process that joins two metallic materials by applying high current generating heat and pressure to the components to create the welding spot. The RSW process is known for its high precision and repeatability, ensuring consistent quality and obtaining a solid and durable joint [1,2].
This process is widely used in the automotive and aerospace industries, as well as various manufacturing applications, due to its low cycle time, low operating cost, ease of implementation, and flexibility with respect to adapting to different combinations of materials such as steel, aluminium, and titanium, among others [1]. Consequently, it is essential to ensure the quality of the joints in the resistance welding process since a malfunction can represent a risk to the end user as the assembly fails to fulfill its mechanical and functional requirements. This production error can have severe safety implications when manufacturing medical products or aerospace assemblies.
The mechanical strength evaluation obtained from the RSW process can use destructive or non-destructive testing. Destructive tests (DTs) such as pull, chisel, peeling, and tensile tests quantify the mechanical strength obtained from the joint but modify the physical properties of the components. Therefore, only a sample from an Acceptable Quality Level (AQL), not 100% of the parts [1,3], was tested. International standards such as AWS 8.9M-2012 [4], ISO 15614-12:2021 [5], and ISO 10447:2015 [6] regulate these methods. Although DT is more accurate and gives more information about the RSW quality, this process takes time, generates high costs [7,8], and cannot evaluate every welded piece.
On the other hand, non-destructive testing (NDT) is the preferred option in characterizing the welding joints since its evaluation “does not alter physical, chemical, mechanical, or dimensional properties and can be applied at any process stage” [9]. NDT offers a good solution in an automated environment to evaluate RSW quality quickly and in a cost-effective manner. However, the industry still uses human experts, which is a source of uncertainty in evaluation [10] because it is costly to integrate the methods researched in a laboratory environment into a real-life manufacturing environment [11].
Multiple studies have investigated the materials’ local mechanical properties, correlating the material response to an external force without altering the weld; for example, ref. [12] uses vibratory stress relief to evaluate dissimilar steel welding quality, ref. [13] applies residual stresses to evaluate cruciform weld joints. The work of [14] correlates the local mechanical properties of the welded material with triangulated 3D image information.
The most common approaches to reduce time loss in production associated with quality inspections are preventing the creation of defective parts (during the process) and identifying faulty parts (after the process) [11]. For precluding, the welding systems continuously monitor its parameters to identify anomalies. For identification, the experts evaluate and categorize the resulting product as acceptable or defective.
The input settings of the process define the properties of the RSW, where the parameters of electrode pressure, current, and welding time play a fundamental role. The quality of the weld is highly dependent on the accuracy and control of these parameters [15]. The welding time and current cause temperature distribution in the weld zone and melting point growth, and applying electrode pressure ensures proper contact between the welded parts [16]. It is essential to have a system that continuously monitors their evolution over time as most of these parameters vary during the melting point formation [17]. The monitoring allows the identification of any anomaly during the process.
The investigation presented in [18] implemented a real-time system based on wavelet threshold analysis to monitor and validate the temperature field within a virtual environment. They report high precision, although they took into consideration only one parameter. The work of [19] observed that the displacement of the electrode (DE) recorded with a camera can help predict the input parameters, nugget size, and strength. However, the camera has to be placed in a fixed position relative to the electrodes to observe the displacement. Ref. [20] correlated the indentation displacement with the nugget growth, expulsion, and diameter, but they did not associate the results with the mechanical strength of the piece. The research of [21] was able to cluster dynamic resistance curves (DRCs), but their results strictly depend on the electrodes’ wear status. The approach of [22] predicts the quality using machine learning models trained on information about the production containing time series data (e.g., current, voltage, or resistance) and single features (e.g., wear count or operating status information). Their work predicts with minor errors the future piece, though they cannot manage random changes, and the quality is not only influenced by the linear wearing effects.
Although online methods can offer a large amount of information to predict the weld’s quality accurately, they are costly to implement, and the latency can affect the results. Also, the published methods can only predict the quality of the upcoming pieces.
There are multiple approaches to identifying faulty pieces in the production line. Ultrasonic testing is the most widely used non-destructive testing in the automotive industry, but its accuracy depends on the user’s skills [3]. Authors of [23] proposed a machine learning model for the ultrasonic test classification in the RSW process, applying classification and regression tree (CART) and Random Forest techniques as pattern-recognition tools. They classified the welding spots into four categories: good weld, undersized weld, stick weld, and no weld. Although it is considered the most accurate evaluation method [24], it is limited to the ultrasonic beam orientation as it has to be perpendicular to the tested surface [25]. Also, it is challenging to apply restricted irregular surfaces [24], and a skilled operator is needed to interpret the signals.
Another popular non-destructive testing method is thermal imaging, which determines the quality of the RSW joint by estimating the area of the welding spot nugget. This method ensures an effective joint of the components and ensures quality.
The work of [26] used thermal images to determine the welding nugget diameter, using the color gradients for the calculation of the dimension and verifying with a visual inspection, obtaining a difference of 22% compared to the naked eye measurement of the melting point. However, the setup of their lock-in technique can be time-consuming and more expensive compared to other thermographic techniques.
To determine the quality of dissimilar dual-phase (DP) 600 and series 300 stain steel (AISI 304), ref. [27] used thermal images obtained during the RSW to train a Convolutional Neural Network (CNN). Even though they report 97.3%, they used the dataset of [28] only, classifying the weld quality.
For the RSW process evaluation, ref. [7] presented a model using CNN and a thermal imaging camera to predict the size and shape of the melting area. The model consisted of two steps: (1) reduce the noise of the videos taken by a thermographic camera, and (2) develop a 2D CNN model to detect the adequate start time of each video and the weld center for segmentation and weld size detection. They also identified that the reflection property of dissimilar weld materials is the leading cause of the variation in prediction. Although they report desirable accuracy, they only evaluate the nugget shape based on the thermal images.
Since surface defects contain features related to the joint’s mechanical performance, ref. [3] proposed image analysis based on vision and image-processing systems to determine the surface quality during welding.
While [29] established a correlation between visual information and the welding parameters, investigating the cathode anode surface on the welding discharge using high-speed cameras, the authors of [30] used the pull-off strength, nugget diameter, and fracture mode for prediction utilizing the heat trace in an image of the weld surface with a CNN algorithm. However, accurate predictions require controlling illumination, distance, and image angle. In addition, electrode contamination and misalignment affected its performance as the surface heat trace depends on heat-transfer conditions. In addition, they are only able to predict good-quality welding.
For position detection and spot welding quality, ref. [3] proposed a CNN MobileNetV3 lightweight network. Also, they introduced a data-augmentation technique for the training process, which randomly picks, organizes, and merges four into one image and evaluates all four images at once, making the network training more robust. They detect multiple nuggets accurately but can only distinguish between good and bad quality.
Finally, ref. [2] proposed a multiscale CNN model with an attention mechanism called AcmNet for the classification of solder spots into seven types: normal, copper adhesion, edge, overlap, mutilation, splash, and twist. Even though they report high accuracy, their model can categorize only the final quality but cannot suggest possible changes in the setup parameters.
To evaluate the relation between the mechanical properties, such as mechanical strength, and the variation of input parameters, ref. [15] monitored the current, voltage, electrical resistance, and electrode pressure during the exploration of the feasibility of welding two steel materials, Quenching and Partitioning (Q&P) and Transformation-Induced Plasticity (TRIP). They reported that welding current, electrode force, and welding time were key parameters influencing weld quality. However, they can estimate this through expensive adjustments to the machinery.
To estimate the influence of polarity on a resistance welding machine, ref. [28] conducted a study by recording voltage and current parameters using a Rogowski coil. Additionally, they used a thermographic camera to record the temperature. They calculated the influence of two polarities on the surface appearance, fusion diameter, and the failure modes measured with a pull-out test. Interfacial failure (IF) occurs when there is a break in the weld zone, and pull-out failure (PF) mode where the break occurs in the base material adjacent to the fusion zone. The results also show no significant correlation between the nugget diameter and the welding time.
A Random Forest model classified the weld quality into three categories (cold welds, expulsion, and good welds) in the work of [31] by capturing electrical parameters such as voltage, current, and dynamic resistance calculation. They successfully connected the process parameters with the results; however, their model’s accuracy indicates that there is still a need for a human expert during the evaluation.
For weld quality estimation, ref. [32] proposed a method utilizing the current, voltage, and dynamic resistance parameters obtained during the process. These input parameters are converted into images and then processed using a CNN. Sensors recorded the voltage, current, and clamping force during welding. Then, they calculated the dynamic resistance based on the voltage’s instantaneous values and the sensor’s sampling period during the cycle. The reported accuracy in this work is 98%, but in some cases, it was overfitting.
Similarly, ref. [33] proposed an in-line system monitoring current and voltage. The model classified the weld quality during the current signal analysis into three categories: bad welds, good welds, and metal expulsion welds. Then, these signals served as input to an artificial neural network and regression model. The presented model can predict the nugget size and quality based on current and voltage. However, it cannot predict the hidden structural characteristics.
Finally, ref. [34] monitored the current and voltage parameters to determine the mechanical resistance. They also explored the relationship between electrode pressure and dynamic resistance. According to the report, the electrode pressure affects the initial peak of the dynamic resistance. In the study, two regression models and a neural network predicted the melt diameter from the dynamic resistance, and a principal component analysis (PCA) reduced dimensionality and computational cost. However, they failed to explain the dataset characteristics they used as input information.
Moreover, the works of [33,34] use a Rogowski coil, a popular choice for measuring high-current applications with a lower limit of 1.0 kA and an upper limit of 2.4 kA. However, these coils are susceptible to external magnetic fields, which affects measurement accuracy—compared to current transformers that are less sensitive to external magnetic interference [35], making them a more reliable option in environments with high electromagnetic activity. Also, Rogowski coils can have other drawbacks in high-frequency applications, limiting their versatility and accuracy in these scenarios. They also require an integrator circuit for signal conditioning, which increases the system’s complexity.
The works mentioned above primarily focused on the force parameter assigned as input when recording electrode force. While this approach helps monitor and control the force applied in the operation, it overlooks the potential of real-time force measurements during the operation. Furthermore, the examined computer vision articles utilize CNN to evaluate and categorize the weld quality using only the visual outcome of the nugget. These approaches lose the opportunity to connect the input variables of the RSW process with the result images due to the complex nature of the experiment setup.
This study proposes a non-destructive RSW evaluation framework using computer vision and machine learning models to connect the welding spot’s mechanical characteristics and process parameters with the nugget’s image information. The trained models have practical applications in welding and manufacturing, as the automated process requires cheap and continuous quality monitoring and feedback systems. The proposed framework can train models that not only classify the quality of the welded nugget but also provide valuable insights into the welding process parameters using only image information. A spot welding test bench was assembled and used for the dataset generation, where the system continuously monitors the applied force and current over the welding spot’s formation. This work proposes six machine-learning models to correlate thermal and visible images with the process parameters. These models use CNNs to classify the fusion quality and predict the welding spot’s mechanical characteristics and process parameters.

2. Materials and Methods

The methodology applied in the present work consists of four steps: (1) use of a manual resistance spot welding machine to study the impact of the input parameters vs. quality attributes; (2) creation of a dataset for the training of the artificial intelligence models; (3) evaluation of the quality of the weld; and (4) testing the effectiveness of the model to detect defects in the welded joints.

2.1. Use of Resistance Spot Welding Machine

One of the key factors influencing the quality of the resistance welding process is the weld spot’s formation. This formation is directly influenced by three essential parameters: electrode force, welding current, and welding time. These are considered the main parameters of resistance spot welding, and each plays an essential role in forming a quality weld [36].
Electrode pressure: The amount of pressure the electrodes applied to the metal sheets during the welding process [37]. It must be strong enough to overcome material distortion for optimum contact before current flows but not too strong to avoid problems. This process affects the quality and strength of the weld and is commonly quantified in newtons (N).
Welding current: The amount of electric current used during welding [37] affects the heat generated during welding and is generally measured in amperes (A). Keeping the welding current as low as possible in each application is advisable. A too-high current might expel molten material from the weld nugget and stick to the tip of the electrodes. The current in the resistance welding process is in the range of thousands of amperes [2]. One method to determine an acceptable range of current is using the Lobe curves of the welding [38] against different factors such as material type, component thickness, and applied cycle time.
Welding time: The electric current flowing through the electrodes to the metals generates the melting point to create the welding spot [37]. This parameter is typically measured in milliseconds (ms). Additionally, the compression time is used to stabilize the force applied to the parts, and the waiting time after welding is necessary for the weld to solidify before releasing the parts.
The resistance welding machine Chicago Electric model 61205 was used [39] (Figure 1) for the experiment consisting of the following units:
  • A load cell to record the applied force to the electrodes with a frequency of 10 samples per second (SPS) using a 24-bit analog-to-digital converter for high sensitivity.
  • A current transformer that connects to a current meter to provide reliable measurements.
  • A current meter to measure the current with a frequency of 10 SPS.
  • An electronic embedded system called Arduino UNO to control the system, setting the force application process’s cycle time, compression time, and dwell time parameters.
  • A pressure gauge with a pneumatic cylinder and a solenoid valve to regulate the electrodes’ applied force.
Figure 1. Use of RSW machine.
Figure 1. Use of RSW machine.
Sensors 25 01744 g001

2.2. Dataset Generation

2.2.1. Sample Generation

The construction of the samples was a result of a systematic approach, carefully considering the combinations of the weld time, the angle between electrodes, and electrode pressure setup parameters. The weld time, for instance, varied in a range of [400–1200 ms], with increments of 200 ms, ensuring a comprehensive exploration of the parameter space. Two settings of electrode tips were used to vary the angle between electrodes, each chosen with a specific purpose in mind. The first one had a 0-degree angle (parallel contact surfaces), while the other had a 15-degree angle between the contact surfaces and the electrodes. Two pressure ranges of 60 and 80 PSI were defined for sample construction, and a decision was made after careful consideration of the requirements.
The samples were in strict accordance with the industry standard AWS 8.9M-2012 [4] during construction using AISI 1010 [40] steel plates (material characteristics in Table 1).
The plates were made to overlap and were welded together, adhering to the highest standards. The geometric dimensions of the test specimens are presented in Figure 2.
A total of 495 samples—falling into three categories: bad, good, and expulsion—were built with the combinations of the established parameter range in a complete factorial design of experiments (Table 2). Among them, 32 samples were built with a random combination of the parameters to avoid data bias and to evaluate the influence of the input parameters of welding time, electrode pressure, and angle between the electrodes with the mechanical maximum force. To create “bad” samples, a combination of low and high setups of the cycle time and 15º angle between electrodes were set. For the “good” examples, the central parameters of the cycle time and a 0º angle between electrodes were used. Finally, the “expulsion” samples were created with the parameters of long welding time and 15º angle between electrodes. Each sample was labeled with an identification number to maintain the traceability of the used parameters for its production to integrate the information into the dataset.
Before starting the resistance welding procedure, the system registered the component characteristics, including material type and thickness, and process input parameters, such as pneumatic cylinder pressure, cycle time, and electrode angle. During welding, the system continuously recorded the electrode force and current parameters. At the end of the process, visible images from both sides of the welded plates and a thermal image of the melting point were captured. In addition, the maximum pull force and the welding nugget diameter were also documented.
The framework used two different types of images: thermal and visible images. Visible images are captured by sensors detecting visible light wavelengths between 400 nm and 700 nm. The detected information is digitalized in three channels (red, green, and blue). The thermal images are single-channel imaging using false colors to represent the views detected in the long wave infrared band ranging between 7.5 μ m and 14 μ m.
The visible images used a 15 cm distance between the camera and the sample surface, which was approximately 10 cm in the case of the thermal images (captured by a Fluke Ti105 infrared camera). As it is difficult to record the heat information during welding due to metal reflection, thermal images were captured immediately after (∼one second) during the cooling phase. Nevertheless, the images show the heat-affected zone’s size, shape, and propagation.
Tensile tests were performed with a Tinus Olsen testing machine with a maximum load capacity of 300 KN and a resolution of 0.1 N. For the pull test, the metal plates were aligned between two V-shaped jaws with a knurling that prevented the parts from being displaced during the test (Figure 3). Subsequently, the maximum pull force value was recorded when the welded parts reached the breaking point due to the applied force.
The speed used for the testing was 2 mm/min. The positioning of the parts was measured in order to ensure the accurate alignment and centering of the specimens with the jaws of the testing machine prior to testing.
After testing, the nugget diameter was measured with an electronic caliper with a resolution of 0.01 mm and categorized into good, bad, and expulsion samples (Figure 4). The “expulsion” classification was selected because it impacts the functional performance of the fusion since part of the material is splashed out of the welding area, weakening the joint.

2.2.2. Image Processing

Because the spot weld regions only occupy a small portion of the total area, digital and thermal images were processed to segment the weld region and resize the image. Additionally, noise and unwanted features were removed to improve the image quality.
During the image pre-processing, to acquire pixel-level information, Geeqie software [42] was used to locate the center point of the weld. Coordinates of the welding spot center in each image were manually recorded in a CSV file. Subsequently, using Python programming language with the OpenCV library [43], the images were cropped to a size of 350 × 350 pixels using the center point ± 175 pixels on the x-axis and center point ± 175 on the y-axis for the visible images. The algorithm then cropped thermal images to 300 × 300 pixels and incorporated a 10 mm scale line as a welding nugget measurement reference.
Spatial resolution for thermal images of 0.0625 mm/pixel and 0.06535948 mm/pixel for surface images.
Visible images (Figure 5a) of each sample were taken from the front (F) and back (B) of the spot. Thermal images (Figure 5b) were named according to the sample identification number.

2.2.3. Data Assembly

The dataset—published in the Mendeley repository [44] and described in [45]—was generated with a total of 495 units, constructed with different welding parameters by varying electrode pressure, angle between the electrode, and welding times. The setup and the recording parameters were saved in a comma-separated values (CSV) file.
The dataset’s (Table 3) first three rows after the ID number (attributes 2, 3, and 4) contain the initial input parameters: the initial pressure value supplying the pneumatic circuit; the welding time; and the angle between the contact surfaces and the electrodes.
The second section includes the recording attributes (attributes 5 and 6), the electrode pressure, and the welding current. The sample rate of these measurements was ten samples per second during the welding. However, due to the diversity of welding times, samples have different data lengths for these parameters. Therefore, it was necessary to use measures of dispersion of the data as the minimum, maximum, and average value of each piece to be used in the Convolutional Neural Network.
The third section (attributes 7 and 8) contains features that describe the characteristics of the material: the material thickness, the recorded thickness of both metal plates in micrometers, and the type of material, which was only AISI 1010 quality carbon steel.
The fourth section (attributes 9 and 10) contains information about the weld quality, including the recorded fusion diameter after performing the pull test with an electronic vernier and the maximum force value obtained during the pull test.
Finally, the visual attribute of quality classification (attribute 11) is defined by three classes: good, bad, and expulsion (class balance in Table 4, and range of attributes in Table 5).
In addition, the dispersion of the data (Table 5).

2.3. Machine Learning Model Creation

2.3.1. Convolutional Neural Network Development

As the dataset is unique, different state-of-the-art Convolutional Neural Networks were built based on four state-of-the-art architectures to choose the best-performing model. MobileNet, ResNet50, and DenseNet201 were selected as high-performing RSW evaluation models based on [2] evaluation and comparison. The LeNet-5 model was selected for its simplicity and speed, and according to [46] with similar accuracy as the previous models. The networks were trained and evaluated to extract features in thermal and non-thermal images related to changes in process parameters.
After selecting the architecture, six models were built to evaluate the quality of the resistance welding process and indicate the input parameters. Three models were trained on visible images, while the others used thermal images.
Each model has its own input and output characteristics:
  • Quality by visible images: This is a quality classifier model based on visible images. The output categories are “good”, “bad”, and “expulsion”.
  • Quality by thermal images: This is a quality classifier model based on thermal images. The output categories are “good”, “bad”, and “expulsion”.
  • Value prediction by visible images: This is a model that predicts the quantitative parameters of the nugget diameter and pull strength, based on images of the melting point surface.
  • Value prediction by thermal images: This is a model that predicts the quantitative parameters of the nugget diameter and pull strength, based on thermal images of the melting point.
  • Input parameter prediction by visible images: This is a model that indicates the input parameters of pneumatic cylinder pressure, electrode angle, material thickness, welding time, electrode force (minimum and maximum), and maximum welding current, based on visible images.
  • Input parameter prediction by thermal images: This is a model that indicates the input parameters of pneumatic cylinder pressure, electrode angle, material thickness, welding time, electrode force (minimum and maximum), and maximum welding current, based on thermal images.
Among the four tested state-of-the-art architectures (MobileNet, LeNet-5, ResNet50, and DenseNet201), the LeNet-5 model was the best for its simplicity and low computational cost. The model architecture was set for a 350 × 350 input array for visible images with three output neurons for the different classes.
Architectures without final layers were imported for the other models, and new ones were added to reconnect with the model and process the information. “Flatten” layers were added to flatten the data: a dense layer with sigmoid activation of 84 neurons and, finally, a dense layer with softmax activation of 3 output neurons.
All models were initially trained with the hyperparameters (Table 6) as in [2] for comparison.

2.3.2. Training of the Models

An array was generated to store the input images of the six models and to be used as input for the different models based on visible images (Figure 6a) or thermal images (Figure 6b).
For the output labels of models 1 and 2, an array in “OneHot” format was generated: [1. 0. 0. 0.] “bad”, [0. 1. 0. 0.] “good”, [0. 0. 1. 0.] “expulsion”. In models 3 and 4, an array with the values of the pull-off force and nugget diameter was created for the quality parameter outputs. Finally, an output array was generated for models 5 and 6, which contains the input welding parameters pneumatic cylinder pressure, electrode angle, material thickness, welding time, electrode pressure (minimum and maximum), and maximum welding current.
These arrays were randomly split into training (60%), validation (20%), and test (20%) groups according to the 60-20-20 rule. Finally, the input data were normalized according to each model’s processing.
The training results of each model were compared between the selected architectures to select the best model. Since models 1 and 2 are classification networks, they used accuracy for the evaluation. The others are prediction models, which use mean absolute error (MAE) as a metric.

2.3.3. Hyperparameter Search

Once the best architecture was defined for each model, a search for hyperparameter optimization was performed using Keras Tuner [47]. This framework can search with Bayesian optimization, hyperband, and random search algorithms. For this study, a random search was performed in the search space described in Table 7.

2.4. Analysis of Results

To ensure the measurement’s accuracy and reliability, the parameters of force applied to the electrodes and current were calibrated, and multiple tests with different ranges were performed to determine the measurement’s repeatability.
For the load cell, multiple constant masses of 266 g were used, previously weighed with a calibrated scale. The number of masses was changed to increase the weight from 0 g to 2128 g, and 31 measurement points were taken for each step.
In the current measurement, multiple voltages were applied using an AC voltage regulator and a constant resistor to generate different current ranges, which were verified using a Fluke 177 multimeter, which has a resolution of 0.01 mA and can measure a maximum current of 10 A. Tests were conducted within a current range of 0 A to 5 A, with increments of 0.5 A, taking a total of 35 data points at each step.
Finally, the force applied to the circuits was measured by adjusting the supply pressure in different ranges to determine the relationship between the supply pressure and the measured force. The process involved manually activating the solenoid valve and recording 121 data points per sample. The range of applied pressure was from a minimum pressure of 35 PSI (necessary for valve activation) to a maximum of 95 PSI (maximum pressure supported by the pneumatic cylinder). Thirty samples were recorded at each step to ensure repeatability.
After the workbench was tested, the framework evaluated two areas: 1. how much the input parameters affect the output; 2. how robust the machine learning models are.

2.4.1. Parameter Correlation

A complete factorial experimental design was developed with four repetitions of each combination for 32 samples to evaluate the effect of the RSW process input parameters (welding time, angle between electrodes, and pressure in the pneumatic cylinder) against the mechanical strength.
A Pearson correlation matrix [48] was used to determine the relationship between the input and quality parameters. The welding current and electrode force parameters were used as dispersion measures of the time series’ minimum, maximum, and average value data.
Pearson correlation (Equation (1)) is a statistical measure that evaluates the linear relationship between two continuous variables. It determines the degree of association, with 1 being a positive association between two variables, −1 a negative association between said variables, and a value close to 0 if the variables do not present a linear relationship between them [48].
r = i = 1 n ( x i x ¯ ) ( y i y ¯ ) i = 1 n ( x i x ¯ ) 2 i = 1 n ( y i y ¯ ) 2
where:
  • r —Pearson’s correlation coefficient;
  • n—Number of data points;
  • x i , y i —Individual data points of variables x and y;
  • x ¯ , y ¯ —Means of x and y, respectively.

2.4.2. Model Performance

The effectiveness of each model was verified using the cross-validation strategy using groups of k = 4, 5, and 9. The classification models calculate the confusion matrix, where the True Positive (TP) represents the number of points where the class prediction equals the actual value, and the True Negative (TN) shows correctly categorized non-class points. The False Positive (FP) is where a non-class classification is expected, and the class is predicted, and the False Negative (FN) is where the model classifies a non-class point as a class. The framework calculated accuracy (Equation (2)) to compare the performance with other works in the state of the art, and the F1 score [49] (Equation (3)) was used to overcome accuracy’s limitations and to have a more accurate evaluation of the classification power of the models.
Accuracy = TP + TN TP + TN + FP + FN
F 1 = 2 Precision Recall Precision + Recall
where:
Precision = TP TP + FP Recall = TP TP + FN
Meanwhile, the regression models used Mean Absolute Error (MAE) (Equation (4)), Mean Squared Error (MSE) (Equation (5)), Root Mean Squared Error (RMSE) (Equation (6)), Relative Absolute Error (RAE) (Equation (7)), Relative Squared Error (RSE) (Equation (8)), Coefficient of Determination (R2) (Equation (9)), and Correlation Coefficient (CC) (Equation (10)) metrics for evaluation, where y i is the real data, y ¯ is the mean of the real data, y ^ i is the predicted value, and y ^ ¯ is the mean of the predicted values.
MAE = i = 1 n | y i y ^ i | n
MSE = i = 1 n ( y i y ^ i ) 2 n
RMSE = i = 1 n ( y i y ^ i ) 2 n
RAE = i = 1 n | y i y ^ i | i = 1 n | y i y ¯ |
RSE = i = 1 n ( y i y ^ i ) 2 i = 1 n ( y i y ¯ ) 2
The Coefficient of Determination [50] (Equation (9)) is a statistical measurement that shows how well the model explains the variance in the data. The value ranges between zero and one, with no explanation when it is zero, and one when the model explains all the variability.
R 2 = 1 RSE
The Correlation Coefficient [51] (Equation (10)) calculates the correlation between actual and predicted values. It varies between zero and one, where zero is interpreted as no correlation and one as a perfect correlation.
CC = S P A S P S A
where:
S P A = i = 1 n ( y ^ i y ^ ¯ ) ( y i y ¯ ) n 1 S P = i = 1 n ( y ^ i y ^ ¯ ) 2 n 1 S A = i = 1 n ( y i y ¯ ) 2 n 1

2.5. Computing Specifications and Libraries

This project was developed on a macbook-pro 2021, with a RAM memory of 32 GB, and an Apple M1 Max chip with a 10-nucleus CPU, 24-nucleus GPU and 16-nucleus neural engine.
The described models were developed in Python version 3.9.13 with the following libraries.
  • Keras version 2.10.0;
  • Tensorflow version 2.10.0;
  • Numpy version 1.23.2;
  • Pandas version 1.5.1;
  • Matplotlib version 3.7.3;
  • Seaborn version 0.12.2;
  • Opencv version 4.6.0.66.

3. Results

3.1. Test Bench Evaluation

The results of the test bench evaluation were consistent with the load cell, circuits, and pressure level. The test bench can be trusted to measure the applied force as the accuracy of the load cell for a wide range of weight measurements was in the correct range (Table 8).
Also, the accuracy of the circuit and its measurements demonstrate consistency and repeatability (Table 9).
During the force experiment, the force was recorded in the range of 35 PSI–95 PSI, with increments of 15 PSI between tests. It has been observed that the maximum point has little variability between the 30 samples, indicating that the process is constant and repeatable.

3.2. Parameter Correlation

A complete factorial design of experiments was developed with four replicates of each combination for a total of 32 samples to evaluate the effect of the input parameters of the RSW process (welding time, angle between electrodes, and pneumatic cylinder pressure). Their effect on the process parameters vs. mechanical strength was evaluated (Figure 7), indicating that the welding time factor is the most significant, followed by the angle between electrodes, and finally, the pneumatic cylinder pressure, which did not affect the pull-out force
A Pearson correlation matrix was performed (Figure 8) to determine the relationship between the input and quality parameters. The welding current and electrode force were represented in the calculation with their minimum, maximum, and average value data of the time series.
The Pearson correlation matrix indicates that among the input parameters, the welding time has the highest correlation with the quality parameters of pull-off force and nugget diameter of 0.55598 and 0.472734. From the electrode pressure data, the minimum and maximum force correlated the most with the quality parameters of −0.28668 and 0.114633. On the other hand, in the welding current time series, the maximum current is the most correlating parameter with −0.164266 and 0.219147.

3.3. Machine Learning Model Selection

Several state-of-the-art machine learning models were tested for the project. The results of the evaluation in the case of all six models show that they all performed equally well with high validation accuracy (Table 10) in the classification models and with low mean average error in the case of the prediction models (Table 11 and Table 12). The LeNet-5 architecture came out victorious as it had the lowest computational time. After the model selection, Keras Tuner optimized each architecture with hyperparameter exploration.

3.4. Model Hyperparameter Tuning and Results

After the model selection, a random search of ten runs for all six models with two repetitions performed in the search space (Table 7) looking for the optimization of the accuracy of model 1 (Table 13) and model 2 (Table 14), the MAE of model 3 (Table 15), model 4 (Table 16) model 5 (Table 17), and model 6 (Table 18) in the validation.
After identifying the best model hyperparameters, k-fold cross-validation was performed using 4, 5, and 9 groups to calculate accuracy, precision, recall, and F1 score evaluation metrics for models 1 and 2 (Table 19) and MSE, RMSE, MAE, RAE, RSE, CC, and R 2 for models 3, 4, 5, and 6 (Table 20).
The comparison of the cross-validation results of the visual quality-classification models (Figure 9), the quality-prediction models, and input parameter-prediction models (Figure 10 and Figure 11) proves that models based on visible images have better performance in all metrics, as well as lower variance. That indicates that these models are more robust using different training and validation sets than those using thermal images.

3.5. Evaluations of Example Models Predictions

The confidence level was calculated to measure the first two models’ robustness by evaluating them with single example images with different quality classifications (“bad” (Figure 12), “good” (Figure 13), and “expulsion” (Figure 14)).
The classification comparison of models 1 and 2 (Table 21) exhibits the strength of the model trained with visible images performing in all three classes with almost perfect confidence. In the meantime, the model trained on the thermal images only has confidence in classifying the “good” class.
The measured value was compared to the quality parameter prediction to evaluate models 3 and 4. In this evaluation (Table 22), both models predicted the pull-out force and welding nugget diameter with high accuracy and low error rate. However, the model trained with visible images performed slightly better.
As in the previous evaluation, the actual values were compared with the input parameter predictions to evaluate models 5 and 6. This evaluation (Table 23) clearly shows the superiority of the visible image trained model by predicting the input parameters (angle between electrodes, pressure in the pneumatic cylinder, thickness, welding time, minimum force recorded at the electrodes, maximum force recorded at the electrodes, and maximum current) with a much lower error rate than the thermal image trained counterpart.

4. Discussion

The presented comprehensive study shows a couple of significant findings that can be applied in future works and experiments.
The correlation of the input parameters shows a higher relationship between the welding time and the quality parameters of pull force and welding diameter, followed by the maximum current during the process and the angle between electrodes. In contrast, the pressure in the pneumatic cylinder does not present a correlation with the quality parameters of the RSW. In other words, machine learning models trained on simple image information cannot predict the pressure used during the welding process.
The extensive development and evaluation of machine learning models for this experiment show that the state-of-the-art LeNet-5 model emerges as the superior choice among the tested architectures. It offers a faster prediction time and demonstrates equal or superior evaluation metrics compared to the other architectures in all six models defined in this work.
Also, the models based on visible images perform better and are more robust than those based on thermal images. They have a higher average performance in cross-validation and a lower standard deviation, which indicates that these models have constant repeatability in different test groups.

5. Conclusions

This work shows multiple achievements during the generation of this non-destructive weld quality-prediction methodology.
A dataset integrating construction parameters, electrode current and strength monitoring, material characteristics, and melting point-related quality attributes was created. This dataset was used to train different models for classifying and predicting resistance welding quality attributes.
The developed models in the present study demonstrate a correlation between input parameters and weld spot quality in their visual and functional attributes.
Utilizing visual information, we can predict quality attributes such as category, pull force, welding diameter, and construction parameters of the spot welding process with impressive accuracy.
We can conclude that the models that use visible images as input are more accurate than those that use thermal images. That is due to the information the medium contained. In the meantime, the visible image shows the shape and form of the exploded material, and our handheld camera’s thermal imagery only captures the shape of the weld spot with the heat propagation on the surface.
Looking ahead, there is significant potential for further research. Multiple areas can be improved to enhance the quality of the environment, such as using grayscale filters and contours for image processing, expanding defect classes, and implementing different classification and prediction models in a production environment using an embedded system.

Author Contributions

Conceptualization, L.A.D.-M. and A.T.; methodology, L.A.D.-M., E.R.-A., J.C.J.-C. and A.T.; software L.A.D.-M.; validation, L.A.D.-M., E.R.-A. and J.C.P.-O.; formal analysis, J.C.J.-C. and J.L.G.-C.; investigation, L.A.D.-M.; resources, E.R.-A. and J.C.J.-C.; data curation, L.A.D.-M.; writing—original draft preparation, L.A.D.-M. and A.T.; writing—review and editing, J.L.G.-C., J.C.P.-O., E.R.-A. and A.T.; visualization, L.A.D.-M.; supervision, A.T.; project administration, L.A.D.-M. and A.T.; funding acquisition, A.T. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by Universidad Autónoma de Querétaro over Knowledge Development Fund (FONDEC in its Spanish acronym) with the project registration number: 20205007071001.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are openly available in Mendeley at doi: 10.17632/rwh8kjzdch.3 (accessed on 20 January 2025).

Acknowledgments

We are grateful for the financial support provided by CONAHCYT through the grant for Luis Alonso Domínguez Molina, as well to the for the financial support of the Universidad Autónoma de Querétaro.

Conflicts of Interest

The authors declare no conflicts of interest. The founders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
AAmpers
AISIAmerican Iron & Steel Institute
AQLAcceptable Quality Level
AWSAmerican Welding Society
CARTClassification and Regression Tree
CCCorrelation Coefficient
CNNConvolutional Neural Network
CSVComma-separated values
DPDual-phase
IDIdentification
IFInterfacial Failure
ISOInternational Organization for Standardization
MAEMean Absolute Error
MSEMean Squared Error
μ mMicrometers
mmMillimeters
msMilliseconds
NNewtons
nmNanometers
PCAPrincipal Component Analysis
PFPull-out Failure
Q&PQuenching and Partitioning
RAERelative Absolute Error
RSERelative Squared Error
RMSERoot Mean Squared Error
RSWResistance Spot Welding
TRIPTransformation Induced Plasticity
SPSSamples Per Second

References

  1. Summerville, C.; Compston, P.; Doolan, M. A comparison of resistance spot weld quality assessment techniques. Procedia Manuf. 2019, 29, 305–312. [Google Scholar] [CrossRef]
  2. Xiao, M.; Yang, B.; Wang, S.; Zhang, Z.; Tang, X.; Kang, L. A feature fusion enhanced multiscale CNN with attention mechanism for spot-welding surface appearance recognition. Comput. Ind. 2022, 135, 103583. [Google Scholar] [CrossRef]
  3. 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]
  4. AWS D8.9M:2022; Test Methods for Evaluating the Resistance Spot Welding Behavior of Automotive Sheet Steel Materials. American Welding Society: Doral, FL, USA, 2022.
  5. ISO 15614-12:2021; Specification and Qualification of Welding Procedures for Metallic Materials—Welding Procedure Test—Part 12: Spot, Seam and Projection Welding. International Organization for Standardization (ISO): Geneva, Switzerland, 2021.
  6. ISO 10447:2015; Resistance Welding—Testing of Welds—Peel and Chisel Testing of Resistance spot and Projection Welds. International Organization for Standardization (ISO): Geneva, Switzerland, 2015.
  7. Zhou, J.; Wang, D.; Chen, J.; Feng, Z.; Clarson, B.; Baselhuhn, A. Autonomous nondestructive evaluation of resistance spot welded joints. Robot. Comput. Integr. Manuf. 2021, 72, 102183. [Google Scholar] [CrossRef]
  8. Rodriguez Torres, J.M.; Reta, C.; Ibarra Villegas, F.J. Review of non-destructive methods for the evaluation of resistance spot welding in the automotive industry. Rev. Cienc. Tecnolog. 2024, 7, e353. [Google Scholar] [CrossRef]
  9. Gutiérrez, C.A. Deep Learning Applied to Welding Diagnostics Via Plasma Optical Spectroscopy. Master’s Thesis, Universidad de Cantabria, Cantabria, Spain, 2017. [Google Scholar]
  10. Ji, C.; Na, J.K.; Lee, Y.S.; Park, Y.D.; Kimchi, M. Robot-assisted non-destructive testing of automotive resistance spot welds. Weld. World 2021, 65, 119–126. [Google Scholar] [CrossRef]
  11. Stavropoulos, P.; Sabatakakis, K. Quality Assurance in Resistance Spot Welding: State of Practice, State of the Art, and Prospects. Metals 2024, 14, 185. [Google Scholar] [CrossRef]
  12. Gao, L.; Yang, Y.; Gu, B.; Li, S.; Xu, G.; Yu, Y. Experimental and simulation analysis on the effect of vibratory stress relief on impact toughness of Q345/316 L dissimilar steel welded joints. Mater. Today Commun. 2024, 38, 108084. [Google Scholar] [CrossRef]
  13. Jia, G.; Luo, Y.; Zheng, H.; Zang, J.; Jiang, W. Evolution of residual stresses in 2205 DSS cruciform weld joints of filter press under water jet peening impact. Int. J. Press. Vessel. Pip. 2025, 214, 105413. [Google Scholar] [CrossRef]
  14. Gu, B.; Zhuo, J.; Xu, G.; Gao, L. Study on the effects of ultrasonic impact treatment on the local mechanical properties of welded joints based on the digital image correlation. Measurement 2025, 239, 115441. [Google Scholar] [CrossRef]
  15. Russo Spena, P.; De Maddis, M.; D’Antonio, G.; Lombardi, F. Weldability and Monitoring of Resistance Spot Welding of Q&P and TRIP Steels. Metals 2016, 6, 270. [Google Scholar] [CrossRef]
  16. Williams, N.; Parker, J. Review of resistance spot welding of steel sheets Part 1 Modelling and control of weld nugget formation. Int. Mater. Rev. 2004, 49, 45–75. [Google Scholar] [CrossRef]
  17. Catty, J. Development of an equipment to monitoring and control the quality of resistance welding. J. Acoust. Emiss. 2014, 18, 205. [Google Scholar]
  18. Dong, J.; Hu, J.; Luo, Z. Quality Monitoring of Resistance Spot Welding Based on a Digital Twin. Metals 2023, 13, 697. [Google Scholar] [CrossRef]
  19. Haghshenas, N.; Moshayedi, H. Monitoring of Resistance Spot Welding Process. Exp. Tech. 2020, 44, 99–112. [Google Scholar] [CrossRef]
  20. Ullrich, M.; Wohner, M.; Jüttner, S. Quality monitoring for a resistance spot weld process of galvanized dual-phase steel based on the electrode displacement. Weld. World 2024, 68, 1791–1800. [Google Scholar] [CrossRef]
  21. Capezza, C.; Centofanti, F.; Lepore, A.; Palumbo, B. Functional clustering methods for resistance spot welding process data in the automotive industry. Appl. Stoch. Model. Bus. Ind. 2021, 37, 908–925. [Google Scholar] [CrossRef]
  22. Zhou, B.; Pychynski, T.; Reischl, M.; Kharlamov, E.; Mikut, R. Machine learning with domain knowledge for predictive quality monitoring in resistance spot welding. J. Intell. Manuf. 2022, 33, 1139–1163. [Google Scholar] [CrossRef]
  23. Martín, O.; Pereda, M.; Santos, J.I.; Galán, J.M. Assessment of resistance spot welding quality based on ultrasonic testing and tree-based techniques. J. Mater. Process. Technol. 2014, 214, 2478–2487. [Google Scholar] [CrossRef]
  24. Mirmahdi, E. Numerical and Experimental Modeling of Spot Welding Defects by Ultrasonic Testing on Similar Sheets and Dissimilar Sheets. Russ. J. Nondestruct. Test. 2020, 56, 620–634. [Google Scholar] [CrossRef]
  25. 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. [Google Scholar] [CrossRef] [PubMed]
  26. Lee, S.; Nam, J.; Hwang, W.; Kim, J.; Lee, B. A study on integrity assessment of the resistance spot weld by Infrared Thermography. Procedia Eng. 2011, 10, 1748–1753. [Google Scholar] [CrossRef]
  27. Veitía, R.; Hernández, E.; Villarinho, O.; Orozco, S.; Roca, S.; Fals, C.; Macias, J. Deep Learning for Quality Prediction in Dissimilar Spot Welding DP600-AISI304, Using a Convolutional Neural Network and Infrared Image Processing. In Proceedings of the 32nd European Modeling and Simulation Symposium EMSS, Online, 16–18 September 2020; pp. 393–399. [Google Scholar] [CrossRef]
  28. Hernández, A.E.; Roca, A.S.; Fals, H.C.; Ferraresi, V.A.; Vilarinho, L.O. Influence of polarity on mechanical properties of dissimilar resistance spot welds of DP600/AISI 304 steels. Sci. Technol. Weld. Join. 2016, 21, 607–613. [Google Scholar] [CrossRef]
  29. Karlina, A.I.; Balanovskiy, A.E.; Kondratiev, V.V.; Romanova, V.V.; Batukhtin, A.G.; Karlina, Y.I. An Investigation into the Behavior of Cathode and Anode Spots in a Welding Discharge. Appl. Sci. 2024, 14, 9774. [Google Scholar] [CrossRef]
  30. Choi, S.G.; Hwang, I.; Kim, Y.M.; Kang, B.; Kang, M. Prediction of the Weld Qualities Using Surface Appearance Image in Resistance Spot Welding. Metals 2019, 9, 831. [Google Scholar] [CrossRef]
  31. Xing, B.; Xiao, Y.; Qin, Q.H.; Cui, H. Quality assessment of resistance spot welding process based on dynamic resistance signal and Random Forest based. Int. J. Adv. Manuf. Technol. 2018, 94, 327–339. [Google Scholar] [CrossRef]
  32. Kang, J.H.; Ku, N. Verification of Resistance Welding Quality Based on Deep Learning. J. Soc. Nav. Archit. Korea 2019, 56, 473–479. [Google Scholar] [CrossRef]
  33. Zhao, D.; Wang, Y.; Liang, D.; Ivanov, M. Performances of regression model and artificial neural network in monitoring welding quality based on power signal. J. Mater. Res. Technol. 2020, 9, 1231–1240. [Google Scholar] [CrossRef]
  34. Zhao, D.; Ivanov, M.; Wang, Y.; Du, W. Welding quality evaluation of resistance spot welding based on a hybrid approach. J. Intell. Manuf. 2021, 32, 1819–1832. [Google Scholar] [CrossRef]
  35. Bawankule, P.; Chandrasekaran, K. Analysis of Rogowski Coil Shielding Effectiveness with External Vertical Magnetic Field Using FEM. In Proceedings of the 2023 IEEE 20th India Council International Conference (INDICON), Hyderabad, India, 14–17 December 2023; pp. 995–1000. [Google Scholar] [CrossRef]
  36. Podrzaj, P.; Polajnar, I.; Diaci, J.; Kari, Z. Overview of resistance spot welding control. Sci. Technol. Weld. Join. 2008, 13, 215–224. [Google Scholar] [CrossRef]
  37. Dupuy, T.; Srikunwong, C. Resistance Welding Numerical Simulation. Rev. Eur. Des éLéMents Finis 2004, 13, 313–341. [Google Scholar] [CrossRef]
  38. Dickinson, D.W.; Franklin, J.E.; Stanya, A. Characterization of Spot Welding Behavior by Dynamic Electrical Parameter Monitoring. Weld. J. 1980, 59, 170. [Google Scholar]
  39. Domínguez, L.; Rivas, E.; Jáuregui, J.; González, J.; Pedraza, J.; Takacs, A. Instrumentación de Equipo de Soldadura por Resistencia. Mecatrónica México 2023, 3, 41–55. [Google Scholar]
  40. American Society for Metals. AISI 1010 Low Carbon Steel. Alloy Digest 1985, 34, CS-106. [Google Scholar] [CrossRef]
  41. AZo Materials. AISI 1010 Carbon Steel (UNS G10100). 2019. Available online: https://www.azom.com/article.aspx?ArticleID=6539 (accessed on 10 February 2025).
  42. Clark, C.; Ellis, J.; Nadvornik, V.; Monin, L.; Illarionov, A.; Rönnquist, A.; Marakasov, D.; Penev, R.; Backhouse, K.; Klausner, T.; et al. Geeqie: Geeqie, Lightweight Image Viewer and Organis, 2005–2024. Available online: https://www.geeqie.org/ (accessed on 15 May 2023).
  43. Bradski, G. The OpenCV Library. Dr. Dobb’s J. Softw. Tools 2000, 25, 122–125. [Google Scholar]
  44. Dominguez-Molina, L.A. Resistance Spot Welding Insights: A Dataset Integrating Process Parameters, Infrared, and Surface Imaging. Dataset Mendeley Data 2024. [Google Scholar] [CrossRef]
  45. Domínguez-Molina, L.; Rivas-Araiza, E.A.; Jáuregui-Correa, J.C.; González-Córdoba, J.L.; Pedraza-Ortega, J.C.; Takács, A. Resistance spot welding insights: A dataset integrating process parameters, infrared, and surface imaging. Data Brief 2025, 59, 111373. [Google Scholar] [CrossRef]
  46. Rai, D.; Verma, H.; Arham, M.; Shukla, S. Comparative analysis of machine learning algorithms in pneumonia detection. SSRN Electron. J. 2024, 8. [Google Scholar] [CrossRef]
  47. O’Malley, T.; Bursztein, E.; Long, J.; Chollet, F.; Jin, H.; Invernizzi, L. KerasTuner. 2019. Available online: https://github.com/keras-team/keras-tuner (accessed on 21 March 2023).
  48. Sedgwick, P. Pearson’s correlation coefficient. BMJ 2012, 345, e4483. [Google Scholar] [CrossRef]
  49. Manning, C.D.; Raghavan, P.; Schutze, H. Introduction to Information Retrieval; Cambridge University Press: Cambridge, UK, 2008. [Google Scholar]
  50. Wright, S. Correlation and causation. J. Agric. Res. 1921, 20, 557. [Google Scholar]
  51. Pearson, K. Note on Regression and Inheritance in the Case of Two Parents. Proc. R. Soc. Lond. 1895, 58, 240–242. [Google Scholar]
Figure 2. Size and configuration of weld samples.
Figure 2. Size and configuration of weld samples.
Sensors 25 01744 g002
Figure 3. Pull force experimental setup with Tinus Olsen Testing machine.
Figure 3. Pull force experimental setup with Tinus Olsen Testing machine.
Sensors 25 01744 g003
Figure 4. Weld spot classification: (a) good, (b) bad, (c) expulsion.
Figure 4. Weld spot classification: (a) good, (b) bad, (c) expulsion.
Sensors 25 01744 g004
Figure 5. Example of (a) visible image of the spot welding process standardized to 350 × 350 pixels and (b) thermal image of the spot welding process standardized to 300 × 300 pixels.
Figure 5. Example of (a) visible image of the spot welding process standardized to 350 × 350 pixels and (b) thermal image of the spot welding process standardized to 300 × 300 pixels.
Sensors 25 01744 g005
Figure 6. Input array for (a) visible image-based models and (b) thermal image-based models.
Figure 6. Input array for (a) visible image-based models and (b) thermal image-based models.
Sensors 25 01744 g006
Figure 7. DOE Pareto effect of input parameters vs. maximum pull force.
Figure 7. DOE Pareto effect of input parameters vs. maximum pull force.
Sensors 25 01744 g007
Figure 8. Pearson correlation matrix.
Figure 8. Pearson correlation matrix.
Sensors 25 01744 g008
Figure 9. Results for cross-validation model 1 (test 6) vs model 2 (test 3).
Figure 9. Results for cross-validation model 1 (test 6) vs model 2 (test 3).
Sensors 25 01744 g009
Figure 10. Results for cross-validation model 3 (test 2) vs model 4 (test 4).
Figure 10. Results for cross-validation model 3 (test 2) vs model 4 (test 4).
Sensors 25 01744 g010
Figure 11. Results for cross-validation model 5 (test 3) vs model 6 (test 10).
Figure 11. Results for cross-validation model 5 (test 3) vs model 6 (test 10).
Sensors 25 01744 g011
Figure 12. Part 480, bad sample, visible and thermal images.
Figure 12. Part 480, bad sample, visible and thermal images.
Sensors 25 01744 g012
Figure 13. Part 474, good sample, visible and thermal images.
Figure 13. Part 474, good sample, visible and thermal images.
Sensors 25 01744 g013
Figure 14. Part 385, expulsion sample, visible and thermal images.
Figure 14. Part 385, expulsion sample, visible and thermal images.
Sensors 25 01744 g014
Table 1. Properties of AISI 1010 carbon steel (UNS G10100) [41].
Table 1. Properties of AISI 1010 carbon steel (UNS G10100) [41].
Chemical CompositionContent (%)
Iron, Fe99.18–99.62%
Manganese, Mn0.30–0.60%
Sulfur, S≤0.050%
Phosphorous, P≤0.040%
Carbon, C0.080–0.13%
Physical CompositionMetricImperial
Density7.87 g/cm30.284 lb/in3
Mechanical PropertiesMetricImperial
Tensile strength365 MPa52,900 psi
Yield strength (depending on temper)305 MPa44,200 psi
Elastic modulus190–210 Gpa27,557–30,458 ksi
Bulk modulus (typical for steel)140 GPa20,300 ksi
Shear modulus (typical for steel)80.0 GPa11,600 ksi
Poisson’s ratio0.27–0.300.27–0.30
Elongation at break (in 50 mm)20%20%
Reduction of area40%40%
Hardness, Brinell105105
Hardness, Knoop (converted from Brinell hardness)123123
Hardness, Rockwell B (converted from Brinell hardness)6060
Hardness, Vickers (converted from Brinell hardness)108108
Table 2. Experiment design parameters and ranges.
Table 2. Experiment design parameters and ranges.
ParameterDescriptionData TypeRange
Welding timeCycle time (ms)Continuous200–1500 ms
PressurePressure in the pneumatic cylinder (PSI)Continuous35–95 PSI
AngleAngle between electrodes (°)Continuous0–15°
Table 3. Description of data and attributes.
Table 3. Description of data and attributes.
N.AttributeFormatDescription
1Sample IDNumericUnique identification number for each sample
2PressureNumericPressure on pneumatic cylinder
3Welding timeNumericWelding process time
4Electrode angleNumericAngle between the electrodes
5Electrode forceNumericForce applied to the electrodes
6Welding currentNumericCurrent passing through the metal sheet
7Material thicknessNumericThickness of the material
8Material typeCategoricalMaterial composition
9Pull test forceNumericMechanical resistance of the welding join
10Nugget diameterNumericDiameter of welding nugget
11CategoryCategoricalCategory of welding spot (good, bad, expulsion)
Table 4. Class balance.
Table 4. Class balance.
ClassCategoryQuantityPercentage
0Bad316%
1Good44389%
2Expulsion214%
Table 5. Dispersion of data.
Table 5. Dispersion of data.
AttributeMinimumMaximum
Pressure (PSI)3595
Welding time (ms)2001500
Angle between electrodes (°)015
Electrode pressure (PSI)0133.53
Welding current (A)639.815009.43
Thickness (mm)0.611.057
Pull force (N)1410.35806.5
Welding nugget (mm)1.94.72
Table 6. Training hyperparameters.
Table 6. Training hyperparameters.
HyperparameterValue
OptimizerAdam
Learning rate1 × 10−3
Loss functionCategorical crossentropy
Batch size32
Ephocs50
Table 7. Search space Keras Tuner.
Table 7. Search space Keras Tuner.
HyperparameterValue
Learning rate1 × 10−5–1 × 10−2
Activation functionrelu, sigmoid
Number of neurons32–512
Number of trials10
Target (classification models)Validation accuracy
Target (prediction models)MAE of validation
Table 8. Actual force results versus measurements.
Table 8. Actual force results versus measurements.
Real Data0 g266 g532 g798 g1064 g1330 g1596 g1862 g2128 g
Measurement average0.18264.42529.26797.451064.581332.911599.811866.222132.53
Standard deviation0.2717.0223.6180.3310.2450.2320.9500.6670.330
Table 9. Actual current results versus measurements.
Table 9. Actual current results versus measurements.
Real Data0 A0.5 A1 A1.5 A2 A2.5 A3 A3.5 A4 A4.5 A5 A
Measurement average00.500.991.471.932.462.863.313.824.444.84
Standard deviation00.0250.0420.0690.0930.1110.150.1530.1790.2050.226
Table 10. Results of model 1 and 2 architectures.
Table 10. Results of model 1 and 2 architectures.
ArchitectureModel 1 Validation Accuracy (%)Model 1 Prediction Time (s)Model 2 Validation Accuracy (%)Model 2 Prediction Time (s)
LeNet-590.400.03891.920.048
MobileNet90.400.05391.920.036
ResNet5090.400.16791.920.108
DenseNet20190.400.53891.920.337
Table 11. Results of model 3 and 4 architectures.
Table 11. Results of model 3 and 4 architectures.
ArchitectureModel 3 Validation MAEModel 3 Prediction Time (s)Model 4 Validation MAEModel 4 Prediction Time (s)
LeNet-50.04800.0380.04940.026
MobileNet0.51210.0520.53110.034
ResNet500.60350.1651.38820.107
DenseNet2010.04830.5210.04910.337
Table 12. Results of model 5 and 6 architectures.
Table 12. Results of model 5 and 6 architectures.
ArchitectureModel 5 Validation MAEModel 5 Prediction Time (s)Model 6 Validation MAEModel 6 Prediction Time (s)
LeNet-50.16510.0390.16870.024
MobileNet0.41550.0530.49720.034
ResNet500.59830.1770.61310.107
DenseNet2010.16890.5490.16800.330
Table 13. Search results for hyperparameters LeNet-5 architecture of model 1.
Table 13. Search results for hyperparameters LeNet-5 architecture of model 1.
TestLearning RateActivation FunctionNumber of NeuronsValidation AccuracyTesting Accuracy
61.41 × 10−5relu3293.18%94.44%
54.60 × 10−4sigmoid32089.90%93.94%
41.96 × 10−5relu1693.43%93.43%
Table 14. Search results for hyperparameters LeNet-5 architecture of model 2.
Table 14. Search results for hyperparameters LeNet-5 architecture of model 2.
TestLearning RateActivation FunctionNumber of NeuronsValidation AccuracyTesting Accuracy
31.28 × 10−3relu32097.98%90.91%
67.45 × 10−4relu16097.47%88.89%
103.76 × 10−5relu44896.97%88.89%
Table 15. Search results for hyperparameters LeNet-5 architecture of model 3.
Table 15. Search results for hyperparameters LeNet-5 architecture of model 3.
TestLearning RateActivation FunctionNumber of NeuronsValidation MAETesting MAE
21.27 × 10−4relu3520.03730.0443
104.43 × 10−5relu3840.03730.0456
62.86 × 10−5relu2560.03660.0532
Table 16. Search results for hyperparameters LeNet-5 architecture of model 4.
Table 16. Search results for hyperparameters LeNet-5 architecture of model 4.
TestLearning RateActivation FunctionNumber of NeuronsValidation MAETesting MAE
45.40 × 10−5relu1280.043280.04316
39.51 × 10−5relu3520.045130.04424
24.08 × 10−5sigmoid1280.047330.04499
Table 17. Search results for hyperparameters LeNet-5 architecture of model 5.
Table 17. Search results for hyperparameters LeNet-5 architecture of model 5.
TestLearning RateActivation FunctionNumber of NeuronsValidation MAETesting MAE
31.46 × 10−5relu2880.08180.0746
22.67 × 10−5relu640.08320.0792
67.41 × 10−4relu1920.08730.0844
Table 18. Search results for hyperparameters LeNet-5 architecture of model 6.
Table 18. Search results for hyperparameters LeNet-5 architecture of model 6.
TestLearning RateActivation FunctionNumber of NeuronsValidation MAETesting MAE
106.99 × 10−4relu640.117930.10248
41.03 × 10−4relu1920.140700.08269
59.95 × 10−5relu1920.145820.09591
Table 19. Cross-validation comparison models 1 and 2.
Table 19. Cross-validation comparison models 1 and 2.
MetricModel 1Model 2
Avg.Stdev.Avg.Stdev.
Accuracy0.9900.0160.9730.030
Precision0.9910.0150.9700.031
Recall0.9900.0160.9700.031
F1 Score0.9900.0160.9700.031
Table 20. Cross-validation comparison models 3, 4, 5 and 6.
Table 20. Cross-validation comparison models 3, 4, 5 and 6.
MetricModel 3Model 4Model 5Model 6
Avg.Stdev.Avg.Stdev.Avg.Stdev.Avg.Stdev.
MSE0.00020.00060.00110.00140.000530.001780.009120.01041
RMSE0.01090.01180.02550.02270.013620.019190.084130.04660
MAE0.00790.00830.01860.01600.009070.011630.056440.03200
RAE0.06240.06530.14540.12590.052380.066680.325380.17073
RSE0.01430.04020.06150.07940.009870.034000.211430.32531
CC0.99420.01670.97500.03300.995900.014180.924570.08726
R20.98730.03390.94280.07170.991550.028120.857450.1520367
Table 21. Comparison of models 1 and 2.
Table 21. Comparison of models 1 and 2.
Sample IDTarget ValueModel 1Model 2
ClassificationClassification
480BadBad (0.9999)Bad (0.0369)
474GoodGood (1.000)Good (0.9628)
385ExpulsionExpulsion (0.9999)Expulsion (0.0505)
Table 22. Comparison of models 3 and 4.
Table 22. Comparison of models 3 and 4.
Sample IDAttributeTarget ValueModel 3Model 4
PredictionPrediction
480Pull force (N)1410.31402.241401.82
474Pull force (N)2902.62908.432893.74
385Pull force (N)3131.73134.943126.63
480Nugget diameter (mm)1.901.89201.8817
474Nugget diameter (mm)3.593.58863.5824
385Nugget diameter (mm)3.473.47123.4759
Table 23. Comparison of models 5 and 6.
Table 23. Comparison of models 5 and 6.
Sample IDAttributeTarget ValueModel 5Model 6
PredictionPrediction
480Angle (°)0−0.06780.2480
474Angle (°)00.0390−0.9022
385Angle (°)1514.946515.8960
480Pressure (PSI)6058.939667.4020
474Pressure (PSI)6059.576966.9101
385Pressure (PSI)6058.880166.1928
480Thickness (mm)1.2501.25351.3646
474Thickness (mm)1.2531.26571.2815
385Thickness (mm)1.2421.25351.2576
480Welding Time (ms)12001189.481021.28
474Welding Time (ms)12001197.331199.89
385Welding Time (ms)600589.64605.423
480Force Min (N)98.1999.0283.4797
474Force Min (N)98.2699.3194.8255
385Force Min (N)94.9395.4995.2123
480Force Max (N)98.5098.4692.6841
474Force Max (N)98.7899.51101.1457
385Force Max (N)95.5295.6393.7294
480Current Max (A)2343.112319.853319.02
474Current Max (A)4251.294236.033723.13
385Current Max (A)4116.034108.544043.39
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.

Share and Cite

MDPI and ACS Style

Domínguez-Molina, L.A.; Rivas-Araiza, E.; Jauregui-Correa, J.C.; Gonzalez-Cordoba, J.L.; Pedraza-Ortega, J.C.; Takacs, A. Resistance Welding Quality Through Artificial Intelligence Techniques. Sensors 2025, 25, 1744. https://doi.org/10.3390/s25061744

AMA Style

Domínguez-Molina LA, Rivas-Araiza E, Jauregui-Correa JC, Gonzalez-Cordoba JL, Pedraza-Ortega JC, Takacs A. Resistance Welding Quality Through Artificial Intelligence Techniques. Sensors. 2025; 25(6):1744. https://doi.org/10.3390/s25061744

Chicago/Turabian Style

Domínguez-Molina, Luis Alonso, Edgar Rivas-Araiza, Juan Carlos Jauregui-Correa, Jose Luis Gonzalez-Cordoba, Jesús Carlos Pedraza-Ortega, and Andras Takacs. 2025. "Resistance Welding Quality Through Artificial Intelligence Techniques" Sensors 25, no. 6: 1744. https://doi.org/10.3390/s25061744

APA Style

Domínguez-Molina, L. A., Rivas-Araiza, E., Jauregui-Correa, J. C., Gonzalez-Cordoba, J. L., Pedraza-Ortega, J. C., & Takacs, A. (2025). Resistance Welding Quality Through Artificial Intelligence Techniques. Sensors, 25(6), 1744. https://doi.org/10.3390/s25061744

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop