# Integrated Image Processing Toolset for Tracking Direction of Metal Grain Deformation
## 4 Experimental Results  
All the computation processes were performed using MATLAB R2021a software and several built-in program extensions, including a ground-truth labeler, image labeler, and image-processing toolbox to support the computation and testing processes. All of the training, testing, and analysis processes were performed using a Dell ALIENWARE PC with an Intel(r) Core(tm) i9-9900 HQ 3.6 GHz of CPU and 32 GB of RAM. The testing process was started by evaluating the proposed GD-HBT algorithm (\(k_{p}=3\)) using a confusion matrix of the prediction and ground-truth models, which were developed manually using a ground-truth labeler (Figure 8). In total, eight performance evaluation metrics were analyzed: the extraction accuracy using binarization accuracy, F1 score, area-under-curve (AUC), negative rate matrix (NRM), prediction balanced error rate (BER), peak signal-to-noise ratio (PSNR), distance reciprocal distortion (DRD), and misclassification penalty metric (MPM). Two variations of the dataset were performed: direct binarization on the raw image dataset and a dataset with CLAHE pre-processing. The analysis also included three existing image binarization algorithms: [PERSON]'s method [60], adaptive thresholding [61], and global thresholding. It was found that GD-HBT achieved promising results by improving all of the evaluation matrix scores compared with the existing algorithm. In addition to the accuracy, the harmonic mean of the model's sensitivity and specificity elucidated a convincing trend to validate the overall performance of the algorithm (Table 1). When dealing with smaller grain sizes on the weld dataset, the GD-HBT performance was relatively stable by maintaining the ratio of NRM, BER, DRD, and MPM at relatively optimum scores. This is essential because stitching processes using BLM can be improved along with the binarization performance. A robust binarization algorithm provides a valid feature input that potentially elevates the stitching accuracy. In terms of pre-processing, image binarization using CLAHE was found to perform better across all types of thresholding methods. This is the same trend as discussed in Section 1, where the image binarization preceded  
Figure 7: Visualization of implementation of Moore–Neighbor tracing algorithm with modification of the tracing termination using [PERSON]’s stopping criteria for grain boundary extraction. by pre-processing promotes a relatively higher extraction performance by enhancing the image's clarity [26]. A comparison of the binarization image results and confusion matrix analysis of each method can be found in Figures S7-S9. Several positive experimental results were obtained by successfully stitching the micrograph image from raw and weld specimens. The algorithm stitched 190 images, with the required times of 204 and 213 min on the raw and weld datasets (\(nC_{y}=500\)), respectively (Figure 9). Additionally, the algorithm exhibited promising computational speeds of 67.44 \(\pm\) 0.51 s/iteration and 70.34 \(\pm\) 0.58 s/iteration on the raw and weld datasets, respectively, and there was no indication of a performance drop during training because a constant variance was maintained with a deviation of less than 0.60 s [46; 47]. Qualitatively, the final stitched image appeared to yield promising results by recognizing the grain pattern. The connection of each image at the edge indicated an appropriate overlap point, reflecting the performance of the BLM algorithm as the kernel. The shape of the entire stitched image described the original condition of the specimen by retaining the actual size of the specimen as qualitative evidence of the algorithm's performance. The results were especially clear for the weld dataset, where the distinction of the grain variation on the base and weld area was visibly stitched (see Figure 9b). The welding pattern was easily recognized, and by zooming in on the transition area of the original grain and welded grain, the overlapping point was visible with the expected trend.