## 2 Materials and Methods
### Labeling of Items  
The first stage begins with an import of the video of the PCB manufacturing cell, preferably in (*.mp4) format, which will be processed through the Roboflow platform (image tagging platform) to obtain a sequence of images of the frames (a concrete image within a sequence of moving images) that contains the video. To achieve element tagging, the number of classes and labels for each identified element in every stage was implemented, as illustrated in Figure 4. This figure includes annotations of the detected elements that were incorporated into the dataset. The quantity of labels or classes required for annotation varies with each stage because it represents the actual objects or elements present in the physical space. Consequently, the number of classes per element can fluctuate depending on the specific zone assigned to each stage. For every stage, we utilized 300 images to train the dataset, as indicated in the top right corner of the image. The dataset consisted of 300 images per stage or zone in the printed circuit board manufacturing cell (900 images by 3 zones). Upon creation, the dataset is divided into folders (210 images for training, 60 images for validation, and 30 images for testing).  
During dataset download, images were automatically sorted into separate folders with respective configurations (training, validation, and test), ensuring that each image had dimensions of 640 \(\times\) 640 pixels and a resolution of 96 dpi. The image segmentation process will be carried out individually for each image and each element identified in the manufacturing area. For this purpose, the toolbox on the right side of the image is used (see Figure 4). We use the \"Smart Polygon (S)\" tool to automatically outline each selected element. Each element will be segmented and colored differently to identify it.  
Additionally, manual refinement of each element's segmentation will be possible using the polygon tool. This tool allows for the precise shaping of manufacturing cell elements that require more accurate segmentation to enhance their identification in artificial intelligence image processing. Each segmented element will be assigned its detected name in the annotation editor (see Figure 4) and will be saved within a group of objects labeled with their assigned name. Furthermore, in the left panel within the class session, labels for each detected element in the image will be added to a list. The number displayed next to  
Figure 4: Segmentation and labeling of elements in the image of the “A” zone. (**a**) Illustrates the group of objects labeled with their assigned name. (**b**) Illustrates the “Smart Polygon (S)” tool to automatically outline each selected element.  
each label indicates the number of detected elements of the same class or label for a given object. Finally, the dataset is downloaded as a (*.zip) file and will be used in the second stage. The dataset contains the labeled images and a configuration file to be used in the training of the neural network.  
The instance segmentation technique is effective for the application because you can know exactly where the object to be recognized is located and, as a result, can almost always identify the same object, regardless of the position in which it is located.