You are on page 1of 4

A Type of Voting Diffusion Model and Its

Application in Defect Detection in Aluminum

Castings

Situ Wuchao, Huang Qian, and Wu Yuan

Abstract-We make use of a type of voting diffusion model for


casting image processing. This model is based on an anisotropic
diffusion equation driven by a diffusion tensor, whose structure
depends on the coupled time-delay regularization of a matrix. The
diffusion tensor determines the directions of the diffusion as well
as the speed in these directions. Experimental results show that
this model is superior to the PM model and other methods based
on classical edge detection in processing the casting images
without affecting its interesting features. Namely, it has better
preservation of the flaws.
Index Terms-anisotropic
time-delay regularization

diffusion,

diffusion

Fig. 1. (a) Radioscopic image of a casting. (b) The most significant


part of (a)

There have been some methods proposed in defect detection

[6][7]. However, generally, they have two problems: a) Since

the original radioscopic image usually has a large size (fig. 1 (a),
540 X 540 ), while continuingly processing directly on the
whole image, it consumes much time. Such as [6], in its part of
"identification of potential flaws", it's too time-consuming
when finishing all steps in this part. b) They use classical edge
detection methods that often result in inaccurate edge. In [6],
accurate contour of defects actually cannot be obtained based
on zero-crossing method.
This paper here proposes a new system to deal with these two
problems. Here is our overall inspection system, seeing Fig.2.

tensor,

1. INTRODUCTION

IN the car industry, many products, like aluminum wheels and

lsteering gears, always have some inevitable material defects


inside during the casting process, such as cavities, gas,
inclusions, and sponging occurs. And these defects must be

image f0&~rMtion -

detected to satisfy requirements. Because of the invisibility of


most defects, X-ray imaging is adopted to defect detection. An
example of a radioscopic image is shown in Fig. I.

lerectr

X-ray

!._......._.._.

-- -- --

pyrorerssng by rhe.

(a)

(b)

Manuscript received August 31, 2005. This work was supported by


Guangdong (2004BI0201035) and Guangzhou (2004C13G0021) technology
fund of P. R. C. China.
Situ Wuchao is with the Electronics and Communication Engineering
Department, South China University of Science and Technology, People's
Republic of China. He is a graduate student (e-mail: cchaos@tom.com

<mailto:cchaos@tom.com>).
Huang Qian is an Assistant Professor at the Department of Electronics and
Communication Engineering, South China University of Science and
Technology, People's Republic of China. (e-mail:eeqhuang@scut.edu.cn).
Wu Yuan is with the Electronics and Communication Engineering
Department, South China University of Science and Technology, People's
Republic ofChina. He is a graduate student (e-mail: tuoge@tom.com)
0-7803-9435-6/05/$20.00 @2005 IEEE.

Fig. 2. Automatic X-ray inspection system


In Fig.2, the step of segmentation is to abstract the most
significant part (where assembles most potential defects) of the
whole original radioscopic image. Because this part usually has

a little share ofthe whole image, the whole computation time of

301

the algorithm can be greatly reduced. As for the realization of


segmentation, roughly speaking, we first do edge abstracting of
the whole image, then many general edges can be obtained.
Next, according to some requirements and characteristics of the
defects (for example, the edge of the defect is closed or nearly
closed and usually defects assemble in a certain place of an
entire original radioscopic image), the significant part can be
located (we will specify the segmentation algorithm in another
paper).
After segmentation, the flowing steps will focus on dealing
with the relatively small but most significant image. This paper
here proposes a voting diffusion model to continue the defect
detection, unlike other methods that often result in inaccurate
edges based on classical edge detection, our model can have a
more accurate contour of the flaw (seeing the flowing rest of
the paper).

III. VOTING DIFFUSION MODEL

The voting diffusion model is:


au - div(L[Vu]Vu) = 0

at

m-+ L = F[Vu]

FIVu]= IP1

if IVu.s {

vu

2(P

)Id2I
V

II. PM MODEL

Id=(

equation.
a

at

u(x,y,t) = div[c(lI Vu(x,y,t) I1)] Vu(x,y,t) j] (1)

c(l1 Vu(x,y,t) 11) =


or

1
1

(11 VU(X,Y,t) 11)2


k

(3)
c(l1 Vu(x,y,t) 1) = exp{f-(I VU(X,Y,t) 11)2 }
k
where u(x,y,t) denotes the image pixel at position(x,y), t
refers to time or iteration step in discrete case and
c(lI Vu(x, y, t) ||) is a diffusion coefficient, a decreasing
conductivity function of the image gradient magnitude

u(x,y,t) (11011 denotes

the vector norm, here we use the


gradient magnitude u(x,y,t) ). The basic idea is to smooth
out noise presented in the image without sacrificing the useful
details and highlight certain image features preferentially.
From then on, numerous PDE models are designed based on
the PM model. A large number ofthem are focus on modifying
the diffusion coefficient c(|) [2][3][4]. Virtually, these can be
viewed as curvature-driven anisotropic diffusion models or as
the evolutions corresponding to the minimization of total
variation. They have the same basic idea as PM model trying to
stop the diffusion where the magnitude of the gradient of the
image intensity is high.
Instead of focusing on the curvature-driven diffusion models,
where the diffusion is governed by the diffusion coefficient
c(*), we use another type of diffusion model [5], where the
diffusion is governed by a matrix, called diffusion tensor,
embedded in the equation.

otherwiseJ

u-L

(6)

s is a parameter that can be selected manually.

u(x,y,O) = I
In 1990, Perona and Malik [1] put forward a new model for
image processing: the Perona-Malik (PM) nonlinear diffusion

(5)

at

Here

(4)

U2

-uUy

(7)

L(x,y,O) = Id
I

Vu=( X)

I is the original image, and obviously, F and L are 2 x 2


matrices .
In order to prevent diffusion across significant edge of the
image, the diffusion tensor L was constructed in (5) that the
diffusion is only along the direction perpendicular to Vu .
IPV is the orthogonal projection on the direction orthogonal
to Vu. L is the time-delay regularization ofF. Time-delay
regularization enables us to bring the past information of the
gradient of image into account, so that over-smoothing can be
adjusted.
Roughly speaking, in (6), inside the homogeneous regions
where the gradients are not large, the diffusion is isotropic
while on the edge where the gradients are high, the diffusion is
only in the direction perpendicular to Vu .
IV. NUMERICAL EXPERIMENTS
Here, we present our numerical scheme and several
experiments. We denote by u(x,y) the value of u at the pixel

(x=ih,y= jh).

We define:

AYu11 = i+1,j u for the forward difference of u atthe


h

pixel (i, j)

Uij=

u. -u-I
a h

pixel (i, j)
(Ayu. j and

302

V (u

A;yu,j
)

forthe backward difference of u at the


have similar results)

div (Vu)

div u

div

(A yui fJ)

A+ (A-u jj)

A+(A-v,,j)

(a)

h
so

according to the definitions above, from (4), we have


n +

-U

At

div (L V u)
div

((

L1 )( Axui,j
L22 )tAyU ij;

L21

A XUi
L21 A2
UYJj + L2
2IV
=

[A+ (LI, A-

A+ (L2IAxUjIj

L22

u ij

LI2 A- uiuj)

jj +

A-uij)]

+
/ h

then,
nj+ =nj

ui

++At
(h)[A

(L, A~u1j

L12A;Ui,)

(8)
A;

(L21Au,j

from (5), we have

L22AUi,j

LI"+ _l Li j

L'l'

At

In=

m(

)]

I in

L,j +F

(9)

At
our programme

is based

conditions L j Id u
=

on

(8) and (9) with the initial

= I.

V. EXPERIMENTS
Here we do some experiments on
obtained by X-ray.

our

(g)

casting pictures

Fig. 3. (a) Standard image of casting defection. (b) Processed picture


of (a), by the PM model (iteration=100, k =8, using equation (3)
for c(e) ). (c) Processed picture of (b) after thresholding. (d) Processed
picture of (a), by the proposed diffusion model (iteration=l00, At
=0.05, m =5, S =2). (e) Processed picture of (d) after thresholding. (f)
Zero crossing image of (a), using Gaussian lowpass filter (c = 1.25,
kernel size = 11 x 11). (g) Result of finding closed edges in (f)

In fig. 3, compared with PM model, the proposed diffusion


model not only erases most of the noise but also tracks the
contour of the flaws more accurately and suitablely (seeing
(d),(e)). However the PM model tracks the contour so rough
and sometimes generates some small speckles around the
contour then the thresholded picture must affect the subsequent
work in dealing with the flaws sorting that is based on the
accurate contour (seeing (b),(c)). (f) is obtained based on the
method in [6] and by observing (g) we find this method cannot
provide acceptable result- there are so many irregular edges
and distorted shapes without any accuracy.

303

PM model. Now focusing on picture (f), contours of interesting


flaws are found which are more accurate. As for (g), it is based
on classical edge detection ( using method of [6] ) , and often
produces many irregular curves. Though after finding the
closed edges, we can get some potential defects, however, the
edges obtained finally (seeing (h)) are inaccurate (the result
can't satisfy our requirements), comparing with (a). The root
cause of this is that the classical edge detection method is weak
in preserving an accurate contour of the defect.
VI. CONCLUSION

We use a type of voting diffusion model for defect detection


in aluminum castings. This model, govemed by diffusion
tensor, can track the flaw edge more accurately than the PM
model as well as other methods based on classical edge
detection. PM model is actually trying to diminish the diffusion
where the magnitude of the gradient of the image is high, but
doesn't take the diffusion directions on the edge into account.
So it leads to a rough contour that causes distortion from the
real edge of the flaw. As for methods based on classical edge
detection, because of its weakness in accurate edge
preservation, the result is not so satisfactory. However, the
suggested diffusion model, while on the edge, controls the
diffusion only in the direction perpendicular to Vu without
diffusing towards direction of Vu through the diffusion
tensor. Then better contours can be preserved. Since accurately
tracking flaws is very important for flaw sorting in the whole
process of casting defect detection, PDE model govemed by
diffusion tensor must have a bright prospect in this field.
Our future work has two main aspects: a) continuing with the
improvement of the voting diffusion model used in the castings
image; b) further investigation about the classification to
abstract the real defects from the potential ones.

(h)
Fig.4. (a) Real defects ofX-ray casting image. (b) Processed picture of

(g)

(a) after direct thresholding without any processes in advance. (c)

Processed picture of (a), by the PM model (iteration=100, k =2,


equation (3) ). (d) Processed picture of (c) after thresholding. (e)
Processed picture of (a), by the proposed diffusion model
(iteration=100, At =0.05, m =5 At, S =2). (1) Processed picture of
(e) after thresholding. (g) Zero crossing picture of (a), using Gaussian
lowpass filter (a = 1.25, kernel size = 11 x 11 ). (h) Result of finding
closed edges in (g).
In figure 4, we can find similar results to what fig. I shows.
Without any processes in advance, a good binarization result
could not be obtained directly by thresholding the real defects
of X-ray casting image. Seeing picture (b) above, contours
obtained are rough and one of them is even distorted, together
with some noise. In picture (d), though general contours of the
flaws we are interested in are found and the uninteresting
objects are denoised, however, the contours are still rough,
part of the
what is more, the shape actually changes a lot
contours become a straight line. These are the disadvantages of

REFERENCES
[1] P. Perona and J. Malik, "Scale space and edge detection using anisotropic
diffusion," IEEE Trans. Pattern Anal. Machine Intell, vol. 12, pp.629-630,
1990.
[2] F. Catte, J. M. Morel, P. L. Lions and T. Coll, "Image selective smoothing
and edge detection by nonlinear diffusion," SIAMJournal on Numerical
Analysis, pp.182-193, Feb. 1992.
[3] Y. Chen, B.C. Vemuri, and L. wang, "Image denoising and
segmentation via nonlinear diffusion," Internat.J.Comput.Math. Appl., to
appear.
[4] B. Smolka, "Combined Forward and Backward Anisotropic Diffusion
Filtering of Color Image." Pattern Recognition Proceedings of 24th
DAGM Symposium, pp1 6-18,2002.

[5] G. H. Cottet and M. E. Ayyadi, "A Volterra type model for image
processing," IEEE Trans. Image Processing, vol.7, issue. 3, pp.292-303,
Mar. 1998.
[6] D. Mery, "Automated Flaw Detection in Aluminum Castings Based on
the Thanking of Potential Defects in a Radioscopic Image Sequence,"
IEEE Trans. Robotics & Automation, vol. 18, 2002.

[7] S. Hemandez, D. Saez, D. Mery, "Neuro-Fuzzy Method for Automated


Defect Detection in Aluminium Castings." ICIAR 2004, LNCS 3212, pp.

304

826-833, 2004.