Introduction

In recent years, Additive Manufacturing (AM) technology, also known as 3D printing, rapid prototyping or freeform fabrication, has gained wide attention due to its superiority in fabricating complex components. Additive manufacturing slices 3D objects into multiple layers of two-dimension in CAD, and then deposits feedstock layer by layer. Compared with traditional manufacturing methods, AM technology simplifies the manufacturing process when producing complex components, saves the production time, and provides a solution for the variety of repairs and direct forming.

According to Frazier (2014), the metal AM technology can be mainly classified into three types: powder bed systems, powder feed systems, and wire-feed based systems. Among them, the wire-feed process has a higher deposition rate and material utilization (up to 100%) (Karmuhilan 2018). The energy source for wire-feed AM usually includes laser, electron beam and welding arc. Compared with laser and electron beam based AM, wire arc additive manufacturing (WAAM) has the advantages in terms of lower equipment expenses and higher deposition efficiency (Xia et al. 2020). Usually, the deposition rate for AM using laser or electron beam is about 2–10 g/min, while the deposition rate for WAAM is about 50–130 g/min (Brandl et al. 2011; Karunakaran et al. 2010; Frazier 2014). At the same time, WAAM has a much higher energy efficiency (90%) than laser based AM (2–5%) (Ding et al. 2015b). Thereby, WAAM is able to fabricate larger-scale metal parts with less production time, while the production cost is lower than other metal additive manufacturing technologies.

As WAAM is a layer by layer deposition process, the surface quality of each layer may have an impact on the quality of final components. The cross-section diagram of WAAM is shown in Fig. 1. It can be seen that during the WAAM process, the deposited beads are overlapped to form one layer. Apparently, the surface flatness of one layer is dominated by the bead geometry and overlap distance, which may vary a lot when different process parameters and path planning strategies are used (Ding et al. 2015a). Due to the accumulation of multiple layers, the accuracy of the final component can be deteriorated by the poor surface quality. Also poor surface quality may lead to a non-uniform deposition in the next layer. As a result, porosity, voids and delamination will be induced possibly, which may deteriorate the functional properties of components, such as the strength of industrial parts or fatigue life for aerospace components (Strano et al. 2013). Additionally, the post-processing operations for poor surface quality may be labor-intensive and time-consuming, since it is often executed manually due to the complex shape of the deposited component. A large number of manual labor and feedstock will be wasted. As a result, the advantage of applying the WAAM process for industrial production may be compromised. Therefore, obtaining a good surface quality plays a vital role in WAAM production.

Fig. 1
figure 1

Cross-section diagram of WAAM

Although there are already a lot of profound studies on WAAM, the research efforts mainly focus on microstructure evolution, mechanical properties and process optimization. The research effort on the surface quality of WAAM is still rare. Poor surface finishing in WAAM processes is often affected by the welding parameters, path planning and the slicing procedure employed during the deposition process. Therefore, the surface finish can be predicted based on process parameters and an advanced predictive model. Figure 2 illustrates the flow path of process planning for WAAM. It can be seen that a roughness model could help improve the whole WAAM process. Through the reverse roughness model, a set of optimized process parameters can be calculated, including overlap distance, welding speed and WFS. Furthermore, the tool path can be adjusted based on the obtained overlap distance. Also, the optimized process parameter can be utilized when generating robot code. If the predictive model can be built into automated machines, it will lead to better quality products and increases in productivity.

Fig. 2
figure 2

Flowchart diagram of WAAM

In the conventional additive manufacturing field, many researchers have studied surface quality during the deposition process. Charles et al. (2019) investigated the effect of different process parameters on the surface roughness in SLM (selective laser melting). The effect of the interaction of various parameters and their individual effect on the surface roughness were analysed respectively. To minimize the need for surface finishing, Strano et al. (2013) investigated the key factors that influence surface quality in SLM additive manufacturing, and a theoretical model was built for predicting surface quality of SLM parts. Raju et al. (2019) proposed to utilize a hybrid PSO–BFO evolutionary algorithm to model the relationship between the surface roughness and process parameters in fused deposition modelling (FDM). Aminzadeh and Kurfess (2019) developed an online surface quality inspection system for powder-bed additive manufacturing, and a Bayesian inference was utilized to classify the surface quality of the deposited layer that signifies the defective and unacceptable build layers or regions. Wu et al. (2018) proposed a data fusion approach to predict the surface roughness in FDM processes. Different machine learning algorithms, including Random Forest, Support Vector Regression and Ridge Regression et al., were utilized to train the predictive model.

From above literature review, it can be seen that the research on surface quality has attracted extensive interest in the additive manufacturing field. As an emerging AM method, the studies on the surface quality of WAAM are still rare. To our best knowledge, only several researchers have tried to study the surface quality of WAAM. To ensure the surface quality of WAAM, Ding et al. (2015a) analysed the multi-bead overlapping process, and an overlapping model was proposed to optimize the surface finish. Xiong et al. (2018b) studied the surface flatness on the side face of a part deposited by the WAAM. The effect of interlayer temperature, wire feed speed (WFS) and welding speed on the surface roughness was investigated. To improve the surface evenness of deposited layer in WAAM, Hu et al. (2020) developed a cross-section profile overlapping model with varying cross-section profile. Even though, there is still little research has been conducted to establish predictive models of surface roughness for WAAM. In the past, to obtain a better surface finish, the operator needs to use their own experience and try and error method to determine appropriate parameters. Due to the inadequate knowledge of the complex process, an improper decision may cause high manpower costs and low deposited quality. If the surface finish can be improved, the overall quality of deposited components can be promoted and the failure rate can be reduced. Besides, a good surface finish will help reduce the amount of material that needs to be removed in the subtractive process. Therefore, it is an important way to save manpower and energy, reduce consumption, and improve production efficiency.

In the modern manufacturing industry, analyzing large amount of data with machine learning algorithms and the integration of machine learning in computer-aided production has become a tendency during recent years. Therefore, this study aims to develop machine learning approaches to predict the surface roughness of the WAAM. With this prediction system, the quality and productivity of WAAM could be ensured. This study could also provide inspiration and guidance for surface roughness modelling in multi-pass arc welding and cladding.

ANFIS, SVR and ELM are three representative models in machine learning, which are based on different principles. ANFIS combines the linguistic concept of the fuzzy logic and the training power of the neural network to solve a regression problem. The main advantages of the ANFIS model are rapid learning and adaptability. SVR is a relatively novel machine learning algorithm. Through minimizing an upper bound of the cost function, good performance in regression can be achieved. It has been proven to have better performance than the old algorithms. ELM is an extremely fast training method for multi-layer perceptron type neural networks, and it’s considered as a state of the art method to train neural networks (Deng et al. 2015). The main advantages of these models are: (i) They do not require mathematical relationships for a complicated process. (ii) They are easy to be implemented. (iii) Good fitting and generalization capability. They have been widely applied as predictive algorithm in many areas, including economics (Hosseinioun 2016; Shekarian and Gholizadeh 2013), energy (Salcedo-Sanz et al. 2014), and industry (Xu et al. 2020; Sarkheyli et al. 2015). But in AM area, their prediction performance hasn’t been investigated. Therefore, this article will conduct a comparative study for these three algorithms in predicting surface roughness of WAAM.

This paper will be organized as follows: Sect. 2 introduces the methodology in this study, which present the detail of the experimental setup and experiment design. Additionally, the theory of the machine learning algorithms developed in this study is introduced. Section 3 assesses the predictive performance of models in this study. Section 4 concludes this paper.

Methodology

Experimental setup

The experimental system is presented in Fig. 3. It consists of a central computer, Fronius TPS 4000 CMT welder, ScanControl 2500 laser scanner, ABB robot and robot controller. The surface profile of the deposited surface could be measured by the laser scanner. Based on the measured surface profile data, and the surface average roughness could be calculated.

Fig. 3
figure 3

Schematic diagram of the experimental setup

1.2 mm diameter filler wire of Mild carbon steel ER70S-6 was utilized as deposited feedstock. The experiments were performed on a Q235 substrate, with the dimensions of 150 × 150 × 10 mm. The chemical compositions of the used wire and substrate are presented in Table 1. The shielding gas consists of 80% Ar and 20% CO2, with a flow rate of 25 L/min. In this welding system, the welding current and welding voltage automatically change to match the pre-setting wire feed speed (WFS).

Table 1 ER70S and Q235 Chemical compositions and ranges (wt.%)

Measurement of surface roughness

Definition of surface roughness

Figure 4 presents the schematic diagram of surface roughness measurement for WAAM. It can be seen that a fluctuating surface can be obtained conspicuously due to the overlap of multiple welding bead. As shown in Fig. 4, an idea plane could be calculated by fitting the surface points based on the least square method. The equation of the fitted plane is expressed as Xiong et al. (2018b):

$$ {\text{Ax}} + {\text{By}} + {\text{Cz}} + {\text{D}} = 0 $$
(1)

where A, B, C and D represent the fitting coefficients of the fitted plane, respectively. The distance between the surface points and the fitted plane can be calculated as:

$$ \sum d_{i} = \mathop \sum \limits_{i = 1}^{N} \frac{{\left| {Ax_{i} + By_{i} + Cz_{i} + D} \right|}}{{\sqrt {A^{2} + B^{2} + C^{2} } }} $$
(2)

N presents the number of data point on the measured surface. The surface roughness on the deposited surface is defined as:

$$ {\text{R}} = \frac{{\sum d_{i} }}{N} $$
(3)
Fig. 4
figure 4

Schematic diagram to quantify average surface roughness

Laser vision-based measurement system

Conventionally, surface roughness is measured by a stylus profilometer. However, this method is time-consuming and labor-intensive. Because WAAM is normally applied in depositing large-scale structures, which demands high-speed measurement, the conventional roughness measurement method maybe not suitable for WAAM. Laser vision-based measurement has the advantages of non-contact, fast and reliable. Therefore, it’s highly recommended to be applied in the WAAM process. In this study, a laser vision-based measurement method was adopted from the studies of Xiong et al. (2018a, b).

In this study, a Micro-Epsilon 2500 laser scanner was utilized to obtain the coordinate data of the surface point of the part deposited during the WAAM process. As shown in Fig. 4, a laser strip is projected on the deposited surface by the laser scanner, and the height information of the surface point can be measured. The laser scanner was mounted on the welding robot arm. After finishing depositing one layer during WAAM, the scanner will be moved by a robot to scan the surface profile of the whole layer. The parameters of the laser scanner is presented in Table 2. Figure 5 presents a reconstruction of 3D image using data obtained by the laser scanner. Through using Eq. (3), the mean value of surface roughness can be calculated.

Table 2 Parameters of the laser scanner
Fig. 5
figure 5

3D Rebuilding using scanning data

Experiment design

Figure 6 presents the effects of overlap ratio, welding speed and WFS on surface roughness. It can be seen that the decrease of the roughness is associated with the increase of the overlap ratio in the range of [0.1, 0.35]. For welding speed and WFS, a nonlinear relationship was found. Therefore, machine learning is a good option for modelling the surface roughness of WAAM.

Fig. 6
figure 6

Effect of each variable on surface roughness. a Overlap ratio. b Welding speed. c WFS

To investigate the effectiveness of predictive models, full factorial experiments with three factors were carried out. The factors consist of welding speed, WFS and overlap ratio. As presented in Table 3, each factor has three levels in this experimental design. Table 4 shows the experiment data. In experiments, each layer consists of four welding beads. The value of surface roughness is measured using the laser vision method, which is described in the last section.

Table 3 Experiment design
Table 4 Experimental data of full factorial design

Machine learning algorithms

ANFIS

Adaptive neuro-fuzzy inference system (ANFIS) is an adaptive fuzzy logic inference system, which integrates the advantages of both neural network and fuzzy logic. Through training a neural network using input and corresponding output data, the parameters for a fuzzy logic model can be determined. ANFIS is normally based on T-S (Takagi–Sugeno) fuzzy structure, which possesses the rules in the following form:

$$ R^{i} :\;{\text{IF}}\;x_{1} \;{\text{is}}\;A_{i1} \;{\text{and}}\;x_{2} \;{\text{is}}\;A_{i2} \ldots \;{\text{and}}\;x_{n} \;{\text{is}}\;A_{in} ,\;{\text{then}}\;y_{i} = a_{0} + a_{1}^{i} x_{1} + \cdots + a_{n}^{i} x_{n} $$

where \( x_{1} \ldots x_{n} \) are the input variables of ANFIS, \( A_{i} \) and \( B_{i} \) are the fuzzy sets, \( y_{i} \) is the output of i th rule, \( a_{0} \ldots a_{n} \) are the antecedent parameters, which are determined by the neural network.

Figure 7 demonstrates the reasoning mechanism of the T-S fuzzy inference in ANFIS with n inputs and three fuzzy partitions. In this figure, the circles represent fixed nodes, while the squares represent adaptive nodes. It can be seen that ANFIS adopts a feedforward propagation structure, which consists of five layers. The detailed explanation for the function of each layer is presented in Table 5.

Fig. 7
figure 7

Structure of the ANFIS model

Table 5 Detail of ANFIS algorithm

In this study, the welding speed, WFS and overlap ratio were selected as the input of the ANFIS model, while the surface roughness was the output of the model.

Normally, the structural parameters of the ANFIS model mainly consist of the antecedent and consequent parameters (Hussein 2016). In the conventional ANFIS model, antecedent and consequent parameters are determined in the training process using gradient-based methods. One shortage of the gradient-based algorithm is that it may fall into local optimal solutions.

PSO and GA

Some researchers (Moayedi et al. 2019; Ghasemi et al. 2016; Alarifi et al. 2019) proposed to utilize metaheuristic algorithms as the training methods to tune the structural parameters of ANFIS, such as Particle Swarm Optimization (PSO) and Genetic Algorithm (GA). The main advantage of PSO and GA is its parallel and random optimization process, which contribute to a high degree of stability and generalization. This type of algorithm does not rely on the derivative property of objective function, and can gain the optimal solution through comparing the value of objective function at every iteration. A minimum value for the deviation between the model prediction and target could be obtained through the iterations of GA and PSO.

In a PSO, each particle represents a potential solution to the problem, and it randomly moves along the search space. A movement of a particle in search space is affected its own and its neighbours’ knowledge. The particles learn from each other within a group and move toward their best neighbours according to their knowledge. Each particle adjusts its position and velocity in the search space according to the best position in which it has ever been (personal best) and the best position in the entire neighbourhood (global best). Supposing \( x_{i}^{k} = \left( {x_{i1}^{k} , x_{i2}^{k} , \ldots ,x_{in}^{k} } \right) \) and \( v_{i}^{k} = \left( {v_{i1}^{k} ,v_{i2}^{k} , \ldots ,v_{in}^{k} } \right) \) denote the position and the velocity of the ith particle at the kth iteration, respectively. The position and the velocity of the particles can be updated by the following formulations:

$$ \begin{aligned} v_{i}^{k + 1} & = \omega \cdot v_{id}^{k} + c_{1} r_{1} \left( {p_{i}^{k} - x_{i}^{k} } \right) + c_{2} r_{2} \left( {g_{i}^{k} - x_{i}^{k} } \right) \\ x_{i}^{k + 1} & = \left( {x_{i}^{k} + v_{i}^{k + 1} } \right) \\ \end{aligned} $$
(4)

where \( p_{i}^{k} \) is the personal best of ith particle at kth iteration, \( g_{i}^{k} \) is the global best at kth iteration, and \( r_{1} \), \( r_{2} \) are random values from 0 to 1. Additionally, the three parameters ω, \( c_{1} \), \( c_{2} \) are the cognitive coefficient, social coefficient, and inertia weight, respectively. Each particle has a fitness value determined by the objective function, then its personal best and global best can be updated. When the best particle’s fitness value satisfies the stopping criterion, the iterations can be stopped. The scheme of PSO for training ANFIS is illustrated in Fig. 8a.

Fig. 8
figure 8

Scheme of PSO and GA algorithm. a PSO, b GA

Genetic algorithms employ Darwin’s evolution theory to find the optimal solution. In GA, there is a string called chromosomes, which contain the parameters of the search space. Every chromosome represents a solution to the problem. All the chromosomes form a set called the population. At the beginning of the evolution process of GA, the initial population elements are typically selected randomly. The algorithm utilizes three operators to implement evolution: selection, crossover and mutation. In the phase of selection, through computing the fitness function of the chromosomes, the best chromosomes of the society can be identified. And then the best chromosomes are selected as parents to generate the next generation. Through crossover operator, new child chromosomes can be produced by two parent chromosomes. The crossover operator is actually a method that determines the structure and ratio of the child’s chromosome. The crossover operator can be implemented with various methods, including Ranking Selection, N-Point, Cycle, Order, Uniform, Tournament, and partially mapped (Saeidian et al. 2016). Mutation operator is applied to search new space in the available dimension. The result could exclude the local optimum for the best solution. This could be achieved through only changing some of the genes inside the chromosomes randomly. The scheme of GA for training ANFIS is illustrated in Fig. 8b.

In PSO–ANFIS and GA–ANFIS, the PSO and GA algorithms are utilized to tune the antecedent and consequent parameters for the ANFIS model. Antecedent and consequent parameters are the main parameters for ANFIS, which have been introduced above.

$$ {\text{E}}\left( x \right) = \left( {\sqrt {\frac{{\mathop \sum \nolimits_{1}^{n} \left( {t - ANFIS \left( {x \cdot *p_{0} } \right)} \right)^{2} }}{n}} } \right) $$
(5)

In PSO–ANFIS, the fitness function is defined as the RMSE of ANFIS prediction, as shown in Eq. (5). In this fitness function, \( {\text{ANFIS}}() \) represents the function of ANFIS output. The detail of computing ANFIS output has been introduced above. To minimize the cost function, a set of correction factors were introduced to optimize the antecedent and consequent parameters. In Eq. (5), \( x \) is the vector of correction factors, \( p_{0} \) represents the vector of initial antecedent and consequent parameters of ANFIS. When employing PSO to solve this optimization problem, the correction factor vector \( x \) was consider as a variable. In another word, through the iteration of PSO, an optimized \( x \) can be obtained to minimize the cost function. When implementing the optimization of PSO, the positions of particles represents the solution of correction factors. The initial values in the positions vector are equal to 1. In each iteration, particles’ position and velocity are updated according to Eq. (4), and then the new value of fitness function can be calculated. Through comparing the new value of fitness function with personal best Pbest, and global best gbest, Pbest and gbest can be updated. Iteration stops when the maximum number of iterations is satisfied. The values of gbest are the optimized correction factors for antecedent parameters and consequent parameters.

Similarly, In GA–ANFIS, the GA algorithm was applied to solve the same optimization problems. Equation (1) is still the fitness function, and the chromosomes represent the solution of the correction factors. The initial values of the genes in chromosomes are all set to be 1. Through the operation of selection, cross over and mutation, the fitness function are re-evaluated until the termination condition is met. As a result, the best solution for correction factors can be obtained.

Both PSO–ANFIS and GA–ANFIS were implemented in MATLAB environment. The programming detail of implementing PSO and GA could refer to the correlative materials (Yarpiz).

Results and discussion

In this section, the predictive performance of developed algorithms (ANFIS, ELM and SVR) in predicting surface roughness of WAAM is presented. The experimental data obtained in the last section is utilized for model training and validating using the K-fold Cross-validation method. In this study, the value of K was selected as 5. To choose the most suitable predictive model for WAAW surface roughness, the prediction results of all developed models are compared and assessed.

During the training process of complex problems, the predictive model may trap in local optimum. Hence, in this study, GA and PSO were utilized to update the parameters of ANFIS adaptively. In the PSO–ANFIS model, the parameters for PSO mainly include the population size, number of iterations, the acceleration constants \( C_{1} \) and \( C_{2} \), and the inertia weight. In the GA–ANFIS model, the main parameters consists of population size, crossover rate, mutation percentage and rate. These parameters need to be optimized through a trial and error process. Among those parameters, population size plays the most important role in the application. Therefore, the performance of PSO–ANFIS and GA–ANFIS with various values of population size are tested (as shown in Table 7). It can be seen that for PSO–ANFIS, when the population size increases from 10 to 40, the value of RMSE increases, and the value of \( R^{2} \) decreases. When the population size is selected as 50, an optimum can be obtained. When the population size increases from 50 to 80, the value of RMSE increases again. For GA–ANFIS, the value of RMSE increases when the population size increases from 10 to 40, and decreases when the population size increases from 40 to 80. In this study, the population sizes for PSO and GA were selected as 50 and 80 respectively. Additionally, other parameters were also determined by trial and error. Table 6 presents the parameters of PSO–ANFIS and GA–ANFIS applied in this study (Table 7).

Table 6 Model parameters of PSO–ANFIS and GA–ANFIS
Table 7 Model performance with different number of population size

K-fold cross-validation method was utilized to validate the performance of ANFIS, PSO–ANFIS and GA–ANFIS models. K-fold cross-validation is a resampling procedure utilized to evaluate the model’s accuracy on limited datasets. In this method, the original data is divided into K subsets randomly. Among those subsets, one group was used as the validation data, and the other K-1 groups were utilized for training. This procedure needs to be repeated for K times, and each group needs to be as validation group for once. In this study, the value of K is set to be 5 to avoid overfitting.

The performance of PSO–ANFIS, GA–ANFIS and ANFIS, are shown in Figs. 9, 10 and 11, respectively. It’s observed that through introducing PSO and GA algorithms to optimize the structural parameters, better predictive performance can be obtained. Among them, GA–ANFIS achieved the highest predictive accuracy. The RMSE for GA–ANIFS, PSO–ANFIS and ANFIS were 0.075727, 0.069424 and 0.086368, respectively.

Fig. 9
figure 9

Prediction of PSO–ANFIS

Fig. 10
figure 10

Prediction of GA–ANFIS

Fig. 11
figure 11

Prediction of ANFIS

In order to compare with ANFIS algorithms, predictive models were also established based on ELM and SVR algorithm. The main parameters for ELM are the type of activation function and the number of hidden nodes. To obtain an ideal predictive performance, the learning performance was analysed when the type of activation function and the number of hidden nodes vary. As shown in Fig. 12, the performance was evaluated when the initial number of hidden neurons is 10, and increased by 10. The types of activation functions tested include Sigmoidal, Sin, Radial basis, Hardlim and Triangular basis. It can be seen that when the activation function was selected as sig and sin, the value of RMSE for ELM fluctuate significantly. When hardlim activation function was applied, the changing trend of RMSE is relatively stable. Considering the model accuracy and computation, optimized model parameters for ELM can be obtained when the activation type is sin and the number of hidden nodes is 10.

Fig. 12
figure 12

Testing error of ELM

In this paper, RBF (radial basis function) was utilized as the kernel function of SVR. As described in the last section, the tuneable parameters Ɛ and C for the kernel function need to be adjusted by users to achieve better performance for SVR model. A smoother decision surface can be obtained if constant parameter C has a lower value, while a high value of C enables the SVR to choose more samples as support vector. The grid search method is an efficient and practical way to determine the values for parameters of Ɛ and C for SVR models. Through searching in serials of values of Ɛ and C, a set of values for parameters Ɛ and C can be obtained, which could contribute to better accuracy for regression. In this paper, the search library for kernel parameter Ɛ was selected as [0.0001, 0.001, 0.01, 0.1, 1, 10, 20], and the search library for regularization parameter C was [0.1, 1, 10, 15, 20, 30, 50, 55, 60, 65, 70]. The heat map of the grid search results for SVR is presented in Fig. 13. It can be observed that the smaller training error can be obtained when Epsilon ranges from 0.0001 to 0.01 and C ranges from 50 to 70, and the best result is obtained while Ɛ = 0.01 and C = 60. The least root mean square error (RMSE) is equal to 0.1005.

Fig. 13
figure 13

Grid research result of SVR

To perform a further comparison of the results, linear regressions between model prediction and corresponding measured data can be implemented through using the ‘Postreg’ function in MATLAB Toolbox. Figure 14 graphically illustrates a correlation between the measured roughness and the roughness predicted by ANFIS based models, ELM and SVR respectively. As the pictures show, the points are scattered around the fit line (represents measured roughness), which indicates a great correlation between the model output values and the actual values. The value of \( R^{2} \) reflects the correlation between the model prediction and the corresponding target. The value of \( R^{2} \) ranges from 0 to 1, and if \( R^{2} \) equal to 1, it means perfect correlation. The results show that the correlation coefficient \( R^{2} \) of the GA–ANFIS performs better than the values of PSO–ANFIS, ANFIS, ELM and SVR. As revealed by Fig. 14, when the predictive models are trained and tested by K-fold Cross-validation, the values of \( R^{2} \) are 0.93516, 0.92753, 0.91369, 0.88691 and 0.862 for developed models respectively. From the results of figures, it can be inferred that among developed models, the proposed GA–ANFIS shows a higher prediction performance in estimating WAAM surface roughness.

Fig. 14
figure 14

Regression plot for different models prediction a GA, b PSO, c ANIFS, d ELM, e SVR

Table 8 furtherly compares the prediction performance of different machine learning models for WAAM surface roughness. The criterions for the accuracy of those models include RMSE, \( R^{2} \), MAE, MAPE, Maximum Deviation and Minimum Deviation. Apparently, the result of Table 8 indicates that the prediction performance of ANFIS based models is better than ELM and SVR model. Furthermore, the prediction accuracy of ANFIS was improved significantly after optimized by GA and PSO, where the RMSE reduced by 13.46% and 5.6% respectively. It can be also found that the lowest RMSE, MAE, and MAPE, and maximum deviation were obtained from the GA–ANFIS model. A part of assessment statistical parameters are computed as follows:

$$ {\text{RMSE}} = \sqrt {\frac{1}{n}\sum \left( {x^{\exp } - x^{pre} } \right)^{2} } $$
(6)
$$ R^{2} = 1 - \frac{{\mathop \sum \nolimits_{i = 1}^{n} \left[ {x^{pre} - x^{\exp } } \right]}}{{\mathop \sum \nolimits_{i = 1}^{n} \left[ {x^{pre} - x^{m} } \right]}},\quad x_{m} = \frac{{\mathop \sum \nolimits_{i = 1}^{n} x_{sim} }}{n} $$
(7)
$$ {\text{MAE}} = \frac{1}{n}\sum \left| {x^{\exp } - x^{pre} } \right| $$
(8)
$$ {\text{MAPE}} = \frac{1}{n}\sum \frac{{\left| {x^{\exp } - x^{pre} } \right|}}{{x^{\exp } }} \times 100\% $$
(9)

where \( x^{\exp } \) is the experimentally measured value, \( x^{pre} \) is the model’s predictive values and n is the number of experimental data. When MAE, \( {\text{MAPE}} \) is near to 0 and \( R^{2} \) is closed to 1, high predictive accuracy can be obtained.

Table 8 Performance comparison between the developed models

The results in this section demonstrate that ANFIS based model, especially GA–ANFIS are efficient in predicting WAAM surface roughness. The models developed in this study have some advantages and disadvantages, which are concluded briefly in Table 9.

Table 9 Main advantages and disadvantages of developed models

The different performance between the machine learning models is due to their different theoretical backgrounds and principles. According to previous studies, the model’s performance varies when applying in different scenarios. For example, Tabari et al. (2012) compared the predictive performance of SVR and ANFIS in predicting the evapotranspiration, and found that SVR could obtain a more accurate prediction. However, in research by Najafi et al. (2016), ANFIS was found to have better performance than SVR in predicting exhaust emissions. ANFIS adopts the adaptability and learning ability from neural networks and fuzzy logic, and has the ability to measure uncertainty. This makes ANFIS a powerful tool in simulating complex processes. In this study, the experiment data is limited, and noise may be produced in those data. Therefore, PSO–ANFIS and GA–ANFIS models has better predictive performance in predicting the surface roughness of WAAM.

Conclusion

This paper aims to investigate the capabilities of machine learning algorithms for predicting surface roughness of the deposited layer by WAMM. The intent of this study was also to develop suitable machine learning methods for solving similar problems in the actual industrial environments. Different machine learning models, including ANFIS, ELM and SVR, were developed to predict the surface roughness in WAAM. The input of model consists of welding speed, WFS and overlap ratio.

The surface roughness was calculated based on the surface profile data collected by a laser scanner. The training data set was developed through experiments based on \( L_{27} \) Taguchi array. In order to make the best use of training data, K-fold Cross-validation was employed to evaluate the prediction performance of the machine learning models. To improve ANFIS performance, GA and PSO are applied to optimize the parameters of the ANFIS.

The experimental results reveal that the developed machine learning models are capable of predicting the surface roughness of WAAM deposited layers with acceptable error rates. Among developed models, GA–ANFIS achieved the highest prediction performance. The prediction results of GA–ANFIS are better than other developed models in terms of RMSE, \( R^{2} \), MAE, MAPE and MaxDev, which are obtained as 0.0694, 0.93516, 0.0574, 14.15% and 0.1516 for GA–ANFIS, respectively.

In the future, the experimental data will be extended to improve the modelling process. Furthermore, we are planning to develop an adaptive WAAM system, which is able to adjust the process parameters, and collect or measure multiple manufacturing information automatically. The machine learning system will be optimized to predict various manufacturing quality.