# Integrated Image Processing Toolset for Tracking Direction of Metal Grain Deformation
## 4 Experimental Results
The model's bias and variance were assessed using four performance metric analyses: the coefficient of determination (R\({}^{2}\)), root mean square error (RMSE), mean absolute error (MAE), and residual value. As shown in Figure 11, the performance of the stitching algorithm using BLM exhibited encouraging results, and the regression model showed satisfying trends, with insignificant bias and variance and a relatively low variability in producing consistent predictions on four different dataset variations. The results indicate a good performance with a relatively high coefficient of determination that can be generalized for predicting the reliability of the future trends of the model. These results are supported by robust model's performance, which is indicated by the evaluation metrics. It was found that the RMSE of the stitching algorithm using BLM remained relatively low. From the eight models trained during the assessment, the highest and lowest RMSE values recorded by the model were 2.74 and 0.67 pixels on the 200-scope (\(y\)-axis) raw specimen and 50-scope (\(y\)-axis) weld specimen models, respectively. This is proportionately low compared to the input feature, which had \(1.2\times 10^{6}\) pixels on each image. The MAE performance exhibited maximum and minimum values of 1.95 and 0.42 pixels, respectively, with the same trend as the RMSE values. Globally, by analyzing models based on specimens, interesting results were obtained. The weld specimens tended to have a lower model bias and maintained an insignificant variability. This is reflected in the overall matrix, which indicated an escalating trend in the performance of the welding specimens. When these results were correlated with the previous analysis of the feature correlation heatmap, identical tendencies were recognized. As explained for the feature correlation maps, a smaller grain size, which explains the uniqueness of the feature input, tends to yield a better probability of detection. These results support the hypothesis that a higher detection probability provides a meaningful possibility for an algorithm to perform an accurate stitching process. Algorithm testing was continued by evaluating the performance of the grain image-matching algorithm based on f-NCC. In general, the algorithm showed promising results by successfully tracing the location of 200-scope images on stitched 50-scope images. The results exhibited equivalent grain shapes, qualitatively demonstrating the performance of the algorithm. To assess this results, image-intensity stacking analysis was performed (Figure 12). The idea was to stack the divergence of the image-intensity value from the base image (stitched 50-scope) to the target image (200-scope image) and vice versa to indicate missing parts in the image and allow us to assess the variety of intensity values in a more structural manner. The results showed that there was an excessive intensity leakage of the stitched 50-scope images, shown by the green channel, which dominated the intensity of the 200-scope image on the red channel. The reason was that on the same image scale and location, the 50-scope lens captured foggy and blurry images, causing the image to lose details of the grain, such as the holes and edges, and to provide overly intense values on the scratch and grain background. By stacking the divergence of the image-intensity values, the results remain clear. In a structural manner, the red and green channels exhibited identical trends at the grain boundary locations. It indicates that the algorithm successfully addressed the uncertainty of the intensity of the image and found the best matching location for the target images by addressing the problems of an invariant and dependent feature size [53; 55].