## 4 Artificial Neural Network
### Artificial Neural Network for Friction Stir Welding  
In this study, the ReLU function was used as the activation function of the neural network model, and the gradient descent method was used to minimize the loss function. TensorFlow (2.7.0) is an open-source software library developed by Google, offering various features that make it easy to use machine learning and deep learning in a Python environment. It is specifically designed to simplify the construction and execution of complex computations, such as neural networks. Therefore, in this study, the neural network was built and trained using TensorFlow in a Python environment. The input variables for train  
Figure 11: Artificial neural network structure.  
In neural network models, hyperparameters such as the number of neurons in each layer, batch size, learning rate, and weight reduction depending on parameters are important for the performance of the model. To optimize the performance of the model through these hyperparameters, we used TensorFlow's Keras Tuner library, which is used to automate hyperparameter tuning and find the optimal model configuration. Keras Tuner has several built-in tuners, of which we used Hyperband Tuner in this paper. Hyperband progressively increases the amount of resources allocated to each hyperparameter configuration during testing. Initially, a small amount of resources is assigned to each hyperparameter to quickly evaluate performance. Then, configurations with lower performance are terminated early to save resources, allowing more resources to be allocated to other configurations. This approach enables Hyperband to focus more resources on configurations with superior performance, ultimately deriving the optimal hyperparameters. The optimization results showed that the best results were obtained using forty-eight nodes and four hidden layers. Therefore, the neural network architecture used in the study consisted of an input layer with five nodes, four hidden layers with forty-eight nodes, and an output layer with one node. The accuracy of an ANN model depends on the quality and quantity of training data. In our experiments, we used 22 input and output datasets, 90% of which were used for training and 10% for testing. Mean squared error (MSE) was used as a loss function to evaluate the difference between the predicted values of the neural network and the values of the actual data. MSE calculates the mean squared error between the predicted and actual values and serves as an intuitive metric for evaluating model performance. Additionally, since MSE is mathematically differentiable, it is often used when applying optimization algorithms such as gradient descent. The MSE is expressed as in Equation (2), where the number of epochs used was 5000.  
\[E=\frac{1}{n}\sum_{i=1}^{n}(\mathcal{Y}_{i}-y_{i})^{2} \tag{2}\]  
Figure 13 shows the evolution of the loss function as the number of epochs increases. We observe that the loss function decreases and then remains constant as the number of epochs increases.  
\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline \multicolumn{1}{c}{} & \multicolumn{1}{c}{**Input Data**} & & & & & & & **Output** \\ \hline \hline
**No.** & **a** & **b** & **c** & **d** & **e** & **f** & **g** & **h** & **Max.** & **Tensile** & **Strength** \\ \hline
**\#4** & \(1.0\times 10^{-5}\) & \(-7.0\times 10^{-4}\) & 0.0158 & 3.0273 & \(-1.0\times 10^{-5}\) & 0.007 & \(-1.0364\) & 53.674 & 284.9 & 233.4 \\
**\#5** & \(4.0\times 10^{-6}\