## 4 Convolutional Neural Network
### Regression CNN
#### 4.2.3 Results  
The coefficient of determination (i.e., \(R^{2}\)) is used to measure the accuracy of each parameter prediction (i.e., \(r_{p}\), \(d_{p}/t\), \(h\), and \(\phi\)), defined by the following equation.  
\[R^{2}=1-\frac{\sum_{i=1}^{N}{(Y_{true,i}-Y_{pred,i})^{2}}}{\sum_{i=1}^{N}{(Y_{ true,i}-\overline{Y}_{true})^{2}}} \tag{4}\]  
where \(Y_{true,i}\) and \(Y_{pred,i}\) represent the true and predicted values, respectively, of each predicted parameter for the \(i\)th (\(i=1\), \(2\),..., \(N\)) point in a given dataset containing \(N\) data points, and \(\overline{Y}_{true}\) denotes the true mean value of \(N\) data points associated with a predicted parameter. Table 5 summarizes the \(R^{2}\) values for the four parameters in the test dataset included in the regression model. The \(R^{2}\) values are also plotted in a so-called radar chart in Figure 11. The true values of the four parameters \(r_{p}\), \(d_{p}/t\), \(h\), and \(\phi\) compared with the estimated values by the CNN for the corroisons in the test set are depicted in Figure 12. It is evident from Table 5 that the CNN model's predictions of the corrosion location parameters (i.e., \(h\) and \(\phi\)) show strong agreement with the actual values, as reflected by the \(R^{2}\) values of 1.0 for all four corrosion categories. In terms of the size predictions (i.e., \(r_{p}\) and \(d_{p}/t\)), the model is more accurate for internal corroisons (P\({}_{\text{in}}\) and PIC\({}_{\text{in}}\)) than for external corroisons (P\({}_{\text{ex}}\) and PIC\({}_{\text{ex}}\)). These results also indicate that the performance of the model is better for cases containing pinholes only than for cases containing PIC. This is expected as PIC introduces additional complexity, including the presence of general corrosion, which may impact the model's accuracy. Overall, the obtained \(R^{2}\) values demonstrate the CNN model's accuracy in predicting the size parameters, with a higher accuracy observed for corroisons on the internal surface and pinholes. However, note that although the predictions for \(r_{p}\) and \(d_{p}/t\) are, in general, accurate, Figure 12 reveals relatively large error bands in both \(r_{p}\) and \(d_{p}/t\) predictions. For instance, the predicted values of \(r_{p}\) range from 1.14 mm to 3.45 mm for \((r_{p})_{true}\) equal to 2 mm. The large error bands may be explained by the small dimensions of the pinhole corrosion and the limited spatial resolution of the model. Furthermore, the presence of composite corrosion features can introduce additional complexities and uncertainties, leading to larger error bands in the predictions. Therefore, further investigation is required to explore the factors contributing to the reduction of regression errors for pinhole corroisons.  
Figure 10: Proposed CNN regression model structure.  
Figure 11: Radar chart for \(R^{2}\) of metrics (\(r_{p}\), \(d_{p}/t\), \(h\), and \(\phi\)) for \(\mathrm{P_{in}}\), \(\mathrm{P_{ex}}\), \(\mathrm{PIC_{in}}\), and \(\mathrm{PIC_{ex}}\) corro  
Figure 12: Comparison of true and predicted values of \(r_{p}\), \(d_{p}/t\), \(h\), and \(\phi\) for the anomalies in the regression test dataset without noise.  
\begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline \multirow{2}{*}{**Category No.**} & \multirow{2}{*}{**Category**} & \multicolumn{3}{c}{**Cases**} & \multicolumn{3}{c}{**Test \(R^{2}\)**} \\ \cline{3-10}  & & **Total** & **Train** & **Test** & \(r_{p}\) & \(d_{p}/t\) & \(h\) & \(\phi\) \\ \hline
0 & \(\mathrm{P_{in}}\) & 1600 & 1280 & 320 & 0.91 & 0.95 & 1.00 & 1.00 \\ \hline
1 & \(\mathrm{P_{ex}}\) & 1598 & 1277 & 321 & 0.88 & 0.92 & 1.00 & 1.00 \\ \hline
2 & \(\mathrm{PIC_{in}}\) & 1599 & 1280 & 319 & 0.89 & 0.85 & 1.00 & 1.00 \\ \hline
3 & \(\mathrm{PIC_{ex}}\) & 1598 & 1279 & 319 & 0.86 & 0.77 & 1.00 & 1.00 \\ \hline Overall & & 6395 & 5116 & 1279 & 0.89 & 0.91 & 1.00 & 1.00 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Results of the regression CNN model without noise.