Predicting Corrosion Rates Based on Recurrent Neural Networks

Predicting Corrosion Rates Based on Recurrent Neural Networks

In chemical plants, various process equipment are usually connected by pipelines. Therefore, pipelines are known as the “veins” of the chemical plant, serving the role of transporting various process media. The damage to pipelines during operation is often caused by corrosion. According to statistics, the losses caused by metal corrosion in China exceed 40 billion yuan annually. Therefore, studying the corrosion of pipelines has considerable economic benefits.

Efficient corrosion monitoring and early warning capabilities can effectively prevent pipeline corrosion, thus avoiding related accidents. During operation, pipelines face medium scouring, acidic ion corrosion, and hydrogen corrosion. Pipeline corrosion varies with different process environments and media, and the corrosion mechanism is quite complex.

Improving process conditions and equipment materials can enhance the safety management of pipelines. Additionally, predicting corrosion rates and providing early warnings for pipeline corrosion failures can also provide a strong theoretical basis for safety managers to formulate pipeline maintenance management plans.

Predicting Corrosion Rates Based on Recurrent Neural Networks

1

Artificial Neural Networks

Neural networks mimic the structure of neurons and synapses in the brain, transforming data models into network structures as shown in Figure 1. The existence of hidden layers and weight functions greatly increases the complexity of neural networks. During the training process, the data from the input layer is summed and delivered to the neurons in the next layer, and then after passing through the activation function, it possesses the ability to express non-linearity.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 1 Schematic Diagram of a Three-Layer Neural Network

Predicting Corrosion Rates Based on Recurrent Neural Networks
Predicting Corrosion Rates Based on Recurrent Neural Networks

2

Recurrent Neural Networks

Recurrent Neural Networks (RNN) improve upon neural networks by processing data with sequential characteristics. The neurons in the hidden layer are interconnected through new weight connections, making the neurons in the hidden layer not independent but related to the previous step’s neurons in the sequence, as shown in Figure 2.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 2 Schematic Diagram of a Three-Layer RNN

The weight connections allow the neurons in the hidden layer to carry information from the previous sequence of neurons and process time series data. The mathematical expression for the hidden layer neurons is: S(t)=f[wx·x(t)+ws·x(t-1)], where S(t) is the value of the hidden layer neuron at time t; f(x) is the activation function; w is the weight; x(t) is the time series value at the input at time t.

For the output layer, the mathematical expression is: y(t)=g[wy·S(t)], where y(t) is the result of the output layer at time t; g(x) is the activation function; w is the weight.

By inputting time series data into the RNN for training and prediction modeling, the output data y(t+1) for the next time step is obtained through the current output data y(t) and the input data at (t-n) after weight training. The training ends once the RNN time series model for predicting corrosion rates is established, and based on this model, the next moment’s data can be calculated, thus achieving the prediction of pipeline corrosion rates.

Predicting Corrosion Rates Based on Recurrent Neural Networks
Predicting Corrosion Rates Based on Recurrent Neural Networks

3

Case Demonstration

Using corrosion rate data monitored by a corrosion probe from a chemical plant over 1000 hours, an RNN time series model was established and its effectiveness was validated. The first 90% of the data was selected as training data for RNN modeling, while the last 10% was used as testing data to validate the prediction model’s effectiveness.

During the RNN training modeling process, the first seven sets of data from the training data were used as input data, while the eighth set was used as output data for training. The number of hidden layer neurons was set to 15, and the number of iterations was 2000. The training results are shown in Figure 3.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 3 Fitting Results of Training Data

As seen in Figure 3, after iterative training, the output values based on RNN can fit the true values of the training data. Therefore, the output results of the trained RNN can reflect the changing patterns of corrosion rates in the training data.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 4 Relative Error of Fitting Results of Training Data

From Figure 4, it can be seen that the relative error of the fitting results of the training data is small, thus it can be concluded that a mathematical prediction model based on 900 sets of corrosion rate training data has been established through RNN, and this model has learned the changing patterns of corrosion rates.

The last 10% of the corrosion rate data was used as testing data to verify the effectiveness of the RNN prediction model. The first seven sets of data from the testing data were input into the trained RNN model, and the output results were the predicted results, which were compared with the eighth set of data, the true value, as shown in Figure 5.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 5 Prediction Results of Testing Data

From the prediction results of the testing data, it can be seen that the corrosion rates predicted based on RNN are consistent with the trends of the true corrosion rates, and the predicted results reflect the changing patterns of corrosion rates. The maximum relative error between the testing data and the predicted values is within 15%, as shown in Figure 6. Additionally, the mean square error between the two was calculated to be 0.00824%.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Figure 6 Relative Error of Testing Data

Thus, the prediction results of the testing data can prove the effectiveness of the corrosion rate prediction model established through RNN. This RNN model can predict the corrosion rate for the eighth hour based on the corrosion rates of the previous seven hours, providing information for the factory’s corrosion early warning management decisions.

Predicting Corrosion Rates Based on Recurrent Neural Networks

Conclusion

Predicting Corrosion Rates Based on Recurrent Neural Networks

The RNN hidden layer neurons can transmit information from previous sequence data to the next layer of neurons, providing a theoretical basis for predicting corrosion rates. By inputting data monitored by field corrosion probes into the RNN for training modeling and validation, the results show that RNN can learn the changing characteristics of corrosion rates after iterative training, predicting the corrosion rates for the next moment and providing effective early warning information for field corrosion decision-making.

Author: Jiang Haisheng (Coking Plant of National Energy Group Coal Coking Co., Ltd.)

Nurshaiti Nurdong, Liu Junheng (Beijing University of Chemical Technology)

Corresponding Author Introduction: Nurshaiti Nurdong, Master’s student, primarily engaged in corrosion prediction research.

Source: “Corrosion and Protection”, Issue 11, 2023

Predicting Corrosion Rates Based on Recurrent Neural Networks

Leave a Comment