Comparison of Regression and Artificial Neural Network Models for Surface Roughness Prediction with the Cutting Parameters in CNC Turning

Surface roughness, an indicator of surface quality, is one of the most specified customer requirements in machining of parts. In this study, the experimental results corresponding to the effects of different insert nose radii of cutting tools (0.4, 0.8, 1.2 mm), various depth of cuts (0.75, 1.25, 1.75, 2.25, 2.75 mm), and different feedrates (100, 130, 160, 190, 220 mm/min) on the surface quality of the AISI 1030 steel workpieces have been investigated using multiple regression analysis and artificial neural networks (ANN). Regression analysis and neural network-based models used for the prediction of surface roughness were compared for various cutting conditions in turning. The data set obtained from the measurements of surface roughness was employed to and tests the neural network model. The trained neural network models were used in predicting surface roughness for cutting conditions. A comparison of neural network models with regression model was carried out. Coefficient of determination was 0.98 in multiple regression model. The scaled conjugate gradient (SCG) model with 9 neurons in hidden layer has produced absolute fraction of variance (R2) values of 0.999 for the training data, and 0.998 for the test data. Predictive neural network model showed better predictions than various regression models for surface roughness. However, both methods can be used for the prediction of surface roughness in turning.


INTRODUCTION
Metal cutting is one of the most significant manufacturing processes in material removal.Metal cutting can be defined as the removal of metal from a workpiece in the form of chips in order to obtain a finished product with desired size, shape, and surface roughness.There are different methods of metal cuttings and turning is one of the commonest among these methods.Turning is the process of machining external cylindrical and conical surfaces.It is usually performed on a lathe [1].
The quality of machined components is evaluated by how closely they adhere to set product specifications for length, width, diameter, surface finish, and reflective properties.Dimensional accuracy, tool wear, and quality of surface finish are three factors that manufacturers must be able to control at the machining operations [2].
In machining of parts, surface quality is one of the most specified customer requirements where major indication of surface quality on machined parts is surface roughness.Surface roughness is mainly a result of process parameters such as tool geometry (i.e., nose radius, edge geometry, rake angle, etc.) and cutting conditions (feed rate, cutting speed, depth of cut, etc.) [3].
Surface roughness is harder to attain and track than physical dimensions is, because relatively many factors affect surface roughness.Some of these factors can be controlled and some cannot.Controllable process parameters include feed, cutting speed, tool geometry, and tool setup.Other factors, such as tool, workpiece and machine vibration, tool wear and degradation, and workpiece and tool material variability cannot be controlled as easily [4].
A considerable number of studies has studied the effects of the speed, feed, depth of cut, nose radius, and other factors on the surface roughness.In recent studies, Lin et al. [5], Feng [6], Wang and Feng [7], Risbood et al. [8], Lou et al. [9], Choudhury and El-Baradie [10], Özel and Karpat [3] evaluated the effects of some factors on surface roughness and developed models.
The aim of this study was to set up a multiple regression models and a neural network model to predict the surface roughness of a machined workpiece, using turning operation.Other objectives of this study were the following: (1) to develop prediction models using machining parameters, such as feed rate, insert radius, and depth of cut, as predictors, (2) a prediction accuracy of above 90%, (3) to compare the different prediction methods for surface roughness to find the best model.

SURFACE ROUGHNESS
The surface parameter used to evaluate surface roughness in this study is the roughness average (R a ).This parameter is also known as the arithmetic mean roughness value, arithmetic average (AA), or centerline average (CLA).Within the presented research framework, the discussion of surface roughness is focused on the universally recognized.R a is recognized universally as the commonest international parameter of roughness.The average roughness is the area between the roughness profile and its center line, or the integral of the absolute value of the roughness profile height over the evaluation length (Figure 1) [11][12][13].Therefore, R a is specified by the following equation: when evaluated from digital data, the integral is normally approximated by a trapezoidal rule: where R a is the arithmetic average deviation from the mean line (μm), L is the sampling length, and Y is the ordinate of the profile curve.Graphically, the average roughness is the area (shown in Figure 1) between the roughness profile and its center line divided by the evaluation length (normally five sample lengths with each sample length equal to one cutoff).

Test specimens
Due to the experimental investigations AISI 1030, steel test samples of dimensions ø150×450 mm are prepared and used in tests.Chemical composition of test samples obtained by spectral analysis has been given in Table 1 and the mechanical properties of them are given in Table 2, respectively.

Cutting tools and lathe
In attempts to evaluate the effects of insert radius and cutting parameters on surface roughness values, as equivalent to ISO P20 grade for common carbon containing steel, it has been used cemented carbide cutters manufactured by Mitsubishi, coated with three layers of (TiN, Al2O3, TiC), the outermost CVD TiN.In tests, TNMG 160404-MA, TNMG 160408-MA,  TNMG 160412-MA inserts, and MTJNR 2525 M16N tool holder were used.The type of the machine used for the turning test was a Johnford T35 Industrial type CNC lathe machine.The lathe equipped with continuously CNC lathe variable spindle speed from 50 to 3500 rpm, and a 10 KW motor drive was used for machining test.Orthogonal machining of AISI 1030 was used in turning.

Surface roughness measuring instrument
Surface roughness values of finish-turned workpieces were measured by MAHR-Perthometer M1 while measuring instrument and the measurements are repeated three times.To measure roughness of the surface formed while processing the workpiece, the cutoff length is taken as 0.8 mm and the sampling length as 5.6 mm.The temperature of environment was 20 ± 1 • C.

Design of experiment
As recommended in ISO 3685, the cutting speed of 300 m/min has been chosen according to the advice for cutting tools quality given by the manufacturing companies.The experiment includes three controllable process factors, whose levels are presented in Table 3.In this research, 75 sets of experiment are sorted using the standard ordering and carried out according to full factorial design.To obtain the surface roughness values were used the TiN-coated tools by CVD method in the machining of AISI 1030 steel.All of the turning tests were run under dry conditions.
Data processing and analysis were performed using Microsoft Windows versions of Microsoft Excell, Statistical Analysis System (SAS) software and SAS Institute JMP statistical software for the regression analysis.

REGRESSION-BASED MODELING
Regression analysis is a technique for modeling the relationship between two or more variables.Regression models quantitatively describe the variability among the observations by partitioning an observation into two parts [14,15].The first part of this decomposition is the predicted portion having the characteristic that can be ascribed to all the observations considered as a group in a parametric framework.The remaining portion, called the residual, is the difference between the observed and the predicted values and must be ascribed to unknown sources.The goal of the multiple regression analysis was to determine the dependency of surface roughness to selected machining parameters such as feed rate, depth of cut, and insert nose radius.In addition to the main effects of these variables, effects of the interactions of them were included in the analysis.
It can be written being linear and exponential empirical models for surface roughness as functions of feed rate ( f ), depth of cut (d), and insert nose radius (r), A logarithmic transformation converts the nonlinear form of (1) into the following linear mathematical form: The equation is rewritten as where y is the logarithmic value of the measured surface roughness, β 0 , β 1 , β 2 , β 3 are regression coefficients to be estimated, x 0 is the unit vector, x 1 , x 2 , x 3 are the logarithmic values of the feed rate, depth of cut, and insert nose radius, and ε is the random error.
The above equation can be written in scalar notation as you see, is the first-order model.The first-order model, with interaction term, and the second-order model, are utilized in this research.
The above equation can be written in matrix notation as Thus, the least-squares estimator of β is The fitted regression model is The difference between the experimentally measured and the fitted values of response is a residual In the regression analysis, the general null hypotheses, were described as the effects of depth of cut, feed rate, and insert nose radius on the surface roughness, do not significantly differ from zero; that is, The alternative hypothesis could also be expressed as follows: H 1 : at least, one of the β i is not equal to zero.

NEURAL NETWORK MODEL
A neuron is the basic element of neural networks, and its shape and size may vary depending on its duties.Analyzing a neuron in terms of its activities is important, since understanding the way it works also helps us to construct the ANNs.An ANN may be seen as a black box which contains hierarchical sets of neurons (e.g., processing elements) producing outputs for certain inputs.
Each processing element consists of data collection, processing the data and sending the results to the relevant consequent element.The whole process may be viewed in terms of the inputs, weights, the summation function, and the activation function (Figure 2) [16,17].
According to the figure, we have the following.
(1) The inputs are the activity of collecting data from the relevant sources.(2) The weights control the effects of the inputs on the neuron.In other words, an ANN saves its information over its links and each link has a weight.These weights are constantly varied while trying to optimize the relation in between the inputs and outputs.(3) Summation function is to calculate of the net input readings from the processing elements.( 4) Transfer (activation) function determines the output of the neuron by accepting the net input provided by the summation function.There are several transfer functions like summation function.Depending on the nature of the problem, the determination of transfer and summation function are made.A transfer function generally consists of algebraic equations of linear or nonlinear form [18].The use of a nonlinear transfer function makes a network capable of storing nonlinear relationships between the input and the output.A commonly used function is sigmoid function because it is self-limiting and has a simple derivative.An advantage of this function is that the output cannot grow infinitely large or small [19].(5) Outputs accept the results of the transfer function and present them either to the relevant processing element or to the outside of the network.
The functioning of ANNs depends on their physical structure.An ANN may be regarded as a directed graph contain-ing a summation function, a transfer function, its structure, and the learning rule used in it.The processing elements have links in between them forming a layer of networks.A neural network usually consists of an input layer, a number of hidden layers, and an output layer [17].

Determination of data and the network model
The training and test data have been prepared using experimental patterns.In this study, we have 75 patterns obtained from the experiments.Among them, five patterns have been randomly selected and used as the test data.Depth of cut, feed rate, insert radius have been used as input-layer, while the surface roughness was used as output-layer of the ANNs.
In the ANN model, logistic transfer function has been used and expressed as follows: where NET is the weighted sum of the input.Input and output values are normalized between 0 and 1.

The training of the network
Generally, there are 3 different learning strategies.Firstly, the trainer may tell the network what it should learn (supervised learning), secondly, the trainer may indicate whether or not the output is correct without telling what the network should learn (reinforcement learning), and finally, the network learns without any intervention of the trainer (unsupervised learning).The learning set consists of the inputs and the outputs used in training the network.The required outputs take place in this set in the case of supervised learning, while in other cases, they are not found in it [20].In our case, we have used supervised learning approach.
Since the number of neurons found in the input and output layers are known, the best performance of the network with the number of hidden layers is determined using trial error method.Using limited number of neurons with limited number of hidden layers causes lesser learning, while increasing these numbers too much, decreases the speed of learning, and in some cases prevents the learning entirely.Usually, an algorithm is used for the learning process, this algorithm determines the weights.There are various learning methods using these strategies [20].The back propagation learning algorithm has been used with SCG and LM versions at the training and testing stages of the networks [21].The computer program has been developed under MATLAB [22].In the first step of the training, a determination of the learning algorithms is made.The number of hidden layers and the number of neurons for each hidden layer are determined.Then, the number of iterations is entered by the user, and the training starts.The training continues either to the end of the iterations or reaching the target level of errors.Figure 3 illustrates the ANN predictions against the experimental results.

TESTING THE ACCURACY OF BOTH REGRESSION ANALYSIS AND ANN-BASED APPROACH
In order to understand whether a multiple regression analysis or an ANN is making good predictions, the test data which has never been presented to the network is used and the results are checked at this stage.The statistical methods of RMSE, R 2 , and MEP values have been used for making comparisons [23][24][25][26].The same data obtained from the regression analysis is used to determine the mentioned values.These values are determined by the following equations: where t is the target value, o the output, and p the number of samples.

RESULTS AND DISCUSSION
The 3 3 full factorial design was used to study the effect of the three process parameters: depth of cut, feed rate, and insert nose radius on surface roughness.Therefore, the experiment includes three controllable process parameters, whose levels are presented in Table 3.After 75 specimens were cut for experimental purpose, they were measured with a profilometer to obtain the surface roughness average value R a and were recorded.All original 75 samples are shown in Table 4.
The experimental data were applied with a statistical analysis system (SAS) software for multiple regression analysis and neural network analysis.
The results of analysis of variance (ANOVA) of the firstorder model also supported linear relationships in the model (Table 5).F value of regression was 100.88.This F value indicated a great significance (α < 0.0001) for model in rejecting the null hypothesis (H 0 ) that every coefficient of the predictor variables in the model was zero.Instead, the alternative hypothesis, at least one of these coefficients are not equal to zero, was accepted.Therefore, the linear relationship between the predicted variable (R a ) and predictor variables is significantly exist.
Correlation coefficient represents the relationship between the variables.Pearson correlation coefficients between depth of cut, feed rate, insert radius, and surface roughness are presented in Table 6.As seen in Table 6, feed rate and insert nose radius were found to have significant correlation coefficients but insert radius has negative effect.
According to calculated coefficients of main factors, the multiple regression first-order model of surface roughness was built as shown in (16),  The determination coefficient (R 2 ) of this model was 0.810 which showed that 81% of observed variability in R a could be ascribed from linear relation.
Equation ( 16) can be transformed into the following form: R a = 52.022d 1.308 f 0.182 r −11.986 . ( The above equation shows that the surface roughness decreases with the increasing of insert radius, whilst it increases with the increasing of feed rate or depth of cut.The expected effects of regressors on the response were observed.Figure 4 shows the main effect on the surface roughness produced by variables d, f , and r.Note that it is preferable to maintain insert nose radius (r) on its highest level and feed rate ( f ) on its lowest level.When the depth of cut is increased, the surface roughness slowly increases, therefore, depth of cut does not have a significant impact on surface roughness as other two variables.
The scatter plot between the actual surface roughness and the predicted surface roughness of all 75 samples as shown in Figure 5 indicated that the relationship between actual sur-  face roughness and predicted surface roughness was accepted as a linear.It is seen that most of the points lie close to the line for prediction.
The scatter plot of surface roughness residual versus predicted surface roughness was illustrated in Figure 6.In the model adequacy checking, the regression model was found correct and assumptions were satisfied form in Figure 6.The residual deviations from the mean line were among from −1.5 to 2.5.
The results of analysis of variance (ANOVA) of the model also supported linear relationships in model (Table 7).F value of regression was 179.19.This F value indicated a great significance (α < .0001)for model in rejecting the null hypothesis (H 0 ) that every coefficient of the predictor variables in the model was zero.Instead, the alternative hypothesis, at least one of these coefficients did not equal to zero, was accepted.Therefore, the linear relationship between the predicted variable (R a ) and predictor variables is significantly exist.
In the regression analysis based on the first-order model with interaction terms, pearson correlation coefficients between surface roughness and depth of cut, feed rate, insert nose radius, interaction terms are presented in Table 8.Feed rate ( f ), insert nose radius (r), depth of cut and feed rate interaction (df ), depth of cut and insert nose radius interaction (dr), feed rate and insert nose radius interaction (fr) were found to have significant correlation but insert radius, dr, and df have negative effect.
The developed full model includes df interaction terms that is not significant.Advanced modeling would, therefore, include model reduction and elimination of term that is not significant in the way that statistical hierarchy is not violated.The model reduction is either stepwise or it follows backward elimination.The analysis of variance proved that the feed rate, insert nose radius, depth of cut, and fr interaction most significantly affect the surface roughness.The surface roughness is additionally affected by the dr interaction.The surface roughness model has been developed in a form of reduced equation in term of factors.When only significant factors were considered in the multiple regression analysis, a statistical model was created by regression function in SAS from the tested data, Y = −7.793+ 0.912d + 0.081 f + 6.063r − 0.669dr − 0.061 f r, R 2 = 0.940.
(18) R 2 was 0.940, which showed that 94% of the observed variability in R a could be explained by the main effect and their interactions of independent variables.
Figure 7 shows the actual surface roughness versus predicted surface roughness.A line inclined at 45 • and passing through the origin is also drawn in the figure.For perfect prediction, all points should lie on this line.Here, it is seen that most of points are close to this line.Hence, this model provides reliable prediction.
Residual surface roughness versus predicted surface roughness is illustrated in Figure 8.In the model adequacy checking, the regression model was found correct and assumptions were satisfied from Figure 8.
Figure 9 shows the effects of interactions on the surface roughness parameter produced by variables d, f , and r.Note that there is a nondisregarded interaction between factors dr and fr.As It can be seen in Table 9, the smallest P-value correspond to the fr interaction, and consequently it is the most important.This fact can be observed by analyzing the graphic shown in Figure 9, where the straight lines shown in the dr interaction are more parallel.Figure 9 indicates that a larger insert nose radius working with a higher feed rate would result in a smoother surface.
The results of analysis of variance (ANOVA) of the second-order model supported linear relationships in model (Table 9).F value of regression was 317.29.This F value indicated a great significance (α < 0.0001) for model in rejecting the null hypothesis (H 0 ) that every coefficient of the predictor variables in the model was zero.Instead, the alternative hypothesis, at least one of these coefficients did not equal to zero, was accepted.Therefore, there is a significantly linear relationship between the predicted variable (R a ) and predictor variables.
In the regression analysis based on second-order model, pearson correlation coefficients are presented in Table 10.Feed rate, insert nose radius, df interaction, dr interaction,  f r interaction, f 2 and r 2 correlation coefficients were found to have significance on the surface roughness but r, dr, f r, and r 2 have negative effect.
Developed full model includes some quadratic and interaction terms that are not significant.Advanced modeling would, therefore, include model reduction and elimination of terms that are not significant in the way that statistical hierarchy is not violated.The analysis of variance proved that the feed rate, insert node radius, depth of cut, and f r interaction most significantly affect the surface roughness.The surface roughness is additionally affected by the dr interaction.The surface roughness model has been developed in a form of reduced equation in term of factors.
Quadratic model was created by regression function in SAS from the data.The R 2 was 0.977 which showed that 97.7% of the observed variability in R a could be explained by the independent variables.
A second-order model was postulated to extend the variables range in obtaining the relationship between the response and the independent variables.The model is given by This model has a coefficient determination (R 2 ) of 0.977 which indicates a strong relationship between the factors and response.
Actual surface roughness versus predicted surface roughness and residual surface roughness versus predicted surface roughness are illustrated in Figures 10 and 11. Figure 10 shows the plot of actual versus predicted surface roughness.It is seen that most of the points lie very close to the line for strong prediction.For perfect prediction, all points should lie on this line.Hence, this model provides reliable prediction.
Residual surface roughness versus predicted surface roughness is illustrated in Figure 11.In the model adequacy  checking, the regression model was found correct and assumptions were satisfied form Figure 11.
Figure 12 shows the interactions on the surface roughness parameter produced by variables d, f , and r.Note that there is a nondisregarded interaction between factors dr and f r.As It can be seen in Table 11, the smallest P-value corresponds to the f r interaction, and consequently it is the most important.This fact can be observed by analyzing the graphic shown in Figure 12, where the straight lines shown in the dr interaction are more parallel.
The ANOVA results also show that all regression models are valid at a high significance (α < 0.01).The secondorder multiple regression model was the better for prediction of surface roughness.They were calculated R 2 = 0.977 and RMSE = 0.375 of multiple second-order regression model.In this study, multiple regression analysis along with the neural network analysis have been applied to measured surface roughness data for making predictions.For accurate results, we have used a single hidden layer by altering the number of neurons used at the hidden layer (e.g., from 3 to 10) to get the best network in terms of the statistical errors that it provides.Table 11 illustrates the behaviors of networks with varying number of neurons.This table has been prepared by selected results obtained from the SCG and LM algorithms.As the table illustrates, the network based on the SCG algorithm with single hidden layer of 9 neurons has provided the best results (Figure 13).Then, the ANN model-as illustrated in Figure 13-is set up using 3 neurons in the input layer with a single hidden layer and finally one neuron is used at the output layer.The representation of knowledge is accomplished by the weights in between the layers.The values of these weights are given at Tables 12-13.
Finally, the surface roughness value can be calculated by Figure 3 corresponds to the R a values for the training data.
It is seen that most of the points lie very close to the original  based approach has also been implemented.As Figures 15,  16, and 17 illustrate, for each insert radius value, the predictions of the ANN are very close to the experiment based results.These graphs show that the ANNs may be used as a good alternative in analyzing about the effects of cutting tool geometry and processing parameters on the surface roughness.As a result, the ANN model has been very successful at the training stage and the results for the test data have provided error levels well below critical acceptance level.
The comparison of accuracy values of multiple regression models and neural network model are presented in Table 15.As seen from the table-based on critical values-secondorder multiple regression model has been the best model in the regression analysis, but the neural network model has provided better results than the second-order multiple regression model.

CONCLUSIONS
In this study, the application of regression analysis and neural network analysis on the experimental surface roughness values are compared and discussed.The developed models which are limited with their boundary conditions are compared in terms of the prediction accuracy to the surface roughness.For a long time, modeling techniques have been developed for prediction of the surface roughness.From the results of this study, the following conclusions are drawn.First-order with interaction terms and second-order model predicting equations for surface roughness have been   interaction and feed rate and insert nose radius interaction terms and the square terms of feed rate and insert nose radius are statistically significant.Moreover, it is seen that the depth of cut and feed rate interaction and square of depth of cut are insignificant.
The predicted values and measured values are fairly close, which indicates that the developed surface roughness prediction model can be used effectively to predict the surface roughness from the cutting process for the secondorder model.However, based on the statistical error analysis methods, using SCG technique for surface roughness, the R 2 value for the training data set was 0.9997, while for the testing data it became 0.9983; the RMSE values are 0.00058 and 0.0033, respectively; and the mean error values are %2.42 and %2.71, respectively.Therefore, the surface roughness values are accurately determined by the ANN, by using 3 input parameters (i.e., cut depth, feed rate, insert radius), the surface roughness of the steel parts may be predicted with less errors when compared to error of regression models.However, the degree of error can be ignored.Regression requires an explicit function to be defined before the least squares parameter estimates, while a neural network depends more on training data and the learning algorithm.Although predictive neural network model seemed to give better predictions than various regression models for surface roughness, both methods can be used for the same purpose, because the difference in R 2 is very small.The weighted sum of the input to the ith processing element

X j:
The output of the jth processing element W i j : The weights of the connections between ith and jth processing elements The weights of the biases between layers

Figure 2 :
Figure 2: The artificial representation of the biological neuron.

Figure 3 :
Figure 3: The ANN predictions against the experiment-based results.

Figure 4 :
Figure 4: The main effect plots of depth of cut, feed rate, and insert nose radius on the surface roughness.

Figure 5 :
Figure 5: The actual surface roughness versus predicted surface roughness of main effects model.

Figure 6 :
Figure 6: The residual surface roughness versus predicted surface roughness of main effects model.

Figure 7 :
Figure 7: The actual surface roughness versus predicted surface roughness of main effects and interaction terms model.

Figure 8 :Figure 9 :
Figure 8: The residual surface roughness versus predicted surface roughness of main effects and interaction terms model.

Figure 10 :
Figure 10: The actual surface roughness versus predicted surface roughness of second-order model.

Figure 11 :
Figure 11: The residual surface roughness versus predicted surface roughness of second-order model.

Figure 13 :
Figure 13: ANN architecture with 9 hidden neurons in a single hidden layer.

Figure 14 :Figure 15 :
Figure 14: The residual surface roughness versus predicted surface roughness of ANN model.

Table 1 :
The chemical composition of test specimens (weight %).

Table 2 :
Selected mechanical properties of test specimens.

Table 3 :
Design factors and their levels for AISI 1030.

Table 4 :
The average surface roughness values depending on depth of cut, feed rate, and insert nose radius.
a (μm) d f Insert radius Insert radius Insert radius r = 1.2 mm r = 0.8 mm r = 0.4 mm

Table 5 :
ANOVA for surface roughness first-order model in turning of AISI 1030 using cemented carbide tools.

Table 6 :
Pearson correlation coefficients to the surface roughness.

Table 7 :
Analysis of variance for surface roughness first order and interactions terms model in turning of AISI 1030 using cemented carbide tools.

Table 9 :
Analysis of variance for surface roughness quadratic model in turning of AISI 1030 using cemented carbide tools.

Table 10 :
Pearson correlation coefficients of second-order regression model.

Table 11 :
Statistical errors for the surface roughness using various algorithms.

Table 14 .
While Figure14presents the residual surface roughness versus predicted surface roughness of ANN model.The residual values of surface roughness by calculated ANN were less than by calculated regression analysis.For the analysis and simulation of the effects of different insert radii of cutting tools, different depths of cut and different feed rates, on the surface quality of the workpiecesdepending on various processing parameters-an ANN-

Table 12 :
The weights corresponding to the input layer and hidden layer.

Table 13 :
The weights corresponding to the hidden layer and output layer.

Table 14 :
Maximum deviation for surface roughness values.

Table 15 :
Comparison of accuracy values of models.