## 6 Discussion
This method has already been proposed by [PERSON] et al. [78] and leads to the avoidance of overfitting in the case of class imbalance caused by a large number of frames without defects and a relatively small number of frames with a detectable defect. In the first step, the standard cross-entropy values were calculated, followed by the extraction of each class label, resulting in the output of the highest value on the tensor axis. The (predefined) weights are then determined according to the class labels. The pre-defined weights provide the ability to highlight classes during training. The next step was to add learning rate scheduling to the model architecture. This method of cyclic learning was introduced by [PERSON] [83] and results in an increase in the learning rate with each batch of data by starting at 0.001 for the first five epochs and then increasing exponentially. Accuracy has been improved by a further 0.5% to 98.5%. The scheduler is based on a mathematical decision of the fastest loss minimization. The final adjustment to the model architecture was the introduction of a Sobel filter which resulted in a final accuracy of over 99%. The simulated defects leave edges in the powder bed, and these sudden image discontinuities are detected via this edge detection [87]. The assumption was that edge detection would be well suited to this, as the abstraction makes defects visible rather than the actual components in the powder bed. The direction in which the intensity increases the most is represented by an image gradient. Consequently, a discrete variation is used to distil the concept of a derivative or gradient. Greyscale conversion is performed before the images pass through two directional Sobel filters stacked on top of each other. The results of this study show that with the implemented method of artificially generating coating defects, a large dataset of defect-free and defective frames could be generated to successfully train a custom CNN for classification with very high accuracy. Manual comparison of the automatically labelled data with real labels has shown that random defects are correctly labelled. This is only true in any chosen setting and after manual validation--while an educated guess can be made about the detection rate, the best results are only expected when a manual check is performed. As the defects tend to occur randomly, the likelihood of a recurring defect being mislabeled is low--however, if it were to occur, the impact on a real-use case would be proportional to the severity of the mislabeled defect. While a decrease in the accuracy is likely to be small, a serious problem that goes undetected because it was mislabeled during training could affect the entire manufacturing process. A continuous increase in the accuracy was observed by tuning the hyperparameters and by adding and combining previously presented and well-established additional functions. This approach has clearly shown that it is not necessary to use a particularly high-resolution industrial camera system for monitoring; as long as the camera is positioned in the right place, the interfaces for the data transfer are correctly defined and the CNN architecture is properly designed.