1. Introduction
With rapid economic and social development, pipeline transportation has become one of the most efficient and economical ways of transporting material. However, the safe operation of pipelines represents an increasingly serious challenge considering the large-scale development in the pipeline transportation industry and pipeline mileage enhancement. Regular inspection and safety assessments of pipeline defects are of great significance to the prediction and timely elimination of pipeline safety hazards [
1,
2].
In general, pipelines are formed by metals and intended for long-term operation. They are vulnerable to the damp soil, internal electrolytes and erosion of transport materials, resulting in cracks, deformations and other defects which may eventually lead to undesired accidents [
3]. The girth welds represent the weakest parts of the pipeline, which are limited by the construction quality level and insufficient control of the welding quality. Cracks are the main form of pipe failure, where the leakage in a sufficiently large crack may result in environmental damage and do harm to humans. According to the US Department of Transportation Pipeline and Hazardous Materials Safety Administration [
4], in 2010–2012 there were eight pipeline accidents caused by girth welding cracks. According to the research of Wang et al. [
5], at present, oil and gas pipeline crack accidents are mainly caused by inner surface cracks of the girth welds. However, the surface morphology of the girth welds is complex and difficult to assess. As a result, the detection of defects in the inner surface of the pipe, especially those superimposed on the circumferential welds, represents the key challenging point of non-destructive pipeline testing.
At present, the most common method for pipeline inspection is to use a pig equipped with non-destructive testing equipment [
6]. The nondestructive testing equipment method is mostly based on magnetic flux leakage testing [
7] (MFLT) and electromagnetic acoustic transducers (EMATs). Nevertheless, MFLT suffers from low precision and is incapable of detecting small defects, and the EMATs are susceptible to interference, which results in poor signal quality [
8]. As a consequence, these two approaches cannot effectively identify girth weld defects. On the other hand, eddy current testing (ECT) technology is endowed with the advantages of high sensitivity, high precision and non-contact, and may be efficiently applied to automatic detection [
9,
10,
11,
12,
13]. It has been widely used for the non-destructive testing of pipelines, especially for the detection of the girth weld defects in the inner surface [
14,
15]. Eddy current testing is typically accomplished by qualitative and quantitative assessment of the defects through the comparison of a test signal to a reference signal. However, a high probability for misjudgment may be expected since the method often largely relies on the experience of the examiner.
This paper introduces a method for the embedded recognition of girth weld defects in the inner surface of the pipe by leveraging image processing, neural network techniques, and ECT technology. In order to accurately and intelligently judge the defects, the system assumes the geometric characteristic parameters as the input and the presence or absence of the defects as the output, where the neural network algorithm could be very useful. Moreover, the neural network algorithm offers many advantages such as simple learning rules, non-linear mapping and easy computer realization. To recognize girth weld defects, we first synthesize the impedance diagram of the eddy current signal, and then use image processing to extract the geometric characteristics of the diagram with proper sorting features, selected using a class scattering matrix. Finally, a recognition algorithm is applied using a FPGA (Field-Programmable Gate Array). The method provided has high reliability, high recognition speed, low power consumption and high accuracy.
2. Operation Principle
2.1. Principle of Eddy Current Testing
ECT operates based on electromagnetic induction, where an eddy current is induced on the surface of the conductive material through an electric coil. We move the eddy current probe on the examined surface, and correspondingly, the defects and fluctuation in the size and material of the conductive surface will lead to a change in the eddy current field which, in turn, results in a change of the coil’s impedance. Hence, the information on the existence of the defects on the examined surface may be achieved by measuring the variation of the coil impedance [
16].
2.2. Characterization of the Original Signal for ECT
Up to now, most pipeline eddy current testing facilities achieve the identification of defect signals through the analysis of the original signals of the ECT [
17]. However, it is difficult to identify the defects from the base noise of the weld, and the signal analysis is complicated due to the complex material and dimensional changes of the girth welds in the inner surface of the pipes.
Figure 1a shows the original signal of the ECT for the girth weld with defects while
Figure 1b shows the original signal without any defects. It may be seen from these figures that the two signals possess similar shapes and a large jump at the weld position. Therefore, it is difficult to distinguish whether a defect lies in the weld based on the information contained in the original signal.
3. Feature Extraction of the ECT Signal Based on the Impedance Diagram
3.1. Embedded Eddy Current Testing System
Figure 2 shows the experimental system. An external absolute eddy current probe is used for ECT. First, the probe illustrated in
Figure 2c is driven by a 100 kHz sine wave, which is generated by the DDS (Direct Digital Synthesizer) technology and controlled by the host computer.
Figure 3 depicts the related electronic circuits. We use the orthogonal lock-in amplifier (LIA) technology to decompose the original signal [
18], and a two-dimensional impedance diagram is synthesized by the decomposed signals to reflect the variations of the coil impedance. The characteristic components of the impedance diagram are extracted through an image processing algorithm, and the defects in the girth weld are identified by utilizing the difference in the impedance variations caused by the weld and the defects. All the test specimens in this paper are pipe sections of the API SPEC 5L X70 type, whose features are described in
Table 1. The physical photograph is shown in
Figure 4.
3.2. Synthesis of the Impedance Diagram
To synthesize the impedance diagram, we first retrieve the real and imaginary parts of the eddy current signal. As the original signal possesses low energy and low signal-to-noise ratio, the LIA is used to extract and decompose the signal. It should be noted that not only the real and imaginary parts of the eddy current signal reflecting the coil impedance are achieved, but also the signal-to-noise ratio of the detection signal is greatly improved [
19,
20].
Figure 5 shows the test signal and impedance diagram of the defects in the girth weld. Specifically,
Figure 5a plots the real part achieved by the LIA, and
Figure 5b plots the imaginary part.
The real and imaginary parts of the ECT signal represent the abscissa and the vertical coordinate, respectively. A two-dimensional trajectory map reflecting the impedance change of the probe may be achieved, hereinafter referred to as an impedance diagram.
Figure 5c plots the impedance diagram of a defect in the girth weld. It may be seen from this figure that the impedance diagram is a pattern composed of two straight lines with different slopes. Experimentation shows that different geometric characteristics occur in the impedance diagrams generated by defects of different types and sizes. The physical properties of the cracks have a certain impact on the measurement and characteristics of the impedance maps. The larger the depth of the crack is, the larger the amplitude of the original eddy current signals. This, in turn, results in a more obvious geometric characteristic of the impedance map. However, when the width of the crack is close to the probe, the characteristics of the impedance map significantly change. Moreover, the positions of the cracks have a certain influence. The result is greatly different between the two sides of the girth weld and the middle of the weld. This paper discusses a particular situation where the crack is located in the middle of the girth weld.
Figure 6 demonstrates typical impedance diagrams of girth weld defects. From this figure, great differences may be seen in the geometrical characteristics between the impedance diagrams of defective and non-defective welds. Therefore, the key problem of the identification system is to determine which geometric characteristic parameters in the impedance diagram should be extracted as the input parameters of the neural network.
3.3. Selection of Characteristic Components of Impedance Diagrams through Scattering Matrix
Since the signal to be recognized is in the form of an impedance diagram, the geometric parameters of the impedance diagram are used as eigenvalues. The evaluation and selection of the geometric characteristics of the impedance diagram are carried out using the scattering matrix evaluation method [
21]. This method is used to estimate the covariance of the multidimensional normal distribution. The intra-class scattering matrix is defined as the size of the intra-class variance, as:
where ∑
i is the covariance matrix of
ωi.
Pi ≈ n
i/N is the prior probability of
ωi. The number of samples belonging to
ωi in sample N is n
i. The inter-class scattering matrix may be then formulated as:
where
μ0 = ∑
Piμi. The global mean, as well as the measure of the average of each class of samples, may be evaluated using {
Sb}. The mixed scattering matrix is the covariance matrix of all class averages. It is also the sum of the intra-class scattering matrix and the inter-class scattering matrix, so that:
In Equation (4), {
Sm} is the sum of the global variance. The criterion values may be achieved by the above definition as:
Therefore, the classification effect is reliable if the intra-class variance of a certain eigenvalue is small; that is, each class is in the vicinity of the mean, and the different classes are far apart. Meanwhile, the criterion’s value is larger. Conversely, if the criterion value of the characteristic is relatively small, the effect of the characteristic for classification and recognition is relatively small. The following two criterion values are commonly used in practical applications:
In this paper, ten geometric characteristics of the impedance diagram were selected to calculate the criterion values of the scattering matrix. The corresponding results are shown in
Figure 7.
By selecting five of the characteristic components of the maximum criterion values as the characteristic parameters of the impedance diagram, the classification of the data set yields satisfactory results. The selected feature components are as follows: the expectation of the slope of fitted straight lines, the expectation of closed curve areas, the variance of closed curve areas, the variance of the slope of fitted straight lines and the number of closed curves that exceed the threshold area. We next use the Hough transform and the contour extraction algorithm to extract the characteristic parameters of the impedance diagram.
3.4. Extraction of the Characteristics of the Impedance Diagram by Image Processing Algorithm
The Hough transform [
22] is a fast algorithm for finding straight lines, circles, and other simple shapes in a binary image. The standard parametric equation of a straight line (termed l) in the image space is as follows:
where
ρ is the distance between l and the origin and
θ is the angle between l and the x-axis. According to Equation (8), the different points of line l are represented as a sinusoid that intersects at one point in the parameter space. If the intersection is determined, that is, the local maximum, the line transformation is realized. The pixel gray value at (
xi,
yi) in the binary image whose size is N × N is represented as I (
xi,
yi). In the parameter space, M discrete values are for
θ evenly selected between (0, π). The number of the samples of
ρ is Q. Then, the standard Hough transform may be expressed as:
The contour extraction algorithm [
23] is also known as an approach for emptying a shape of its internal points. Specifically, if a black point exists in the input binary image and the neighboring points are also black, the point is considered as an internal point and is hollowed out. When all the internal points are hollowed out, the contour line is achieved.
Figure 8 shows the extraction process of the geometric features of the impedance diagram. Since noise or individual erroneous data points may exist in the original image, the morphological filtering is performed by combining the opening closing operations. In general, the opening operation removes the isolated dots and burrs, while the closing operation fills the holes, preserving the image position and shape.
Table 2 provides the characteristic parameters of
Figure 5c achieved by the feature extraction algorithm.
3.5. Investigaton of the Influence of Lift-Offs on the Impedance Diagram
Considering that ECT is very sensitive to lift-off, the influence of lift-off on the impedance diagram is investigated. Using the automatic scanning system with the stimulating frequency as well as the scanning speed kept unchanged, three samples with different types of cracks are tested under different lift-off values. Neglecting the thickness of the probe jacket protecting the internal coil, the four lift-off values are respectively 0 mm, 1 mm, 2 mm and 5 mm.
Figure 9 shows the retrieved impedance diagrams of a weld crack, body crack and weld toe crack under different lift-offs. The crack depth for all cracks is 80%. It can be observed that for each type of crack, as the lift-off increases, the pattern size of the impedance diagram accordingly decreases, yet the pattern structure remains the same. When the lift-off is less than 2 mm, the pattern size of the impedance diagram is acceptable, in which case the crack type can be easily identified. When the lift-off exceeds 2 mm, the tiny pattern size is beyond acceptance and the crack type can hardly be distinguished correctly. Consequently, the lift-off value is supposed to be less than 2 mm during the test process. In our experiments, to avoid the possible impact from lift-off fluctuation, we employed a specially designed spring structure, as illustrated in
Figure 10, to keep the probe tip in touch with the specimen surface.
4. Defect Recognition based on a Back Propogation Neural Network
A neural network is an extensive parallel network composed of adaptive simple units which is capable of simulating the interactive response of a biological nervous system to actual objects. The error back propagation (BP) algorithm represents an outstanding representation of neural networks. Furthermore, it may be considered as the most successful neural network learning algorithm to date [
24]. The system assumes the image of the Lissajous curves as the input, whereas the x and y components are the real and imaginary parts of the eddy current signal, and the existence of the cracks as the output. Here, 1 (0) indicates the presence (absence) of the crack. The BP algorithm based on the gradient descent strategy is used, which does not involve the calculation of a second derivative but still has quadratic convergence characteristics, thus allowing for a faster convergence rate and a relatively small number of computations. The input of the BP neural network is the five characteristic parameters of the impedance diagram, and the output is the probability of the defects in the specimen. Since the output is a value between 0 and 1, we choose the Sigmoid function as the activation function.
There is no definite theorem for the selection of the number of hidden layers and the number of its nodes. In theory, a three-layer BP network with only a single hidden layer may approximate any function [
25]. A larger number of hidden layers requires more samples and time for training. Thus, here we use a three-layer BP network with a single hidden layer. Concerning the selection of the number of nodes in the hidden layer, the experimental results show that for a small number of nodes, the network does not have the necessary learning and information processing capacity. On the contrary, a large number of nodes yields significant enhancement in the complexity of the network structure. Moreover, the network falls into a local minimum in the process of learning more easily and exhibits a very slow learning speed. According to the experience, a suitable number of hidden layer nodes is 13–17. After repeated experiments comparing the training error, the minimum training error was achieved for the 15 hidden layer nodes.
Table 3 lists the training results.
We selected 50 pipeline specimens for the testing and synthesis of the impedance diagrams, with the defects lying in the girth welds and other complex morphologies.
The eigenvalues of the impedance diagrams were extracted as the test data using the image processing algorithm and fed to the neural network for identification. The recognition results are listed in
Table 4.
Four errors were seen in the 50 test samples, corresponding to a 92% accuracy rate. Moreover, 10 samples were the girth weld signals without defects, and 30 samples contained the defects. The 40 sets of samples included three sets of errors, which corresponds to a correct detection rate of 92.5%. It is therefore shown that the identification system could effectively recognize the defect signals in the girth weld and overcome the shortcomings of the conventional eddy current testing equipment, when attempting to correctly recognize the defects in the girth weld and other complex morphologies.
5. Defect Recognition Algorithm Based on Acceleration of FPGA
To date, hardware acceleration of neural networks has been extensively studied. Due to the high degree of parallelism of the network’s operation, the current hardware acceleration means are mainly based on the CPUs (Central Processing Unit) and FPGAs. The CPU implementation is characterized by high versatility and relatively simple development effort, but high-power consumption. In contrast, FPGAs offer high performance, low power consumption and high flexibility. What’s more, it could be arranged into different dedicated neural network configurations according to the application environment. Therefore, we use a FPGA to realize the BP neural network and achieve faster run times and lower power consumption than conventional CPUs [
26].
Figure 11 shows the flow chart of a BP neural network algorithm based on the FPGA. It may be seen from this figure that the algorithm requires a neural element accumulation multiplication module, an excitation function module of the Sigmoid function, an error calculation module, a weight update module and a RAM (Random Access Memory) module. Among them, the RAM module is implemented using an IP (Intellectual Property) core, and the Sigmoid function module is realized by the piecewise nonlinear function approximation. Other modules may be implemented using simple addition, subtraction and multiplication.
We then use the same training set to test the running speed and power consumption of the neural network algorithm using the FPGA and CPU implementations.
Table 5 shows the results. We see that compared to the CPU, the calculation speed of the FPGA is increased by about 30 times, while its power consumption is 1/10 of the CPU’s.
6. Conclusions
We presented a method for efficient eddy current detection and recognition of the defects in the girth welds of pipelines. This method uses an embedded system based on image processing with a back propagation neural network. Conventional internal testing methods of pipelines, e.g. the magnetic flux leakage technique and the ultrasonic technique, are not able to detect defects of the girth weld [
7,
8]. However, the eddy current testing method based on the impedance diagram analysis proposed in this paper could effectively identify the cracks in the girth weld. In contrast with the conventional eddy current testing [
9,
10], we used the two-dimensional impedance diagram of the eddy current detection signal and selected the geometric characteristic parameters of the impedance diagram with proper classification effect using the intra-class scattering matrix. Then, an image processing algorithm was used to extract the characteristic parameters of the impedance diagram that were considered as the network input. Finally, the back propagation neural network was trained using the training set, which realized an automatic recognition of the defect signals. The identification accuracy of the system is high, which provides a new idea for non-destructive testing of the pipes and overcomes the shortcoming that conventional pipeline inspection can not detect the defects in the girth weld effectively. Moreover, we implemented the defect recognition algorithm using a FPGA and achieved higher computational performance. The real-time online analysis could be achieved under lower power consumption and provides eddy current detection and recognition of the girth weld defects in a pipeline inner surface using an embedded system. The implementation of this system provides a basis for the pipeline pig application.
The limitations of the proposed system are as follows. Due to the limitation of the machining accuracy, the minimum depth of the cracks is about 2.5 mm and the width is about 0.7 mm. It could only judge the existence of the cracks in the girth weld, but cannot determine the characteristics of the defects, such as depth, width, length, morphology and other parameters. In response to this problem and to enrich the training set, the processing method of the experimental specimens needs to be improved, and more kinds of specimens need to be tested. The speed of the data acquisition and the recognition need to be further improved in order to be applied to the pipeline pigs. The detection range is limited by the number and size of the probe, and only small areas may be detected. To solve this problem, it is necessary to study the design and application of the array probes.
For the crack in the girth weld, the conventional magnetic flux leakage technique and ultrasonic technique may not be applicable. That makes the eddy current testing a breakthrough. The design of the eddy current array probe and corresponding signal processing methods should be seriously taken into account, which could expand the detection area and may greatly facilitate the development of defect imaging technology.