Application of Machine Learning in the Reliability Evaluation of Pipelines for the External Anticorrosion Coating

The purpose of this research is to enhance the analysis of the reliability status for external anticorrosive coatings. With the limitation and insufficiency of the static evaluation method, we study and construct an evaluation method of dynamic reliability for the anticorrosive layer, integrating the trend analysis of the Markov chain and the set pair theory. This method is implemented by the machine learning software of PyCharm community edition, based on Python language. The algorithm utilizes the connection degree in the set pair theory to determine the risk levels of the anticorrosive coating systems. According to the characteristics of the dynamic change of the anticorrosive layer with time, we built the mathematical evaluation model by combining it with the nonaftereffect property of the Markov chain. Therefore, we can make a dynamic and useful analysis for the reliability grade of the anticorrosive coating and assess the effectiveness grade of the changed reliability for the anticorrosive coating after some time. This method can effectively evaluate the reliability level of the anticorrosion coating through the example of big data of detection points. Under national standards, we provide the theoretical basis for pipeline maintenance within detection cycle requirements.


Introduction
e reliability evaluation of the pipeline external anticorrosive coating is a significant component of pipeline integrity management, which is related to the safety of pipeline energy transportation [1]. e current safety evaluation method mostly belongs to static evaluation. Because of the dynamic characteristics of the external anticorrosive coating, the static evaluation method cannot meet the dynamic requirements of the system in some aspects. eir numerical conclusions are often too simple to express danger. e poor expression of risk tendentiousness and dynamics is not conducive to providing decision-making services to managers [2,3].
According to the research of reliability analysis methods at home and abroad, there are two main categories of external anticorrosion coating for pipelines: the evaluation method of direct safety and the evaluation method of mathematical theory analysis [4]. e evaluation methods of direct safety include the method of fault tree assessment, the safety checklist, the risk matrix diagram, the event tree analysis, the direct assessment method of external corrosion, and the manual of pipeline risk management. ey belong to qualitative or semiquantitative methods. Generally, they can only give the risk levels or relative values, such as high, medium, or low. ey have no unit and dimensional values or accident probability and have certain limitations. e analysis evaluation methods of applying mathematical theory include the analytic hierarchy process, the model method of BP neural network, the grey theory, and the fuzzy evaluation method. e model method of the BP neural network is to use the autonomous learning of neural network models and nonlinear approximations to obtain knowledge. It puts forward the ideas of serial-parallel processing and self-fault tolerance. However, the BP algorithm is only an improved method of nonglobal partial search. It requires that the solution is indeed the global extremum of a nonlinear function, which may cause the algorithm to fall into the local extremum and lead to training failure [5]. e analytic hierarchy process treats complex problems as systems. It decomposes the multiindex or constraint into various levels so as to evaluate and analyze the problems at various levels and find out the decision-making method of multiindex scheme optimization. However, if the amount of index data is too large, it is difficult to solve the eigenvalues and eigenvectors of the matrix, and the weight cannot be determined, resulting in the failure of the analysis. In the process of scheme formulation, the better one can only be selected from the known hierarchical schemes, but the shortcomings of the known schemes cannot be found, and the improvement methods cannot be put forward. So it cannot provide a new scheme for decision-making for evaluation. e fuzzy evaluation method of grey theory is to analyze data by using fuzzy mathematics and the grey system analysis method. However, the algorithms for parameter threshold and correlation degree in its membership function have obvious defects, which will have a great impact on the accuracy of the results [6,7].
Aiming at the limitations and shortcomings of static evaluation, the dynamic evaluation of the deterioration trend of the anticorrosive coating based on the set pair (S.PA) and Markov chain theory is proposed [8,9]. By using the connection degree of S.PA to determine the status of each deterioration grade in the anticorrosive coating, we established the reliability evaluation model of the degradation trend level of the anticorrosion layer [10,11]. Combining the nonaftereffect and homogeneous of the Markov chain, the safety effectiveness of the anticorrosive coating varying at intervals of time is obtained according to the transfer matrix and modification [12,13]. rough the above algorithm, we use the machine learning software of the PyCharm community edition based on the Python language to predict and intelligently analyze the detection data.

Set Pair eory.
Set pair theory uses connection degree to represent the connection component of two sets under the background of a certain problem. e connection degree is expressed by the normalized connection number. at is, U � a + bi + cj. "a" denotes the identity degree. "b" denotes the difference degree. at is, the difference is uncertain, and the characteristics are neither identical nor opposite in the two sets. "i" is a marker symbol or a difference coefficient. "c" is called the opposition degree. "j" is a marker symbol or a degree of opposition coefficient [14]. By using the connection formula of S.PA, we can use this method to describe the deterioration status of pipeline anticorrosive coating [15].

Markov Chain.
It is a method proposed and named by the Russian mathematician Markov to analyze the stochastic process of things. It is different from other methods such as variance analysis and interval estimation. It has the characteristics of no aftereffect. Given the corrosion status of the pipeline anti-corrosive coating, the future corrosion status is only related to the corrosion status at the time of detection, which has the characteristics of the Markov chain. erefore, the corrosion degradation process can be viewed as a Markov chain [16,17].
For the pipeline coating, the transition probability between the degradation states of the coating is only related to the corrosion state. It has nothing to do with the time n of detection. erefore, the corrosion state process can be regarded as a homogeneous Markov chain [18]. at is, in the case of any state i, j ∈ S � {1, 2, . . ., n} (state space), the transition probability P (n) ij of the Markov chain is only related to state i and j. P (1) ij is used to represent one-step transition probability, that is, · · · · · · · · · · · · P n1 P n2 · · · P nn where P (n) � (P (n) ij ) is n-step transition probability matrix, and P (n) ij ≥ 0, k∈s P (n) ij � 1. e n-step transition probability P (n) ij has the following properties [19]: At present, there are four methods for calculating the transition probability matrix, such as the solving method of the inverse matrix, the regression analysis method, the empirical judgment method, and the statistical analysis method.

Statistical Analysis Method.
e statistical analysis method calculates the percentage of one to another state in a certain period under the condition of data accumulation for many years. at is to say, the number m i in the hypothesis "i" state is calculated. From "i" to "j" state, the transition number m j is also calculated. e transition probability P (1) ij , P (1) ij � m j /m i is used as the element of the matrix of transition probability, and then the matrix of transition probability is constructed in turn.

Empirical Judgment Method.
e empirical judgment method requires using the engineering experience to determine the transfer probability matrix. It is subjective and one-sided. e magnitude of each probability value is estimated by the subjective human. is method needs several years of verification and gradual revision before it tends to the actual state of the transfer law.

2
Computational Intelligence and Neuroscience

Inverse Matrix Method.
e inverse matrix method considers the inverse matrix to solve the transition probability matrix. It requires a few detection data. With the addition of new data, the transfer probability matrix can be amended to make the judged data results more reasonable and accurate. e method steps are as follows: Assuming that the system has three states, the initial vector is U 1 � a 1 , b 1 , c 1 , and the matrix of transition probability is P � P 11 P 12 P 13 en the next year's value is U 2 � a 2 , b 2 , c 2 and can be expressed as e equation is In the same way, the values of U 3 � a 3 , b 3 , c 3 and U 4 � a 4 , b 4 , c 4 in another two years can be listed into eight equations of the same form.
e total set has twelve equations. e transition probability parameter solution has nine parameters. erefore, four years of data can be used to solve the elements of the transition probability matrix in the system of equations, that is, D � e transition probability matrix is

Regression Analysis.
Regression analysis is based on the assumption that the transfer probability distribution obeys a certain distribution law. For example, it follows a normal distribution and then obtains the probability distribution of the estimated value. e first step requires establishing the regression equation between the variables (regression accuracy W). e next step is to determine M i (the median value of state i) into the regression equation and inversely calculated t i (number of years). en t i+1 is substituted into the regression equation, calculated the expected value for the next year and assumed that the transition probability also obeys the normal distribution. According to the expected value, we determine the standard deviation (accuracy of the regression equation) and the discrete state distribution. So, we determine the probability distribution of each state, and construct the transition probability matrix P. From the above calculation steps, we observed that the results are to be verified by assuming that the distribution law of transition probability obeys normal distribution. en the regression model is checked, and the errors are calculated and predicted.
Establishment steps of a dynamic assessment model for the deterioration tendency grade of external anticorrosion coating.
According to the evaluation standard of external anticorrosion coating, we select reasonable performance parameters that can reflect the damage and deterioration level of the anticorrosion coating and define the deterioration level of the external anticorrosion coating. We establish the evaluation model of connection degree by using the set pair theory.
e initial state distribution of the anticorrosion coating system is established by using the detection data of the external anticorrosion coating in different years, and the solution method of the appropriate transfer probability matrix is selected to calculate the transfer probability matrix.
Combined with the properties of the Markov chain, we establish the dynamic evaluation model of the Markov chain of the set pair theory by using the transition probability matrix and initial state distribution. erefore, we evaluate the distribution of deterioration states of the external anticorrosion coating [20].
Application of dynamic assessment model for the deterioration tendency grade of external anticorrosive coating. e actual detection methods and data of gas and oil pipelines in the project site allow us to select the breakage points density classification of the anticorrosive coating as the evaluation index. At present, the methods and technologies to judge the damage point of anticorrosion coating are as follows: numerical direct reading method, radiation distance method, statistical graphics method, voltage-controlled vibration frequency method, cursor observation method, and magnetic field drop method [21,22]. With the actual requirements of maintenance measures, the deterioration level of external anticorrosive coating is divided into three levels: the first level is classified as the excellent and good status of the damage point density; the second level is a normal status of the damage point density; and the third level is classified as a bad status of the damage point density [23,24]. Table 1 shows the classification standard for the degradation of the external anticorrosive coating. "Bp" is the density value of the breakage point of the anticorrosive coating.
e minimum distance between two adjacent damaged points is not more than twice the central burial depth of the pipeline, which can be marked as one.

Computational Intelligence and Neuroscience
According to the connection degree of the S.PA, a definition is introduced: U m � a + bi + cj, m � (1, 2, . . ., n) (natural number). "a" represents the first-class grade of excellent and good anticorrosive coating in the whole pipeline. "b" indicates the second-class grade of normal anticorrosive coating in the whole pipeline. "c" shows the third-class grade of bad anticorrosive coating in the whole pipeline. "i" represents the marker of the normal grade of pipeline. "j" indicates the marker of the bad grade and opposition to the excellent and good grade. As an example of the Bp data of breakage points of asphalt anticorrosive coating for the 6909-meter pipeline, we calculate that the pipeline length with excellent and good anticorrosive coating is 4421m, so a � 4421/6909 � 0.6399. Similarly, the pipeline length in the second grade is 2211m, so b � 2211/ 6909 � 0.3200. e pipeline length in the third-grade is 277m, so c � 277/6909 � 0.0401. Table 2 describes the classification status summary of inspection data collated in different periods for the anticorrosive coating (detection cycle every three years). erefore, the initial state distribution model for the anticorrosive coating pipeline is U 1 � 0.6399 + 0.3200i + 0.0401j. In other years, the state distribution models of the anticorrosive coating pipeline are as follows: We observed the state model that the deterioration of coating becomes more and more obvious.
at is, the changing trend of the good grade is from 0.6399 to 0.2451. With the increase of service years, the good grade becomes smaller. e changing trend of the normal grade is from 0.3200 to 0.3901. By comparing the indexes nearly four times, we found that the changing trend of normal grade is about 0.40, which conforms to the basic change law of the pipeline life cycle. e changing trend of the bad grade is from 0.0401 to 0.3648, and the 4th deterioration state of coating has begun to be greater than that of the good grade (0.3302 > 0.2698). e trend of aging is obvious. e same conclusion can be drawn from the set-pair tendency. When the set-pair tendency is used for the reliability system evaluation, the set-pair tendency represents the reliability tendency. Its reliability analysis is based on the hierarchical relationships in the connection number. Taking the ternary connection number as an example, it indicates the degree to which the relationship between (a, b) and (c) affects the deterioration development.
at is, zc � c/(a + b), which indicates the dynamic development of the deterioration direction. In the example, the deterioration level of external anticorrosion coating for the pipeline has developed from 0.0401/(0.6399 + 0.3200) � 0.0418 to 0.3648/ (0.2451 + 0.3901) � 0.5743, and the degree of deterioration is obviously large.
According to the analysis of the data characteristics of Table 2, we selected the inverse matrix method to solve the transition probability matrix. erefore, the machine learning software of PyCharm community edition is used for data analysis. We construct the matrix C 1 and D 1 by the four distribution vectors corresponding to the detection data of the previous four times. at is, According to equation (2)-(9), we calculate the transfer probability matrix P 1 through python programming based on the previous four detection data, with the properties of the Markov chain, we evaluate the deterioration value of anticorrosive coating in June 2021, Compared with the fifth detection value in August 2021, there exists a certain deviation. erefore, we modify the transition probability matrix.
Firstly, we establish four distribution vectors corresponding to the last four detection data. We construct the matrices C 2 and D 2 , which is  Secondly, according to equation (2)-(9), we calculate the transfer probability matrix P 2 through python programming based on the last four detection data, Finally, P 1 is used to take the mean value of P 2 to modify the transition probability matrix, and P mo d is calculated by the python program, According to the modification of the transfer probability matrix, the deterioration value of the anticorrosive coating by the Python program algorithm in August 2024 is predicted as follows: Similarly, the deterioration value of the anticorrosive coating in August 2027 is predicted as follows: e above flow chart of the Python program is shown in the Python flow chart of the set pair-Markov algorithm in Figure 1. Figure 2 is the python calculation value of the set pair-Markov algorithm for the pipeline's external anticorrosion coating. e data vector iterates through the set pair-Markov algorithm until the product of the vector remains unchanged, and outputs the result. Figure 3 is the iterative value diagram for predicting the deterioration of the external anticorrosion coating of the pipeline against the set pair-Markov matrix vector. e red dot represents the iterative value distribution of pipeline tendency in excellent and good condition. e green dot represents the iterative value distribution of pipeline tendency in the general state. e blue dot represents the iterative value distribution of pipeline tendency in a poor state.

Results
In August 2024, the first class of the anticorrosion layers will reach 23.17%, the second class will reach 38.52%, and the third class will reach 38.31%. In August 2027, the deterioration resulting in anticorrosion coating will have 22.48% in the first class, the second class will have 38.21%, and the third class will have 39.31%. From 2024 to 2027, the deterioration tendency further increases, and the poor state of the anticorrosion coating is nearly twice that of the good state. e degree of deterioration is larger. rough program calculation, it is found that the transition probability matrix P will basically not change and the limit matrix B will appear when m ≥ 11. at is, B � For steady-state, it is worth noting that the product of the transition matrix and steady-state must be steady-state again. When the limit matrix B is obtained, the steady-state distribution probability of the quality status of the anticorrosion coating for the whole pipeline can be obtained. e steady-state distribution probability π � [0.2173, 0.3780, 0.4047]. It shows that the steady-state distribution probability is independent of the initial vector U4 and only related to the limit matrix B. It can be seen that the quality distribution will tend to be stable when the inspection times of the anticorrosion coating for the pipeline are enough. e proportion of pipeline sections with a quality grade of excellent and good is 21.73%. e proportion of pipeline sections with a general quality grade is 37.80%. e proportion of pipeline sections with a poor-quality grade is 40.47%. e excellent and good condition is maintained at one fifth of the pipeline. e other two conditions account for two fifths each. e deterioration tendency is obvious. We need to take maintenance measures to prevent the deterioration of the anticorrosion coating.

Discussion
With the development of the corresponding detection technology for the pipeline, the accuracy and statistical management of coating detection data will be more meticulous in the improvement and standardization of the relevant standards. Meanwhile, the methods of modifying the transfer matrix are also increasing, such as the arithmetic average method, weighted arithmetic average method, geometric average method, weighted geometric average method, square average method, and the harmonic average method. e transfer probability matrix P can be updated and revised in time, making the evaluation results more in line with the actual situation on the spot. So, we will grasp more accurately the deterioration trend of the anticorrosion layer. It has great significance for prolonging the service life of pipelines. Take the mean value for correction

Conclusions
rough the case analysis, we evaluate the deterioration status of the anticorrosive coating in 2024 and 2027 and judge the safety grade of the anticorrosive coating comprehensively. e evaluation results can reflect the reliability status of the anticorrosive coating of pipelines in a timely, objective, and comprehensive manner. It makes up for the limitations and shortcomings of static evaluation. It also provides a decisive theoretical basis for pipeline maintenance.
If the corresponding maintenance measures are taken for the normal and bad anticorrosion coatings, the reliability and quality level of the anticorrosion coating will be improved. But the deterioration of the anticorrosion coating will continue to deteriorate without any maintenance measures. is is a dynamic characteristic of the damage distribution of the external anticorrosion coating. Combining with the machine learning software of PyCharm community edition based on the Python language, the intelligent detection data analysis is carried out by taking advantage of its simplicity, wide application fields, high development efficiency, and comprehensive class library.
rough the set pair theory with the Markov chain, we can effectively analyze the change, and evaluate the distribution of deterioration trend of pipeline coating. According to the actual situation of pipelines, each pipeline company can guide and formulate the corresponding evaluation and detection times for the three to eight-year cycles in the national standards and integrate them. e optimization of pipeline anticorrosive coating is guaranteed under reasonable safety and economic conditions. It also provides a basis for the pipeline maintenance of formulating scientific and efficient schemes.

Data Availability
e raw data is obtained through the pipeline breakage points collected every three years in the third-party detection department of PetroChina Changqing Oilfield Company. e raw data required for these findings cannot be shared at this time as the data also forms part of an ongoing study.

Conflicts of Interest
e authors declare that there are no conflicts of interest.

Authors' Contributions
Zhifeng Zhao (first author) contributed to the methodology, software, investigation, data analysis, and writing of the original draft. Mingyuan Chen contributed to writing the review and investigation. Heng Fan contributed to the data curation and resources. Nailu Zhang contributed to the investigation and resources. Computational Intelligence and Neuroscience 7