1 Introduction

Resistance spot welding (RSW) is a solid-state welding technique used for the joining of two faying surfaces (mostly sheet metals) by the application of pressure and the heat produced by the workpieces' resistance to the passage of electrical current (Ref 1, 2). Pressure is applied via the electrodes to ensure sufficient contact between the two workpieces. Generally, copper alloy electrodes are designed to supply the necessary current density and pressure at the weld location (Ref 3). The temperature rises at the sheet–sheet interface due to resistance heating (Ref 4). When the temperature at the sheet–sheet interface reaches its melting point, they start to fuse, forming an autogenous weld called a nugget (Ref 5, 6). The weld nugget is then allowed to cool and solidify under pressure by water-cooled electrodes, which can dissipate heat by conduction after the current is turned off (Ref 7). RSW parameters need to be optimized to achieve high-quality welds. Welding current (WC), electrode force (EF), and welding time (WT) are the three most essential parameters in RSW (Ref 8, 9). The heat generated depends upon the electric resistance, the thermal conductivity of the two workpieces, and the current passing through the electrodes. The amount of heat generated can be expressed in an equation as follows:

$$Q = \eta \cdot \int\limits_{0}^{t} {I^{{2}} \left( t \right) \cdot R\left( t \right) \cdot {\text{d}}t}$$
(1)

where Q = heat generated (Joules), η = welding thermal efficiency, I = current flowing through electrodes (Amperes), R = resistance offered by workpiece (Ohms), and t = welding time (s).

The physical and metallurgical properties of the workpiece materials and the welding parameters interact intricately during RSW (Ref 10). Previously, optimization of the RSW process was primarily based on known empirical criteria such as weld strength, nugget size, and electrode life. This approach involved conducting experiments to determine the optimal welding conditions based on these criteria. This method was time-consuming and costly to conduct multiple experiments to optimize the RSW process for multiple criteria (Ref 11). Although they have been successfully utilized for many years, it is necessary to fully understand and have better knowledge about the factors that would affect weld nugget formation and growth to benefit from advancements in process design and management (Ref 12, 13). Implementing artificial intelligence (AI) and machine learning (ML) would lead to a greater understanding of weld parameters and their effects on weld quality. This would help maximize manufacturing efficiency and minimize defects (Ref 14, 15).

Nowadays, AI and ML have been used widely due to technological advancements and digitalization aimed at improving productivity and eliminating defects. AI and ML are used to automate, make predictions of outcomes, and optimize the manufacturing process (Ref 16, 17). The advantage of using ML in manufacturing is handling multivariate and high-dimensional data to improve quality control optimization and constantly improve complex processes (Ref 18,19,20). The ML prediction models, if appropriately implemented, will help reduce economic loss and improve productivity (Ref 21).

Nomura et al. used a convolutional neural network model to estimate the weld quality using the molten pool image obtained for the single bevel groove metal active gas welding (Ref 22). The model’s prediction accuracy for the burn-through and penetration depth in metal active gas welding was improved when they were considered a regression problem instead of a discontinuous phenomenon. This can be attributed to the regression model’s nuanced understanding of the complex relationship between the target and input parameters, enabling it to make predictions for unseen data. By treating the problem as regression, the continuous nature of the target variable is retained, enabling the model to capture and preserve a broader range of information. Unlike discrete classes, a regression model can learn and predict a broad spectrum of values, facilitating a more comprehensive understanding of the problem. The error was less than 1 mm for more than 95% of the sample test cases and less than 0.5 mm for more than 87% of the sample test cases. Further, the image size did not affect the estimation accuracy. Real-time monitoring of the tool was possible as the calculation time was sufficiently short.

Mayr et al. found that some of the main challenges in implementing ML are the availability of high-quality data (Ref 23). The ML model's prediction accuracy depends on the training data used. Due to this, if there is any error in the training data, then the ML model's prediction accuracy decreases. The ANN model is a black box model where it is difficult to understand how the algorithm reached the decision. Due to this, making changes or justifying the model's behavior is challenging. (Ref 24, 25). A viable solution to this problem is using deep fuzzy learning, a combination of fuzzy logic and deep neural network. This hybridization makes the ML algorithm accurate and easily interpreted by humans (Ref 26).

The relationship between the input welding parameters and output weld quality indicators cannot be established linearly (Ref 27,28,29,30). Therefore, it is tough to use mathematical models for accurate prediction. The genetic algorithm (GA) with the least square support vector (GA-LSSVM) can accurately determine the relationship and optimize the process. The GA-LSSVM algorithm predicted the weld quality with 90.6% accuracy (Ref 31). The precision of the weld quality is limited to the equipment used for the prediction and subjected to human error (Ref 32). Hwang et al. performed RSW and used adaptive resonance theory artificial neural networks (ART-ANN) in which the input parameters used were welding voltage and current signal (Ref 33). It was found that the nugget size and the tensile strength were predicted with high accuracy, and the fracture mode was predicted with 100% accuracy. Kitano et al. used the least squares assisted rule extraction from facts, version 5 (LSRF5) method, to derive the equation for the correlation between the input and output parameters (Ref 25). It is found that the LSRF5 method can be used to predict the nugget diameter (ND).

The cited studies show that GA has extensively optimized complex manufacturing processes. ANN is a very reliable and popular method implemented by most researchers for predicting specific responses in different welding processes. However, there is a remarkable gap in the literature where multiple different ML algorithms are used with multi-objective optimization to find the best algorithm that generalizes the RSW process. The present study aims to implement ML prediction models such as ANN and ANFIS and then compare them to find the most suitable ML model that can accurately predict the RSW weld quality indicators. Further, multi-objective optimization using GA is done to optimize the complex RSW process and generate a set of optimized welding parameters.

2 Methodology

2.1 Material Selection and Experimental Setup

Dual-phase (DP) steel is used extensively in the automotive industry owing to its favorable characteristics, such as high ductility, high strength, low yield-to-tensile ratio, and continuous yielding (Ref 34). DP780 steel is used in the roof rails, rear rails, body side inner panels, and shock reinforcements of an automobile (Ref 35). The usage of DP780 is increasing many folds in developing countries such as India as lightweight initiatives and safety concerns are of paramount importance; hence, this paper aims at optimizing the RSW welding parameters for DP780 steel sheets of thickness 1.40 ± 0.05 mm. The chemical composition and mechanical properties of DP780 steel used for the experimentation are listed in Tables 1 and 2, respectively. The mechanical properties were obtained using standard testing procedures and equipment.

Table 1 Chemical composition of DP780 steel (wt.%)
Table 2 Mechanical properties of DP780 steel

The RSW experimentation to generate the weld data was carried out on a pedestal-type 150 kVA medium-frequency direct current machine. The electrodes were made of a copper–chromium–zirconium alloy with a truncated cone shape, a face diameter of 8 mm, and a shaft diameter of 16 mm. The WC and voltage were recorded using a weld checker at an interval of 1 ms. Alligator clips were fastened to the electrodes to measure the voltage, and a Rogowski coil was used to measure the WC. The experimental setup is depicted in Fig. 1. A weld nugget growth curve was also generated. The dimensions of the weld samples for the coach peel and tensile shear tests are shown in Fig. 2. The weld sample in Fig. 2(b) is converted into the coach peel test geometry (T shape) to determine the peel strength (PS).

Fig. 1
figure 1

Schematic of the RSW experimental setup

Fig. 2
figure 2

Dimensions of the weld specimen for (a) coach peel test and (b) tensile shear test

2.2 Design of Experiment

The experimentation was performed as per a four-level full factorial design. This was achieved by varying three critical input welding parameters in 4 levels of intensity to ensure the completion of different combinations of the welding parameters with a minimum number of experimental runs. This work considers the three critical welding parameters: WC, WT, and EF. The other less significant welding parameters, such as squeeze time, hold time, and coolant flow rate, were kept constant, and their values are shown in Table 3. Trail experiments were done to determine the feasible range of process parameters that could be used such that there was minimum expulsion. Table 4 shows the design of the experiment and the ranges of the critical welding parameters.

Table 3 Constant welding parameters
Table 4 Critical welding parameters and their factor levels

The weld quality was assessed based on four indicators: ND, PS, tensile shear strength (TSS), and mean dynamic contact resistance (MDCR). A total of 256 samples were prepared to ascertain the weld quality. The MDCR was calculated from the WC, and voltage data that were recorded using a weld checker during the experimental runs. The welded specimens used for the coach peel test and tensile shear test are shown in Fig. 3. Tensile shear and coach peel tests were performed using the universal testing machine following the JIS Z3136 and JIS Z3144 standards, respectively. During the coach peel test, the peel angle was 90° and the crosshead velocity (peel rate) was set to 5 mm/min. The ND measurements were taken using a Vernier caliper from the coach peel test samples. The experimental data generated as per the design of experiments are shown in Table A1.

Fig. 3
figure 3

Weld samples: (a) coach peel test, (b) tensile shear test

2.3 Prediction Models

The weld quality indicators were predicted using ANN and ANFIS on MATLAB software. The WC, WT, and EF were the input welding parameters considered for the prediction models. The criteria used to estimate the performance of the ANN and ANFIS models are R-squared (R2), EP, and mean square error (MSE). It can be noted that the size of the training dataset has a significant impact on the performance of the prediction model. Hence, we have used 54 datasets for training and 10 datasets to validate and test the prediction models.

For the ANN model, the first layer is the input layer comprised of three input parameters that are connected to two hidden layers, which consist of six hidden neurons with transfer function hyperbolic tangent sigmoid (tansig) and log-sigmoid (logsig), respectively. The hidden neurons are then connected to the output layer of four neurons with a linear (purelin) transfer function. The gradient descent optimizer was used in the ANN model. The architecture of the ANN model is shown in Fig. 4(a). The back-propagation algorithm used for the training function is the Bayesian regularization algorithm. The output layer consists of the four weld quality indicators. Bayesian regularization was used since it prevents overfitting by incorporating a prior distribution over the model parameters, which encourages the model to have smaller parameter values and thus be less complex. The advantage of Bayesian regularization over other regularization techniques is that it allows for the automatic selection of the regularization parameter using Bayesian inference. Hence, there is no need to manually tune the regularization parameter, which can be difficult with small datasets (Ref 36).

Fig. 4
figure 4

(a) ANN model architecture, (b) ANFIS model architecture

Another approach, the ANFIS model, is also used due to its advantages over the ANN model. The ANFIS model integrates the fuzzy inference system with neural networks. Figure 4(b) shows the different layers of the ANFIS algorithm. The ANFIS algorithm uses a set of if–then rules which governs the membership function. The fuzzy inference system is generated using a grid partition. The member function type is the Gaussian membership function (gaussmf) for the input and linear for the output. The number of member functions used for each input is four. The total number of rules used is sixty-four, and the training method used is hybrid. The prediction was made for each weld quality indicator individually.

2.4 Multi-objective Optimization

Most real-world engineering problems consist of several parameters (objectives) that need to be optimized (either maximizing or minimizing) simultaneously, with an equality and inequality constraint attached to each objective (Ref 37, 38). The RSW process parameters, such as WC, WT, and EF, were evaluated and optimized using the multi-objective genetic algorithm (MOGA). The weld quality criteria considered (ND, PS, TSS, and MDCR) have made it feasible to identify the ideal welding settings that produce high-quality welds. The multi-objective optimization was done on MATLAB software. The procedure followed to optimize the welding parameters is shown in Fig. 5. The initial objective equations for the welding parameters were constructed using multivariate regression and are shown in Eq 2-5. The developed models were then tested using analysis of variance (ANOVA) to examine adequacy at 95 percent. The ANOVA for the developed multivariate regression model is shown in Table 5.

$$\begin{aligned} {\text{ND}} & = - 9.5531 + 0.37149\left( {{\text{WC}}} \right) - 0.010251\left( {{\text{WT}}} \right) + 5.5117\left( {{\text{EF}}} \right) + 0.024883\left( {{\text{WC}}} \right)^{2} \\ \quad + 1.3438 \times 10^{ - 5} \left( {{\text{WT}}^{2} } \right) - 0.82312\left( {{\text{EF}}^{2} } \right) - 0.00091375\left( {{\text{WC}} \times {\text{WT}}} \right) \\ \quad + 0.001387\left( {{\text{WT}} \times {\text{EF}}} \right) + 0.17638\left( {{\text{EF}} \times {\text{WC}}} \right) \\ \end{aligned}$$
(2)
$$\begin{aligned} {\text{PS}} & = {9}.{661 } + {3}.{1638}\left( {{\text{WC}}} \right) - 0.{16571}\left( {{\text{WT}}} \right) + {6}.{4969}\left( {{\text{EF}}} \right) + 0.{11728}\left( {{\text{WC}}^{{2}} } \right) + 0.000{32764}\left( {{\text{WT}}^{{2}} } \right) \\ \quad - 0.{77533}\left( {{\text{EF}}^{{2}} } \right) - 0.0{12334}\left( {{\text{WC}} \times {\text{WT}}} \right) - 0.000{39844}\left( {{\text{WT}} \times {\text{EF}}} \right) \\ \quad + 0.0{566}0{7}\left( {{\text{EF}} \times {\text{WC}}} \right) \\ \end{aligned}$$
(3)
$$\begin{aligned} {\text{TSS}} & = - {54}.{93} + {18}.{165}\left( {{\text{WC}}} \right) + 0.0{94134}\left( {{\text{WT}}} \right) - {7}.{1499}\left( {{\text{EF}}} \right) - {1}.{11}\left( {{\text{WC}}^{2} } \right) - 0.000{22765}\left( {{\text{WT}}^{2} } \right) \\ \quad - 0.{42175}\left( {{\text{EF}}^{{2}} } \right) - 0.00{11}0{62}\left( {{\text{WC}} \times {\text{WT}}} \right) + 0.0{214}0{5}\left( {{\text{WT}} \times {\text{EF}}} \right) \\ \quad + 0.{27481}\left( {{\text{EF}} \times {\text{WC}}} \right) \\ \end{aligned}$$
(4)
$$\begin{aligned} {\text{MDCR}} & = {821}.{3} - {45}.{699}\left( {{\text{WC}}} \right) - {1}.{5945}\left( {{\text{WT}}} \right) - {37}.{511}\left( {{\text{EF}}} \right) + 0.{44624}\left( {{\text{WC}}^{{2}} } \right) + 0.00{1}0{81}\left( {{\text{WT}}^{2} } \right) \\ \quad - {4}.{8}0{47}\left( {{\text{EF}}^{2} } \right) + 0.0{1}0{785}\left( {{\text{WC}} \times {\text{WT}}} \right) + 0.{12199}\left( {{\text{WT}} \times {\text{EF}}} \right) \\ \quad + {3}.{59}0{3}\left( {{\text{EF}} \times {\text{WC}}} \right) \\ \end{aligned}$$
(5)
Fig. 5
figure 5

RSW process parameter optimization procedure

Table 5 ANOVA of the multivariate regression model

The aim and weights assigned for each of the objectives in the multi-objective optimization model are shown in Table 6. The symbol “*” denotes the weight assigned. The higher the number of “*,” the more significant the weight assigned to the objective. This approach can be used in the automotive industry to improve weld quality, eliminate defects, and reduce production time while extending the welding equipment's service life. Then some of the critical GA parameters were selected and set to an appropriate value, as shown in Table 7, to generate the best possible results. The stochastic uniform was used as the selection function mainly because of its ability to maintain diversity within the population. It is also a more efficient selection method than the tournament, roulette wheel, and ranking method since it selects multiple parents at once without any bias applied. The scattered crossover function was used because it allows for the exchange of genetic information across multiple locations in the genome rather than just a single or a few points. This improves the diversity of the offspring and reduces the likelihood of producing infeasible solutions.

Table 6 Aim and weightage of objectives
Table 7 Genetic algorithm parameters

3 Results and Discussion

3.1 Effects of Welding Parameters on Weld Quality

The welding parameters' effect on the weld’s quality can be correlated with the weld nugget size since the PS and TSS are directly, and MDCR is inversely proportional to ND. The welding parameters studied here are WC, WT, and EF. The critical nugget diameter (CND) for the RSW of DP780 steel sheets of thickness 1.40 mm is calculated using Eq 6. Here, the CND equals 5.03 mm. When the ND formed is less than the CND, an interfacial failure is dominant when loads are applied, whereas when the ND is greater than the CND, the dominant failure mode is a button failure or a pullout failure (Ref 39). The pullout failure is the preferred failure mode for spot welds because the energy dissipated by the non-straight path of crack propagation is higher than the energy dissipated during interfacial failure (Ref 40).

$${\text{CND}} = 4.25 \times \sqrt {{\text{th}}}$$
(6)

where th = thickness of the sheet (mm).

The effect of the variation in WC on the ND, as shown in Fig. 6, indicates that the ND is directly proportional to the WC. The ND continuously increases with the corresponding increase in the WC up to the maximum intensity tested (8.0 kA). This phenomenon occurs because the ND mainly depends on the amount of heat generated. From Eq 1 (Joule’s law), it is evident that the heat produced is directly correlated with the square of the WC passing through the electrode. The trend of ND increasing with an increase in WC is also visible in Fig. 7, which illustrates the effects of WC and EF on the size of the nugget.

Fig. 6
figure 6

Relationship between ND and WC

Fig. 7
figure 7

Effect of WC and EF on the size of the nugget

Figure 6 shows that when the WC is lesser than 6.5 kA, the ND obtained is below the CND. Hence, the critical WC for DP780 steel sheets of 1.40 mm thickness is 6.5 kA. This trend is also visible in Fig. 8 and is in line with the results obtained by other researchers (Ref 33, 39, 41). Figure 9 shows the failure modes of the welded samples during the tensile shear test. When 8 kA WC is used, the failure mode is always pullout fracture which is much more desirable than interfacial fracture, which is observed at lower WC.

Fig. 8
figure 8

Macrostructure images illustrating the change in ND with the corresponding increase in WC

Fig. 9
figure 9

Failure modes during tensile shear test

Most researchers studying the RSW of steels report that there is a WC threshold above which the ND decreases due to expulsion (Ref 42). The findings indicate that the WC threshold for the applied EF of 4.15 kN was achieved because slight expulsion was observed at a WC of 8.0 kA. There was a slight reduction in the ND, as shown in Fig. 6 and 7. Several researchers claim that increasing the EF can also increase the WC without expulsing material (Ref 43, 44). A similar trend was noticed in this study. Minor expulsions were observed when WC of 8 kA and EF of 4.15 kN were used, but expulsion was eliminated as the EF was increased to 4.40 kN. When a low EF of 4.15 kN was applied, and a WC of 5 kA to 7 kA was used, a partial interfacial failure of the nugget was observed during the coach peel test. When a WC of 8 kA is used, a pullout failure is constantly observed, and the sheet metal surrounding the nugget fails. WC greater than 7 kA produces a nugget with an ND greater than the CND of 5.03 mm. When the ND exceeds the CND, the dominant failure mode observed is a pullout failure.

Figure 10 depicts the relationship between the ND and the EF. The increase in EF leads to an increase in the ND till a critical EF of 4.40 kN. The ND gradually decreases when the EF increases to a value greater than 4.40 kN. The explanation for this phenomenon would be that due to an increase in the EF above a critical value (in this case, 4.40 kN), the minute gaps between the two steel sheets will be reduced, significantly improving the contact patch between the two faying surfaces. This, in turn, drastically reduces the electrical resistance and the heat generated (Ref 39, 42). However, when the EF is greater than 4.40 kN, the electrode indentation increases, further reducing the electrical resistance and decreasing the ND (Ref 45,46,47). This decrease in the electrical resistance, which leads to lower heat generation, can be counteracted by adjusting the other welding parameters. Either the WC or the WT or both the WC and WT should be increased to compensate for the heat lost when a high EF is used.

Fig. 10
figure 10

Relationship between ND and EF

As the WT is increased, there is only a slight increase in the overall ND, as shown in Fig. 11. The WT has a negligible effect on the ND (Ref 47, 48). Figure 11 shows that there is only a marginal increase in ND as the WT increases but a drastic increase in ND as the WC increases. However, it can be noted that the excess heat generated due to the longer WT results in a higher weld indentation which explains the lack of significant increase in the ND (Ref 42, 49). The increase in WT can drastically increase the contact surface temperature, increasing melting in the contact zone without any melt spatter. Increasing the WT brings the weld pool to a state of equilibrium which restricts the growth in the nugget (Ref 50).

Fig. 11
figure 11

Relationship between ND and WT

3.2 Microstructure and Microhardness

The microstructure of the RSW DP780 steel weld specimens is shown in Fig. 12. The welded region is analyzed, and the distinct zones formed due to the different local peak temperatures and cooling rates are studied. Figure 12(b) shows the fusion zone (FZ) microstructure. In the FZ, the base material (BM) melts as the heat generated between the two faying surfaces of the sheets is much higher than the melting point of the steel. In contrast to the BM microstructure, the FZ had higher martensite content due to the higher local peak temperature and much faster cooling rates. The FZ is cooled rapidly using the water-cooled copper alloy electrodes, quickly dissipating heat.

Fig. 12
figure 12

(a) Macrostructure of the weld nugget cross section, (b) FZ, (c) CGHAZ, (d) FGHAZ, (e) SCHAZ, (f) BM

The following distinct zone present is the heat-affected zone (HAZ). The HAZ is an intermediate zone between the FZ and BM where the heat produced is not high enough to melt the material but just enough to alter its microstructure. Due to the directional solidification phenomenon in metals, the grains of the HAZ grow from the FZ toward the BM. Due to this phenomenon, different grain sizes are observed at different parts of the HAZ. Based on the difference in grain size, the HAZ can be further divided into three distinct zones that are coarse-grained heat-affected zone (CGHAZ), fine-grained heat-affected zone (FGHAZ), and subcritical heat-affected zone (SCHAZ), which are shown in Fig. 12(c), (d), and (e) respectively. The CGHAZ is the closest to the FZ and has a higher martensitic content than FGHAZ and SCHAZ. The SCHAZ is furthest away from the FZ and has the lowest martensite content compared to the CGHAZ and FGHAZ. The heat the resistance produces does not affect the BM due to its distance from the FZ. The microstructure of the BM shows the typical DP780 microstructure where the martensite is dispersed in a ferritic matrix at the grain boundaries, as shown in Fig. 12(f).

The microhardness of the DP780 welded specimen was studied, as shown in Fig. 13. The presence of martensite content increases the hardness of the material. The maximum hardness of 435 VHN is found at the CGHAZ and the FGHAZ interface. This is due to smaller and finer martensite grains compared to the FZ. The SCHAZ is subjected to high temperatures during welding but does not experience the full melting. The prolonged exposure to elevated temperatures causes the microstructure in the SCHAZ to undergo thermal cycles and experience grain growth, which leads to a less ordered coarse microstructure and tempering of martensite in this region. This results in a steep drop in the microhardness at the SCHAZ. The BM has the lowest microhardness value of 234 VHN because it contains the least amount of martensite.

Fig. 13
figure 13

Vickers microhardness profile across one-half of the weld region

3.3 Relationship Between the Weld Quality Indicators

For welding process optimization, a polynomial regression analysis was performed to study the relationships between the chosen weld quality parameters (ND, PS, TSS, and MDCR). Figure 14(a) and (b) shows the variation in the PS and TSS with the corresponding change in ND and follow a second-order polynomial fit with an R2 value of 0.6599 and 0.9214, respectively. It is evident that the PS and TSS increase with an enhancement in the ND, but the rate of increase flatlines beyond a specific value of ND. The results agree with Pouranvari et al., who observed a similar increase in PS and TSS with the corresponding increment in the ND for DP600 RSW joints (Ref 51). Since tensile shear tests offer better data repeatability and reliability than coach peel tests, less scatter is shown in Fig. 14(b) than in Fig. 14(a); this is because the peak load in the coach peel test is less sensitive to the size of the fusion zone than in tensile shear tests (Ref 52, 53).

Fig. 14
figure 14

(a) PS as a function of ND; (b) TSS as a function of ND; (c) ND as a function of MDCR

Figure 14(c) shows the relationship between ND and MDCR. As the MDCR rises, the corresponding ND decreases linearly, and this interaction can be quantified using a linear fit with an R2 value of 0.9128. Hence, a clear conclusion can be drawn that the ND is inversely proportional to the MDCR (Ref 54). Therefore, ND should be maximized, and MDCR should be minimized to maximize the weld strength.

3.4 Prediction of Weld Quality Indicators

The prediction of the weld quality was made using ANN and ANFIS. In both methods, experimental data (54 datasets) was used as training data to train the neural network, and another set of experimental data (10 datasets) was used to test and validate the predictions made by the algorithm. The validation metrics used were the EP and mean square error (MSE) in the predictions made by the algorithm. The prediction was made for each output weld quality indicator separately with the set of input welding parameters to improve the efficiency and reduce the algorithm’s complexity.

Tables 8, 9, and 10 show the EP and the MSE for the predictions made using ANN and ANFIS models for ND, PS, and TSS, respectively, as these are the main outputs monitored by the automotive companies. The EP ranges for ND were recorded as 0.0778 to 1.4847 with ANN and 0 to 0.0132 with ANFIS. Therefore, ANFIS is found to be precisely predicting the ND. Similarly, the EP range for PS and TSS with ANN was 0.1449 to 2.4091 and 0.0440 to 0.5461, respectively. The ANN algorithm could predict the TSS output with very high accuracy; this can be attributed to the lesser deviations observed in the experimental data. Due to a noticeable scatter in the experimental data for PS and ND, the prediction output has a higher EP.

Table 8 Comparison between the actual and predicted values of ND
Table 9 Comparison between the actual and predicted values of PS
Table 10 Comparison between the actual and predicted values of TSS

Similarly, the EP range of the prediction of PS and TSS with ANFIS is 0 to 0.015 and 0 to 0.0045, respectively. Therefore, ANFIS exhibits higher accuracy as compared to ANN. This can be attributed to ANFIS being a comparatively more advanced algorithm as it uses both ANN and fuzzy inference systems to make predictions (Ref 41, 54).

In the ANN model, the algorithm learns the relationship between the input and output (Ref 55). Unlike the ANN algorithm, where the process is done in hidden layers, in the ANFIS model, the process occurs in the mode of if–then statements, where the fuzzy inference algorithm connects the inputs to the desired output. This method increases the ease of understanding and making changes to the algorithm. Figure 15 shows the normalized values of the actual and predicted output responses from the ANN and ANFIS models. Therefore, it is evident that ANFIS is better for predicting output than ANN (Ref 41, 54, 56).

Fig. 15
figure 15

Comparison between the actual and predicted responses from ANN and ANFIS (a) ND (b) PS (c) TSS

Furthermore, it can be summarized that the ANFIS was more accurate than the ANN for predicting weld quality indicators. The accuracy of ANFIS (99.98%) is superior to ANN (99.36%) during the prediction of all the output responses. This can be attributed to the architecture of the ANFIS model. ANFIS is a hybrid model which combines neural networks with a fuzzy interference system. This improves the model’s speed, efficiency, fault tolerance, and adaptiveness. This makes ANFIS models more interpretable and transparent than ANN models, as the fuzzy rules can be understood and analyzed by experts in the field. This is especially valuable in RSW, where expert knowledge can provide insights into the complex relationships between the input welding parameters and the weld quality indicators. The hybrid structure of ANFIS allows for both numerical learning (through neural network weights adjustment) and rule-based learning (through fuzzy rule tuning). This can be advantageous in capturing complex nonlinear relationships and optimizing the model’s performance. ANFIS models can also handle uncertainty and errors in the training datasets through fuzzy logic. The fuzzy inference system within ANFIS allows for the representation and reasoning of incomplete or uncertain information, providing a more robust framework for modeling and prediction when faced with data imperfections.

3.5 Multi-objective Optimization of the Welding Parameters

The multi-objective optimization was performed on MATLAB software using the GA. The optimization goal is to either maximize or minimize the welding process parameters. ND, PS, and TSS were classified as “Higher the better,” and MDCR was classified as "Lower the better." Another constraint added to the algorithm was that the optimal Pareto solutions for ND should have a minimum critical ND of 5.03 mm. After several generations, the GA operations no longer significantly influence the improvement of the solutions generated. In this case, it happened in the 149th generation. The outcomes from this generation are regarded as the optimized Pareto set of solutions. The complexity of the goal functions, the size of the population, the constraints applied, and the likelihoods of mutation and crossover all affect the number of generations produced. After optimization, a Pareto optimal set of solutions are generated, and the ideal welding parameters are summarized as shown in Table 11. The best solution among the generated Pareto optimal set of solutions must be determined per the manufacturer’s needs.

Table 11 Optimized solutions for ND, PS, TSS, and MDCR

Figure 16 illustrates the relationship between the optimized set of weld quality indicators. It can be observed that initially, in Fig. 14, the points were relatively more spread out as compared to the points in Fig. 16. This shows that the GA has successfully optimized the welding process parameters to ensure the outputs are more predictable and has generated the optimal set of solutions to achieve better weld strength.

Fig. 16
figure 16

Relationship between the Pareto optimal set of weld quality indicators (a) PS, (b) TSS as a function of ND, (c) ND as a function of MDCR

Out of the Pareto set of optimal solutions in Table 11, the best solution to achieve a high PS and TSS is the 24th and the 11th Pareto solution, respectively. Table 12 shows the comparison between the optimal weld quality parameters and the initial level of the weld quality parameters and the comparison between the predicted and actual output responses for ND, PS, and TSS. The initial level here is the welding parameters generally used by manufacturers for the RSW of 1.40 mm DP780 steel sheets. From Table 12, it is visible that there is a significant increase in the ND, which results in increased PS and TSS of the weld joints. The gains observed in PS and TSS are comparable to the results of other researchers (Ref 47, 57). The error in the output responses' predicted and experimentally obtained values are within a tolerable limit of less than 1%. This is in line with the findings of other researchers using the GA (Ref 38, 58,59,60).

Table 12 Comparison between the initial and optimized welds

Based on the multi-objective optimization results, validation trails were also performed with some of the optimized welding process parameters from the Pareto set of solutions. The CND for 1.4-mm-thick DP780 steel sheets, as per JIS Z3140:2017 standard, is 5.03 mm. The minimum TSS to be achieved and set for the experimental validation was 11.056 kN. The 30th Pareto solution from Table 11 is used. The comparison between the optimal and the experimental welding process parameters is shown in Table 13. Furthermore, from Tables 12 and 13, it is concluded that the welding cycle time of the RSW process has also been considerably reduced by using the optimized welding parameters. This will be crucial for manufacturing companies to improve the productivity and efficiency of the production process.

Table 13 Initial and optimal process parameters to achieve minimum TSS of 11.056 kN

4 Conclusion

The current study aimed to develop and implement ANN and ANFIS models to predict RSW quality indicators (ND, PS, and TSS) for DP780-DP780 steel sheets of 1.40 mm thickness. The data required to train the ML models were generated using a four-level full factorial design of the experiment. Furthermore, multivariate regression analysis coupled with the GA was used to optimize and generate a set of optimum welding process parameters. The findings of the current study are as follows:

  1. 1.

    The nugget diameter (ND) is directly proportional to the welding current when all the other welding process parameters are kept constant. In contrast, the welding time and electrode force are directly proportional to the nugget diameter till a specific point before the trend is reversed.

  2. 2.

    The mean dynamic contact resistance (MDCR) is inverse to the nugget diameter.

  3. 3.

    The ANN and ANFIS models are reliable and accurate for predicting weld quality. However, the ANFIS model predictions were slightly more accurate than the ANN model. The prediction accuracy of the ANFIS model was higher than 99.98% for all the outputs compared to the ANN model (99.36 %).

  4. 4.

    Multivariate regression analysis confirms that the welding current’s impact on the weld quality is the most significant. The undersized nugget formation is observed for 5 kA and 6 kA welding currents. However, for all the cases, 7 and 8 kA welding currents resulted in increased nugget diameter (> critical ND of 5.03 mm).

  5. 5.

    To achieve high weld strength and low cycle time, the optimal set of welding process parameters chosen from the optimal solutions generated using the genetic algorithm (GA) is 8 kA welding current, 350.53 ms of welding time, and 4.89 kN electrode force which produces a weld with a nugget diameter of 7.06 mm, peel strength (PS) of 4.83 kN and tensile shear strength (TSS) of 23.67 kN.