289

Computer aided weld defect delineation using statistical parametric active contours in radiographic inspection Aicha Baya Goumeidanea,∗ , Nafaa Nacereddinea,b and Mohammed Khamadjac a Centre

de Recherche en Soudage et Contrôle, Algiers, Algeria Math. et leurs Interactions, Centre Univ. de Mila, Algeria c Sp Lab., Université Constantine 1, Constantine, Algeria b Lab.

Received 26 May 2014 Revised 31 December 2014 Accepted 25 February 2015 Abstract. A perfect knowledge of a defect shape is determinant for the analysis step in automatic radiographic inspection. Image segmentation is carried out on radiographic images and extract defects indications. This paper deals with weld defect delineation in radiographic images. The proposed method is based on a new statistics-based explicit active contour. An association of local and global modeling of the image pixels intensities is used to push the model to the desired boundaries. Furthermore, other strategies are proposed to accelerate its evolution and make the convergence speed depending only on the defect size as selecting a band around the active contour curve. The experimental results are very promising, since experiments on synthetic and radiographic images show the ability of the proposed model to extract a piece-wise homogenous object from very inhomogeneous background, even in a bad quality image. Keywords: Welded joint, radiographic inspection, active contours, local statistics-based model, band region selection

1. Introduction Welding is a process of utmost importance in the metal industry. The quality of a welded joint determines whether the weld is suitable for subsequent manufacturing processes, or if the joint must be re-welded. Weld quality assessment is a complex task because of the great number of variables involved, such as the mechanics of the welding process, the chemical composition of the pieces to be welded, and oxides and inclusions dragged into the welding zone [1]. Flaws that may result from welding process are determining for the following operations. For this purpose, the quality control of the weldments must be carried out on the basis of the established standards, to ensure the integrity of the piece. NonDestructive Testing (NDT) is examination techniques of materials and assemblies using methods that do not alter their structure in any way, permitting further utilization [2]. Radiography is recognized to be ∗ Corresponding author: Aicha Baya Goumeidane, Centre de Recherche en Soudage et Contrôle, Algiers 16002, Algeria. E-mail: [email protected].

c 2015 – IOS Press and the authors. All rights reserved 0895-3996/15/$35.00

290

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

one of the oldest and still effective tools in NDT [3]. Therefore, the radiographic weld joint interpretation is a complex problem requiring expert knowledge. Although weld joint film analysis is done by qualified inspectors, unfortunately it is a time consuming operation and results could be subjective and biased. Consequently, many efforts have been done to automate the inspection process or, if needed, to provide a computer-aided diagnostic to the interpreters to get more objective interpretations for the radiographs. This has been done by employing image processing and analysis techniques that can give more consistency to the interpretation and then enhance the productivity. Most of the proposed automatic radiographic inspections involve a step of region of interest (ROI) selection. This step prevents the operator to make treatments on the irrelevant regions of the image and, furthermore, it reduces the computing load for real-time applications [4–10]. The ROI selection is followed by an image segmentation step that aims to extract weld defect indications. Finally the defect categorization (quantitative analysis and decision making step) can be performed on the detection stage outcomes. Image segmentation is a key step for automatic radiographic inspection. Its results influence strongly the subsequent tasks. Segmenting the image permits the separation of the flaws from the weld joint and then allows extracting the defects from the radiographic images. With advance of computer science, automatic detection of weld defects in radiographic images using image segmentation techniques has gained importance with an increasing number of papers. To deal with this issue, various techniques have been proposed and used, such as thresholding [4,11], graphs [5], statistical methods [7,12], Artificial Neural Networks [13], mathematical morphology [14], texture analysis [15], fuzzy reasoning [16], etc. In one of the latest efforts dedicated to image processing techniques for NDT, Vijay et al. [17] presented a study, where they made a comparative study of some image segmentation techniques applied to detect flaws in radiographic images. They find that classical techniques are not suitable or are time consuming. Other techniques like watershed method, suffers from drawbacks like sensitivity to noise, poor detection of thin boundaries and poor detection of significant areas with low contrast. To sum up, weld defect radiographic image segmentation remains a difficult task that has been very little addressed, due to both tremendous variability of defect shapes and variation in image quality. In general, such images are characterized by a poor quality and are often corrupted by noise. To overcome these difficulties, segmentation with deformable models or active contours seems to be quite suitable for radiographic images to extract defects because of many reasons. The most important one is the fact that the active contours incorporate global view of edge detection by assessing continuity and curvature combined with the local edge strength [18]. On the other hand, by considering the boundary as a whole, a structure is imposed to the problem. As a result, the broken edges are bridged; the blurred and the weak ones are delineated and the overall defect shape to be extracted is recovered by the mean of one smooth curve located as close as possible to the real boundary. Moreover, such boundary description can be readily used by subsequent applications conversely to the classical edge detection methods that must be followed by edge thinning and linking operations, pending branch removing step and finally contour tracking to obtain similar representations. The deformable models hold, therefore, many promises in the field of weld defect detection in radiographic images. Deformable models, originally introduced by Kass et al. [20], are artificially made curves that are able to expand or contract over time under the influence of internal and external forces. The internal forces keep the model smooth and continuous, while external ones are defined through the image information to push the model. From the model representation point of view, active contours can be categorized into two groups: parametric active contours (also called snakes), where the curve model is represented explicitly by the mean of an ordered collection of discrete points named snaxels (snake pixels) or nodes, and geometric active contours proposed by Osher and Sethian [21], who provide an implicit formulation

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

291

of the active contour in a level set framework. Geometric approaches offer great flexibility as far as the curve’s topological changes are handled [22]. However, they tend to be computationally more complex, since they evolve a surface rather than a curve [23–26]. Indeed, in spite of an elegant solution, it is well known that geometric approaches increase the computational load and consequently they cannot be used in all contexts [27]. Moreover, the expression of the explicit form is easy to implement and is more appropriate for extracting an object. In fact, explicit active contours give directly an ordered point’s chain describing only the considered object. The obtained configuration can be applied to the analysis stage without any other transformation. The authors in [28] denote that the computational complexity of parametric active contour models is lower than the geometric ones. Unfortunately, these models cannot face topological changes without ad hoc solutions [29]. From the used image information point of view, active contours can be also categorized into edge-based approaches and region-based ones. The edge-based approaches are called so because the information used to draw the curves to the edges is strictly along the boundary. Hence, a strong edge must be detected in order to drive the snake. This obviously causes poor performance of the snake in weak gradient fields. That is, these approaches fail in the presence of noise. The region-based approaches, used at first by Cohen et al. [30] and Ronfard [31], are interested by both regions delimited by the contour. Thus, to guide the curve progression, the pixels characteristics of the inner and the outer region defined by this contour are considered. However, one can note that such methods are computationally intensive since the computations are made over a region [32]. Other classifications of active contours models can be found in the literature as shape-based models, combination of region + edge-based models, etc. [33]. Active contour have been very little studied in the scope of weld defect detection in X -ray or gamma-ray images. When using edge-based models, the pre-processing step became unavoidable. However, the variability of radiographic images quality makes unsupervised preprocessing not recommended. Indeed, if a preprocessing method gives good results on bad contrast images it may not give good results on images suffering of, for example, non-uniform illumination. So, applying the same preprocessing to all kinds of images may lead to unusable results. There is, therefore, a need for human intervention to determine the adequate preprocessing or at least to tune parameters to adapt the preprocessing to the image. For this reason, we find that although edge-based active contours progression is quicker than region-based ones, but the need of obvious human interaction in the processing, make them less attractive in the scope of automatic inspection; and hence, here the main advantage of exploiting the region-based models. Some attempts have been made to detect defects with region-based active contours where background and defect were considered as homogeneous regions [34–36]. However, this is rarely the case because of the nature of industrial radiographic images, with, among other characteristics, high luminance variability particularly for the background. The inhomogeneous characteristic of the weld joint radiogram must be taken into consideration to obtain an extraction method that suits to all weld joint radiographic images. Moreover, if the method frees the operator to select the ROI, this can result of a human intervention limitation which leads to an automatic inspection less subjected to supervision. The present paper proposes a new approach to extract weld defects from radiographic images. A preliminary study of the proposed method has already been published in [19]. The method is based on an explicit Bayesian active contour which uses pixels gray-values statistics to drive the model to the desired boundaries. Local statistics are used for the radiographic varying background since they are more suitable for inhomogeneity while global ones are kept for modeling the defect. The strategies proposed to improve its progression are also presented and developed. In Section 2, we develop the proposed technique. Section 3 gives the implemented algorithms. Section 4 is devoted to simulation results and discussion. Conclusion and future improvements are presented in Section 5.

292

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

2. Global and local modeling association for statistical active contour In this section, we detail the different steps and techniques that permit to develop an efficient algorithm for defect extraction from the whole radiogram. The first idea of the proposed method consists in the utilization of an explicit Bayesian active contour that was already used in the scope of weld defect detection. Afterward, this idea is extended to use local statistics to handle the inhomogeneous background that often characterizes the radiograms. Local statistics computation being intensive, it will be interesting to limit the computation inside a band surrounding the active contour model. The band computation is detailed in the last part of the section. 2.1. Bayesian active contour Statistical approaches for image segmentation have a long tradition. The probabilistic formulation of the segmentation problem presented in the following extends the statistical approach presented in [37]. This approach has examined the segmentation problem under the Baye’s rule and was exploited in many works [34–36,38]. Under the Bayesian framework, given the vectors c and Z the contour description and the image pixels gray-values respectively, the a posteriori probability density function (pdf ) p(c/Z) is given by p(c|Z) = p(c) × p(Z|c)/p(Z)

(1)

where p(c) is the a priori contour pdf, p(Z/c) the conditional pdf of the pixels gray values given the contour and p(Z) defines the pdf of the images pixels gray levels. Maximizing p(c|Z ) leads to the maximization of p(Z/c) with respect to c since the Maximum a posteriori estimation is reduced to a Maximum likelihood one as reported in [37]. Thus, the best estimate of the region contour is obtained by cˆM L = arg max p(Z/c)

(2)

c

If N is the number of the image pixels and zx ∈ Z (1 x N ) is the gray-value of the image pixel x, under the assumption of conditional independence, i.e. given a region, all the region pixels gray values are independent, we can write p(Z/c) = p(zx ) × p(zx ) (3) x∈R1

x∈R2

where R1 is the region inside c and R2 is all the pixels that do not belong to R1 . Hence log p(Z/c) = log p(zx )+ log p(zx ) x∈R1

(4)

x∈R2

To apply this contours technique one should have a good modeling of the pixels gray-values pdf. To do that, various approaches exist. Most of them are spatially homogenous regions methods and assume a global pdf for each region. If global modeling is assumed, another hypothesis is added to the conditional independence one: region homogeneity, i.e., all the pixels in the inner (outer) region of c have identical

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

293

distributions characterized by the same distribution parameters φi . p(zx , φ1 ) and p(zx , φ2 ) stand for the pixel-wise conditional probabilities, of the inner and outer regions, respectively. So cˆML = arg max p(Z/c, φi ) (i = 1, 2)

(5)

c

And log p(Z/c, φz ) =

log p(zx /φ1 )+

x∈R1

log p(zx /φ2 )

(6)

x∈R2

In our work, the Gaussian distribution is retained to model the pixels gray values as the radiographic images are well described by this one [36]. 2.2. Local modeling Usually, the assumption done for spatially homogeneous regions are quite appropriate, however it is inappropriate for some kinds of images [39]. In spatially homogenous regions methods, intensity variations inside a region are ignored and then, they cannot deal with the intensity inhomogeneities which are almost unavoidable especially for industrial radiographic images. Nevertheless, to deal with region inhomogeneity, one has to take into consideration gray level values variations that can occur inside each region, by considering that each pixel gray value will have its own pdf depending on its position in the region. We consider, in this work the locally homogeneous modeling with local Gaussian distributions. That is why, the Gaussian parameters, which are spatially varying, are computed locally. As proposed by [40,41], let w be the window in which the local pdf s computations are done. Thus, for the pixel x, the associated pdf is computed as follow 1 (μw − zx )2 (7) pw (zx ) = √ exp − 2 2σw 2πσw where μw and σw are the local intensity mean and standard deviation respectively, computed over the window w centered at the pixel s. To the window w is associated a weighting function ws,d which depends on the distance, noted dist(s, x), between the current pixel x and the window’s center s, and subjected to the following constraints ⎧ ⎨ ws,d (x) = 1 (8) x∈w ⎩ if dist (s, x) > d, ws,d (x) = 0, d is a fixed distance related to the window size. Furthermore, it is recommended to choose a weighting function that gives bigger weights for the closer pixels to the window center s. These local parameters are computed as follows [42] ws,d (x)zx ws,d (x) × (zx − μw )2 x∈w

μw = x∈w

ws,d (x)

2 σw =

x∈w

x∈w

ws,d (x)

(9)

294

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

By introducing the above weighting function, the expression of the window-based log likelihood function for the entire image I(I = R1 ∪ R2 ), denoted by LZ|c is given by

LZ/c =

⎡ ⎣

s∈I

ws,d (x) log pw (zx , μw , σw )+

x∈w/(s,x∈R1 )

⎤ ws,d (x) log pw (zx , μw , σw )⎦

x∈w/(s,x∈R2 )

(10) It should be noticed, that the weighting function ws,d plays a key role in such local statistics segmentation model. In fact, it cannot be too large, leading to prohibitive time cost and inaccuracy, neither be too small, causing sensitivity to noise and evolution instability [43] and should be properly chosen. We have chosen a circular window with a truncated Gaussian kernel as a weighting function [41], then

1 |dist(s, x)|2 if dist (s, x) d ws,d (x) = exp − (11) a 2σd2 otherwise ws,d (x) = 0 where a is a scalar and σd the standard deviation of the Gaussian kernel which can be seen as a scale parameter and should be chosen carefully [40] (must not exceed (1/2)d). Nevertheless, local regionbased segmentation models are found to be more sensitive to noise than global ones. Such models may also be more sensitive to initialization if the local scale is not appropriate [44]. It is well known that the radiographic images are characterized by inhomogeneous background and piece-wise homogeneous region objects (defects). Then, in order to extract defects from these images, we have used local modeling for the non-uniform radiographic background, while global modeling is applied to the defect region. If μ and σ are the normal distribution parameters of the defect region (R1 ), then the new formulation of LZ|c adapted for this case is LNew Z/c =

log p(zx , μ, σ) +

s∈R1

ws,d (x) log pw (zx , μw , σw )

(12)

s∈R2 x∈w/(x∈R2 )

The first part of the equation is then no more concerned with the windowing operation then the first summation over the whole image is reduced to a summation over the region R2 . The contour will be estimated by cˆ = arg max LNew Z/c c

(13)

We expect that this second formulation will not only reduce the undesirable effect of local modeling, as mentioned above, but also it will reduce the computation cost of the overall maximization formulation of local distribution estimation. Nevertheless, formulation of Eq. (12) implies computing local statistics for all the pixels that are outside the model which remains intensive. To reduce once again the computation load, on the background (R2 ), we propose that the processing will be done only on a band defined around the model c as illustrated by Fig. 1. The local statistics computation will be done only in this band. Then, one of the most important issues in our work is how to compute quickly this band, in which the intensive computation will be held.

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 1. The various image regions involved in the statistics computation.

Fig. 2. c(t) is the curve; n(t0 ), T(t0 ) and κ(t0 ) are, respectively, the normal vector, the tangent vector and the curvature at the curve point c(t0 ).

295

Fig. 3. Exterior offset to the curve c.

2.3. Band region selection One can have, first, in mind that a simple parallel curve will resolve the problem of this band computation, but the solution was not readily usable. Indeed, a simple parallel curve computation will contain cusps and self-intersections. However, if the option of using the parallel curve is chosen then, operations of self-intersection detection and invalid loops removal became inviolable, which are non-trivial [45] and time consuming tasks. Many others methods are used to compute such band which can be assimilated to an offset curve, but this operation is quite complex and may need additional prohibitive computation time. As the model offsetting operation will be done in each iteration, we need a very quick offsetting. The solution we have chosen is to approximate, even in a coarse way, the offset by avoiding situations where cusps could occur. Moreover, after offset computation, loops are clipped by inspecting the offset result without computing self-intersections. 2.3.1. Discrete geometry We assume that the normal vectors n(t) of the planar polygon c(t) (the model) are pointing to the left of the curve advancing direction (clock-wise sense) as illustrated in Fig. 2. So, the directions of positive and negative vectors are the interior and the exterior of the model, respectively. The offset curve cpd , also called parallel curve, is defined as locus of the points with a constant distance D in the normal direction from the progenitor curve c(t). cpd is given by [46] cpd (t) = c(t) ± D × n(t)

(14)

In the case of Fig. 3, the offset is an exterior one, so cpd(t) = c(t) − D × n(t) with D taken equal to 5. The shape of the offset depends not only on the progenitor, but also on the offset distance D as well as the local curvature [46]. Degeneracies may occur in some cases. For an exterior offset, degeneracies problems arise for the concave parts of the progenitor curve; this is where the complexity lies. Indeed, singularities (cusps) and self-intersecting appear when the radius of local curvatures are smaller compared to the offset distance D and when the spaces separating parts of the polygonal curve are too small compared to D [46]. Normal vectors and curvature computing for discrete curves: We define the normal direction in the vertex ci of the polygon c as the bisector direction of the angle ∠ci−1 ci ci+1 , as shown in Fig. 4. At this end, we have to compute the orthogonal line of the segment [p1 p2 ] passing through the point ci ,

296

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 4. (a) The three considered vertices involved in the normal vector ni computation, (b) the points p1 and p2 designation, and here p2 = ci+ 1 and p1 is computed.

Fig. 5. Discrete curvature computation.

where p1 and p2 are two points chosen on the line segments [ci−1 ci ] and [ci ci+1 ] respectively such as ci p1 = ci p2 The unit normal vector is obtained after normalizing the outcome with p1 p2 . Thus, such normal vectors computation is independent of the discrete curve segment length. As regards to the curvatures, when curvature calculus is applied on discrete curves, the concept of discrete curvature should be considered [47]. For simplicity and convenience, we have chosen a quick and a good anglebased estimation way. In addition, it is coherent with the normal vectors computation approach chosen in the scope of this work. A discrete approximation of the curvature related to the two vectors Ui+1 (xi+1 − xi , yi+1 − yi ) and Ui (xi − xi−1 , yi − yi−1 ) is given by [48] i+1 U Ui κ = − (15) i+1 i U U This curvatures measure depends only on the angle θ , thanks to the vectors normalization operation. The i = U i , then Fig. 5 shows length of the difference is equal to 2 × sin(θ/2) where 0 θ π [48]. If V U i how the discrete curvature is computed. It is equal to l where l = 2 × sin(θ/2). Figure 6 summarizes the direction of the unit normal vectors and the curvatures at each vertex of a discrete curve. 2.3.2. Offsetting the model contour As noticed in Section 2.3, we had in mind the aim of computing the region where the intensive computation of local statistics will be done. So, we began by avoiding the critical situations where degeneracies may occur. First, vertices are added between initial ones, to ensure continuity as shown in the Fig. 7(b). The vertices curvatures are then inspected. Concave vertices with curvatures equal or greater than 1/D are removed. A concave vertex ci is defined as such, if it involves an angle ∠ci−1 ci ci+1 greater than π taken in the anticlockwise sense. The removed vertices may increase adjacent vertices curvatures. If these vertices exhibit curvatures greater than 1/D , they are deleted in turn. Local search and vertex elimination procedure is achieved until no prejudicial curvature remains as shown in Fig. 7(c). The resulting vertices are offseted by a shifting operation in the normal direction outer the initial polygon by

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 6. Normal vectors and curvatures.

297

Fig. 7. (a) Initial curve, (b) Adding vertices, (c) Not allowed curvatures elimination. (Colours are visible in the online version of the article; http://dx.doi.org/ 10.3233/XST-150488)

Fig. 8. (a) The progenitor and its offset without vertices removal, (b) Zoom into the loop, (c) The last offset state in the critical part before the last inspection operation, (d) Final solution. (Colours are visible in the online version of the article; http://dx.doi. org/10.3233/XST-150488)

the distance D . The obtained offset will look like Fig. 8. a with possible loops, if the curve is not convex. In [49] a relationship is established between the progenitor signed curvature κ and its parallel signed one κp (curvatures are positive for convex vertices and negatives for concave ones). Afterward, we designate by κ a signed curvature. For a continuous case this relationship is as follow κp =

κ |1 + κ × D|

(16)

For a discrete case, we have noticed that this relationship is not substantially different. We have, therefore, relied upon Eq. (16) for what follows. Since the remaining concave vertices have curvatures in absolute values less than 1/D then the curvatures radius ri (ri = 1/|κi |) are greater than D . As a result, for negative curvatures, |κp | is greater than |κ| since |1 + κ × D| < 1. Moreover; Eq. (16) implies that κ and κp have the same sign. However, when degeneracy happens (case of presence of loops in the offset), some litigious situation can appear as for example Fig. 8(b) where to some concave vertices in the progenitor, correspond convex ones in the offset. Moreover; some flat vertices in the progenitor are transformed in the offset curve to vertices with pronounced convexity. Such situations are overcome by removing the corresponding vertices in the offset. New possible litigious situations are created and other

298

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Algorithm 1: VerticesRemoval1

Algorithm 2: VerticesRemoval2

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

299

Algorithm 3: Algorithm3

inspections with vertices removal operations are achieved till no critical vertex remains. Figure 8(d) shows the final result. The first step of the pseudo offset computation is achieved by the algorithm named VerticesRemoval1. This algorithm remove concave vertices with curvatures |κi | greater than 1/D in absolute values. The second step is held by a second algorithm named VerticesRemoval2 which proceeds to litigious parallel vertices elimination. It performs on the parallel to the outcome of VerticesRemoval1 named cp . It achieves the deletion of the vertices responsible of the degeneracy by comparing the progenitor signed curvatures κi to the parallel signed ones κpi . Let be (κi , κpi ) the set of the relationships that links a

300

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 9. The new neighborhood: from the eight nearest pixels to the two nearest pixels in the normal directions.

Fig. 10. Maintaining the curve continuity: Segment splitting.

progenitor vertex curvature κi to the curvature of the corresponding vertex κpi in a degeneracy parallel curve part. It takes the Boolean value true, if to a negative κi corresponds a positive κpi or to a zero valued κi corresponds a sharp κpi (positive or negative). This achieves the pseudo offset computation by defining the region where the local statistics calculus will be done. Once the band computed the maximization operation of LNew Z/c to estimate the defect region boundary can. The likelihood maximization operation is held by the mean of the greedy algorithm. 2.3.3. Greedy algorithm The nodes spacing is not guaranteed to be uniform, with our model. So we had to choose a suitable strategy to maximize LNew Z/c . Moreover, it is known that the use of image pixels statistics to drive the model slows its motion down [32]. To gain in execution time, the greedy strategy seems to be the most adequate one, since its use will increase the model evolution speed, as it has been shown in [48]. Furthermore, with the greedy strategy, the nodes are not needed to be evenly spaced. The greedy algorithm evolves the model nodes in an iterative manner by local neighborhood search around these nodes to select new ones which maximize LNew Z/c . Furthermore, this search is preferred to be done only in the orthogonal directions to the contour at the model nodes. This choice is justified by the fact that for the active contour external and internal energies, it can be shown that if the optimal deformation is small, then it needs to be only normal to the template [50]. In this way, the space search compared to the 8-neighbors is reduced from 1 to 1/4 as shown in Fig. 9. This evolution leads the model to the boundary through iterative refinement of the model. 2.3.4. Nodes regularization operation The model nodes number increases gradually with the snake evolution iterations through a split and merge-based process, implemented to adapt the nodes number to the curve progression and to allow an accurate description of the defect. The creation of new nodes (splitting segments line) permits to the contour to keep a sufficient sampling when it dilates and hence its continuity is preserved as shown in Fig. 10. Conversely, merging of nodes has as a role to prevent two successive control points to be very close to each other, which would be likely to cause contour breaking or self-intersections (loops), as illustrated in Fig. 11(a). Moreover, to prevent undesired behavior of the contour, certain configurations are avoided, by merging segments as illustrated in Fig. 11(b). This can be assimilated to a regularization process to maintain curve continuity and prevent overshooting. The criterion to adapt the nodes number and then maintain the continuity is related to a segment length value la . If a segment length exceeds the product of this value and a certain split threshold δs (> 1), i.e. ds = δs × la the segment is subdivided by adding a new node in the middle of the segment, as illustrated in Fig. 10. Conversely, if the segment length is inferior to dm , where dm = δm × la with δm (< 1) as merging threshold, the two nodes that describe the segments are merged and then replaced by one node in the middle of this segment.

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

301

Fig. 11. Model regularization: Solutions in anticipation to avoid overshooting by (a) nodes merging, (b) segments merging.

3. Implementation We give in Algorithm 3. the general model evolution algorithm. We call: Sin-s the set of pixels sin belonging to the window w centered at s and sin ∈ / R1 and zsin the gray value of sin . Practical considerations for implementation: In our model, it has to be noted that the stable nodes are no more treated. Nodes are considered stable if they are motionless over a number of consecutive iterations and their position is considered as final and unchanged. Only the other nodes are treated. This permits to gain in computation time, by avoiding unnecessary processing. 4. Experiments In this section, we provide experimentations and the behavior analysis of the proposed active contour method. The method is tested on a set on synthetic and radiographic images. Experiments on synthetic images assess the ability of the proposed model to extract a piece-wise homogenous object from a very inhomogeneous background, even in a bad quality image. Those performed on radiographic images evaluate the efficiency of the model evolution in an inhomogeneous background and without selection of region of interest. First, we start this section by validating the pseudo offset computation proposed, on two non-convex closed polygonal curves illustrated in Fig. 12 and named c. To this purpose, five different offset distances D are used (2, 4, 6, 8, 10). The outcomes are shown in the same figure without degeneracies or loops. The algorithm we have developed to select a region outside the model seems to give the needed result by drawing properly and quickly the desired curve although in presence of shapes with pronounced sharpening concavities and/or convexities as is the case of c in Fig. 12. 4.1. Algorithm validation on synthetic images We need to analyze the behavior of the model on synthetic images. Using synthetic images permits to assess the extraction performance of the model even in a very bad quality images. At first, we test

302

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 12. Examples of pseudo-offsetting two curves. (Colours are visible in the online version of the article; http://dx.doi. org/10.3233/XST-150488)

Fig. 13. In the top: the binarized object. Below: from left to right: Initial and final contour for the test image 1, the initial and final contour for the test image 2, zoomed part of the second test image.

the evolution of the proposed model on two synthetic images TestIm1 and TestIm2 (see Fig. 13) which consist of an homogeneous object drown in a background with non-uniform darkness and where the boundaries cannot be distinguished from the dark backgrounds. TestIm1 is of size 55 × 82 represents a part TestIm2 of size 200 × 200 as shown in Fig. 13. In these experiment, the weighting function parameters d and σd are empirically chosen equal to 6 and 3 respectively. The band width D equals to d + 1. For the same initialization, consisting of a circle crossing the object, the proposed model progression converges from the two initial contours to the same final contour with the same iterations number (23 iterations) and nearly the same execution time (22 sec and 23; 3 sec) as shown by the results in Fig. 13. This means that the convergence time relies only on the size of the object and not on the image size. This is one of the advantages of selecting the band surrounding the model. Indeed, this band whose the purpose was to limit the execution time, brought another advantage which is the independency on the ROI selection. Undeniably, we have no more the need of ROI selection to process the radiographic images unlike several paper dedicated to weld defect detection. In fact, the use of this band excludes definitely the pixels that are not concerned with the local statistics computation. Being freed from the ROI selection, the model will be applied with less human intervention. In Fig. 14, the results of the proposed model are compared to those given by a global statistics-based model, where the extraction ability of our model is highlighted whereas the global statistics-based model fails. Since the proposed active contour is a partly local statistics-based one and the local statistics-based active contours are known to be sensitive to noise, the last experiments done on synthetic images concern the aptitude of the model to finish its progression as close as possible to the real object boundaries even in very bad conditions. Moreover, its outcomes are compared to a global statistics-based model known for its robustness in presence of noise. To this end, we use a set of synthetic images consisting of a known complex object shape shown in Fig. 15, put in variable intensities backgrounds. The obtained images are corrupted by Gaussian noise. Table 1 shows the noise parameters of each image. The backgrounds of these images have varying means, so that: The gray level of each column is obtained from the precedent one by an increment of 1, 1, 2 and 2.5 gray levels for the first, second, third and fourth synthetic images of Fig. 16. These varying means are denoted by μcol , μ2col and μ2,5col .

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

303

Table 1 The noise parameters for synthetic images Gaussian noise parameters 1st image 22 image 3rd image 4th image Gaussian noise 1st image 22 image 3rd image 4th image parameters μobj 60 60 80 70 σobj 10 25 15 15 μbkg μcol μcol μ2col μ2.5col σbkg 10 25 65 65

Fig. 14. Global statistics-based model vs the proposed model results: Left side: Initialization for the two models. Right side Final positions for Global statistics-based model (top), and the proposed model (bottom).

Fig. 15. The reference object.

As the reference object is previously known, it is easy to apply a supervised image segmentation evaluation to assess the model efficiency and to compare its results to the global statistics-based model. Therefore, we have used the measures called internal and external distortion rates (IDR, EDR) proposed in [51]. These measures assess the discrepancy with respect to compactness (or elongation) of the object shape by computing distortion after image segmentation. If A and B are, respectively, the reference object and our model-based segmentation result, IDR and EDR are given by K1 K2 2 2 du (i) d (i) i=1 i=1 o IDR = M , EDR = M (17) 2 2 dA (j) dA (j) j=1

j=1

where du (i) is the distance between the under detected pixel i of B and the closest pixel of the reference background, do (i) the distance between the over detected pixel i of B and the closest pixel of A, dA (j) the distance between the pixel j of A and its nearest pixel in the reference background, K 1 the number of under detected pixels, K 2 the number of over detected pixels and M the number of pixels in A. The obtained measures computed for the four test images (see Fig. 16) show that, as expected, the image with the least noise(the first row) has the best discrepancy scores for IDR and EDR, and the noisiest one (the las row) has the worst discrepancy score. This is the consequence of using local statistics to drive the model which leads to sensitivity to noise. However, the objects borders have been detected and the objects are extracted with different accuracies, thanks to the contribution of the global statistics used inside the curve model even under a high amount of noise. Furthermore, the small values of the discrepancy measures scores indicate that the results do not undergo significant distortions and the overall shapes are recovered. The results of global statistics-based models give nearby the same results as our model as long as the backgrounds intensities do not vary considerably. However, beyond a certain amount of background variation, the model diverges. Moreover, the detected object contour by our model is more accurate as ascertained by the discrepancy measures applied on the images and shown on the two last columns of Fig. 16.

304

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 16. First column: synthetic images, second column: extracted objects with the proposed model, third column: extracted object with a global statistics-based model, fourth column: discrepancy measures for the second column results, fifth column: discrepancy measures for the third column results.

4.2. Algorithm validation on radiographic images Radiography for non-destructive inspection provides a mean to examine the internal structure of a weld and hence to reveal discontinuities and flaws. It uses radiations to penetrate the material under test produce a “shadow picture” of the internal structure of the target [3]. Such picture shows variation of intensity in the receiving film depending on X -ray absorption. Defects that may result with welding process are of different natures as cracks, inclusions, porosities, undercuts, lack of penetrations, burn-through, etc. Nevertheless, the obtained radiograms suffer usually from bad contrast, non-uniform illumination and noisy nature which make the application of standalone automatic flaws detection with radiographic imaging almost impossible. Given some irrelevant information contained in the radiogram and the film characteristics mentioned above, the operator must always intervene to select regions of interest or to tune the applied algorithm parameters etc. We are about showing here that the detection method we propose permits to reduce the user actions and get as a result, a defect description that is readily usable for the image analysis stage. There is no need of radiogram delimitation, region selection or parameters tuning, but just the proposed model initialization on the defect in the whole radiogram. 4.2.1. Local statistics vs global ones for progression After the film digitization, the operator has to indicate the defects on the whole image. The proposed algorithm results are those of the marked defects. Afterward, an adequate shape descriptor computed on the extracted object representing the defect may conduct to a good categorization. To compare the proposed model to global statistics ones, we use the radiogram shown in Fig. 17 where an ROI is selected. Such selected image part is characterized by an inhomogeneous background and a non-uniform

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

305

Fig. 17. ROI selection in the radiogram

Fig. 19. A radiogram of a burn-through at the top, the extracted defect from the whole radiogram at the bottom.

Fig. 18. The proposed model behavior vs the global statistics-based models behaviors: from right to left and from top to bottom: initialization, final contour for our model in 15 iteration; contour evolution in the 15th iteration for the nonparametric based -global statistics (Parzen-based [52]); contour evolution in the 15th iteration for the parametric-based global statistics one [34].

Fig. 20. A radiogram of a weld defect (top), the extracted defect from the whole radiogram (bottom).

illumination. Our model is confronted, then, with two global statistics-based models. The statistics in the first one are computed with a parametric method [34], whereas the second model uses non-parametric statistics [52]. For the same initialization, our model converges to the right boundary in 15 iterations, while the two other models diverge completely as shown in Fig. 18. This shows that the proposed model performs well in case of inhomogeneous backgrounds conversely to the other models. Then, with our method, the weld defect detection permits to handle the backgrounds variability efficiently unlike global statistics based methods to which our model is compared to. 4.2.2. Proposed model progression without ROI selection Next tests shown in Figs 19 and 20, represent the contour extraction via the proposed model applied directly on the radiographic film without any ROI selection. The model has only to be initialized on the film, and it achieves its evolution from its initial position to its final one. Figure 21 shows different defect types extracted from one weld joint radiographic image. Each defect has to be marked on the whole radiogram so that the model defines a circle or an ellipse around the marked point. The progression for each initialized contour goes from the initial defined contour, to the final one to achieve a good boundary estimation. The isolated defect images of Fig. 21 are just zoomed parts of the entire radiogram to show clearly the final contours. Lastly, for the case of the three defect surrounded with one curve in Fig. 21, one can use methods proposed in [29] for example to split the curve into three contours.

306

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

Fig. 21. The proposed model behavior applied on the whole radiographic image without ROI selection. The isolated images are the zoomed parts of the entire image after the model initializations and convergences. (Colours are visible in the online version of the article; http://dx.doi.org/10. 3233/XST-150488)

Fig. 22. In the top, the whole radiogram with the right delineation of the defect with D greater than 3, in the bottom, zoomed parts of a good delineation and a bad one with D = 3.

Fig. 23. Execution time vs the band width value. (Colours are visible in the online version of the article; http://dx.doi.org/10. 3233/XST-150488)

4.2.3. Influence of band width values on the contour evolution Otherwise, the influence of the band width on the contour evolution is summarized by the outcomes in Fig. 22 where ten (10) band width values ranging from 4 to 13 are used. It appears clearly from the graph in Fig. 23 and the final loci given by Fig. 22 (top and left bottom) that, besides a proportional increase of the algorithm running time with the band width value, the contour estimation accuracy of the processed weld defect obtained with value 4 has not been improved any more with greater band width values. However, for this example, band width values less than 4 imply a wrong weld defect estimation as shown in Fig. 22 (right bottom).

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

307

Fig. 24. The proposed model behavior applied on the whole radiographic image vs the implicit model proposed in [41]. From top to down, our model outcome, the model of [41] outcomes, zoomed initialization, our model final contour and the final contour of the model in [41].

4.2.4. Example of comparison with geometric active contour model A last experiment has been conducted to compare the result of the local statistics-based implicit model presented in [41] to our model result on the radiographic film of Fig. 21. The two models are initialized on the whole film image as it is shown on Fig. 24 and their outcomes are shown on the same figure. To begin, our method permits to extract only the object under consideration (the defect) and avoid unnecessary processing without selecting any “ROI” and permits, therefore, a gain of time. In fact, the model converges in 15 iterations which last 17 seconds with a non-optimized code. Indeed, radiographic films contain too much information and the NDT inspector needs to focus its attention only on a particular part of the film where he suspects the presence of defects. Unlike our model, the model proposed in [41] (www.enc.edu/∼liwa/LGD source code.rar) extracts, not only the defect, but other parts of the image as shown in Fig. 24, in 400 iterations which spent 75 seconds. Nevertheless, such model requires labeling

308

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography

techniques to distinguish between extracted regions and other procedures to automatically identify the object of interest among all extracted regions. Moreover, once the object identified, its contour is not parameterized and then not ready to be used by further contour-based image description techniques, unlike the contour issued by our model. 5. Conclusion In this paper, we proposed a new way to recover the defect shapes from radiographic images of welded joints by the mean of a statistical active contour based on global and local statistics. Experiments on synthetic images show that the model gives the same results whether initialized on a ROI image part or on the whole image, and achieve its progression with the same iterations number and nearby the same execution time. That means that we have no more the need of selection ROI to reduce execution time or prevent processing on irrelevant part of the image. Furthermore, we have shown that it achieves a good object delineation in a inhomogeneous background even in very bad image quality. Those performed on radiographic images confirm deductions done with synthetic images. The local statistics make the model progress to the right boundaries in presence of very inhomogeneous background while the global one gives the contribution of the piece-wise homogeneous defect to achieve a correct delineation even in presence of noise. Moreover, selecting a band around the model has permitted to reduce the computation time which represents a big advantage, especially for real time radiogram inspection. In fact, it has accelerated the model motion as the local statistics computations are known for slowing down the models progression. Moreover, selecting this band excludes all other pixels in the local statistics computation which leads to be freed from the ROI selection and reduces at the same time human intervention that will be reduced to just an initialization around or crossing the defect indication to detect. Lastly, the proposed method for selecting this band by a pseudo offsetting, gives the needed results without a supplementary computational load. Finally, the experiments of the synthetic images and radiographic ones show that the model successfully extracts the object under investigation even in bad conditions. As further investigations, the next works will focus on the improvement of the model by an automatic initialization and also the automatic selection of band width value D which is strongly related to de inhomogeneities and the defect size. References [1] [2] [3] [4] [5] [6] [7] [8]

J. Molleda, J.L. Carus, R.Usamentiaga, D.F. Garcia, J.C. Granda and J.L. Rendueles, A fast and robust decision support system for in-line quality assessment of resistance seam welds in the steelmaking industry, Computers in Industry 63 (2012), 222–230. E.B. Lawrence, Non-destructive testing handbook, in: Radiography and Radiation Testing, 901, American Society for Non-destructive Testing (1985). R. Halmshaw, Introduction to the non-destructive testing inWelded joints, Woodhead Publishing, 128, Cambridge, 1996. N. Nacereddine, L. Hamami and D. Ziou, Thresholding techniques and their performance evaluation for weld defect detection in radiographic testing, Machine Graphics and Vision 15(3/4) (2006), 557–566. I. Valavanis and D. Kosmopoulos, Multiclass defect detection and classification in weld radiographic images using geometric and texture features, Expert Systems with Applications 37 (2010), 7606–7614. S.A. Halim, A. Ibrahim, M. Idris and Y.H.P. Manurung, Weld defect features extraction on digital radiographic image using chan-vese model, (CSPA) (2013), 67–72. R. Vilar and J. Zapata, Segmentation of weld regions in radiographic amages: A knowledge-based efficient solution, IWINAC, Part II, LNCS 7931 (2013), 421–430. I.B. Mhamed, S. Abid and F. Fnaiech, Weld defect detection using a modified anisotropic diffusion model, EURASIP Journal on Advances in Signal Processing (2012), 1–12.

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40]

309

O. Zahrana, H. Kasbanb, M. El-Kordya and F.E. Abd El-Samiea, Automatic weld defect identification from radiographic images, NDT and E 57 (2013), 26–35. N. Nacereddine, D. Ziou and L. Hamami, Fusion-based shape descriptor for weld defect radiographic image retrieval, Int J Adv Manuf Technol 68(9/12) (2013), 2815–2832. H. Yazid, H. Arof and H. Yazid, Automated thresholding in radiographic image for welded joints, Nondestructive Testing and Evaluation 27(1) (2012), 69–80. R. Cogranne and R. Retraint, Statistical detection of defects in radiographic images using an adaptive parametric model, Signal Processing 96(B) (2014), 173189. N. Nacereddine, R. Drai and A. Benchaala, Weld defect extraction and classification in radiographic testing based artificial neural networks, WCNDT Roma (2000). T. Tong, Y. Cai and D. Sun, Defects detection of weld image based on mathematical morphology and thresholding segmentation, WiCOM (2012), 1–4. D. Mery and M.A. BertiA, Automatic detection of welding defects using texture features, Insight 45 (2003), 676–681. V. Lashkia, Defect detection in X-ray images using fuzzy reasoning, Image Vision Comput 19(5) (2001), 261–269. R.R. Vijay, R.S. Anand and A. Alaknanda, Comparative analysis of NDE techniques with image processing, Nondestructive Testing and Evaluation 27(4) (2012), 305–326. S.F.L. Gunn and M.S. Nixon, A robust snake implementation: A dual active contour, IEEE Trans PAMI 19(1) (1997), 63–68. A.B. Goumeidane, N. Nacereddine and M. khamadja, Local and global statistics-based explicit active contour for weld defect extraction in radiographic inspection, CAIP, Part II, LNCS 8048 (2013), 491–498. M. Kass, A. Witkin and D. Terzopoulos, Snakes: Active contour models, Int J Computing and Vision 1(4) (1988), 321– 331. S. Osher and J. Sethian, Fronts propagating with curvature-dependent speed: Algorithms based on Hamilton-Jacobi formulations, J Comp Phys 79 (1998), 12–49. N. Paragios and R. Deriche, Unifying boundary and region-based information for geodesic active tracking, CVPR (1999). M.E. Leventon, W.E.L. Grimson and O. Faugeras, Statistical shape influence in geodesic active contours, CVPR 1 (2000), 316–323. M. Jacob, T. Blu and M. Unser, Efficient energies and algorithms for parametric snakes, IEEE Transactions on Image Processing 13 (2004), 1231–1244. V. Srikrishnan and S. Chaudhuri, Stabilization of parametric active contours using a tangential redistribution term, IEEE Trans Image Processing 18 (2009), 1859–1872. F. Precioso, M. Barlaud, T. Blu and M. Unser, Robust real-time segmentation of images and videos using a smooth-spline snake-based algorithm, IEEE Transactions on Image Processing 14(7) (2005), 910–924. C. Collewet, Polar snakes: A fast and robust parametric active contour model, ICIP (2009), 3013–3016. L. He, Z. Peng and B. Everding, A comparative study of deformable contour methods on medical image segmentation, Image and Vision Computing 26(2) (2008), 141–163. T. McInerney and D. Terzopoulos, T-snakes, topology adaptive snakes, Medical Image Anal 4(2) (2000), 73–91. L.D. Cohen and I. Cohen, Finite-element methods for active contour models and balloons for 2D and 3D images, IEEE Trans Pattern Analysis and Machine Intelligence 15(11) (1993), 1131–1147. R. Ronfard, Region-based strategies for active contour models, Int Journal of Computer Vision 13(2) (1994), 229–251. C. Chesnaud, P. Réfrégier and V. Boulet, Statistical region snake-based segmentation adapted to different physical noise models, IEEE Transaction on PAMI 21(11) (1999), 1145–1157. Y. Tian, F. Duan, M. Zhou and Z. Wu, Active contour model combining region and edge information, Machine Vision and Applications 24 (2013), 47–61. A.B. Goumeidane, M. Khamadja and N. Nacereddine, Adaptive and statistical polygonal curve for multipleWeld defects detection in radiographic images, DICTAP, Part I, CCIS 166(2011), 184–198. N. Nacereddine, L. Hamami, D. Ziou and A.B. Goumeidane, Adaptive B-spline model based probabilistic active contour for weld defect detection in radiographic imagin, Image Processing and Communications and Challenges 2 AISC 84(2) (2010), 289–297. N. Nacereddine, L. Hamami and D. Ziou, Probabilistic deformable model for weld defect contour estimation in radiography, Machine Graphics and Vision 15(3/4) (2006), 547–556. J.M.B. Dias, Adaptive bayesian contour estimation: A vector space representation approach, EMMCVPR, LNCS 1654 (1999), 157–173. S.M.G.V.B. Jardim and M.A.T. Figueiredo, Segmentation of fetal ultrasound images, Ultrasound in Medicine and Biology 31(2) (2002), 243–250. M. Gadermayr, A. Maier and A. Uhl, Active contours methods with respect to vickers indentations, Machine Vision and Applications 24 (2013), 1183–1196. C. Li, C. Kao, J. Gore and Z. Ding, Minimization of region-scalable fitting energy for image segmentation, IEEE Trans-

310

[41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52]

A.B. Goumeidane et al. / Weld defect delineation with active contours in radiography actions on Image Processing 17 (2008), 1940–1949. L. Wang, L. He, A. Mishra and C. Li, Active contours driven by local Gaussian distribution fitting energy, Signal Processing 89(12) (2009), 2435–2447. T. Brox and D. Cremers, On local region models and a statistical interpretation of the piecewise smooth mumford-shah functional, Int J Comput 84(2) (2009), 184–193. S. Zhu and A. Yuille, Region competition: Unifying snakes, region growing, and bayes/MDL for multiband image segmentation, IEEE Trans Pattern Anal Mach Intell 18(9) (1996), 884–900. Q. Yang and D. Boukerroui, Ultrasound image segmentation using local statistics with an adaptive scale selection, ISBI (2012), 1096–1099. W. Li and R.R. Martin, Global topological changes of offset domains, in: Eighth International Symposium on Voronoi Diagram in Science and Engineering, ISVD (2011), 83–90. B. Pham, Offset curves and surfaces: A brief survey, Computer Aided Design 24(4) (1992), 223–229. D. Coeurjolly, S. Miguet and L. Tougne, Discrete curvature based on osculating circle estimation, LNCS 2059 (2001), 303–312. D.J. Williams and M. Shah, A fast algorithm for active contours and curvature estimation, CVGI Image Understanding 55(1) (1992), 14–26. R.T. Farouki and C.A. Neff, Analytic properties of plane offset curves, Computer Aided Geometric Design 7 (1990), 83–99. H. Tagare, Deformable 2-D template matching using orthogonal curves, IEEE Trans on Medical Imaging 16(1) (1997), 108–117. A.B. Goumeidane, M. Khamadja, B. Belaroussi, H. Benoit-Cattin and C. Odet, New discrepancy measures for segmentation evaluation, ICIP, part II 3 (2003), 411–414. A.B. Goumeidane, M. Khamadja and N. Nacereddine, Bayesian pressure snake for weld defect detection, ACIVS, LNCS 5807 (2009), 309–319.