# A Novel Physics-Guided Neural Network for Predicting Fatigue Life of Materials
## 3 Results and Discussions  
The accuracy of the prediction results can be measured using the root mean square error (RMSE) function as follows:  
\[\text{RMSE}=\sqrt{\frac{1}{n}\sum_{i=1}^{n}\left(\log N_{i}^{p}-\log N_{i}^{e} \right)^{2}} \tag{6}\]  
where \(n\) is the total number of samples, \(N_{i}^{p}\) and \(N_{i}^{e}\) are the life prediction value and experimental test value of the \(i\)th sample, respectively. Figure 4 shows the fatigue life prediction RMSE of the ANN, PGNN and SVR in all four cases. It can be seen that the ANN, PGNN and SVR achieved the highest prediction error in Case 1, while the three methods achieved the lowest prediction error in Case 2. The average prediction error of Case 3 and Case 4 is relatively close. It shows that the selection of training samples has a non-negligible impact on the prediction accuracy of the model. One way to solve this problem is to carefully select training samples. The selected training samples should be able to cover a sufficient range. The noise of the samples is small and the samples should be representative. On the other hand, it is also necessary to integrate the ML model with specific prior knowledge to constrain or guide the prediction results of the model, so that its prediction ability is less affected by the randomness of training sample selection, which will make the prediction results of the model more credible under the condition of limited sample size. In all cases, the RMSE of the predicted results of the PGNN is the smallest, indicating that the PGNN has an advantage in the accuracy of fatigue life prediction compared with the ANN and SVR. The following is a further analysis of Case 2, in which all three models achieved the minimum error. Figure 5 shows the details of the training samples and validation samples in Case 2, and Figure 6 shows the fatigue life prediction results of the ANN, PGNN and SVR for Case 2. Figure 3: All samples: (**a**) Kt = 1.6, (**b**) Kt = 2.4 and (**c**) Kt = 3.4. Figure 4: RMSE results of the ANN, PGNN and SVR. Figure 5: Details of the samples of Case 2: **(a)** training samples; **(b)** validation samples. Figure 6: Fatigue life prediction results of Case 2: **(a)** ANN; **(b)** PGNN; **(c)** SVR. The error line in Figure 6 is a double error line. Among them, the ANN and SVR have higher fatigue life prediction results than the double error line, while the PGNN has lower fatigue prediction results than the double error. This is consistent with the RMSE results in Figure 4, indicating that the PGNN has higher accuracy in predicting the fatigue life of Case 2 in this study. After each epoch, the ANN and PGNN calculate the loss function for all samples in Case 2 to determine the progress of network training. Figure 7 shows the loss function iteration process of ANN and PGNN. The value of the loss function of ANN is reduced to the minimum value, and the loss function increases with the continuous training, indicating that the prediction error of ANN in Case 2 increases with the continuous training. It shows that the ANN has the phenomenon of over-fitting training samples. The loss function of the PGNN tends to be stable after falling to the minimum value, indicating that the PGNN can effectively resist the over-fitting of training samples. After training, the ML method can output the fatigue life prediction results of any load under certain conditions. Figure 8 shows the S-N curves of each stress ratio R output by the ANN and PGNN under the condition of \(\text{Kt}=1.6\). Among them, the S-N curves output by the PGNN are all smooth curves, while the S-N curves output by ANN, as a purely data-driven method, are irregular line segments. In Figure 8, the S-N curve output by the ANN has a sudden increase in the slope, which is inconsistent with reality. In fact, the S-N curve output by the PGNN is determined by the fatigue parameter \(\sigma_{f}^{\prime}\),\(b\) corresponding to the specific loading environment, which is  
Figure 8: S-N curves outputted by ANN and PGNN.