## 2 Research Methodology and Dataset
### Data Balancing and Augmentation  
The preprocessing of the dataset before feeding into the model required that the images be normalized from the (0-255) uint eight image type to a grey image within the (0-1) range. Data augmentation was applied to the training dataset to evaluate the effect of augmentation on the model's performance. The augmentation adopted for the AM1 and AM2 models is shown in Table 5. The images were translated about the X- and Y-axis within the range [\(-10\ 10\)] pixels, causing the dataset to increase 20 times. The augmentation basis was from studies conducted by [PERSON] et al. [45]. The AM1 and AM2 models are compared with themselves to see the effects of scale, rotation, and shear on the performance of the model and thereafter compared to the control model without augmentation. An unbalanced dataset describes a dataset in which the classes of the training dataset are not equally represented. The defective pixels in the dataset adopted in this study are relatively smaller than the sound pixels. The loss function used in most semantic segmentation tasks represents the overall accuracy that is inappropriate for an unbalanced training dataset. Therefore, an unbalanced dataset may influence the model's results and bias towards the dominant class and still give a favorably high overall accuracy. Figure 4 shows the pixel distribution of FRNB datasets adopted in this study. In addressing this bias in classification, the class weighting factors are introduced to create a balanced dataset. In this case, the inverse of class frequency is applied [46]. Class weighting effectively balances classes when there are underrepresented classes in the training data. In this study, the RD and MD models' defect-to-sound pixels ratio was 1:4 and 3:7, respectively (Figure 4). Similarly, the ratio of the defect-to-background-to-sound pixels is 2:3:5. The class weights in the classification layer for each class label, which is either one or none, were replaced with the inverse class frequency of the other class label. In balancing the RD dataset, the defected pixel class weight was replaced by the inverse of the class frequency of the sound pixels (1.33), while the sound pixel class weight was replaced by the inverse of the class frequency of the defected pixels (4.00). The total sum of the pixels remained the same. \begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multirow{2}{*}{**Preprocessing**} & \multirow{2}{*}{
\begin{tabular}{c} **Testing Bridge** \\ **Name** \\ \end{tabular} } & \multicolumn{2}{c}{**Model Type**} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ \cline{3-7}  & & **CM** & **AM1** & **AM2** & **BM** & **ABM** \\ \hline \multirow{6}{*}{MD} & FRNB & FN/M/D & FN/M/A & FN/M/A2 & FN/M/B & FN/M/AB \\ \cline{2-7}  & FRSB & FS/M/D & FS/M/A & FS/M/A2 & FS/M/B & FS/M/AB \\ \cline{2-7}  & PRMD & PM/M/D & PM/M/A & PM/M/A2 & PM/M/B & PM/M/AB \\ \cline{2-7}  & PRNB & PN/M/D & PN/M/A & PN/M/A2 & PN/M/B & PN/M/AB \\ \cline{2-7}  & PRSB & PS/M/D & PS/M/A & PS/M/A2 & PS/M/B & PS/M/AB \\ \hline \hline \end{tabular}
\end{table} 
Table 4: _Cont._ \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Parameter** & **Axis** & **AM1 Models** & **AM2 Models** \\ \hline Translation (pixels) & X & [\(-10\ 10\)] & [\(-10\ 10\)] \\ \hline Translation (pixels) & X & [\(-10\ 10\)] & [\(-10\ 10\)] \\ \hline Rotation (degrees) & & & [\(-20\ 20\)] \\ \hline Scale & X & & [\(10\ 10\)] \\ \hline Scale & Y & & [\(10\ 10\)] \\ \hline Shear & X & & [\(10\ 10\)] \\ \hline Shear & Y & & [\(10\ 10\)] \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Augmentation parameters for models. The images for each set of four (4) bridges set for training were split at every instance into five (5) k-folds and the fifth bridge was used for testing the model. Therefore, in every instance, 80% of the dataset for every four-bridge set is for the training and 20% for the validation set.