Radial Basis Function Neural Network for Electrochemical Impedance Prediction at Presence of Corrosion Inhibitor

Simulation and preparing predictive model of electrochemical impedance Nyquist plots based on radial basis function neural network (RBFNN) are presented in this paper. The RBFNN as a powerful predictive system predicts the real and imaginary parts of impedance as a function of time, temperature and inhibitor concentration. The mean R value of 0.9996 as regression coefficient and mean square error (MSE) value of 1.72 × 10 −3 as results show the validity of proposed method for simulation and prediction of electrochemical impedance spectroscopy (EIS) in different environmental situations.


Introduction
One of the serious problem in oil and gas production technology is corrosion that mainly occurred by carbon dioxide (CO 2 ) as sweet corrosion and/or hydrogen sulfide (H 2 S) as sour corrosion in water injection system [1].The usage of inhibitors in oil industry is currently prevalent because of the effectiveness and low cost such as nitrogen based inhibitors [2].The adsorption ability depends on the sort of corrosion environment, the kind and surface of metal and inhibitor chemical structure [3].Many studies are performed recently to model the experimental corrosion data.Artificial neural network (ANN) is used to predict metal corrosion manner in [4].The issue of whitening environment on pitting corrosion is analyzed in [5].
The electrochemical impedance spectroscopy (EIS) is an approach to investigate the metal kinetic and electrodeposition information.One of the most relevant techniques to obtain this information is the simulation of the system impedance [6].The multi-layer perceptron (MLP) is used to simulate and to plot the electrochemical impedance spectroscopy diagram in [6] and [7].In [7], the steel EIS in a corrosive environment is studied considering the corrosion inhibitor concentrations as 5 and 25 ppm, and two MLPs are trained separately according to each of these corrosion inhibitor concentration database.Inputs of MLPs were time and real part of impedance and the output of MLPs was the imaginary part of impedance.Thus, it can be deduced that the imaginary part of impedance was defined as a function of time and real part of impedance as:

= ( )
, where Z im imaginary part of impedance, Z re is the real part of impedance, t is the time of experiment and f was a function that was approximated by MLP.
In our study, Z im and Z re are both selected as outputs, because they depend on the experiment conditions, and the independent parameters such as temperature, corrosion inhibitor concentration and lapse of experiment time are selected as inputs of the simulation system.So, it can be written: where t is the time of experiment, c is the concentration of corrosion inhibitor and f is a function that is approximated by radial basis function neural network (RBFNN).
In this paper, a new automatic model based on RBFNN is presented to predict various chemical impedance spectroscopy from different inhibitor concentrations and different experiment temperatures during the time in an environment including NaCl and CO 2 to resemble crude oil and transport industries environments.
RBFNN is a special class of single hidden layer feedforward neural network for application to problems of supervised learning.Supervised learning is interpreted as estimating a function from some input-output pairs with little or no knowledge of the form of the function.RBFNN is a technique to approximate function that trained by couples of input-output to implement interpolation [8][9][10].RBFNNs are capable of approximating well any function [11].In this paper, the mean of utilizing RBFNN is to estimate the underlying EIS function and to estimate its output at certain desired values of the input.
In corrosion surveys, electrochemical impedance spectroscopy is a method that use alternating current (AC) exerted over an electrode to gain relevant responds.According to Ohm's laws, the relation between voltage (V ) and current (I ) expresses as follow:

V RI =
where R is resistance.Equation (3) alters to (4) in case of AC signals:

V ZI =
where Z is total impedance that composes of real part as resistance (R ), and imaginary part as reactance (X ): The amount of X depends on applied signal frequency.Equation ( 5) would be rephrased to (6) according to our case study [7]: where w is the applied signal frequency, R S is resistance, R ct and C dl are the electrochemical double layer or charge transfer resistance and capacitance respectively.Theoretically, typical Nyquist plot would be a semicircle [12].

Material and Method 2.1 Experimental Database
The experimental database was prepared in Faculty of Chemical and Petroleum Engineering, University of Tabriz.The material used in the experiments was carbon steel manganese with its main chemical composition as vanadium 0.001 wt.%, niobium 0.055 wt.%, and titanium 0.014 wt.%.
The size of pieces was 0.030×0.30×0.010m.Samples were heated at 1250 °C at a heating rate of 0.4 °C/s, drenched for 90 min.Then, the rolling stage is performed immediately from 1250 °C to 1098 °C in five steps, reaching 42.3% of total deformation hot rolled and an average strain rate of 2.48 s −1 .Then, a cooling stage ending at 867 °C, achieving a total deformation of 37% in five steps with an average strain rate of 2.98 s −1 is performed.The samples were cooled again by forced nitrogen gas to 650 °C.After that, the samples were left to be cool to the ambience temperature.The pieces were polished using 600 grit SIC emery paper and then cleaned with alcohol, acetone, and distilled water.The commercial carboxyamidoimidazoline dissolved in pure 2-propanol was used as inhibitor in this study.The inhibitor was mixed to a solution of 3% NaCl, heated, deaerated by Nitrogen gas and CO 2 -saturated for 120 minutes pre-prepared, continues bubbling and seething during the experiments.The experiments were carried out using signals adjusted by the amplitude of 10 mV and the frequency of 0.1 Hz to 100 KHz applied with a model PC4 300 Gamry potentiostat at the free corrosion potential during 11 hours.Electrochemical impedance spectroscopy tests were carried out at the free corrosion potential.

Radial basis function neural network (RBFNN) architecture
RBFNN were originally developed for exact interpolation of a set of data points in multidimensional space.The aim of exact interpolation is to project every input vector x i , onto the corresponding target y i , to find a function f (x) such that: where i = 1,…,m, m is the number of objects.According to the radial basis function approach, exact mapping can be performed using a set of m basis functions (one for each data point) with the form ϕ (|| x i − x j ||), where ϕ (.) is some nonlinear function, and || .|| denotes distance between x i and x j , usually Euclidean distance.Then the output of the mapping can be presented as linear combinations of these basis functions: where w j denotes weights, x i and x j are input object and center of basis function respectively.The basis functions can have different forms.The most popular among them is Gaussian function: where σ is controlling the smoothing properties of the interpolating function [13].
RBFNN can be presented as a three-layer feedforward structure as shown in Fig. 1.The input layer serves only as input distributor to the hidden layer.Each node in the hidden layer is a radial function as dimensionality being the same as the dimensionality of the input data.The output is calculated by a linear combination i.e. a weighted sum of the radial basis function according to (8) [13].It is easy to determine an equation for obtaining the weights of network by converting ( 8) to the matrix format as: where Y = {y i }, W = {w j } and Φ = {ϕ(|| x i − x j ||}.Then, W matrix is gained by: where Φ −1 is calculated by pseudo inverse as: where Φ T is the conjugate transpose of Φ. The RBFNN is configured and implemented in Matlab software.The network has three inputs and tow outputs as the inputs are time in minute (min), temperature in centigrade (°C) and concentration of inhibitor in gram per liter (g/l), whereas the outputs are real and imaginary parts of impedance in ohm square centimeter.

Results and Discussion
The experimental database was separated to two parts of train part (80% of database) and test part (20% of database).The RBFNN was trained with the train part, then the provided RBFNN was tested with the test part and the results of the prediction are shown in Fig. 2, Fig. 4 and Fig. 6.
Experimental condition of inhibitor concentration of 10 −3 at temperature 25°C, inhibitor concentration of 3 × 10 −5 at temperature 45°C and inhibitor concentration of 5 × 10 −4 at temperature 65°C are selected as samples and the prediction results are shown in Fig. 2, Fig. 4 and Fig. 6 respectively.According to the Fig. 2, Fig. 4 and Fig. 6, it is obvious that the proposed RBFNN can show high performance in predicting electrochemical impedance values with negligible error.The nugatory error indicates that the developed RBFNN technique performs superlatively in regard of predicting electrochemical impedance.The mean square error (MSE) is expressed as: The regression performance of selected sample experimental conditions are shown in Fig. 3, Fig. 5 and Fig. 7 respectively.The regression coefficients of R=0.99991, R=0.99983 and R=0.9976 were obtained for these figures respectively, and the mean regression coefficient for all database was obtained as Mean.R=0.99966, which indicate the high ability of proposed RBFNN for corrosion modeling and predicting studies and can determine different impedance behaviors in various conditions confidently.

Conclusions
This paper presents a radial basis function neural network (RBFNN) prediction and modeling of electrochemical impedance under various conditions such as different inhibitor concentrations, different temperatures during the time.The RBFNN can perform sufficiently with negligible error of prediction.This method can be utilized in modeling, predicting, Nyquist plotting and estimating the electrochemical impedance, corrosion resistance of diverse materials over the wide range of situations.The productivity in this sort of modeling is related to the fact that the developed technique do not need any suppositions in advance on the underlying corrosion type or chemical mechanisms.

Fig. 7
Fig. 7 Regression performance of predicted and actual values of electrochemical impedance in inhibitor concentration of 5 × 10 −4 at temperature 65°C