Web http://www.jcse.org/

Volume 1 Paper 6

A Neural Network Model for CO2 Corrosion of Carbon Steel

Srdjan Nesic1 and Miran Vrhovac2
1Department of Mechanical Engineering, University of Queensland, Brisbane Qld 4072, Australia.
2Research, Development and Training Department, ISQ - Instituto de Soldadura e Qualidade, Portuguese Welding Institute, EN249 - Km 3, Cabanas - Leião, Tagus Park, Apartado 119, 2781 Oeiras - Codex, Portugal


A model for "worst case" CO2 corrosion using a neural network approach was developed in this study. The performance of the model was validated against a large experimental database and has demonstrated superior fitting of the experimental data compared to one mechanistic and two well known semi-empirical models from the open literature.


Although much work has been done in the area of CO2 corrosion particularly in the past two decades, modelling of this process was seriously hampered by the lack of understanding. For example, even the basic electrochemical reaction mechanisms still remain obscure. When a number of complicating factors, which are normally present in industrial situations, such as:

are added, the complexity of the problem exceeds our ability to understand it. Consequently, we have been unable so far to construct mechanistic, theoretically based, models for prediction of CO2 corrosion. The exception is the laboratory case of bare steel corroding in pure CO2 saturated water ("worst-case" corrosion) for which a few models can be found in the open literature.1, 2, 3

There is a number of semi-empirical models which attempt to bridge the gap between our lack of understanding and the need to have an operating CO2 corrosion model.4, 5 These models rely partly on theory, and when it fails to give the right answer, they introduce so called "correction factors" which in a purely empirical way adjust the answer to fit the limited experimental observations. Most often these semi-empirical models have reasonable fitting capabilities but are very poor when used for extrapolation outside the boundaries of parameters with which they were calibrated.

Since there are a lot of scattered experimental data on CO2 corrosion in the literature (albeit much of it of poor quality), an attempt has been made in the present study to construct a purely empirical model for CO2 corrosion, using the state-of-the-art artificial intelligence (AI) modelling techniques. The result is a CO2 corrosion model based on neural networks described below. It is, in its present stage, also just another model of "worst case" corrosion. However given enough reliable experimental data it can be easily extended to account for many of the relevant factors listed above.

Not many purely empirical models exist in the open literature. A statistical 6 and a Markov description stochastic approach 7 were presented for modelling of pitting corrosion, however, this topic is outside the scope of this paper. Another example is the linear multiple regression model shown by Adams et al.8 , however, it is doubtful that one such simple linear model (even if it is multivariable) can represent a satisfactory description of the highly nonlinear and coupled processes occurring in CO2 corrosion.

Before the neural network model is described below, a brief description of the CO2 corrosion process is given followed by an outline of the AI techniques used, with references to further reading.

A Brief Description of the CO2 Corrosion Process

There is a number of detailed studies where the process of CO2 corrosion is described in detail.3, 9, 10 Here only an outline of the main reactions is presented.

Aqueous CO2 corrosion of carbon steel is an electrochemical process involving the anodic dissolution of iron and the cathodic evolution of hydrogen. The overall reaction is:


The electrochemical reactions are often accompanied by the formation of films of FeCO3 (and/or Fe3O4) which can be protective or non protective depending on the conditions under which they are formed.

The anodic dissolution of iron in acid solutions:


has been studied extensively with several multi-step mechanisms suggested to explain the various experimental results.11, 12

On the cathodic side, it has been assumed that the presence of CO2 increases the rate of the hydrogen evolution reaction. In strong acids, which are completely dissociated, the rate of hydrogen evolution cannot exceed the rate at which H+ ions can be transported to the surface from the bulk solution. In solutions with a pH >4 this mass transfer controlled limiting current is small, however the presence of H2CO3 (hydrated CO2) enables hydrogen evolution at a much higher rate. Thus at a given pH the presence of CO2 leads to a much higher corrosion rate than would be found in a solution of a strong acid. It is not known whether H2CO3 is reduced directly (as assumed by many workers in the field) 2, 9 or the final step in the reaction follows the dissociation of the H2CO3 .13 Many have assumed that the two reactions are independent and the net cathodic current is the sum of the currents for the two reactions:2



It has been suggested14 that in CO2 solutions at higher pH the direct reduction of the bicarbonate ion becomes important:

(5 )

A Brief Description of the Artificial Intelligence Techniques Used

Evolved Descriptors Approach

In this approach15 it is assumed that the actual problem is depicted by a known (measurable) set of input parameters, called here primitive descriptors and a set of output parameters. Often, the direct correlation between the problem input and the output is poor. Hence, it is necessary to complement such a description of the problem with the so called evolved descriptors, which are non-linear combinations of the primitive descriptors and which capture important causal relations between them, expressing implicitly the actual problem physics. For example a well known evolved descriptor in hydrodynamics, obtained from dimensional analyses, is the Reynolds number. In general a solution of a particular problem depends on a set of specific evolved descriptors, which have to be defined before a development of a model is attempted. However, it is not always possible to define the evolved descriptors beforehand in an explicit analytical form, especially when the problem at hand is not fully understood. This paper shows, among other things, how they can still be defined indirectly by using combined Artificial Intelligence techniques: Neural Networks and Genetic Algorithms.

Neural Network

Generally, neural networks are aimed at prediction or pattern recognition problems, for which it is difficult to develop a suitable analytical model. In addition, neural networks are a convenient tool for testing the suitability of different evolved descriptors. The best set of chosen evolved descriptors is the one for which the neural network performs most accurate interpretation of independent test data.

Neural networks can "learn" to forecast, developing a correlation between a known set of input and output problem descriptors. The learning capability is achieved through its architecture, structured as a network of interconnected non-linear computational units called "neurones", organised in multiple layers just like biological neural cells. Each neurone is characterised by a sigmoidal transfer function (other types of transfer functions can also be used), responsible for non-linear interpretation ("learning") of input signals, scaled between 0 and 1. Each connection between the neurones is given a numerical weight, which represents a conductivity of the connection. When the neural network is "learning", the weights are iteratively recalculated until the error of prediction is minimised.

Neural network methods typically excel over traditional computational or rule based methods at the problems where pattern recognition is important and precise computational answers are not required. Further, when a neural network’s inputs and/or outputs contain evolved parameters, its computational precision and prediction ability significantly increases. In that case, as it is shown in a comparisons below, a neural network outperforms other more traditional modelling approaches.

Figure 1. Back Propagation neural network.

A Back Propagation neural network, used in the present model, consists of three interconnected neurone layers: input, hidden and output layers, as shown in Figure 1. The network learns by adjusting the connection weights (wi and wh). using the so called Generalised Delta Rule (GDR) algorithm. GDR is a gradient-descent technique based on minimisation of squared network errors, obtained in comparison between network interpretation of training input patterns and known training outputs. During the training, the network adjusts its weights to obtain better answers simultaneously with a backward error propagation through the network layers. The training efficiency depends on interaction between neurone transfer functions and typical training patterns.

A complete set of training patterns presented to the neural network during the training process is called an epoch. Usually, the training patterns within one epoch are processed by the neural network in a randomly ordered sequence to avoid learning by memorisation. This can happen when there is an excessive number of nodes and particularly when a fixed order of patterns is given repeatedly to the neural network during the training sequence.18 There is a simple way to avoid this problem, which amounts to reshuffling of the patterns every time a new set of patterns is presented to the network.19 When this is done, the memorisation of the individual patterns can be reduced.

The unknown analytical form of evolved problem descriptors and their correlation to the output are approximated by introduction of additional network inputs and their non-linear processing through the neural network architecture. The neural network inputs, initially consisting of scaled primitive descriptors pi=1,..,n are extended with the harmonics of one-dimensional Fourier cosine series S{Aj× cos((2× j-1)× 2× pi=1,..,n)}j=1,..,r., where r is total number of harmonics in each of the series. After being scaled by (cos(2× pi)+1)/2=cos2(pi), the additional inputs are presented to the network in the increasing harmonic order as:

pn+1=cos2(p1), pn+2=cos2(3× p1), pn+3= cos2(5× p1),…, pn+r=cos2((2× r-1)× p1), … ,

pn× (r-1)+1=cos2(p2), pn× (r-1)+2=cos2(3× p2), pn× (r-1)+3=cos2(5× p2), …, pn× (r-1)+r=cos2((2× r-1)× pn).

Hence, the total number of input neurons I increases from "n" to "n× (1+r)". The number of hidden neurons H can be selected by using recommendations found in.20 Therefore the total number of network connections becomes (I+1)*H+(H+1)*O and should be smaller than the number of training patterns. O is a number of outputs and the "+1" stands for a bias neuron in input and hidden network layers.

Genetic Algorithms

During the training, the network can operate interactively with a genetic algorithm. Genetic algorithms are stochastic search tools for determination of the fittest problem solution according to a pre-defined criteria. The main purpose of the genetic algorithm in this work was to enhance the network training efficiency.

M. Vrhovac16 reported that selection of the proper sequence of patterns for each training epoch considerably influences the training efficiency. The genetic algorithm is used here to determine the fittest sequence of patterns for the given set of training epochs. The fittest training sequence generates the minimal standard deviation of the neural network output. The standard deviation is calculated for the complete set of patterns in each training epoch. The sequence of training patterns is defined as a string of concatenated pattern order numbers, such as |127|022|239|…|004|, representing a chromosome in the genetic population with each number having fixed three digits length. The sequence was allowed to repeat the order number of patterns.

Genetic algorithms encode initial input data set information into strings, analogous to living being cellular chromosomes. A population of strings competes according to predefined solution fitness criteria, so that the fittest among them "procreate" and the rest eventually dies "childless". As with biological parents, two strings combine by simulated genetic operations: crossover and mutation, contributing part of their characteristics to two new-born offspring strings. In this case, the genetic operations on chromosomes were performed on individual pattern numbers, here treated as genes. The crossover was performed by random exchange of entire numbers between selected parent strings. The mutation was performed individually on the each parent by substitution of the randomly chosen number (gene) from the given sequence with another number (gene) randomly chosen from the complete set of pattern order numbers. Both operations were controlled by stipulated rates. The new-born offspring join the string population taking the place of their parents and compete further until an acceptable problem solution is found.

Genetic algorithms are robust. They perform well on problems whose complexity increases exponentially with number of input parameters. Also, they possess the ability of implicit parallelism, to evaluate simultaneously many possible problem solutions, the feature largely exploited in this case.

The Present Model

The experimental database of Dugstad et al.5 described below was used for training of the neural network (courtesy of Institute for Energy Technology, Norway). It was not easy to find a sufficiently wide and reliable experimental CO2 corrosion database where most of the relevant parameters were measured and controlled, so that it could be used as a training database for the neural network model. The study of Dugstad et al.5 satisfies this criterion to the largest extent. It covers a broad range of experimental conditions: temperature t=20-90 oC, pipe velocity v=0.1-13 m/s, pH 3.5 -7, CO2 partial pressure =0.3-26 bar, ferrous ion concentration Fe++ =1-230 ppm. The corrosion rate was measured on flat diagonally mounted St52 steel coupons using a radioactive measuring technique in experiments which lasted from a few days to a few weeks. Long duration experiments were needed to obtain stable corrosion rates due to growth of iron carbide films.

Most of the experiments were conducted under conditions where protective films did not form, however, in some of the high temperature experiments precipitation of iron carbonate scales may have occurred. For more details of the experimental techniques and the results see the original paper.5

image91.gif (39662 bytes)

Figure 2. Artificial intelligence model for determination of the Vcor correlation

The total number of experiments presented by the authors was 328. The present neural network model was actually trained with 308 of the 328 cases. The remaining cases were randomly sampled and extracted in order to perform a preliminary test of the neural network ability to generalise by comparing the predictions with an "unknown" data-set.

The model, consisted of a neural network and a genetic algorithm (Figure 2).16, 17 After it was determined that the effect of Fe2+ on the corrosion rate is small, the model was constructed having four primitive descriptors (inputs):

t - temperature,
- partial pressure of CO2,
v - velocity

and one output:

Vcor - corrosion rate.

Including the evolved descriptors, the final neural network architecture was defined by 32 input neurones, 8 hidden neurones and one output neurone. The genetic population contained 100 chromosomes.

The training of the model was achieved in the following manner:

  1. Initially, the network performed training without the genetic algorithm, for certain number of epochs, until an approximately steady decreasing rate of the network output standard deviation was established.
  2. Then, the genetic algorithm was started by random generation of chromosomes for the initial set of training sequences in the genetic population.
  3. The network continued to train attributing calculated standard deviation to the corresponding chromosome of the actual training sequence at the end of each completed training epoch.
  4. After characterisation of all chromosomes by the corresponding standard deviation, they were sorted by fitness. The genetic operations were applied.
  5. The network continued to train with the new generation of chromosomes repeating the current and the previous step until the network output standard deviation reached relative but not complete stagnation.

Instead of randomly varying the order of patterns presented to the neural network during training, the genetic algorithm intelligently selected the fittest sequences of training patterns from the random generated pool of epochs and improve them.

Performance of the Model

Once the model was constructed it was interesting to compare its performance to the performance of some of the other well known mechanistic and semi-empirical models from the open literature. Three other models were selected for this task:

It should be pointed out that the selected empirical database5 used for training of the neural network was actually also used by both the SHELL and IFE models for calibration of the model constants. In that sense the comparisons shown below can be seen primarily as a test of the ability of these models to describe the experimental data. The mechanistic EC model was not calibrated against this database and the presented comparison represents an extrapolation prediction for this model.

As shown in Figures 3-5, the SHELL, IFE and neural network models all show reasonable predictive capabilities. The best agreement between the predictions and the KSC2 experimental values was obtained for the neural network model with a correlation coefficient of r2=0.98. The IFE model was second best (r2=0.82) followed by the SHELL model (r2=0.72). The main discrepancies for the latter two models come from the high temperature experiments where protective films probably formed. With these points removed from the analysis (along with some other outliers) de Waard et al.21 reported an improved agreement (r2=0.91) for the SHELL model.

It is interesting that the predictions of the neural network for the extracted 20 test cases was also rather successful: r2=0.88 (Figure 5). The extrapolation predictions made with the EC model (Figure 6) showed a worse agreement with the experimental data (r2=0.62). This is not really surprising since the model constants were calibrated with a different database. There, relatively short glass cell experiments were used (a few days), where lower corrosion rates were measured than in the KSC2 experiments due to the absence of iron carbide films normally developed during more prolonged corrosion tests.

Figure 3. Comparison of the SHELL model with the KSC2 experimental data.

Figure 4. Comparison of the IFE model with the KSC2 experimental data.

Figure 5. Comparison of the neural network model with the KSC2 experimental data.


Figure 6. Comparison of the EC model with the KSC2 experimental data.


A purely empirical CO2 corrosion model based on a neural network coupled with a genetic algorithm and an evolved parameter approach was developed in this study. The performance of the neural network model validated against a large experimental database has demonstrated superior predictive performance compared to two other well known semi-empirical models from the open literature. The neural network model also demonstrated better predictive capabilities when compared to a purely mechanistic electrochemical CO2 corrosion model (although the latter model was calibrated with a different data set, and is therefore extrapolating outside the bounds for which it was developed).

Future Work

A few different directions are envisioned for further development of the neural network model:


The experimental database and initial support for this project was provided by the Institute for Energy Technology in Norway. Their contribution to this project is greatly appreciated. Funds for further development of the neural network have been obtained from the Australian Research Council. The current research program is open for new participants. If you are interested please contact .


1. C. de Waard and D. E. Milliams, "Prediction of Carbonic Acid Corrosion in Natural Gas Pipelines", First International Conference on the Internal and External Corrosion of Pipes, paper F1, University of Durham, UK, 1975.

2. L. G. S. Gray, B. G. Anderson, M. J. Danysh, P. G. Tremaine, "Mechanism of Carbon Steel Corrosion in Brines Containing Dissolved Carbon Dioxide at pH 4", Corrosion/89, paper no. 464, (Houston, TX: NACE International, 1989).

3. S. Nesic, J. Postlethwaite and S. Olsen, "An Electrochemical Model for Prediction of CO2Corrosion", Corrosion/95, paper no. 131, (Houston, TX: NACE International, 1995)

4. C. de Waard and U. Lotz, "Prediction of CO2 Corrosion of Carbon Steel", Corrosion/93, paper no. 69, (Houston, TX: NACE International, 1993).

5. A. Dugstad, L. Lunde and K. Videm "Parametric Study of CO2 Corrosion of Carbon Steel", Corrosion/94, paper no. 14, (Houston, TX: NACE International, 1994).

6. A. K. Sheikh, J. K. Boah and D. A. Hansen, Corrosion, 46 (1990) p. 190.

7. J. W. Provan and E. S. Rodriguez III, Corrosion 45 (1989) p. 178.

8. C. D. Adams, J. D. Garber, F. H. Walters, C. Singh, "Verification of Computer Modelled Tubing Life Predictions by Field Data", Corrosion/93, paper no. 82, (Houston, TX: NACE International, 1993).

9. C. de Waard and D. E. Milliams, Corrosion, 31 (1975): p.131.

10. G. Schmitt and B. Rothman, Werkstoffe und Korrosion, 28 (1977): p.816.

11. J. O .M. Bockris, D. Drazic and A. R. Despic, Electrochimica Acta, 4 (1961): p.325.

12. S. Nesic, N. Thevenot, and J. L. Crolet, "Electrochemical Properties of Iron Dissolution in CO2 solutions - basics revisited", Corrosion/96, paper no. 3, (Houston, TX: NACE International, 1996).

13. M. R. Bonis and J. L. Crolet, "Basics of the Prediction of the Risks of CO2 Corrosion in Oil and Gas Wells", Corrosion/89, paper no. 466, (Houston, TX: NACE International, 1989).

14. L. G. S. Gray, B. G. Anderson, M. J. Danysh and P. R. Tremaine, "Effect of pH and Temperature on the Mechanism of Carbon Steel Corrosion by Aqueous Carbon Dioxide", Corrosion/90, paper no. 40, (Houston, TX: NACE International, 1990).

15. J. Zarka, and P. Navidi, "Clever Optimal Design of Materials and Structures", Proceedings, French-Korean Conference on Numerical Analysis of Structures, Seoul, Korea, 1993.

16. M. Vrhovac, "Combined Empirical and Analytical Modelling of Hardness Softening Due to Particle Coarsening Using Artificial Intelligence Tools", ASME 95 Congress, IMECE Proceedings, MD-Vol. 69-2, San Francisco, California, USA, November 12-17, 1995.

17. M. Vrhovac, C. R. João and R. Rodrigues, "Automation of Microstructure Analysis by Artificial Intelligence Image Processing ", Int. Conf. SMIRT 13, Post Conference Seminar: "Applications of Intelligent Software Systems in Power Plant, Process Plant and Structural Engineering", São Paolo, Brasil, August 21-23, 1995.

18. P. Simpson, "Artificial Neural Systems", Pergamon Press, New York, 1990.

19. P. Wasserman, " Neural Computing, Theory and Practice", Van Norstrand Reinhold, New York, 1989.

20. W. C. Carpenter, and M. E. Hoffman, "Training Backprop Neural Networks", Journal "AI Expert", p.30-33, A Miller Freeman Publication, USA, 1995

21. C. de Waard, U. Lotz and A. Dugstad, "Influence of Liquid Flow Velocity on CO2 Corrosion a Semi-Empirical Model", Corrosion/95, paper no. 128, (Houston, TX: NACE International, 1995).