## 3 Experimental Method
### Data Preparation
#### 3.1.2 Data Gathering and Preprocessing  
Metal transfer, arc shape, and weld-pool/bead are important features that must be verified for process stability. For the real-time monitoring of the features, the images were obtained using an HDR camera at 50 frames per second. The monitored images are segmented into three regions of interest (RoIs): (1) metal transfer, (2) arc shape, and (3) weld-pool/-bead, as shown in Figure 2b. In this study, we focus on two RoIs, i.e., metal transfer and weld-pool/bead. Because the arc features show characteristics that differ from those of the others, it requires a more sophisticated method. This will be investigated in future work.  
To obtain a uniform and regular weld bead, the wire must be smoothly melted and transferred to a weld-pool with or without a droplet, as shown in Figure 3a. By contrast, Figure 3b shows an abnormal metal transfer, discontinuously transferring the droplet into the weld pool. Consequently, abnormal weld-beads (e.g., humping beads) are generated. To detect this problem, the image data of the metal transfer RoI are gathered and classified into normal and abnormal classes. The gathered images are difficult to use as raw images in the development of the AI model because strong noise is included, and the edge of the wire material in the image is vague owing to the light reflection of the arc. To obtain a clear metal transfer RoI, the contour line of the feed wire is extracted and labeled as normal or abnormal based on its shape, as shown in Figure 4a,b. The Canny edge detection algorithm [44], which has a lower error rate than other edge detection algorithms, is used for contour line extraction. The contoured images in two classes (normal and abnormal) were used for training and testing in the development of an AI model that can discriminate the failure of metal transfer.  
Figure 2: (**a**) Experimental setup; (**b**) welding area monitored by HDR camera.  
To detect the defects, the bead shape should be verified. The quality of the bead shape is affected by various process parameters (e.g., arc current, wire feed rate, and travel speed). If these process parameters are incorrectly set [45; 46], defects such as humping can occur [47; 48]. [PERSON] et al. [49] limited the range of the torch traveling speed during the welding process when humping occurred. In addition, humping degrades the overall weld quality in a single- or multi-layer process. In this study, humping is defined and reproduced as an abnormal class. The well-processed welding should maintain a uniform height and width of the bead (see Figure 5b). By contrast, the defective welding shows an uneven or wavy bead shape (see Figure 5c).  
The RoI of the weld-pool/bead based on the HDR image in this study is depicted as normal and abnormal in Figure 6a,b, respectively. Compared with the metal transfer RoI, the weld-pool/bead RoI is clearly shown without the interference of arc light. The main difference between normal and abnormal cases is shown by the shape of the weld-bead; as such, additional preprocessing is not required. The defined RoI of the weld-pool/bead contains long width pixels, and the humping beads can be located at any location in the weld-pool/bead RoI. Hence, the reduced square area from the weld-pool/bead RoI is randomly extracted from the original weld-pool/bead RoI, and these extracted areas are labeled as \"normal\" and \"abnormal\" from the normal and abnormal weld-pool/bead RoIs, respectively, as shown in Figure 6. Furthermore, random extraction from the RoI is facilitated in class data augmentation.  
Figure 4: (**a**) Normal contour line of metal transfer; (**b**) abnormal contour line of metal transfer.  
Figure 5: (**a**) Humping phenomenon (refer [PERSON] et al. [49]); (**b**) normal bead; (**c**) abnormal bead.  
Figure 3: (**a**) Normal metal transfer shape; (**b**) abnormal metal transfer shape.