Transient electromagnetic apparent resistivity imaging technology is one of the more promising methods for external inspection of metallic oil and gas pipelines. Through the research on the transient electromagnetic response and imaging technology of pipelines, it is found that the accuracy and real-time performance of the apparent resistivity calculation are the key to its application. To achieve fast imaging, a three-layer BP neural network is designed with the kernel function of the secondary field as the input and the transient parameter value as the output; the nonlinear equation of transient response is fitted by the neural network to solve the apparent resistivity, and inversion depth is calculated based on smoke ring theory. Aiming at the shortcomings of the traditional BP network, such as slow convergence rate and the ease of falling into local minima, the genetic algorithm is designed to optimize the initial weight and threshold of the network. In the model pipeline experiment, the measured data are brought into the trained GA-BP network, and calculation time is greatly shortened. The obtained sectional image can directly and accurately reflect the pipeline shape. The validity and practicability of the transient electromagnetic apparent resistivity imaging technology based on the GA-BP neural network are verified, which is expected to be a powerful tool for real-time evaluation of pipeline corrosion detection.
As of the beginning of 2018, the total mileage of China’s long-distance oil and gas pipelines has accumulated to approximately 133,100 kilometers. This increased length of pipelines makes in-service corrosion inspection more and more important for the safe operation of oil and gas pipeline networks. At present, internal inspection devices and technologies based on magnetic flux leakage and ultrasonic waves are mostly adopted, but they are all affected by the pipeline structure, operating environment, and transmission medium, especially the buried pipelines, which are limited by high cost and difficulties in implementation and accurate positioning of defects. The noncontact pipeline external inspection technology with the advantages of trenchless and nonstop transmission will be the main development direction for breaking through the bottleneck of the pipeline testing industry in the future.
The transient electromagnetic method is a kind of controllable artificial-source time-domain electromagnetic testing method based on the electromagnetic induction principle: the primary magnetic field generated by the pulse current is transmitted by the transmitting coil above the pipeline, and the eddy current secondary field signal carrying the electromagnetic characteristics of the metal pipe is received by the receiving coil; apparent resistivity imaging technology is used for signal analysis and inversion interpretation; finally, the position and metal quantity change of the pipeline can be displayed visually to achieve noncontact external inspection of oil and gas pipelines.
Tartaras and Zhdanov first proposed the S-inversion method based on the “floating thin plate model,” which converted the time derivative matrix of the detected vertical magnetic-field component into the apparent conductivity-depth value to obtain a continuous image [
Therefore, the method of solving the transient electromagnetic apparent resistivity under the central-loop device using the BP neural network optimized by the genetic algorithm is proposed. The BP (backpropagation) neural network is a supervised multilayer feedforward network trained by the error backpropagation algorithm [
In the detection using the transient electromagnetic method, the central-loop device is optimally coupled with the oil and gas pipelines, and the reflected abnormal amplitude and lateral resolution are the largest. Therefore, this paper discusses the inversion imaging technique of transient electromagnetic response using the central-loop model under the step pulse current excitation.
The time-domain expression of the step pulse current excitation function is
According to the Duhamel integral, the analytical expression of the transient response under the central-loop device is obtained as [
The transient response expressions (
According to Nabighian’s smoke ring theory [
Oil and gas pipelines are generally laid horizontally, which can be regarded as one layer of layered medium. The vertical depth
The diffusion velocity
Every layer’s apparent resistivity
The corresponding apparent depth
In summary, the apparent resistivity imaging process is shown in Figure
Transient electromagnetic apparent resistivity inversion imaging flowchart.
The premise of realizing transient electromagnetic fast inversion imaging is to accurately calculate the apparent resistivity value of a pipeline, but there is a relatively complicated implicit function relationship between the transient response value of buried pipelines and the apparent resistivity. Conventional numerical methods (such as iterative methods) are complex and inefficient. Nevertheless, the artificial neural network (ANN) is particularly suitable for the processing of uncertain and unstructured data. With the help of previous data, the relationship between the kernel function and the transient parameter can be established directly, which makes fast imaging possible.
The BP neural network includes one input layer, several hidden layers, and one output layer. The learning algorithm is realized by signal forward propagation and error backpropagation: sample signals enter the hidden layer from the input layer after weighted cumulative processing, and hidden layers generate the output signal to the output layer through complex nonlinear transformation; if the result does not match the expected output, the error will be returned to the input layer through the hidden layer; each layer modifies the weight and threshold of every neuron according to the error signal obtained by itself so that the error decreases along the gradient direction; after updating the connection weights and thresholds, the forward propagation process of the signal is repeated; repeated training will continue until the output error meets the desired range or the predetermined learning times are reached. The structure of the BP neural network is shown in Figure
BP neural network structure.
Take a 3-layer BP network with one hidden layer as an example. The input layer has
The BP network belongs to the multilayer feedforward backpropagation network. Each neuron in each layer can only connect with the neurons in the former and the latter layer: when the signals propagate forward, the neuron receives the signals from all the former layer’s neurons and transmits the output to all the neurons in the next layer. No information is transmitted between neurons in the same layer.
For a given sample
The input of the
The output error
The conventional BP network training algorithm adopts the gradient descent method or Gauss–Newton method to correct the connection weight and threshold of the hidden layer, input layer, and output layer according to the principle of error gradient descent.
In order to enhance the performance of the BP network, the Levenberg–Marquardt (L-M) algorithm is used to train the network, which is better for solving nonlinear problems.
The L-M algorithm is a combination of the gradient descent method and the Gauss–Newton method, which can achieve seamless movement between the two methods and greatly improve the convergence rate. The idea is that each iteration does not follow a single negative gradient direction but allows errors to be searched along the direction of deterioration and dynamically adjusts the convergence direction of iteration. By adaptively optimizing the weights between the gradient descent method and the Gauss–Newton method, the training can converge effectively, and the convergence rate and generalization ability of the network can be greatly improved. New weights and thresholds are updated as
The correction quantity ∆ is
After getting the new weights and thresholds according to the correction quantity ∆, the square sum of error
For each given sample, the connection weights and thresholds of the network are updated layer by layer based on the error. When all given samples are trained, the network global error
If
The BP neural network has good performance in self-learning, self-adaptation, and generalization capabilities, but for nonlinear systems and complex objective functions, the use of the unoptimized gradient descent method will lead to the problem of long training time and local optima. The genetic algorithm (GA), a global optimization search algorithm, is selected to optimize the BP neural network to accelerate convergence and ensure the global optimum of training results.
The GA uses a heuristic global random search method to simulate the process of biological evolution in nature [
The steps to optimize the BP network using the genetic algorithm (to get the GA-BP network) are as follows: The transient electromagnetic method inspection data are normalized; the network topology, the number of layers, the number of neurons in each layer, etc. are determined; and the network is generated. The initial weights and thresholds are encoded to form the initial population; each individual in the population represents a combination of initial weights and thresholds of the network. The reciprocal of the objective function of the BP network is used as the fitness function to calculate the fitness of each individual, and the selection, crossover, and mutation genetic operators are applied to evolve the current population to generate a new population. The above steps are repeated until the population reaches the maximum evolutional generation, and the genetic operation is ended; the individual with the greatest fitness in the current population is selected as the optimal individual. The optimal individual is decoded, and the obtained weights and thresholds are substituted into the BP neural network as the initial value for training until the network performance meets the desired requirements.
The flowchart of the GA-BP network algorithm is shown in Figure
GA-BP network algorithm flowchart.
In view of the excellent performance of the GA-BP neural network in nonlinear curve fitting, according to the above-mentioned research, the neural network with kernel function as the input and transient parameter
According to equations (
Generalization ability of the BP network is determined by the complex degree of the problem, the structure and size of the network, and the number and representative of given samples. According to Kolmogorov’s theorem, a three-layer BP network can achieve the approximation of any nonlinear function. In this paper, we design a 3-layer BP network containing one hidden layer with
There is no general method to determine the number of neurons in the hidden layer. If the number is too small, the network performance will be very poor and the law of samples cannot be reflected; if the number is too large, the “overfitting” phenomenon will appear, the training time will be longer, and it will easily fall into the local optimum solution. The errors of various neural network models with different numbers of hidden neurons are analyzed through simulation research, and the calculation results are shown in Figure
Errors of various neural network models with different hidden neurons.
Based on the above analysis, the final designed BP neural network has a three-layer architecture, as shown in Figure
Topological structure of the final designed BP neural network.
The BP network belongs to supervised learning, and the training samples are determined by numerical calculation according to equation (
It is known by the backpropagation algorithm that the larger the learning rate is, the greater the weight change and the faster the convergence speed will be. However, excessive learning rate will cause network oscillation, leading to low performance, and it is easy to cause algorithm instability when exceeding a certain extreme value. The smaller learning rate can ensure the stability and convergence of the system, so the learning rate in this paper is set at 0.05.
After the network structure is determined, the weight set and threshold set will be generated randomly, and global optimization is carried out on them by the genetic algorithm. The obtained global optimal or approximate optimal weights and thresholds optimized by the genetic algorithm are used as initial weights and thresholds of the BP algorithm for further training the neural network.
When designing a genetic algorithm, the connection weights and thresholds should be coded first. They are transformed into chromosomes in the population with the representation of the gene string code to construct the search space which the algorithm can deal with. The input layer and output layer of the BP network have 1 neuron, and the hidden layer has 13 neurons, so the number of connection weights is 1 × 13 + 1 × 13 = 26. The hidden layer needs 13 thresholds, and the output layer has 1. Then, the total number of parameters that need to be optimized by the genetic algorithm is 26 + 13 + 1 = 40. Conventional binary coding would result in a too large solution space for training and low search efficiency. In this paper, real coding is used: the gene code of each chromosome is represented by a real number in a certain range, which facilitates the introduction of heuristic information related to the problem domain to increase the search ability of the algorithm.
After population initialization coding is completed, based on the simple and general principle, the fitness of each chromosome is evaluated by evaluation function derived from the reciprocal of the objective function of the neural network, which measures that the degree of individuals in the group can achieve or contribute to finding the optimal solution in the calculation. As one of the control parameters, the population size—the total number of chromosomes—has a significant impact on the efficiency of the algorithm: too small size is not conducive to evolution, while too large size will lead to an increase in computational complexity and an excessively long convergence time. Generally, the population size is between 10 and 200, and 50 is selected in this study.
After all chromosomes are evaluated, the selection operator is used to extract chromosomes from the current population to create an intermediate population. The selection operation uses a combination of optimal individual preservation and roulette: the best individual preservation strategy is adopted first; that is, the individuals with the highest fitness do not participate in the crossover and mutation operations but are directly copied to the next generation to ensure that the optimal solution of a certain generation will not be destroyed. In order to avoid falling into local optima, roulette selection is adopted for other individuals in the current generation; that is, the probability of an individual being selected is proportional to its fitness; the higher the fitness, the greater the probability of being selected, which not only ensures the diversity of individuals in the population but also keeps the fitness function value of individuals close to the optimal solution.
Crossover and mutation operations are carried out in the intermediate population generated by the selection operation to produce the next-generation population representing the new solution set. Crossover operation is the operation of replacing and recombining the partial structure of two parent individuals to generate new individuals, which is the main method to generate new individuals and determines the global search ability of the algorithm. In this paper, the arithmetic crossover method matching with real number coding is used to generate new individuals from the linear combination of two individuals.
Mutation operation is to replace the values at some loci in an individual’s coding string with other alleles at those loci to form a new individual, which is the auxiliary method to generate new individuals but determines the local search ability of the algorithm, and it is possible to repair important genes lost during the crossover process. We adopt nonuniform mutation to make random perturbations to the original gene values, and the results are used as the new gene values after the mutation. Each locus is mutated with the same probability, which is equivalent to a slight change in the whole solution space.
The key to control crossover and mutation operations is crossover probability
After the new population is generated by selection, crossover, and mutation operators, the evaluation and creation procedures of all chromosomes are repeated, and the fitness of the population is continuously improved until the stop criteria are met. Then, the chromosomes in the final optimal population are decoded as the initial weights and thresholds of the network; the backpropagation training is carried out using the L-M algorithm until the performance index meets the expected value, and the final optimal value of the BP network is obtained.
After the parameters of the BP neural network and genetic algorithm and samples are determined, the neural network is trained by classical BP and GA-BP, respectively, and the results are compared, as shown in Table
Comparison of BP and GA-BP.
Algorithm | Average elapsed time | Average convergence steps | Prediction error |
---|---|---|---|
BP | 19.584000 s | 931 | 0.00297 |
GA-BP | 12.356000 s | 798 | 0.00159 |
Finally, the GA-BP neural network composed of the optimal weights and thresholds between each neuron is used as the tool to solve apparent resistivity:
Through the model pipeline experiment, the constructed GA-BP network is tested and its effectiveness and practicability are analyzed. In order to verify whether the imaging technology established in this paper can accurately reflect the shape of the pipeline, the model pipeline is composed of three steel pipes of different diameters and wall thicknesses. The specifications are
Experimental pipeline section and layout of measuring points.
The experimental testing device is the “oil and gas pipelines’ transient electromagnetic method external inspection equipment” developed by the laboratory. It is composed of an antenna device, a transmitter, a receiver, and an upper computer and has the characteristics of an integrated transceiver, remote operation, and so on. The host and working connection mode of the transient electromagnetic method external inspection equipment are shown in Figure
Host (a) and working connection mode (b) of the transient electromagnetic method equipment.
The experimental parameters, device parameters, and working parameters are shown in Table
Experimental parameters, device parameters, and working parameters.
Type | Name | Value |
---|---|---|
Environmental parameters | Medium | Air |
Simulated burial depth | 1 m | |
Air permeability | 4 | |
|
||
Device parameters | Antenna material | Enameled copper wire + timber framework |
Size of the transmitting coil | 800 × 800 mm | |
Turns of the transmitting coil | 6 | |
Size of the receiving coil | 400 × 400 mm | |
Turns of the receiving coil | 12 | |
|
||
Working parameters | Excitation current | 3 A |
Transmitting frequency | 16 Hz | |
Superposition times | 10 | |
Multiple of preamplifier + multiple of main amplifier | 8 + 16 | |
Sampling interval | 1 | |
Turn-off time | 1.2 |
Before the experiment, the ambient noise level and background field of the pipeline-free site are measured first, and the results show that the experimental environment is basically free from interference and the background field is relatively stable. Then, the pipe is laid flat on the ground and the testing is started; during the inspection, each measuring point should be observed twice at least, and the relative error of the two observations should not exceed 3%; if it exceeds, more observations should be made, and the average of 2-3 sets of data with the least deviation is taken as the response data of the measuring point. The experimental site is shown in Figure
Experimental site.
In order to ensure the consistency of the detection data and facilitate postprocessing and interpretation, the induced voltage value normalized by the emission current (
Measured data.
The measured data of the first few time windows reflect the trend of the secondary field changing with the shape of the pipeline, but further quantitative inversion interpretation is still needed.
Before calculating the apparent resistivity, the induced voltage is converted into the transient field value
Image of apparent resistivity based on the GA-BP network.
The distribution and depth of the pipe can be clearly shown from the image. The pipeline layout range starts from measuring point 4, and the apparent resistivity is gradually increased relative to the environmental medium; the abnormal apparent resistivity displayed at measuring points 5–37 reveals different outer diameters of the three sections of pipes; measuring points 17 and 26 correspond to the joint face of pipelines, which is in accordance with the actual model. Starting from measuring point 37, the testing coil is gradually removed from the model pipeline, and the apparent resistivity is decreased. The image perfectly matches with the actual pipe shape. The time required for calculating apparent resistivity by the conventional numerical algorithm and trained GA-BP neural network is shown in Table
Comparison of numerical algorithm and trained GA-BP neural network algorithm.
Algorithm | Computational time | Maximum number of iterations | Maximum error (%) | Average error (%) |
---|---|---|---|---|
Numerical algorithm | About one hour | 28 | 1.14 | 0.0471 |
GA-BP neural network | Less than 1 s | — | 0.51 | 0.26 |
The results show that the GA-BP neural network with powerful parallel computing ability is obviously superior to the conventional numerical method in terms of computing speed; the computational time is less than 1 s, and the accuracy is also in line with the requirements. It is proved that the theoretical method and transient electromagnetic method inspection equipment studied can be applied to the detection of pipeline burial depth and metal loss, which can be used as a general survey tool for pipeline corrosion.
The key of transient electromagnetic apparent resistivity inversion imaging technology is to calculate the apparent resistivity quickly and accurately. In this paper, a BP neural network with the input of the kernel function of the secondary field intensity and the output of the transient parameters is constructed; the apparent resistivity under the central-loop device is solved based on the fitting of the nonlinear equation; the depth algorithm of smoke ring inversion is used to achieve the real-time imaging. In order to overcome the disadvantages of the conventional BP network, such as slow convergence, the genetic algorithm is used to optimize the initial weight and threshold of the network according to the objective function to improve the network performance. The model pipe experiment and imaging results show that the apparent resistivity inversion technology based on the GA-BP network can accurately describe the shape and distribution position of the pipe, and the trained network can be used as a fast and effective tool to solve the apparent resistivity under the central-loop device, which provides an intuitive and practical means to determine pipeline metal loss through the inversion results.
In the process of experiment, the pipeline model with obvious morphological differences is specially adopted to test the feasibility of the trenchless pipeline transient electromagnetic inspection method established in this paper. In the next step, the prefabricated buried pipeline with pre-prepared defects will be tested in real time, focusing on the imaging effect of minor defects and the influence of soil characteristics on the detection results, and the application range and precision of neural network inversion imaging technology will be studied further.
The data used to support the findings of this study are available from the corresponding author upon request.
The authors declare that they have no conflicts of interest.
This research was supported by the National Key Research and Development Program of China (Grant no. 2016YFC0802100).