Defect reconstruction from magnetic ﬂux leakage measurements employing modified cuckoo search algorithm

: Accurate and efficient estimation for defect profile of magnetic ﬂux leakage (MFL) signals is important for nondestructive evaluation in industry. To improve the accuracy of defect profile reconstruction, an improved reconstruction method based on modified cuckoo search (CS), called MCS, is proposed in this paper. Firstly, a novel single-dimension updating evolution strategy is proposed to avoid the interference between multiple dimensions, which can make full use of the appropriate nest position in the historical search. Secondly, an adaptive multi-strategy difference evolution is introduced into the evolution process to improve the diversity and efficiency of CS algorithm. The proportion factor of each strategy in multi-strategy difference evolution is adjusted dynamically according to the value of the objective fitness. Finally, various MFL signals are selected to verify the effectiveness of the proposed MCS algorithm. The experiment results illustrate that the proposed method has high performance on the quality of the solution and robustness for noise.


Introduction
For the nondestructive testing problem, the solution methods can be classified into three different categories: magnetic flux leakage (MFL) testing [1,2], eddy current testing [3,4], and ultrasonic testing [5]. Among these methods, the MFL technique is a highly efficient and popular implementation, strong ability of searching and so on. The CS algorithm is widely used in solving with optimal problems, such as function optimization, power system optimization and parameter estimation. In the study and application of the CS algorithm, it is found that the CS algorithm [25,26] has some drawbacks of weak local search ability, slow convergence speed and easy to get into the local solution. Therefore, in order to solve these shortcomings, a modified CS (MCS) algorithm based on single dimensional evolution strategy and multi-strategy difference evolution are introduced in original CS algorithm.
The innovations and main contributions of this paper are described as follows.
•An improved reconstruction method based on modified cuckoo search (CS), called MCS, is proposed to improve the accuracy of defect profile reconstruction.
•The single dimensional evolution is firstly proposed to optimize the process of the evolution. The dimension with the maximum error between preference signals and predicted signals is selected to update the position of its nest in CS algorithm.
•The DE with multi-strategy evolution is complemented to optimize the initial CS algorithm by the way of increasing the diversity of the swarm. The multi-strategy evolution can avoid the species into the local optimum, consequently the algorithm ability of global optimization is enhanced.
The remainder of the paper is organized as follows. The principle of the defect reconstruction problem is described in Section 2. The traditional CS algorithm is presented in Section 3. The modified CS algorithm is introduced in Section 4. The modified CS algorithm is used to estimate the defect profile in Section 5. The experimental results to demonstrate the performance of the proposed method are given in detail in Section 6. Finally, Section 7 concludes this paper and discusses future research direction.

Forward model of MFL signals
Ferromagnetic materials are magnetized under the action of external magnetic field, which leads to leakage magnetic field at defects. Due to the high magnetic permeability of ferromagnetic materials, the magnetic induction field of magnetized materials is relatively strong. When the materials are defective, the non-continuity of material properties leads to the magnetic refraction at the interface where they contact with the air, and the magnetic induction field in ferromagnetic materials is deflected to the air, forming magnetic diffusion. The principle of three-axis magnetic flux leakage detection is to saturate and magnetize the tube wall with permanent magnet, so that the tube wall between magnetic iron reaches the state of magnetic saturation, and then transfers to another steel brush and permanent magnet. The two permanent magnets are connected by yoke iron, and the permanent magnet steel brush tube wall and iron core finally form a magnetic circuit. The complete physical model of the MFL inspection system is shown in Figure 1, which mainly consists of permanent magnet, steel brushes, yoke iron, sensor and the inspected pipe wall.
The solid model is built according to the working state of the detection equipment in the pipeline with MFL. Since the detection model of the pipeline is axisymmetric, this model is built by selecting the radial profile of the detection equipment in the pipeline with MFL. The axial simplified model of the MFL inspection system is depicted in Figure 2. X52 steel is chosen as the material of the pipeline wall, its B-H curve is described in Figure 3. When the magnetic force line passes through the pipe wall, the magnetic force line passes through the pipe wall without defects and is evenly distributed. As shown in Figure 4. When there are defects in the pipe wall, the cross-sectional area of the pipe wall where the defects become smaller. As the permeability of the pipeline wall at the defects is far less than that of the pipe wall, the magnetic path at the defects becomes smaller and the magneto-resistance becomes larger. Finally, the magnetic force line is distorted, and a leakage magnetic field is formed when the pipe wall at the defects penetrates through the pipe wall. Figures 5 and 6 show the MFL signal corresponding to a group of rectangular defects with the same length and different depths. Figure 5 describes the axial component of the MFL signal, and Figure 6 shows the radial component.     FEM is adopted as the forward model to generate MFL signal, which provides a large number of samples for Radial-basis function neural network (RBFNN) to train. RBFNN utilizes a fast learning Distance/mm By/T speed and learning convergence speed to approximate the forward model. In RBFNN frame, there is three-layer neural network, including input layer, hidden layer and output layer. The size of the samples is proportional to the increased training accuracy.
The data extracted from the defects of pipeline wall is used as the input vector, and the MFL signal of different defects is regarded as the target output vector for the common defects. A highly uncertain nonlinear system can be achieved through the network operation. The model can be expressed mathematically as where is the i-th output component of the radial basis function, is the weight value of the input vector in the network, is the center of the i-th radial basis function, and M is the total number of radial basis functions. The Gauss function is the most commonly used radial basis function, so it is denoted as (2) where j  is the standard deviation of the Gauss function. Substitute Eq (2) into Eq (1), the relation between input and output of the neural network with the Gauss function as the radial basis function can be written as

Cuckoo search algorithm
Cuckoo search algorithm is a new and effective population-based optimization algorithm to solve high-dimension optimization problems. The algorithm is designed by the observations on the breeding behavior of cuckoo birds. It is called that certain species of cuckoos select suitable birds' nests to lay their eggs with the Lévy flights behavior [25][26][27]. Once the host bird discovers the presence of the cuckoo's eggs, the host bird will discard the cuckoo's eggs or rebuilds a new nest. In Cuckoo algorithm, Lévy flights random walks is utilized to replace isotropic random walks in GA and PSO algorithms. So it is more efficient than many swarm-based intelligent optimal algorithms. Its step is a random walk that satisfies a stable distribution of a heavy tail. CS has the three assumptions as follows.
(I) Each cuckoo lays only one egg at a time, and its egg is randomly put into a nest; (II) The nests with the highest quality of eggs will carry over to the next generation; (III) The number of host's nests is fixed, and the cuckoo egg is discovered by the host with the probability according to the following equation (4) with (5) where is the position of the d-th dimension for the k-th nest at t iteration; is a step length scaling factor. In general, , and is the d-th dimension of the best nest.
In Eq (11), is the step size obeying a given Lévy distribution.
Where is a constant, both u and v follow a normal distribution (6) After new nest is obtained by Lévy flight, it is possible that cuckoo egg in a host nest is found by its host bird with the probability a P . Random migration is the second important operation to update the solution. Random migration will produce a new solution to replace the previous one by two different solutions randomly selected from current solutions, and the updated formula is x t are two different nest position randomly selected from current nest at iteration, respectively. The new generated solution may be out of the search space, so the solution should be constrained as follows

Modified cuckoo search algorithm
Although cuckoo search algorithm has many advantages, e.g. strong global optimization ability and few parameters, it still has some drawbacks, such as low convergence speed, poor population diversity etc. Specifically, the major improvement of MCS algorithm includes the following two aspects. 1 1/

Single dimension evolution
In CS algorithm, each nest is updated and evaluated as a whole to investigate the effectiveness of algorithm evolution. It means that each dimension in each nest location will be updated, and all new generated dimensions will be evaluated as a whole. This overall updated and evaluation strategy is effective for single-dimensional optimization problems. However, for multi-dimensional problems, the search speed and convergence accuracy of the algorithm will be restricted due to the coupling phenomenon between multi-dimensions. The traditional CS algorithm does not make full use of the information of the current candidate solution. Therefore, the single dimension evolution strategy is adopted to optimize the quality of obtained solution to improve the search efficiency of CS algorithm.
Each generation of single evolution strategy only updates the solution of single dimension. In view of the correspondence between the defect signal and the corresponding MFL signal, the single evolution dimension is selected according to the difference between the reference signal and the MFL single of the estimated global best defect profile at current iteration. The selection of the dimension can be derived from the following equation N d sigma is Gaussian distribution with mean 0 d and standard deviation s .
The i-th dimension is updated according to Eq (4), the obtained new dimension together with the other dimensions constitutes a new candidate solution, and it is appraised by the objective function value. If the value is better than the function fitness value of the last generation, keep the candidate solution and continue to evolve until meet the stop condition. Due to the adoption of the greed rule, the algorithm only accepts new values that can improve the current candidate solutions, which ensures the target tuning of the search direction during the optimization process of the algorithm and does not affect the efficiency of the algorithm. Due to the single-evolution evaluation strategy using the greed rule, it will not abandon the global optimal evolution direction because of the degeneration of some dimensions. The single-dimension information guidance is used to carry out effective search and obtain higher quality solution results.

Multi-strategy DE mutation
In the cuckoo search algorithm, firstly the random search by Lévy Flight is designed to obtain new solutions, and then the part of the obtained nests are discarded to rebuilt new nest according to the probability a P . The second important process is designed on the basis of randomly selected nests from the population, to generate new nest position solution. In order to improve the population diversity, multi-strategy difference evolution is introduced into CS algorithm. A new updating strategy is designed on the basis of three following kinds of difference evolution strategies.
As an important branch of evolutionary algorithm, difference evolution is a heuristic global random search algorithm based on the differences among individuals [28]. The individual of the difference evolution algorithm will generate new individuals through mutation operation. The commonly used mutation strategy [29] is summarized as DE/Rand/2: (11) DE/Best/1: Current-to-best/1: (14) where F is the weighted factor; 1 2 3 4 5 , , , , [1, ] r r r r r N  are random number; N is the number of the population; ( ) best x t is the best individual in the current group, rand is random number that obey uniform distribution of [0, 1].
MCS algorithm combines Eqs (11)-(14) as the new random migration strategy which is used to rebuilt the solutions which have been abandoned according to the proportion a P . New random migration strategy consisting four choices can enhance the search efficiency and enrich the diversity of cuckoos. When a few of evolution strategies are implemented, we should consider the performance of each evolutionary strategy in each generation. The scaling factor is designed to be dynamically adjusted associated with the evaluation function. The MCS algorithm retains the global searching ability of CS algorithm, and improves local searching ability of CS algorithm. It provides an effective and feasible method to extract the characteristic of adaptive multi-strategy mutation process for DE algorithm.

Adaptive parameter strategy
The control parameters of MCS algorithm have an important influence on its optimization performance. Generally the control parameters are determined by traditional empirical methods which cannot always maintain the optimality.
The global search of MCS algorithm is carried out by adaptive Levy flight mechanism, the Levy flight step size decreases with the iteration. The improved algorithm has a larger step size factor in the initial stage of optimization, so as to expand the search space and improve the global search ability; in the process of optimization, the step size is reduced to improve the local search performance of the algorithm. The adaptive strategy of the step length scaling factor 1 c is described The probability a P of each generation is obtained by normal distribution, which can be expressed as In the evolution process, if the individual is better than that of the parent after multi strategy differential mutation, the corresponding a P will be stored in F S set. At the end of each generation According to the experience, the value of F should increase with the number of iterations. When the algorithm begins, F should be small, and in the later stages of the algorithm, the value of F will get large. Therefore, F is set as follows, Where max F and min F are the upper and lower bounds of F.

Complete optimization procedure of the MCS
The MCS algorithm with single dimension search and adaptive multi-strategy different evolution is described as follows in detail.
Step 1. Initialize the MCS algorithm. Set the size of nests N , the maximum number of iterations max T , the upper and lower bounds of search space, step length scaling factor 1 c and the probability a P . Randomly generate the positions of N nests.
Step 2. Calculate the fitness value.
Calculate the fitness value of each individual, and choose the best position of the individual and the global optimum as the current position of cuckoo nests and best individual.
Step 3. Select the dimension of evolution. The dimension is selected according to Eqs (9) and (10).
Step 4. Update single dimension of the nests by Lévy flight. The selected dimension is updated by using Lévy flight, which together with the others forms the new nests. The fitness of new nests is calculated according to the evaluation function, where the quality of new nests positions will be measured. If the fitness of the new nest positions is better than the old one, the previous nest can be replaced by the new nest. Step with (20) According to 1/5 principle which is proposed by Rechenberg [30], the adjust rule of factor in strategy is calculated as i j a t t d r g r g r g a a k t t r g r g r g r g r g a a t t i g r g i g r g r g a a x t r x t x r P where is the improvement rate of Eq (11); is the number the current solutions which are better than the previous ones; 1 s is the total number of the individuals which are used to update by the first strategy. The adjust rule of and are similar to , when , ; .
In order to prevent the parameter be overturned, it is noted the upper and lower of k f should be determined before the start of the run. If the dimension exceeds the search space, then it is limited into the boundary value of search space.
Step 6. Determine the end condition. Determine whether the end conditions are met. If the end condition is met, the global optimum value and position of nest are recorded. Otherwise, turn to Step 2.

Inversing approach based on MCS
On the basis of the above section, MCS algorithm is used to reconstruct the defect profile. The flow chart of which is shown in Figure 7. Choose the dimensions that need to be evolved by (9) and (10) Update the selected dimension of each nest by (4) According to the possibility Pa, apply multi-strategy DE to mutation Figure 7. The flow of MCS-based algorithm.
The algorithm is implemented using the following steps in detail.
Step 1. Initialize the nests of the MCS algorithm and set all the parameters, e.g., the number of the nests N, the maximum iteration of max It , the probability a P , and step length scaling factor 1 c . N nests of MCS algorithm represent the predicted profiles as (22) Step 2. Compute the MFL signal of the corresponding nest by the RBFNN, the obtained data from the FEM forward model are used to train the RBFNN, which can be more accurate to approximate the relationship between profile signal and the MFL signal.
Step 3. Calculate the fitness value of each nest according to the given preference profile using the formula as The best nest is selected by the fitness value f.
Step 4. Generate the new nests by MCS algorithm.
Step 5. Determine whether the maximum number of the iterations is met. If max t T  , turn to Step 2.
Otherwise, output the final predicted defect profile.

Performance evaluation
To test the performance of the proposed approach, some defects with different profiles were reconstructed in the experiment. The MFL data was generated from ANSYS 15.0 software. The defects with 360 samples were used to produce the corresponding MFL signals. Among the 360 defects, 240 profiles were rectangular defects, 80 profiles were ladder defects, and the remaining 40 profiles were triangular. The data were divided into two groups. The first group including 340 pairs was used for training by RBFNN and the second group was used to test the reconstruct result of the proposed inversing approach. The dimension number of defect profile was 50, so the number of input and output layers of RBFNN was also 50.
In order to evaluate the error between the true defect profile and reconstruction predicted profile, overall proximate degree PSD could be utilized as an important performance criterion. Besides that, the error PDE between the maximum depth of the true defect profile and the maximum depth of the predicted profile were taken account to estimate the severity of the defect. The PSD and PDE [15] are defined as follows, The accuracy of defect assessment is mainly evaluated by the above two indicators. In practice, the actual MFL signals are often mixed by the normally distributed noise. The noise will affect the evaluated results, so we discussed the performance with the noise which had with an SNR of 20 dB.
All the simulation experiments were implemented on a PC with an Intel Core I7-9700 CPU and a 32 GB memory. For a reliable and fair comparison, all simulation experiments were ordered to execute 50 independent runs. The average results were calculated to demonstrate the performance of the different algorithms.
(I) Parameter setting If there is no defect in the pipe, the depth of defect is defined as 0. In ANSYS model, pipe wall thickness was set to 8 mm. The scope of defect depth was from −8 to 1 mm, which constrained the search space for the solutions. So min 8 X   and m ax 1 X  . In MCS algorithm, 0.8 a P  , 1.5   , and 0.8 F  , respectively. To show the effect of population size on the performance of the algorithm, we selected different population sizes from 50 to 500. Figures 8 and 9 display the simulation experimental results, including the results of the PSD and the PDE. The corresponding simulation experimental data is recorded in Table 1. The profiles and the MFL signal estimated by MCS are shown in Figure 10.      Figures 8 and 9, the results demonstrate that if the number of nests is too small, e.g., 50, the value of PSD and PDE is obviously larger than when N are other values. But when the number of nests was enough to predict the defect profile, e.g., 100, the number of nests had little influence on the change of the value of PSD and PDE.
(II) Performance comparison of different approaches without noise

Reference signal Predicted signal
To demonstrate the performance of the proposed algorithm, the nine defect profiles with different depth and width were adopted to reconstruct, which were randomly selected from the test set and presented in Table 2. The parameters in PSO, DE, CS, CS-PF [6] is given in Table 3. The results, including PSD and PDE, are listed in Table 4.    Table 4 show the reconstruction result of defect profile. It is noted that the best results among the five algorithms are indicated in bold. From Figures 11 and 12 and Table 4, it is obvious that MCS can achieve better result indicators, e.g., PSD and PDE, than the other approaches. PSD of CS-PF method was smaller than that of the other three methods (PSO, DE, CS) in most cases. It is clearly visible that MCS exceeds other algorithms significantly in three types of defect samples.
From the experiment, it could be concluded that the performance of MCS was better than the other four approaches. This results demonstrated that the proposed inversing approach based on MCS was effective and steady.    In the actual environment, noise signals are often included in the collected MFL measurement signals, so the performance of the reconstruction algorithm with noise added should be considered when the defect reconstruction is employed. To verify the performance of MCS about the robustness of the noise, the noise with an SNR of 20 dB was added to the above nine signals. The performances of the five different methods are described in Figures 13 and 14 and Table 5. Figures 15-23 display the reconstruction results of the defect profiles based on MCS. In these figures, the true profile is expressed by the blue line, and the predicted defect profile is represented by the red line.

Reference signal Predicted signal
Since the noise is added into the preference MFL signal, which causes some differences between the reference signal and the real value. Therefore, the accuracy of contour defect inversion will be affected by the noise and increases evaluation difficulty. From Table 5 and Figures 13 and 14, it is seen that the noise influences greatly the accuracy of the measurement. The PSD and PDE of the proposed approach were both higher than that case with no noise. The evaluated error increased due to the existence of the noise for the five algorithms. Among these algorithms, MCS and CS-PF had good robustness to noise. The change in PSD and PDE of PSO and DE, especially PSO, was larger than that of MCS and CS-PF.
Meanwhile, it is generally known that the predicted profiles achieved by MCS are clearly closer to the true profiles than CS-PF according to the average indicator PSD. It can be seen that the reconstructed profile of the proposed method can further improve the performance of CS-PF approach, which is a little better than CS-PF in the nine samples. The PSD and PDE of the proposed algorithm were lower than that of the other approaches. These results demonstrated that the proposed model was effective and efficient to reconstruct the defect profile in the presence of noise.
To further test the influence of the MCS on the accuracy of the inversion, an arbitrary defect was also used to reconstruct the profile. The number of the maximum iteration was 10,000. The predicted profile based on different methods is shown in Figure 24 and Table 6.
It is clearly seen that the accuracy of the predicted profile based on MCS is better than that of other four methods according to the PSD and PDE in Table 6. From Figure 24, it is also obvious that the predicted signal of MCS matches the reference signals accurately. Therefore, MCS algorithm is helpful for improving the profile reconstruction accuracy.
In addition, the experimental case was performed for testing the effectiveness of the MCS approach. The defect reconstruction based on MCS was applied to estimate real defect profile. As can be seen from the Figure 25, the MFL detector includes the three independent parts: the magnetic section, the record section and the battery section. The magnetic section was mainly used for detection. The record section was to save the data during the detection process. The main purpose of the battery section was to provide the required electric energy. The defect profile with known size was used to test the availability of the proposed algorithm. The results of the defect profile are plotted in Figure 26, the indicators of PSD and PDE are listed in Table 7. From Table 7, it can be seen that the method based on MCS is an effective method to construct the defect profile of the pipeline in the experimental case. The performance of MCS algorithm was superior to CS algorithm.

Conclusions
In this paper, we have proposed a novel defect profile reconstruction approach based on MCS. In the proposed approach, firstly, the MFL signal is employed as a key reference to estimate the quality of the predicted defect profiles in inversing process. Specifically, only the one-dimensional information with the largest error between the predicted signal and the reference signal is updated to reduce the interference caused by other dimension information. Secondly, to improve the diversity of the CS algorithm, multi-strategy DE optimization method is introduced to enrich the nest solution in rebuilt new nest process. Moreover, to optimize the structure of solution space, adaptive and dynamic settings of proportion parameter according to cost function or fitness function are discussed. The proposed MCS algorithm is tested by MFL experiment. In order to prove the ability of the reconstruction in noise circumstance, the proposed approach can reconstruct the defect profile by adding noise in preference MFL signal. The experiment results indicate that MCS can achieve higher accuracy. To reconstruct 3D defect profiles will be our future work with intelligent optimization methods.