Application of machine learning and neural network models based on experimental evaluation of dissimilar resistance spot-welded joints between grade 2 titanium alloy and AISI 304 stainless steel Authors: Marwan T. Mezher, Alejandro Pereira, Rusul Ahmed Shakir, Tomasz Trzepieciński Published: 2024 ABSTRACT The use of a composite welded joint consisting of titanium and austenitic stainless steel metals is evidently a favourable selection for industrial applications employing the resistance spot welding (RSW) operation. Nevertheless, achieving a high-quality welded joint proved challenging owing to the properties of the diverse range of materials' used. To improve the quality of dissimilar welded joints, the welding parameters should be selected precisely. With that in mind, the current research endeavoured to figure out the ideal RSW parameters for a dissimilar resistance spot-welded joint between grade 2 titanium alloy (Ti) and AISI 304 austenitic stainless steel (ASS) with equal and unequal thicknesses of 0.5 and 1 mm. The RSW cases based on the selected thickness were referred to as the following: similar thickness of 1 mm for Ti and ASS as case E, dissimilar thickness of 0.5 mm for Ti and 1 mm for ASS as case F, dissimilar thickness of 0.5 mm for ASS and 1 mm for Ti as case I, and similar thickness of 0.5 mm as case J. Tensile shear force, failure mode, and micro-hardness were the metrics used to assess the dissimilar joint's soundness. The RSW variables utilized in the scope of the present investigation were “welding current, pressure, welding time, squeeze time, holding time, and pulse welding”. Models from gradient boosting, CatBoost, and random forest machine learning (ML) algorithms were used to guarantee an accurate analysis, along with the artificial neural network regressions. Therefore, the ML and artificial neural network (ANN) models were trained using real data collected from 100 experimental RSW samples conducted under different RSW process parameters. Various transfer and training functions were applied with the multilayer perceptron employing the feed-forward-back propagation approach when building the ANN models. Also, for the first time in the RSW field, an estimation of the relative importance of the RSW variables regarding the predicted shear force is presented in the current study. Evaluating the experimental findings demonstrated that the highest shear force was 2.183, 2.589, 1.708, and 1.851 kN for cases E, F, I, and J. The micro-hardness data indicated that the nugget zone had a much higher hardness than the heat-affected zone (HAZ) and base metal (BM) zones, wherein case F showed the peak nugget hardness in comparison to the other cases. The best prediction model was found to be the ANN model when training the conjugate gradient with the Polak-Ribiere updates (Traincgp) training function with the hyperbolic tangent sigmoid transfer function (Tansig) with the mean squared error (MSE) and correlation coefficient (R2) values recorded as 0.01886 and 0.94973, respectively. However, the random forest algorithm gave the second best prediction of the MSE while the CatBoost and gradient boosting algorithms were third and fourth, respectively. The automotive and aerospace sectors are anticipated to benefit from the present research in applications associated with body component production that result in a superior strength-to-weight ratio. Introduction The automobile and aerospace industries are deeply concerned about reducing the weight of vehicles and aircraft in light of the present fuel and environmental crises caused by strict government regulations and high gas prices [1]. To achieve this, the structural design of vehicles and aircraft often makes use of lightweight materials, including composites, titanium, magnesium, and aluminium alloys. Using materials that have dissimilar hybrid components allows the use of each material's unique benefits [2]. Composites made of stainless steel and a titanium alloy might be useful in the aircraft and automobile sectors. A combination of high strength and low weight is required, and the properties of these materials fulfil this requirement [1,2]. One promising strategy for reducing spacecraft mass is the partial replacement of steel components with titanium and its alloy [3]. It is essential to weld the steel and titanium. Indeed, the process of welding these metals is challenging due to the generation of brittle structures inside the weld [4]. Titanium alloy and steel welds have been attempted using brazing and pressure welding techniques like impulse pressure diffusion [5], friction welding [6], explosive welding [7], and diffusion bonding [8]. Having said that, there is a lack of published studies on the topic of resistance spot welding (RSW) with these two materials. In addition, other studies have applied the friction welding process to join different aluminium alloys [[9], [10], [11], [12]]. The mechanical performance of dissimilar joints made of commercial titanium and ASS grade 304 with an aluminium insert was conducted by Tu et al. [13]. Their findings demonstrated that even though the shear force was 5.38 kN, the failed joints still experienced interracial failure. Mansor et al. [14] investigated the dissimilar micro-RSW of Ti-6Al-4V and ASS 316L. The results of the tensile shear test indicated that all of the joint samples fractured in an interfacial failure (IF) mode, with the peak shear force for each specimen being 378.25 N. When Li et al. [15] examined the RSW of AA 6061-T6 and commercial titanium, they reported that the weld current significantly influences the tensile shear performance of the joints, while the electrode force and welding time had negligible impacts. The combination of AISI 304 and commercial titanium was welded by Santhakumari et al. [16] via upset butt-welding. Their results demonstrated that brittle intermetallic phases cause a decrease in elongation at the welded joints. Taufiqurrahman et al. [17] analysed the hardness and shear force of dissimilar ASS 316L/Ti6Al4N RSW joints. Interfacial mode generation remained despite a shear force of 895 N and hardness of 367.3 HV. According to research by Rana et al. [18], friction-stirred welded joints made of AISI 316L/Ti6Al4V could reach a maximum shear force of 554 N/mm. The hardness was improved by 25 % and 15 % with respect to the top plates of AISI 316L and Ti6Al4V, respectively. According to the findings of Chen et al. [19], the joint strength between Ti6Al4V and stainless steel 201 reached a peak value of 150 MPa. Furthermore, the failure of the sample occurred specifically at the intermetallic compound (IMC) layer. In a similar vein, Cheng et al. [20] performed studies using various welding techniques, such as brazing, metal inert gas (MIG), and tungsten inert gas (TIG), to join Ti grade 4 and ASS 304. Fractures were seen at the interface along the IMC layer in all samples, as described. A further investigation conducted by Ref. [21] using the laser welding technique revealed that the fractured joints of Ti/ASS 304 exhibit a similar pattern of brittle failure caused by the development of IMCs at the contact. The friction stir welding procedure of ASS 304/commercial pure Ti was examined by Fazel et al. [22]. The shear strength of 330 N/mm was reported as a maximal record. Using the pressure joule-heat forge welding method, Shotri et al. [23] examined the joining mechanism of Ti6Al4V/ASS 316L steel rods. It was shown that when the forging force is increased, the deformation behaviour of the dissimilar joints is reduced and the interfacial stresses are increased. The microstructure analysis showed that ASS had α+β phases with refined annealed austenite and extended Ti α-grains. Through pulse laser welding and an electron beam, Adomako et al. [24] found that at the interface of the fractured area of the Ti6Al4V/SS436 joint, there were IMCs such as FeTi and Fe2Ti. Similar to this, FeTi and Fe2Ti IMCs were found within ASS 304L/Ti6AL4V by Kumar et al. [25] during the vacuum diffusion bonding and electrical resistance welding procedures. By using rotating friction and forge load, Balasubramanian et al. [26] and Kumar et al. [27] joined commercial pure Ti and Ti5Al2.5Sn to AISI 304L. The joint strength results ranged from 150 to 270 MPa. Linear friction welding was used by Astarita et al. [28] with a frequency and oscillation amplitude of 2.5 mm at 50 Hz. A high-temperature, uncontrolled flash was seen in the martensitic structures close to the titanium weld contact. Wang et al. [29] used diffusion welding experiments to join titanium and 17-4 PH stainless steel by varying the temperatures range. They concluded that the maximum shear strength and micro-hardness were 163 MPa and 693 HV. The microstructure development of the interface of CP-Ti and ASS 304 friction stir-welded butt joints was examined by Gotawala et al. [30]. As a result of welding, Ti-Fe IMCs emerged on each side of the titanium/steel contact. Although the interface temperature and the number of IMCs within the weld may decrease with a low tool speed, the failure strain offers undesirable findings. Szwajka et al. [31] analysed the microstructure and the mechanical properties of RSW joints of Ti6Al4V and DP600 steel. The evaluation of the quality of the RSW joint relies on the concurrent interaction of several factors, including welding current, welding, holding, and squeeze times, welding pressure, and pulse welding. Determining the impact of a one parameter on joint quality while neglecting other factors poses significant challenges in practical applications. Hence, several methodologies such as analytical modelling, analysis of variance (ANOVA), artificial neural networks (ANNs), machine learning (ML), and deep learning approaches, and artificial intelligence are used [32]. ANNs and ML are the most prevalent of the approaches listed, and how they function is well understood. Artificial intelligence (AI) approaches have gained in popularity for addressing welding process issues, with ANNs and ML being the most prominent. The performance of ANNs is influenced by various parameters, including the hidden layer number [33], the training approach [34], the number of neurons in the hidden layers [35], the input data quality [36], the activation functions [37], and the test dataset size. Using the mean absolute error (MAE), Siamakmanesh et al. [38] used ANNs to forecast the grain size and hardness of friction-stirred Ti joints. The MAE was 4.7731 %. For assessing the residual stresses, Qin et al. [39] applied a convolutional NN model for evaluating the correlation coefficient (R2) and MAE of around 0.95 and 6.8, respectively, for laser-welded ASS 304 joints. Peng et al. [40] suggested a back-propagation NN-based model for residual stress measurement. Using the predictions from an ANN and finite element method (FEM), Baruah et al. [41] assessed the thermal profile of arc-welded samples. Nejad et al. [42] utilized an ANN to forecast the fatigue crack rate and fracture toughness of AA2024-T351 welded joints that were stirred by friction. They executed this by altering the hidden layer neurons number. Another investigation that utilized ANNs and ML to estimate the fatigue life of flash butt joints was conducted by Sheng et al. [43]. With R2, MSE, MRE, and MAE reported as 0.865, 0.134, 0.872, and 0.171, respectively, the results demonstrated outstanding performance. Martin et al. [44] employed an ANN to assess the effects of AISI 304's RSW aspects on the pitting corrosion behaviour of the material. Their results show that controlling overfitting during training and carefully selecting hidden layer neurons are necessary for effective prediction. Wan et al. [45] found that back propagation outperformed a probabilistic NN for fracture force assessment. In their study, Mezher et al. [46] used both experimental and ANN studies to assess the RSW of grade 2 titanium alloy. Using the results of an FEM and a multilayer perceptron (MLP) approach, Ghafarallahi et al. [47] divided the welding diameter into subsets. The ANN model's weld diameter estimates were much more accurate than those of the FEM model. Arunchai et al. [48] used ANN for RSW to predict the weld quality based on the NN observations. The accuracy of the model's predictions was 95 %. Mezher et al. [49] applied an FEM and experimental investigation to the AISI 316L resistance spot-welded joints. Considering fracture topography characteristics, Macek et al. [50] investigated the fractured surface of maraging steel under low cycle fatigue. The results verified that the fatigue life values using the core material volume were within the scatter band and on the whole fracture surface. Based on reconstructing crack propagation in microstructural details by examination of fracture surface topographies, Kobayashi and Shockey [51] introduced a novel approach for fracture surface analysis called fracture surface topography analysis (FRASTA). Presenting the above facts demonstrates that there is no such paper on dissimilar Ti grade 2/AISI 304 that has analysed all the RSW parameters simultaneously using ANNs, ML algorithms and experimental tests in the same investigation without omitting any parameter. The RSW parameters include welding current, welding, holding, and squeeze times, pressure, and pulses per weld. In addition, the authors are aware of no prior research that has examined a dissimilar RSW joint based on an equal and unequal thickness of Ti grade 2 and ASS 304 using random forest, CatBoost, and gradient boosting ML algorithms. Besides this, the absence of a mathematical equation for measuring shear force based on an ANN model has driven the authors to present this study. Moreover, the experimental observations evaluated the impact of the aforementioned RSW variables on the shear force, micro-hardness, and failure mechanism. Experimental setup Materials preparation and RSW operation The base metals employed in the current paper were ASS 304 and grade 2 titanium alloy using two thicknesses of 0.5 and 1 mm. A lap-joint configuration as presented in Fig. 1 was used in accordance with the AWS specifications [52] as shown in Table 1. Table 2, Table 3 summarised the chemical composition and mechanical properties, respectively. Using grit abrasive paper No. 2000, the surfaces of the welded specimens were mechanically cleaned. This step was necessary to ensure that the RSW samples were free of oxide coatings, surface impurities, and cutting-edge burr before implementing the welding operation. To improve the weld performance and avoid expulsion generation, ethanol was applied to the surfaces of the RSW samples. This contributed to eliminating impurities that might have been present during the RSW process.Fig. 1Schematic diagram of the shear tensile test specimen.Fig. 1Table 1The RSW sample dimensions.Table 1Thickness (mm)Length (mm)Width (mm)Overlap region (mm)0.576161611002525Table 2Chemical composition of AISI 304 and Ti grade 2.Table 2Element wt.%CMnPSSiCrNiCuMoONHTiFeAISI 3040.082.00.040.031.01880.750.75––––Bal.Ti grade 20.0055––––––––0.110.00670.001Bal.0.062Table 3Mechanical properties of AISI 304 and Ti grade 2.Table 3PropertyAISI 304Ti grade 2Yield strength (MPa)215318Tensile strength (MPa)505428Young's modulus (GPa)193113Elongation (%)4028Poisson's ratio0.290.37 Schematic diagram of the shear tensile test specimen. Table 1The RSW sample dimensions.Table 1Thickness (mm)Length (mm)Width (mm)Overlap region (mm)0.576161611002525 The RSW sample dimensions. Table 2Chemical composition of AISI 304 and Ti grade 2.Table 2Element wt.%CMnPSSiCrNiCuMoONHTiFeAISI 3040.082.00.040.031.01880.750.75––––Bal.Ti grade 20.0055––––––––0.110.00670.001Bal.0.062 Chemical composition of AISI 304 and Ti grade 2. Table 3Mechanical properties of AISI 304 and Ti grade 2.Table 3PropertyAISI 304Ti grade 2Yield strength (MPa)215318Tensile strength (MPa)505428Young's modulus (GPa)193113Elongation (%)4028Poisson's ratio0.290.37 Mechanical properties of AISI 304 and Ti grade 2. Conducting the welding experiments at room temperature, a pneumatic system was used to regulate pressure on an RSW machine that utilized two electrodes of type B and class 2 made of a chromium-zirconium-copper alloy from RWMA group A. A 4-mm-diameter circular contact region characterises the electrodes. The cooling water flow rate used in this study was 3 L per minute. By using a digital screen, the experimental welding parameters were entered into the RSW equipment. Fig. 2 presents an illustration of the RSW operation. This welding experiment employed the following RSW variables: 1–5 pulses per weld, 0.6–1.4 s welding and squeeze times, 0.5–1.5 s holding time, and 2–8 bar of pressure. Table 4 shows the set-up for using the Taguchi technique to determine the RSW setup of each test using the DOE technique. Fig. 3 displays the welded samples.Fig. 2RSW process schematic diagram.Fig. 2Table 4RSW experiment conditions based on the DOE.Table 4Exp. No.Welding casesWelding current (A)Pressure (bar)Welding time (s)Squeeze time (s)Holding time (s)Pulse welding (−)1E1F1I1J150002.00.60.60.5012E2F2I2J250003.50.80.80.7523E3F3I3J350005.01.011.0034E4F4I4J450006.51.21.21.2545E5F5I5J550008.01.41.41.5056E6F6I6J655002.00.81.01.2557E7F7I7J755003.51.01.21.5018E8F8I8J855005.01.21.40.5029E9F9I9J955006.51.40.60.75310E10F10I10J1055008.00.60.81.00411E11F11I11J1160002.01.01.40.75412E12F12I12J1260003.51.20.61.00513E13F13I13J1360005.01.40.81.25114E14F14I14J1460006.50.61.01.50215E15F15I15J1560008.00.81.20.50316E16F16I16J1665002.01.20.81.50317E17F17I17J1765003.51.41.00.50418E18F18I18J1865005.00.61.20.75519E19F19I19J1965006.50.81.41.00120E20F20I20J2065008.01.00.61.25221E21F21I21J2170002.01.41.21.00222E22F22I22J2270003.50.61.41.25323E23F23I23J2370005.00.80.61.50424E24F24I24J2470006.51.00.80.50525E25F25I25J2570008.01.21.00.751Fig. 3Dissimilar RSW samples.Fig. 3 RSW process schematic diagram. Table 4RSW experiment conditions based on the DOE.Table 4Exp. No.Welding casesWelding current (A)Pressure (bar)Welding time (s)Squeeze time (s)Holding time (s)Pulse welding (−)1E1F1I1J150002.00.60.60.5012E2F2I2J250003.50.80.80.7523E3F3I3J350005.01.011.0034E4F4I4J450006.51.21.21.2545E5F5I5J550008.01.41.41.5056E6F6I6J655002.00.81.01.2557E7F7I7J755003.51.01.21.5018E8F8I8J855005.01.21.40.5029E9F9I9J955006.51.40.60.75310E10F10I10J1055008.00.60.81.00411E11F11I11J1160002.01.01.40.75412E12F12I12J1260003.51.20.61.00513E13F13I13J1360005.01.40.81.25114E14F14I14J1460006.50.61.01.50215E15F15I15J1560008.00.81.20.50316E16F16I16J1665002.01.20.81.50317E17F17I17J1765003.51.41.00.50418E18F18I18J1865005.00.61.20.75519E19F19I19J1965006.50.81.41.00120E20F20I20J2065008.01.00.61.25221E21F21I21J2170002.01.41.21.00222E22F22I22J2270003.50.61.41.25323E23F23I23J2370005.00.80.61.50424E24F24I24J2470006.51.00.80.50525E25F25I25J2570008.01.21.00.751 RSW experiment conditions based on the DOE. Dissimilar RSW samples. Shear force and hardness tests This study used the tensile shear force experiment for analysing the quality of the RSW joints and computing the highest fractured shear force required to break the dissimilar grade 2 Ti/AISI 304 joints. Tensile shear force testing was performed on each sample in cases E, F, I, and J to measure the peak shear force and select the best sample based on the force and displacement data from each experiment. Utilizing a universal testing apparatus capable of a maximum load of up to 50 kN at room temperature and a speed of 5 mm/min, the shear force was assessed. After the shear force test was carried out, Fig. 4 shows the fractured RSW samples of the four scenarios.Fig. 4Fractured RSW samples.Fig. 4 Fractured RSW samples. Where: Case E (equal thickness of 1 mm for Ti and ASS 304), Case F (unequal thickness of 0.5 mm for Ti and 1 mm for ASS 304), Case I (unequal thickness of 0.5 mm for ASS 304 and 1 mm for Ti), Case J (equal thickness of 0.5 mm for Ti and ASS 304). In accordance with the shear force results, the micro-hardness measurements were performed on the RSW samples that exhibited the highest, intermediate, and lowest shear force for each case. Using a pyramidal diamond indenter tester (HVS-1000 series, Laryee Testing Machines), the Vickers hardness measurement of the welded sample includes the base metal (BM) zone, heat-affected zone (HAZ), and nugget zone (NZ). A dwell period of 10 s and a load of 2.98 N were used to measure the hardness. All hardness profile lines were carried out on a diagonal path at a constant interval of 0.5 mm, starting from the BM, continuing through the HAZ, and finally reaching the nugget zone (NZ) as shown in Fig. 5. The sectioned welded samples were mounted in acrylic, followed by grinding and polishing for the microstructure examination. In addition, the samples were etched at room temperature with a solution of 2 % HF, 6 % HNO3, and 92 % distilled water.Fig. 5Micro-hardness profile along the weld line.Fig. 5 Micro-hardness profile along the weld line. Prediction models In the current investigation, different regressions such as ANNs, random forest, CatBoost, and gradient boosting were applied to evaluate the prediction performance. ANN modelling The neural network notion originated from McCulloch and Pitts's investigation in the 1940s. Essentially, they hypothesized that ANNs were capable of computing numerous mathematical and logical calculations. Tens of thousands of academics across disciplines have recently focused on neural networks. In general, it is clear that neural networks are interconnected with every scientific discipline. Healthcare, aerospace, defence, the arts, cinematography, music, and a host of industrial technologies are among the many fields that embraced ANNs. Neural networks enhance their performance via data learning rather than relying on presumptions while creating their model. A common thought is that neural networks are simplified models of the way the brain really processes neural input [53,54]. The neural network method has various uses, but one is training a model to accurately predict process dynamics using input and output data [55,56]. Welding operations are one example of an area where this approach excels, given that it is exceedingly challenging to acquire a comprehensive knowledge of physical mechanics. With the use of training data, a neural network is able to pick up new capabilities. The input variables are the first step in the process, and the last step is to compare the forecasted and actual outputs. The network then adjusts the value of the linkages within the layers. The operation is halted when the network generates favourable outcomes for the training set. Applying a validation set that is excluded from the training set to assess the network is another way to enhance network convergence. Multilayer perceptron (MLP) neural network A network's topology consists of its components' structure, connections, inputs, and outputs. An ANN's topology may be defined by its input and output layer numbers, the neuron numbers within every layer, and the types of transfer functions that connect them [57]. The structure of an ANN typically includes an input layer, an output layer, and at least one hidden layer. Each layer of the network comprises numerous neurons. The neurons number in the input layer is equivalent to the number of input variables, whereas the neuron number in the output layer corresponds to the output number linked with each input. The transfer function [58] enables the neurons in the layers to transmit weight both forwards and backwards between the layers. This research used a back-propagation learning technique to train an ANN model employing an MLP architecture. As stated in Equation (1), the MLP is defined as follows:(1)y=f(net)=(∑i=1nwix+b)where: y: the outputs, f: the activation function, x: the input wi: the weights, b: the bias. Using MATLAB R2021a, an MLP structure was created to predict the tensile shear force for the four RSW cases. Data for the inputs and outputs were gathered from measurements taken from the welded samples using the RSW method. However, there are seven input variables: welding current, pressure, welding time, squeeze time, holding time, pulse welding, and sheet thickness. According to the schematic in Fig. 6, all of the net structures used in this study had a single hidden layer with ten neurons connected to the input and output layers. As for the other primary training parameters used in this investigation, they were: learning rate 0.01, performance target 0.001, and epochs 1000. Notably, in order to determine the optimal model and structure, many training and transfer functions were trained and tested.Fig. 6ANN structure of the RSW process.Fig. 6 ANN structure of the RSW process. Training and transfer functions Training a neural network on a dataset involves optimizing the network's parameters to generate an accurate prediction map. Training functions are just another name for the many optimization techniques available. In order to teach a network to recognize and respond to a given input, an algorithm known as the training function must be implemented. The training performance is affected by a number of factors, including the target performance, the trained data set, and the biases and weights. Defining a fitting training function for the network is one obstacle to creating quick, accurate, and excellent predictions. Thus, 12 distinct training functions were run in MLP networks to map the inputs to the outputs within the context of this research. The training functions utilized in this paper are outlined in Table 5.Table 5Training functions employed in the MLP.Table 5AlgorithmDescriptionTrainlmLevenberg-MarquardtTrainscgScaled conjugate gradientTraincgfConjugate gradient with Fletcher-Reeves updatesTraincgbConjugate gradient with Powell-Beale restartsTraincgpConjugate gradient with Polak-Ribiere updatesTrainbfgBFGS Quasi-NewtonTrainrpResilient backpropagationTrainossOne step secantTraingdGradient descent backpropagationTraingdmGradient descent with momentumTraingdaGradient descent with adaptive learning rateTraingdxGradient descent momentum and an adaptive learning rate Table 5Training functions employed in the MLP.Table 5AlgorithmDescriptionTrainlmLevenberg-MarquardtTrainscgScaled conjugate gradientTraincgfConjugate gradient with Fletcher-Reeves updatesTraincgbConjugate gradient with Powell-Beale restartsTraincgpConjugate gradient with Polak-Ribiere updatesTrainbfgBFGS Quasi-NewtonTrainrpResilient backpropagationTrainossOne step secantTraingdGradient descent backpropagationTraingdmGradient descent with momentumTraingdaGradient descent with adaptive learning rateTraingdxGradient descent momentum and an adaptive learning rate Training functions employed in the MLP. In an ANN, multiplying the inputs of each node by their respective weights yields the final products, which are then added together. This total is then passed via a mathematical function called a transfer function. A transfer function processes the collected weights and determines the output of each layer for a given set of input weights. Establishing appropriate transfer functions is a complex mission that relies mostly on the topology of the network, among other considerations. This study involved the implementation of several transfer functions to improve the prediction accuracy. These functions were the hyperbolic tangent sigmoid function (tansig), the log sigmoid transfer function (logsig), and the pure linear function (purelin). The transfer functions may be computed using Equations (2), (3), (4). In all scenarios, the output layer was processed with the logsig.(2)tansig(n)=21+e−2n−1(3)logsig(n)=11+e−n(4)purelin(n)=n Data distribution Predicting the outcome of welded joints may be done by using the outcomes of the RSW joints as objectives. Training, validation, and test datasets are necessary partitions created from actual data. Creating separate datasets for training and testing has the potential to significantly impact the accuracy of any model. Shahin et al. [59] hold the view that the ratio of data from various subsets does not seem to have any clear relationship. Zhang et al. [60] state that the dividing ratio is a big difficulty with datasets and that, generally speaking, there is not yet a solution for this problem. In accordance with [61,62], 70 % of the data was allocated for training purposes, 15 % assigned for testing and 15 % for validation in their research. The present study used a dividing ratio of 80 % for training data and 20 % for testing data, which was kept for final testing. The 80 % of data that was used for the training stage was divided into: 70 % for training, 15 % for testing, and 15 % for validation. The actual data for the RSW joints was collected from 100 samples taken from the experiments, and this served as the data for training and testing. Gradient boosting machine learning algorithm One of the most effective ML algorithms, the gradient boosting decision tree, learns a function by mapping inputs to targets using recognized input and target variables. Its ability to automatically handle sophisticated connections and relations among defined inputs [63], its better interpretability than other ML approaches [64], and being computationally simple, make it suitable to use and implement, generating verified forecasting findings in an actual and practical environment [[65], [66], [67]]. Consequently, it is being used as the basis for embedded failure prediction methods. The gradient boosting algorithm is implemented as both a regressor and a classifier. This is a collective learning predicative algorithm in which each step tries to enhance the errors of the preceding step in a structure known as a decision trees. Using this algorithm with a depth of 6, a minimum sample division of 2, 1000 trees, and least-squares loss, the shear force of the welded joints in the present investigation was predicted. This is illustrated in Fig. 7. Aiming to reduce error, least squares loss identifies predictive points and applies them to the line that has already been fitted. The profundity of a regression tree indicates the number of divisions that can be generated before a prediction is made. To make weak learners strong, gradient boosting trains models consecutively, with each model fixing the errors of the one before it. Gradient boosting derives its gradient from its ability to minimize the loss function through gradient descent. In essence, the boosting approach is an iterative process that involves learning nodes, fitting findings to the data set, analysing errors between predicted and real values, and then learning the already acquired nodes. In addition, this loop continues until the iteration number that was previously specified is achieved. The gradient boosting model uses the same data division (80 % for training and 20 % for testing) as the ANN.Fig. 7Structure of the gradient boosting ML algorithm.Fig. 7 Structure of the gradient boosting ML algorithm. CatBoost machine learning algorithm A high-performance, open-source gradient boosting technique specifically designed to effectively handle categorical data is CatBoost [68]. In particular, CatBoost provides a number of benefits for datasets that include categorical data, which may be difficult for conventional algorithms to handle. Among the several benefits of CatBoost is its built-in support for categorical features, which eliminates the need for pre-processing methods such as one-hot encoding or label encoding [69]. In addition, CatBoost provides efficient encoding by using a technique called target-based encoding with statistical approaches to convert category variables into numerical values in a way that avoids over-fitting. It is possible to reduce the occurrence of over-fitting by processing the data so that each iteration of the model relies only on previous data to make predictions. This approach works especially well with smaller datasets. It is not necessary to do substantial hyper parameter adapting to modify the parameters since CatBoost performs well even with default values [70]. In its default configuration, CatBoost generates 1000 trees with two leaves, perfectly symmetrical binary trees with six levels of depth. The automatic calculation of the learning rate is done under the constraints of the iteration number and the features of the training dataset. Maximum effectiveness is achieved when the learning rate is automatically set. Reducing the number of iterations and increasing the learning rate can speed up training. The CatBoost model has used the same data split as the ANN and gradient boosting models, with 80 % of the data assigned for training and 20 % for testing. Random forest machine learning algorithm Random forest is a commonly used and potent ensemble ML approach that integrates multiple decision trees during training and produces the mode (classification) or mean prediction (regression) of the individual trees. It was introduced by Adele Cutler and Leo Breiman in 2001. The algorithm's benefits include accurate prediction, capable of dealing with data in high dimensions that exhibit non-linear input effects and interactions, and the ability to prioritise inputs based on their significance and contribution. On the basis of a decision tree, the random forest model generates an interpretable model for regression and classification tasks. Based on the feature values, it divides the data into subsets and makes a series of decisions to arrive at a final prediction. Bagging is employed by random forest, which entails the construction of a decision tree for each training data subset by replacing variables. This assists in decreasing variance and preventing over-fitting. Improving the algorithm's predictive power required adjusting three configuration settings. A minimal number of data points at a leaf, also known as the node size, is employed to avoid over-fitting. The node size, the maximum number of randomly chosen inputs to be evaluated at each split node and the number of trees are the three setup parameters [71,72]. A random subset of features is selected at every split in the construction of the decision tree, rather than all of the features being considered. This results in the introduction of additional randomness and the ability to generate trees that are less correlated. A decision tree is generated for each bootstrapped dataset. A random subset of features is selected at each node during the tree construction process, and the optimal split among these features is determined. The hyper-parameters have a related influence on the effectiveness of the ML model, as well as the patterns and speed at which the algorithm recognizes and analyses data [73]. The random forest model applied the same data distribution as the ANN, gradient boosting, and CatBoost models. Utilizing cross-validation is decisive for ideal forecasting performance when tuning hyper-parameters on the datasets. This investigation employed a ten fold cross-validation strategy. The data was partitioned into ten subgroups, and in each iteration, one subgroup was designated for testing the trained model [74,75]. The illustration scheme for the Random Forest employed in the present investigation is illustrated in Fig. 8.Fig. 8Structure of the random forest ML algorithm.Fig. 8 Structure of the random forest ML algorithm. Performance metrics Selecting appropriate validation metrics is crucial for assessing the accuracy of a predictive model, and incorporating real-world data is vital for enhancing the model's performance. This research conducted a comparison and validation of several training and transfer functions to assess and quantify the level of good match between the real and forecasted findings. The selection of a suitable validation standard is of the utmost importance and presents a significant challenge when evaluating outcomes and reducing errors. To evaluate performance, all ANN, CatBoost, gradient boosting, and random forest models trained and tested in this research were compared by employing favourable metrics. The following metrics were utilized: mean squared error (MSE), root mean squared error (RMSE), mean error (ME), mean absolute error (MAE), mean relative error (MRE), and the coefficient of determination (R2). A high R2 value, close to 1, implies excellent performance, whereas low values of MSE, RMSE, and MAE, around 0, imply minimal error. In this situation, consistent performance can be guaranteed, and conversely, a substantial difference between the RMSE and MAE observations indicates important discrepancies in the error distribution. In addition, the RMSE and MAE provide a more precise assessment compared to other validation measures. While the MAE offers more stability, the RMSE is more responsive to errors. The error (E), MSE, RMSE, ME, MAE, MRE, and R2 can be calculated from the following:(5)E=(yp−yt)(6)MSE=1N∑i=1N(yp−yt)2(7)RMSE=MSE(8)ME=1N∑i=1N(yp−yt)(9)MAE=1N∑i=1N(∣yp−yt∣)(10)MRE=1N∑i=1N(∣[(yp−yt)/(yt)]∣)(11)R2=[(Stot.−Sres.)/((Stot.)(12)Stot.=∑i=1N(yt−y‾)2(13)y‾=1N∑i=1N(yt)(14)Sres.=∑i=1N(yp−yt)2where: yp: the predicted value, yt: the target value, N: total number of experiments. Evaluation of the RSW parameters contribution The relative or feature importance analysis examines the impact of the welding input factors on the outputs. Nevertheless, this study demonstrates the weighting of each feature in the predictive model by observing the shift in prediction averages with changes in the feature importance value. The findings are significantly affected when input variables with high feature importance values are substituted with variables with lower feature importance values. Feature importance is already a built-in tool of the Gradient boosting, CatBoost, and Random Forest algorithms. According to the aforementioned literature, no publication has compared the significance of welded joints produced by the RSW process based on the relative importance observations. Results and discussions Joint mechanical properties The incorporation of spot-welded joints into the design of a structure guarantees that the shear force is the dominant load experienced by the welds whenever the joints undergo tension or compression. The welds might be subject to tension loading, shear stress, or both. In the former scenario, the loading direction would be perpendicular to the joint's plane [76]. It is important to note that spot welds utilized in automotive construction may exposed to shear stress owing to the rotation or relative motion of neighbouring sheets, and tensile loads caused by separation forces operating perpendicular to the sheets while carrying out their functions [77,78]. However, the RSW quality is primarily evaluated by the shear force of the RSW joints [79]. To fulfil this requirement, this investigation used four Ti/St304 welded cases with equal and unequal thicknesses for obtaining the tensile shear force, meaning that there are 25 samples for each case. The RSW cases based on the selected thickness as shown in Table 4 were referred to as the following: similar thickness of 1 mm for Ti and St 304 as case E, dissimilar thickness of 0.5 mm for Ti and 1 mm for St 304 as case F, dissimilar thickness of 0.5 mm for St 304 and 1 mm for Ti as case I, and similar thickness of 0.5 mm as case J. The RSW parameters were tested using the DOE method on the samples from each instance to determine the shear force. Based on the DOE evaluation, the shear force analysis of scenario E reveals that, with a maximum shear force of 2.183 kN, sample 14 is the best one, as seen in Fig. 9. With welding parameters of 6000 A welding current, 6.5 bar of pressure, 0.6 s welding time, 1 s squeeze time, 1.5 s holding time, and 2 pulses per weld, the maximum shear force was achieved. On the other hand, sample 21 as shown in Fig. 7, gave 0.528 kN as the lowest shear force under RSW conditions including a welding current of 7000 A, pressure of 2 bar, welding time of 1.4 s, squeeze time of 1.2 s, holding time of 1 s, and 1 pulse per weld.Fig. 9Tensile-shear force results of 1-1 mm Ti/St304 (case E).Fig. 9 Tensile-shear force results of 1-1 mm Ti/St304 (case E). The main effect curves in Fig. 10 show that the shear force of case E, according to the RSW parameters, has a minimum value of 1.077 kN at a welding current of 5500 A and a peak value of 1.471 kN at a welding current of 6500 A. Even though the shear force deteriorates further when the welding current increases, it still outperforms the force at 5500 A. While a primary reason for the enhancement in shear force at 6000 A is the generation of adequate heat, which facilitates the direct formation of molten metal between the welded joints, nevertheless, an increase in welding current beyond 6000 A results in a reduction in shear force as a consequence of excessive metal expulsion [80]. This leads to brittle and weak weld metal, consequently diminishing the shear strength of the welded joints. This observation aligns with the findings reported by Ref. [14]. Nevertheless, their research revealed a maximal shear force of 0.378 kN. Controlling the heat input directly influences the weld joint performance by reducing grain coarsening, which has an inverse impact on the shear force. This is the reason why the shear force of the RSW joints in the current paper is better than in earlier research.Fig. 10Shear force main effect plots of RSW parameters of case E.Fig. 10 Shear force main effect plots of RSW parameters of case E. The aforementioned improvement in shear force is also achieved by applying all of the RSW parameters at different levels and not leaving out variable. The evidence for achieving better welding properties is supported by a scanning electron microscopy (SEM) inspection (Fig. 11) of sample 14 which showed the highest shear force of 2.183 kN. The SEM results revealed that the two metals diffused into each other and there was complete diffusion, as the diffusion line between the two metals is almost visible.Fig. 11SEM inspection of sample 14 in case E.Fig. 11 SEM inspection of sample 14 in case E. A through hole in the diffusion line between the two metals, sometimes known as burn-through, may result from very forceful ejection. It is quite probable that cracks and holes will occur within the weld nugget [81]. To get tensile shear strength, employing higher welding currents is not recommended since this leads to poor joint formation. Sample 21 showed the lowest shear force of 0.528 kN, but the SEM examination of this sample showed a through hole defect in the diffusion line between the two metals as seen in Fig. 12. This explains why increasing the welding current lowers the mean maximum load.Fig. 12SEM inspection of sample 21 in case E.Fig. 12 SEM inspection of sample 21 in case E. An examination of the effect of pressure on the mean shear force in case E (Fig. 10) revealed that, up to 6.5 bar of welding pressure, the shear force increases in a nearly polynomial fashion, reaching a maximum of 1.526 kN. At 8 bar, on the other hand, the mean shear force drops to 1.2072 kN. As the primary component in lowering the heat input and resulting in a smaller nugget zone, increasing the welding pressure to 8 bar causes the shear force to drop drastically. Fig. 10 illustrates that 3.5 bar of pressure resulted in the minimal shear force of 0.9638 kN. This is due to the fact that voids or shrinkage at lower pressures are more likely to occur when the electrodes are removed before the weld pool has completely solidified. It might be common to find these holes close to the weld metal's core, where the final solidification took place [82,83]. The study found that raising the welding time from 0.6 to 1 s led to an increase in the shear force from 1.026 to 1.518 kN, the highest shear force. Conversely, increasing the welding time beyond 1 s, specifically between 1.2 and 1.4 s, significantly reduced the shear force, hitting the lowest recorded of 0.932 kN at 1.4 s. This is because the longer the specimen is exposed to the welding process, the more weldment overheating at the interface generates irregularities during the nugget zone formation, thus resulting in a weak welded joint. This takes place when the RSW joint becomes overheated, which disrupts the development of the weld nugget and leads to a poor welded connection. Upon measuring the squeeze time impact on the shear load, it was recorded that the optimal mean load of 1.3 kN was observed with 1 s as the squeeze time, while a squeeze time of 1.2 s produced the lowest mean load of 0.837 kN. Increases in shear load with regards to the holding time were noticed to be almost proportional, indicating that the maximal mean shear load of 1.254 kN was shown when the holding time reached 1.5 s. On the contrary, the lowest mean force of 1.082 kN was depicted with a holding time of 0.75 s. With a pulse welding of 2, the mean shear force hit the maximum of 1.437 kN, while, conversely, with 3 pulses, the minimal shear force of 0.869 kN was noted. Examining the shear load of 0.5–1 mm Ti/St304 (case F) (Fig. 13) showed that the optimal shear load of 2.589 kN was noted with sample 13 when applying RSW conditions of 6000 A welding current, 5 bar of pressure, welding, squeeze, and holding times of 1.4, 0.8, and 1.25 s respectively, and 1 pulse per weld. By contrast, it was demonstrated that sample 18 with welding parameters of 6500 A welding current, 5 bar of pressure, and welding, squeeze, and holding times of 0.6, 1.2, and 0.75 s respectively, and 5 pulses per weld produced the lowest shear load of 0.476 kN.Fig. 13Tensile-shear force results of 0.5–1 mm Ti/St 304 (case F).Fig. 13 Tensile-shear force results of 0.5–1 mm Ti/St 304 (case F). The maximal mean shear force of 1.397 kN was seen at a welding current of 5500 A, while the minimal value of 0.978 kN was recorded at 7000 A, according to the main effects plot for case F with regard to the welding current, as presented in Fig. 14. The pressure welding experiment results exhibit that a pressure of 3.5 bar yielded the least load of 0.877 kN, while a pressure of 5 bar yielded the highest mean value of 1.318 kN. The experimental findings pertaining to the impact of welding time demonstrated that a 1.2 s welding duration raised the mean shear force to a maximum value of 1.343 kN. Inversely, 1 s was shown to have the least influence on the mean force.Fig. 14Shear force main effect plots of RSW parameters of case F.Fig. 14 Shear force main effect plots of RSW parameters of case F. In addition, the mean tensile shear force decreased from 1.248 kN to 0.918 kN as the squeeze time rose from 0.6 to 1.2 s, according to the data in Fig. 14. Most importantly, the shear load increased to 1.311 kN with the maximum impact achieved at a squeeze time of 1.4 s. Holding time results show that 0.5 s had the greatest influence on shear load, causing it to peak at 1.284 kN, while additional increases in squeeze time reduced the shear force until 1.5 s, when it dropped to 1.036 kN, with the least noticeable effect. Finally, pulse welding exerted a significant influence on the shear force. Specifically, the shear force decreased dramatically from 1.949 kN, the highest, to 0.724 kN, the lowest, as the pulse welding increased from 1 to 5 pulses. Upon application of the Taguchi method on 0.5–0.5 mm Ti/St 304 (case I) for assigning the ideal specimen, the findings of the shear force verified that sample 20 exhibited the optimal shear load of 1.708 kN, as noted in Fig. 15. This specimen was welded using RSW conditions of 6500 A welding current, 8 bar of pressure, 1 s welding time, 0.6 s squeeze time, 1.25 s holding time, and 1 pulse per weld. Sample 19, conversely, had a minimum shear load of 0.585 kN after being resistance spot-welded with a 6500 A welding current, 2 bar of pressure, 1.2 s welding time, 0.8 s squeeze time, 1.5 s holding time, and 3 pulses per weld.Fig. 15Tensile-shear force results of 0.5–0.5 mm Ti/St304 (case I).Fig. 15 Tensile-shear force results of 0.5–0.5 mm Ti/St304 (case I). The mean impact curves in Fig. 16 show that the shear load gradually reduced from 0.944 kN to its smallest of 0.879 kN when the welding current is increased from 5000 A to 6500 A. On the other hand, 1.087 kN is the maximal force obtained with 7000 A of welding current. Plots of the pressure welding impact show that the shear force peaked at 1.183 kN at 8 bar, while it was at its lowest point of 0.821 kN at 6.5 bar. It was shown that raising the welding time from 0.6 to 0.8 s improves the shear force from the lowest of 0.841 kN to the highest of 1.034 kN, in accordance with the influence of welding time. After examining how the squeeze time affected the shear load, it became apparent that the highest shear load of 1.212 kN was created in 0.6 s, while the lowest shear load of 0.775 kN was obtained in 1.4 s. According to the holding time data, the peak shear load of 1.095 kN was recorded at a holding time of 0.5 s, while the lowest shear value of 0.816 kN was recorded at a holding time of 1 s. This is still less than the maximum value even if increasing the holding time by more than 1 s enhances the shear force. As for the effects of pulse welding, at 2 pulses the shear force of 1.26 kN reached its maximum effect, while at 5 pulses the shear load of 0.805 kN reached its lowest influence.Fig. 16Shear force main effect plots of the RSW parameters for case I.Fig. 16 Shear force main effect plots of the RSW parameters for case I. The ideal RSW joint of 1–0.5 mm Ti/St 304 (case J) was obtained with sample 13 as presented in Fig. 17 with a shear load of 1.851 kN, which was confirmed by the DOE optimization utilizing the RSW parameters of 6000 A welding current, 5 bar of pressure, and welding, squeeze, and holding times of 1.4, 0.8, and 1.25 s, respectively, and 1 pulse per weld. Conversely, sample 6 had the least shear load of 0.835 kN under the following RSW conditions: 5500 A, 2 bar of pressure, and welding, squeeze, and holding times of 0.8, 1, and 1.25 s respectively, and five pulses per weld. As evident from the mean impact curves in Fig. 18, when the welding current is raised from 5000 A to 6000 A, the shear load declines gradually from 1.494 kN the maximum force to its minimal force of 1.276 kN.Fig. 17Tensile-shear force results of 1–0.5 mm Ti/St 304 (case J).Fig. 17Fig. 18Shear force main effect plots of the RSW parameters for case J.Fig. 18 Tensile-shear force results of 1–0.5 mm Ti/St 304 (case J). Shear force main effect plots of the RSW parameters for case J. However, while a further increase in the welding current beyond 6000 A improves the shear force, these enhancements are lower than those observed at 5000 A. The plots of the pressure welding impact reveal a remarkable trend, where the shear force increased gradually from the smallest force of 1.088 kN at 2 bars to the highest force of 1.609 kN at 8 bar. Since the electrode pressure dictates the formation of fusion zone voids, these enhancements at greater welding pressures are a result of fewer cavities or voids in the cooled weld nugget. Regarding the influence of the welding time, it was also found that the shear force increased proportionally when increasing the welding time from 0.6 to 1.4 s. In other words, the least shear load of 1.162 kN was at a welding time of 0.6 s, while 1.581 kN as the peak shear force was found at 1.4 s. Upon investigating the influence of the squeeze time on the shear load, it was proven that 0.6 s gave the maximal shear load of 1.625 kN and that 1.2 s achieved the least shear force of 1.231 kN. When it comes to the holding time results, the highest shear load of 1.444 kN was noted with a 0.5 s holding time, and a 1.5 s holding time gave the minimal shear load of 1.279 kN. Relating the influence of pulse welding, the shear force altered gradually with raising the pulse welding from 1 to 5, meaning that 1 pulse gives the ideal shear force of 1.607 kN, while 5 pulses produce the smallest shear force of 1.279 kN. The analysis of the rank response of the RSW parameters for the four welding cases is done with the aid of a Pareto chart, which was evaluated after measuring the shear force for each case as shown in Fig. 19. The relative importance of each RSW factor for case E was evaluated, and the factor contributing the most was the welding pressure, whereas the welding current was the lowest contributing parameter, as shown in Fig. 19a. According to Fig. 19b, it was verified that pulse welding was the biggest influential factor and squeeze time was the least affected parameter in case F. Contrasting with case F, where squeeze time was the least influential factor, Fig. 19c reveals that squeeze time in case I had the greatest impact on the shear load. In case I, the welding time demonstrated the lowest ranked impact. Case J exhibited similar observations to case E, where the welding pressure was the biggest affecting variable and the welding current was the lowest, as shown in Fig. 19d.Fig. 19Pareto charts of the four cases.Fig. 19 Pareto charts of the four cases. Failure mechanism The failure mechanism of RSW joints has a fundamental effect on their mechanical properties [[84], [85], [86], [87], [88]]. There are four recognized modes of failure for spot welds, as listed in Refs. [89,90]: interfacial (IF), pull-out (PF), partial interfacial (PIF), and partial pullout-partial width (PP-PW). The shape of the fusion zone (FZ), sheet metal thickness, and the ratio between nugget zone hardness and failure spot hardness throughout shear load experiment are used to identify the fracture mode of RSW specimens [91]. The mechanism of failure of the test samples was examined in the present investigation. Regardless of the welding case and the parameters used, the findings of the shear load tests always show the same failure mode: interfacial failure (IF). Consequently, the metallographic properties of the fractured surface were examined using only one test specimen. Sample 14 from case E was selected from among the other welded samples due exhibiting to the its highest shear force. Fig. 20 shows micrographs of the surface of the titanium side fracture caused by tensile shear force. As seen in Fig. 20a, fracture initiation can be observed beginning at the HAZ border and extending from the HAZ towards the middle of the weld nugget. This crack spreads throughout the faying surfaces between the welded sheet metals in a direction perpendicular to the applied force, as shown in Fig. 20b. Because of the fracture, the shear force and weld strength would decrease due to interfacial failure. The same phenomenon took place when the surface of spot-welded DP600 steel that had fractures was studied by Ref. [92].Fig. 20The interfacial failure mode under microscope inspection.Fig. 20 The interfacial failure mode under microscope inspection. SEM analysis of the interface failure of the Ti side in Fig. 21 shows, as seen in Fig. 21a, that a portion of the fracture surface displays a cleavage facet indicating that a brittle fracture occurred. A river-like shape is shown in Fig. 21a, which is caused by the crack's propagation throughout the tensile shear stress experiment. Typically, the fracture will separate into terrace-like stages because of the fact that each grain in the FZ has distinct orientations from one another. These cracks processes are characterized by cleavage fracture, a kind of trans-granular brittle fracture. Observing Fig. 21b, it is evident that some secondary cracks were generated in the weld nugget. Fig. 21c demonstrates the presence of some elongated dimples with a white colour which is thought to be the main reason for the improving shear force in the current study compared to the previous study [14], and this is confirmed by the XRD analysis in Fig. 22. Numerous dendritic shear ledge patterns seen on the fracture surface in Fig. 20d provide conclusive proof that the difference in the solidification shrinkage is the root cause of the welding defects.Fig. 21SEM inspection of the fractured surface on the Ti side.Fig. 21Fig. 22SEM inspection of the fractured surface on the St side.Fig. 22 SEM inspection of the fractured surface on the Ti side. SEM inspection of the fractured surface on the St side. Examination of the fractured surface of AISI side as shown in Fig. 22a, reveals several cracks and a river-like shape on the fractured stainless-steel side, demonstrating the occurrence of a brittle fracture. Also, the presence of cleave facets observed in Fig. 22b, c, and d on the stainless-steel side are proof of a trans-granular fracture generated between the welded joints over the grain boundary as the fracture continues to expand. A cleavage fracture, a common kind of brittle overload fracture, is another name for this type of fracture. Crack initiation area origin, carbide precipitation, is another factor that leads to the formation of these fractures. Welded joints are brittle because of this. It is worth mentioning that the melting point of each metal is different, meaning that titanium melts at approximately 1668 °C, while AISI 304 melts at around 1400–1450 °C. Additionally, there is a variation in the thermal expansion between these metals, with AISI 304 having a thermal expansion approximately twice that of titanium. All these factors caused unequal volume expansion and thermal stress, which in turn led to the occurrence of brittle fractures. Moreover, the resistivity of the Ti is different to that of the St, causing the shrinkage rate of the two metals to be different and generating pores and cracks after the solidification is completed. As shown in Fig. 23, the XRD analysis on the fusion line of the optimal Ti/AISI 304 (case I, sample 20) identifies the generated phases in the welded joint. The existence of the NiTi phase, as shown by the XRD results, is a desired property of welded titanium and stainless steel joints since it helps to reduce the quantity of brittle intermetallic compounds such as FeTi, Fe2Ti, and CrTi, which developed in the joint under investigation. This enhances the overall strength of the welded junction. Another phase identified by the XRD analysis was γ-Fe. This phase was shown to enhance the ductility of the welded joint, as proved by the presence of elongated dimples in the SEM test, as shown in Fig. 21c.Fig. 23XRD analysis of the optimum Ti/AISI 304 joint (case I, sample 20).Fig. 23 XRD analysis of the optimum Ti/AISI 304 joint (case I, sample 20). Micro-hardness distribution Evaluation of the hardness distribution along the RSW joints is of the utmost importance. Owing to the different temperature generation suffered by the weldment, several phases will emerge and be divided into three main regions: base metal, heat-affected zone (HAZ), and nugget zone (NZ). Because of this, the hardness values in certain areas will differ. This paper conducted a hardness test using the micro-hardness Vickers method, applying a force of 2.98 N. The test consists of 20 indentations spaced 0.5 mm apart across the welded joint. Hardness measurements were carried out in the present study on the three chosen RSW samples of instances D, G, and H. These three welded samples were taken from the joints that showed the maximum, middle, and smallest shear force, in that order, according to the measurements of shear load. In the present paper, the hardness determinations were applied to the three chosen specimens of cases E, F, I and J. These three samples were taken according to the shear load test by selecting the joints that exhibited the minimum, middle, and peak shear load, respectively. The hardness measurements were conducted by starting with the BM, then proceeding to HAZ on the titanium side, reaching the NZ, and proceeding to the HAZ and BM on the AISI 304 side. The hardness distribution for 1−1 mm Ti/St304 (case E), is shown in Fig. 24. In comparison to the BM, the Vickers hardness in the NZ and HAZ was noticeably greater. Sample E21, which had the lowest shear load, had the greatest micro-hardness of all samples in case E. The BM zone had the lowest Vickers-hardness of 146 and 155 HV for the Ti and St sides respectively, whereas for sample E21, 992.2 HV was recorded in the NZ. The heat-affected zone recorded 837.2 HV. In contrast, sample E7, the sample with the greatest shear load, was found to have less micro-hardness in the HAZ and NZ than the other samples in case E. The NZ had a hardness of 954 HV with 805 HV at the HAZ, whereas the BM of the E7 sample on the Ti and St sides recorded a similar hardness value to that of the E21 sample. The micro-hardness findings for sample E14, which displayed the intermediate shear force, shown between samples E7 and E21 are 917.4 and 766.7 HV, respectively, for the hardness in the NZ and HAZ. Moreover, the hardness of the BM was around 145 and 157.2 HV on the Ti and St sides, respectively.Fig. 24Micro-hardness results of 1−1 mm Ti/AISI 304 (case E).Fig. 24 Micro-hardness results of 1−1 mm Ti/AISI 304 (case E). Exploring the micro-hardness of 0.5–1 Ti/AISI 304 (case F) in Fig. 25 demonstrated similar observations to the case E of the hardness variation along the BM, HAZ, and NZ. The figure reveals that sample F18 exhibited the lowest shear force of the case F samples, demonstrating the highest Vickers hardness in the HAZ and NZ compared to specimens F22 and F13. Based on Fig. 25, the hardness observations for sample F18 varied from the maximal value of 1078 HV at the NZ to 665.2 HV at the HAZ. The hardness observations in the BM of this case are different on the Ti and AISI 304 sides, with the BM on the Ti side recording a hardness of approximately 215.6 HV and 189.5 HV on the AISI 304 side.Fig. 25Micro-hardness results of 0.5–1 mm Ti/AISI 304 (case F).Fig. 25 Micro-hardness results of 0.5–1 mm Ti/AISI 304 (case F). On the contrary, sample F13 revealed the maximal shear load and the least amount of micro-hardness when compared to samples F22 and F18. In contrast to the NZ, which measured 1036.5 HV for micro-hardness, the HAZ recorded 639.6 HV. Nevertheless, a variation in BM hardness was observed between the welded metal sides as well: the St side exhibited a hardness of 187 HV, while the Ti side measured approximately 207.3 HV. Prior to this, it was observed that the hardness measurements profile for sample F13 is positioned between the curves for samples F18 and F22 at the NZ and HAZ despite the fact that the BM of specimen F13 is assigned the same hardness along the Ti and St sides as sample F22. It was discovered that the NZ of sample I16 had a maximum Vickers hardness of about 927.4 HV when the hardness profile of the 0.5−0.5 mm Ti/AISI 304 (case F) was examined more closely in Fig. 26. Hardness values of about 688.9 HV were recorded in the HAZ, which was in the middle of the range for both the BM and the NZ, with the BM exhibiting the lowest hardness on the Ti side and 203.2 HV on the St side. I22, the sample with the highest shear force, had the least hardness values in the NG and HAZ according to the hardness distribution, in contrast to samples I16 and I24. The NZ produced a hardness value of 881 HV, the HAZ produced 634 HV, the BM on the Ti side produced 233 HV, and the St side produced 187 HV. Sample I24 followed the same pattern as samples I16 and I22 in terms of the Vickers hardness distribution. The micro-hardness tests for sample I24, however, showed hardness values that were in the middle of the curves for samples I16 and I22, as shown in Fig. 26. At the NZ, the peak hardness value of specimen I24 was 911 HV, the HAZ was about 656.1 HV, and the BM zone was 230 HV on the Ti side and 193.5 HV on the St side.Fig. 26Micro-hardness results of 0.5−0.5 mm Ti/AISI 304 (case I).Fig. 26 Micro-hardness results of 0.5−0.5 mm Ti/AISI 304 (case I). Similar findings to those seen in cases E, F, and I were obtained while studying the micro-hardness for 1−0.5 mm Ti/AISI 304 (case J) shown in Fig. 27. The greatest level of hardness demonstrated by the NZ for samples J6, J17, and J13, respectively, was 967.6, 930.4, and 894.6 HV. As the NZ hardness decreased towards the HAZ area, the Vickers hardness in the HAZ for samples J6, J17, and J13 was 731.2, 703, and 676 HV, respectively. The micro-hardness of the BM was the smallest, therefore, the HAZ hardness is better. Similarly to cases E, F, and I, sample J6 had the peak hardness with the least shear load, while sample J13 had the smallest hardness with the strongest shear load.Fig. 27Micro-hardness results of 1−0.5 mm Ti/AISI 304 (case J).Fig. 27 Micro-hardness results of 1−0.5 mm Ti/AISI 304 (case J). The development of intermetallic compounds (IMCs) in the NZ for cases E, F, I, and J is the cause of the improvement in NZ. The IMC at the NZ is abundant and present, which represents the brittle and hard behaviour of the weldments. Another factor was that the carburization process after welding rendered the NZ with a larger proportion of carbon than the BM. Previous studies [14,93] noted similar observations. It has been found that the NZ hardness is correlated with the weight percentage of carbon in the welded materials. The NZ hardness of materials will rise with increased carbon equivalency. Importantly, the interfacial fracture developed owing to the brittle behaviour of the weldments, making the hardness reach its maximum values. Additionally, the varying cooling rates experienced by the NZ and HAZ may contribute to the hardness improvement in these regions. Throughout the RSW operation, the ratios at which the temperature decreases gradually change from the area where the heat source is most concentrated, known as the NZ, to the HAZ, which is located further away from the heat source, and finally to the BM, which is the area furthest from the heat source. As a result of this factor, the nugget zone undergoes more rapid cooling rates in comparison to other regions, resulting in an elevation in the hardness of the NZ. ANN prediction Several ANN tests of the dissimilar RSW joints in the four scenarios were developed using different training and transfer functions. The impact of the RSW variables on the shear load was measured using several validation measures for identifying the best neural network model. The validation measures used in this study were mean squared error (MSE), correlation coefficient (R2), mean error (ME), mean absolute error (MAE), mean relative error (MRE), and root mean squared error (RMSE). The error between the real and predicted data was measured in order to evaluate these validation measures for the ANN models. The evaluation of the shear load of the Ti/AISI 304 dissimilar weldments with varying training and transfer functions is shown in Table 6, along with verification metrics data.Table 6Evaluation metrics for predicting the shear load using various training and transfer functions.Table 6Training FunctionTransfer functionMSER2RMSEMEMAEMRETrainlmLogsig0.020960.94440.144780.011880.091890.000102Tansig0.031910.91520.178650.012340.093360.000106Purelin0.097730.70770.312610.0404700.230150.000349TrainscgLogsig0.027930.92360.167110.003580.128570.000031Tansig0.048010.87350.219110.034830.154310.000301Purelin0.117180.705660.342310.0767570.259470.000662TraincgfLogsig0.040280.88820.200690.013340.152600.000115Tansig0.057500.844250.239780.029260.172450.000252Purelin0.093180.72610.305210.022780.241470.000196TraincgbLogsig0.051160.871260.226190.028330.174980.000244Tansig0.057350.861280.239470.065970.173330.000568Purelin0.089480.73340.299130.0372000.238270.000321TraincgpLogsig0.022760.939120.150860.010550.114590.000091Tansig0.018860.949730.13731−0.009300.093970.000080Purelin0.112980.734010.336120.0706320.239060.000609TrainbfgLogsig0.037590.815460.264250.015890.193340.000137Tansig0.088500.840420.236080.002390.179590.000021Purelin0.255010.646620.371450.079110.265480.000682TrainrpLogsig0.042780.883660.206840.024940.152680.000215Tansig0.040720.892610.201780.038210.152710.000329Purelin0.112520.725940.335440.034010.253890.000293TrainossLogsig0.046400.875110.215400.028290.162890.000244Tansig0.062570.823770.25013−0.018440.183160.000159Purelin0.119450.724680.345610.093160.249520.000803TraingdLogsig0.133370.613090.365200.011060.274070.000095Tansig0.175000.587890.418330.145950.291190.001258Purelin0.186340.560620.431670.038910.303570.000336TraingdmLogsig0.106050.693150.325660.046930.251220.000404Tansig0.122720.644210.350310.041010.255780.000353Purelin0.134540.616540.366800.017910.284500.000154TraingdaLogsig0.088410.767580.297350.036740.212170.000316Tansig0.093230.754150.305340.004860.220810.000041Purelin0.139390.623310.373350.026060.266820.000225TraingdxLogsig0.075160.811070.274160.014390.181360.000124Tansig0.106910.734050.326970.051830.235770.000447Purelin0.151400.663030.389100.039780.287610.000343 Table 6Evaluation metrics for predicting the shear load using various training and transfer functions.Table 6Training FunctionTransfer functionMSER2RMSEMEMAEMRETrainlmLogsig0.020960.94440.144780.011880.091890.000102Tansig0.031910.91520.178650.012340.093360.000106Purelin0.097730.70770.312610.0404700.230150.000349TrainscgLogsig0.027930.92360.167110.003580.128570.000031Tansig0.048010.87350.219110.034830.154310.000301Purelin0.117180.705660.342310.0767570.259470.000662TraincgfLogsig0.040280.88820.200690.013340.152600.000115Tansig0.057500.844250.239780.029260.172450.000252Purelin0.093180.72610.305210.022780.241470.000196TraincgbLogsig0.051160.871260.226190.028330.174980.000244Tansig0.057350.861280.239470.065970.173330.000568Purelin0.089480.73340.299130.0372000.238270.000321TraincgpLogsig0.022760.939120.150860.010550.114590.000091Tansig0.018860.949730.13731−0.009300.093970.000080Purelin0.112980.734010.336120.0706320.239060.000609TrainbfgLogsig0.037590.815460.264250.015890.193340.000137Tansig0.088500.840420.236080.002390.179590.000021Purelin0.255010.646620.371450.079110.265480.000682TrainrpLogsig0.042780.883660.206840.024940.152680.000215Tansig0.040720.892610.201780.038210.152710.000329Purelin0.112520.725940.335440.034010.253890.000293TrainossLogsig0.046400.875110.215400.028290.162890.000244Tansig0.062570.823770.25013−0.018440.183160.000159Purelin0.119450.724680.345610.093160.249520.000803TraingdLogsig0.133370.613090.365200.011060.274070.000095Tansig0.175000.587890.418330.145950.291190.001258Purelin0.186340.560620.431670.038910.303570.000336TraingdmLogsig0.106050.693150.325660.046930.251220.000404Tansig0.122720.644210.350310.041010.255780.000353Purelin0.134540.616540.366800.017910.284500.000154TraingdaLogsig0.088410.767580.297350.036740.212170.000316Tansig0.093230.754150.305340.004860.220810.000041Purelin0.139390.623310.373350.026060.266820.000225TraingdxLogsig0.075160.811070.274160.014390.181360.000124Tansig0.106910.734050.326970.051830.235770.000447Purelin0.151400.663030.389100.039780.287610.000343 Evaluation metrics for predicting the shear load using various training and transfer functions. The metrics in Table 6 and Fig. 28 clearly demonstrate that the training function conjugate gradient with Polak–Ribiere updates (Traincgp), together with the transfer function hyperbolic tangent sigmoid (Tansig), yielded the most favourable outcomes for the evaluation metrics MSE and R2. According to the data shown in Table 6 and Fig. 28, it is obvious that the highest level of accuracy was achieved when using the Traincgp training function in combination with the Tansig transfer function. In this case, the mean squared error (MSE) was 0.01886 and the correlation coefficient (R2) value was 0.94973. In addition, the Traincgp training function yielded the lowest prediction when the Purelin transfer function was used. The mean squared error (MSE) and the correlation of determination (R2) values were measured to as 0.11298 and 0.73401, respectively.Fig. 28The MSE of the shear force using various training and transfer functions.Fig. 28 The MSE of the shear force using various training and transfer functions. It is important to note that, as Table 6 and Fig. 28 makes significantly evident, the Purelin transfer function produced the least shear load prediction in terms of MSE and R2. This is true for all the training functions utilized in the present study. However, when Purelin was used as a transfer function, the conjugate gradient with Powell-Beale restarts (Traincgb) as a training function accomplished the best prediction, with MSE and R2 reaching 0.08948 and 0.7334, respectively. On the other hand, Purelin gave the poorest prediction when BFGS Quasi-Newton (Trainbfg) was employed as the training function. The MSE and R2 values were 0.25501 and 0.64662, respectively. The least accurate prediction was computed by using the Tansig transfer function and the Traingd training function, with the corresponding MSE and R2 values being 0.17500 and 0.58789, respectively. Analysing the Logsig transfer function's prediction accuracy, it was discovered that, in comparison to other transfer functions, Logsig generates the highest validation metrics, particularly when combined with the following training functions: Trainlm, Trainscg, Traincgf, Traincgb, Trainoss, Traingd, Traingdm, Traingda, and Traingdx. Nevertheless, when compared to Tansig and Traincgp, which demonstrated the greatest ANN performance, Logsig's highest validation metrics with these training functions remain lower. Fig. 29 shows the optimal ANN model's best performance regression curves with the Traincgp training function and the Tansig transfer function.Fig. 29Actual and predicted regression curves of the best ANN model of shear force employing Traincgp with Tansig.Fig. 29 Actual and predicted regression curves of the best ANN model of shear force employing Traincgp with Tansig. Table 7 and Fig. 30 show the validation metrics results using gradient boosting, CatBoost, random forest, and best and worst ANN models for checking the prediction accuracy of the RSW joints. It is clear from Table 7 and Fig. 30 that the Gradient boosting, CatBoost and Random Forest regressions provide good predictions. The MSE and R2 reached 0.059862 and 0.74841, respectively, when testing the model using the Gradient boosting algorithm. However, CatBoost gives better predictions compared to the gradient boosting, wherein the MSE and R2 were recorded as 0.039958 and 0.832061, respectively. CatBoost also showed more favourable predictions than gradient boosting when predicting the other validation metrics such as RMSE, MAE, ME, and MRE. However, these predictions using CatBoost and Gradient boosting are lower than the prediction with best ANN model when testing the model using Traincgp with Tansig, wherein the MSE and R2 were noted to be 0.01886 and 0.94973 respectively. It is important to note that CatBoost provides a better prediction than using the ANN models with the following training functions: Traincgf, Traincgb, Trainrp, Trainoss, Traingd, Traingdm, Traingda, and Traingdx with all the transfer functions. Concerning the accuracy of gradient boosting accuracy compared to ANN models, it outperformed the ANN models when trained with Traingd, Traingdm, Traingda, and Traingdx and all transfer functions.Table 7The evaluation metrics for examining the precision of the gradient boosting, CatBoost, random forest, and ANN models.Table 7MSER2RMSEMAEMEMREGradient boosting model0.0598620.748410.2446680.190087−0.0169460.177461CatBoost model0.0399580.8320610.1998950.123618−0.0047190.112852Random forest model0.0397980.8327320.1994960.12422−0.0042970.113599Best ANN model0.018860.949730.137310.09397−0.009300.000080Worst ANN model0.255010.646620.371450.265480.079110.000682Fig. 30Comparison of the accuracy of the different models according to the validation metrics a) MSE, and b) R2.Fig. 30 Table 7The evaluation metrics for examining the precision of the gradient boosting, CatBoost, random forest, and ANN models.Table 7MSER2RMSEMAEMEMREGradient boosting model0.0598620.748410.2446680.190087−0.0169460.177461CatBoost model0.0399580.8320610.1998950.123618−0.0047190.112852Random forest model0.0397980.8327320.1994960.12422−0.0042970.113599Best ANN model0.018860.949730.137310.09397−0.009300.000080Worst ANN model0.255010.646620.371450.265480.079110.000682 The evaluation metrics for examining the precision of the gradient boosting, CatBoost, random forest, and ANN models. Comparison of the accuracy of the different models according to the validation metrics a) MSE, and b) R2. The random forest model achieves similar precision to the Catboost model in terms of the validation metrics shown in Table 7 and Fig. 30. The MSE and R2 values for the random forest model were 0.039798 and 0.832732, respectively. Similar to CatBoost, random forest exhibited superior performance in predicting outcomes compared to certain ANN models discussed in the CatBoost model. CatBoost, gradient boosting, and random forest also outperformed the ANN model when examining the Purelin transfer function with all training functions used in the current study. The fact that CatBoost and Gradient boosting do not perform as well as, or even better than, some ANN models might be due to a number of factors. The problem's stochastic character, a lack of important features in the data set, inadequate data, an oversimplified model, or a mix of these factors might be the explanation. When it comes to estimating the model's actual prediction skills for unknown data, the slightly mismatch in results caused by the aforementioned problems is clear. The predicted findings achieved via the proposed models versus the actual data are presented in Fig. 31 a–d. The dispersion and deviation of the data are determined by how well the selected models can predict the shear force values with a minimum of errors. A large difference between the predicted and actual points on the curves indicates a high level of error, while a small difference indicates a low level of error. All models showed a good match between the experimental and predicted values. This figure clearly demonstrates that these models are capable of accurately forecasting the shear force.Fig. 31Actual and predicted shear force results employing: a) Gradient boosting model, b) CatBoost model, c) Random Forest model, and d) Best ANN model.Fig. 31 Actual and predicted shear force results employing: a) Gradient boosting model, b) CatBoost model, c) Random Forest model, and d) Best ANN model. Relative importance Concerning the relative importance, considerable and significant RSW variables based on Gradient boosting, CatBoost, and Random Forest regressions affecting the shear load of the weldments are shown in Fig. 32. It can be seen that the most significant factor according to Gradient boosting in Fig. 32a is the sheet thickness, with a relative importance of 33.94 %, while the welding current has the lowest effect, with a relative importance of 2.22 %. Pulse welding is the second impacting parameter, and its relative importance was 23.49 %. The pressure and welding time were ranked as the third and fourth factors with a relative importance of 15.7 % and 11.61 %, respectively. The squeeze time and holding time ranked fifth and sixth, respectively, with a relative importance of 7.44 % and 5.6 %. Similarly, CatBoost reveals that sheet thickness is the most influential factor as shown in Fig. 32b, accounting for 31.55 % of the total, while holding time contributes the least, accounting for 4.74 %. Similar to gradient boosting, CatBoost reveals that pulse welding ranks second in terms of contribution, with a relative importance of 22.74 %. The relative importance of the welding pressure was 18.39 %, making it a third-affecting parameter. Welding time has a slightly higher contribution percentage than squeeze time, which ranks them as the fourth and fifth parameters, respectively. Lastly, the welding current was shown to be the sixth influential factor, with 5.36 %. According to Fig. 32c, the most important variable in Random Forest in terms of relative significance is sheet thickness, which accounts for 31.94 % of the total. The welding current has the lowest contribution, however, at 4.03 %. Note that when evaluated with Random Forest, the RSW parameters give the same rank as when tested with CatBoost, although with different relative significance values.Fig. 32Relative importance of the RSW parameters on the shear force based on a) gradient boosting, b) Catboost, and c) random forest models.Fig. 32 Relative importance of the RSW parameters on the shear force based on a) gradient boosting, b) Catboost, and c) random forest models. Mathematical equation Using the weights and biases gathered from the optimal ANN model of the shear force, a novel addition to the RSW field was made: an analytical equation for forecasting the shear force. In this study, there was only one set of input weights (IW) and layer weights (LW) since the shear force ANN model only had one hidden layer. The hidden layer and the outputs are separated by a layer weight (LW), while the input parameters and the hidden layer are separated by an input weight (IW). Furthermore, each layer was given a bias of either b1 or b2. The optimal ANN model with respect to the shear force yielded (IW), (LW), b1, and b2; these are shown in Table 7.(15)tansig(n)=21+e−2n−1(16)y=f(net)=(∑i=1nwix+b)Here, the shear force is the output, thus we may rewrite Equation (15) as follows:(17)Shearforce=f(net)=(∑i=1nwix+b) The following equation may be obtained from the fact that f(net) = Tansig (n):(18)Shearforce=b2+LW×Tansig(b1+IW×x)(19)Shearforce=b2+LW×2(1+exp−2×x)−1) Given that the variable x stands for “pulse welding, holding time, pressure, welding time, squeeze time, and welding current,” the equation modifies to:(20)Shearforce=b2+LW×21+exp(−2(b1+IW×x(weldingcurrentweldingtimepressureholdingtimesqueezetimepulseweldingsheetthickness)−1where: b2, b1, IW, and LW values are shown in Table 8.Table 8Weights and biases for predicting shear force with Trainlm and Logsig.Table 8b12.4062−1.7669−1.01391.0984−0.2843−0.504530.642151.74460.58412.0995b20.907140.313111.0529−0.59317––––––IW−0.726040.669830.0881950.291481.0498−1.5541−0.726040.669830.0881950.29148−0.367780.22851−1.387−1.55050.48352−1.4975−0.367780.22851−1.387−1.55052.80430.809410.43888−0.55044−1.60650.357442.80430.809410.43888−0.55044−0.77432−0.45364−0.451091.75450.51210.53199−0.77432−0.45364−0.451091.7545−1.6348−0.602871.1577−0.46201−0.451281.0372−1.6348−0.602871.1577−0.46201−0.000800020.72780.747890.79686−0.20246−0.76431−0.000800020.72780.747890.796861.35040.69424−1.1164−1.424−0.66344−0.345631.35040.69424−1.1164−1.4241.28040.29123−0.858830.45448−0.174921.04561.28040.29123−0.858830.45448−0.31155−1.6322−0.335970.904440.27795−0.59058−0.31155−1.6322−0.335970.904441.0285−1.11270.8895−0.783750.902820.57151.0285−1.11270.8895−0.78375LW−1.5960.66416−1.132−0.87935−0.176390.8634−0.32511.1820.044939−0.031059−0.069083−0.12923−0.84684−1.1648−0.312590.600580.119410.0307890.4372−0.796260.427260.782150.88838−0.3011−0.055967−0.23123−0.8134−0.25293−0.11819−0.668350.69404−0.23402−0.39741−0.604720.589191.5411.0854−0.11594−0.322960.79864 Table 8Weights and biases for predicting shear force with Trainlm and Logsig.Table 8b12.4062−1.7669−1.01391.0984−0.2843−0.504530.642151.74460.58412.0995b20.907140.313111.0529−0.59317––––––IW−0.726040.669830.0881950.291481.0498−1.5541−0.726040.669830.0881950.29148−0.367780.22851−1.387−1.55050.48352−1.4975−0.367780.22851−1.387−1.55052.80430.809410.43888−0.55044−1.60650.357442.80430.809410.43888−0.55044−0.77432−0.45364−0.451091.75450.51210.53199−0.77432−0.45364−0.451091.7545−1.6348−0.602871.1577−0.46201−0.451281.0372−1.6348−0.602871.1577−0.46201−0.000800020.72780.747890.79686−0.20246−0.76431−0.000800020.72780.747890.796861.35040.69424−1.1164−1.424−0.66344−0.345631.35040.69424−1.1164−1.4241.28040.29123−0.858830.45448−0.174921.04561.28040.29123−0.858830.45448−0.31155−1.6322−0.335970.904440.27795−0.59058−0.31155−1.6322−0.335970.904441.0285−1.11270.8895−0.783750.902820.57151.0285−1.11270.8895−0.78375LW−1.5960.66416−1.132−0.87935−0.176390.8634−0.32511.1820.044939−0.031059−0.069083−0.12923−0.84684−1.1648−0.312590.600580.119410.0307890.4372−0.796260.427260.782150.88838−0.3011−0.055967−0.23123−0.8134−0.25293−0.11819−0.668350.69404−0.23402−0.39741−0.604720.589191.5411.0854−0.11594−0.322960.79864 Weights and biases for predicting shear force with Trainlm and Logsig. Conclusion The dissimilar joints between grade 2 titanium alloy and AISI 304 of 0.5 and 1 mm thickness were welded using the RSW process by applying different levels of the RSW parameters. The RSW parameters were welding current, pressure, welding time, squeeze time, holding time, and pulse welding, which were used with different welding cases by achieving an equal or unequal thickness. Moreover, the joint quality accuracy was assessed based on the ANN, gradient boosting, CatBoost, and random forest models. The shear force observations showed that case F yielded the highest value of 2.589 kN, while case I showed the second highest shear force of 2.183 kN. The maximum shear forces in cases I and J were 1.708 and 1.851 kN, respectively. Predictions of the accuracy of joint quality using different models such as ANN, gradient boosting, CatBoost, and random forest provided incredible observations about how RSW affects the predicted shear force. The ANN model achieved the most favourable results when trained and tested with Traincgp and Tansig, with MSE and R2 values of 0.01886 and 0.94973, respectively. Nevertheless, the Trainbfg and Purelin functions demonstrated the ANN model's worst prediction, with MSE and R2 values of 0.25501 and 0.64662, respectively. The random forest proved to have the second-best prediction accuracy, with an MSE of 0.039798 and an R2 of 0.832732. CatBoost was the third-most accurate model, with an MSE of 0.039958 and an R2 of 0.832061. Finally, the gradient boosting model yielded satisfactory results, however, these were not as promising as the results obtained with the random forest and CatBoost models. The performance metrics of MSE and R2 with gradient boosting were 0.059862 and 0.74841, respectively. In this research the relative importance metric was used for the first time to assess the impact of each RSW parameter on the shear force. Sheet thickness was the most effective parameter in the random forest, CatBoost, and gradient boosting models, with values of 31.94 %, 31.55 %, and 33.94 %, respectively. This study also provided a new mathematical equation for estimating the shear force based on the weights and biases of the ANN model. Lastly, the micro-hardness of the highest, medium, and lowest shear force specimens from cases E, F, J, and I were analysed. Case F exhibited the greatest hardness, while case E showed the second-highest. Cases J and I were third and fourth, respectively. CRediT authorship contribution statement Marwan T. Mezher: Writing – review & editing, Writing – original draft, Visualization, Software, Resources, Methodology, Investigation, Formal analysis, Data curation, Conceptualization. Alejandro Pereira: Writing – review & editing, Supervision, Project administration, Formal analysis, Data curation. Rusul Ahmed Shakir: Validation, Investigation, Formal analysis, Conceptualization. Tomasz Trzepieciński: Resources, Methodology, Investigation, Formal analysis, Data curation. Data and code availability Not applicable. Funding This research received no external funding. Declaration of competing interest The authors declare no conflicts of interest.