# Machine Learning-Based Prediction and Optimisation System for Laser Shock Peening
## 5 Results and Discussion
### Case Studies Using ANN and GA Models  
Residual stresses were predicted as a function of the input parameters as a function of the depth below the peened surface using the Bayesian neural networks and applying a  
Figure 10: Parametric studies showing the variation of residual stresses as a function of spot size for different offset distance and layer parameters in multiple-shot laser peening data with overlap (dataset 2). \"leave-one-out\" cross-validation method. Table 6 shows a summary of the input parameters used for the prediction model. Measured and predicted residual stresses are compared in Figure 11 for different cases. In Figure 11a,b, residual stresses are simulated for (spot size = 8.5 mm, layers = 4 and power density = 1 GW/cm\({}^{2}\)) using dataset 1. The ANN prediction was found to overestimate the residual stresses by about \(-\)80 MPa along both directions, and the mismatch was observed at a depth range of 100-400 \(\upmu\)m. Apart from this discrepancy, the predicted and measured stresses were in reasonable agreement. In further examples in Figure 11c,d, the predicted and measured residual stresses were in excellent agreement throughout the depth for input parameters (spot size = 3.5 mm, layers = 2 and power density = 6 GW/cm\({}^{2}\)). In dataset 2, very good consensus was observed in all the predicted cases as shown in Figure 11e-h. The predicted stress profile was seen to closely follow the trend in the measured residual stress profiles, especially with the peak compressive stresses and the high stress gradients present near the surface. The scatter within the predictions was markedly low in dataset 2. Therefore, the error bars that were subsequently calculated using the standard deviation of predicted data of the ensemble networks were small in the simulated residual stress distribution. Overall, the ANN model predictions were consistently in good agreement with the measured residual stress profiles, with differences of less than 100 MPa between the measured and predicted data. In contrast, the amount of information required to develop the ANN model is not tedious, unlike mechanistic models, and does not involve comprehensive testing regimes to evaluate the material properties. Moreover, the ANN model covers the critical parameters such as LSP process variables and utilizes the measured residual stress data. The application of GA was demonstrated using multiple case studies from the single-shot laser peening data. In the first case study, the algorithm was given the freedom to optimise all the process parameters, namely spot size, layers and power density. The GA was used to obtain the values of the longitudinal and transverse residual stress at a given depth as shown in Table 7. On running the algorithm, the solutions for the input parameters obtained by the GA are shown in Table 8 alongside the predicted residual stresses from the ANN model. A mean _RMSE_ of 7.61 was obtained with three degrees of freedom, suggesting that the GA efficiently optimised the input parameters. For the second case study (see Table 9), the number of layers was two, three and five for three independent iterations. The solutions showing the optimised process parameters obtained by applying the GA with fixed number of layers are shown in Table 10. The _RMSE_ value (14.64) nearly doubled in the second case study with two degrees of freedom, suggesting that parameter design problems are challenging due to the nonlinear relationships between the output and input parameters. However, with the application of GA, any set of parameters can be efficiently optimised through convergence to a global solution within the corresponding parameter bounds. This approach is superior to the Taguchi optimisation methods [23,24] where the mathematical formulation of the objective function is undefined in an industrial