## 6 Results  
For the case study considered, the classification error function is shown in Figure 7, which contains the output of Bayesian optimization:  
each blue dot corresponds to an estimate of the minimum classification error computed by the optimization process when all sets of hyperparameter values tested so far, including the current iteration, are considered. The estimate is based on an upper confidence interval of the current classification error objective model. Each dark blue dot corresponds to the minimum observed classification error computed so far by the optimization process. The red square indicates the iteration corresponding to optimized hyperparameters. Such hyperparameters do not always yield the minimum observed classification error. Bayesian hyperparameter optimization chooses the set of hyperparameters that minimizes a higher confidence interval of the objective model of the classification error, rather than the set that minimizes the classification error. The yellow dot indicates the iteration corresponding to the hyperparameters that yield the lowest observed classification error. Then, the best point is extracted as the optimized AI. For sake of brevity, the results of this AI in the form of scatter plots, parallel plots, and ROC curves are omitted; instead, the corresponding confusion matrix after validation is shown in Figure 8. The trained AI achieves an accuracy of 73.3 percent and commits a maximum error in estimating the corro  
Figure 7: Classification error function. It is worth noting that a distinction should be made between the different types of errors: the error in the upper triangular matrix corresponds to an overestimation of the actual damage, which would lead to false alarms in real applications, while the errors in the lower triangular matrix are associated with an underestimation of the actual damage, which may lead to missed alarms. While these two types of errors are the same in terms of damage quantification, they can have very different consequences: a false alarm is costly because of the inconvenience it causes, while a missed alarm can jeopardize the safety of the work and people. Based on these considerations, it is interesting to define how to translate these technical observations so that AI can learn from them. The solution found is to insert penalties during the learning phase that limit the number of missed alarms in favor of false alarms. Figure 9 shows the penalty matrix used. Then, the AI was re-trained through optimization. The resulting AI achieves an accuracy of 75.0% and commits a maximum error in estimating the corroded thickness of 1 mm. The introduction of the penalty matrix could also lead to a decrease in accuracy (although only to a very small extent) because its objective is not to increase accuracy, but to improve structural safety. Figures 10 and 11 show the classification error function and the confusion matrix of the AI trained with the penalty matrix, respectively. Figure 12 shows how well Bayesian optimization fits. Figure 8: Confusion matrix. Figure 9: Penalty matrix. Nevertheless, Bayesian optimization succeeds in finding one of the best possible AIs, but not the absolute best, because AIs with higher accuracy can be seen from the figure. Thus, one could argue that Bayesian optimization allows one to find an excellent (not the best) AI without having to perform many iterations to understand its variability and then take its maximum; the solid blue line remains close to the upper bound. Figure 12 shows the accuracies obtained by training tens of thousands of AIs trained by hyperparameter randomization. The accuracy of a Bayesian optimized AI with an additional penalty matrix is shown in the dashed blue line; the resulting accuracy is very similar to that without a penalty matrix. As mentioned earlier, this is not a problem, since the goal is to reduce the probability of missed alarms. We also wanted to use this plot to examine the variability in accuracy as the number of FE analyses performed for training changes.