Magnetic Flux Leakage Testing Method for Pipelines with Stress Corrosion Defects Based on Improved Kernel Extreme Learning Machine

: This study aims to study the safety of oil and gas pipelines under stress corrosion conditions and grasp the corrosion damage situation timely and accurately. Consequently, a non-destructive testing method combining magnetic ﬂux leakage testing technology and a kernel function extreme learning machine improved by genetic algorithm (GA-KELM) is proposed. Firstly, the variation of the corrosion defect dimension and proﬁle with time is obtained by numerical simulation. At the same time, the distribution of the magnetic ﬂux leakage signal under different defect conditions is analyzed and studied. Finally, feature selection is carried out on the magnetic ﬂux leakage signal distribution curve, and GA-KELM is used to predict the depth and length of corrosion defects so as to realize the non-destructive testing of the pipeline defects. The results show that different geometric features result in different magnetic ﬂux leakage signal distributions. There is a corresponding relationship between the defect dimension and extreme value, area, and peak width of the magnetic ﬂux leakage signal distribution curve. The GA-KELM prediction model can effectively predict the depth and length of corrosion defects, and the prediction accuracy is better than the traditional extreme learning machine prediction model.


Introduction
It is well known that pipeline transportation is a secure, dependable, and economical means of energy conveyance, which is increasingly used in the transportation of oil and gas resources around the world.The corrosion of metal pipelines is due to the difference in electrode potential, and electrochemical reactions occur when the metal is in contact with the electrolyte.Pipelines are affected by a variety of stresses during service, such as soil stress, internal residual stress of the pipelines, thermal stress caused by welding, etc. [1].Both elastic and plastic tensile stress can improve the surface activity of pipeline steel, further promote the electrochemical reaction of the steel surface, and accelerate the corrosion of pipelines [2].Corrosion is a dynamic process that develops over time, and as the operating time of pipelines increases, corrosion will become a major hidden danger to the safe operation of pipelines.There are several methods to predict the damage to pipelines such as experiments, analytical methods and the finite element method (FEM).Recently, with the advancement of computer technology, FEM has established itself as the method of choice for the majority of analysis applications [3].Khalajestani K.M [4] used FEM to analyze the residual strength of pressure pipelines with corrosion defects, and the research results proved that the depth and length of defects and the spacing between adjacent defects had a greater impact on the residual strength of pipelines.Larin [5] used FEM to analyze and determine the local area of the maximum stress, and found that the stress state was affected by the internal pressure and time of the corroded defective pipelines.
Mourad Nahal [6] established a numerical model of a corroded elbow by FEM, studied the mechanical behavior under the action of corrosion defects, and established an empirical model.The results show that the failure probability is proportional to the corrosion rate, the reliability of a corroding pipe elbow can be significantly affected by corrosion and residual stress.Zhang Jia [7] used FEM to carry out nonlinear analysis of buried natural gas pipelines.The effects of internal pressure, corrosion pit defect size, internal and external wall corrosion, the corrosion pit group, and different types of volumetric corrosion pit defects on the failure of an L360QS steel pipe were analyzed with consideration to the effects of axial and circumferential zones of corrosion pits.
To guarantee the secure functioning of pipelines, periodic inspections are imperative to assess their corrosion status.Magnetic flux leakage testing is a significant non-destructive testing method that is widely used.When combined with other methods, it provides a fast and inexpensive evaluation of ferromagnetic workpieces.Given that a substantial proportion of oil and gas conveyance pipelines are fabricated from ferromagnetic materials, magnetic flux leakage testing technology can detect the location and dimension of pipeline defects effectively [8].Magnetic flux leakage testing technology evolved from magnetic particle detection technology as early as 1906 in C. Mc Cann's work in South Africa, and other scholars have carried out flaw detection by magnetization for the problem of broken wire ropes.In 1933, Zuschlug first proposed the method of detecting leakage magnetic fields using magnetic sensitive elements.In 1947, Hastings designed the first magnetic flux leakage testing system, and then magnetic flux leakage testing and its defect magnetic flux leakage imaging technology began to be applied [9].In recent years, magnetic flux leakage testing technology has gradually become a popular research direction for scholars [10][11][12][13][14][15][16].Z. Usarek [17] designed a FLUMAG500 magnetic flux leakage testing device for the detection of corrosion defects on gas pipe walls.An advanced signal processing and analysis system was developed for the device, and the working principle of the device was introduced.Miguel A. Machado [18] developed a new eddy current probe for detecting micron-level defects in any direction on the inner surface of the pipelines and verified the performance of the designed probe.Yavuz Ege [19] developed a new magnetic flux leakage testing system for natural gas and long-distance oil transportation pipelines with a KMZ51 AMR sensor.Tohara Makoto [20] proposed a method to obtain the outer surface defects of ferromagnetic steel pipelines by detecting the changes in the eddy current distribution in the pipelines.Zhao Yunli [21] used ANSYS Maxwell software to calculate the permeability of different specifications at the inner and outer walls of X80 steel pipelines and verified the calculation results.Hu Jing [22] studied the distribution law and modeling method of a vortex magnetic flux leakage field on the inner and outer walls of pipelines, constructed a mathematical model of a dynamic magnetic flux leakage similar stability field for defects on the inner and outer walls of pipelines, explored the identifiability of magnetic flux leakage signal features under dynamic conditions, selected the data characteristics of defect signals on the inner and outer walls, and established an effective method for distinguishing between internal and external defect signals.Zheng Fuyin [23] mathematically modeled the force-magnetic coupling relationship of ferromagnetic materials, derived the functional relationship between stress and material permeability, designed a pipeline stress detection system, and gave the mathematical relationship between the magnetic flux leakage signal on the pipe surface and the magnetic permeability of the material, excitation voltage and coil turns.Feng Bo [24] presented a comprehensive review of magnetic flux leakage (MFL) testing, explained the principle of MFL testing with the refraction magnetic field theory, and analyzed the factors affecting the MFL test signal.The results show that excitation and sensing are the most important steps in MFL testing, in which excitation decides if there is a leakage field generated and sensing decides if the generated field can be effectively detected.
Artificial neural networks have undergone rapid development in recent years, and achieved great success in tasks such as classification and regression.The emphasis of non-destructive testing is the quantification and prediction of defects, which is essentially a classification or regression problem.Thus, artificial neural networks have been widely used in defect quantification and prediction.Chen Yuanhang presented a method based on feature extraction and machine learning algorithms for online quality monitoring and defect classification, and experiments indicated the performance of artificial neural networks is slightly better than that of support vector machines, while both of them have their own advantages [25].Feng Jianghua proposed a novel object detection algorithm to detect rail defects.The net architecture of the proposed algorithm includes a backbone network using MobileNet and several novel detection layers [26].Mat Jizat Jessnor Arif described an evaluation of machine learning classifiers to be applied in wafer defect detection-k-nearest neighbours, logistic regression, stochastic gradient descent, and support vector machine were evaluated with three defect categories and one non-defect category [27].Sun Hongyu integrated the magnetic flux leakage theory into the loss function and proposed a physicsinformed double-fed cross-residual network that estimated the defect length, width, and depth accurately [28].Wang Qi proposed an extreme learning machine optimized by a genetic algorithm to predict the erosion rate, residual life, and residual strength of the pipe with erosion defects; the model can not only predict effectively, but its prediction accuracy is better than the traditional model [29].
As mentioned above, the presence of corrosion defects constitutes one of the main threats to pipeline safety.The soil-induced strain, combined with internal pressure, results in a complex stress/strain condition on pipelines.The local stress concentration developed at the defect further accelerates the localized corrosion.Magnetic flux leakage testing technology can effectively detect the corrosion damage of pipelines.Meanwhile, artificial neural networks are widely used in the quantification and prediction of defects.However, most of the existing research uses the experimental method to carry out the research of magnetic flux leakage testing, and there is no close connection with computer technology.In order to assess the corrosion damage of oil and gas pipelines from the perspective of safety and economy, it is imperative to establish a scientific evaluation methodology.In this paper, considering the combined impacts of corrosion and stress on oil and gas pipelines in practical engineering scenarios, the finite element model of pipeline stress corrosion is established.Employing time as a variable, the dynamic evolution of corrosion defect profiles and sizes with pipelines is investigated.Building upon the principles of magnetic field theory, the finite element model of magnetic flux leakage testing for pipeline defects is established.It enables an exploration of the magnetic flux leakage signal distribution under varying corrosion defect profiles; the effects of defect depth, defect length and lifting height on magnetic flux leakage signal distribution are also analyzed.On this basis, the features of the signal distribution curve are defined and selected as sample data, and the GA-KELM model is built to predict the depth and length of defects.The above contributes to advancing the theoretical foundations of corrosion protection strategies for oil and gas pipelines in engineering applications.

Simulation of Elastoplasticity
Elastoplasticity refers to the deformation of an object when it is subjected to external force; only part of the deformation disappears when the external force is removed, and the rest will not disappear by itself.Elastoplasticity includes elastic mechanics and plastic mechanics; in the scope of elastic mechanics, stress and strain are linearly related, while in the scope of plastic mechanics, the relationship between stress and strain is nonlinear.This nonlinear characteristic is related to the materials studied, and has different transformation laws for different materials and conditions.The model established in this paper adopts the small strain plastic model to simulate the elastic-plastic mechanics of the pipelines and the isotropic hardening model, whose hardening function σ yhard (a function that describes the stress-strain curves in the scope of plasticity) is defined as follows: In Equation ( 1), σ exp is the stress-strain curve measured by X100 pipeline steel experiments [30], as shown in Figure 1; ε p is plastic deformation; σ e is the von Mise stress; E is the Young's modulus, 2.07 × 10 9 Pa; σ ys is the yield strength of the pipeline steel, 8.06 × 10 8 Pa.
In Equation (1), exp  is the stress-strain curve measured by X100 pipeline steel ex- periments [30], as shown in Figure 1

Simulation of Electrochemical Corrosion
Corrosion of oil and gas pipelines refers to the destruction of the outer wall of oil and gas pipelines due to chemical changes, electrochemical changes or physical dissolution of metal pipelines under long-term contact with surrounding substances.Soil is the main cause of the corrosion of buried pipelines.Because the soil contains a lot of water and air, water makes the soil become a conductor, and the airflow causes the uneven distribution of oxygen concentration, and finally forms the galvanic cell.The pipelines are dissolved as the anode, which is damaged [31].
The model dictates that two electrochemical reactions, iron dissolution (anode) and hydrogen evolution (cathode), occur on the corrosion defect surface of the pipelines, and the other surface of the pipelines is considered to be electrochemically inert.The chemical reaction formula of the anode reaction and the cathode reaction is as follows: The anode's Tafel expression is used to simulate the iron dissolution reaction, and the local anode current density a i is defined as follows [32]:

Simulation of Electrochemical Corrosion
Corrosion of oil and gas pipelines refers to the destruction of the outer wall of oil and gas pipelines due to chemical changes, electrochemical changes or physical dissolution of metal pipelines under long-term contact with surrounding substances.Soil is the main cause of the corrosion of buried pipelines.Because the soil contains a lot of water and air, water makes the soil become a conductor, and the airflow causes the uneven distribution of oxygen concentration, and finally forms the galvanic cell.The pipelines are dissolved as the anode, which is damaged [31].
The model dictates that two electrochemical reactions, iron dissolution (anode) and hydrogen evolution (cathode), occur on the corrosion defect surface of the pipelines, and the other surface of the pipelines is considered to be electrochemically inert.The chemical reaction formula of the anode reaction and the cathode reaction is as follows: The anode's Tafel expression is used to simulate the iron dissolution reaction, and the local anode current density i a is defined as follows [32]: In Equations ( 4)-( 6), i 0,a is the exchange current density, 2.353 × 10 −3 A/m 2 ; A a is the anode's Tafel slope, 0.118 V; η a is the overpotential of the anode reaction; E eq,a is the equilibrium potential of the anode reaction; E eq0,a is the standard equilibrium potential of anode reaction, −0.859 V; ∆P m is the overpressure that causes elastic deformation, 2.687 × 10 8 Pa; V m is the molar volume of steel, 7.13 × 10 −6 m 3 /mol; z is the electric charge of steel, 2; F is Faraday's constant; T is the absolute concentration, 298.15 K; R is the ideal gas constant; v is the directional correlation factor, 0.45; α is the coefficient, 1.67 × 10 15 m −2 ; N 0 is the initial dislocation density, 1 × 10 12 m −2 .
The cathode's Tafel expression is used to simulate the hydrogen evolution reaction, and the local cathode current density i c is defined as follows [32]: In Equations ( 7)-( 9), i 0,c is the exchange current density; A c is the cathode's Tafel slope, 0.207 V; i 0,c,re f is the reference exchange current density of the cathode reaction without external stress/strain, 1.457 × 10 −2 A/m 2 ; η c is the overpotential of the cathode reaction; E eq,c is the standard equilibrium potential of the cathode reaction, −0.644 V.
Deformation geometry is used to model the dissolution of iron in corrosion defects.The dissolution of iron causes the electrode boundary to move at a speed of v, calculated by the following equation [33]: In Equation (10), M is the molar mass of iron, 55.845 g/mol; ρ is the density of iron, 7870 kg/m 3 .

Finite Element Model of Pipelines Stress Corrosion
COMSOL Multiphysics 6.0 is used to establish a finite element model of pipeline stress corrosion.The geometric model consisted of X100 pipelines and the surrounding soil domain, as shown in Figure 2. The pipe wall thickness is 19.1 mm, and the length of the pipe segment used for finite element simulation is 2 m.The initial corrosion defect is elliptical, with a length of 200 mm and a depth of 60% of the pipe wall thickness, 11.46 mm.In numerical simulation, the calculation speed and accuracy are affected by the quality and quantity of the mesh; high-quality mesh can not only reduce the operation memory, but also improve the calculation accuracy.This paper uses a free triangle mesh to divide the corrosion defect area's local mesh encryption and set the maximum unit size of 1 mm.The complete mesh consists of 13,807 cells, with a maximum cell size of 40 mm, a minimum cell size of 0.6 mm, and a maximum cell growth rate of 1.2.The contact interface between the pipeline and the soil domain is set as a free boundary, an electrochemical corrosion reaction occurs, and the conductivity of the electrolyte in the soil domain is 0.096 S/m.The left end of the pipeline is fixed, the right end is subjected to tensile strain, and the bottom of the pipeline is set to electrical ground.

Verification of Model Accuracy
Corrosion potential is the potential measured when a metal reaches a steady state of corrosion in the absence of an applied current.It is the mixed potential of anodic and cathodic reactions polarized by self-corrosive currents, which greatly affects the corrosion of metals [34].Before the numerical simulation, the rationality and accuracy of the finite

Verification of Model Accuracy
Corrosion potential is the potential measured when a metal reaches a steady state of corrosion in the absence of an applied current.It is the mixed potential of anodic and cathodic reactions polarized by self-corrosive currents, which greatly affects the corrosion of metals [34].Before the numerical simulation, the rationality and accuracy of the finite element model should be verified.The curve of the corrosion potential change with von Mises stress of X100 pipeline steel is shown in Figure 3, and a comparison between the experimental data in the literature and numerical simulation results is shown in Table 1.It can be seen from the data analysis that the numerical simulation results in this paper fit well with the experimental data of L.Y. Xu [35], with a maximum error of 0.27%, a minimum error of 0.04%, and an average error of 0.059%.The results show that the finite element model can simulate the pipeline stress corrosion accurately, and the mesh division and boundary condition setting are reasonable and feasible.

Simulation Analysis of Corrosion Situations
This paper undertakes a comprehensive analysis of pipeline corrosion over a 30-year period, with calculations performed at 3-year intervals.A total of 10 simulations have been conducted to assess the progression of corrosion in the presence of defects.The evolution of defect dimensions over the corrosion timeline is presented in Table 2, and the transformation of defect profiles is depicted in Figure 4. Analysis of the data shows that the corrosion defect changed significantly.The depth of defects increased from 11.46 mm to 16.798 mm, with an average increase of 0.54 mm every three years.The length of defects increased from 200 mm to 210.649 mm, with an average increase of 1.065 mm every three years.With the increase in the service life of pipelines, the stress corrosion leads to the continuous thinning of the pipe wall and the increase in the defect area, which seriously threatens the safe operation of pipelines.

Simulation Analysis of Corrosion Situations
This paper undertakes a comprehensive analysis of pipeline corrosion over a 30-year period, with calculations performed at 3-year intervals.A total of 10 simulations have been conducted to assess the progression of corrosion in the presence of defects.The evolution of defect dimensions over the corrosion timeline is presented in Table 2, and the transformation of defect profiles is depicted in Figure 4. Analysis of the data shows that the corrosion defect changed significantly.The depth of defects increased from 11.46 mm to 16.798 mm, with an average increase of 0.54 mm every three years.The length of defects increased from 200 mm to 210.649 mm, with an average increase of 1.065 mm every three years.With the increase in the service life of pipelines, the stress corrosion leads to the continuous thinning of the pipe wall and the increase in the defect area, which seriously threatens the safe operation of pipelines.The initial corrosion defect depth of 11.46 mm is kept unchanged, and the initial defect lengths are taken as 160 mm, 170 mm, 180 mm, 190 mm, 200 mm, 210 mm, 220 mm, 230 mm, 240 mm and 250 mm, respectively.By establishing a model and calculating the defect profiles under different corrosion times, they are derived to provide a geometric model for the subsequent numerical simulation analysis of magnetic flux leakage testing signal detection.

Magnetic Flux Leakage Testing Theory
Similar to electric field lines, magnetic induction lines are imaginary curves used to help describe the direction of a magnetic field.The propagation of magnetic induction lines obeys the boundary conditions of the electromagnetic field.When the magnetic induction line passes through the different media interfaces of the two materials, the propagation path is refracted due to the change in permeability [36].A schematic diagram of the refractive law of the magnetic induction line is shown in Figure 5.  and 2  , and the permeability of medium 1 and medium 2 is 1  and 2  , according to the boundary conditions of the two mag- netic media.
The permeability ratio on both sides of the medium is equal to the tangent ratio of the angle between the magnetic induction line and the normal line on both sides of the medium, that is: The magnetic induction line is incident from medium 1, refracted at the interface and emi ed from medium 2; when the size of 1  is much greater than 2  , 2  infinitely tends to 0, and 1  tends to 90 degrees.At this time, the magnetic induction line inside medium 1 becomes very dense and parallel to the interface.The greater the permeability of the material constituting medium 1, the closer 1  is to 90 degrees.
The principle of magnetic flux leakage testing is schematically shown in Figure 6, As shown in the figure, two media with different permeability are divided by interface, and the normal components of magnetic induction intensity in medium 1 and medium 2 are B 1n and B 2n , respectively.The magnetic field strength components of the circumferential of medium 1 and medium 2 are H 1t and H 2t , respectively, the angle between magnetic induction and normal is θ 1 and θ 2 , and the permeability of medium 1 and medium 2 is µ 1 and µ 2 , according to the boundary conditions of the two magnetic media.
The permeability ratio on both sides of the medium is equal to the tangent ratio of the angle between the magnetic induction line and the normal line on both sides of the medium, that is: tan The magnetic induction line is incident from medium 1, refracted at the interface and emitted from medium 2; when the size of µ 1 is much greater than µ 2 , θ 2 infinitely tends to 0, and θ 1 tends to 90 degrees.At this time, the magnetic induction line inside medium 1 becomes very dense and parallel to the interface.The greater the permeability of the material constituting medium 1, the closer θ 1 is to 90 degrees.
The principle of magnetic flux leakage testing is schematically shown in Figure 6, where an excitation device is applied to magnetize the pipe wall into near saturation.If the pipe wall is continuous and free of defects, the magnetic induction line will be constrained.The magnetic flux is parallel to the surface of the pipe wall and hardly forms a magnetic field.If there are defects in the pipe wall, the magnetic induction line will change.Part of the magnetic flux leaks into the space on the surface of the pipe wall, forming a leakage magnetic field at the defect.At this time, sensors such as Hall elements are used to detect the magnetic flux leakage on the surface of the pipe wall, and the magnetic flux leakage signal can be analyzed to evaluate whether the pipelines have defects.

Finite Element Model of Magnetic Flux Leakage Testing
The finite element model of pipeline defect magnetic flux leakage testing is established by COMSOL Multiphysics 6.0.The geometric model consists of a ferromagnetic X100 steel pipeline, an excitation coil and a magnet yoke.The model adopts the corrosion defect profile calculated in numerical simulation of pipeline stress corrosion, the positions and sizes of the excitation coil and magnet yoke are shown in Figure 7.The magnetic flux leakage signal detection path is set above the pipe wall to replace the Hall sensor, as shown in the blue dashed line.In order to ensure the accuracy and smoothness of the magnetic flux leakage signal, the defect area and the air region above it are divided by a sweeping mesh, the unit size is set to 5 mm, and the rest are divided by a free triangle mesh.The complete mesh consists of 33,990 mesh cells, with a maximum cell size of 60 mm, a minimum cell size of 0.225 mm, and a maximum cell growth rate of 1.2.In the actual test, considering the geometric size and magnetization effect of the mag-

Finite Element Model of Magnetic Flux Leakage Testing
The finite element model of pipeline defect magnetic flux leakage testing is established by COMSOL Multiphysics 6.0.The geometric model consists of a ferromagnetic X100 steel pipeline, an excitation coil and a magnet yoke.The model adopts the corrosion defect profile calculated in numerical simulation of pipeline stress corrosion, the positions and sizes of the excitation coil and magnet yoke are shown in Figure 7.The magnetic flux leakage signal detection path is set above the pipe wall to replace the Hall sensor, as shown in the blue dashed line.In order to ensure the accuracy and smoothness of the magnetic flux leakage signal, the defect area and the air region above it are divided by a sweeping mesh, the unit size is set to 5 mm, and the rest are divided by a free triangle mesh.The complete mesh consists of 33,990 mesh cells, with a maximum cell size of 60 mm, a minimum cell size of 0.225 mm, and a maximum cell growth rate of 1.2.

Finite Element Model of Magnetic Flux Leakage Testing
The finite element model of pipeline defect magnetic flux leakage testing is estab lished by COMSOL Multiphysics 6.0.The geometric model consists of a ferromagnetic X100 steel pipeline, an excitation coil and a magnet yoke.The model adopts the corrosion defect profile calculated in numerical simulation of pipeline stress corrosion, the position and sizes of the excitation coil and magnet yoke are shown in Figure 7.The magnetic flux leakage signal detection path is set above the pipe wall to replace the Hall sensor, as shown in the blue dashed line.In order to ensure the accuracy and smoothness of the magnetic flux leakage signal, the defect area and the air region above it are divided by a sweeping mesh, the unit size is set to 5 mm, and the rest are divided by a free triangle mesh.The complete mesh consists of 33,990 mesh cells, with a maximum cell size of 60 mm, a mini mum cell size of 0.225 mm, and a maximum cell growth rate of 1.2.In the actual test, considering the geometric size and magnetization effect of the mag netization device, the local magnetization method is generally selected.The magnetic field signal in the magnetization area is detected to determine whether there is a defect in the In the actual test, considering the geometric size and magnetization effect of the magnetization device, the local magnetization method is generally selected.The magnetic field signal in the magnetization area is detected to determine whether there is a defect in the area and the geometry of the defect.In this paper, the yoke method is selected to locally magnetize the defective pipelines, and the coil is excited to generate the direct current magnetization, which can generate a stable magnetic field without a skin effect.The excitation coil material is set to copper, and the relative permeability is 0.9999912; the yoke material is selected from the COMSOL material library, regardless of loss.The pipeline material is set to X100 pipeline steel with ferromagnetism, and the relative permeability input B-H curve [37] is given as the nonlinearity of the material, as shown in Figure 8.

Effect of Magnet Yoke on Magnetic Flux Leakage Signal
The number of excitation coils and the current value will directly affect the magnetization effect of the magnet yoke.The geometric model with defect length of 200 mm and defect depth of 11.46 mm is established, and the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall.Currents of 3 A, 5 A, and 7 A are applied to the excitation coil, and the coils are wound 400 turns, 500 turns, and 600 turns, respectively.The magnetic flux leakage signal distribution under different parameter conditions is shown in Figure 9:

Effect of Magnet Yoke on Magnetic Flux Leakage Signal
The number of excitation coils and the current value will directly affect the magnetization effect of the magnet yoke.The geometric model with defect length of 200 mm and defect depth of 11.46 mm is established, and the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall.Currents of 3 A, 5 A, and 7 A are applied to the excitation coil, and the coils are wound 400 turns, 500 turns, and 600 turns, respectively.The magnetic flux leakage signal distribution under different parameter conditions is shown in Figure 9:

Effect of Magnet Yoke on Magnetic Flux Leakage Signal
The number of excitation coils and the current value will directly affect the magnetization effect of the magnet yoke.The geometric model with defect length of 200 mm and defect depth of 11.46 mm is established, and the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall.Currents of 3 A, 5 A, and 7 A are applied to the excitation coil, and the coils are wound 400 turns, 500 turns, and 600 turns, respectively.The magnetic flux leakage signal distribution under different parameter conditions is shown in Figure 9: (a) (b) The figure shows that the magnetization effect of the magnet yoke on the pipe wall will be enhanced with the increase in current value and number of excitation coils.Low current and small coil turns will cause the curve to change less significantly.In the meantime, high current and large coil turns will increase the calculation amount.Therefore, considering the calculation accuracy and calculation speed, a 5A current and 500 coil turns are selected in this study.

Effect of Geometric Features on Magnetic Flux Leakage Signal
According to the number of excitation coil and current value, the magnetic flux leakage testing model is established, and the influences of defect depth, defect length and lifting height on magnetic flux leakage signal distribution are studied, respectively.When the defect depth is taken as a variable, the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall, the defect length is 200 mm, and the defect depths are taken as 8 mm, 9 mm, 10 mm, 11 mm and 12 mm.When the defect length is taken as a variable, the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall, the defect depth is 11.46 mm, and the defect depths are are taken as 100 mm, 150 mm, 200 mm, 250 mm and 300 mm.When the lifting height is taken as a variable, the defect depth is controlled at 11.46 mm, the defect length remains unchanged at 200 mm, and the magnetic flux leakage signal detection paths are set to 30 mm, 40 mm and 50 mm above the pipe wall.The magnetic flux leakage signal distribution under different geometric characteristics is shown in Figure 10: The figure shows that the magnetization effect of the magnet yoke on the pipe wall will be enhanced with the increase in current value and number of excitation coils.Low current and small coil turns will cause the curve to change less significantly.In the meantime, high current and large coil turns will increase the calculation amount.Therefore, considering the calculation accuracy and calculation speed, a 5A current and 500 coil turns are selected in this study.

Effect of Geometric Features on Magnetic Flux Leakage Signal
According to the number of excitation coil and current value, the magnetic flux leakage testing model is established, and the influences of defect depth, defect length and lifting height on magnetic flux leakage signal distribution are studied, respectively.When the defect depth is taken as a variable, the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall, the defect length is 200 mm, and the defect depths are taken as 8 mm, 9 mm, 10 mm, 11 mm and 12 mm.When the defect length is taken as a variable, the magnetic flux leakage signal detection path is set to 40 mm above the pipe wall, the defect depth is 11.46 mm, and the defect depths are are taken as 100 mm, 150 mm, 200 mm, 250 mm and 300 mm.When the lifting height is taken as a variable, the defect depth is controlled at 11.46 mm, the defect length remains unchanged at 200 mm, and the magnetic flux leakage signal detection paths are set to 30 mm, 40 mm and 50 mm above the pipe wall.The magnetic flux leakage signal distribution under different geometric characteristics is shown in Figure 10: The figure shows that different geometric features lead to different magnetic flux leakage signal distributions.As the defect depth increases, the extreme values of the axial and radial components show a continuous increase, with a concomitant increase in the enclosed area of the curve.Conversely, as the defect length increases, the extreme values of both the axial and radial components decrease, accompanied by an increase in the width of the peak of the curve.This observation implies a correlation between the defect dimension and the extreme value, area and peak width of the curve.In addition, the extreme values of the axial and radial components decrease as the lifting height increases.In this study, a lifting height of 40 mm is chosen to ensure clear changes in the distribution curve of the detected magnetic flux leakage signal for each component.

Corrosion Defect Regression Prediction 4.1. Magnetic Flux Leakage Signal Feature Extraction
The key to quantitative analysis of defect magnetic flux leakage signal is to extract the feature of the distribution curve.Combined with the above analysis of the transformation law of the magnetic flux leakage signal curve, the feature of the distribution curve is defined as follows (Figure 11):

Kernel Function Extreme Learning Machine Improved by Genetic Algorithm
An extreme learning machine (ELM) is a single hidden layer feedforward artificial neural network, which has faster operation speed and be er generalization performance than traditional algorithms [38].In the training process of ELM, the connection weights of the input layer and the hidden layer are randomly generated, and the connection weights of the hidden layer and the output layer are obtained by solving the equation rather than iteratively adjusting.Be er performance can be obtained only by adjusting the number of neurons in the hidden layer, which greatly enhances the learning speed.The network structure of ELM is shown in Figure 12, which consists of the input layer, hidden layer and output layer.A baseline is established along the lower edge of the axial component curve, and the disparity between the peak of the curve and this baseline is defined as the peak value of the axial component (P 1 ).In the meantime, the disparity between the positive peak and the negative peak within the radial component curve is defined as the peak value of the radial component (P 2 ).

Area
A baseline is established along the base of the axial component curve, and the absolute area enclosed by the curve and the baseline is defined as the peak area of the axial component (A 1 ).Similarly, by connecting the endpoints of the radial component curve to form a baseline, the absolute area enclosed by the curve and the baseline is defined as the peak area of the radial component (A 2 ).

3.
Full width at half maximum (FWHM) The width of the axial component curve at half of its peak height is defined as the FWHM of the axial component (W 1 ).On the other hand, since the radial component curve exhibits two peaks, the average of two width values is defined as the FWHM of the radial component (W 2 ).

Corrugation pitch
By calculating the disparity between the abscissa values of the negative and positive peaks of the radial component curve, the resulting difference is defined as the corrugation pitch of the radial component (S).
The magnetic flux leakage signal distribution of pipelines with different defect profiles is calculated by using the magnetic flux leakage testing model.A total of 100 groups of data are obtained by extracting the feature of the distribution curve, as shown in Table A1 of Appendix A.

Kernel Function Extreme Learning Machine Improved by Genetic Algorithm
An extreme learning machine (ELM) is a single hidden layer feedforward artificial neural network, which has faster operation speed and better generalization performance than traditional algorithms [38].In the training process of ELM, the connection weights of the input layer and the hidden layer are randomly generated, and the connection weights of the hidden layer and the output layer are obtained by solving the equation rather than iteratively adjusting.Better performance can be obtained only by adjusting the number of neurons in the hidden layer, which greatly enhances the learning speed.The network structure of ELM is shown in Figure 12, which consists of the input layer, hidden layer and output layer.

Kernel Function Extreme Learning Machine Improved by Genetic Algorithm
An extreme learning machine (ELM) is a single hidden layer feedforward artificial neural network, which has faster operation speed and be er generalization performance than traditional algorithms [38].In the training process of ELM, the connection weights of the input layer and the hidden layer are randomly generated, and the connection weights of the hidden layer and the output layer are obtained by solving the equation rather than iteratively adjusting.Be er performance can be obtained only by adjusting the number of neurons in the hidden layer, which greatly enhances the learning speed.The network structure of ELM is shown in Figure 12, which consists of the input layer, hidden layer and output layer.In the figure above, n x is the eigenvector of the input sample; i W is the connection weight of the input layer and the hidden layer; i β is the connection weight of the hidden layer and the output layer; n y is the label vector corresponding to the sample; In the figure above, x n is the eigenvector of the input sample; W i is the connection weight of the input layer and the hidden layer; β i is the connection weight of the hidden layer and the output layer; y n is the label vector corresponding to the sample; ] is hidden layer output, the calculation formula of h i (x) is as follows: In Equation ( 14), g(•) is the activation function; b i is the deviation of the hidden layer unit.
In an extreme learning machine, the number of hidden layer neurons needs to be determined to obtain the unique optimal solution.While the kernel function extreme learning machine (KELM) replaces the unknown hidden layer feature mapping with the kernel function, it does not need to determine the number of hidden layer nodes in advance but only obtains its kernel function.The basic principle of the kernel function is to map the input space sample data to the high-dimensional feature space by the nonlinear function, and then process the high-dimensional feature space.The key point is to transform the product operation in the high dimensional space after nonlinear transformation into the kernel function calculation in the original input space by introducing the kernel function [39].The kernel function formula is as follows: In Equation ( 16), K x i , x j is the element of the kernel matrix Ω; δ is the parameter of the kernel function.
Meanwhile, the main means of the numerical solution is iterative operation, and the general iterative method is easy to fall into the local minimal loop.The genetic algorithm (GA) is a globally improved algorithm that follows the principle of survival of the fittest.It uses the "random selection according to probability" search method to avoid the trap of local optimal cleverly, and has good convergence.In order to improve the accuracy of the neural network algorithm, a kernel function extreme learning machine improved by genetic algorithm (GA-KELM) is proposed.Setting the population number to 20, the maximum number of iterations to 100, the crossover probability to 0.7, and the mutation probability to 0.3, the performance workflow of GA-KELM is shown in Figure 13.

Prediction Results and Analysis
The ELM and GA-KELM prediction models are established by MATLAB R2018a, and 100 sets of features of magnetic flux leakage signal distribution curves are selected as data sets to predict corrosion defects.Each data set comprises eight distinct parameters.Among them, P1, P2, A1, A2, W1, W2 and S are taken as inputs, and the defect depth and defect length are, respectively, taken as outputs.In total, 80 groups of data are randomly selected as the training set, and the remaining 20 groups of data are selected as the test set.
Figure 14 shows the comparison of prediction results of the two models.It can be seen from the figure that the accuracy of the GA-KELM model in predicting defect depth and defect length is 98.8% and 98.2%, respectively, which is 5.4% and 5.2% higher than that of the traditional ELM model.It shows that the GA-KELM model established in this paper can well predict the corrosion defect dimension, the improved algorithm adopted can effectively improve the prediction performance, and the prediction accuracy of the improved model is significantly improved.In this algorithm, the input weights of KELM training data and the threshold of hidden layer nodes are mapped to genes on each chromosome in the GA population.The chromosome fitness of GA corresponds to the training error of KELM, and the problem of obtaining the optimal input weight and threshold is transformed into the problem of selecting the optimal chromosome by reducing the chromosome fitness.Through GA selection, crossover, mutation and other genetic operations, the optimal chromosome is selected as the input weight and threshold of KELM after being improved.The output weights of hidden layer neurons are calculated by the least squares method to calculate the predicted output.The algorithm integrates the global search ability of GA and the strong learning ability of KELM, which can effectively improve prediction accuracy.

Prediction Results and Analysis
The ELM and GA-KELM prediction models are established by MATLAB R2018a, and 100 sets of features of magnetic flux leakage signal distribution curves are selected as data sets to predict corrosion defects.Each data set comprises eight distinct parameters.Among them, P 1 , P 2 , A 1 , A 2 , W 1 , W 2 and S are taken as inputs, and the defect depth and defect length are, respectively, taken as outputs.In total, 80 groups of data are randomly selected as the training set, and the remaining 20 groups of data are selected as the test set.
Figure 14 shows the comparison of prediction results of the two models.It can be seen from the figure that the accuracy of the GA-KELM model in predicting defect depth and defect length is 98.8% and 98.2%, respectively, which is 5.4% and 5.2% higher than that of the traditional ELM model.It shows that the GA-KELM model established in this paper can well predict the corrosion defect dimension, the improved algorithm adopted can effectively improve the prediction performance, and the prediction accuracy of the improved model is significantly improved.

Conclusions
In this paper, a calculation model of pipeline stress corrosion is established by the numerical simulation method.Furthermore, this paper analyzes the transformation law of magnetic flux leakage signal distributions.In addition, it combines improved artificial neural network algorithms to predict the corrosion defect depth and length.The following conclusions are deduced: (1) In this study, the accuracy of the numerical simulation results for pipeline stress corrosion is validated by published experimental data.Therefore, the effectiveness of the finite element model established herein in calculating corrosion defect changes is confirmed.(2) Different geometric features result in different magnetic flux leakage signal distributions.With the increase in defect depth, the area enclosed by the magnetic flux leakage signal distribution curve increases, and the extreme value of the curve also increases.As the defect length increases, the width of the curve crest increases, but the extreme value of the curve decreases.Correspondingly, a rise in lifting height corresponds to a conspicuous reduction in the curve's extreme value.(3) As described above, the established GA-KELM model demonstrates excellent predictive ability, accurately predicting changes in corrosion defect depth and length, with prediction accuracies of 98.8% and 98.2%, respectively, which shows improvements of 5.4% and 5.2% over the traditional ELM model.

Future Directions
There are still many limitations and deficiencies in the study, which need to be improved in future work: (1) In the present study, magnetic flux leakage testing has been explored as a method for detecting small-sized defects.However, it is crucial to acknowledge that the method becomes impractical when the defect size exceeds the coverage area of the magnetic

Conclusions
In this paper, a calculation model of pipeline stress corrosion is established by the numerical simulation method.Furthermore, this paper analyzes the transformation law of magnetic flux leakage signal distributions.In addition, it combines improved artificial neural network algorithms to predict the corrosion defect depth and length.The following conclusions are deduced: (1) In this study, the accuracy of the numerical simulation results for pipeline stress corrosion is validated by published experimental data.Therefore, the effectiveness of the finite element model established herein in calculating corrosion defect changes is confirmed.(2) Different geometric features result in different magnetic flux leakage signal distributions.With the increase in defect depth, the area enclosed by the magnetic flux leakage signal distribution curve increases, and the extreme value of the curve also increases.As the defect length increases, the width of the curve crest increases, but the extreme value of the curve decreases.Correspondingly, a rise in lifting height corresponds to a conspicuous reduction in the curve's extreme value.(3) As described above, the established GA-KELM model demonstrates excellent predictive ability, accurately predicting changes in corrosion defect depth and length, with prediction accuracies of 98.8% and 98.2%, respectively, which shows improvements of 5.4% and 5.2% over the traditional ELM model.

Future Directions
There are still many limitations and deficiencies in the study, which need to be improved in future work: (1) In the present study, magnetic flux leakage testing has been explored as a method for detecting small-sized defects.However, it is crucial to acknowledge that the method becomes impractical when the defect size exceeds the coverage area of the magnetic yoke.Another noteworthy non-destructive testing approach is acoustic testing.In acoustic testing, sound signals propagate along the pipe wall, and signals carrying defect-related information can escape into the surrounding medium.Thus, the location and size of defects can be determined with appropriate acoustic equipment [40].Importantly, acoustic inspection technology is not constrained by defect size, making it a valuable option for addressing larger defects.(2) Moreover, it is essential to consider the impact of various factors on the magnetic flux leakage signal, including the anti-corrosion measures applied to pipelines, the properties of pipe wall coatings, and the chemical composition of pipe material.In our future research, we will thoroughly investigate how these properties influence the outcomes of non-destructive testing.(3) Furthermore, the accurate determination of the defect's location is of paramount importance.In our subsequent research endeavors, we intend to advance our methodology to enable the precise detection of both defect size and defect location, thus enhancing the comprehensiveness and effectiveness of our non-destructive testing approach.

Electronics 2023 ,
12,  x FOR PEER REVIEW 6 of 24 of 1 mm.The complete mesh consists of 13,807 cells, with a maximum cell size of 40 mm, a minimum cell size of 0.6 mm, and a maximum cell growth rate of 1.2.The contact interface between the pipeline and the soil domain is set as a free boundary, an electrochemical corrosion reaction occurs, and the conductivity of the electrolyte in the soil domain is 0.096 S/m.The left end of the pipeline is fixed, the right end is subjected to tensile strain, and the bo om of the pipeline is set to electrical ground.

Figure 2 .
Figure 2. Calculation model of pipeline stress corrosion.

Figure 2 .
Figure 2. Calculation model of pipeline stress corrosion.

Figure 3 .
Figure 3. Corrosion potential change with von Mises stress of X100 pipeline steel.

Figure 3 .
Figure 3. Corrosion potential change with von Mises stress of X100 pipeline steel.

Figure 4 .
Figure 4. Variation of defect dimension with corrosion time.The initial corrosion defect depth of 11.46 mm is kept unchanged, and the initial defect lengths are taken as 160 mm, 170 mm, 180 mm, 190 mm, 200 mm, 210 mm, 220 mm, 230 mm, 240 mm and 250 mm, respectively.By establishing a model and calculating the defect profiles under different corrosion times, they are derived to provide a geometric model for the subsequent numerical simulation analysis of magnetic flux leakage testing

Figure 4 .
Figure 4. Variation of defect dimension with corrosion time.

Figure 7 .
Figure 7. Calculation model of magnetic flux leakage testing.

Figure 6 .
Figure 6.Principle of magnetic flux leakage testing.

Figure 7 .
Figure 7. Calculation model of magnetic flux leakage testing.

Figure 7 .
Figure 7. Calculation model of magnetic flux leakage testing.

Figure 9 .
Figure 9. Distribution of magnetic flux leakage signal under different parameter conditions.(a) Axial component of current value signal with 500 turns.(b) Radial component of current value signal with 500 turns.(c) Axial component of coils' number signal with 5A current.(d) Radial component of coils' number signal with 5A current.

Figure 10 .
Figure 10.Distribution of magnetic flux leakage signal under different geometric characteristics.(a) Axial component of defect depth signal.(b) Radial component of defect depth signal.(c) Axial component of defect length signal.(d) Radial component of defect length signal.(e) Axial component of lifting height signal.(f) Radial component of lifting height signal.

Figure 10 .
Figure 10.Distribution of magnetic flux leakage signal under different geometric characteristics.(a) Axial component of defect depth signal.(b) Radial component of defect depth signal.(c) Axial component of defect length signal.(d) Radial component of defect length signal.(e) Axial component of lifting height signal.(f) Radial component of lifting height signal.

Figure 14 .
Figure 14.Comparison of prediction results.(a) Schematic diagram of defect depth.(b) Schematic diagram of defect length.

Figure 14 .
Figure 14.Comparison of prediction results.(a) Schematic diagram of defect depth.(b) Schematic diagram of defect length.
; p  is plastic deformation; e  is the von Mise stress; E is the Young's modulus, 2.07 × 10 9 Pa; ys  is the yield strength of the pipeline steel, 8.06 × 10 8 Pa.

Table 1 .
Comparison of experimental data and simulation results.

Table 2 .
Change of defect dimension with corrosion time.

Table 2 .
Change of defect dimension with corrosion time.

Table A1 .
The feature of magnetic flux leakage signal distribution curve.