A New Pattern Recognition Technique in Non Destructive Testing by the Use of Linear Discriminate Analysis

One of the most challenging scientific industrial courses in recent years is intelligent defect detection. Non Destructive Testing (NDT) techniques are the most useful methods due to their efficiency and low cost. Models were developed to determine surface-breaking defects along the applied field when using the magnetic flux leakage (MFL) non-destructive technique. The theoretical model fits the experimental MFL results from simulated defects. For MFL sensors, the normal magnetic leakage field is subsequently used for evaluation of defects. Permeability variations were neglected by employing a flux density close to sample saturation. Three different defect geometries were experimentally investigated and the validity of the analytical model was verified. Different Feature extractor functions are applied in this paper to yield fast decision and more accurate. Indeed more accuracy is because of decision on different features that yields by employing two kinds of feature extractors, PCA and DCT. By hiring a BELBIC (Brain Emotional Learning Based Intelligent Controller) controller on the extracted features, the results are more accurate in some cases. Linear Discriminate Analysis (LDA) is another helpful instrument that is employed precise decision. All feature extractions LDAs and Multilayer perceptron (MLP), are methods for identifying erosion defects are described and employed in this paper. Great accuracy rate in compare between results of related approaches suggests that this Method can be used as an algorithm of MFL data interpretation technique.


Introduction
The pipeline transportation is one of the fundamental modes in petroleum and natural pipeline transportation.It is necessary for pipeline's security evaluation and maintenance to detect the pipeline regularly using pipeline detector and obtain the precise information of the defect (A.Bergamini, 2001) ( A. Bergamini, 2002).Among various pipeline inspection technologies, MFL inspection is the most widespread and perfect one.Applying MFL inspection technology, the defect recognition is mainly completed by man at present.Indeed it needs long time for man to analyze a long pipeline data (M.Afzal and S. Upda, 2002).So finding the intellective technology to recognize pipeline defect quantitatively is urgent.This is not only a time consuming and tiring task; moreover, the result depends on human elements of uncertainty.So for this reason we applied a mathematical relation between the magnetic field applied on the surface and the defect properties.In this way an approach is to find many exactly samples from a defect which is sorted in the surface by its various radial and depth.In this paper, the pipeline MFL image is recognized in an artificial algorithm that is trained BP neural network (P.Ramuhalli, L. Udpa and S.S. Udpa, 2002).also In this work, an approach for the automatic detection of a defect is presented, where the NDE data are preprocessed using an analytical model of the magnetic flux and the extracted information is passed on to a panel of neural networks.Also this peper mentions employment of LDA in the application of defect detection.

Database of defects from MFL testing
The database of the experimental MFL signals that is employed in this project, is from Applied Magnetics group (AMG) in The department of physics from Queens in Canada.This database concludes signals of MFL that measured from Outside and Inside of a pipeline.Details of this database will lead to both un annealed and annealed data plots of increasing dent depths from 3mm to 7mm, resulting in a total of 10 plots for each one.For an instance Figure 1 illustrates a measurement from an annealed and not annealed MFL measurement from inside and out side of a pipeline.

Formulation of an analytical model from MFL defect measurements
If a material is magnetized near saturation, the MFL field generated by a subsurface flaw can be described as follows: (1) Where m is the dipole moment per unit length this is measured as follows (2) Where h bar is the plank coefficient, Ha is the applied magnetic field that is 1 Tesla (C Mandache, B Shiari and L Clapham, 2005) and a is the radius of the defect (D.E.Bray, 1997)(R.Christen, A. Bergamini and M. Motavalli, 2004).If the MFL on the surface of a sample is calculated, the variable y is constant and is equal to the depth h of the defect (see fig. 2).So the magnitude of h could specify the depth of defect.As mentioned above, it is not necessary to get physical information, like size or position of the defect.If the unknown system and material properties are defined in p=2h(m-2H a a 2 ) and q=h 2 parameters we obtain so the following simple fit function for the MFL on the surface of a sample could be illustrated as below: (3) In the developed device the signal is measured by induction coils and for this reasons the measured signal is the derivative in x direction times the velocity of f(x) of measuring device.With regards to the previous equation, the MFL signal becomes as below.In this relation we try to calculate the rate of measured signal in time.So with acknowledge of velocity, that is rate of measuring device distance in time, and by timing this term to deviation of f(x), we could reach to rate of delta f to delta t that is rate of depth in time.
(4) On the assumption that the velocity is constant, a new parameter P can be defined as: (5)  Where is the covariance matrix, V is the eigenvector matrix of and λ is the corresponding diagonal matrix of Eigen values.As the PCA has the property of packing the greatest energy into the least number of principal components, eigenvectors corresponding to the m largest Eigen values in the PCA are selected to form a lower-dimensional subspace.It is proven that the residual reconstruction error generated by discarding the N r -m components is low even for small m (Duda, R.O. and Hart, P.E., 1973).
As has been said, PCA computes the basis of a space which is represented by its training vectors.The basis vectors computed by PCA are in the direction of the largest variance of the training vectors.These basis vectors are computed by solution of an Eigen problem, and as such the basis vectors are eigenvectors.These eigenvectors are defined in the signal space.They can be viewed as signals and indeed look like its inherent shape.Hence they are usually referred to as Eigens.
A discrete cosine transform (DCT) is a Fourier-related transform similar to the discrete Fourier transform (DFT), but using only real numbers.DCTs are equivalent to DFTs of roughly twice the length, operating on real data with even symmetry (since the Fourier transform of a real and even function is real and even.The DCT, is often used in signal and signal processing, especially for lossy data compression, because it has a strong "energy compaction" property: most of the signal information tends to be concentrated in a few low-frequency components of the DCT (Ken cabeen, peter gent).This function is mathematically explained below: (8) For our reason this function is employed because if its strong behaviour on collecting the important information in low frequencies at the top left of the DCT matrix.The squared low dimensional matrixes could lead to best and rapid decisions in some cases this later could lead to the accuracy rate of 100% in some cases.

Recognition of defects
The recognition of pipeline corrosion defects in this paper includes preprocessing and classification analysis.The former can be accomplished by recognizing and classifying typical features of signals from magnetic flux signals in types of real signals or mathematical forms.An approach is to classifying and performs a true decision.For this reason, these are some different kinds of neural networks such as Multilayer Perceptron (MLP), Learning Vector Quantization (LVQ) (Martin Golz, David Sommer, 2006), Self Organized Machine (SOM) (Hiroshi Wakuya, Hiroyuki Harada, Katsunori Shida, 2007) and so on.In this work multilayer perceptrons are applied with BP structure.

Classification for recognition
According to construction of combiners, they are all made of learning process.Therefore to have different combiners different ways of training is essential.The process of learning is based on many ways such as: different ways to show inputs, samples for learning, training process, differ consulting technologies although in this task many theories are offered but each of them should due to some results: 1) The first requirement is that each expert has high level of performance and independently in deciding feature 2) Expert has an arithmetic mathematics table to refer this point as strong point of each expert.
Classifying is done by many ways such as: multilayer perceptron, (MLP), radial basis function (RBF), k-mean etc.This paper presents MLP for classifying.MLP means multi layer perceptron.Classifying is done by neural networks such as MLP.Fundamental work of MLP is to changing weights between layers and each layer has (m) nodes.Number of input nodes is depended on dimension the database.Amount of nods located in hidden layer are subject to change by complicated rate of the expert.In this paper an approach is shown in follows that specifies the number of each layer this equations for this reason is earned exrimentally but the result of this employment is satisfied.In training situation the weights are subject to change until reaching the best weights .The number of training situations is determined by the number of epochs it is kept done until less mistakes appears in out put.
In this algorithm three Networks with the names of +1 0 -1 are employed.All of these three experts are learned by a same set of database and the result of classification is achieved by voting the triple output.

Brain Emotional Learning Based Intelligent Controller (BELBIC)
BELBIC is a computational model of learning system of human's brain.Amygdala and Orbitofrontal cortex play the most important roles in this learning method.The structure of BELBIC is shown in Fig. 3 In the Thalamus part of this model, some simple pre-processing on sensory input signals such as noise reduction on filtering can be done.Sensory cortex's inputs are come from thalamus part.Sensory cortex should subdivide and discriminate the coarse input from thalamus.The next step is Orbitofrontal cortex.This part's task is to inhibit inappropriate response from Amygdala based on the context given by the hippocampus.Amygdala is responsible for the emotional evaluation of stimuli.
BELBIC receives sensory input signals via thalamus.After preprocessing in sensory input, the input signal will be sent to Amygdala and sensory cortex.These parts compute their output based on emotional signal received from environment.Ultimate output is calculated by subtracting Amygdala's output from orbitofrontal cortex's output.
The Thalamic connection is calculated as the maximum overall Sensory Input S and becomes another input to Amygdala as described in Eq. ( 9).Unlike other inputs to Amygdala, the thalamic input is not projected into the orbitofrontal part and cannot be inhibited by itself (9) For each A node in Amygdala, there is a plastic connection weight V. Any input is multiplied by this weight to provide the output of the node.The O nodes behave analogously, with a connection weight W applied to the input signal to create an output.The connection weights are adjusted proportionally to the difference between the emotional stress and activation of the A nodes.The α term is a constant that is used to adjust the learning speed.In order to modify the update rule the sensory signal value is multiplied inside max operator (10) In formula (10) Amygdala learning rule is presented.This is an instance of a simple associative learning system.The real difference between this system and similar associative learning system is the fact that this weight-adjusting rule is monotonic, i.e., the weights V cannot decrease.At first glance, this may seem like a fairly substantial drawback; however, there are good reasons for this design choice.Once an emotional reaction has been learned, this should be permanent.The orbitofrontal part inhibits this reaction when it is inappropriate.
The reinforcement signal for the O nodes is calculated as the difference between the previous output E and the reinforcing signal stress.In other words, the O nodes compare the expected and received reinforcement signals; therefore, inhibiting the output of the model should be a mismatch.In (11), the learning rule in the orbitofrontal cortex is presented (11) The orbitofrontal learning rule is very similar to the Amygdala rule.The only difference is that the orbitofrontal connection weight can either increase or decrease as needed to track the required inhibition.Parameter b is another learning rate constant.The A nodes produce their outputs proportionally to their contribution in predicting the reward or stress signal stress, while the O nodes inhibit the output of E when necessary  A typical LDA implementation is carried out via scatter matrices analysis (Saeedreza Ehteram, Ali Sadr, 2007).We compute the within and between-class scatter matrices as follows

Employed algorithm
We have applied similar algorithm to SSCE (Saeedreza Ehteram, Seyed Z. Moussavi, 2007) to database of MFL signals.
In this map we apply preprocessing to the crude data this section is discussed and as a brief it contains extracting different kinds of defects from physical formulation and normalization then three classes perform a decision on the their inputs, the rate of each of which is composed by a voter to achieve a well decision.See fig. 4.

Results and discussion
Above a robust algorithm is defined, an important point of it is employing Linear discriminate analysis (LDA) in a same algorithm with a twin well-known statistical feature extraction functions.In order to investigate the statistical distribution of the error rate, three neural networks with the same structure and transfer functions (but with different number of neurons that are referred to initial state) were trained with the not same data set (Saeedreza Ehteram, Ali Sadr, Seyed zeinolabedin Mousavi, 2007)( R. Ebrahimpour, S. R. Ehteram, E. Kabir, 2005)( R. Ebrahimpour, Seyed Zeinolabedin Moussavi, and Saeedreza. Ehteram, 2006).In this approach each expert is trained to recognize o sort of defect so that each of which experts in final are tried to find three common sort of defects.Then the accuracy rate of each network is calculated.To calculate different numbers of input parameters were trained and compared to the network described in the above sections.The following experiential rule was used to define the structure of the network: (16 Where N is the number of neurons in the corresponding layer and P is the number of input parameters that could be even or odd.In this project first we try to test a simple network by different characteristics and then we design three experts.In some information about the set of trained networks is given by accuracy rate as well as the worst and the best network, respectively.Furthermore, maximum or minimum of the average of output of each network in ten times training is mentioned.Summary of the network performance for different input parameters is as follows: P1, p2, q1, q2, q3 As is demonstrated in the table below there is q1, q2, q3, P1, P2 parameters.These parameters are described as follows in ( 17): So by training classes with these triple clusters of data, class one could discriminate features of depth, better than radius and momentum.

Historical discussion
To date, all published research based on the analytical model of dipolar magnetic charge, (Dobmann G and H¨oller P, 1980) ( Shcherbinin V E and Pashagin A I, 1972) ( F¨orster F, 1986)( Edwards C and Palmer S B, 1986)( Mandal K and Atherton D L, 1998), this later is discussed before and defined as m parameter.But for an exception, reference (Uetake I and Saito T, 1997) is presented.This reference is just discussed a single defect., The often encountered practical situation of two adjacent defects is also discussed only by Uetake and Saito(Uetake I and Saito T, 1997), but their study is limited to slots with parallel walls, of a maximum of 4mm in length.In this study we consider a multiple defect case.Jayakumar T and Raj B, 2000).Two of the numerical analysis studies (LordWand Hwang J H, 1997) ( Altschuler E and Pignotti A, 1995) correctly predicted that the amplitude of the normal MFL signal Component increases with defect depth, and that the separation between the extreme MFL values is directly proportional to the Defect length.In this paper, with regards to previous works, a new simple algorithm is applied that could exactly determine defects with various shapes.For problem of encountering different kinds of defects we initializes deferent defects with three classes which each of them tries to learn a defect with determined characteristics.These features are an estimate of three large groups of defects.

Conclusion
In this study, we have discussed intelligent defect recognition directly from MFL signals.An analytical model is employed to account defects in order to correlate the normal component MFL profile with the defect dimension along the Impregnating magnetic field.The efficiency of the model was confirmed through experimental results in MFL defect detection.A clear advantage of the method presented here is the low number of parameters that have to be considered.For a satisfactory estimation we classify all the defects in three groups with different shapes in this case all the defects ranged to depth of 2 till 4 millimeter and radius of 1 up to 1.5 millimeters.These later are subject to recognize.For this reason three expert systems were learned to recognize the request.Employing BELBIC controller helped us to calculate more accurate results.Also this algorithm is equipped with linear discriminate analysis (LDA) the result of all are shown and discussed well in table 1.And at the end of our processing scheme voter starts to vote between the results of three experts.The accuracy rate of 100 percent shows the efficiency of the mentioned devised algorithm.
Table 1.Three Networks performance by different parameters

4.
Feature extraction for recognition PCA is a well-known statistical technique for feature extraction.Each M × N MFL signal in the training set was row concatenated to form MN×1 vector x k .Given a set of training signals {x k }, k=0, 1,…, N T the mean vector of the training set was obtained as (M.Turk, A. Pentland, 1991).
×MN training set matrix X={x k -} can now be built.The basis vectors are obtained by solving the Eigen value problem: 12) presents the model output expression (M.R. Jamali , A. Arami, M. Dehyadegari, C. Lucas, Z. Navabi, 2008).

4. 4
Linear Discriminate analysis (LDA) Linear discriminant analysis (LDA) is a popular holistic feature extraction technique for object recognition.LDA determines a set of projection vectors maximizing the between-class scatter matrix S b and minimizing the within-class scatter matrix S w in the projection feature space.A 2D object signal is viewed as a vector of n dimension.The training set contains M samples belonging to L individual classes .Unlike PCA that extracts features to best represent object signals, LDA aims to construct the subspace which best discriminates different object classes.Therefore, LDA is more suitable for the classification problem than PCA.
the Within-class Scatter Matrix showing the average scatter of the sample vectors x of different class Ci around their respective mean M: (14) Similarly S b is the Between-class Scatter Matrix, representing the scatter of the conditional mean vectors mi's around the overall mean vector m (15)The distance measure used in the matching could be a simple Euclidean, or a weighted Euclidean distance.It has been suggested that the weighted Euclidean distance will give better classification than the simple Euclidean distance (S.Chandrasekaran, B.S. Manjunath, Y.F.Wang, J. Winkeler, and H.Zhang, 1997), where the weights are the normalized versions of the eigenvalues.But it turns out that this weighted measure is sensitive to whether the corresponding persons have been seen during the training stage or not.To account for this, we devised a simple scheme to detect whether the person in the testing signal has been trained or not and then use either a weighted Euclidean distance or a simple Euclidean distance respectively.

Figure 1 .
Figure 1. after anneal(left) and before anneal (right) from outside of a 3 mm pipeline (Lord W, Bridges J M, Yen W and Palanisamy R, 1978))this algorithm could satisfy almost all of defects.With increase in computational capabilities, finite element analysis can now compete with analytical methods.Since the proceeding numerical modeling of MFL phenomena is exposed by Lord and co-workers(Hwang J H and Lord W,  1975)(LordWand Hwang J H, 1977)( Lord W, Bridges J M, Yen W and Palanisamy R, 1978), the finite element analysis of defect-induced magnetic signals has become increasingly popular.In oppose of the significant progress made in this area to include non-linear material properties(Atherton D L and Daly M G, 1987)( Patel U and Rodger D, 1995)( Altschuler E and Pignotti A, 1995), a quantitative relationship between magnetic leakage field and defect length has not been clearly specified.Furthermore, numerical modeling involves a direct MFL approach, since it includes predefined defect geometries and material characteristics.Calibration of the MFL signals in terms of defect depth has been studied both through finite element modeling(LordWand Hwang J H, 1977)( Lord W, Bridges J M, Yen W and Palanisamy R, 1978)(Atherton D L and Daly M G, 1987)( Altschuler E and Pignotti A, 1995)and through analytical methods based on dipolar magnetic charge(Lord W, Bridges J M, Yen W and Palanisamy R, 1978)( Philip J, Rao C B,