1 Introduction

The essential properties of titanium alloys are excellent load-bearing ability at high temperature, high strength, lightweight, and superior corrosion resistance. These alloys find increased utilization in the fields of automotive, bio-medical, marine, defense, and aerospace [1, 2]. Turning titanium alloys is challenging because of their high hardness, low thermal conductivity, and high chemical reactivity, reducing the tool life and surface roughness [3, 4]. Turning Ti-6Al-4 V alloys can be performed better by choosing the latest cutting tool materials and advanced coated tools [5, 6]. Surface integrity is one of the most reliable factors to judge the quality of the machined components. The primary concern of current industries is to increase productivity, which hugely depends on the material removal rate (MRR) [7, 8]. The selection of optimal cutting parameters is crucial to enhance the quality of the industry's product and economy. Response surface methodology (RSM), Artificial neural networks (ANN), Analysis of variance (ANOVA), Taguchi method, Fuzzy rule, and TLBO are among various optimization techniques applied to find the optimal cutting parameters for better results [9,10,11,12,13]. Khalid H. Hashmi et al. conducted a high-speed milling operation on Ti-6Al-4 V alloy with coated inserts, ZPMT 09T208 R with ISO JC5015 grade. They developed a model to study the influence of depth of cut, speed, and feed on the surface roughness. The depth of cut (DOC) has the maximum effect on the surface roughness, followed by cutting speed and feed [14]. Abhineet Saini et al. concentrated on producing mathematical relationships among input and output parameters viz., surface roughness, tool wear, and tool vibration. The optimum cutting parameters are validated, which exhibited a decent agreement with the predicted results. The feed and the cutting speed are recognized as the most significant parameters affecting surface roughness, tool vibration, and tool wear, respectively [15]. Raghavendra M J et al. investigated the effect of optimum machining parameters while turning Titanium grade-5 alloy with PVD coated tools. The ANOVA analysis concluded that speed has 88.92% influence on surface roughness, and DOC has 48.1% influence on the cutting force [16]. Djordje Cica et al. focused on predicting machining parameters using different machine learning techniques, namely polynomial regression, support vector regression, Gaussian process regression, and artificial neural networks and also performed a comparative study. The experimental results are in good agreement with the predicted results for all machine learning techniques. The ANN model-based indicated results had shown high accuracy [17]. Ajit Kumar Pattanaik et al. investigated wear characteristics of different metals using a lightning search algorithm-simplex method (LSA-SM), and prediction is made using the ANN method and support vector machine. The ANN method exhibited better efficiency in prediction [18]. Lila Imani et al. conducted milling experiments on Inconel 738 and examined the effect of speed, feed, axial DOC, and coolant on cutting force and surface roughness. The optimum parameters were predicted using the ANN model [19].

From the studied literature, it can be concluded that most researchers applied analytical methods for obtaining optimum parameters. Though machine learning can derive nonlinear models straight from estimated input/output data, very few researchers applied machine learning techniques that showed excellent accuracy in predicting the optimum parameters. It is observed that there is no literature available on the influence of choosing CNC machine for comparing the predicted machining parameters. The goal of this work is to compare the predictions of analyitical method (RSM) with that of ANN in achieving the optimized set of machining parameters.

This research work discusses the methodology of Box-Behnken method for carrying out experiments and the results are compared with the predicted results of artificial neural network model. In this work, titanium alloy (Ti-6Al-4 V) is machined using a coated carbide tool on a programmable CNC lathe machine. The cutting parameters are optimized using RSM and the machine learning techniques are used for predicting the surface roughness and material removal rate. A high-level application programming interface (Keras) is used in Python to build ANN models, which are very flexible to iterate the state of the art ideas. This method enables faster computation and "go from idea to result" as fast as possible. It is concluded that in comparison with RSM, the percentage error in ANN is less.

2 Methodology

2.1 Experimentation

The turning experiments are performed on Ti-6Al-4 V workpieces of diameter 30 mm and length 200 mm using CNMG120408MS WS25PT TiCN coated carbide tool on ACE Micromatic programmable CNC lathe machine as shown in Fig. 1. TableS 1 and 2 show the chemical composition, physical and mechanical properties of Ti-6Al-4 V. Figure 2 shows the microstructure of the Ti-6Al-4 V titanium alloy. The light area is predominant of the phase α rich in aluminum and the dark area is predominant of the phase β rich in vanadium. Using RSM's Box-Behnken method, the total number of experiments designed is L15. The cutting parameters selected for the current investigation: speed, feed, and DOC at three different levels are shown in Table 3. The output parameters considered in this investigation are surface roughness (SR) and material removal rate (MRR). Talysurf instrument is used to measure the surface roughness of the specimens after each experiment [20]. Each specimen's weight is measured before and after the completion of each experiment to calculate the MRR. Table 4 shows the measured and predicted SR and MRR results. The RSM and ANN methods are applied to find the optimum cutting parameters for minimum SR and maximum MRR.

Fig. 1
figure 1

Programmable CNC machine

Table 1 Chemical composition of Ti-6Al-4 V
Table 2 Physical and mechanical characteristics of Ti-6Al-4 V
Fig. 2
figure 2

Ti-6Al-4 V microstructure

Table 3 Selected cutting parameters
Table 4 Measured and predicted output factors

2.2 Response surface methodology

After completion of the total number of experiments, depending on the requirement, some output factors need to be minimized and some to be maximized with selected input factors. RSM is one of the best techniques to obtain optimum input factors for the desired output. RSM uses a combined mathematical and statistical approach for modeling and analyzing the problems. It also measures the correlation between the input cutting factors and the obtained output response. The central composite and Box-Behnken designs are the most effective for fitting second-order polynomials to response surfaces. They apply a relatively small number of observations to estimate the parameters. The Central Composite Design (CCD) and the Box-Behnken design are preferred for three levels and three factors in experimental techniques. Box -Behnken projected three-level designs for fitting response surfaces, which are developed by combining 2 k factorials with incomplete block designs [21]. Usually, a second-order model (Eq. 1) is generally employed to find a correct approximation for the functional connection between the input and output factors.

$$ Z = \beta_{o} + \mathop \sum \limits_{i = 1}^{k} \beta_{i} X_{i} + \mathop \sum \limits_{i = 1}^{k} \beta_{ii} X_{i}^{2} + \mathop \sum \limits_{i} \mathop \sum \limits_{j} \beta_{ij} X_{i} X_{j} + \varepsilon $$
(1)

where Z is the output factor, \({\beta }_{o}\) is the fixed term; \({\beta }_{i}\),\({\beta }_{ii}\),\({\beta }_{\mathrm{i}j}\) are the coefficients of linear, quadratic, and cross product terms, respectively, and \({X}_{i}\) is the input factor [21].

Analysis of variance (ANOVA) goes hand in hand with RSM. Using ANOVA the interaction between the input factors and the resulting response factors are determined. It also helps in assessing the statistical significance of each parameter.

2.3 Machine learning

In recent times, machine learning techniques, particularly artificial neural networks (ANN), have grabbed many researcher's interests in all engineering fields [22]. The information processing ability of the human brain has inspired ANN to achieve human-like performance [23]. ANN is useful for modeling the machining processes to predict interrelated parameters. Using data preprocessing, the numpy, the pandas and the matplotlib libraries are imported to build an ANN model.

The data is imported and defines dependent and independent variables. The pair-plot generated is shown in Fig. 3, which represents the matrix of relationships among the variables. While building ANN models, Keras library files are imported in python, where TensorFlow (free and open-source software library for machine learning) is used in the backhand. Two modules were imported from Keras, in which Sequential is the first for initializing the model, and then the second module, Dense, is used to add different layers in the ANN model. The parameters included in the input and first hidden layer are the numbers of neurons = 25, input dimensions = 3, and activation function = relu. In the second hidden layer, neurons = 25, activation function = tanh, and in the output layer, output dimensions = 1 and linear function are used because the output response is a continuous variable.

Fig. 3
figure 3

ANN model

After initializing the model, the next step is compiling the model. The optimizer Adam is used to get optimal weights and the other parameter used is the mean squared error loss function (since the output response is a continuous variable). The data is then fitted using X_train, Y_train model by taking 25 percent out of total experiments for validation followed by the parameter epoch. In this work, its value is considered 500.

3 Results and discussion

RSM is employed to examine the impact of cutting parameters on output results while turning Ti-6Al-4 V using a TiCN coated carbide tool on a CNC programmable lathe machine. Figure 4a–b shows the standard probability plots for SR and MRR, which provide information about the distribution of residual data points. From Fig. 4a–b, it is understood that there is no deviation among the data points, which represents an inclined-line form designating that the errors are dispersed equally. Figure 5a–b displays the connection between the actual and predicted SR and MRR. From the data points pattern, as shown in Fig. 5a–b, it is understood that the generated model and the calculated results are in decent agreement. The coexistence of data points with the fitted line authenticates that the model is valid with the smallest errors.

Fig. 4
figure 4

Normal Probability of a surface roughness and b MRR

Fig. 5
figure 5

Actual vs Predicted data of a surface roughness and b MRR

The ANOVA technique is applied to find each input parameter's contribution to output responses viz material removal rate and surface roughness, which confirms the impact of individual parameters, squares, and interactions on the output factors [23,24,25]. The F-values exhibit the significance of each input parameter on the model. The multiple regression investigations of the above second-order polynomials and their validation is carried out using ANOVA for the corresponding machining responses are shown in Table 5 and 6. The generated R2 value confirms the predictive capability of the model. The models developed for SR and MRR are found significant at a 95% confidence level. The obtained regression equations for SR and MRR are shown in Eqs. (2) and (3).

Table 5 ANOVA results for SR
Table 6 ANOVA results for MRR

3.1 Analysis of surface roughness

In this investigation, the output response surface roughness (SR) is assigned smaller, the better criterion. From Table 5, it is clear that speed has the highest impact on SR, followed by feed and DOC. Speed, feed, and DOC have 44.62%, 28.39%, and 21.48% influence on SR. A slight variation in speed and considerable variation in DOC has the most and least impact on SR, respectively. Figure 6a–c shows the collective effect of cutting parameters at different hold values: DOC (0.75 mm), speed (1200 rpm) and feed (0.25 mm/rev) for SR. It is observed that with the decrease in cutting speed from 1500 to 900 rpm, the SR decreases, and with a decrease in DOC from 1 to 0.75 mm, the SR decreases and further decreases in DOC to 0.5 mm, the SR increases slightly. It is also understood that to achieve the best surface roughness, the optimum combination of cutting parameters are the speed at level-1 (900 rpm), feed at level-1 (0.15 mm/rev), and DOC at level-2 (0.75 mm). It is well-known from the fundamentals of metal cutting that the feed influences the pitch of the machined surface profile (SR = f2/8r), where f = feed and r = nose radius. Hence, surface roughness increases with the increase in feed. This is because, at higher cutting speeds and feeds, the tool traverses the workpiece too fast, resulting in deteriorated surface quality, and also the combination of high speed and high feed increases the chatter and vibrations in machines, which leads to more elevated surface roughness [26].

Fig. 6
figure 6

a Combined effect of speed and feed on surface roughness(SR), b Combined effect of feed and DOC on surface roughness(SR), c Combined effect of speed and DOC on surface roughness(SR)

3.2 Analysis of material removal rate

In this investigation, the output response viz., material removal rate (MRR) is assigned larger, the better criterion. From Table 6, it is clear that the DOC has the most significant impact on the MRR, followed by speed and feed. DOC has 64.43% influence on MRR, followed by the speed with 33.16%, and feed with 1.89%. A slight variation in DOC and a considerable variation in feed have the most and least significant deviation in MRR, respectively. Figure 7a–c shows the collective effect of variation of cutting parameters at hold values: DOC (0.75 mm), speed (1200 rpm), and feed (0.25 mm/rev) for MRR. With an increase in DOC from 0.5 to 1 mm and speed from 900 to 1500 rpm, the MRR increases. To attain the highest MRR, the optimum combination of cutting parameters is the speed at level-3 (1500 rpm), feed at level-3 (0.35 mm/rev), and DOC at level-3 (1.00 mm). As the depth of cut and feed increases, MRR also increases. This is mainly due to more volume of chips generated during machining [27, 28].

Fig. 7
figure 7

a Combined effect of speed and feed on Material removal rate, b Combined effect of feed and DOC on Material removal rate, c Combined effect of speed and DOC on Material removal rate

3.3 Regression equations for Surface roughness and Material removal rate

$$ \begin{aligned} {\text{Surface roughness }} = \, 0.46 \, - 0.00017 {\text{speed }} + 20.7 {\text{feed }} - 7.59 {\text{DOC }} - 0.000000 {\text{speed}}*{\text{speed}} \hfill \\ \, - 41.4 {\text{feed}}*{\text{feed }} + 4.48 {\text{DOC}}*{\text{DOC }} + 0.00208 {\text{speed}}*{\text{feed }} + 0.00143 {\text{speed}}*{\text{DOC}} \hfill \\ + 0.89 {\text{feed}}*{\text{DOC}} \hfill \\ \end{aligned} $$
(2)
$$ \begin{aligned} {\text{Material removal rate }} = \, 1298 \, + 29.3 {\text{speed }} + 20349 {\text{feed }} - 60193 {\text{DOC }} - 0.0114 {\text{speed}}*{\text{speed}} \hfill \\ - 132089 {\text{feed}}*{\text{feed}} + 34810 {\text{DOC}}*{\text{DOC }} + 12.5 {\text{speed}}*{\text{feed }} + 4.0 {\text{speed}}*{\text{DOC}} \hfill \\ \, + 51283 {\text{feed}}*{\text{DOC}} \hfill \\ \end{aligned} $$
(3)

3.4 ANN analysis

In the ANN model, a back-propagation algorithm is used to predict the machining responses. The number of hidden layers and the fair number of neurons in each hidden layer is based on the targets, such as the function's complexity, generalization capabilities, the computation time required for training, and the risk of over-fitting. The network optimization was performed by adjusting the number of hidden layers and the number of nodes in these layers through a trial and error method to change the converged error [17]. After examining different neural network architectures, the results show that the network structure is accurate with two hidden layers and 25 neurons and is reliable in the present investigation. The ADAM optimization algorithm was selected among different training methods because it is relatively easy to configure (the default configuration parameters do well on most problems). The hyperbolic tangent and relu transfer functions have been used between the input and hidden layers. A linear transfer function has been used between the hidden and output layers as the output is a continuous value. The model's evaluation is done for SR and MRR based on loss propagation, and it achieved stable performance with not much difference in training and validation sets as shown in Fig. 8a and b. The Root mean squared error (RMSE) metric is chosen to evaluate the model performance, using Eq. (4); the RMSE value obtained for MRR is 0.397 and for surface roughness is 0.291. The lower the RMSE value, and the better is the model.

$$ RMSE = \sqrt {\mathop \sum \limits_{i = 0}^{n} \frac{{\left( {y^{pred} - y^{actual} } \right)^{2} }}{n}} $$
(4)

where ypred = predicted value from ANN.

Fig. 8
figure 8

a Model loss propagation during training and validation for surface roughness, b Model loss propagation during training and validation for material removal rate

yactual = experimental value.

n = number of samples.

The result analysis observed that the considered machine learning technique is an accurate, efficient, and practical tool for estimating SR and MRR at different cutting conditions. Among all the machine learning techniques, ANN is one method that produces the best outcomes with high accuracy [17].

The results obtained by this technique have been entirely satisfactory, but few results have variations with predicted values. Fewer experiments might be one of the reasons for deviations, and this can be improved by taking more samples.

3.5 Confirmation test and comparison of RSM and ANN error

The best combination of cutting parameters found from the RSM and ANN for SR and MRR is validated with the experiment to authenticate the model's effectiveness. The optimal combination for best SR and MRR is at a speed of 1200 rpm, feed of 0.15 mm/rev, and DOC of 0.75 mm. The comparison between the experimental result and the predicted outcome is shown in Table 7. The percentage error using RSM for surface roughness and MRR is 6.85 and 13.33, respectively. Whereas for ANN, it is 5.04 and 10.66, respectively. The percentage error values are within the acceptable range.

Table 7 Confirmation test and comparison of RSM and ANN error

4 Conclusion

In the present work, the 2FI models for MRR and SR have been developed to investigate the influences of cutting parameters in turning of titanium (Ti-6Al-4 V) alloy. The experimental plan is based on Box Behnken method. The influence of cutting parameters such as cutting v, f, d have been evaluated using RSM and ANN. The following conclusions are drawn based on this study:

  • ANOVA is applied to identify the influence of each cutting parameter on both surface roughness and material removal rate. Cutting speed (44.62%) significantly impacted surface roughness, followed by feed (28.39%) and depth of cut (21.48%). The material removal rate is majorly influenced by the depth of cut (64.43%), followed by the speed (33.16%), and the feed (1.89%) has a minor influence.

  • From the response surface methodology, for better surface roughness, the optimum combination of cutting parameters is: the speed at level-1 (900 rpm), feed at level-1 (0.15 mm/rev), and depth of cut at level-2 (0.75 mm) and for material removal rate: the speed at level-3 (1500 rpm), feed at level-3 (0.35 mm/rev) and depth of cut at level-3 (1.00 mm).

  • The ANN analysis concludes that the predicted values are promising and reliable. The evaluation of the model also shown less loss propagation between test and validation results. The RMSE value obtained is 0.397 for MRR and 0.291 for surface roughness. The lower RSME values indicate the higher accuracy of the model.

  • In comparison with RSM, the percentage error in ANN is less.

This work is limited to the dry machining of titanium alloy (which is hard to machine) using coated tool and optimized using RSM and ANN techniques. This work can be extended by carrying out wet machining as well as using different advanced optimization tools.