## Materials and Methods
### Analysing Methods
#### 2.3.1 XMR and CT with Artificial Intelligence Evaluation
A coating layer, filler layer, glass fiber-reinforced laminate, a surplus of the matrix, and a void in the coating layer are enclosed by the frame. A few pixels of each material layer, the background, and the defect were manually labeled with different colors, as seen in Figure 8a. Then machine learning was adopted to avoid the manual labeling of all the pixels. Here, a random forest classifier based on a decision tree delivered the segmentation of the to-be labeled frame in Figure 8b. The adjusted random forest prediction delivers enough labeled pixels to start training a neural network. Figure 7: XRM-scans: (**a**) 3D view of the whole object, (**b**) cross-sectional image with ROI, ROI-scan as a sectional view, ROI with pore [19]. Convolutional neural networks (CNN) are standard deep learning tools in the field of image processing. An established neural network for semantic image segmentation is the U-Net [14], here for the automated defect detection in the specimen. The size of the images used for U-Net segmentation is 774 px \(\times\) 1284 px \(\times\) 2013 px (width/height/depth). The first training of the U-Net took 15 min and was done using two virtually labeled data sets, such as the one shown in Figure 8b. In total, the U-Net was trained 12 times and fed with a new virtually labeled frame for each training session, and 12 virtually labeled frames were used as the training data set. The training duration depended on the complexity of the labeled frames and varied between 15 and 72 min, averaging 30 min per/training. The training of the neural network consists of adjusting the values of the weights epochwise using gradient descent, with the objective being error minimization. Here, the epoch refers to one cycle through the full training dataset. In an epoch, an entire dataset is passed forward and backward through the neural network only once. Usually, training a neural network takes more than a few epochs. The evolution of the loss function during the first training (where only two virtually labeled frames were used) is shown in Figure 9.  
Loss functions decrease with time, i.e., with an increasing number of epochs (which are training cycles made out of several batches). The first training did not deliver the required weights of the CNN to successfully segment all CT slices and locate all defects, which is indicated by efficient training. Note the drop of the green curve (loss function) with time, i.e., with the training evolution. For this reason, additional training was needed. Figure 10 shows the evolution of the loss training after the final (10 th) training of the U-Net. Figure 8: (**a**) Result of manual pixel-wise labeling of a CT-slice, (**b**) result of labeling of a virtual frame using a random forest classification [19]. Figure 9: Loss function vs. epochs during the first U-Net training [19]. The reduction of the loss function stagnated (0.163) after the 10 th training. An error minimization from 0.9 after the first training to 0.163 after the last training was attained, and further training was not beneficial. Since the difference between the validation loss function and loss function is partially less than 0.05, no conclusion regarding overfitting or underfitting of the neural network could be made. The success of distinguishing between different material layers can be seen in Figure 10(a). A greater challenge was the identification of pores (in purple, Figure 10(b)). The small pores were fully detected, while the larger ones were only partially detected. It was also found that the air bubbles in the coating, located above the pores in the filler layer, were not detected. However, the obtained results did not improve with further training. For this reason, a Sensor 3D [23] CNN with a different architecture was investigated to obtain better results.