# Prediction of Corroded Pipeline Failure Pressure Based on Empirical Knowledge and Machine Learning
## 4 Result and Discussion
From the average error values shown in Figure 4, it can be observed that overall, the third model outperforms the first two models. The prediction errors of the first model are slightly higher than those of the third model. However, the second model has some samples with significant deviations from the actual values, which is the primary reason for its higher prediction errors compared to the first model. This is attributed to the second model's direct use of an imprecise empirical formula to calculate the results and compute the loss, making it more sensitive to changes in corrosion defect sizes and less adaptable to various defect scenarios. In contrast, the third model employs an improved empirical formula as part of the loss function calculation, enhancing its adaptability to different defect conditions. Next, this study compares the prediction results and their errors among samples across three models. Figure 5 presents the prediction results of different models on each sample in the validation set. Specifically, Figure 5a provides an intuitive comparison of the deviations between predicted and actual values by plotting the predicted values against the true values. The coefficient of determination (\(R^{2}\)) for each model is indicated in the legend. Meanwhile, Figure 5b visually illustrates the positive and negative deviations of the prediction results for each sample. Table 2 lists the numerical deviations of prediction results for each sample across the models. From Figure 5a, it is evident that the third model achieves the highest coefficient of determination (\(R^{2}\) = 0.9886), followed by the first model (\(R^{2}\) = 0.9589), which is slightly higher than the second model (\(R^{2}\) = 0.9400). Table 2 reveals that the second model exhibits significantly smaller errors in predicting the failure pressures of samples 1, 2, 4, and 9, while its predictions for samples 3 and 10 are notably larger. This trend is similar to the deviations observed when using the empirical formula DNV RP-F101 for failure pressure prediction. This suggests that the direct incorporation of empirical-formula-calculated failure pressures into the loss function (second model) may cause the model to overfit to defect scenarios that align with the empirical formula,  
Figure 3: The loss of different models various with iterations. (**a**) is the training process while (**b**) is the validation process. while increasing the deviations for other cases. In contrast, the model trained with the improved loss function (third model) shows a significant improvement in overfitting. This third model exhibits stronger adaptability to various defect scenarios, thereby providing more accurate and robust predictions across the validation set. Figure 4: Statistical results of predictions by different models on the validation set. (**a**) shows the absolute percentage error of different models, (**b**) shows the absolute error of different models, and (**c**) shows the square error. The numbers above the bars represent the average error across all samples, with the corresponding values in parentheses indicating the standard deviation.