1 Introduction

Over the years, the manufacturing sectors have developed various technologies for improving production efficiency and maximizing revenues at a reduced cost to be relevant in the competitive global market. These indices correlate with higher material removal rate, efficient machining time, and excellent surface quality finish on hardened steels through high-precision manufacturing. One such technology employed in phasing out the traditional grinding operations for better accuracy and surface quality in machining hard materials, superalloys, and other hard-to-cut materials to desired specification of components and parts is the ultra-precision hard-turning (UPHT) for finishing operations. Hard turning is a machining method for cutting the cylindrical surface of a workpiece of a hardness value of more than 45 HRC with a single-point cutting tool [1,2,3]. Ultra-precision hard-turning is a machining process involving high-precision machines and cutting conditions to produce parts with extremely high surface finish and geometric accuracy. It is typically used to produce parts with a surface roughness of less than 0.1 µm and form an accuracy of less than 1 µm.

Ultra-precision hard-turning typically requires specialized machine tools and cutting tools, such as diamond or CBN turning tools with negative rake angles, which can produce high-quality surface finishes and precise dimensional tolerances. The cutting conditions, such as cutting speed, feed rate, and depth of cut, must also be carefully controlled to achieve the desired level of precision. This process has been applied in different industries but not limited to the automobiles, aerospace, medical, and optical industry, where high precision and surface quality are crucial for optimal performance and economical manufacturing [4] and be more efficient than the grinding process [5]. Ultra-precision hard-turning is also used to produce machine parts, such as gears and bearings, and optical components, such as lenses and mirrors [6]. It is worth mentioning that the ultra-precision hard-turning process is a challenging task. It requires high skill and experience to achieve the desired precision and surface finish level. It also requires advanced measurement and control systems to ensure the finished parts meet the specifications.

In recent years, there have been studies on developing new cutting tools and techniques for hard turning. The cubic boron nitride (CBN) is a synthetic material recognized for its exceptional hardness, wear resistance, and thermal stability at high temperatures. It is second only to diamond in terms of hardness and is mostly well-suited for machining hardened steels, cast irons, and other difficult-to-cut materials [7,8,9]. More so, the polycrystalline cubic boron nitride among the likes of carbide and ceramic cutters is predominantly accepted for machining AISI D2 as perfect replacement for expensive grinding operations [10]. Additionally, research has been done on optimizing hard machining process parameters such as cutting speed, feed rate, depth of cut, chamfer angle (inserts), and novel prime inserts to improve surface finish, dimensional accuracy, and tool life [11,12,13]. Other investigations involving the use of coolant and lubrication during hard turning have been reported to have some remarkable improvement in surface quality and tool life, too [14, 15].

Modern manufacturing is undisputedly dependent on time, resources, and deployment of information from machines and processes across spatial constraints. These events enhance accuracy and dependability in predicting resources needed and allocation, maintenance scheduling, remaining useful life of tools and equipment, and the surface quality of product parts. Therefore, it is necessary to integrate machine learning (ML) algorithms to help actualize the goals of modern manufacturing. Artificial intelligence is the use of machines to imitate the functions of the human brain, using computers smartly based on algorithms [16, 17]. In contrast, machine learning is a branch of artificial intelligence that examines algorithms that can learn independently directly from input variables [13]. Machine learning algorithms are trained to generate predictions using statistical methodologies, discover vital insights in data mining schemes, and can effectively analyze extensive data, identify complex patterns, and make relevant deductions that are valuable for tool condition monitoring and damage detection of components [18,19,20,21]. Machine learning is generally categorized into three areas namely, thus, supervised, unsupervised, and reinforcement learning. Supervised learning has been reported in works of literature, among which are but not limited to artificial neural networks, genetic algorithms, response surface methods, support vector machines, decision trees, Gaussian process regression, random forest, adaptive neuro-fuzzy inference systems, logistic regression, and naïve Bayes classifiers [13]. In addition, ML methods have been applied in process system engineering, providing alternatives to first principle experimental models for traditional process engineering, for instance, in modeling, product design, fault diagnosis, and predictions of responses given input parameters [22, 23]. According to Imad et al. [24], the application of ML techniques in modeling and optimization problems in intelligent machining systems, including genetic algorithm (GA) and particle swarm optimization, has 23% each; due to their adaptability in comparison to other techniques for complex problems, followed by non-dominated sorting genetic algorithm (NSGA) recorded 15%, ANN and simulated annealing (SA) has 9%, multi-objective genetic algorithm (MOGA) and firefly algorithm (FA) recorded 6% each. In contrast, ant colony (ACO), grey relation algorithm (GRA), and response surface method (RSM) account for 3%, respectively, as of the period of the report.

Tang et al. [25] investigated the wear performance of the PCBN tool in dry hard turning of AISI D2 with various hardness from 40 to 60 HRC values with fixed cutting parameters of feed 0.1 mm/rev, depth of cut 0.15 mm, and cutting speed of 250 mm/min. The results show that workpiece hardness has a significant effect on flank wear. Patel and Gandhi [26] implored full factorial design of experiment (FFD) in the empirical modeling of surface roughness during hard turning of AISI D2 using the CBN tool. The analysis considered cutting speed, feed rate, and nose radius as cutting parameters. The results show that feed rate has the most significant impact on surface roughness, and the empirical model predictions are in close agreement with the experimental results when tested within conditions.

Rafighi et al. [27] utilized Taguchi L36 mixed orthogonal array design of experiment (DoE) in investigating the effect of CBN and ceramic inserts during the hard turning of AISI D2. An ANN and multivariate multiple regression (MMR) models were developed to predict surface roughness and force components. The results show that the ANN model had a better prediction accuracy than MMR, with 99.5% and 83.9%, respectively. More so, it was recorded that feed rate has a more significant effect (90.2%) on surface roughness than nose radius, cutting insert, depth of cut, and cutting speed. Kumar et al. [28] designed a Taguchi L9 orthogonal array to evaluate the effect of process parameters on cutting force and surface roughness on the hard turning of AISI D2 using CBN inserts. Results show that the feed rate has a more significant effect (56%) on cutting force than cutting speed while cutting speed has a more significant effect (72%) on surface roughness than feed rate. On the other hand, signal-to-noise ratio analysis was used for the optimal process parameters proposed at 80 m/min, 0.109 mm/rev, and 0.1 mm for cutting speed, feed, and depth of cut, respectively.

Srithar et al. [10], with a Taguchi L27 DoE, investigated the effect of process parameters on surface roughness during hard turning of AISI D2 using the PCBN tool. Considering feed rate, cutting speed, and depth of cut as process parameters, the results show that the feed rate is the most influential factor of the three cutting parameters. Sarnobat and Raval [29] utilized a central composite inscribed (CCI) design in investigating the effect of tool edge geometry and workpiece hardness on surface roughness and surface residual stress when turning AISI D2 using the CBN tool of the light, standard, and heavy-honed geometries, respectively. The results show that feed rate overall impacts the residual stress and surface roughness more than the depth of cut, hardness, and tool edge geometry. In contrast, CBN light-honed tool geometry in the low to moderate range cutting parameters generates a compressive residual stress state and better surface finish.

Zhang et al. [30] investigated the effect of process parameters, viz. feed, depth of cut, and cutting speed on surface quality, cutting temperature, and tool life using coolant and lubrication versus a dry environment during hard cutting of AISI D2 with PCBN. The results show that feed rate is the most influential process parameter on surface roughness in dry and lubricated conditions while cutting speed is the most significant factor for tool interface temperature and flank wear. It was concluded that the cooling and lubrication conditions could improve the surface quality and prolong tool life. Takács and Farkas [31] investigated the effect of varying the feed rate and cutting speed on cutting force components during ultra-precision hard-turning of AISI D2 using the CBN tool. The results show that the higher the feed rate, the larger the passive and cutting force components. The finite element model was developed to simulate the chip removal process, and it was deduced that the theoretical cutting force values compared to measured values were 45–120% higher.

Furthermore, to improve the surface quality and tool life, various machine learning techniques for predictive or/and optimization models have been employed in hard machining operations related to hardened AISI D2 or CBN cutters, providing good predictive accuracy and optimum combinations of process parameters. These results have been found more efficient and cost-effective in the long run compared to traditional control turning optimization methods [32,33,34,35,36,37,38,39,40,41,42].

Consequently, upon careful literature reviews, it is glaring that the optimization of process parameters which are essential selection considerations to attain better accuracy and surface quality during UPHT is insufficient as the earlier focus has been on dry hard turning operation with conventional lathe. More so, most investigation has implored DoE on Taguchi methods L9, L16, L27, L36 mixed orthogonal array and central composite design (CCD) and a few on FFD, which is a crucial aspect in precision machining. The inappropriate selection of process parameters will affect the surface quality and cost of production. Therefore, more investigation is required to evaluate the effect of process parameters deploying a full factorial design to include all possible combinations of the process parameters.

In addition, various researches have reported the application of different ML techniques as a predictive or optimization model; however, there are limited reports on the investigation of all RSM, GP, SVM, ANFIS, and ANN machine learning techniques, especially during UPHT of AISI D2 using the CBN cutting tool. It is reported that no appropriate ML technique has been certified as suitable for prediction [43]; thus, evaluating the performance of these machine-learning techniques is necessary.

Conclusively, very few reports have implored additional test data to validate the predictive accuracy of developed models for industrial applications. Therefore, the current research seeks to investigate the optimization of process parameters using RSM composite desirability with full factorial design method for all possible combinations of factors and prediction of surface quality using GP, SVM, ANFIS, and ANN in UPHT of AISI D2 using CBN tool and implore additional experimental data to validate the models for effective integration into industrial manufacturing technology and Industry 4.0 environment.

2 Experimental objectives, setup, and methods

2.1 Design of experiment

The specific objectives of the experiment include the prediction of surface quality using different machine learning models with various training algorithms, viz. Gaussian process regression (GPR), support vector method (SVM), adaptive neuro-fuzzy inference system (ANFIS), and artificial neural networks (ANN) and evaluating their performances with experimental results. Moreover, the optimization of process parameters (cutting speed, depth of cut, and feed), imploring the full factorial design for all possible combinations with the response surface method (RSM), in other to obtain the optimal combination of process parameters for minimum surface roughness or better surface quality during the ultra-precision hard-turning of AISI D2 with a CBN tool.

Ultra-precision hard-turning experiments were carried out on hollow cylindrical AISI D2 workpieces with outer and inner diameters of 12 mm and 60 mm, respectively. The length of the workpiece is 40 mm with a hardness value of 62 HRC (Fig. 1). The cubic boron nitride (CBN) cutters and inserts serve as fundamental tools utilized in machining operations, particularly in scenarios demanding high-speed cutting and removal of hard materials. The used insert for this experiment was SECO insert designated with DCGW11T308S-01020-L1-B CBN010. The manufacturer recommends this grade for finishing purposes [44]. The CBN cutter is an uncoated solid full-faced layer and brazed single tip of approximately 50% CBN grade with an average grain size of 2 µm, with TiC ceramic binder, nose radius of 0.8 mm, and chamfer size and rake angle of 0.10 mm and 20°, respectively. The tool shank has an ISO designation of SDHCL2020K11.

Fig. 1
figure 1

(a) Specimen AISI D2 bars. (b) AISI D2 specimen dimension

The operations were performed on a Hembrug ultra-precision machine (with Siemens 840 D CNC control) with a maximum spindle speed of 6000 rev/min, with repetitive and positioning accuracies of ± 1 µm (1 µm/150 mm), respectively. The AISI D2 steel was selected because of its great importance to the manufacturing industries like aerospace, mold-die making, and automotive, for die stamping, cold forming rolls, slitters, chipper knives, shear blades, tire shredders, and the list is endless due to its exceptional wear resistance and toughness properties [26], as shown in Table 1. A high-precision pneumatic 3-jaw chuck clamped the workpiece, and concentricity was checked with a dial indicator and versatile digital microscope. The front surface of the workpieces was machined in three sections, each with a new parameter combination (Fig. 2 (a)). The applied machine is a CNC machine with a’controller, which keeps the vc constant, coded in the NC codes (G-codes), by automatically calculating and setting the rotational speed in the case of face turning.

Table 1 Chemical composition of experimental material
Fig. 2
figure 2

(a) Schematic diagram of AISI D2 specimen surface with three different parameter combinations in an experimental run. (b) Cutting environment of Hembrug ultra-turn. (c) Surface roughness measurement setup

A full factorial design was implemented for the experiments for all possible combinations, with three factors having three levels each, providing 27 experiments (Table 2). The applied factors are as follows: cutting speed, \({v}_{c}\) (m/min), feed f (mm/rev), and depth of cut, \({a}_{p}\)(mm).

Table 2 Design of experiments

However, the experiment was done with two replicates; thus, 81 experiments were carried out. The essence of repeating the experiment twice is to ensure that error is minimized to validate the experimental process. The cutting environment is shown in Fig. 2b. The AISI D2 specimen is removed at the end of each systematic combination of 3 different parameters in each run. The surface roughness was measured with a Mitutoyo SJ-400 surface roughness tester with a diamond tip radii of 2 µm (Fig. 2c). Each surface was measured three times, and the arithmetic mean of these three measurements gives the roughness of the given surface. Regardless of this, the experiments were repeated three times. More so, to train the model, the data of all three experiments were used by taking their average (Rɑ). The experiment and ML model development have been represented in the flowchart, as shown in Fig. 3. In the case of successful training and testing of the model and the performance checked with reliable performance indicator MAPE [45, 46] and achieved satisfied result, the model is then further validated using validation test data and an additional test data (new experiment, with new dataset). Thus, if the validation performance is satisfied, the model is accepted, as it can satisfactorily predict the response for data from similar experimental conditions. However, if the model cannot be validated successfully, the model was tuned-up again by changing training function, training algorithm, membership function, number of neurons, rules, hidden layers, etc., in order to improve on it.

Fig. 3
figure 3

Flowchart of experimental and modeling procedure

2.2 Response surface method

The response surface methodology (RSM) is a statistical approach utilized to examine the connections between various process or input parameters and the response of a system. It is a design of experiments (DoE) technique that involves constructing a mathematical model through several experimental trials. The goal of RSM is to enhance response by altering the input levels, such as process parameters, to discover the optimal combination that results in the preferred outcome. The RSM is expressed as shown in equation below [47, 48].

$$Y= {\beta }_{0} +\sum_{i=1}^{k}{\beta }_{i}{X}_{i}+ \sum_{i}\sum_{j}{\beta }_{ij}{X}_{i}{X}_{j}+ \sum_{i=1}^{k}{\beta }_{ii}{X}_{i}^{2}+ \varepsilon ,$$
(1)

where Y is the predicted response, X are process parameters (X1, X2, X3,..., Xk), i and j are the linear and quadratic coefficients, respectively, k is the number of parameters, \(\beta\) is the regression coefficient, and \(\varepsilon\) is the experimental error. In this work, RSM in Minitab 21 statistical software was used to evaluate the effects of the process parameters on the response and approximate the best combinations of process parameters for optimal response.

2.3 Support vector machine

The support vector machine (SVM) is a popular machine learning algorithm that can be used for classification or regression and prediction for nonlinear problems. The fundamental concept of SVM is to locate the hyperplane that optimally divides the data points into their corresponding classes. SVM aims to maximize the margin, which refers to the space between the hyperplane and the nearest data points. These nearest data points are referred to as support vectors and are crucial in defining the hyperplane [49, 50]. Thus, the function for predicting new values is expressed in the equation:

$$f \left(X\right)= \sum_{n=1}^{N}({\alpha }_{n}-{\alpha }_{n}^{*})G\left({X}_{n}, X\right)+b,$$
(2)

where \({\alpha }_{n}\) and \({\alpha }_{n}^{*}\) are non-negative multipliers for each observation \({X}_{n}\), \(b\) is the bias, and \(G\left({X}_{n}, X\right)\) is the Gaussian kernel function. The SVM in this work was implemented using the Regression Learner of Statistics and Machine Learning Toolbox in MATLAB R2022b.

2.4 Gaussian process regression

The Gaussian process regression (GPR) is a type of non-parametric Bayesian machine learning method used for predicting target values of new data points based on the relationship between features and target values found in the training data [51,52,53]. The GPR can be summarized for prediction as expressed in the equation:

$$f\left(X\right)=\sum_{n=1}^{N}GP(m\left(X\right), k \left(X, {X}{\prime}\right)),$$
(3)

where \(m\left(X\right)\) and \(k \left(X, {X}{\prime}\right)\) represent the mean function often taken as zero with no loss of generality and kernel covariance function regulating model smoothness, respectively. The GPR in this work was deployed using the Regression Learner of Statistics and Machine Learning Toolbox in MATLAB R2022b.

2.5 Artificial neural network

Artificial neural networks (ANNs) are computer programs that aim to mimic the way the human nervous system works by replicating its complex network structure [54, 55] that could validate and predict responses from process parameters [56, 57]. These networks consist of an input layer, one or more hidden layers, and an output layer, each with multiple neurons, in which the neurons between adjacent layers are fully interconnected [45]. The ANN model works thus, with input or process parameters \({X}_{i}\) connected and transferred by multiplication with weights \({W}_{i}\) and summed with a bias, B, and an activation function (sigmoid, hyperbolic tangent, threshold, or ReLU) to obtain the output. A simple ANN model equation is expressed in the equation below [45].

During the several iterative processes, the output parameter(s) are compared with the original ones and adjusted accordingly to minimize error and maximize model accuracy. A simple multilayer perceptron for this work is presented in Fig. 4, with process parameters and response parameters such as cutting speed, depth of cut, feed, and surface roughness, respectively. The neural networks toolbox in MATLAB R2022b was used for the model training.

$$f \left(X\right)= \sum_{i=1}^{N}\left({W}_{i} * {X}_{i}\right)+B.$$
(4)

where \({X}_{i}\) are inputs or process parameters (\({X}_{1}, {X}_{2, } {X}_{3}, . . . {X}_{n}\)), \({W}_{i}\) are weights (\({W}_{1}, {W}_{2, } {W}_{3}, . . . {W}_{n}\)), and \(B\) is the bias.

Fig. 4
figure 4

A simple multilayer ANN architecture for the proposed model

2.6 Adaptive neuro-fuzzy inference system

The adaptive neuro-fuzzy inference system (ANFIS) is a fuzzy inference system that utilizes an adaptive algorithm to determine the fuzzy system parameters from the available data. ANFIS is an integrated machine learning system of two recognized methods, artificial neural networks (ANN) and fuzzy logic systems (FLS). ANFIS combines the strengths of both ANN and FLS to create a powerful and flexible model that can handle complex and nonlinear problems with fewer process and response parameters [38]. The ANFIS consists of a fuzzy inference system (FIS), responsible for decisions based on fuzzy rules, and the adaptive algorithm, which is the mechanism for adjusting the parameters of the FIS and enhancing its performance over time (backpropagation or the hybrid). Then comprises an input, fuzzy, rule, normalization, and output layers. The input layer receives the process parameters, which are used to make the predictions, and the fuzzy layer imposes a fuzzy rule (\({W}_{i}\)) on the inputs to process intermediate output, referred to as the membership functions (MF). The normalization layer (N, \(\overline{{W }_{i}}\)) normalizes the intermediate output between 0 and 1. The fuzzy output layer (\({W}_{i} {f}_{i}\)) combines the output from normalization using a specific weighted method to produce a linear membership function. In contrast, the final output layer defuzzifiers (\(\sum {W}_{i} {f}_{i}\)) and converts the fuzzy output to a concise and clear output for decision-making or prediction. This process is illustrated in Fig. 5. The ANFIS model for this investigation was developed using the NeurofuzzyDesigner toolbox in MATLAB R2022b.

Fig. 5
figure 5

A simple ANFIS Sugeno model architecture

2.7 Models performance evaluation

There are various statistical performance measures for evaluating predictive accuracy between two variables. In this case, we have measured values and predicted values. For this work, we shall be considering the correlation coefficient (R), root mean squared error (RMSE), and the mean absolute percentage error (MAPE).

2.7.1 Correlation coefficient (R)

The correlation coefficient (r or R) measures the relationship between two variables and varies between + 1 and 1. In the case of modeling, the relationship between the measured or experimental value (M) and the predicted value (P) can be evaluated by this parameter. Thus, an R-value that tends toward 1 means a strong positive correlation between the measured and the predicted values, and if it tends toward zero, the correlation will be weak. In contrast, negative values indicate a negative correlation between the two variables, and − 1 indicates a strong negative correlation. Therefore, the conventional polarity sign of R adopts the coefficient of regression [46]. It is also known as Pearson’s correlation coefficient and is expressed in the equation:

$$R= \frac{\sum \left({M}_{i}- \overline{M}\right)- \left({P}_{i}- \overline{P}\right) }{\sqrt{\sum {({M}_{i}- \overline{M})}^{2}\sum {({P}_{i}- \overline{P})}^{2}}}$$
(5)

2.7.2 Root mean squared error (RMSE)

The root mean squared error (RMSE) is the square root of the sum of squared errors divided by the number of observations. The RMSE can be expressed in equation [27, 58]. In this case, the best value is that which tends to zero, while the worst is on the positive infinity [59].

$$RMSE= \sqrt{\frac{\sum_{i=1}^{N}{({M}_{i} - {P}_{i})}^{2}}{N}}$$
(6)

2.7.3 Mean absolute percentage error (MAPE)

The mean absolute percentage error (MAPE) is the average of absolute errors divided by the measured or experimental values. The MAPE is the most effective measure in assessing the predictive accuracy of models in that it measures relative performance [45, 46, 57]. It is expressed in the equation below [58, 60]. The predicted values can be interpreted according to Lewis [46]; a model is classed as Highly accurate (if MAPE is less than 10), Good prediction (if MAPE is between 10 and 20%), and Satisfactory (if MAPE is between 20 and 50%). In comparison, Inaccurate (if MAPE is greater than 50%).

$$MAPE= \frac{1}{N} \sum_{i=1}^{N}\left(\frac{{M}_{i}- {P}_{i}}{{M}_{i}}\right)\times 100\%,$$
(7)

where \({P}_{i}\) = predicted values, \({M}_{i}\) = measured values, \(\overline{M}\) = mean of measured values, \(\overline{P}\) = mean of predicted values, \(N\) = number of observations, as represented in Eqs. 5-7.

3 Results and discussion

The process parameters, namely cutting speed (vc), feed (f), and depth of cut (ɑp), selected for the experiment, and the measured average surface roughness (Rɑ) have been investigated using the RSM in Minitab 21. The effect of process parameters on the response parameter has been reported in this section. In developing each ML model (ANFIS, SVM, GPR, and ANN), the input and measured parameters were divided systematically, training and testing the models. In the process parameters, the measured Rɑ and the ML-predicted Rɑ are summarized in Table 3.

Table 3 Summary of processes parameters combination and the corresponding measured and predicted values of surface roughness

3.1 Analysis of variance

The analysis of variance (ANOVA) in Table 4 shows that among the process parameters, only the feed rate has a significant effect on the surface roughness, and that the p-values at the linear, squares, and two-way interactions of the model were found to be far less than p-value at \(\propto\) = 0.05. The feed rate percentage contributions on surface roughness are about 92%, 82%, and 8% in the linear, square, and 2-way interactive effect (with cutting speed), respectively, as seen in the Normal plot and Pareto chart of standardized effect (Fig. 6).

Table 4 Analysis of variance
Fig. 6
figure 6

(a) Normal plot of standardized effect. (b) Pareto chart of standardized effect

The RSM model for surface roughness has an R-squared value of 94.93%, which shows that the model is highly satisfactory under the confidence interval of 95% at a significance of α = 0.05. The surface roughness model is found to be a quadratic regression, as expressed below, which is affirmed by the main effect plots shown in Fig. 7.

Fig. 7
figure 7

Main effect plot for surface roughness

$$Surface\;Roughness\;{R}_{a}\left(\mu m\right)=0.523-4E-5\left({v}_{c} \right)-2.48\left(f\right)-6.5ap+1E-5{\left({v}_{c} \right)}^{2 }+49.3{\left(f\right)}^{2 }+ 41.3{\left(ap\right)}^{2 }-0.021\left({v}_{c} \right)\left(f\right)-0.016\left({v}_{c} \right)\left(ap\right)+29.6 \left(f\right)\left(ap\right)$$
(8)

The main effect plot shows that the surface roughness decreases sharply as the cutting speed increases from 75 to 120 m/min, then gradually decreasing as the cutting speed increases to 175 m/min. On the other hand, surface roughness decreased gradually as the depth of cut increased from 0.06 to 0.08 mm and was observed to increase gradually at a further increase to 0.1 mm. However, it is glaring that the surface roughness increases for every increase in the feed from 0.025 to 0.125 mm/rev. The current results and the correlations found are similar to the general findings related to the effect of feed. This outcome could be explained by the direct relationship between surface roughness and feed, as represented in the equation below [27], where “nr” is the nose radius.

$${R}_{a}= \frac{{f}^{2}}{32{n}_{r}}$$
(9)

Figure 8 shows the contour plots of surface roughness, in which surface roughness is found to be less than 0.3 µm at the interaction between feed rate and cutting speed (for f ≤ 0.06 mm/rev and 75 m/min ≤ vc ≤ 175 m /min) with a constant value of ɑp = 0.08 mm, however for higher feeds, the surface roughness increases. Similarly, the surface roughness is found to be less than 0.3 µm at the interaction between feed and depth of cut (for f ≤ 0.06 mm/rev and 0.06 mm ≤ ɑp ≤ 0.1 mm) with constant value vc = 125 m/min; however, surface roughness increases with feeds higher than 0.06 mm. For the interaction between depth of cut and cutting speed (for ɑp ≤ 0.098 mm/rev and 80 m/min ≤ vc ≤ 175 m/min) with a constant value of f = 0.075 mm/rev, the Rɑ was found to be within 0.3 and 0.4 µm. Surface roughness values within these regions could be spotted on the contour as shown in Fig. 8 for vc = 81.9 m/min and f = 0.052 mm/rev Rɑ = 0.27 µm, while for ɑp = 0.098 mm and f = 0.058 mm/rev Rɑ = 0.28 µm.

Fig. 8
figure 8

The contour plots for surface roughness

3.2 Development and evaluation of machine learning models

The ML models were developed using different training algorithms, transfer functions, membership functions, and neurons, depending on the type of ML in each case. The best model in each technique that satisfied the training and test evaluation criteria based on the statistical performance indicators (R, RMSE, and MAPE) was saved and validated using additional test data afterward.

3.2.1 GPR model development

The regression learner application in MATLAB R2022b was used, and the data set was divided into 80% and 20% for training and testing (cross-validation) for the modeling. All GPRs of different regression learner algorithms were trained, including rational quadratic, squared exponential, matern 5/2, and exponential. The GPR algorithm with squared exponential algorithm of the isotropic kernel function, constant basic function and automatic kernel scale, sigma hyperparameters, the training time of 9.23 s, and prediction speed 390 obs/s was found to be the best with R-squared and RMSE values for trained data to be 0.88 and 0.08 respectively, and that for the test data were 0.77 and 0.11, respectively. These values are statistically significant compared to other GPRs. Figures 9 and 10 show the response plot and the predicted vs. measured values plot of the squared exponential GPR model.

Fig. 9
figure 9

Response plot of squared exponential GPR trained model

Fig. 10
figure 10

Predicted vs. measured response plot of squared exponential GPR trained model

3.2.2 SVM model development

The SVM model was developed using the regression learner in MATLAB R2022b. The data set was divided into training (80%) and testing (20%) data. The five inbuilt different kernel functions of SVM were investigated; they include SVM linear, quadratic, cubic, fine Gaussian, medium Gaussian, and coarse Gaussian. After all evaluations, the cubic SVM, with automatic kernel scale, box constraint, and epsilon hyperparameters and training time of 1.72 s with a predictive speed of 980 obs/s, was found to be better than the other four SVMs with R-squared and RSME values 0.88 and 0.07, respectively for training, while that of testing are 0.62 and 0.14, respectively. The response plot and prediction vs. measured response plot are shown in Figs. 11 and 12, respectively.

Fig. 11
figure 11

Response plot of cubic SVM trained model

Fig. 12
figure 12

Predicted vs. measured plot of cubic SVM trained model

3.2.3 ANN model development

In developing the ANN models, the feedforward backpropagation with sigmoid hidden neurons and linear output neurons was considered due to its suitability for regression tasks with a gradient descent with momentum weight and bias adaptive learning function (learndgm). The data partitioning for each model was 80% and 20% of available data for training and testing, respectively. Three different training functions were used, namely thus, Levenberg–Marquardt (trainlm), Bayesian regularization (trainbr), and scaled conjugate gradient (trainscg). Two different types of architecture were considered, one hidden layer (3-N-1) and two-hidden layers (3-N–N-1), where N equals 6, 10, 12, and 20, and where the numbers 3 and 1 represent the number of input and output parameters, respectively. The results show that the Bayesian regularization model with one hidden layer 3–12-1 has the best predictive accuracy and minimum error with R, MSE, and RMSE values 0.9867, 0.0012, and 0.0346, respectively, at the 28th epoch. The performance and regression plots of the selected ANN model are shown in Figs. 13 and 14.

Fig. 13
figure 13

Performance plot of Bayesian regularization ANN model

Fig. 14
figure 14

Performance plot of Bayesian regularization ANN model

3.2.4 ANFIS model development

The ANFIS model, as earlier discussed, has the strength of fuzzy logic and ANN integrated by learning from the process and the capability of managing uncertain information. Therefore, it approximates nonlinear and uncertain systems without requiring an actual mathematical model. The ANFIS model was developed using the NeuroFuzzyDesigner in MATLAB R2202b. The model has three input parameters (cutting speed, feed rate, and depth of cut) and one output parameter (surface roughness) using the Sugeno fuzzy inference system, which was designated the m422c model, as shown in Fig. 15. It must be noted that different models were tested and named according to the membership function (MF) in each input parameter; however, the best was m422c. The ANFIS model m422c implies that 4-MF, 2-MF, and 2-MF are in the input parameters, cutting speed, feed rate, and depth of cut, respectively. The model utilizes Gaussian MF (gaussmf) in each input parameter, constant MF at the output with 16 rules connected with IF and AND logic operators, and default defuzzification method of weight average of all rules (wtaver). It was trained with the hybrid FIS optimization method. The architecture of the ANFIS model is shown in Fig. 16.

Fig. 15
figure 15

ANFIS Sugeno model designated with “m422c”

Fig. 16
figure 16

The architecture of the developed “m422c” ANFIS model

The result of the developed ANFIS model is statistically significant, with R and RMSE values of 0.99 and 0.03, respectively, for the training data. Conversely, that for the testing data was found to be 0.98 and 0.06, respectively (Table 5). More so, the surface interaction plots from the ANFIS model validated our ANOVA results using RSM, showing a rapid increase in surface roughness as the feed increases. In contrast, cutting speed does not significantly affect surface roughness (Fig. 17). Similarly, in Fig. 18, the feed shows a direct relationship with surface roughness. In contrast, the depth of cut has no significant effect. Finally, the cutting speed and depth of the cut surface interaction plot show no significant effect on the surface roughness (Fig. 19).

Table 5 Summary of statistical performance indices
Fig. 17
figure 17

Surface interaction plot of feed and cutting speed

Fig. 18
figure 18

Surface interaction plot of feed and depth of cut

Fig. 19
figure 19

Surface interaction plot of the depth of cut and cutting speed

Therefore, based on the results, it could be seen that the predictive accuracy of all proposed ML models is said to be highly accurate since MAPE values are less than 10% for the trained data and good accuracy for trained data (since MAPE values are between 10 and 20%) [46]. Table 5 summarizes the statistical performance indicators of ML models. All models have high correlation coefficient R-values (ranges from 0.94 to 0.99) and low RMSE-values (ranges from 0.03 to 0.08) which are statistically satisfactory because they show a strong positive correlation between the measured and the predicted values and minimum errors. Similarly, validation test performance sees the R-values (from 0.88 to 0.99) and low RMSE-values (from 0.03 to 0.14), which are statistically satisfactory because they show a strong positive correlation between the measured and the predicted values and minimum errors respectively. However, it could also be deducted that the ANFIS and ANN models outperformed other ML model as highly accurate with MAPE values of 6.24% and 9.30%, respectively for trained data. While the validation test of the models were found to be 9.98% and 3.43% for ANFIS and ANN, respectively. More so, the ANN model has R (0.99) and RMSE (0.03) for trained data while the validation test values were R (0.99) and RMSE (0.03). Similarly, ANFIS has R (0.99) and RMSE (0.03) for trained data, then R (0.98) and RMSE (0.06) for validation test.

Figure 20 shows the comparative plots of measured and predicted surface roughness (Ra) values from the different developed machine learning models. It shows very close similarity and high correlation between the measured and predicted values. The predictive accuracies for the developed models are highly accurate, as the validation test affirms [45, 46]. However, it is essential to validate these models with additional experimental test data to recommend industrial applications and future integration for predicting surface quality in real-time.

Fig. 20
figure 20

Comparison of measured and predicted Rɑ values of developed models

3.3 Additional validation test of ML models

Furthermore, to validate the predictive accuracy of developed models for industrial application, an additional experiment test was carried out using a new set of machining parameters, and the corresponding surface roughness was measured. The cutting parameters were subsequently used as the input data for the developed models to predict the surface roughness (as output). The additional experimental test cutting parameters, the measured, and the predicted surface roughness have been summarized in Table 6. The additional validation test results are summarized in Table 7, and comparative plots of ML models predicted Rɑ with the measured Rɑ presented in Fig. 21. The R-values for GPR, SVM, ANN, and ANFIS are 0.79, 0.79, 0.78, and 0.81, respectively, showing strong correlations between measured and predicted values. Furthermore, it is essential to note that the MAPE values for all models were satisfactorily accurate, with an average value of 36.17% (MAPE is between 20 and 50%). However, it could be inferred that the ANFIS model has better predictive accuracy with a strong positive correlation between the measured and predicted values compared to other ML models, with an R-value of 0.81, a minimum RMSE of 0.17, and a MAPE value of 32.34%, which are statistically significant.

Table 6 Summary of additional experimental test with measured and predicted surface roughness for validation
Table 7 Summary of statistical performance indicators of validation test of the different predictive models
Fig. 21
figure 21

Comparison of measured and predicted Rɑ values for validation test

Table 6 shows some similarity among the ML models’ predicted surface roughness values with a strong correlation coefficient (R) value for GPR, SVM, ANFIS, and ANN models having 0.79, 0.79, 0.81, and 0.78, respectively. Figure 21 presents the comparison plot of measured and predicted surface roughness of additional validation test experiments. Additionally, it is interesting to note that there is a wide margin between the measured and predicted values of the ML models. This margin can be adequately explained by looking at the MAPE values in Table 7, in that the average error of the model’s prediction is 36.17% for entirely new data not used in model development. This result implies that the ML models’ predictive accuracy is statistically satisfactory because their errors are within 20–50%. However, the ANFIS has a better predictive accuracy among the developed ML models with a minimum MAPE value of 32.34% using additional new test data.

3.4 Optimization of process parameters

Furthermore, to investigate the appropriate process parameter selections for good surface quality in the hard-turning operations, the response surface method (RSM) was implored to optimize the process parameters to minimize surface roughness. After successful iterations, five different solutions were proposed for minimum Rɑ values. It could be observed that the depth of cut could be held at 0.08 or 0.09 mm, and feed of 0.025 mm or 0.029 mm with varying cutting speeds of 77 m/min, 78 m/min, 100 m/min, 120 m/min, and 121 m/min. The smallest surface roughness value investigated was 0.207 µm with process parameters as follows: 100 m/min, 0.025 mm/rev, and 0.09 mm for cutting velocity, feed, and depth of cut, respectively. The proposed optimization process parameter combinations for minimum surface roughness are summarized in Table 8.

Table 8 Optimization solutions for surface roughness

4 Conclusion

This research has conducted a comprehensive review of predictive modeling related to the ultra-precision hard-turning operation. A systematic series of experiments were carried out on AISI D2 hardened tool using a CBN cutting insert with a full factorial design (FFD) for all possible combinations of process parameters (cutting velocity, feed, and depth of cut) at three levels, and the measured response was surface roughness. Different machine learning-based models were proposed and developed to predict and optimize surface roughness. Thus, the following main findings were made:

  • The effect of process parameters, investigated with analysis of variance (ANOVA), shows that the RSM model for surface roughness is statistically satisfactory; the R-squared and adjusted R-squared values are 94.93% and 92.25%, respectively. The feed was the only significant factor affecting the surface roughness, with about 92% influence, while cutting speed and depth of cut were insignificant within α = 0.05 at a 95% confidence interval (Fig. 6b).

  • The proposed and developed machine learning models were evaluated using correlation coefficient (R), root mean squared error (RMSE), and mean absolute percentage error (MAPE), and the results show that their predictive accuracies were satisfactory and statistically significant (Table 5). All machine learning models were highly accurate according to their MAPE values (6.24% at ANFIS, 9.30% at ANN, 7.88% at SVM, 6.11% at GPR) for the trained data, which are all less than 10% [46]. More so, the validation test indicates that ANFIS (9.98%) and ANN (3.43%) models are highly accurate, while SVM (16.18%) and GPR (13.51%) models have good predictions.

  • An additional validation test experiment was carried out to further validate the models’ predictive accuracy with new process parameters. The performance indices show that ML models’ average R, RMSE, and MAPE values are 0.79%, 0.18, and 36.17%, respectively. This implies that all proposed models are satisfactory and statistically significant [46], and ANFIS provides the minimum MAPE (32.34%). This could be attributed to its robust capabilities of incorporation of ANN and fuzzy logic algorithms.

  • More so, a full factorial design in RSM was implored to optimize the process parameters for minimum surface roughness to attain better surface quality, and a surface roughness model was developed for the process parameters, as expressed in Eq. 8.

  • Optimization of process parameters was investigated for minimum surface roughness (Rɑ), viz; vc (75, 125, 175 m/min), \(f\) (0.025, 0.075, 0.125 mm/rev), and ɑp (0.06, 0.08, 0.1 mm) in which five (5) solutions of composite desirabilities of 1 were obtained with minimum Rɑ, as presented in Table 8. However, the optimal parameters have been proposed to be 100 m/min, 0.025 mm/rev, and 0.09 mm for the cutting speed, feed, and depth of cut, respectively, in the case of machining parameter ranges of 75–175 m/min for vc, 0.025–0.125 mm/rev for f, and 0.06–0.1 mm for ap.

  • When integrated into the machining process, the proposed model could provide technical support on the shop floor for improving the process and good product quality by providing information on the proper process parameters selection and improving the overall manufacturing cost.

  • Further investigation could be done on integrating the machine learning models into the machining process for cloud-based and real-time prediction for response parameters during the machining process in future research.