Prediction Model of Corrosion Current Density Induced by Stray Current Based on QPSO-Driven Neural Network

e buried pipelines and metallic structures in subway systems are subjected to electrochemical corrosion under the stray current interference. e corrosion current density determines the degree and the speed of stray current corrosion. A method combining electrochemical experiment with the machine learning algorithm was utilized in this research to study the corrosion current density under the coupling action of stray current and chloride ion. In this study, a quantum particle swarm optimization-neural network (QPSO-NN) model was built up to predict the corrosion current density in the process of stray current corrosion. e QPSO algorithm was employed to optimize the updating process of weights and biases in the articial neural network (ANN).e results show that the accuracy of the proposed QPSO-NN model is better than the model based on backpropagation neural network (BPNN) and particle swarm optimization-neural network (PSO-NN).e accuracy distribution of the QPSO-NNmodel is more stable than that of the BPNN model and the PSO-NN model. e presented model can be used for the prediction of corrosion current density and provides the possibility to monitor the stray current corrosion in subway system through an intelligent learning algorithm.


Introduction
Stray current is de ned as electric currents owing along other elements, which are not components of the purposebuilt electric current [1].Stray current can originate from electri ed traction system, o shore structure, marine platforms, cathodic protection system, etc. Stray current leakage and its corrosion in the direct current (DC) mass transit system are shown in Figure 1.Stray current will cause electrochemical corrosion in some of the infrastructure, such as the running rails [2], buried pipelines [3], and concrete structures [4,5], which overall reduces the safety performance of the DC mass transit system.In particular, it needs to be explained that most pipelines consist of carbon steel, which makes corrosion one of the most common integrity threats of these systems [6].In some extreme cases, severe structural damage has occurred as a result of stray current leakage [7].
e reasons for stray current formation are diversi ed and complex and are easily a ected by many factors, such as stray current density, structure of buried metal, salt content and composition, soil moisture content, soil texture and tightness, organic content, and temperature.
In the face of rapid development of urban rail transit, it is especially important to understand and monitor the process of stray current corrosion that happens in the DC transit system.e existing monitoring of stray current corrosion is mainly conducted through reference electrode.However, problems existed.For example, the polarization potential of reference electrode sometimes cannot represent the corrosion status of buried pipelines accurately due to the in uence of IR drop and internal reactants.e faulty reference electrode is hard to replace in the subway system because it is di cult to excavate the electrode from the concrete structure in order to ensure the overall strength of the system.Besides, because the subway system is difficult to make structural changes after completion, accurate corrosion monitoring without excavation is especially important.erefore, a method for accurately establishing the mapping relationship between the external environment factors and corrosion status is urgently needed.Based on Faraday's law, corrosion current density i corr is an important parameter in the direct evaluation of stray current corrosion.e corrosion current density not only reflects the degree of stray current corrosion but also the corrosion rate.Corrosion current density is affected by external factors during stray current corrosion.Since the stray current corrosion is a complex process with multiple factors, it is difficult to accurately establish the relationship between external factors and corrosion current density through numerical modelling.e prediction of corrosion current density by a machine learning algorithm is of great practical significance for the evaluation of stray current corrosion state.
As an effective tool to study the corrosion process, many methods based on the machine learning algorithm have been employed, such as the backpropagation neural network (BPNN) model [8,9], radial basis function (RBF) neural network model [10], support vector machine (SVM) model [11,12], self-organized map (SOM) model [13], and grey theory model [14].e intelligence algorithm is often utilized to predict the corrosion current density in steel reinforced concrete structures [13], polarization potential [10], stray current density [8], weight loss [14], corrosion rate [11], corrosion hazard classification of stray current [15], and so on.In the last few years, artificial neural network (ANN) has emerged as powerful devices that can be used in many engineering applications [16][17][18][19][20][21]. e ANN has been widely employed in the field of corrosion prediction.Some important research results on corrosion prediction have been carried out based on the ANN [22][23][24].e main advantage of ANN is its outstanding capabilities in capturing the nonlinear relationships between input and output corrosion data sets.
However, some problems also exist in the application of ANN, such as weak global search ability, and poor robustness, and it is easy to fall into local minimum value.erefore, many algorithms such as the genetic algorithm (GA) [25,26], gravitational search algorithm (GSA) [27], and particle swarm optimization (PSO) [28,29] are utilized to optimize the ANN.
In this paper, stray currents existing in the main structure of the subway systems, buried pipelines, and metal structures around the system are studied using the intelligent algorithm-based method combining with an electrochemical experiment.NaCl is an important composition of the extracted soil solution [3].us, the NaCl solution is adopted as the corrosive medium in this study.e quantum particle swarm optimization-neural network (QPSO-NN) model is established to predict the corrosion current density under the coupling excitation of stray current and chloride ion.e quantum particle swarm optimization (QPSO) is utilized to optimize the weight and threshold of each layer.Compared with PSO, QPSO has less parameters, better robustness, and faster convergence rate [10], which has been successfully employed in many optimization problems [30], including the neural network [31].However, the QPSO algorithm is rarely utilized in the field of corrosion prediction, especially the electrochemical corrosion induced by stray current, in which some new explorations and attempts are needed to improve the performance of stray current corrosion prediction.QPSO can better converge to the global best, shows strong global search ability, and local search ability, which is not easy to fall into the local best [32,33].e database for training the QPSO-NN model is collected from the electrochemical experiment of Q235A.
Aiming at stray current corrosion process, the purpose of this paper is to realize the prediction of corrosion current density considering multiple environment factors based on the QPSO-NN algorithm, and then to provide the possibility of accurately monitoring the corrosion status of buried 2 Complexity pipelines without excavation.us, the experimental process is firstly conducted to determine the main factors affecting the corrosion current density and then to set up the prediction database.e rest of this paper is organized as follows: e theory of the proposed QPSO-NN algorithm is described in Section 2. Section 3 introduces the experimental system designed for generating data set for the prediction model of corrosion current density and experimental results.Section 4 introduces the corrosion current density prediction framework and the related technique details.In Section 5, the training process is stated and the QPSO-NN method is compared with the BPNN method and the particle swarm-neural network (PSO-NN) method.Further analysis of parameters in the algorithm is also conducted in Section 5. Section 6 draws the conclusions.

Training Algorithm of the Proposed Model
Based on QPSO  [34].Frank Rosenblatt firstly proposed the perception network model and used it in the computer addition, subtraction, and pattern recognition calculation in 1958 [35].In 1982, the Hopfield model was proposed to provide nonlinear neural summarization for the information storage and extraction functions of the ANN33, in which the dynamic equations and learning equations were also put forward. is model provides theoretical guidance for the construction and learning of ANN [36].e ANN has strong nonlinear mapping capabilities, self-learning and self-adaptive capabilities, generalization capabilities, and fault tolerance.e basic structure of the ANN includes information called the processing unit or node of neuron and the connection relationship of each node, which simplifies the imitation and abstraction of the biological neural network.e neurons in the ANN are classified into three types of layers: input layer, hidden layer(s), and output layer.e relationship between various neurons is a singular relationship, and there is no difference.
e connection weights can be adaptively adjusted through continuous learning.

Quantum Particle Swarm Optimization.
e QPSO algorithm based on quantum behavior is generated from the classical PSO algorithm.It is mainly combined with the improvement of quantum theory behavior, which improves the global optimization performance of the algorithm.In quantum mechanics, the state of a particle is described by a wave function Ψ(X, t), which is a complex function of the particle position X (X is a position vector) and time t. e physical meaning of the wave function can be expressed as the square of the wave function modulus represents the probability density at which the particle appears at spatial position X.By integrating the wave function over entire space, the sum of the probability of particles appearing at various points in space is obtained.In n-dimensional space, one-dimensional potential well δ at the centre of p i for each dimension is defined, in coordination with the attractor p i � (p i1 , p i2 , . . ., p iN ).Each particle converges to a certain area by an attractor p i .e position coordinate of the attractor p i is as follows: where r 1,j , r 2,j , and φ i,j are all independent random positive real numbers between [0, 1]; P i,j (t) represents the local optimal position of attractor p i ; G j (t) represents the global optimal position of the population; c 1 and c 2 is local cognitive coefficient and overall cognitive coefficient, respectively.
According to the theory of quantum mechanics, the dynamic behavior of particles in quantum space can be described by Schrödinger equation.In the QPSO algorithm, the wave function in the Schrödinger equation is used to express the position of the particles in the quantum particle space.e wave function of a particle with the position of X i,j (t + 1) in each dimension for p i,j can be obtained as follows: After the probability density function for a particle appearing at a certain point in the quantum space is calculated, the Monte Carlo method is employed to obtain the position equation of the particle.e position equation is given in the following equation: e L i,j (t) in equation ( 4) is the characteristic length of the potential well δ, which is calculated as follows: where α is the contraction-expansion coefficient, the only parameter in the QPSO algorithm except from population size and iteration times.e mean best position mbest(t) in equation ( 6) is the individual optimal mean of all particles, which is defined as follows:

Complexity
In equation ( 7), P ij (t) represents the individual best position of the j th dimension of the i th particle at the t th iteration.For minimization, the smaller the objective function value, the better the fitness it corresponds to.When the current position of the i th particle is X i (t) � [X i,1 (t), X i,2 (t), . . ., X i,D (t)] (i � 1, 2, . .., M), the current individual optimal position of the i th particle can be updated through equation (8), where f( ) is the object function.e current global optimal position G(t) can be obtained through equation (9), where Finally, the evolution formula of the QPSO can be expressed as follows: where f ij (t) � rad( ) and u ij (t) � rad( ); the function rad f( ) produces a random number that is uniformly distributed between [0, 1]; the function Rand(t) in equation ( 11) is given as follows: M is the total number of particles; D is the dimension of the particle; RP ij (t) is the random point between the individual optimal position of the i th particle at the j th dimension P ij (t) and the global optimal position at the j th dimension G j (t); φ j (t) is the random number between [0, 1]; and a(t) represents the contraction-expansion coefficient of QPSO, which is an important parameter of convergence.
e value of a(t) depends on the situation, which can be dynamically changed in a certain way.e variable a(t) can be determined according to the following formula: e m and n in equation ( 13) usually are set as 1 and 0.5, and the MaxTimes represent the maximum number of iterations.
e flow of the QPSO algorithm is stated in detail as follows: (1) Randomly initialize the initial position of M particles X i (0), and set the current best position of each particle as P i (0) � X i (0); the initial global optimal value is the minimum value of the local optimal values of all current particles (assuming to find the minimum value of the function as an example), which is P g (0) � min X 1 (0), X 2 (0), . . ., X D (0)   (2) Calculate the fitness value of particles according to object function f[X i (t)] (3) Update current position of each particle X i (t) based on the calculated current fitness value (4) Compare the last individual optimal values P i (t − 1) with current position of each particle X i (t) to update current individual optimal position of each particle P i (t) through equation ( 8) and update current global optimal position G(t) through equation ( 9) (5) Compare current global optimal position G(t) with last global optimal position  [37].e specimens of 20 mm × 20 mm × 7 mm in size were adopted, and all the surfaces were subsequently grounded with 80, 240, 400, 600, 800, 1000, 1500, 2000, and 5000 sandpaper and cleaned by acetone and anhydrous ethanol.e epoxy resin was utilized to isolate the contact of the other five faces with the NaCl solution, and a working surface of 20 mm × 20 mm was left for the stray current corrosion.
In this paper, the accelerated simulation corrosion was conducted by the experimental system shown in Figure 2. A DC power supply is employed to apply the excitation of 0.0125 A/cm 2 , 0.025 A/cm 2 , 0.05 A/cm 2 , and 0.075 A/cm 2 , respectively.
e input current is chosen based on the previous field test in a DC transit system with a directly grounded scheme, which is conducted through a noncontact fibre-optic current sensor embedded in the flange joint of the buried pipeline [37].When the stray current corrosion was conducted for 10 min, the Tafel curve was tested until a total corrosion time of 60 min is reached.In this experimental system, the time of each corrosion interval is realized through the switch S1.A system of three electrodes was used in the corrosion cell.e preparation of NaCl solution was carried out using the 4 Complexity chemically analytical grade reagents, the pH of which is 7.1.e concentration of NaCl solution is 0.05 mol/L, 0.1 mol/L, 0.2 mol/L, and 0.3 mol/L, respectively.e redox characteristic was changed by adding FeCl 3 to the solution.
e counter electrode used in this experiment is a 4 cm 2 Ti electrode, and the reference electrode is a saturated calomel electrode (SCE).e potential values shown here and in the next are of the relative SCE.ere is a maintained gap of 15 mm between the counterelectrode and counterelectrode during each measurement.A CHI604e electrochemical workstation was employed as the electrochemical measurement instrument.During electrochemical testing, the test loop is independent of the applied DC loop.Each time before the testing of Tafel polarization curves, the opencircuit potential (OCP) needs to be measured to ensure scanning range.e potential scanning direction in the Tafel method is from negative to positive.e potential range of each scan is based on the testing result of OCP. e scanning rate utilized in the Tafel method was set to 2 mV/s.All experiments were performed in an indoor environment at 20 °C.e solution remained undisturbed during polarization curve measurement.

Experimental Results and Database.
In the case of excitation amplitude of 0.025 A/cm 2 , the polarization curve under stray current corrosion in the initial oxidation-reduction potential of 230 mV and 0.2 mol/L NaCl is shown in Figure 3.
e complete cathode and anode processes are exhibited on the polarization curve in Figure 3 during the stray current corrosion of different electrolyte concentrations.Taking the curve of 10 min as an example, there is an exponential increase of i corr due to the oxidation reaction of steel electrode in the anodic polarization zone, which can be explained by Bulter-Volmer equation.e Bulter-Volmer equation is given in equation ( 14), where I is the polarization current, I a is the anodic current, I c is the cathodic current, I corr is the corrosion current, E represents the applied potential, E corr represents the corrosion potential, β a is the anode Tafel slope, and β c is the cathode Tafel slope.Under this circumstance, the corrosion current density measured at different corrosion time is illustrated in Figure 4. e e experimental database is obtained from the electrochemical corrosion experiment stated above.e stray current density I s , corrosion time t corr , chloride concentration Cl%, and oxidation-reduction potential ORP were set as input valuables.e corrosion current density i corr was set as output valuable.
e correlation coefficient values between input variables and i corr were calculated to demonstrate that there is a strong correlation between these parameters and i corr , as shown in Figure 5. e correlations were investigated using Pearson's, Spearman's, and Kendall's correlation coefficients.e absolute correlation coefficients of four input variables range from 0.6071 to 0.8680, which indicates that these parameters are of great significance in predicting the i corr in the QPSO-NN model.

Corrosion Current Density Prediction Framework
4.1.Overall Framework and Algorithm Description.e whole prediction algorithm can be divided into preparation phase, optimization phase, training phase, and prediction phase.e backpropagation (BP) learning is to generate a final prediction model.e QPSO algorithm is employed to search for the suitable connection weights and biases for the initial structure of the neural network.e framework of the QPSO-NN method for predicting corrosion current density is shown in Figure 6.In the QPSO-NN algorithm, the NN training process is embedded in the fitness calculation function for processing.e NN training phase is continuously cycled throughout the prediction algorithm.e algorithm flow is given specifically as follows: (1) Prepare the training and validation data sets and set the training ratio, validation ratio, and testing ratio in data normalization process (2) Initialize the input weights, output weights, and hidden biases of NN structure, establish the initial NN model, and initialize the vector containing optimization object (3) Update particles according to the QPSO evolution equations ( 10) and (11), which has been stated in Section 2 (4) Update the parameters for each particle according to the global optimal solution gbest in the QPSO algorithm (5) When the weights and the hidden biases are updated, the NN model will be correspondingly updated with new parameters (6)   Complexity calculation method will be explained detailedly in equation ( 16)) (7) Judge whether meeting end of criterion, if yes, obtain the optimal input weights, output weights, and the hidden biases; if not, jump to step 3 (8) Establish the optimal NN model based on the optimization results returning from QPSO (optimized weights and biases) (9) Predict corrosion current density based on the built QPSO-NN model (10)  e parameters of the QPSO-NN are given in Table 2.
e input weights, hidden biases, output weights, and output biases are the optimization target of the QPSO algorithm.e details of the QPSO-NN algorithm are shown in Figure 7. e number of hidden nodes m remains to be determined in the next section.
(1) Encoding for particle in QPSO and pretreatment for data set in the NN: the structure of the ANN model is shown in Figure 5.A position vector of particle p j is built up to store the parameter information of the ANN.e vector consists of four parts: input weights between input layer and hidden layer: ω ih(1,1) ,  . . ., ω ih(4,1) , . . ., ω ih(1,m) , . . ., ω ih(4,m) }, hidden biases on hidden layer: θ 1,1 , θ 1,2 , . . ., θ 1,m  , output weights between hidden layer and output layer:  (2) Data normalization: before the training and optimization process in the QPSO-NN model, the data set needs to be normalized to induct statistical distribution of unified samples and eliminate the dimensional impact between input indicators.In this model, linear min-max normalization was employed.
Taking the input parameter stray current density I s as an example, the I i s is mapped to I i * s through equation the following equation: where I min and I max is the minimum and maximum of stray current density I s in the input samples.(3) Optimization process in QPSO: in general, two termination conditions can be chosen: the max generation G max is met or the deviation between adjacent generations is within a specified range [38].
In this model, the max generation G max is utilized as the termination condition.e particle p m (1 ≤ m ≤ G max ) is updated for each searching process until the G max is reached, as shown in Figure 6.(4) Fitness function in the QPSO-NN model: when a search process is finished and a particle is updated with the determined weights and biases, the fitness of this particle p j needs to be calculated to evaluate the performance of these structure parameters of the ANN.In this model, the fitness function is defined as equation ( 16). e calculation results of fitness will be discussed in Section 5 to determine the best topological structure of the ANN: where I i is the real value of i corr , I i ′ is the predicted value of i corr , and batch is the number of training set during one training session.

Training Process.
In this section, the effectiveness of the QPSO-NN is validated through experiments on the experimental data.e work in this paper is mainly to improve the performance of the traditional NN for the i corr prediction problem in the process of stray current corrosion.Hence, the specific contrast between the QPSO-NN algorithm and the basic PSO-NN algorithm and the proposed QPSO-NN algorithm is indispensable in the next section.In the experiments, the QPSO-NN and the PSO-NN were implemented on MATLAB software, and the prediction process of the BPNN was realized by using the toolbox in the MATLAB.ere is one more important parameter that needs to be determined, which is the number of hidden nodes in the NN.
e number of hidden nodes in the NN is selected according to the calculation results.Figure 8 gives the value of fitness

Output variable
Input variable ω ih (3,m) ω ih (1,1) ω ih (2,1) ω ih (4,m) ω ih (2,m) ω ih (1,m) ω ih (4,1) ω ih (3,1) ω ho (1,1) ω ho(m,1) ω ho (1,1) ω ho(m,1) ω ih (1,1) Cl% ORP Figure 7: Structure of the ANN and encoding details in QPSO.8 Complexity function corresponding to the number of hidden nodes.It can be observed from Figure 6 that the lowest validation is achieved, when the number of hidden nodes is 7. us, the basic topological structure of the QPSO-NN is determined as 4-7-1.e experiments were performed on a computer running 64 bits Windows 10 system.In order to perform quantitative comparison, the following indexes are used to measure the performance of each prediction model, such as the precision, mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE), proportional error (PERR), and coefficient of determination: where n is the number of samples; i ∈ [1, n]; I i ′ is the predicted value; I i is the measured value; and I is the mean value of I i .

QPSO-NN vs. BPNN and PSO-NN.
Comparative study needs to be conducted first to determine the proposed model for corrosion current density is effective.While comparing the QPSO-NN with the BPNN and PSO-NN, 100 runs are repeated to get the average value of prediction results.Based on the prediction results in Table 3, a higher prediction accuracy of the QPSO-NN is always observed regardless of the proportion of training set, compared to the BPNN and PSO-NN.ere is about 7 to 9 percent difference in prediction accuracy between BPNN and QPSO-NN, while the difference between the PSO-NN and the QPSO-NN is about 5 to 6 percent.e biggest difference in accuracy between the BPNN and the QPSO-NN is 9.39%, while the biggest difference between the PSO-NN and the QPSO-NN is 6.64%.To quantitatively verify the advantage of the QPSO-NN over traditional algorithms, an analysis of variance (ANOVA) test is employed for evaluating the difference among the BPNN, PSO-NN, and QPSO-NN.As can be seen from the 6 th and 8 th column in Table 4, the P values of the data column among the BPNN, PSO-NN, and QPSO-NN in all cases of the proportion of all training set are far less than 1 × 10 − 4 .us, a conclusion can be drawn from Table 4 that the proposed QPSO-NN model is obviously more applicable than the PSO-NN and BPNN for this prediction problem.
Although the precision of the QPSO-NN model is proved to be better than the PSO-NN and the BPNN model through the general statistics analysis like mean value, the comparison conducted above is rough.Furthermore, a deeper analysis is indispensable to be carried out.In this analysis, the accuracy distribution of each algorithm is conducted after running 100 times.e corresponding results of the BPNN, PSO-NN, and QPSO-NN with six different proportions of training set are illustrated in Figure 9.With the ratio of the training set increasing from 40% to 80% in Figures 9(a)-9(e), the distribution range of QPSO-NN's accuracy in 100 trials is smaller than that of QPSO-NN's and BPNN's.e QPSO-NN exhibits a better performance and higher stability than the PSO-NN and BPNN in the prediction problem of corrosion current density induced by stray current.us, the strategy of using QPSO instead of PSO to optimize neural networks is effective, which improves the accuracy of the prediction.In the case of ratio � 90%, the highest and lowest prediction is 98.32% and 81.22%, and the mean precision is 91.95%.
Next, the effect on prediction precision due to different proportions of training set is analysed in this section.e effect of ratio on the precision results is shown in Figure 10.No matter the population size is 60 or 80, the prediction precision of the QPSO-NN, PSO-NN, and BPNN gradually increases with the increasing proportion of the training set.With population size of 60, the precision increases from 88.60% to 90.77%.e precision increases from 89.51% to 91.95% when the population size is 80. us, the precision is improved by 2.17% and 2.44%, which indicates that the ratio of training set has little influence on the prediction accuracy.
When the ratio of training set is 80% and parameters are used as given in Table 2, the prediction results of the QPSO-NN, PSO-NN, and BPNN are intuitively illustrated in Figure 11.e testing set contains 50 samples.e precision of three algorithms is 82.86%, 85.38%, and 90.32%, respectively.Compared with the BPNN and PSO-NN, the predicted results of the PSO-NN are more consistent with the measured results.e evaluation indexes MAE, MSE, and RMSE are shown in Table 4. e MAE, MSE, RMSE, and PERR of prediction results in the QPSO-NN model are smaller than those in the BPNN model and PSO-NN model, which also indicates the prediction accuracy of the QPSO-    e regression lines between tested and predicted values of three algorithms are displayed in Figure 12. e correlation coefficient of determination R 2 is calculated so as to test how well the model fits the sample observations.e model is considered to be more successful when the R 2 is close to 1. e correlation coefficient of determination for the BPNN, PSO-NN, and QPSO-NN is 0.9440, 0.9552, and 0.9867, respectively.e regression lines are given in equations ( 18)- (20).
e results of correlation coefficient also demonstrate that the QPSO-NN model shows better accuracy than the PSO-NN model and BPNN model: Regression Line 2 : y � 0.9158x + 0.0575, Regression Line 3 : y � 1.0760x − 0.0222.
Based on the comparison analysis from multiple aspects in this section, a higher precision is achieved by the QPSO-NN model regardless of the ratio of the training set.In terms of computational efficiency, the QPSO-NN model costs a relatively longer time than the BPNN due to the optimization process of the QPSO algorithm.Since the corrosion is a longterm process, real-time performance is not a major factor in corrosion current density prediction, which means the offline analysis can be performed based on the collected data.
erefore, the model based on the QPSO-NN algorithm is feasible and more resultful for this prediction problem.

Analysis of Training Times of NN.
e parameter of training times represents the times of iterations for optimizing the configuration of a neural network during the training process [39], which affects the performance of the neural network.To investigate its effect on the prediction accuracy, the corrosion current density prediction under two different proportions of training set (60% and 80%) is conducted with varied training times of the NN. e results are illustrated in Figure 13.
Based on the results in Figure 13, with the ratio of training set = 60%, the average precision is 87.40% when the training times of the NN is 100, and the average precision is 90.44% when the training times of the NN is 400.When the training times of the NN is 100 and 400, the average precision is 88.13% and 91.62%, with the ratio of training set = 80%, respectively.In both cases, the average precision is improved by 3.04% and 3.49%.us, the training times of the NN have a little impact on the precision.However, there is no further increase in accuracy when the training times of the NN is bigger than 300, as can been seen from Figures 13(a) and 13(b).When the training times of the NN is bigger than 300, the increase of training times will not significantly improve the prediction accuracy but increase the algorithm runtime.
In terms of distribution of precision, the mean precision is looser when the training times of the NN is small.With the 12 Complexity increase in training times, the distribution of mean prediction is more concentrated, which indicates that the algorithm is more stable.

Analysis of Population
Size.Generally speaking, the population size of whole particle is a significant parameter that has an impact on the convergence speed, accuracy, and stability of QPSO.In order to evaluate its impact on the QPSO-NN, the population size varies from 20 to 80, and then the results corresponding to each parameter are compared for difference.
As can be seen from Figure 14, the prediction accuracy of the QPSO-NN increases rapidly with the increasing population size no matter how much the proportion of the training set is.Furthermore, the mean precision is compared when the ratio of training set is 80% and 90%.In Figure 14(a), the average precision is 88.92% when the population size is 20 and the ratio of training set is 80%, while the average precision is 91.34% when the population size is 80 and the ratio of training set is 90%.In Figure 14(b), the average accuracy is 88.91% when the population size is 20, and the average precision is 91.95% when the population size is 80.When the population size varies from 20 to 80 in both cases, the average precision is increased by 2.42% and 3.04%.

Analysis of Max Generation QPSO.
e max generation of QPSO affects the optimization process to a large extent, which determines the effectiveness and efficiency of the search process.erefore, it is essential to study the impact of the maximum generation G max on the QPSO-NN.In this section, the max generation of QPSO was examined from 50 to 300, in the step of 50, with the ratio of training set � 60% and 80%, respectively.e prediction results are shown in Figure 15.
It can be seen from Figure 14 that QPSO-NN's mean precision increases slowly with the increasing max generation QPSO.In Figure 15(a), the average precision is 87.31% when G max � 50, while the average precision is 90.10% when

Complexity
G max � 300.Under this circumstance, the prediction accuracy is improved by 2.79%.In Figure 15(b), the average precision is 89.16% when G max � 50, while the average precision is 91.34% when G max � 300.
e prediction accuracy is improved by 2.18% on this occasion.us, the increasing max generation of QPSO makes little contribution to the improvement of precision.
In addition, the mean precision is relatively loose-distributed in the low G max .When the G max increases, the distribution of mean precision becomes narrower, which means the prediction performance is more stable than the lower G max .However, the distribution of mean precision does not stay monotonically increasing over the G max but the trend is increasing.

Conclusions
In this paper, a QPSO-NN model was proposed to predict the corrosion current density i corr under the coupling effect of stray current and Cl − ion, in which the corrosion time t corr , oxidation-reduction potential ORP, stray current density I s, and chloride ion concentration Cl% were set as input variables.e database was generated from a stray current electrochemical experiment.
e QPSO-driven neural network was compared with the BPNN model and PSO-NN model and proved to be with better accuracy.Compared to the BPNN model and PSO-NN model, the prediction accuracy of the QPSO-NN model is more stable.
e best average prediction accuracy of the QPSO-NN during 100 trials is 91.95%.
e proposed model indicates that the QPSO-NN model exhibits a theoretical value in the prediction of corrosion current density i corr under the coupling effect of stray current and Cl − ion.e max generation of QPSO, training times of the NN, ratio of training set, and population size of QPSO show little impact on the precision of prediction accuracy.
e model built up provided the possibility to monitor the corrosion status of buried metallic pipeline based on the information measured without excavation.e proposed model is designed for the prediction of corrosion current density for Q235A steel.However, buried pipelines contain a variety of metals, stray current corrosion characteristics of which are different.Future work will concentrate on predicting the corrosion current density under the coupling action of stray current and multiple ions regardless of the type of buried pipeline metal.To establish the prediction model dealing with different pipeline metals, new database has to be created through extra electrochemical experiments.

Figure 1 :
Figure 1: Stray current in the DC mass transit system.

Figure 2 :
Figure 2: Experimental system of electrochemical corrosion under the coupling excitation of stray current and Cl − ion.

Figure 6 :
Figure 6: Structure of the ANN and encoding details in QPSO.

Figure 8 :Figure 9 :
Figure 8: Fitness versus number of hidden nodes in the ANN.

Table 2 :
Parameters of the QPSO-ANN algorithm.

Table 4 :
Evaluation indexes on prediction results.