## 4 Prediction of 3D Printing Process Parameters Based on GA-BP Neural Network  
### Bone Density BP Neural Network Prediction Modeling  
A robust regression model of bone density has been established using RSM. The neural network training and test sample data were generated through quadratic regression \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Predictive Model** & **Parameters** & **First-Order Sensitivity** & **Global Sensitivity** \\ \hline \multirow{4}{*}{Cortical bone density} & Filling density (\%) & 0.8700 & 0.8100 \\  & Material flow (\%) & 0.1878 & 0.1892 \\  & Layer thickness (mm) & 0.0004 & 0.0005 \\  & Filling density (\%) & 0.9738 & 0.9658 \\ \multirow{2}{*}{Cancellous bone density} & Material flow (\%) & 0.0340 & 0.0371 \\  & Layer thickness (mm) & 0.0000 & 0.0001 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: First-order sensitivity and global sensitivity of predictive models. Figure 9: First-order sensitivity and global sensitivity of the bone density prediction model. (**a**) Sensitivity of cortical bone density model parameters; (**b**) sensitivity of cancellous bone density model parameters. modeling. A total of 600 different sets of data were selected, with 450 sets used as training samples and 150 sets as test samples. In this study, Matlab was utilized to execute the model design. The built-in normalization function'mapminmax' was employed to normalize both the input and output data, transforming the learning and testing sample data into the \([-1,1]\) interval. After the model training and testing were completed, the inverse normalization procedure was applied to retrieve the actual output values. The normalization formula used is as follows:  
\[x\prime=\frac{x-x_{\text{min}}}{x_{\text{max}}-x_{\text{min}}}, \tag{15}\]  
In this equation, \(x\) and \(x\prime\) represent the data before and after normalization, respectively; \(x_{\text{max}}\) and \(x_{\text{min}}\) represent the maximum and minimum values of the data for a sample within a given dimension. 1. Design of the input and output layers  
The objective of this paper is to construct a network model that correlates printing bone density with processing parameters. As determined in the preceding section, the processing parameters include the filling density (%), flow rate (%), and layer thickness (mm). Consequently, the prediction model formulated in this study features three nodes in the input layer, corresponding to the aforementioned parameters, and a single node in the output layer, representing the bone density. 2. Design of hidden layers  
To streamline the model architecture, this paper employs a single-hidden-layer BP neural network. Through systematic network construction, we sought to determine the optimal number of nodes within the hidden layer. Initially, the node count was bracketed between 3 and 20. By training the network and evaluating the Euclidean distance errors of the training set, the optimal configuration was identified as the one yielding the minimum error. As depicted in Figure 9(a), setting the hidden layer to 14 nodes minimizes the Euclidean distance error to 0.020709. Conversely, Figure 9(b) reveals that a five-node hidden layer reduces the error to 0.017854. Consequently, the structure of the BP neural network prediction model for cortical bone density is determined to be 3-14-1, while that for cancellous bone density is 3-5-1, as illustrated in the model structures shown in Figure 11.  
Figure 10: Plots of training set error as a function of the number of nodes in the hidden layer. (**a**) The variation in cortical bone density training set error with the number of hidden layer nodes; (**b**) the variation in cancellous bone density training set error with the number of hidden layer nodes. (3) Selection of activation function  
The activation function plays a crucial role as the transfer mechanism between the hidden layer and the output layer within a neural network, with its selection directly impacting the network's output.