Abstract
Predicting the progression of external corrosion from historical in-line inspection (ILI) data supports risk-based pipeline integrity management. However, multi-kilometer odometry drift, the absence of persistent feature identifiers across runs, and unmonitored environmental variability pose major challenges for empirical modeling. This study presents a spatio-temporal framework combining girth-weld spatial normalization and circular density-based clustering (DBSCAN) with a two-layer Gated Recurrent Unit (GRU) network to reconstruct and forecast multi-campaign corrosion trajectories across persistent, unrepaired anomalies. Evaluated on an independent test set () spanning four inspection runs (Years 1, 3, 5, and 7), the proposed GRU model achieved strong continuous accuracy (, , ), operating well within High-Resolution Magnetic Flux Leakage (HR-MFL) sizing tolerances (). Five-fold cross-validation confirms robust generalization, while GRU matches Long Short-Term Memory (LSTM) accuracy with a smaller parameter footprint and maintains performance across irregular inspection intervals () via explicit time-delta encoding. Furthermore, an asymmetric Mean Squared Error (MSE) loss function () reduces critical out-of-tolerance under-predictions by , while soft monotonicity regularization lowers physical trajectory violations without introducing positive bias. These results establish an efficient, risk-sensitive solution for pipeline degradation forecasting without auxiliary environmental profiling.
1. Introduction
Oil and gas pipelines constitute critical infrastructure for energy transportation, and maintaining their structural integrity is essential for operational safety, environmental protection, and economic sustainability. Among the degradation mechanisms affecting pipeline systems, external corrosion is a major contributor to material deterioration and failure [1,2,3]. The progressive loss of wall material can lead to leakage, rupture, and, in severe cases, catastrophic failure. Consequently, predicting the progression of corrosion is an important component of pipeline integrity management, particularly for supporting inspection planning and risk-based maintenance decisions [1,2].
Traditional approaches to corrosion prediction include physical, electrochemical, and statistical models. Physical and mechanistic models attempt to describe corrosion processes using chemical, thermodynamic, and transport phenomena, but their application generally requires detailed environmental and operational information and may involve substantial modeling complexity [1,2]. Statistical approaches, including linear regression, ARMA, ARIMA, Grey models, Kalman filtering, and Markov chains, provide relatively simple predictive formulations [4,5,6]. However, their ability to represent nonlinear degradation processes and complex long-term temporal dependencies may be limited [4,5].
The increasing availability of in-line inspection (ILI) and historical inspection data has encouraged the development of data-driven approaches for pipeline corrosion assessment. Machine learning and deep learning techniques have been investigated using artificial neural networks, gradient boosting, hybrid finite-element and neural-network models, and transfer-learning architectures [3,7,8,9,10]. These approaches have demonstrated the potential of data-driven modeling for corrosion prediction. Nevertheless, several limitations remain. Many existing approaches depend on environmental and operational variables, including temperature, pressure, CO2 partial pressure, H2S concentration, pH, and flow velocity [11,12,13]. Obtaining such measurements continuously and consistently along long-distance pipelines can be technically and economically demanding. While these environmental and operational parameters directly influence corrosion kinetics, continuous high-resolution profiling across multi-kilometer buried assets is rarely accessible in legacy operator databases. To overcome this limitation, data-driven frameworks must leverage multi-campaign ILI sequences to capture historical growth trajectories, which implicitly reflect the cumulative severity of localized environmental aggressors without requiring explicit environmental monitoring inputs. Other approaches rely on simulation-generated data or highly specific case studies, which may limit their applicability to inspection-driven integrity management [14,15,16]. More complex hybrid architectures can also increase computational requirements while requiring structured multi-source information.
An additional and less explored challenge arises from the temporal organization of historical inspection data themselves. Repeated inspection campaigns provide spatially distributed measurements of corrosion features at different points in time; however, observations recorded in different campaigns do not necessarily contain an explicit persistent identifier indicating that they correspond to the same physical corrosion feature. Furthermore, multi-kilometer odometry drift across consecutive inspection runs complicates spatial alignment when relying solely on absolute distance logs [17,18]. Consequently, the direct use of such observations in a temporal learning model is not straightforward. Before temporal dependencies can be learned, observations from successive inspection campaigns must first be spatially associated using a robust girth-weld referencing system—resetting odometry errors at individual pipe joints—so that the evolution of individual corrosion features can be reconstructed. This data-association problem is particularly important when the objective is to forecast corrosion progression from historical inspection measurements rather than from continuously monitored environmental variables [19].
This study addresses this problem by formulating corrosion progression prediction as a two-stage data-driven process: temporal trajectory reconstruction followed by sequential degradation modeling [17,19]. First, spatial coordinates are normalized relative to upstream girth welds to eliminate cumulative odometry drift, confining spatial discrepancies strictly within single pipe joints. A density-based spatial clustering procedure based on DBSCAN is then applied to the spatial characteristics of corrosion observations to identify groups of observations that can be associated across successive inspection campaigns. Clusters containing observations from the considered inspection years are used to establish correspondence between corrosion features and assign them to individual temporal trajectories. This procedure transforms spatially distributed inspection observations without explicit cross-inspection identifiers into structured temporal sequences describing the evolution of corrosion features over time. The resulting sequences provide the input representation for the subsequent temporal learning stage.
In the second stage, a Gated Recurrent Unit (GRU) network is employed to learn temporal patterns contained in reconstructed trajectories and predict future corrosion depth. Following systematic comparative evaluation against alternative architectures—including Bidirectional LSTM (BiLSTM), Standard unidirectional LSTM, Random Forest (RF), and Gradient Boosting Regressor (GBR)—the unidirectional GRU was selected as it best models forward temporal progression while maintaining a streamlined parameter footprint ( parameters) [20,21,22,23]. Unlike static tabular regressors (e.g., GBR, Random Forest) that require fixed input dimensions, the recurrent GRU framework naturally scales to extended sequence histories () and irregular multi-year inspection intervals () via explicit time-delta encodings (), which we empirically validate under simulated irregular inspection gaps. Furthermore, to address safety-critical integrity management requirements without obscuring operational trade-offs, we evaluate asymmetric loss weighting () across a full Pareto sensitivity frontier and compare soft monotonicity regularization () against hard post-processing constraints.
The research contribution of this work lies primarily in the integration of spatial feature association, risk-sensitive temporal learning, and multi-model benchmarking into a unified pipeline-inspection-based forecasting framework. The main contributions are summarized as follows:
- A girth-weld spatial normalization and circular DBSCAN-based spatial association procedure is employed to establish correspondence between corrosion observations obtained from successive inspection campaigns in the absence of explicit cross-inspection feature identifiers and in the presence of multi-run odometry drift.
- An explicit definition of operational applicability boundaries—supported by trajectory attrition tracking across inspection campaigns—delineating model scope to persistent, un-repaired corrosion anomalies observed across consecutive ILI runs ( matched trajectories), whose growth sequences implicitly proxy localized environmental aggressors.
- A rigorous multi-model evaluation combining held-out testing and 5-fold cross-validation across machine learning and deep learning architectures, distinguishing statistical consistency from practical engineering equivalence relative to HR-MFL sizing tolerances () while demonstrating the parameter efficiency ( smaller footprint than LSTM) and irregular-interval scalability () of the unidirectional GRU.
- A risk-oriented analysis of corrosion forecasts comprising depth-stratified error profiling relative to HR-MFL sizing tolerances, a Pareto trade-off evaluation of asymmetric loss weighting (), and a systematic comparison between soft monotonicity regularization during training and hard post-processing constraints.
The remainder of this paper is organized as follows. Section 2 presents the principal corrosion mechanisms relevant to oil and gas pipelines. Section 3 reviews temporal modeling techniques. Section 4 discusses related work on data-driven corrosion prediction. Section 5 describes the proposed methodology, including spatial feature association and temporal sequence construction. Section 6 presents the experimental results and discussion. Finally, Section 7 concludes the paper and outlines directions for future research.
2. Physical Basis and Operational Proxy for Corrosion Progression
Understanding the physical nature of external pipeline degradation is essential for justifying a purely inspection-driven forecasting framework. In oil and gas infrastructure, degradation is primarily driven by localized processes such as pitting corrosion and sweet () corrosion [7,11]. These phenomena are governed by complex electrochemical reactions, electrolyte transport kinetics, and localized environmental aggressors (e.g., soil resistivity, moisture content, pH, and fluid flow regimes) [12,13].
However, continuous spatial-temporal profiling of such environmental covariates across multi-kilometer buried pipelines is technically and economically prohibitive in legacy operational databases. To overcome this limitation without sacrificing physical plausibility, the proposed framework leverages multi-campaign In-Line Inspection (ILI) historical sequences as an empirical functional proxy.
Because site-specific environmental aggressiveness directly drives defect propagation rates, historical physical degradation trajectories (e.g., sequential pit depth measurements over time) inherently encode the net cumulative severity of unobserved localized environmental conditions. Tracking these historical physical features over consecutive ILI runs enables the Standard GRU network to implicitly learn site-specific degradation kinetics, providing accurate future corrosion forecasts () without requiring explicit environmental or electrochemical covariates.
3. Temporal Modeling Techniques
Temporal models are a category of predictive models specifically designed to handle data that evolves over time or follows a sequence. These models are essential for tasks where observations are not independent, but rather, the data points are interdependent based on their position in time or sequence. Temporal data is widely encountered in numerous fields such as finance, healthcare, energy systems, environmental studies, and predictive maintenance, among others.
3.1. Long Short-Term Memory Networks (LSTM)
Long Short-Term Memory (LSTM) is a widely used type of Recurrent Neural Network (RNN), originally introduced by Sepp Hochreiter and Jürgen Schmidhuber [21]. Unlike traditional RNNs, LSTMs are specifically designed to capture long-range dependencies in sequential data. They can effectively handle both single and multiple input sequences simultaneously. By incorporating memory cells and gating mechanisms, LSTMs mitigate common issues such as the vanishing gradient problem encountered during backpropagation in standard neural networks.
As illustrated in Figure 1, the LSTM block is primarily composed of a memory cell state, a forget gate, an input gate, and an output gate. The input gate regulates the flow of information into the memory cell, while the forget gate determines which information is discarded from the cell. The output gate controls the information passed from the memory cell to the output.
Figure 1.
Long Short-Term Memory Network Unit.
The operations of the LSTM neural network at time step t are carried out as follows:
- Forget gate: This gate determines which information from the previous cell state should be retained or discarded. It takes as input the current input and the previous hidden state , and applies a sigmoid activation to produce a value between 0 and 1 for each component of the cell state:where is the forget gate activation vector at time step t, denotes the logistic sigmoid activation function, is the weight matrix, is the hidden state from time step , is the input vector at time step t, and is the bias vector.
- Input gate and cell state update: The input gate is responsible for adding new information to the cell state. It first applies a sigmoid function to determine which parts of the new input to remember:Simultaneously, a vector of candidate values is created using the tanh activation function:The new cell state is then updated by combining the retained information from the previous cell state and the newly computed candidate values:where:
- is the input gate activation vector,
- is the candidate cell state,
- is the updated cell state,
- ⊙ denotes element-wise (Hadamard) multiplication,
- tanh is the hyperbolic tangent activation function.
- Output gate: This gate is responsible for generating the output of the LSTM unit based on the updated cell state. First, the cell state is passed through a tanh activation to produce a filtered version. Then, a sigmoid function determines which parts of this filtered state should be output:Finally, the output hidden state is computed as:where:
- is the output gate activation vector,
- is the hidden state passed to the next time step,
- , are the weight matrix and bias for the output gate,
- ⊙ denotes element-wise multiplication.
LSTMs have demonstrated strong performance in various time-series forecasting and sequential prediction tasks due to their ability to model long-term temporal dependencies. In applications where degradation processes evolve progressively over time, such as corrosion growth prediction, LSTMs are particularly suitable because they can learn nonlinear temporal patterns without requiring explicit physical modeling. However, their computational complexity and training time may increase with sequence length and network depth.
3.2. Gated Recurrent Unit (GRU)
The Gated Recurrent Unit (GRU) is a simplified variant of the LSTM architecture, introduced to reduce model complexity while maintaining the ability to capture long-term dependencies [22]. Unlike LSTM, GRU combines the forget and input gates into a single update gate and merges the cell state and hidden state.
Figure 2 presents the architecture of the GRU network. This network structure is built around two principal gating mechanisms: the reset gate and the update gate.
Figure 2.
Gated Recurrent Unit (GRU) Architecture.
The reset gate regulates how the new input is combined with the previously stored hidden state information when computing the candidate activation. In other words, it determines the extent to which past information is forgotten.
The update gate controls how much of the previous hidden state is retained and carried forward to the current output. It decides which portion of the historical information should be preserved and transmitted to the new hidden state.
The mathematical formulation of GRU at time step t is given by:
GRUs generally require fewer parameters than LSTMs, leading to faster training while often achieving comparable performance in many time-series applications.
3.3. Bidirectional LSTM (BiLSTM)
Bidirectional Long Short-Term Memory (BiLSTM) is an extension of the conventional Long Short-Term Memory (LSTM) network. While traditional LSTM models process sequences in a single direction (usually forward in time), BiLSTM simultaneously processes sequences in both forward and backward directions. This bidirectional approach enables the network to capture information from both past and future contexts, resulting in richer contextual representations. Consequently, BiLSTM is particularly effective for tasks that require understanding the full sequential context, such as time-series prediction, natural language processing, and sequence labeling [23].
The general architecture of a BiLSTM unfolded over three time steps is illustrated in Figure 3. During training, the BiLSTM computes two hidden sequences: the forward hidden sequence and the backward hidden sequence , which are then combined to produce the output sequence y. The forward layer iterates from time to , while the backward layer iterates from to [24]. The forward, backward, and output sequences are calculated as follows:
Figure 3.
The general architecture of the Bidirectional LSTM (BiLSTM).
This bidirectional structure allows the recurrent network to model temporal dynamics more effectively by leveraging both forward and backward contextual information.
4. Related Work
Recent advances in corrosion prediction for oil and gas pipelines have increasingly relied on machine learning (ML) and deep learning (DL) techniques to address the nonlinear and multivariate nature of degradation processes. Existing studies have explored a variety of predictive models and data sources, ranging from environmental and geospatial information to inspection measurements, simulated data, and hybrid representations.
Mazzella et al. [15] investigated underground pipeline corrosion growth using inspection data combined with extensive geospatial and environmental information. Their study evaluated generalized linear models, extreme gradient boosting, and neural networks, demonstrating accurate corrosion growth estimation across multiple locations. However, the framework depends heavily on the availability and quality of environmental and interpolated geospatial data. Such information may not be consistently accessible along long-distance pipeline systems, particularly when historical inspection records constitute the most reliable source of degradation information.
Chin et al. [8] developed an Artificial Neural Network (ANN) model to predict failure pressure in pipelines affected by single corrosion defects. The results demonstrated the ability of neural networks to model nonlinear relationships between corrosion characteristics and structural integrity. Nevertheless, the study focused primarily on defect-based failure assessment rather than the temporal evolution of corrosion features across successive inspection campaigns.
Lo et al. [9] proposed a hybrid finite element method (FEM)–ANN framework in which FEM simulations were used to generate training data for predicting pipeline behavior under combined loading conditions. Although the hybrid approach improved prediction accuracy and reduced conservatism compared with standard guidelines, its predictive capability depends on the assumptions embedded in the FEM simulations and the selected failure criteria. Moreover, simulation-based approaches do not directly address the reconstruction of corrosion evolution from repeated field inspection observations.
Udonsek et al. [16] performed a corrosion-based integrity assessment for an offshore pipeline project by integrating established analytical formulations with experimental burst-test data. The model achieved high predictive performance (); however, the evaluation was conducted for a specific case study, which may limit its generalization to different pipeline systems and inspection conditions.
More recently, Long et al. [10] introduced a transfer-learning framework based on a CNN–LSTM–Transformer architecture to address small-sample corrosion prediction scenarios. Their staged fine-tuning strategy demonstrated strong predictive accuracy and improved generalization capability. However, the hybrid architecture introduces additional computational complexity and relies on structured multi-source input data. More importantly, these approaches primarily focus on learning predictive relationships from already structured samples rather than addressing how temporally corresponding corrosion observations can be established from successive inspection campaigns.
4.1. Recent Advances in Graph-Based and Attention-Driven Degradation Modeling
In broader industrial degradation analysis and structural health monitoring, recent literature has increasingly adopted advanced spatial-temporal modeling paradigms beyond standard recurrent neural networks. Graph Neural Networks (GNNs) and Spatio-Temporal Graph Convolutional Networks (ST-GCNs) have emerged as powerful tools for modeling non-Euclidean spatial relationships and dynamic topological interdependencies across interconnected components [25,26]. Concurrently, Attention mechanisms and Transformer-based architectures have revolutionized time-series trajectory tracking by dynamically weighting long-range temporal dependencies and filtering transient measurement noise [3]. In systems with high-density sensor arrays or continuous operational logging, hybrid Graph-Attention networks have demonstrated state-of-the-art capability in capturing complex spatial kinetics alongside non-linear degradation progression.
Despite their theoretical strength in continuous sensor environments, applying advanced graph-based or attention-driven trajectory architectures to pipeline external corrosion forecasting encounters fundamental operational constraints. First, multi-campaign In-Line Inspection (ILI) datasets do not possess a fixed, continuous spatial network topology; rather, localized pitting defects initiate, propagate, or coalesce dynamically across discrete pipe joints over multi-year intervals. Second, multi-kilometer odometry drift across consecutive inspection runs breaks the spatial node consistency required to construct valid GNN adjacency matrices. Third, Transformer architectures generally require extensive temporal sequence lengths () to effectively optimize self-attention weights without overfitting, whereas field ILI histories are characteristically sparse short-sequence records (typically or 4 historical campaigns). Consequently, over-parameterized graph or attention blocks risk severe overfitting on short-horizon ILI data while failing to resolve underlying spatial alignment errors.
4.2. The Spatial Association Bottleneck
Despite these computational advances, an important methodological issue remains insufficiently addressed. Historical pipeline inspection campaigns generally provide spatially distributed corrosion observations at different inspection times, but observations from successive campaigns may not contain explicit identifiers linking measurements to the same physical corrosion feature. Consequently, before any temporal learning model can be applied, the observations must first be spatially associated and organized into sequences representing the evolution of individual corrosion features. This distinction is important because temporal deep learning assumes that the input sequence represents a meaningful temporal trajectory; simply arranging measurements according to inspection year does not guarantee that the observations correspond to the same physical defect.
Existing corrosion prediction studies have largely concentrated on improving the predictive model itself, incorporating additional environmental variables, increasing model complexity, or exploiting simulated and project-specific data. Comparatively less attention has been given to the preceding data-structuring problem of automatically reconstructing temporal corrosion trajectories from spatially distributed inspection observations. This motivates the development of a framework in which spatial association and temporal modeling are treated as complementary stages: corrosion observations are first associated across inspection campaigns using density-based spatial clustering, and the resulting trajectories are subsequently modeled using a temporal deep learning architecture. In this study, circular DBSCAN is used for the spatial association stage, while a 2-layer unidirectional Standard GRU network serves as the temporal learning component. The methodological contribution therefore lies not in the use of GRU alone, but in the integration of spatial feature association, multi-model benchmarking, and temporal trajectory construction to transform raw inspection observations into structured samples for robust corrosion progression forecasting.
5. Methodology
5.1. Overview of the Proposed Framework
The proposed framework addresses the prediction of external corrosion progression from multi-temporal In-Line Inspection (ILI) data across consecutive campaigns (). The overall methodology is formulated as an end-to-end two-stage framework: (1) spatial normalization, grid-based tolerance calibration, and cross-campaign defect trajectory reconstruction via DBSCAN and Hungarian assignment, followed by (2) multi-model temporal degradation benchmarking and forecasting using a Gated Recurrent Unit (GRU) network.
As illustrated in Figure 4, the proposed framework consists of three main operational stages:
Figure 4.
Workflow of the proposed spatial-temporal Standard GRU-based corrosion prediction framework, detailing the spatial matching and trajectory reconstruction pipeline (Step 1), the 2-layer unidirectional GRU architecture and multi-model benchmarking (Step 2), and depth-stratified evaluation against High-Resolution MFL vendor tolerance limits (Step 3).
- Data Preparation and Spatial Trajectory Reconstruction (Step 01): Transforms raw multi-temporal ILI records into persistent trajectories via four sequential verification steps:
- Relative Axial Referencing: Girth-weld axial referencing (SIPRD.m) relative to upstream joints (GWNUM) to systematically eliminate multi-kilometer odometry drift.
- Spatial Tolerance Calibration: Empirical optimization establishing calibrated spatial matching bounds (, ) to accommodate tool positioning noise.
- Deterministic Feature Matching: Circular DBSCAN clustering followed by global cost minimization via the Hungarian (Kuhn-Munkres) algorithm to resolve localized candidate ambiguity.
- Quality Control & Pre-filtering: Vendor pre-filtering of pig speed excursions () to guarantee cross-campaign measurement comparability.
- Standard GRU Model Development & Multi-Model Benchmarking (Step 02):Inputs reconstructed longitudinal depth sequence tensors () into a 2-layer unidirectional Standard GRU network (39,937 parameters) designed to capture forward temporal degradation kinetics. This stage incorporates systematic benchmarking against alternative recurrent (Standard LSTM, BiLSTM) and tree-based ensemble models (Random Forest, Gradient Boosting).
- Model Evaluation and Industrial Validation (Step 03): Evaluates predictive performance on the independent test set () using MAE, RMSE, and metrics, complemented by depth-stratified residual error analysis against High-Resolution MFL vendor tolerance bounds (/).
5.2. Data Preparation and Feature Engineering
The first stage of the proposed framework focuses on transforming raw multi-temporal In-Line Inspection (ILI) datasets into structured temporal trajectories suitable for temporal learning models [19]. Because observations acquired across different inspection campaigns lack persistent cross-inspection identifiers, raw data must first be pre-filtered, statistically evaluated for feature redundancy, spatially associated, and reorganized into temporal sequences.
The data preparation procedure consists of five sequential operations: (i) multi-temporal dataset aggregation and quality pre-filtering, (ii) exploratory correlation analysis, (iii) feature selection and final spatial-temporal representation, (iv) spatial matching and trajectory verification, and (v) construction and normalization of input temporal sequences.
5.2.1. Multi-Temporal ILI Dataset and Data Quality Filtering
The raw dataset comprises ILI observations collected across four historical inspection campaigns, designated as Years 1, 3, 5, and 7. Each inspection log provides spatial location coordinates and geometric defect measurements recorded by Magnetic Flux Leakage (MFL) and Ultrasonic Testing (UT) tools.
An important operational factor influencing ILI data quality is pig velocity during data acquisition. Velocity fluctuations—caused by pressure variations, flow dynamics, or local friction at pipe bends—affect wall magnetic saturation in MFL sensors. As standard in commercial ILI vendor reporting, raw inspection logs were pre-filtered at data acquisition to ensure tool velocities remained within the optimal sensing window (). Residual depth variations stemming from localized velocity noise and inherent tool depth-sizing tolerances () within this operating window are subsequently smoothed by the unidirectional Standard GRU architecture, which implicitly filters transient measurement errors across multi-campaign trajectories.
In addition to velocity pre-filtering, raw multi-campaign ILI logs present inconsistencies in attribute availability. Certain positional and orientation parameters are absent in specific inspection years due to evolving vendor sensing technologies and reporting formats. For instance, seam weld orientation (SO.deg) was not reported during Year 3, while endpoint distance (EPD.m) is missing in Year 5. Attributes with incomplete multi-year records were flagged for exclusion during feature selection to guarantee consistent temporal coverage.
5.2.2. Exploratory Correlation Analysis
Before establishing the final feature space and performing spatial matching, statistical relationships among all candidate ILI variables were evaluated independently for Years 1, 3, 5, and 7. The resulting campaign-specific correlation matrices are presented in Figure 5. The primary objective was to detect collinear spatial descriptors and evaluate structural geometric redundancies across historical inspection runs.
Figure 5.
Correlation matrices across the four analyzed inspection campaigns: (a) Year 1 (), (b) Year 3 (), (c) Year 5 (), and (d) Year 7 ().
Across all four campaigns, a perfect positive correlation () was observed between absolute pipe distance (SPD.m) and girth weld index (GWNUM). This confirms extreme spatial redundancy between global absolute distance and localized weld referencing. Similarly, circumferential positional metrics—including start position (SPO.deg), end position (EPO.deg), and midpoint position (SIPO.deg)—exhibited strong inter-variable correlations consistently ranging from to .
Regarding corrosion geometry, defect length (L.mm) and width (W.mm) demonstrated persistent strong positive associations across campaigns, with correlation coefficients of 0.73, 0.75, 0.73, and 0.70 for Years 1, 3, 5, and 7, respectively. Maximum depth measurements (MD) displayed moderate structural dependency on defect length (ranging from to ) and weak dependency on defect width (ranging from to ).
5.2.3. Feature Selection and Final Spatial-Temporal Representation
Guided by the correlation findings and multi-campaign data availability constraints, a minimal yet complete feature representation was formulated. Redundant spatial descriptors identified in Section 5.2.2 were eliminated to prevent overfitting and high-dimensional noise during spatial clustering.
Specifically, absolute pipe length (SPD.m) was discarded in favor of joint-specific relative longitudinal distance (SIPRD), effectively resetting cumulative odometry drift at individual girth welds (GWNUM). Similarly, circumferential descriptors were consolidated into a single midpoint orientation angle (SIPO). Geometric parameters (L, W, MD) were retained to track physical defect progression.
Table 1 summarizes the final selected ILI variables and their explicit functional roles within the framework.
Table 1.
Selected ILI variables and their roles in the framework.
5.2.4. Spatial Matching and Temporal Tracking of Corrosion Features
Following data preprocessing and feature selection, a spatial matching procedure is applied to identify corrosion observations corresponding to the same physical feature across different inspection campaigns. The need for this procedure arises from the absence of a persistent corrosion identifier in raw inspection logs. Therefore, spatial proximity within individual pipe joints is leveraged to establish correspondence between multi-temporal observations.
Theoretical Basis and Spatial Metric Formulation
Feature association across multi-temporal inspection runs is modeled as a spatial density clustering problem. Standard centroid-based partitioning algorithms (such as K-Means) are unsuitable because the total number of unique physical corrosion defects is unknown a priori. DBSCAN (Density-Based Spatial Clustering of Applications with Noise) is uniquely suited for this task as it groups observations based on local spatial density without requiring a predefined cluster count, while explicitly modeling isolated false signatures as noise.
Each corrosion anomaly is characterized by three main attributes: the girth weld number (GWNUM), the relative axial distance z (SIPRD, in meters) from the upstream weld center, and the circumferential orientation (SIPO, in degrees). To prevent feature misassociation across the top-of-pipe seam boundary, DBSCAN is executed independently within each weld segment using a normalized circular distance metric defined as:
where computes the shortest angular distance along the pipe wall. Evaluating this normalized metric with a DBSCAN radius parameter of explicitly defines an elliptical search region centered around each feature, where the axial and circumferential semi-axes strictly correspond to the tool location scaling factors and . These tolerances were selected based on high-resolution MFL/UT tool location specifications defined in API Standard 1163 [17] and POF guidelines [18]. We set during clustering to allow complete candidate trajectories to form across inspection runs without density restrictions.
Subsequently, a temporal validity filter is applied: candidate clusters are validated and assigned a persistent trajectory identifier (corrosion_id) only if they contain valid feature entries across all four inspection years (). Requiring a complete 4-year history explicitly isolates active, un-repaired corrosion features while filtering out repaired defects, post-Year 1 feature initiations, and transient sensor detection noise.
Quantitative Validation via Semi-Synthetic Ground-Truth Injection
Because publicly available in-line inspection datasets—including the benchmark dataset by Yarveisy et al. [19]—lack annotated physical ground-truth correspondences, spatial proximity alone cannot strictly guarantee the absence of misassociations between closely spaced adjacent pits. To quantitatively evaluate trajectory recovery performance, a semi-synthetic benchmark experiment was established by injecting synthetic 4-year corrosion trajectories (4000 total observations) into the inspection space.
Subsequent observations across Years 3, 5, and 7 were simulated by incorporating operational positional measurement errors modeled after industry standards [17,18]:
where and represent standard operational odometer drift and sensor rotation variances. Physical depth progression was modeled using a realistic linear growth rate , where % WT/year and % WT.
Because ground-truth trajectory identifiers were known a priori, matching accuracy was evaluated against the Global Hungarian Linear Sum Assignment (LSA) algorithm applied frame-by-frame () [27]. In addition to standard Precision, Recall, and -score, structural grouping accuracy was evaluated using two clustering-native agreement metrics:
- Adjusted Rand Index (ARI): Measures the proportion of correctly matched observation pairs across campaigns while correcting for chance agreement ( indicates perfect pair matching).
- Adjusted Mutual Information (AMI): Quantifies the shared information content between predicted clusters and ground-truth trajectories normalized against random chance ( indicates perfect structural identity).
Table 2 summarizes the performance comparison.
Table 2.
Quantitative matching performance on the semi-synthetic benchmark dataset (1000 ground-truth trajectories across 4 inspection campaigns).
As detailed in Table 2, the proposed circular DBSCAN pipeline achieved a high trajectory retrieval precision of and recall of (), outperforming the frame-by-frame Hungarian baseline (). High values for both the Adjusted Rand Index () and Adjusted Mutual Information () confirm that of observation pairs were correctly linked and that the resulting clusters preserve over of the true underlying temporal information structure without misassociating neighboring defects.
Figure 6 illustrates the spatial distribution and temporal trajectory alignment of corrosion features for a representative girth weld segment (GWNUM = 67) before and after matching across the four inspection campaigns.
Figure 6.
Spatial clustering and trajectory matching of multi-temporal corrosion features for GWNUM = 67: (a) Distribution of raw, unlinked corrosion observations across four inspection campaigns (), color-coded by inspection year; (b) Validated 4-year corrosion trajectories post Circular DBSCAN matching, illustrating feature spatial continuity across inspection runs with uniform marker scaling and unique trajectory identifiers (ID) assigned per defect cluster.
This spatial coordinate grouping provides a robust, physically grounded framework for linking multi-temporal inspection observations prior to depth forecasting. Applying this spatial clustering and temporal verification pipeline across the entire field dataset successfully identified 9353 unique, persistent corrosion feature trajectories tracked consistently across all four inspection campaigns (Years 1, 3, 5, and 7).
5.2.5. Temporal Sequence Construction
Following the spatial matching and trajectory validation stages (illustrated in Figure 6b), each verified corrosion trajectory spanning four inspection campaigns (Years 1, 3, 5, and 7) is formulated as a supervised sequence modeling sample for the unidirectional Standard GRU architecture. Specifically, three chronologically ordered historical observations (Years 1, 3, and 5) form an input sequence of length , while the corresponding Year 7 measurement serves as the ground-truth prediction target. This formulation enables the temporal model to capture the underlying degradation kinetics of corrosion progression rather than treating individual inspection measurements as independent samples.
To maintain numerical stability during backpropagation through time and prevent data leakage across inspection campaigns, feature standardization (StandardScaler, scikit-learn v1.6.1) was fitted exclusively on the training subset () and subsequently applied to transform the validation and test splits:
Standardized input sequence tensors are processed in mini-batches via PyTorch (v2.5.1) DataLoader instances, while predicted scaled depth values () are mapped back to absolute physical depth measurements in millimeters via inverse transformation ().
5.3. Operational Assumptions and Verification
To ensure the rigorous application of the proposed spatial-temporal framework to multi-campaign In-Line Inspection (ILI) logs, four primary operational assumptions were formulated and empirically verified. The verification steps follow the chronological workflow of the data processing pipeline (). Table 3 summarizes these operational assumptions, their corresponding empirical testing methods, and quantitative outcomes.
Table 3.
Formulated operational assumptions, verification methods, and empirical validation outcomes.
Detailed Verification of Operational Assumptions
Assumption A1 (Sensitivity Calibration of Spatial Matching Bounds): In-Line Inspection (ILI) tools present inherent spatial positioning noise, with vendor axial positioning uncertainties typically ranging between and . To establish robust operational matching thresholds without cluster contamination, a 2D sensitivity grid search was evaluated across candidate windows ( in steps of , in steps of ). Overly restrictive boundaries () yielded low matching efficiency () due to sensor discretization jitter, whereas excessive thresholds () led to severe cluster pollution (, reaching up to ). A distinct stability plateau was identified across at , maintaining a constant candidate retrieval efficiency () and an exceptionally low contamination rate (). Calibrating operational bounds to the plateau midpoints ( and ) ensures optimal candidate retrieval while strictly preventing false candidate associations.
Assumption A2 (Odometer Drift Correction via Relative Referencing): Relying on absolute odometer logs leads to cumulative multi-kilometer positioning drift over long pipeline segments. By referencing defect axial positions to the immediate upstream girth weld joint (), cumulative spatial errors are systematically reset at every pipe joint. Evaluating the spatial discrepancy distribution () across all matched feature pairs ( for ) yielded a near-zero mean residual of and a tight standard deviation of . The near-zero mean empirically proves that relative referencing neutralizes systematic odometer drift. Furthermore, the dispersion bound () rigorously justifies our calibrated operational matching threshold (), confirming that over of physical sensor noise is captured without trajectory interruption.
Assumption A3 (Hybrid Spatial Correspondence Pipeline): To establish persistent feature trajectories across multi-year inspection campaigns (), a two-stage hybrid alignment framework was implemented:
- Spatial Candidate Clustering (DBSCAN): Density-Based Spatial Clustering of Applications with Noise (DBSCAN) was executed using the normalized distance metric () based on calibrated tolerances () to isolate spatial feature groups per weld segment (). Across the pipeline, of candidates formed unambiguous 1-to-1 pairings, resulting in a low cluster contamination rate ().
- Deterministic Conflict Resolution (Hungarian Algorithm): For the remaining multi-candidate clusters where closely spaced corrosion pits created spatial overlap, the Hungarian (Kuhn-Munkres) algorithm was executed on the normalized spatial distance matrix. This step resolved candidate competition by global cost minimization, strictly enforcing unique 1-to-1 spatial correspondence and yielding 9353 persistent four-point trajectories ().
Assumption A4 (Cross-Campaign Depth Sizing Comparability and Quality Control): Variations in magnetic flux leakage (MFL) sensor calibration or operational pig velocity can introduce measurement noise into reported maximum depth values (). Vendor logs were pre-filtered to eliminate out-of-spec pig velocity excursions ( or ). Across the 9353 persistent trajectories ( inter-campaign transitions), empirical depth discrepancy analysis yielded a near-zero mean residual (), a median of , and a tight standard deviation (). Depth measurement uncertainty remains strictly within standard ILI vendor specification limits (±10% WT at confidence level), with out-of-spec negative sizing excursions (<−1.0) limited to only . Residual high-frequency sensor noise is effectively smoothed by the temporal recurrence mechanism of the Standard GRU model.
5.4. Model Architecture Selection and Standard GRU Specification
To determine the optimal predictive architecture for sequential in-line inspection (ILI) data, multiple machine learning and deep learning candidate models—including Random Forest (RF), Gradient Boosting Regressor (GBR), unidirectional Standard LSTM, Bidirectional LSTM (BiLSTM), and unidirectional Standard GRU—were systematically implemented and benchmarked on the reconstructed trajectory dataset.
Among the evaluated models, a unidirectional Gated Recurrent Unit (GRU) network implemented in PyTorch yielded superior predictive performance. The GRU architecture simplifies recurrent gating by combining the forget and input gates into a single update gate, offering a streamlined parameter footprint while mitigating overfitting risks on multi-campaign physical trajectory data. Because pipeline degradation progresses strictly forward across time, a unidirectional architecture preserves strictly causal temporal dependencies.
The proposed deep learning pipeline consists of a two-layer unidirectional GRU backbone (num_layers=2) with a hidden dimension of 64 units per layer (hidden_dim=64) and an inter-layer dropout probability of (dropout=0.2). Input sequence tensors of shape represent defect depth histories across Years 1, 3, and 5. The hidden state representation from the final temporal step (Year 5) is extracted via out[:, -1, :] and routed to a fully connected dense projection head (nn.Sequential). This head comprises a linear projection layer (64 to 32 units), a Rectified Linear Unit (ReLU) activation function, a dropout layer (), and a final linear output layer mapping 32 features to a single continuous prediction representing defect depth at Year 7 (MD_Y7).
Model parameters were optimized using the AdamW optimizer with an initial learning rate of and a weight decay penalty of . The optimization objective minimizes the Mean Squared Error (MSE) loss function over 40 training epochs. To further strengthen predictive reliability and verify parameter efficiency without introducing unverified assumptions, the resulting architecture was systematically validated via 5-fold cross-validation, paired Wilcoxon signed-rank significance testing, asymmetric loss sensitivity analysis (), and soft monotonicity regularization (), as detailed in Section 5.5 and Section 6.3.
Table 4 presents the detailed architectural layer summary and parameter counts of the proposed PyTorch Standard GRU implementation.
Table 4.
Detailed architectural summary of the implemented PyTorch Standard GRU model.
5.5. Model Training Procedure and Comparative Evaluation
The reconstructed trajectory dataset ( persistent defect trajectories) was split into independent training (70%, ), validation (15%, ), and testing (15%, ) subsets using a fixed pseudo-random permutation seed () to guarantee strict experimental reproducibility.
To maintain numerical stability during backpropagation through time and prevent data leakage, feature standardization (StandardScaler) was fitted exclusively on the training subset () and subsequently applied to transform validation and test splits according to Equation (16).
For recurrent models (GRU and unidirectional LSTM), inputs were reshaped into 3D tensors and processed in mini-batches of size 64 using PyTorch DataLoader instances. For classical machine learning baselines (Random Forest and Gradient Boosting Regressor), 2D flattened standardized feature vectors were used. Predicted scaled values () were mapped back to absolute physical depth measurements in millimeters via inverse transformation ().
To evaluate predictive performance, models were assessed on the unseen test set () using Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), normalized percentage errors relative to nominal pipe wall thickness(), and the coefficient of determination (). Table 5 summarizes the empirical performance metrics across all evaluated architectures.
Table 5.
Comparative performance evaluation across deep learning and machine learning models on the unseen test set ().
The experimental results demonstrate that the unidirectional Standard GRU model delivers superior predictive performance, obtaining the lowest continuous prediction errors (, ) and highest variance explanation (). Unidirectional recurrent topologies (GRU and LSTM) consistently outperform bidirectional architectures (BiLSTM, ) and tree ensembles (RF, ). This performance hierarchy highlights that forward-only temporal modeling best respects the irreversible physical progression of corrosion kinetics without introducing unnecessary parameters.
Statistical Significance and Architectural Efficiency
To evaluate whether the performance advantage of the proposed Standard GRU ( mm) over the Gradient Boosting Regressor ( mm) is statistically significant, a paired Wilcoxon signed-rank test was conducted on absolute error vectors () across the unseen test set (). The test yielded a Wilcoxon statistic of and a statistically significant p-value (), confirming that the GRU’s predictive superiority over tree-based ensembles is statistically robust rather than an artifact of random split sampling. Furthermore, while the performance delta between the Standard GRU and Standard LSTM ( mm) is negligible ( mm), the GRU operates with a 24.0% smaller parameter footprint (39,937 vs. 52,545 parameters), establishing its architectural efficiency for real-time pipeline monitoring systems.
Five-Fold Cross-Validation Robustness
To verify that model rankings are not sensitive to the single hold-out partition (used in Table 5), we further performed 5-fold cross-validation across all persistent trajectories (Table 6). Across all folds, the proposed unidirectional GRU maintains tightly bounded variance ( mm, mm, ), matching recurrent LSTM performance within mm while consistently outperforming static GBR ( mm), BiLSTM ( mm), and Random Forest ( mm, ).
Table 6.
Five-fold cross-validation performance () across all persistent corrosion trajectories.
6. Results and Discussion
6.1. Evaluation Metrics
The predictive performance of the proposed Standard GRU model on the unseen test dataset () was assessed using three standard regression metrics: Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and the coefficient of determination (). To ground error evaluation within industry integrity practices, all error metrics are reported in both absolute engineering units (millimeters) and normalized percentages of nominal pipe wall thickness (, ).
The Mean Absolute Error (MAE) measures the mean magnitude of absolute prediction residuals:
The Root Mean Squared Error (RMSE) penalizes larger deviation outliers more heavily:
The coefficient of determination () quantifies the proportion of target variance explained by the model:
where and represent the denormalized reference (actual) and predicted corrosion depths at Year 7, respectively, and denotes the mean reference depth.
6.2. Prediction Performance
Model predictions evaluated on the scaled test tensor were denormalized back to absolute depth values in millimeters via inverse scaling transformation (). Table 7 summarizes the overall quantitative performance of the Standard GRU model on the test dataset.
Table 7.
Overall predictive performance metrics of the proposed Standard GRU model evaluated on the independent Year-7 test set ().
To address depth-dependent bias and evaluate performance across defect severity levels, a stratified error analysis was performed. Anomalies were categorized into three operational depth severity classes relative to nominal wall thickness (): Minor (<10), Moderate (), and Severe (>20). Table 8 provides the detailed error breakdown, including sample count (n), MAE, RMSE, Mean Signed Error (), and the percentage of under-predictions exceeding standard ILI tool sizing tolerances (<−1.0 mm).
Table 8.
Depth-stratified predictive performance metrics, residual bias, and out-of-tolerance under-predictions evaluated on the Year-7 test set ().
Figure 7 depicts the residual prediction error () plotted against reference corrosion depth at Year 7, overlaid with standard HR-MFL vendor sizing tolerance bounds ().
Figure 7.
Depth-stratified residual error distribution of the proposed Standard GRU model evaluated across defect severity classes on the unseen Year-7 test set (). The horizontal dashed line denotes zero residual bias, while upper and lower dotted bounds represent standard HR-MFL vendor sizing tolerance (/±).
6.3. Discussion
To contextualize model performance physically, all evaluation metrics are interpreted relative to High-Resolution Magnetic Flux Leakage (HR-MFL) technology standards. As documented in industry benchmarks [19], standard HR-MFL vendor specifications guarantee a depth sizing accuracy of ( for nominal wall thickness ) at an confidence level (API 1163/POF standards). On the independent test set, the proposed Standard GRU model achieved an overall MAE of () and an RMSE of (). Crucially, because target measurements at Year 7 are themselves ILI log reports subject to instrumental uncertainty (), the achieved MAE demonstrates that the model operates well within the instrumental noise floor, effectively filtering out high-frequency inter-campaign measurement variance.
The coefficient of determination () demonstrates strong predictive alignment for field-recorded MFL data, where inter-inspection sizing jitter and operational noise introduce significant intrinsic variance. As shown in Figure 7, residuals for minor (<10% WT) and moderate () defects remain tightly clustered around the zero-error reference line, with overall out-of-tolerance under-predictions strictly bounded at .
However, the depth-stratified analysis (Table 8) highlights a depth-dependent error progression. While shallow defects display a minor positive bias (), deeper features (/>) exhibit a slight negative mean signed error (), with of severe defects exceeding the lower tool tolerance bound (). This behavior stems directly from natural dataset imbalance, as severe anomalies represent less than of field-recorded trajectories.
6.3.1. Asymmetric Loss Optimization and Safety–Precision Pareto Trade-Off
From a pipeline risk management perspective, under-predicting severe corrosion anomalies (, i.e., >) poses a direct structural failure risk. While standard MSE training () yields an unbiased symmetric baseline, incorporating the Asymmetric MSE Loss Function (Equation (20)) during model training penalizes non-conservative under-predictions on deep pits:
Note that to isolate the pure effect of loss-function weighting and monotonicity regularization without confounding feature-engineering interactions, all models in Table 9 and Table 10 were trained under a unified core depth-sequence configuration and evaluated relative to their own symmetric unconstrained baseline (; , ). To characterize the safety–precision trade-off transparently, we first mapped the full Pareto frontier across using the proposed GRU architecture, and subsequently benchmarked LSTM and sample-weighted GBR at two representative operating regimes: the balanced knee point () and the conservative safety-oriented setting (). As shown in Table 9 and Figure 8, increasing from to monotonically reduces severe-defect negative bias from to and cuts out-of-tolerance under-predictions () by (from down to ). However, this safety gain incurs a measurable operational trade-off: out-of-tolerance over-predictions (false alarms ) rise from to , while overall MAE increases from () to ().
Table 9.
Safety–precision Pareto trade-off across asymmetry penalty factors () and cross-architecture comparison on the independent Year-7 test set (). Severe defects are defined as (>20%); is computed on the severe-defect subset, whereas out-of-tolerance exceedance rates ( and , threshold /) are evaluated across all test anomalies.
Table 10.
Comparison of unconstrained GRU, soft monotonicity regularization (), and hard post-processing on the independent Year-7 test set ().
Figure 8.
Pareto trade-off between safety-critical out-of-tolerance under-predictions (), over-prediction false alarms (), and overall MAE across asymmetry penalty factors for the GRU model.
Between and , the Pareto curves intersect in an optimal operating regime where critical under-predictions drop by – (to and ) while false alarms remain contained at ≈– and stays above . Across identical penalty weights ( and ), GRU consistently achieves lower RMSE and higher than both LSTM and sample-weighted GBR, while maintaining lower out-of-tolerance under-prediction rates than GBR ( vs. at , and vs. at ).
6.3.2. Physical Monotonicity Constraints: Soft Regularization vs. Hard Post-Processing
In un-repaired external corrosion, metal loss is physically irreversible (). However, inter-campaign HR-MFL sizing noise () causes raw inspection logs to exhibit apparent negative growth rates, leading unconstrained regression models () to predict physical depth reductions () on of test trajectories. To evaluate how best to enforce physical consistency without propagating sensor noise, Table 10 compares soft monotonicity regularization during training (, Equation (21)) against hard post-processing ().
While hard post-processing eliminates of monotonicity violations, it degrades global predictive accuracy—increasing MAE from to , increasing RMSE from to , reducing from to , and introducing a positive systematic bias () because positive measurement spikes in are mechanically locked into the forecast. Conversely, soft monotonicity regularization () reduces physical violations from to while slightly improving overall MAE () and keeping global bias near zero (). Increasing to further lowers violations to while preserving high accuracy (), allowing the recurrent network to learn physically upward trajectories while filtering transient MFL sizing noise.
6.3.3. Implicit Environmental Encoding and Model Boundary Conditions
A primary consideration in empirical corrosion forecasting is the influence of unobserved environmental and operational parameters (such as soil resistivity, soil moisture content, pH, cathodic protection efficiency, and thermal dynamics). In this study, explicit environmental covariates were omitted to maintain direct compatibility with standard vendor In-Line Inspection (ILI) logs, where auxiliary environmental profiling along multi-kilometer buried assets is rarely available in legacy operator databases.
Nevertheless, the sequential GRU framework implicitly captures site-specific environmental severity: highly aggressive localized micro-environments manifest directly as accelerated historical growth trends within multi-campaign spatial-temporal trajectories. Consequently, historical degradation sequences serve as a functional proxy for net environmental aggressors. However, an operational boundary of this approach is that it relies on the continuity of historical degradation patterns; it cannot anticipate abrupt, step-change accelerations caused by sudden unmonitored events, such as localized coating disbondment or abrupt cathodic protection failure. Furthermore, because each anomaly is modeled independently using scalar depth trajectories () without axial length (L), circumferential width (W), or inter-pit spatial proximity descriptors, the current formulation does not capture colony interaction effects or pit-coalescence mechanics, which remain important directions for multi-output spatial-temporal extensions.
6.3.4. Architectural Horizon Scalability and Non-Uniform Inspection Intervals
Unlike static tabular regressors (e.g., GBR, Random Forest) that require fixed-dimension input matrices, the recurrent GRU framework naturally scales to longer inspection histories () without structural re-engineering of the model parameters. To empirically validate scalability under irregular inspection schedules, we masked the intermediate inspection for of trajectories, creating an irregular gap between and , and compared GRU models trained without time-delta encoding () versus with explicit time-delta encoding (). As summarized in Table 11, incorporating reduces overall negative bias by (from to ), lowers RMSE from to , and improves from to across irregular-interval trajectories, confirming that explicit temporal conditioning preserves forecasting fidelity across non-uniform ILI campaigns.
Table 11.
Empirical validation of explicit time-delta encoding () on trajectories with an irregular inspection gap ( masked).
Overall, these results confirm that the proposed GRU-based approach reliably predicts future corrosion depth while providing transparent controls for asymmetric safety risk, physical monotonicity, and irregular inspection schedules under operational constraints where continuous environmental logging is unavailable.
7. Conclusions and Future Work
This study presented a Gated Recurrent Unit (GRU)-based spatial-temporal framework for predicting external corrosion progression in oil and gas pipelines using historical In-Line Inspection (ILI) data. To eliminate multi-kilometer cumulative odometry drift without relying on absolute coordinates, spatial defect locations were normalized using a girth-weld referencing system. Following spatial trajectory reconstruction via Circular DBSCAN across persistent, un-repaired defect trajectories, a comparative benchmarking across multiple machine learning and deep learning models demonstrated the strong predictive performance and parameter efficiency of a 2-layer unidirectional Standard GRU architecture.
The predictive performance demonstrated in the evaluation results—achieving an MAE of (), RMSE of (), and an of on the held-out test set ()—confirms the model’s robustness and reliability for real-world pipeline integrity management. Residual error analysis verified that of predictions remain strictly within High-Resolution MFL vendor sizing tolerance limits (). Visual residual analysis across defect severity categories confirmed that the GRU model effectively filters out high-frequency inter-campaign measurement noise while maintaining an unbiased residual distribution centered at zero.
Five-fold cross-validation across all trajectories further confirmed that GRU maintains consistent predictive performance across data splits (, , ). While sub-millimeter differences among deep recurrent variants lie well within the HR-MFL instrumental tolerance, GRU delivers comparable accuracy with a smaller parameter footprint than unidirectional LSTM ( vs. parameters) and consistently outperforms static tabular baselines (GBR and Random Forest).
To address safety-critical integrity requirements transparently, Pareto sensitivity analysis of a custom Asymmetric MSE Loss Function () demonstrated that increasing reduces severe-defect negative bias from to and cuts critical out-of-tolerance under-predictions (>) by (from to ), identifying as an optimal balance between tail-risk reduction and false-alarm containment. Furthermore, comparing monotonicity enforcement strategies revealed that soft monotonicity regularization during training () lowers physical violations while preserving global accuracy (), avoiding the positive bias () and variance degradation () caused by hard post-processing.
These findings highlight the strong potential of forward-directed temporal deep learning models for operationally feasible corrosion forecasting, supporting proactive risk mitigation in long-distance pipelines where continuous environmental logging is unavailable. Empirical validation on simulated irregular inspection schedules () confirmed that augmenting GRU inputs with explicit time-delta encodings () reduces overall negative bias by and improves from to , providing a scalable foundation for non-uniform ILI campaigns.
Future work will explore incorporating Bayesian uncertainty estimation to provide probabilistic confidence intervals around predicted defect depths, extending the sequence formulation to multi-output prediction of axial length (L) and circumferential width (W), and integrating spatial graph neural networks (GNNs) to model inter-pit proximity, colony coalescence mechanics, and complex pipeline network topographies.
Author Contributions
Conceptualization, K.C., M.Y.H. and I.B.; methodology, K.C. and M.Y.H.; software, K.C. and H.S.; validation, K.C., M.Y.H. and I.B.; formal analysis, K.C. and I.B.; investigation, K.C. and H.S.; data curation, K.C.; writing—original draft preparation, K.C.; writing—review and editing, M.Y.H., I.B. and H.S.; visualization, K.C.; supervision, M.Y.H. and I.B.; project administration, I.B. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding. The APC was paid by the authors.
Data Availability Statement
The dataset analyzed in this study is publicly available from Mendeley Data: Yarveisy et al. [19]. Dataset for: Cross-country pipeline inspection data analysis and testing of probabilistic degradation models (V1). https://doi.org/10.17632/c2h2jf5c54.1 (accessed on 15 January 2025).
Acknowledgments
The authors acknowledge the Laboratory of Mathematics, Informatics and Systems (LAMIS), Echahid Cheikh Larbi Tebessi University, Tébessa, Algeria, for its institutional and scientific support. During the preparation of this manuscript, the authors used ChatGPT (GPT-6, OpenAI) for language revision, translation, and improvement of the manuscript. The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| AMI | Adjusted Mutual Information |
| ARI | Adjusted Rand Index |
| BiLSTM | Bidirectional Long Short-Term Memory |
| DBSCAN | Density-Based Spatial Clustering of Applications with Noise |
| FEM | Finite Element Method |
| HR-MFL | High-Resolution Magnetic Flux Leakage |
| ILI | In-Line Inspection |
| LSTM | Long Short-Term Memory |
| UT | Ultrasonic Testing |
| WT | Wall Thickness |
References
- Hussain, M.; Zhang, T.; Jamil, I.; Soomro, A.A.; Hussain, I. Application of machine learning approaches to prediction of corrosion defects in energy pipelines. In Advances in Corrosion Modelling; Springer: Cham, Switzerland, 2024; pp. 127–166. [Google Scholar]
- Xu, L.; Wang, Y.; Mo, L.; Tang, Y.; Wang, F.; Li, C. The research progress and prospect of data mining methods on corrosion prediction of oil and gas pipelines. Eng. Fail. Anal. 2023, 144, 106951. [Google Scholar] [CrossRef] [Scilit]
- Kang, F.; Zhang, Z.; Zhang, H.; Chen, G.; Shen, S.; Cai, G.; Lu, X.; Chen, W.; Li, M. A lightweight transformer with corrosion gating and physical embeddings for small-sample pipeline corrosion prediction. Coatings 2026, 16, 854. [Google Scholar] [CrossRef] [Scilit]
- Kalman, R.E. A new approach to linear filtering and prediction problems. J. Basic Eng. 1960, 82, 35–45. [Google Scholar] [CrossRef] [Scilit]
- Box, G.E.P.; Jenkins, G.M.; Reinsel, G.C.; Ljung, G.M. Time Series Analysis: Forecasting and Control, 5th ed.; Wiley: Hoboken, NJ, USA, 2015. [Google Scholar]
- Liu, S.; Lin, Y. Grey Systems: Theory and Applications; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Soomro, A.A.; Mokhtar, A.A.; Kurnia, J.C.; Lashari, N.; Lu, H.; Sambo, C. Integrity assessment of corroded oil and gas pipelines using machine learning: A systematic review. Eng. Fail. Anal. 2022, 131, 105810. [Google Scholar] [CrossRef] [Scilit]
- Chin, K.T.; Arumugam, T.; Karuppanan, S.; Ovinis, M. Failure pressure prediction of pipeline with single corrosion defect using artificial neural network. Sci. Technol. Oil Oil Prod. Pipeline Transp. 2021, 11, 166–171. [Google Scholar] [CrossRef] [Scilit]
- Lo, M.; Karuppanan, S.; Ovinis, M. ANN- and FEA-based assessment equation for a corroded pipeline with a single corrosion defect. J. Mar. Sci. Eng. 2022, 10, 476. [Google Scholar] [CrossRef] [Scilit]
- Long, P.; Yang, G.; Liu, H.; Deng, W.; Liang, M. Transfer learning-driven prediction of oil and gas pipeline corrosion rates in small sample scenarios. PLoS ONE 2025, 20, e0333914. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kermani, M.B.; Morshed, A. Carbon dioxide corrosion in oil and gas production—A compendium. Corrosion 2003, 59, 659–683. [Google Scholar] [CrossRef] [Scilit]
- Dan, S.; Hao, J.; Yang, F.; Chen, H.; Liang, N.; Wu, Y.; Zhang, J.; Ma, H.; Klu, E.E.; Gao, B.; et al. Corrosion behavior and mechanism of Cr-Mo alloyed steel: Role of ferrite/bainite duplex microstructure. J. Alloy. Compd. 2019, 809, 151787. [Google Scholar] [CrossRef] [Scilit]
- Talukdar, A.; Baranwal, P.K.; Talukdar, M.K.; Rajaraman, P.V. Synergistic effect of H2S and acetic acid on CO2 corrosion of carbon steel at elevated temperature. JOM 2023, 75, 3757–3770. [Google Scholar] [CrossRef] [Scilit]
- Adams, C.D.; Garber, J.D.; Walters, F.H.; Singh, C. Verification of computer modeled tubing prediction by field data. In Proceedings of the NACE Corrosion Conference, Houston, TX, USA, 7–12 March 1993; pp. 53–55. [Google Scholar]
- Mazzella, J.; Hayden, T.; Krissa, L.; Tsaprailis, H. Estimating corrosion growth rate for underground pipeline: A machine learning based approach. In Proceedings of the CORROSION 2019, Nashville, TN, USA, 24–28 March 2019; NACE International: Houston, TX, USA, 2019. [Google Scholar]
- Udonsek, D.E.; Tamonodukobipi, D.; Odokwo, V.E. Corrosion-based integrity analysis of offshore pipeline for hydrocarbon transportation. J. Power Energy Eng. 2023, 11, 24–41. [Google Scholar]
- American Petroleum Institute. In-Line Inspection Systems Qualification, 3rd ed.; API Standard 1163; American Petroleum Institute: Washington, DC, USA, 2020. [Google Scholar]
- Pipeline Operators Forum. Specifications and Requirements for In-Line Inspection of Pipelines; Version 2016; Pipeline Operators Forum: Leidschendam, The Netherlands, 2016. [Google Scholar]
- Yarveisy, R.; Khan, F.; Abbassi, R. Dataset for: Cross-Country Pipeline Inspection Data Analysis and Testing of Probabilistic Degradation Models (V1); Mendeley Data: Oxford, UK, 2021. [Google Scholar] [CrossRef]
- Breiman, L. Random forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef] [Scilit]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Cho, K.; van Merriënboer, B.; Gülçehre, Ç.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder–decoder for statistical machine translation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, 25–29 October 2014; Association for Computational Linguistics: Stroudsburg, PA, USA, 2014; pp. 1724–1734. [Google Scholar]
- Schuster, M.; Paliwal, K.K. Bidirectional recurrent neural networks. IEEE Trans. Signal Process. 1997, 45, 2673–2681. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Elsayed, N.; Zaghloul, Z.S.; Azumah, S.W.; Li, C. Intrusion detection system in smart home network using bidirectional LSTM and convolutional neural networks hybrid model. arXiv 2021, arXiv:2105.12096. [Google Scholar]
- Xing, M.; Ding, W.; Zhang, T.; Li, H. STCGCN: A spatio-temporal complete graph convolutional network for remaining useful life prediction of power transformer. Int. J. Web Inf. Syst. 2023, 19, 102–117. [Google Scholar] [CrossRef] [Scilit]
- Deng, L.; Liu, J.; Liu, M.; Cao, Y.; Wen, C.; Deng, X. Remaining useful life prediction based on cross-temporal dynamic graph convolutional network. Eksploat. Niezawodn. 2025, 27, 203249. [Google Scholar] [CrossRef] [Scilit]
- Kuhn, H.W. The Hungarian method for the assignment problem. Nav. Res. Logist. Q. 1955, 2, 83–97. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.







