Python inspired Artificial Neural Networks Modeling in Drilling of Glass-Hemp-Flax Fiber Composites

As composites are materials whose properties can essentially be customized to suit the necessities of the engineering application on hand, they are being widely used in many applications for radically different purposes. In order to ensure quality in production process of composite products, a solid understanding of the process involved during its manufacturing is essential to ensure the product is free from both internal and external defects. To that aim, a study was conducted to model Thrust force and Torque on drilling of Glass-Hemp-Flax reinforced polymer composite by fabricating and maching the composite as per Taguchi’s L27 Orthogonal Array. The process parameters considered for modeling are drill diameter, spindle speed and feed rate. Using the process control parameters as inputs and thrust force and torque to be predicted as outputs, artificial neural networks (ANNs) were created to model the effects of the inputs and their interactions. The predictions obtained from the neural networks were compared with the values obtained from experimentation. Excellent agreement was found between the two sets of values, establishing grounds for more extensive use of neural networks in modelling of machining parameters.


INTRODUCTION
Machining is the core for any manufacturing industry. With the ever-growing use of composite materials for various engineering applications due to economic viability and configurable material properties, the analysis of the effects of machining on composite samples has quickly risen to being one among the most important tasks to be carried out, in order to better understand these materials and the effects of various machining parameters on their material properties [1][2][3][4][5][6]. Excessive thrust forces, heat generated, twisting torque etc. have been shown to cause cracking and delamination in composites [7,8].
Some of the popularly used composite materials are Glass Fiber Reinforced Polymers (GFRP), Carbon Fiber Reinforced Polymers (CFRP), Aramid Fibers, etc. are mostly synthetic. To dispose of them, they have to be either incinerated or put into landfills, which makes them a hazard to the environment. For this reason, Hybrid Fiber Composites have gained importance and preference as they consist of natural fibers like flax, jute, hemp, oil palm, sisal, kenaf, etc. These are cellulosic fibers, which provide enhanced mechanical properties at a low cost to HFCs [1]. HFCs are also superior to conventional composite materials in that they exhibit heightened damping and thermal properties, especially with reference to single-fiber type composites.
Considering the various industries where composites are used, analysing their behaviour during machining is essential. Composites are used in industries which include application of fatigue loads, creeps causing loads, thermal loads, mechanical loads and so on. The typical machining operations involved in the fabrication of composite components deal with tampering with the composite matrix partially, completely or only up to the surface. If machining is done without proper consideration of the process parameters, it could lead to failures like delamination, crack generation, crack propagation, etc. For this reason, researchers have extensively studied the machining parameters.
Nagarajan et al. have considered spindle speed and feed rate as the parameters of the composite drilling process based on which they modelled a fuzzy inference system using MATLAB, to predict values and have found that their sub-routines have provided excellent correlation [9]. Palanikumar et al. and Davim et al. have identified that the feed rate of the drill bit into the specimen considerable influence in the variation of thrust force [10,11].
For this research, feed rate, drill bit diameter, and spindle speed of drilling are considered to train the model. The models are considered based on the works done by Nagarajan et al. and Latha et al [3,9]. An experimental procedure for drilling the HFC sample is designed and deployed, and the thrust force and torque various cases is recorded. After this, a computer-based predictive model using artificial neural networks (ANNs) is created using Python to predict the thrust force and torque using the machining parameters considered above as the inputs. The experimental values were provided as inputs to these computational Artificial Neural Networks, which were used to learn the parameters and assign weightages to each parameter for modelling the thrust force and torque. Good agreement is observed between empirical and model-predicted values, thus establishing grounds for using ANN modelling in predicting machining process parameters.

Fabrication of composite and conduction of drilling test
The hybrid fiber composite consisted of:  , taking the total final composite thickness to 12 mm. The hand roller was used to ensure the prevention of formation of air bubbles. After the hand rolling procedure was done, the composite was cured for 24 hrs at room temperature. The drilling operations were carried out using a BMV 40 T20 drilling machine, which has a maximum spindle speed of 6000 rpm. Figure 2 shows the experimental setup used to carry out the procedure.

Figure 3. Drill bits of different diameters used for experimentation
Considering all the 3 parameters and all the 3 values of each parameter taken, it makes the total number of experiments 3 3 3 = 27. 3 trials were made for each experiment, making the total number of experiments that were carried out to 81. A Taguchi L 27 orthogonal array (3 controlling factors) was used for design of experiments [20]. The thrust force and torque for each individual trial for a set of parameters were computed and the average of the 3 values were considered as the value for each set of parameters.

Construction of Predictive Artificial Neural Networks
Modelling of machining parameters with neural networks has been widely studied and documented for various materials being operated upon with different machining processes [12][13][14]16]. Neural networks present a novel method of modelling, by automatically formulating relationships between input and output parameters through an algorithm involving error minimization and self-correction. In most cases, neural network modelling has produced satisfactory results and has since established grounds for use in different machining processes. Considering these factors, neural networks were chosen for modelling purposes in this work. An Artificial Neural Network System consists of an input layer, at least one hidden layer and an output layer. Each layer consists of a collection of 'neurons', each of which interacts with all neurons of the previous layer and those of the next layer through a collection of weightages assigned to each possible linkage. Data about collections of inputs with known values of outputs are used to train the model, which entails assigning and fine-tuning the weights and biases used in it. This is done through various methods, the one used in this work being the back-propagation method. The point of the process is to optimize the weights and biases such that the output prediction made by the model is as close to the true value of the data as possible. For this purpose, the mode of operation of this optimization is the minimizing of a "loss function" (usually the mean squared error), conventionally done by popular techniques to find minima such as gradient descent, stochastic gradient descent etc. The back-propagation algorithm is outlined below: 1. Initialize all neurons with random weights and biases 2. Feed the input parameters to the system using the input layer neurons 3. Compute the output of each neuron in each layer up to the last output layer, which gives the intended output 4. Compute the difference between computed output and intended output 5. Percolate backwards from the output layers, adjusting weights and biases to reduce the error 6. Repeat steps till computed error converges, or lands below an acceptable threshold value The training data used here will be the 27 sets of experimental values obtained, with the drill bit diameter, spindle speed and feed rate being the input parameters and the thrust force and torque being the output parameters to be predicted by the neural networks. These data sets are used to train the system to think regressively. In this case, considering the fact that the influence of the chosen control parameters affects each output parameter differently, separate neural network models were created, initialized and trained to predict each output parameter. The neural networks were created using the scikit-learn package in Python. The pandas library was used for data handling and providing inputs to the models, and the matplotlib module was used for data visualization and interpretation of results. The experimental data was randomly split into two sets; one set (with 60% of the data points) was used to train the neural networks, while the other was used as testing data to determine the performance of the trained ANNs.
The neural networks were designed with input layer being fixed with 3 neurons (one for each control parameter), output layer being fixed with 1 neuron (for one output parameter) and optimizing the number and configuration of hidden layers. A trial-and-error approach was adopted, where neural networks with 1, 2 and 3 hidden layers were created with different possible number of neurons in each layer, and a brute-force method was followed to find the network configuration which best fit the observed data. In each category (1, 2 and 3 hidden layers) the neuron configuration which gave the best R 2 score for testing data was selected as the best candidate (since generalization to unseen data is a crucial purpose of neural network modelling and prediction), and the best performing configuration from these 3 was used as the final modelling network.
The procedure used in this work has been outlined in the flowchart given below.

RESULTS AND DISCUSSION
The results of the above-mentioned modelling and prediction using the neural networks were tabulated. The matplotlib package in Python was used to plot and visualize the data, and the in-built r2_score function in the scikit-learn package was used to determine the degree of correlation between the observed and predicted values and test the model accuracy.
The trial-and-error approach showed that for thrust force modelling, a neural network with 1 hidden layer consisting of 52 neurons gave the best R 2 score for testing, while for torque modelling, a neural network with 3 hidden layers containing 11, 9 and 20 neurons respectively turned out to be the winning configuration. The results of the brute-force analysis and the comparison of the categorical best performers are shown below.  The selected neural networks were applied to the experimental data for final modelling, and the predicted results were graphed. The plots obtained are given in the figures below, showing the output variation for each experimental procedure.
Python was used for programming, to take advantage of well-documented modules and packages such as numpy, scikit-learn, pandas, matplotlib etc. which are popularly used for neural network modelling and machine learning applications, while being user-friendly and easy to implement. Considering the trial-and-error approach involving brute-force checking of all possible neuron configurations and the relative unpredictability of the torque data due to its evidently high degree of non-linearity and apparent lack of a definite pattern, the program executed in remarkably good time (8 minutes) and was able to complete the checking of configurations with no overflow. The identified best-performing neural networks also gave very good results with demonstrable accuracy.
The verification that the models had indeed converged to the demonstrated level of accuracy was done by plotting the loss functions of the neural networks, which calculates the mean square error between the predicted values and experimental values for each learning iteration of the models. These loss curves are shown below. The curves are found to converge to values close to zero, indicating optimum modelling and reduction of error over each iteration.

Figure 11. Converging loss values evaluated at each iteration of learning by the ANNs
For each output parameter, a scatter plot with a trend line was made between the empirical and predicted values. These plots further clarify the quality of fit of the models to the data. The scatter plots are given below.
On visualization, it is observed that thrust force increases with decrease in spindle speed and increase in feed rate and drill bit diameter, which matches with the observations by several previous works [8][9][10][16][17][18][19]]. Torque appears to show similar trends in variation with the control parameters. A possible explanation for the downward trend in both thrust force and torque with increase in spindle speed could be the increased frictional heat generated due to rubbing between the drill bit and the specimen, resulting in thermal softening of the matrix material and reduction in reaction force and torque. It is also speculated that the torque and thrust force show an increase with increase in drill bit diameter and feed rate due to the larger area of material removal between the drill bit and the specimen, and increase in resistance due to higher speed of motion of the drill bit with reduced time given for the material to yield.

Figure 12. Scatter plot comparison of torque values
To test the accuracy of the created ANN models in terms of predicting the output parameter for a given set of input parameters, the R 2 coefficient of correlation was calculated for each output parameter. In each case, the R 2 values for both the testing data set as well as the overall data set were calculated. The obtained values are found to be close to unity, indicating that the created ANN models were able to accurately predict the output parameters using the given control parameter data while robustly accounting for possible random variation in the data. The calculated R 2 values are shown below.

CONCLUSION
To conclude, the experiment was carried out using solid carbide drill bits on glass-hemp-flax composite. In total, 27 experiments were designed using Taguchi's L 27 orthogonal array method and the resulting thrust force and thrust values were tabulated. An Artificial Neural Network (ANN) modelling system was constructed, consisting of 2 individual networks for predicting torque and thrust force independently. A trial-and-error approach was employed using the brute-force method, to identify the optimum configuration of the neural networks in each case for best possible results. A neural network with 1 hidden layer made of 52 neurons was selected for modelling thrust force, and a neural network with 3 hidden layers respectively having 11, 9 and 20 neurons was employed for predicting torque values. Both neural networks had 3 neurons in the input layer and 1 neuron in the output layer. The results of the experimentation indicated that the thrust force and torque increase with increase in drill bit diameter and feed rate, and decrease with increase in spindle speed; these observations were found to align with results from other research work.
The technique of neural network modelling has proved to be very efficient in predicting the output values for a given set of input values. This is evidenced by the fact that the testing accuracy of the models have R 2 values of 0.9962 and 0.8781 for thrust force and torque modelling respectively, and the model-to-data correlation shows R 2 correlation coefficients of 0.9931 for thrust force prediction and 0.939 for torque prediction. The high value of R 2 obtained in these predictions demonstrate the ability of the model to robustly account for almost all variability and randomness found in the data, for both thrust force and torque. It also establishes strong precedent for the use of neural network modelling in optimization of machining process parameters.
To improve the efficiency of the system, more training data may be gathered by introducing new levels of parameter variation (3 levels for each control parameter were used in this work). Also, additional parameters like drill bit materials, individual layer thickness, total composite thickness, use of lubrication etc. may also be considered for the purpose of modelling.