1 Introduction

It is conceivable to integrate cutting-edge computational methods with CNC machines, however adaptive systems that can handle required textural tolerance are uncommon. The problem is even more difficult in general-purpose CNC machining centers since these machines need several prediction models for various tasks. A better surface finish tolerance is required due to the current industry’s requirement for precision components. The majority of surface roughness estimate is still done using conventional approaches, despite the existence of intelligent systems [1]. The assembly of components and overall performance depend on obtaining high-quality machined surfaces. On component service life, especially in components with relative motion, surface texture tolerance has a crucial role. Due to changeable factors like machine condition and tool quality, it is difficult to meet particular tolerance requirements. Utilising stylus-based Talysurf contact probes, conventional surface texture measuring techniques are causing delays in manufacturing [2]. Benardos PG et al. [3] developed artificial Intelligence techniques to optimize cutting parameters and predict the roughness of a workpiece surface during CNC face milling under different machining conditions. The model has been created using the Artificial Neural Networks method to map the relationship between cutting parameters, vibration signals, and surface roughness. The experimental data collected has been used to train the neural network model. Input data is grouped and evaluated by individual functional nodes using a polynomial function before being passed on to the next layer. The machining process used is CNC milling with Aluminium regular grade. The Artificial Neural Networks model uses cutting parameters, workpiece hardness, cutting time, and vibrations to predict the roughness of the turned surfaces. The ANN model has proven highly accurate in predicting surface roughness for CNC face milling components. ANN design of experiments has been used to perform several machining operations. Steel bars undergo a turning operation where the surface roughness and dimensional deviation are estimated through measured cutting forces and vibrations [4]. The input factors considered for estimating surface roughness are cutting fluid, tool holder vibrations, cutting speed, feed rate, and depth of cut. The study shows that ANNs have the potential to predict surface roughness through machine vibrations in CNC end milling [5]. Researchers can choose the best structure and model from various ANN structures, although designing different structures is time-consuming.

An experimental investigation was conducted on the effect of cutting parameters on cutting forces and surface roughness in finish hard turning of steel plate number 1. A non-linear quadratic model was found to be highly accurate in predicting surface roughness, with feed rate being the major contributing factor. The analysis of variance showed that interactions containing cutting speed and feed rate, feed rate and depth of cut, and cutting speed and depth of cut are crucial in altering surface roughness. To predict surface roughness, acceleration amplitude of vibration in the axial, radial, and tangential directions were used. Multiple regression models using only vibration signals were developed, but neither showed satisfactory prediction ability. The Pearson correlation coefficient was used instead to determine the correlation between surface roughness and cutting parameters and acceleration amplitude of vibrations. The multiple regression model was developed using input parameters, namely feed rate, acceleration amplitude of vibration in the radial direction, depth of cut, and acceleration amplitude of vibration in the tangential direction. The neural network model was developed using the same combination of input parameters. Both models were validated with data not used in the development of models and showed reasonable accuracy in predicting surface roughness. In-process surface roughness prediction can help control the surface finish within the required limits [6].

Özel T et al. [7] discusses the use of Analysis of Variance (ANOVA) to predict surface roughness in hard turning based on cutting parameters. Experimental cutting parameter data is utilized to predict surface roughness using this model. By combining Response Surface Methodology (RSM) with factorial design of experiments, a small number of experiments can provide valuable information used to predict roughness equations. The primary contributor to surface roughness is the feed rate, and it significantly influences the evolution of surface roughness. Self-exciting vibrations and chattering were not observed during the experiments, indicating proper machining operations. The quadratic effect of cutting speed and feed rate, as well as their interaction, provides a secondary contribution to the model. Vibrations have no significant effects. Experimental models have been developed to correlate surface roughness parameters with machining ones and tool vibrations. The highest influence on surface roughness is from the feed rate and cutting speed, while the depth of the cut has no influence. The effect of vibration is minimal. ANOVA provides high-accurate results. Upadhyay V et al. [8] discusses the use of Artificial Neural Network (ANN) to predict the tool wear, surface roughness, and vibration of steelwork pieces. During the boring of stainless steel, the vibration of the boring bar affects the tool wear and surface roughness. In this study, a boring AISI 316 steel with cemented carbide tool inserts was used to examine the tool wear, surface roughness, and vibration of the workpiece. Experimental data was collected and input into ANN techniques. A multilayer perceptron model was used along with a back-propagation algorithm, utilizing input parameters such as nose radius, cutting speed, feed rate, and volume of material removed. The ANN model was then used to predict surface roughness, tool wear, and amplitude of workpiece vibration. The Design of Experiments method with two-level cutting parameters was applied, resulting in a strong correlation between the dependent and independent variables of different parameters. The ANN model was developed and trained using cutting parameters as input data, resulting in less error between predicted and experimental data and satisfactory results. The study concludes that ANN is an acceptable model to determine surface roughness and vibration. The study of surface roughness machining parameters [9] utilizes Artificial Intelligence techniques like ANN and Genetic Algorithm. These models require sensor data as input. Factors such as spindle unbalance, tool wear, and vibrations can impact surface roughness. Feed rate and cutting parameters have a significant impact on surface roughness. Tool vibration is a major issue [10] that affects dimensional accuracy and surface roughness. To produce minimal chatter, ANN is used to forecast cutting conditions. The results of this analysis are within acceptable limits. Khorasani AM et al. [11] utilizes ANOVA to estimate the impact of process parameters such as speed, feed, and depth of cut on surface roughness. The authors implement a multi-objective optimization approach to optimize these parameters and use quadratic models to predict measurements with high accuracy. The results show that feed rate has a significant effect on surface roughness, while the depth of cut has a minimal effect and cutting speed negatively impacts it. This model can be extended to optimize other machining processes as well. The authors investigate the combined effects of process parameters on performance characteristics using ANOVA and model the relationship between process parameters and performance characteristics through response surface methodology (RSM). They use the composite desirability optimization technique with RSM’s quadratic models to find the optimal values of process parameters simultaneously optimizing performance characteristics. This experimental and statistical approach provides a reliable methodology to optimize and improve the hard-turning process and can be efficiently extended to other machining processes. Khorasani A et al. [12] generated the data using DOE to establish relationships among different parameters, and ANOVA results confirm the adequacy of the approach. They find that feed rate influences surface roughness and is lower at higher speeds and vice versa. Surface roughness is high for large depth of cuts, and the authors use an optic system to avoid unwanted processes damaging the surface during face milling on AISI 1040 carbon steel and aluminum alloy 5083 materials at different speeds and depths of cut. The surface roughness values were obtained using a roughness tester. Khorasani AM et al. [13] measured surface roughness during turning at different cutting parameters such as speed, feed rate, and depth of cut using full factorial experimental design. They use artificial neural networks and multiple regression approaches to model the surface roughness of AISI1040 steel and compare these models with statistical models. The results show that both models can predict surface roughness, but the ANN model has higher accuracy. The study introduces a novel approach to surface roughness estimation in milling operations. It employs a Bayesian quantile model (BQR) that takes into account information from several sources, such as monitoring signals and cutting parameters. Model parameters, which provide expected roughness values and confidence intervals, are estimated via Gibbs sampling. According to experimental findings, the prediction error is less than LSR, BPN, and BLR, at 15.05%. BQR stands out for its ability to analyze the effect of cutting parameters on roughness, despite having a negligible advantage over BPN in prediction error and a minor disadvantage to SVM. Operators can improve milling procedures with the help of this useful knowledge. To provide accurate predictions and analyses of surface roughness, the suggested method integrates a QR model, MSH data, and Bayesian theory [14]. In this study, surface roughness is predicted using a novel “chatter stability feature” generated from milling stability analysis and a BP neural network model for high-speed precision milling of aerospace aluminum alloy 7075Al. Compared to a model that only relies on cutting parameters, experimental results demonstrate an improvement in accuracy of 7.8%. The method may be applied to current machines with the aid of an optical non-contact vibrometer and is also resistant to modal parameter mistakes of up to 10%. Extending this process to various cutting techniques is the goal of future study [15].

The article highlights difficulties encountered with milling intricate freeform surface components, such as aeronautical blades. It suggests a monitoring strategy employing blade-root acceleration signals to create a spatial vibration model for foretelling surface roughness. The method’s non-interference with milling and capacity to forecast roughness at different places make it useful for industrial product inspection and risk reduction. In this paper, the surface roughness of the aerospace aluminum alloy 7075Al is investigated in terms of accurate machining quality prediction, and a unique “chatter stability feature” is suggested as a means of improving forecast accuracy [16]. In order to increase material removal rate (MRR) and surface quality during micro-electrical discharge machining (EDM), the study looks at the usage of vibration support. An approach for categorizing discharge pulses is suggested in order to comprehend them better during traditional and ultrasonic vibration-assisted EDM. Additionally, the research introduces histograms for pulse analysis and real-time discharge energy estimate. Increased discharge energy and less depth inaccuracy result from the application of vibration aid. Accuracy, surface quality, and the amount of tapering in micro-holes are all increased by ultrasonic vibrations. The results show that vibration support can increase the process’s stability and efficiency [17]. The article provides details on a remote surface roughness monitoring system. Through the observation of spindle power, workpiece vibration, and cutting parameters, the system indirectly checks roughness. Support vector regression (SVR) creates prediction models based on several variables, with the X-direction’s vibration and spindle power displaying the highest results. Data aquisition, cloud servers, and client-side components are used in the configuration of the remote monitoring system. Remote alarms are set off by anomalies, allowing users to track problems back in time and find the origin of processing anomalies [18].

The article examines how ICT might be used in manufacturing to facilitate effective decision-making, with a focus on cost containment and quality improvement. Monitoring drilling activities and determining surface roughness are its two main areas of emphasis. Surface roughness predictions may not match actual results since drilling is different from other machining techniques. Recognizing its significance in product quality and industrial effectiveness, the study investigates non-contact methods for assessing surface roughness. The paper offers a thorough analysis of different non-contact methods for estimating surface roughness in machining [19]. In order to enhance the quality of end-milling by classifying roughness, the study applies a transformer-based deep learning technique. The model includes methods for extracting audio features that increase accuracy by using cutting force and machining sound data. Studies show that models trained on 10–40 s of machining data produce validation and test accuracies of 90%, proving the advantages of steady-state data. A comparison of DL models reveals how well the suggested technique predicts the quality of the machining surface and has the potential to save a lot of time and money during post-operations. In order to address current industrial issues, the study offers a viable use of deep learning [20].

In this work, the authors simulate a dynamic monitoring system for surface roughness prediction in milling operations using three components of workpiece vibrations to enhance the performance of the monitoring system. The authors have successfully pioneered an innovative approach in the field of surface roughness prediction by harnessing the power of intelligent systems. Through their meticulous research and development, they have engineered a method that capitalizes on the analysis of overall vibrations across all three dimensions, enabling the accurate prediction of surface roughness. This breakthrough not only expedites the measurement process but also eliminates the need for direct human intervention, ushering in a new era of efficiency and productivity. They aim to develop an operator-friendly performance enhancement model that generates the desired output of roughness for given inline elements. The remaining part of work are as follows: 2. Experimentation, 3. AI Model, 4. Model Evaluation and 5. Conclusion.

2 Experimentation

The use of CNC machines is gaining popularity in the manufacturing industry due to their ability to minimize the risk of human error and produce parts efficiently. With advanced programming features, these machines are capable of handling complex tasks, which is why they are being adopted in various industries. The CNC JV-55 machine is used for face milling operations with the following specifications: spindle speed of 6000 rpm, table size of 900 by 340 mm, spindle motor power of 7.5 kW, and spindle bore taper of BT40. To determine the effects of cutting speed, feed rate and depth of cut on aluminum alloy A96061-T6 flats of 10 by 5 cm, various experiments are conducted under different machining conditions. The number of experiments required is determined using DESIGN EXPERT v10 software, which assists with experimental design.

Table 1 displays the range of cutting parameters and its corresponding surface roughness. To measure vibrations, the tri-axial vibration measurement device was utilized. This device is equipped with a PCB single axis accelerometer, model number 352C03, with a sensitivity of ± 20% at 9.95 mV/g, a frequency range of 0.5–10,000 Hz at ± 5%, a measurement range of ± 500 g Pk, and a resonant frequency of ≥ 50 kHz. It weighs 5.8 g and can measure vibrations in all three directions (x, y, and z). Table 1 outlines the cutting parameters (Speed (S), feed rate (F) and depth of cut (DOC)), overall vibration values and corresponding measured surface roughness (SR). To measure vibrations, the sensor is placed on the machine spindle, as shown in Fig. 1.

Table 1 Cutting parameters, vibrations and surface roughness
Fig. 1
figure 1

Accelerometer placed on spindle for vibration measurement

3 AI model

3.1 KNN regression model

The k-NN model, short for k nearest neighbor, is employed for identifying novel records by amalgamating the most recent historical data with K characteristics alongside earlier records. This algorithm, applicable for both classification and regression in machine learning, operates on a non-parametric basis. In the k-NN algorithm, the initial step involves determining the distance between a new data point and the training sample, followed by identifying the nearest neighbor to that point. Subsequently, the algorithm determines the category to which the new data point belongs by considering the categories of its neighboring data points. If all the surrounding data points share the same category, the new data point is also assigned to that category. The value for the Euclidian distance, also known as the distance of new data from the training sample are given below.

$$ \varepsilon \left( {x_{i, } y_{i} } \right) = \sqrt {\mathop \sum \limits_{i = 1}^{k} \omega^{2} \left( {x_{i} - y_{i} } \right)^{2} } $$

In this context, ε denotes the total number of predictions within the optimization set. The function \(\varepsilon \left({x}_{i, }{y}_{i}\right)\) is recognized as a distance function, used to measure the dissimilarity between two distinct scenarios. Here, x and y denote matrix scenarios containing k features, and w represents the weight assigned to each dependent variable in the K-NNs. The kernel function is symbolized by ‘k’. The order of the k-NNs is referred to based on their proximity to the current performance condition, with the closest k-NN being labeled as I = 1, 2,… k.

3.2 Polynomial regression model

Polynomial regression falls under regression analysis and involves elevating each original predictor to a power while introducing additional predictors. The objective is to model the influence of predictor x on response variable y as an nth degree polynomial in x. Polynomial regression is a useful tool for assessing this relationship. For instance, quadratic polynomial regression employs predictors x and x2, while cubic polynomial regression includes x, x2, and x3 as predictors. Consequently, polynomial regression is considered a subset of multiple linear regression, providing a straightforward approach to exploring the relationship between independent and dependent variables. Building upon the principles of multiple linear regression, the resulting Polynomial Regression (PR) model is formulated.

$$ Y = \alpha_{o} + \alpha_{1} x_{1} + \alpha_{2} x_{2} + \ldots + \alpha_{s} x_{s} + \delta $$

where \(\alpha_{o} , \alpha_{1} ,\alpha_{2} , \ldots \ldots \alpha_{n}\) are knows as PR regression coefficients, \(\alpha_{o}\) is the bias term, \(x_{1}\), \(x_{2}\), …, \(x_{s}\) are denoted as independent variables, Y is the dependent variable and \(\delta\) is represented as random error. Equation. _ can be rewritten as follows if enough data points are collected:

$$ Y = X\alpha + \delta $$

where Y = \({[{y}_{1},{y}_{2},\dots \dots {y}_{n}]}^{T}\), \(\alpha ={[{\alpha }_{o}, {\alpha }_{1},{\alpha }_{2},\dots \dots {\alpha }_{n}]}^{T}\) and \(\delta ={[{\delta }_{1},{\delta }_{2},\dots , {\delta }_{n}]}^{T}\) and.

X = \(\left[\begin{array}{ccc}\begin{array}{c}1\\ 1\\ \vdots \end{array}& \begin{array}{c}{x}^{(\text{1,1})}\\ {x}^{(\text{1,2})}\\ \vdots \end{array}& \begin{array}{c}\begin{array}{ccc}\cdots & \cdots & {x}^{(s,1)}\end{array}\\ \begin{array}{ccc}\cdots & \cdots & {x}^{(s,2)}\end{array}\\ \begin{array}{ccc}\cdots & \cdots & \vdots \end{array}\end{array}\\ \vdots & \vdots & \begin{array}{ccc}\cdots & \cdots & \vdots \end{array}\\ 1& {x}^{(1,n)}& \begin{array}{ccc}\cdots & \cdots & {x}^{(s,n)}\end{array}\end{array}\right]\)

The sum of squared errors can be determined by following Equation.

$$ {\text{Cos}} t\;\left( {\alpha_{o} ,\alpha_{1} ,\alpha_{2} , \ldots , \alpha_{s} } \right) = \mathop \sum \limits_{i = 1}^{j} \left( {y_{i} - \alpha_{o} - \alpha_{1} x_{1,i} - \alpha_{2} x_{2,i} - \ldots x_{s,i} } \right)^{2} $$

The least-squares method is a method that can be used to calculate an estimation of the regression coefficient vector \(\hat{\alpha }\).

$$ \hat{\alpha } = \left( {X^{T} X} \right)^{ - 1} X^{T} Y $$

Following this, the PR model that was constructed based on multiple linear regression is defined as:

$$ y = \alpha_{o} + \mathop \sum \limits_{m = 1}^{s} \left( {\alpha_{m} x_{m} } \right) + \mathop \sum \limits_{m = 1}^{s} \mathop \sum \limits_{n = 1}^{s - m + 1} \left( {\alpha_{mn} x_{m} x_{n} } \right) + \mathop \sum \limits_{m = 1}^{s} \mathop \sum \limits_{n = 1}^{s - m + 1} \mathop \sum \limits_{o = 1}^{s - n + 1} \left( {\alpha_{mno} x_{m} x_{n} x_{o} } \right) + \ldots + \delta $$

where \(\alpha_{mn}\) and \(\alpha_{mno}\) are known as regression coefficients which can be computed by multiplying the values of the individual variables.

$$ {\text{Y}} = X^{P} \alpha^{P} + \delta^{P} $$

Where \(X^{P}\) is the independent variable matrix and \(\alpha^{P}\) is the corresponding regression coefficient vector and \(\delta^{P}\) is corresponding error vector. Hence, the least squares estimation approach can be used to estimate the regression coefficient vector \(\widehat{{\alpha }^{P}}\):

$$\widehat{{\alpha }^{P}}= {\left({({X}^{P})}^{T}{X}^{P}\right)}^{-1}{\left({X}^{P}\right)}^{T}Y$$

3.3 Decision tree

The growing popularity of Decision Trees (DT) can be attributed to its simplicity, ease of comprehension, cost-effectiveness, and its ability to be visually represented in various forms. A Decision Tree is a set of conditions organized hierarchically, executed in a sequential order from the tree’s origin to its final node or leaf. Unlike artificial neural networks, the key advantage of employing a hierarchical tree structure is its visibility, making it more accessible for understanding. Constructing the Decision Tree involves applying an evaluation measure to each evidential attribute, enhancing the variability between internal nodes. The construction process includes multiple regressions and recursive partitioning of the dataset. Data splitting occurs iteratively, starting from the root node and continuing until a predefined termination condition is met. The application scope of a simple regression model is limited to specified terminal nodes or leaves. Pruning is performed to enhance the tree’s generalization capacity by reducing structural complexity, considering total occurrences in a node during the process.

To begin, the dependent feature, which is also referred to as the parent node (root), is subdivided into binary components. It is generally agreed upon that the child nodes are “purer” than the parent node. During this phase, the DTs search through all of the candidate splits in order to locate the optimal split, denoted by the letter c*, which optimizes the ‘purity’ of the resultant tree while simultaneously minimizing the number of candidate splits. The following equation provides the formula for the process of splitting.

$$ \Delta j\left( {c,x} \right) = j\left( x \right) - Q_{L} j\left( {x_{L} } \right) - Q_{R} j\left( {x_{R} } \right) $$

This node x is divided by c into the left child node \({x}_{L}\) with the proportion \({Q}_{L}\) and the right child node \({x}_{R}\) with the proportion \({Q}_{R}\). c is the candidate split at note z. The amount of impurity before splitting is denoted by the symbol \(j\left(x\right)\). After splitting, the measure of impurity is denoted by the symbols \(j\left({x}_{L}\right)\) and \(j\left({x}_{R}\right)\). \(\Delta j\left(c,x\right)\) results in a reduction in the amount of impurity from split s. The Gini index, often known as \({J}_{G}\), is the most popular measure used in DTs, and it is calculated with the use of following equation. In order to partition the decision tree, the attribute that has the Gini Impurity Index that is the lowest possible value must be selected as the dividing criterion.

$$ J_{G} \left( {x_{{z\left( {z_{j} } \right)}} } \right) = 1 - \mathop \sum \limits_{i = 1}^{n} f\left( {x_{{z\left( {z_{j} } \right)}} , i} \right)^{2} \cdots $$

f \({({x}_{z\left({z}_{j}\right)}, i)}^{2}\) is the fraction of samples with the value \({z}_{j}\) belonging to leave i as node x.

3.4 Random forest

The random forest regression method predicts or classifies data points by amalgamating outcomes from multiple decision tree algorithms. This ensemble approach, grounded in trees, overcomes limitations of traditional classification and regression tree methods. To mitigate bias and variability, Random Forest (RF) employs numerous weak decision tree learners constructed simultaneously. Training involves collecting N bootstrapped sample sets from the source dataset, and unpruned regression or classification trees are built from each set. Instead of utilizing all variables, a predetermined number, K, of randomly chosen predictors is employed in this phase. This process is iterated until T trees are formed. Aggregating predictions from all T trees projects fresh data. Through bagging, RF enhances tree diversity while reducing overall model variance by evolving trees from distinct training data subsets.

$$ f_{RF}^{T} \left( x \right) = \frac{1}{T} \mathop \sum \limits_{n = 1}^{T} DT_{i} \left( x \right) $$

where x is the vectored input variable, T represents the total number of trees, and \({DT}_{i}(x)\) represents an individual regression tree.

The function is created by utilizing a subset of input variables and bootstrapped sample data in its construction. Additionally, samples not utilized in training the DTth tree during the bagging phase form a distinct subset known as the out-of-bag sample collection. This subset allows the DTth tree to assess system performance using these excluded components. Random Forest (RF) inherently performs out-of-bag error, providing an unbiased estimate of generalization error without requiring an external test data subset, unlike other methods. A key advantage of RF lies in its ability to assess the relative importance of input parameters, crucial for dimensionality reduction and enhancing model performance on large datasets. RF alters one input variable while keeping others constant, evaluating the mean drop in model prediction accuracy. The resulting mean decrease in prediction accuracy assigns a relative relevance value to each input characteristic. Another noteworthy feature of RF classifiers is that their trees grow without being pruned, making them computationally efficient.

3.5 ANFIS model

The main goal of ANFIS is to integrate the strengths of both neural networks and fuzzy systems. A key benefit of a fuzzy system lies in its ability to define network topology based on existing knowledge, potentially eliminating the necessity for search space optimization. In contrast, backpropagation, a technique successful in neural networks, is employed to automate the training process for fuzzy control. The fundamental mechanism of a fuzzy inference system involves establishing logical connections between input and output spaces, primarily composed of membership functions, fuzzy sets, fuzzy implication operators, and linguistic if–then rules.

A membership function is a graphical function that transforms individual input values into corresponding degrees of membership within the 0 to 1 range. Various types of membership functions are utilized in FIS systems, and this study involved a comparison of the effectiveness of triangular, generalized bell, trapezoidal, and Gaussian functions. The connection between input and output variables is articulated through if–then rule statements. Generally, a first order Sugeno fuzzy model was employed, as depicted below:

  • Rule-I: If (m is X1) and (n is Y1) then f1 = R1.m + S1.n + T1

  • Rule-II: If (m is X2) and (n is Y2) then f2 = R2.m + S2.n + T2

Where m1, m2, n1, n2, o1, o2 are known as linear parameters and X1, X2, Y1, Y2 are denoted as non-linear parameters. The schematic representation of ANFIS architecture is shown in Fig. 2. Basically, ANFIS comprises of five layers i.e., fuzzy layer, product layer, normalized layer, de-fuzzy layer and output layer.

Fig. 2
figure 2

Basic structure of the ANFIS model

In Fuzzy layer, the input variables are converted in to linguistic labels i.e., X1, X2, Y1, Y2 which are actuated by membership functions. The output of each node in the fuzzy layer is determined by following equations:

$$ O_{1,i} = \mu_{{P_{i} }} ({\text{m}})\quad {\text{I}} = 1,\;2,\; \ldots ,\;{\text{n}} $$
$$ O_{1,j} = \mu_{{Q_{i} }} ({\text{n}})\quad {\text{j}} = 1,\;2,\; \ldots ,\;{\text{n}} $$

where \({O}_{1,i} and {O}_{1,j}\) are known as the output values of fuzzy layer and \({\mu }_{{P}_{i}}\), \({\mu }_{{Q}_{i}}\) are represents the membership functions used in the layer1. The signals received from the nodes of the fuzzy layer is multiplied in product layer i.e., second layer. Each node in the product layer is labeled as π function. The output values of the product layer are calculated by following equations:

$$ O_{2,i} = W_{i} = \prod \left( {O_{1,i} \times O_{1,j} } \right)\quad {\text{I}} = 1,\;2,\; \ldots ,\;{\text{n}} $$

The output of the product layer is also implying that firing strength of the rule (\({W}_{i}\)). These firing strength values are normalized in normalization layer. Each node of the normalization layer is labeled by N. The following Equation is used to determine the output value of the normalization layer.

$$ O_{3,i} = \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\rightharpoonup}$}}{{W_{l} }} = \frac{{W_{i} }}{{W_{1 + } W_{2} }}\quad {\text{I}} = 1,\;2,\; \ldots ,\;{\text{n}} $$

where \({O}_{3,i}\) is denoted as output of the normalization layer and \(\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\rightharpoonup}$}}{{W_{l} }}\) is known as normalized firing strength value. Afterwards, in Defuzzy layer, these normalized firing strength values are multiplied by first order polynomial equation. The nodes present in this layer are adaptive nature which are labeled by D. The following expression is used to compute the output of the Defuzzy layer.

$$ O_{4,i} = \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\rightharpoonup}$}}{{W_{l} }} f_{i = } = \overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\rightharpoonup}$}}{{W_{i} }} \times \left( {R_{i} m + S_{i} n + T_{i} } \right)\quad {\text{I}} = 1,\;2,\; \ldots ,\;{\text{n}} $$

where \({O}_{4,i}\) is denoted as output of the Defuzzy layer and Ri Si and Ti are known as linear parameters which is also called as consequent parameters. Finally, the output signals of Defuzzy layer are passed in to output layer where all these signals are summed and gives the final output value. The node present in this layer is fixed nature which are labeled by \(\in \). The final output value is expressed in given equation:

$$ O_{5,i} = \mathop \sum \limits_{i = 1}^{n} \left( {\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\rightharpoonup}$}}{{W_{l} }} \times \left( {R_{i} m + S_{i} n + T_{i} } \right)} \right)\quad {\text{I}} = 1,\;2,\; \ldots ,\;{\text{n}} $$

where \({O}_{5,i}\) denotes the output of the output layer.

4 Model evaluation

In the present research mainly focus on predicting the surface roughness of the machined samples. This prediction relies on three key factors: X, Y and Z direction vibration. To accomplish this, Python 3.10.5 software was employed to develop machine learning models based on experimental data, enabling to accurately predict the surface roughness of the machined sample. A pair plot is generated to visualize the distribution of vibrational data acquired during the machining process. This plot helps identify the attributes that most effectively elucidate the relationship between two variables by considering both dependent and independent variables. The relation between the surface roughness and other input parameters such as directional vibration is shown in Fig. 3. The training and testing datasets are presented in Table 2.

Fig. 3
figure 3

Pair plot for surface roughness distribution

Table 2 The Training and testing data used for model generation

Furthermore, Fig. 4 presents a Heatmap diagram illustrating the relationship between surface roughness, which has been analyzed using the Pearson correlation coefficient (PCC) to evaluate the connections between dependent and independent variables. The PCC, ranging from −1 to 1, quantifies the linear correlation between these variables. When the PCC coefficient approaches 1, it signifies a strong direct linear relationship, while values near −1 indicate a significant inverse linear connection. A PCC coefficient near 0 suggests a lack of a substantial linear association between the independent variables. Upon close examination of the Heatmap diagram for surface roughness, it becomes evident that the PCC values for all independent variables are relatively low. A deeper analysis of the PCC results reveals an inverse linear relationship between vibration in x-axis. Consequently, these findings suggest that y and z-axial vibration also exhibit an linear relationship.

Fig. 4
figure 4

Pearson’s correlation coefficient for surface roughness

Figure 5a illustrates the relationship between spindle vibration along the X-axis and Y-axis, aiming to assess their impact on surface roughness. Upon examination, it is evident that an increase in both X-Axis and Y-Axis vibrations results in irregular surface roughness, making it challenging to draw any definitive conclusions. Moving on to Fig. 5c, which explores the connection between X-axis and Z-axis vibrations, an elevation in X-axis vibration doesn’t significantly affect surface roughness. However, Z-axis spindle vibration shows a notable correlation, indicating that an increase in Z-axis vibration leads to a corresponding rise in surface roughness. In Fig. 5b, depicting the relationship between Y-axis and Z-axis spindle vibration, an increase in both values corresponds to heightened surface roughness. The presence of a conical shape in red suggests an upward trend in surface roughness. Consequently, the influence of Y-axis and Z-axis vibrations appears to have a substantial impact on surface roughness. During experiments with higher machining feed rates (200 mm/min), specifically at experiments numbered 3, 4, 13, 14, 17, 21, 33, 35, 39, 46, 52, 54, 56, and 58, as shown in Table 1, the Z-axis spindle vibrations exhibit elevated levels. Figure 5d illustrate the correlation between experiment numbers and their respective surface roughness values.

Fig. 5
figure 5

Interaction plots of surface roughness a x–y direction b y–z direction c x–z direction d variation of surface roughness for selected experiments

Figure 6a illustrates the relationship between spindle speed and feed rate, aiming to assess their impact on surface roughness. Upon examination, it is evident that lower speed and higher feed rate leading to increase the surface roughness value. However, Fig. 6b, c illustrates the relationship between depth of cut versus feed rate and speed versus depth of cut, aiming to assess their impact on surface roughness respectively. From the plots, it can be observed that the lower speed, higher feed rate and higher depth of cut leads to increase the surface roughness value.

Fig. 6
figure 6

Interaction plots of surface roughness a speed versus feed rate b feed rate versus depth of cut c speed versus depth of cut

The comparison between experimental and predicted surface roughness of various models is shown in Fig. 7. From the visual inspection of this figure, it can be observed that, among all machine learning models, the predicted outcomes of the ANFIS model were very close to the experimental outcomes. Figures 8 and 9 shows the regression plots and comparison plots of the optimum ANFIS model. From this plots, it is observed that the optimal ANFIS model well predicts the experimental results.

Fig. 7
figure 7

Comparison between surface roughness of experimental and various predicted models

Fig. 8
figure 8

Regression plot between actual and ANFIS model

Fig. 9
figure 9

Comparison between surface roughness of experimental and ANFIS models

5 Conclusion

A new intelligent system has been developed to predict surface roughness based on overall vibrations in all directions. This breakthrough technology integrates Python 3.10.5 software and machine learning models, promising transformative impacts on industrial practices.

  • Utilized Python 3.10.5 software and machine learning models to predict surface roughness.

  • Machine learning models, such as polynomial regression, decision trees, random forests, and ANFIS, were developed to predict surface roughness.

  • Upon evaluation against other machine learning models, the ANFIS model demonstrated an exceptional prediction accuracy of 98%.

  • This finding establishes ANFIS as the superior model for surface roughness estimation, especially when leveraging data from machine tool vibrations across all three directions.

  • Employed pair plot and Heatmap diagrams for visual representation and correlation analysis.

  • Highlighted the significant correlation between Z-axis vibration and surface roughness.

  • Explored relationships between spindle speed, feed rate, and depth of cut on surface roughness.

  • Demonstrated the effectiveness of the ANFIS model in accurately predicting surface roughness.

The developed intelligent system not only optimizes resource allocation and efficiency but also streamlines quality control and manufacturing processes. By eliminating the need for conventional measuring instruments, it paves the way for a more automated and productive future in various sectors. The ANFIS model’s reliability underscores its significant contribution to machining optimization and quality control, marking a notable advancement in surface roughness prediction technology.