## 6 Discussion
### In Situ Classification Routine  
As illustrated in Figure 10, several misclassifications are demonstrated. The predicted and true labels are displayed adjacent to the images to serve as a reference. The images emphasise the challenges associated with the conversion of height data to image data. In Figure 10a, the phenomenon known as'stringing' is evident, where thermoplastic strings form the printed part as a consequence of the extruder nozzle oozing on its travel trajectory. This phenomenon can potentially lead to misclassification, as the hardened thermoplastic strings may result in the model erroneously identifying an out-of-place copper wire. Another salient issue visible in this image is the absence of height data in the shadow of the printed part, attributable to the angle at which the light sensor is mounted. However, in this particular instance, the absence of height data does not constitute a significant problem, as only the height data within the printed plane is relevant. As illustrated in Figure 10c-h, sensor artifacts are evident and can originate from various sources, including fluctuations in ambient light, reflections, or mechanical oscillations of the machine. Upon examination of the data, it is observed that these artifacts \begin{table}
\begin{tabular}{l l c c c c} \hline \hline \multirow{2}{*}{**Model with ID**} & \multirow{2}{*}{**Dataset**} & \multicolumn{4}{c}{**F1 Score Averaged**} \\ \cline{3-6}  & & **Infill** & **Solid** & **Wire Bad** & **Wire Good** \\ \hline Custom CNN 2 & Dataset 1 & 0.86 + 0.01 & 0.98 \(-\) 0.01 & 0.73 & 0.69 \\ Transfer Learning 4 & Dataset 4 & 0.89 + 0.01 & 0.99 \(-\) 0.01 & 0.84 & 0.80 \(\pm\) 0.02 \\ Fine-Tuning 3 & Dataset 4 & 0.90 \(\pm\) 0.01 & 0.99 & 0.83 \(\pm\) 0.02 & 0.81 \(\pm\) 0.02 \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Overview of the averaged F1 scores achieved by the best models of each approach conducted. frequently result in a localized offset relative to the surrounding data, manifesting as intensity variations in the corresponding regions of the image. Furthermore, Figure 10c-g illustrate the difficulty of distinguishing wire-related data from infill data. When a copper wire is fully embedded within the thermoplastic, the model struggles to make accurate predictions. Similarly, if the nozzle or a partially retracted copper wire leaves a slight groove in the infill structure, the model may confuse it with the groove that forms around the wire when it is embedded. An isolated classification model is not an adequate solution for in situ monitoring of the printing process. After each printed layer, the controller must initiate a scan, process the recorded data and analyze all the resulting patches. The first obstacle in this procedure is the format of the scan. Each scan is manually prepared for training the CNN using a purpose-built GUI. However, this is not practical during a continuous printing process. It is therefore necessary to develop a way of detecting the component in a scan. The overall objective of the study is to enable a DL classifier that can be incorporated into an automatic in-line monitoring method. The top-level objective of fully automated in-line monitoring remains impaired by the manual image cropping still present in the developed method. Consequently, automated solutions for cropping the raw data must be integrated into the overall solution in the future. This can be achieved, for example, by using predefined target image sizes and a simple cutting routine based on edge detection. Methods for the automated cropping of images are available in the literature, so it can be considered technically feasible to automate this task. Examples include filter-based methods [57; 58], attention-based methods [59], and aesthetic-based methods [60]. The use of an upstream ML model for object recognition is also a good option for this task. Alternatively, any separate program can also be used for localization; therefore, this step is omitted in this study.