# Predicting the External Corrosion Rate of Buried Pipelines Using a Novel Soft Modeling Technique
## 3 Results  
### PSO-ELM Model Training Results  
In the established prediction process, the four principal components obtained by the KPCA dimensionality reduction were applied as the training inputs in the PSO-ELM model. The network training data were normalized using the mapminmax() function of MATLAB. The inverse of this normalization was used, and the training was performed using the train() function. Multiple training iterations were performed while varying the number of neurons in the hidden layer of the ELM. By comparing the results, the optimal number of neurons in the hidden layer was determined to be 15. This configuration improved the performance of the PSO-ELM model for corrosion rate prediction. For this case, the ELM network structure was 4-15-1. The training obtained the best fitness value of 0.03856, with an R\({}^{2}\) value of 99.59%. The iterative error variation curve of the PSO-optimized ELM parameters is shown in Figure 9.  
Figure 9 shows that 17 iterations were required to achieve convergence at the minimum best adaptation value, indicating the best prediction performance. The PSO-optimized results were passed to the ELM algorithm to determine the input weights and hidden layer thresholds. It was then trained to obtain the optimized ELM model. The KPCA-PSO-ELM model used 12 randomly selected test data samples for the corrosion rate prediction. The results are shown in Table 4. As can be seen from the predictions in Figure 10, the KPCA-PSO-ELM model predictions were very close to the original data samples. Figure 11 shows the relative error curves between the measured values and the predicted values from the KPCA-PSO-ELM model for the 12 test samples. The first prediction had the smallest relative error of 1.94%. The eighth prediction had the largest relative error of 16.07%, but it was still within the acceptable range of 20% error. Therefore, the KPCA-PSO-ELM model has good generalization ability, high prediction accuracy, and ease of use. It can be effectively used for the prediction of corrosion rates of buried pipelines. Figure 9: Iterative error variation curves of PSO-optimized ELM parameters. Figure 11: Test set relative error. \begin{table}
\begin{tabular}{c c c c} \hline
**No.** & **Measured Value/mm \(\mathbf{a^{-1}}\)** & **KPCA-PSO-ELM Forecast Value/mm \(\mathbf{a^{-1}}\)** & **Relative Error (\%)** \\ \hline
1 & 0.103 & 0.101 & \(-1.94\) \\
2 & 0.076 & 0.084 & \(10.53\) \\
3 & 0.240 & 0.235 & \(-2.08\) \\
4 & 0.071 & 0.076 & \(7.04\) \\
5 & 0.058 & 0.062 & \(6.90\) \\
6 & 0.019 & 0.020 & \(5.26\) \\
7 & 0.204 & 0.200 & \(-1.96\) \\
8 & 0.056 & 0.065 & \(16.07\) \\
9 & 0.163 & 0.171 & \(4.91\) \\
10 & 0.034 & 0.035 & \(2.94\) \\
11 & 0.031 & 0.035 & \(12.90\) \\
12 & 0.143 & 0.149 & \(4.20\) \\ \hline \end{tabular}
\end{table} 
Table 4: Prediction results of KPCA-PSO-ELM model. Figure 10: Model prediction results. A correlation analysis was carried out to compare the predicted corrosion rates from the different ELM models (ELM, KPCA-ELM, PSO-ELM, KPCA-PSO-ELM) with the actual corrosion rates. The R\({}^{2}\) value indicates the degree of linear correlation between the predicted values of the measured model and the actual values. The results are shown in Figure 14. The black line represents the formula Y = X. The red line represents the fitted prediction result line. The R\({}^{2}\) values for ELM, KPCA-ELM, PSO-ELM, and KPCA-PSO-ELM were 0.8867, 0.9435, 0.9462, and 0.9959, respectively. The KPCA-PSO-ELM model had the highest R\({}^{2}\) value. This indicates that the model fits very well. However, since the R\({}^{2}\) value exceeded 99%, there may be a risk of overfitting. But the R\({}^{2}\) value does not reflect the accuracy of the model's predicted values. Therefore, we also need to consider other indicators, such as the standard deviation (SD) and mean square error (MSE) or root mean square error (RMSE), to evaluate the generalization ability of the model. The generalization ability refers to the model's ability to predict unknown data.