Table of Contents
- Fundamentals of CO₂ corrosion in natural gas
- What is an Artificial Neural Network (ANN)?
- How is data processed in an ANN applied to corrosion?
- Application of ANN in CO₂ corrosion prediction
- Results and analysis
- Conclusions
- References
- Frequently Asked Questions (FAQs)
- What is CO₂ corrosion in natural gas?
- How does natural gas composition affect corrosion?
- What are Neural Networks and how do they help in prediction?
- What is the advantage of using ANN over empirical methods?
- What mitigation measures can be applied based on the prediction?
- What structural risks are associated with CO₂ + H₂S corrosion?
In recent years, the integration of tools such as Artificial Neural Networks (ANN) into the study of carbon dioxide (CO₂) induced corrosion in natural gas has emerged as a significant challenge for the energy industry, given its profound impact on the integrity of pipelines and metallic equipment. Within this context, ANN in CO₂ corrosion prediction has established itself as an advanced methodology for modeling complex phenomena, such as CO₂ corrosion, by providing reliable estimates of corrosion rates and potential localized damage based on the specific composition of natural gas.
This phenomenon, commonly known as sweet corrosion, is heavily influenced by the chemical composition of the gas, the presence of water, and traces of H₂S, as well as critical temperature and pressure conditions. Accurate prediction of CO₂ corrosive trends allows for the implementation of more efficient mitigation strategies, thereby reducing operational risks and maintenance costs across the infrastructure.
Fundamentals of CO₂ corrosion in natural gas
When CO₂ dissolves in the water present within pipelines or transport systems, it forms carbonic acid (H₂CO₃), which subsequently lowers the pH and increases the medium’s conductivity. In this environment, the iron found in carbon steels undergoes oxidation through an anodic reaction, releasing electrons and dissolving as $Fe^{2+}$. Simultaneously, these electrons participate in the cathodic reaction of proton reduction, effectively closing the electrochemical circuit.
The formation of iron carbonate (FeCO₃) can act as a protective film, significantly reducing the corrosion rate. However, the effectiveness of this protection depends on factors such as pH, temperature, flow velocity, and CO₂ concentration; if these conditions change, the film can dissolve, reactivating the corrosion process. Furthermore, the presence of H₂S intensifies the damage, favoring the formation of iron sulfides (FeS) and increasing the risk of pitting and Sulfide Stress Cracking (SSC).
What is an Artificial Neural Network (ANN)?
Artificial Neural Networks (ANN) constitute an advanced machine learning tool designed to identify complex patterns within multivariate datasets. Their operation is inspired by the human nervous system, where multiple interconnected “neurons” process information simultaneously. Although at first glance they may seem complex, they are actually composed of fundamental elements and structures that work together to process data and generate results.
Structure of the Artificial Neural Network (ANN)
The basic structure of a neural network is composed of different layers of interconnected neurons. The input layer is responsible for receiving the data and transmitting it throughout the network, while the output layer provides the final result. Between them, there are one or more hidden layers responsible for transforming and processing the information. The following image shows the conceptualization of a diagram of an Artificial Neural Network as a Multilayer Perceptron (MLP) system.

1. Input Layer (Inputs – X): On the left side, the input variables are shown, represented as:
- x₁, x₂, …, xₙ
Each of these variables feeds the network with process information.
The term +1 represents the bias, which allows the model to be adjusted and improves learning capability.
2. Synaptic Weights (W¹ and W²): The connections between neurons are represented by lines, each with an associated weight:
W¹: connects the input layer to the hidden layer
W²: connects the hidden layer to the output layer
These weights are fundamental because:
They determine the importance of each variable
They are adjusted during the training of the network
They allow modeling of non-linear relationships
3. Hidden Layer: This is the core of the model, where processing occurs:
Each node (neuron) combines the inputs through a weighted sum
Then it applies an activation function (not explicitly shown in the image)
In this part, the network detects complex patterns
4. Output Layer (Outputs – Y): On the right side are the outputs:
y₁, y₂, …, yₘ
5. Information Flow: The process follows a clear direction:
During training: the weights are adjusted through backpropagation to minimize the error.
How is data processed in an ANN applied to corrosion?
The use of ANNs allows anticipating corrosive behavior and optimizing mitigation strategies, reducing risks and increasing the service life of equipment. Thus, the combination of traditional partial pressure criteria with artificial intelligence techniques constitutes a powerful tool for corrosion management in the natural gas industry. Data processing in an ANN for corrosion prediction follows a structured sequence:
First, representative system data are collected, including natural gas compositions, operating conditions, and historical corrosion records. This data is then cleaned, normalized, and organized to ensure consistency and avoid bias in the model.
Next, the data is divided into training and validation sets. During training, the network adjusts its internal parameters using algorithms such as backpropagation, minimizing the error between predicted and observed values.
In more advanced applications, probabilistic classifiers, such as Bayesian approaches, can be incorporated, allowing estimation of the probability of occurrence of specific corrosive scenarios, thereby increasing the robustness of the model.
This approach is particularly useful in systems where corrosion depends on multiple interdependent variables, as occurs in environments with CO₂ and H₂S.
The partial pressure of gases is a key factor in predicting the type of corrosion that may occur in a natural gas mixture, as it directly influences the chemical reactions affecting the materials. To evaluate this, CO₂ values are expressed in molar percentage and H₂S in parts per million (ppm). The relationship between the partial pressures of both gases allows determining the predominant corrosion mechanism, as described by Feng et al. (2018). The criteria are as follows:
- PpCO₂/PpH₂S < 20 ⇒ Acidic H₂S corrosion: The corrosive action of hydrogen sulfide predominates, generating strong acids capable of attacking the metal.
- 20 < PpCO₂/PpH₂S < 500 ⇒ Combined H₂S + CO₂ corrosion: Both gases contribute to the corrosive process, generating a mixture of carbonic acid and hydrogen sulfide acid that accelerates material degradation.
- PpCO₂/PpH₂S > 500 ⇒ Sweet CO₂ corrosion: CO₂ is the dominant gas, primarily forming carbonic acid, which produces a more uniform and less aggressive attack than that caused by H₂S.
These criteria allow engineers and corrosion specialists to anticipate the type of damage that could occur.
Application of ANN in CO₂ corrosion prediction
The usefulness of ANNs in the natural gas industry lies in the fact that corrosion does not depend on a single variable but on the simultaneous interaction of multiple factors, such as: chemical composition of the gas (CO₂, H₂S, CH₄, N₂, etc.), pressure and temperature, presence of liquid water, flow or static conditions. And taking into consideration predictions of the predominant corrosion mechanism based on partial pressure.
Based on the above, to improve the accuracy of these predictions, Artificial Neural Networks (ANNs) can be employed. These artificial intelligence tools allow processing multiple variables simultaneously, such as gas partial pressure, temperature, water content, flow velocity, and material characteristics, and learning complex corrosion patterns that are not always evident through traditional methods, applying the Multilayer Perceptron (MLP) system model.
The image represents the typical architecture of an Artificial Neural Network (ANN) used to model and predict complex phenomena, such as corrosive trends depending on operating variables and gas composition.

In this case, the variables x1, x2, …, xn on the left correspond to system parameters, for example:
- Partial pressure of CO₂
- H₂S concentration
- Temperature
- Flow velocity
- pH or water content
Each of these variables feeds the network with process information.
On the right side are the outputs:
y1, y2, …, ym
These represent the model predictions, for example:
Results and analysis
Recent studies show that ANNs outperform traditional empirical methods in prediction accuracy. Among the most relevant findings:
- Gases with more than 10% CO₂ show significant acceleration of corrosion.
- The CO₂ + H₂S combination generates critical scenarios for FeS and SSC formation.
- ANNs allow defining preventive strategies by optimally adjusting inhibitor injection.
These results demonstrate how advanced modeling can anticipate risks and reduce the occurrence of unexpected structural failures, contributing to operational safety and efficiency.
Conclusions
Predicting CO₂ corrosive trends in natural gas using Neural Networks represents a major advancement in industrial corrosion management. This methodology enables the industry to:
- Evaluate how the specific composition of the gas affects the rate of corrosion.
- Anticipate the formation of pitting and SSC before significant damage occurs.
- Implement more precise and cost-effective mitigation strategies.
The integration of ANN-based predictive models with real-time monitoring and laboratory analysis provides a robust tool for facing the challenges of CO₂ corrosion, ensuring both pipeline integrity and operational continuity.
References
- Nesic, S. (2007). Key issues related to modeling of internal corrosion of oil and gas pipelines – A review. Corrosion Science, 49(12), 4308–4338. https://doi.org/10.1016/j.corsci.2007.06.043
- Zhang, X., Zhang, Y., & Li, X. (2020). Prediction of CO₂ corrosion rates in pipelines using artificial neural networks. Journal of Loss Prevention in the Process Industries, 65, 104142. https://doi.org/10.1016/j.jlp.2020.104142
- Uhlig, H. H., & Revie, R. W. (2011). Corrosion and Corrosion Control: An Introduction to Corrosion Science and Engineering (4th ed.). Hoboken, NJ: Wiley.
- Da Silva, R. C., & Spinacé, E. V. (2015). Effect of CO₂ and H₂S on the corrosion of carbon steel in natural gas pipelines. Materials Research, 18(4), 902–912. https://doi.org/10.1590/1516-1439.327615
- Chen, Y., & Sun, H. (2018). Application of neural networks for prediction of internal corrosion in oil and gas pipelines. Computers & Chemical Engineering, 116, 239–247. https://doi.org/10.1016/j.compchemeng.2018.05.011
Frequently Asked Questions (FAQs)
What is CO₂ corrosion in natural gas?
It is a type of corrosion known as “sweet corrosion” that occurs when CO₂ dissolves in water to form carbonic acid (H₂CO₃), leading to the oxidation of carbon steel and resulting in pitting or uniform corrosion.
How does natural gas composition affect corrosion?
The concentration of CO₂ and H₂S, the presence of methane, and overall humidity levels influence the severity. High CO₂ levels and traces of H₂S significantly increase the risk of pitting and Sulfide Stress Cracking (SSC).
What are Neural Networks and how do they help in prediction?
Artificial Neural Networks (ANNs) are machine learning models that correlate complex variables—such as gas composition, pressure, temperature, and humidity—with the corrosion rate, providing accurate predictions and early risk warnings.
What is the advantage of using ANN over empirical methods?
Unlike traditional methods, ANNs capture complex non-linear relationships between variables, significantly improving prediction accuracy and allowing for the optimization of mitigation strategies in real time.
What mitigation measures can be applied based on the prediction?
Depending on the estimated risk, engineers can deploy chemical inhibitors, protective coatings, humidity control, or specific operational adjustments to reduce corrosion and prevent structural failures.
What structural risks are associated with CO₂ + H₂S corrosion?
The combination of these gases can generate iron sulfides (FeS), increase the porosity of protective films, and promote Sulfide Stress Cracking (SSC), which can lead to sudden structural failures under mechanical stress.