1 Introduction

Determining an optimum condition of machining parameters is a crucial issue in manufacturing. Conventionally, a series of trials are conducted to formulate the optimum machining parameters, result in lowering material and process efficiency. Constructing a forecast model solves the limitation of conventional methods. However, the complexity of the machining process requires a compressive understanding of the chosen modelling technique.

The prediction process is complicated because of the characteristics of the non-deterministic, multidimensional, non-linear nature of machining, and many other hardships in modelling the manufacturing process [1]. There are parameters that are highly challenging to predict owing to their stochastic nature, i.e. material non-homogeneity, chip formation, workpiece, tool and machine vibrations, tool wear and degradation [2]. Thus, the capability of the prediction tool determines the accuracy of the model.

To solve the machining parameters prediction problems, there are few techniques that are commonly practised, such as recurrent neural network (RNN) [3], support vector machine (SVM) [4], artificial neural network (ANN) [5], convolutional neural network (CNN) [6], fuzzy logic (FL) [7], and particle swarm optimisation (PSO) [8]. Among these methods, ANN is the most desired technology that has been employed in many types of engineering applications [9]. ANN is a popular solution method in a broad variety of knowledge fields, includes business [10, 11], engineering [12], and medicine [13].

ANN model is developed from the biological concept. It is comparable to human brain functions and mechanisms. The elements of this model are neurons, weighted interconnections, transfer functions, and activation rules. ANN is able to learn from a complex non-linear relationship that makes it a robust mathematical tool for constructing a predictive model from a real-life application [14].

The related works depicting the capability of ANN in forecasting and optimising various machining process parameters which impact the quality of the machined components are listed in Table 1. The work by [15] depicts the advantages of employing ANN modelling than the traditional method in predicting machining time, surface roughness and energy consumption. The study of [16] showed the success of applying ANN in machining the common engineering material. They investigated the application of ANN to predict surface roughness on the hard turning of AISI 5210 steel. On the other hand, utilizing ANN in predicting the machining process of non-engineering materials, such as natural materials, were described in [17,18,19].

Table 1 Related studies of ANN for predicting machining performance

The examination by [17] selected wood as the workpiece material and looking at the pressure, machining speed, wood species, and abrasive types as the parameters for the ANN network construction. The examination confirms that surface roughness could precisely be anticipated using ANN in an abrasive machining process. A complementary study by [20] describes the ANN prediction model for optimizing the process parameters to minimize energy consumption in wood machining. Recently in 2018, an ANN construction by [18] was carried out on a bone milling process to predict the cutting force and the milling temperature by considering the spindle speed and feed rate.

Performing machining procedures on natural materials is developing into a challenge for the next era of machining process. Some works in recognizing the machining process of natural material were conducted on bamboo [19], and timber [21]. In the present application, machining of the bovine horns was selected. It is a natural material that has unique mechanical properties with promising sustainability, recyclability, and biodegradability [22]. Unique mechanical properties with strength and durability help bovine horns to stand in extreme loading conditions [23]. It is frequently found for creating buttons, horn plates, toggles, and photo frames. The potential of bovine horns as the raw material for other applications is still wide open. For instance, bovine horns may become an alternative material for bone graft procedure of veterinary supporting bone remodelling process of the fractured bones.

This study aims to describe the process of constructing a prediction model based on the ANN approach in suggesting the cutting parameters of the bovine horns milling process. The subsequent sections describe the step-by-step process in constructing an ANN model from the methodology and followed by a case study of machining bovine horn by a milling process.

2 Methodology of constructing ANN

Artificial neural networks are referred to as an intelligent technique with nonlinear and densely interconnected processing elements called neurons [25]. It is one of the most popular methods for solving different fields of study with a remarkable capability to handle complex and nonlinear relationships. Several types of architectures are suggested for ANN construction. Among them, the multilayer perceptron (MLP) is the most widely used network architecture to make the predictions [20]. An MLP is designed with a combination of an input layer, an output layer and one or more hidden layers [26]. The mathematical representation of the prediction output is shown in Eq. 1.

$$Y = g\left( {\theta + \sum\limits_{j = 1}^{m} {V_{j} } \left[ {\sum\limits_{i = 1}^{n} {f\left( {W_{ij} X_{i} + \beta_{j} } \right)} } \right]} \right)$$
(1)

where Y is the output of the prediction model; Xi is the input variable; βj is the bias value for jth hidden neurons; wij is the representation of weight between ith input and jth hidden neurons; while bias for output neuron represented by θ; g and f refer to the activation functions. Graphical representation of Eq. 1 is shown in Fig. 1.

Fig. 1
figure 1

A typical architecture of ANN model [20]

The first layer of an ANN model is used for collecting information called datasets. Then, the layer sends the data to the hidden layer, and after the hidden layer finishes the processing of this data, it transmits to the output layer referred to as output data. Weight factors are used for transmitting data from one neuron to other neurons. To obtain the optimum hidden neurons, the trial-and-error procedure is mostly used [27]. Several types of training algorithms are available, with the most common and preferable algorithm is referred to as a feed-forward and back-propagation algorithm [28]. Once the targeted error level achieves, the training process is stopped, and the optimum prediction model is ready to perform for further testing.

3 Procedures

3.1 Material and experimental setup

The first step to construct the ANN prediction model is to have a dataset. The datasets provide both the input and output information. The input data shown in Table 2, was collected by empirically collecting the machining data of bovine horns with a full factorial design where experiments are run at all possible interactions. Three fundamental parameters of milling with three levels were considered: spindle speed (S), feed rate (f) and depth of cut (d). Thus, the experiments were run based on 27 combinations. The bovine horns acquired from the regional sources (West Java Province in Indonesia) were utilized as the workpiece material. The as-received horns were manually prepared by cutting the base section to a size of 35 mm × 45 mm and 20 mm before performing a face milling process (Fig. 2).

Fig. 2
figure 2

Workpiece sample preparation

The details experimental setup including workpiece and tool path is depicted in Fig. 3. A HauwGen Zx7550z manual vertical milling drilling machine was used as the machining tool. An uncoated carbide end mill (Ø12 mm, 4 flutes) was selected as the cutting tool for the experiments. On each experiment, the cutting condition was maintained by performing flank wear inspection. A new cutting tool would be installed if the flank wear size exceeded 0.1 mm.

Fig. 3
figure 3

The experimental setup for bovine horns machining. The cutting tool design and the relative motion between the workpiece and cutting tool (inserts)

The output data was gathered from the power consumption and the surface roughness of each sample. Typically, there are two techniques used to measure energy consumption: direct measurement technique by wattmeter or digital data logger [20, 29,30,31] and indirect measurement technique by measuring to cutting force with dynamometer [32, 33]. The average energy consumption (kW) of each sample combination was measured through direct measurement technique by using a wattmeter (Peakmeter MS2205 3-Phase digital clamp meter) placed in the main electrical control panel of the machine. The average surface roughness (Ra) was determined by measuring the machined surface of each sample with a surface roughness tester (Mitutoyo SJ-410). Figure 4 presents the typical surface of the bovine horn after face milling machining process.

Fig. 4
figure 4

The surface of machined bovine horn workpiece in different machining conditions, a f155, s600, d2; b f155, s1400, d1; c f240, s860, d3; d f490, s1400, d1 (f = feed rate, S = spindle speed, d = depth of cut)

3.2 Artificial neural network constructions

In this section, the whole process of developing an artificial neural network is described. The process flow of constructing the ANN model is displayed in Fig. 5. The construction process divided into 4 stages as below:

Fig. 5
figure 5

Flow chart of constructing an ANN prediction model

  1. 1.

    Stage-1 Defining input and output datasets with dataset extraction based on training and testing.

  2. 2.

    Stage-2 Training algorithm selection

  3. 3.

    Stage-3 Training and network optimisation and adjusting parameters.

  4. 4.

    Final stage Obtaining the best network

The performed process of each stage is described below:

3.2.1 Stage-1: Defining input and output datasets with dataset extraction based on training and testing

As the first stage of ANN model creation, input and output layers were defined accordingly. In this study, there were three inputs: spindle speed, depth of cut and feed rate. The outputs were defined as power consumption and surface roughness. Thus, there were three units in the input layers and two unit neurons as the output layers.

In the present study, the trial-and-error procedure has been adapted to obtain the optimal model. This procedure is simple and widely used [34]. Based on user’s knowledge, a promising architecture is emerged after comparing the performance of several candidates. The numbers of hidden layers and number of nodes in hidden layers was selected by the trial-and-error method until achieving the minimum mean square error (MSE). As the results, the current ANN network architecture comprised 2 hidden layers, with 25 units of neuron in layer 1 and 2 units of neuron in layer 2 (Fig. 6). The collected data was then divided into two subsets namely training and testing. According to [27], the total combination of training and testing data ratio can be 90%:10%, 85%:15% or 80%:20%. In this study, the proportion of the data was 80% for training and the balance of 20% for testing. This combination matched with the available data generated from the 27 experimental runs. The data used for testing was not used in the training phase. The feed-forward backpropagation algorithm was applied to the training set.

Fig. 6
figure 6

The artificial neural network architecture of the present study

3.2.2 Stage-2: Training algorithm selection

The feed-forward backpropagation (FFBP) neural network algorithm was implemented as it has been widely used to train in various neural network applications. An FFBP neural network based on Levenberg–Marquardt was selected as the training method. The algorithm is a combination of two other algorithms, namely gradient descent method and the Gauss–Newton method [35]. With fast and stable convergence characteristics, the FFBP algorithm provides a numerical solution for minimizing non-linear function problems [36]. Equation 2, provides the calculation of the Levenberg–Marquardt algorithm.

$$w_{k + 1} = w_{1} - \left( {j_{k}^{T} j_{k} + \mu I} \right)^{ - 1} j_{k} e_{k}$$
(2)

where \(k\) is the index for the number of iteration; \(\mu\) is the combination coefficient (always positive); j is the Jacobian matrix; \(I\) refers to the identity matrix.

3.2.3 Stage-3: Training and network optimisation and adjusting parameters

According to the training rules of FFBP, training data is input into the neural network until output using FFN and then the error of the output neurons is propagated backward. Due to the propagation of error, weights and biases are adjusted to minimize the remaining error between the actual and targeted outputs for further model improvement, weights and bias can be calculated [11] by Eq. 3. Weights and bias were selected randomly and ranged between − 1 to 1 or − 0.5 to 0.5, and the judging criteria were based on the minimum cost function.

$$z_{k} = \sum\limits_{i = 1}^{n} {w_{jk} x_{j} + b_{k} }$$
(3)

where \(w_{jk}\) represents the weight factors that connects input nodes j to hidden nodes k; \(b_{k}\) represents the bias for each of the hidden nodes k.

$$g\left( x \right) = \frac{1}{{\left( {1 + \exp \left\{ { - \beta x} \right\}} \right)}}$$
(4)

Equation 4, computes the activation functions [37]. The sigmoid function was employed for each activation of hidden nodes (\(\beta\) is the slope parameter).

Combining the weight and bias for each input nodes (Eq. 3), pure linear activation function computed the output \(o_{i}\). Then the network calculated half of the mean square error as the last steps of forward-propagation. Therefore, the prediction was represented with the Eq. 5.

$$E\left( {W,b} \right) = \frac{1}{2m}\sum\limits_{i = 1}^{m} {\left( {o_{i} - y_{i} } \right)^{2} }$$
(5)

where \(E\left( {W,b} \right)\) refers to the cost function of this ANN model. Feed-forward and back-propagation were continuously updated with weights and biases to find the local optima. Figure 7 shows the training process of the ANN model. It describes the process of finding local optima for the cost function. The slope is closer to zero when the model increases the iteration. The dataset that has been processed through the network by feed-forward and back-propagation algorithm is called epoch. Epoch is an important parameters in selecting the best performing network. The minimum value of gradient was found in epoch 5, where gradient represented the slope of local optima. Once whole dataset of the training passes through the neural network after feed forward and backpropagation is simply called an epoch. Epoch is one of the important hyper-parameters for performance of the network.

Fig. 7
figure 7

ANN model training in finding the local optima of the cost function

3.2.4 Final stage: obtaining the best network

To evaluate the performance of the model and to reach the error goal, the model parameters were adjusted. In this study, the mean square error (MSE) was employed as the performance function. The value of mean square error is represented in Eq. 6.

$$MSE = \frac{1}{n}\sum\limits_{i = 1}^{N} {\left( {t_{i} - td_{i} } \right)^{2} }$$
(6)

where \(t_{i}\) refers to the measured value; \(td_{i}\) is the predicted value by the prediction model; \(N\) defines the total number of training. There are several factors affecting the accuracy of artificial neural networks model. Among them are: network architecture, training process, number of hidden layer, number of hidden neuron, and learning rate. Eventually, a model with the architecture of 3–25–2–2 layer produced the best result with the minimum training error of 0.0000557 and the testing accuracy of 95%. The best performance was achieved at epoch 5, while the value of MSE was 0.050176 for the testing datasets (Fig. 8). Typically, error value reduces with increasing of epochs. In the present case, after epoch-4, the error value of training and testing became stable. Hence, the best training performance recorded at the epoch-5.

Fig. 8
figure 8

Performance of the selected ANN model as epochs varies

The predicted value upon selecting the best performing network and the respective experimental data set is compiled in Table 2. The error of each predicted data to the experimental data is also presented. This data would be further validated to provide a solid decision on the selected network.

To validate the proposed ANN model, a regression analysis was carried out. Figure 9 describes the regression analysis between the experimental data and the predicted data. The calculated regression value (R) for the training dataset was 0.999 (Fig. 9a), while the regression value of the testing dataset was 0.975 (Fig. 9b). Both R values are closer to 1 (one), indicating a sufficient accuracy of the selected model. Therefore, it is worth to say that the proposed model has a good agreement between the predicted and the experimental data of energy consumption and surface roughness of the milled bovine horn.

Table 2 The ANN prediction results with the respective experimental data and settings
Fig. 9
figure 9

Regression analysis result of the network estimations, a training, b testing

4 Discussions

The predictive model has been constructed with a model error of around 5%, indicating enough capability in predicting machining performance. Notably, the present ANN networks can predict energy consumption and surface roughness with high accuracy, as shown by the good correlation between the experimental and the predicted data. Similar results were also described by [38, 39], where the artificial neural network was employed to the natural material processing and manufacturing applications.

Despite achieving a good prediction, employing natural materials to machining comes with an additional challenge in controlling the mechanical properties of the raw horns. For instance, the hardness of the bovine horns is related to the biological structure [40] and the water contents [41]. Lower water contents and higher density contribute to higher hardness, leading to higher cutting force and power consumption. In the present study, the properties of the raw materials were controlled by forming the workpiece to a standard dimension and extracting the workpiece material only from the base end of the raw horns. However, the variation of current prediction may be imparted from the anisotropy properties of the raw material.

The comparison of experimental data and the predicted data by ANN model are presented in Figs. 10 and 11. The predicted performances (i.e., surface roughness and power consumption) of each machining parameters combination were calculated using the ANN model. These combinations were used earlier to produce the experimental dataset.

Fig. 10
figure 10

Comparison between the experimental and the ANN-predicted energy consumption of bovine horns face milling

Fig. 11
figure 11

Comparison between the experimental and the ANN-predicted surface roughness of face-milled bovine horns

Figure 10 describes the visual comparison between the experimental and the predicted data using the proposed prediction model. The predicted data is in good agreement with the empirical data. However, the deviation on several points was still considerably wide. Experimental and predicted data at run 3, 11, 21 and 26 deviated with a maximum of 11%. This difference could be related to the non-isotropic characteristic of the bovine horns.

Surface roughness is the concern of any machining process. According to [42], determining optimum machining parameters are very important to improve machined product’s surface quality, reducing the cost of machining and remaining more competitive in the market. Therefore, it is beneficial for the producer of bovine horn products to minimize the consumption of energy and improve the quality of the product surface.

Figure 11 depicts the results of prediction and actual data for the surface roughness of the machined components. Similar to the energy consumption prediction data (Fig. 10), sufficient agreement between the predicted data and the empirical data is achieved. However, the deviation at run 2, 3, 16, 21 and 26 were observed. Since surface roughness is also determined by the characteristic of the workpiece, the non-isotropic condition of the bovine horns created this variation. However, the accuracy of the surface roughness prediction was in an acceptable range. Hence, it can be suggested that this model can predict surface roughness data of bovine horns.

Predicting energy consumption and surface roughness of a machining process with the involvement of a considerable number of parameters is very time consuming and expensive. ANN solves this issue by saving the resource needed. Hence, this prediction model may significantly increase the productivity of the bovine horn product manufacturers by reducing their expenses in energy and setup time.

5 Conclusions

A study in predicting surface roughness, and energy consumption of bovine horn after face milling process using an artificial neural network has been conducted. The following findings are obtained:

  • The experimental and ANN predicted values exhibited a strong correlation.

  • The proposed ANN model provided acceptable results with relatively high prediction accuracy (95.4%).

  • The proposed ANN-based prediction model capable of predicting surface roughness and energy consumption of machining a bovine horn.

The present study provides additional evidence on the remarkable prediction performance of ANN. The current practices of predicting machining characteristic of engineering materials by ANN could be extended to animal-based materials, such as bovine horns. The industrial practitioners may gain an understanding of the machining set-up of bovine horns as described by the present study. Our findings may provide a solid foundation for future studies on the behaviour of bovine horns as the workpiece of the machining process. A higher adoption level of bovine horns as industrial products is expected, leading to increasing the production volume of industrial products made of bovine horns. Lastly, applying ANN prediction model to other material removal techniques are worth to be conducted as the future application studies of ANN.