## 3 The Results of Experiments  
### Prediction of Welding Pool Boundary via U-Net  
The original image and the corresponding labels are entered into the neural network as the input images. Labels were created one by one for the cropped areas using the open software LabelMe ([[https://labelme.io/](https://labelme.io/)]([https://labelme.io/](https://labelme.io/))), shown in Figure 9[24]. In PAW, once the welding process has achieved a state of stability, the position of the keyhole remains constant, provided that the welding conditions remain constant. In this experiment, it was observed that the appearance of the keyhole was not evident after 600 lines of pixels when the weld pool had been stabilized. To remove the effect of the misalignment of the central keyhole, only the area directly below the keyhole was targeted, and the pixel area (1280 \(\times\) 240) was cut out from the original image from 600 pixels shown in Figure 10b. The teaching images were used for only one background class, except for the boundary line of the molten pond. The red boundary line was marked with 1, and all the background images were marked with 0. The cropped images and the created labels are shown in Figure 10c. First, the input image from the original weld pool images was cropped. The label images were created by LabelMe. The input image should be placed alongside its corresponding labeled image as the training image. A total of 1532 images were pre-processed. To increase the generalizability of this model, the training images include images of the weld pool advancing along the weld line and images of the weld before deviating from the welding. The teaching data for the segmentation consists of pairs of images of arbitrary regions segmented in pixel units for the input X images and the class of each color  
Figure 8: The digital control block diagram for seam tracking. Figure 10: A cropped part from the original image and the label were created. (**a**) Original image. (**b**) Input image cropped from the original image. (**c**) Labels created by LabelMe. Figure 9: Cropped areas by LabelMe. of the segmented region as the correct answer Y. The dataset used in the study includes both training and test data. The ratio of training data to test data is 9:1. Table 4 shows the number of images for each label employed as the teaching data. \[L(y,p)=-\frac{1}{N}{\sum\limits_{i=1}^{N}{y_{i}\cdot\text{log}(p(y_{i}))}}+(1-y_{ i})\cdot\text{log}(1-p(y_{i})) \tag{1}\]  
Binary cross-entropy is a loss function used in binary classification problems, as shown in Equation (1) [25]. Where y is the label (1 for positive points and 0 for negative points), p(y\({}_{i}\)) is the predicted probability of the point being positive for all the N points. For positive point y = 1, loss = log(p(y\({}_{i}\))), the p(y\({}_{i}\)) gets larger, and the loss gets smaller. On the other hand, for negative points y = 0, loss = \(-\)log (1 \(-\) p(y\({}_{i}\))), the p(y\({}_{i}\)) becomes smaller, and the loss becomes smaller. In this research, positive points and negative points are the boundary line marked with 1 and the background marked with 0. The Adam optimizer was employed with an initial learning rate of 1 \(\times\) 10\({}^{-4}\). The batch size was set to 8 due to GPU memory constraints and the substantial image size. The autoencoder trained 300 epochs. Figure 11 shows the change in loss function and accuracy during training and testing. Train accuracy and train loss mean the change in training data; Val accuracy and Val loss mean the change in testing data, respectively, in the figures. As shown in the figures, as the training progresses, the value of the loss function gradually approaches 1 to 0. At the final epoch, the loss converges at 1.2% for the teaching data and 3.3% for the test data. The accuracy was 99.5% in the training data and 96.5% in the test data. Figure 11 shows images of the predicted weld pool along and off the weld line. As shown in Figure 12, it is clearly distinguished when the weld pool is along the weld path and when it is not.