## 2 Materials and Methods
### Preparation of the Training Dataset for Learning the Model-Roboflow  
The Roboflow platform was chosen to preprocess the dataset. Roboflow offers a comprehensive data management tool designed for the preparation, organization, and augmentation of image datasets utilized in machine learning applications. As a web-based application, it allows users to access its functionalities without the need for local software installation. Data are stored in the cloud, facilitating access and modification from multiple computers. A fundamental component of the Roboflow platform is its capability for data preprocessing and augmentation. Data preprocessing enables modifications to the dataset, removal of redundant information, and adaptation to specific tasks, thereby reducing training time and enhancing model efficiency. In the context of the implemented project, data preprocessing was utilized to resize images and filter out those labeled as null because an excess of such images can adversely impact the model training process. The dataset preparation commenced with the acquisition of images depicting samples utilized in the selective laser melting process. The dataset included images representing three distinct defect types encountered in the process: super-elevation, marks induced by recoater vibration, and marks resulting from recoater streaking (Figure 1). Initially, the images were organized into folders on a local computer. After the images were imported into the project, the process of annotating the defects to be detected commenced (Figure 2). Each image was manually annotated by delineating the contours of the visible defects. This contour-based annotation method allowed for precise definition of defect areas, resulting in more accurate training outcomes and precise interpretation of the marked regions by the model. Bounding boxes were found to be less precise, particularly for defects with irregular shapes. Once a defect area was annotated, it was assigned the appropriate class. During the labeling process, adjusting the contrast and brightness of the images proved essential for more accurate defect area annotation. After all images in the uploaded folder were annotated, a new folder was uploaded, and the defect marking process was repeated. Following the annotation of all images, the dataset was partitioned. A critical aspect of preparing the training dataset is the proper classification of the data into three primary subsets:  
**Training set**--This subset constitutes the largest portion of the dataset and is utilized for training the model. The model learns by identifying relationships between input data and corresponding responses. This set includes all classes introduced during the image classification process. In this project, the training set comprised approximately 70% of the total dataset. Figure 1: Example of sample defects: (**a**) correct, (**b**) super-elevation, (**c**) recoater damage, and (**d**) recoater vibration. **Validation set--**The validation set is essential for assessing the performance of the trained model. The data in this set are excluded from the training phase. Evaluating the model's performance on the validation set enables fine-tuning of critical parameters and determining the optimal stopping point for training when satisfactory results are achieved. In the implemented project, the validation set constituted approximately 20% of the total dataset. **Test set--**This subset is utilized for the final evaluation of the model's performance following the training and validation phases. It provides an assessment of the model's predictive capability on new, previously unseen data. In this project, the test set represented approximately 10% of the total dataset. The project used an augmentation process (Figure 3) to generate additional samples. The images were rotated three times by an angle of 90 degrees. A change of \(\pm\)25% in brightness and \(\pm\)5% in exposure was applied.