You are on page 1of 5

Fuzzy Min-Max Neural Network for

Image Segmentation
Pablo A. Estévez, Gonzalo A. Ruz and Claudio A. Perez
Department of Electrical Engineering
University of Chile
Casilla 412-3, Santiago, Chile

Abstract- In this work a new fuzzy min-max neural color video camera, a frame grabber and a
network for color image segmentation, called FMMIS microcomputer was developed, and applied to defect
neural network, is proposed. The FMMIS algorithm uses classification in radiata pine boards. The best overall
seed pixels to grow hyperboxes, and a criterion of off-line performance obtained on a test set was 74.5%
homogeneity for controlling the size of these hyperboxes. of correct classifications with 10 defect categories plus
The algorithm has been implemented for 2D images and clearwood (area free of defects). In this system, the
tested on the segmentation of live and dead knots in image segmentation was performed by histogram-based
images of wood boards. On a test set, all knots were multiple thresholding combined with edge detection.
correctly detected and most of them were precisely Thresholds were adjusted to get a high defect detection
segmented (the area recognition rate was 91%). The rate (95%), but this was achieved at the expense of
method is very fast and may be applied on real-time visual segmenting dark grain lines as defects. Ideally the
inspection systems. segmentation algorithm should divide the image into
clearwood and defects. In radiata pine boards some
knot pixels are of the same color and intensity as grain
I. Introduction patterns. If a high histogram threshold were used to
fully segment knots, many grain patterns would be
Fuzzy min-max (FMM) neural networks were first segmented too. If a low threshold were used to avoid
introduced by Simpson, oriented to classification [6] detecting grain patterns, knots would be partially
and clustering [7] tasks. In FMM neural networks, segmented only. Both situations are undesirable, and
fuzzy set hyperboxes are defined by pairs of min-max usually there is a tradeoff between the rate of true
points, and a membership function is defined with positives and false positives. In this work, we propose a
respect to these points. The pattern classes or clusters new image segmentation method based on FMM neural
are represented by fuzzy set hyperboxes. The min-max networks. The new model is called FMMIS (Fuzzy
points are learned by placing and adjusting hyperboxes Min-Max for Image Segmentation) neural network. The
in the pattern space. The learning algorithm is a three- performance of this method is evaluated on the
step expansion-contraction process, which has the segmentation of knots in images of wood boards.
ability to learn online and in a few passes through the
data. In [4] an extension of the FMM model is
developed, which is called the general fuzzy min-max II. FMMIS Algorithm
(GFMM) neural network. In GFMM the hyperbox
membership function and the hyperbox expansion A. FMMIS Basic Characteristics
constraint have been modified. In a survey on image 1. The input patterns are the spatial coordinates of the
processing with neural networks [2], no applications of pixels, with each dimension normalized in the range
FMM neural networks were reported. Recently the [0,1]. Let X be a P × 2 input matrix, where
original FMM clustering algorithm has been used to P = M × N is the number of pixels in the image I m .
locate clusters of skin color pixels within the Hue- The position of the hth pixel in the image is represented
Saturation-Value color space, and applied to the by the vector X h = (x h1 , x h 2 ) ∈ I 2 , where the first
segmentation of faces [8]. component indicates the column and the second
component indicates the row of the image. To obtain a
In [5] a review of methods for automated grading and fast segmentation method only a few input pixels,
detection of defects on wood boards was presented. A called seeds, are used to grow hyperboxes. For the knot
defect is considered to be any characteristic which segmentation problem the seeds are automatically
makes wood unsuitable for a given use, e.g. knots. In determined before applying the FMMIS algorithm, as it
[3] a low-cost machine vision system composed of a is explained later in the methods section.
2. The hyperbox membership function defined in i. Expand the hyperbox B j (if needed) to include
GFMM [4] is used. Let each hyperbox fuzzy set, B j ,
X h , by adjusting the min and max points,
be defined by the ordered set

{
B j = X h , V j , Wj , b j ( X h , V j , Wj ) } (1) v new
ji = min v old (
ji , x hi , ) for i = 1,2.
w new = max (
w old , x hi ,) for i = 1,2.
( )
ji ji
where V j = v j1 , v j 2 is the min-point and
(
Wj = w j1 , w j 2 ) is the max-point. The membership The expanded hyperbox will contain a new image
function for the jth hyperbox b j ( X h ), 0 ≤ b j ( X h ) ≤ 1 , region I new
j . Before the expansion the
measures the degree to which the hth input pattern fall hyperbox B j contained the region I old
j .
outside of the hyperbox B j , i.e. the min-max bounds of
the hyperbox. As bj approaches 1, the point is more ii. Calculate the mean intensity of the pixels
contained by the hyperbox, with the value 1 contained within image regions I new
j and I old
j , for
representing complete hyperbox containment. The
membership function is: the red (R), green (G) and blue (B) color channels,

( ([ ( )] [
b j (Xh ) = min min 1− f x hi − w ji , γ i , 1 − f (v ji − xhi , γ i ])) (
j (t )
µ told = mean I old ) for t = R, G, B.
= mean(I (t )) for t = R, G, B.
i =1,2
µ tnew new
j
(2)
where
iii. Verify if the following expansion criterion is met
 1 if rγ > 1
 or not,
f (r , ) f (r ) rγ if 0 ≤ rγ ≤ 1
γ = γ = (3)
 0 if rγ < 0 ,
 ∑µ
t = R ,G , B
old
t − µ tnew ≤ η , (5)

and γ represents sensitivity parameters, that regulate


how fast the membership value decreases. where η is a user-defined value, which controls the
size of the hyperbox. If the expansion criterion is
B. FMMIS Learning Algorithm
satisfied then set B j =B new
j , otherwise set B j =B old
j . If
1. Initialization: The min, Vj , and max, Wj , points
none of the existing hyperboxes include or can be
are set initially to V j = 0 and Wj = 0 . When expanded to include the input X h , then a new
the jth hyperbox is adjusted for the first time using the hyperbox B k is created, and it is initialized using (4).
input pattern X h = (x h1 , x h 2 ) the min and max points
of this hyperbox would be identical to the input pattern 3. Hyperbox Overlap Test: This step and the next one
are identical to those defined in [7]. Let C be the set of
V j = Wj = X h . (4) hyperboxes that has been created by the FMMIS
algorithm. Assume that the hyperbox B j ∈ C has been
2. Hyperbox Expansion: When the input pattern X h is expanded in the previous step. To test for possible
presented, the hyperbox B j with the highest degree of overlaps, a dimension-by-dimension comparison is
performed between B j and the remaining B k ∈ C .
membership is found. The hyperbox B j has to satisfy
There exists overlap between B j and B k , if one of the
an expansion criterion before expanding to include the
input (seed) X h . The image region contained within following four cases is satisfied for i = 1,2 ,
the crisp boundaries of the hyperbox B j is defined as
Case 1: v ji < v ki < w ji < wki

{ }
I j = X k b j ( X k ) = 1 , for all X k ∈ I m .
Case 2: v ki < v ji < wki < w ji
Case 3: v ji < v ki ≤ wki < w ji
The size of the hyperbox is regulated by controlling the Case 4: v ki < v ji ≤ w ji < wki .
degree of homogeneity of the image region I j . The
procedure for the hyperbox expansion is as follows:
4. Hyperbox Contraction: If the hyperboxes B j and
B k are overlapping, both hyperboxes are contracted in
every dimension. The hyperbox contraction rules
depend on the four cases previously described, as
follows:

Case 1: v ji < v ki < w ji < wki ,


v kiold + w old
ji Fig.1. The boundaries of the hyperbox (rectangle for 2D images) are
v kinew = w new
ji = . defined by four line segments passing through the min and max
2
points: two horizontal segments, hmin and hmax, and two vertical
Case 2: v ki < v ji < wki < w ji , segments, vmin and vmax.

ji + wki
v old old
v new
ji = wkinew =
2
.
 l
( )
Case 2: while  max v max jt (l ) ≤ u t and w j1 ≤ N 

Case 3: v ji < v ki ≤ wki < w ji ,
j1 = w j1 + 1
{ w new old

v new
ji = wkiold , if wki − v ji < w ji − v ki
update vmax jt using w new
j1 } (6b)
w new
ji = v kiold , if wki − v ji ≥ w ji − v ki .
Case 4: v ki < v ji ≤ w ji < wki ,
( )
Case 3: while  max h min jt (l ) ≤ u t and v j 2 ≥ 1
 l 
same assignments as in Case 3.
j 2 = v j2 −1
{ v new old

5. Fine-tuning Hyperbox Expansion: After a single


pass through all the input patterns, a number of update hmin jt using v new
j2 } (6c)
hyperboxes are created. Since these hyperboxes are
created using seed pixels, there may exist some pixels
that actually belong to the object being segmented but ( )
Case 4: while  max v min jt (l ) ≤ u t and v j1 ≥ 1
 l 
are not included within the hyperbox boundaries. A
j1 = v j1 − 1
{ v new old
fine-tuning expansion stage has been added in FMMIS
to allow a hyperbox to be expanded in any of its sides
update vmin jt using v new
j1 }. (6d)
when a similarity criterion is satisfied. For 2D images
the hyperboxes are rectangles, defined by four line
segments, as shown in Fig. 1. A horizontal line
segment, hmin, and a vertical line segment, vmin, pass 4. Wood Defect Detection
through the min-point of the hyperbox. Likewise, a
horizontal line segment, hmax, and a vertical line A. Methods
segment, vmax, pass through the max-point of the A sample of 400 color images of wood boards was
hyperbox. Given the hyperbox, B j , and color channel, extracted from the wood defect image database
available at the University of Chile [3]. The images
t, the following notation is introduced: hmax jt (l ) , extracted corresponded to 200 boards with live knots
vmax jt (l ) , hmin jt (l ) and vmin jt (l ) are the and 200 boards with dead knots. Sample board widths
ranged from 6 cm to 15 cm, and board lengths varied
intensities of the lth pixel belonging to the line
between 10 cm and 30 cm. The images are in RGB
segments hmax, vmax, hmin and vmin, respectively. color containing 256 intensity levels each channel, with
Let u t be intensity thresholds defined for channels a resolution of 320x240 pixels. From these 400 images,
t = R, G, B. A line segment would be expanded if a training set of 300 images was used for adjusting the
contain pixels darker than u t . There are four cases of parameters of the FMMIS learning algorithm, and a test
possible expansions, one for each line segment shown set of 100 images was used for measuring the
in Fig. 1. The following conditions for the while cycles performance of the FMMIS algorithm. The parameters
should be satisfied for each t = R, G, B. of the FMMIS algorithm were set to γ = 1 in (3),
η = 0.35 in (5), and ut = 195 for t = R in (6). Only the
Case 1: while  max h max
 l
( jt (l )) ≤ u t and w j 2 ≤ M 
 red channel was used in the fine-tuning hyperbox
expansion process.
{ w new
j2 = w old
j2 +1
update hmax jt using w new
j2 } (6a)
To get a few pixels as seeds for the FMMIS algorithm, TABLE I
PERFORMANCE OF THE FMMIS ALGORITHM ON THE TEST SET
pixels darker than clearwood at the intensity levels 90,
170 and 190 were automatically detected in each image. Grain Other
Knot Area Average
These levels were found by analyzing the training set. Board
Detection Recognition
Patterns Defects
Processing
Category Detection Correctly
To avoid noisy inputs, isolated seed pixels having no Rate Rate Time
Rate Detected
neighboring seeds within a window of 21x21 pixels Live Knots 100 % 91.0 % 4.8 % 3 0.06 s
were eliminated.
Dead Knots 100 % 91.5 % 6.1 % 2 0.06 s

The performance of the FMMIS algorithm was


measured on the test set using the following criteria: Table I shows the performance of the FMMIS
knot detection rate (ratio between the number of algorithm on the test set. All knots were correctly
detected knots and the total number of knots in the test detected. The area recognition rate was 91% for live
set); grain patterns detection rate (ratio between the knots and 91.5% for dead knots. A few grain patterns
number of clearwood objects detected and the total were detected too, representing 4.8% and 6.1% of all
number of objects detected), and area recognition rate. the objects segmented on wood boards containing live
To calculate the last criterion, an optimal bounding knots and dead knots, respectively. A few defects
rectangle was manually set for each knot in the test set. different from knots present in the images, in total 5,
Since knots are circular or elliptical, the optimal were correctly detected. The average processing time
bounding rectangle will enclose all the knot pixels plus per image was of 0.06 s.
some clearwood pixels. The area of the FMMIS
hyperbox was compared to the area of the optimal
rectangle, using the area recognition rate, ARR, defined
as,

 ukp unp 
ARR = 1 − −  × 100% , (7)
 tp tp 

where tp is the total number of pixels in the optimal


bounding rectangle; ukp is the number of unrecognized
knots pixels, i.e. the absolute difference between the
knot pixels contained within the optimal bounding
rectangle and the knot pixels contained within the
hyperbox determined by the FMMIS algorithm; and
unp is the number of unrecognized non-knots pixels,
i.e. the absolute difference between the clearwood
pixels contained within the optimal bounding rectangle
and the clearwood pixels contained within the hyperbox
determined by the FMMIS algorithm. The FMMIS
algorithm was implemented in MATLAB. The
processing time was measured on a PC Athlon XP
2000+, 1666 MHz, 256 MB RAM.

B. Experimental Results
Fig. 2 illustrates the different steps of the FMMIS
algorithm. Figure 2(a) shows a sample image with two
live knots. Figure 2(b) shows the seed pixels in white,
which were automatically determined using the same
thresholds for all the images. In average 38 pixels per
image were used as seeds on the test set, i.e. 0.03% of
the total number of pixels in an entire image. Figure
Fig. 2. Example showing the different steps of the FMMIS
2(c) depicts the two hyperboxes found by the FMMIS algorithm: (a) original image containing two knots, (b) seed pixels are
algorithm after a single pass through all the seed pixels. shown in white, (c) two hyperboxes (rectangles) determined by the
Figure 2(d) illustrates the results obtained after the fine- FMMIS algorithm after a single pass through all the seed pixels, and
tuning hyperbox expansion process. (d) the two hyperboxes after the fine-tuning expansion process.
5. Conclusions References
A new FMM neural network for image segmentation, [1] R. Adams and L. Bischof, “Seeded region growing”, IEEE
called FMMIS neural network, has been proposed. As Trans. Pattern Anal. Machine Intell., vol. 16, pp. 641-647,
1994.
in seeded region growing techniques [1], the FMMIS [2] M. Egmont-Petersen, D. de Ridder and H. Handels, “Image
algorithm uses seeds and a criterion of homogeneity for processing with neural networks – a review”, Pattern
controlling the region sizes. In contrast with region Recognition, vol. 35, pp. 2279-2301, 2002.
growing methods, the FMMIS algorithm grows [3] P. A. Estévez, C. A. Perez and E. Goles, “Genetic input
selection to a neural classifier for defect classification of
hyperboxes using only the seed pixels as inputs. If the radiata pine boards”, Forest Prod. J., in press.
homogeneity criterion is satisfied, a hyperbox could be [4] B. Gabrys and A. Bargiela, “General fuzzy min-max neural
expanded from a given size to any other size by network for clustering and classification”, IEEE Trans. Neural
Networks, Vol. 11, No. 3, pp. 769-783, 2000.
including a new seed pixel. This feature allows in [5] D. T. Pham and R. J. Alcock, “Automated grading and defect
principle a faster segmentation than region-based detection: A review”, Forest Prod. J., vol. 48, No. 4, pp. 34-
methods, where the seed pixels are compared with all 42, 1998.
[6] P. K. Simpson, “Fuzzy min-max neural networks – Part 1:
their neighboring pixels. In the knot segmentation Classification”, IEEE Trans. Neural Networks, Vol. 3, No. 5,
problem all knots were correctly detected and most of pp. 776-786, 1992.
them were precisely segmented. This was achieved with [7] P. K. Simpson, “Fuzzy min-max neural networks – Part 2:
Clustering”, IEEE Trans. Fuzzy Systems, Vol. 1, No. 1, pp. 32-
a very low-rate detection of grain patterns as compared
45, 1993.
to previous work [3]. The method proposed is very fast [8] J. Wachs, H. Stern and M. Last, “Color face segmentation
and may be applied on real-time visual inspection using a fuzzy min-max neural network”, Int. J. Image and
systems. The algorithm has been implemented for 2D Graphics, Vol. 2, No. 4, pp. 587-601, 2002.
images but it can be easily expanded to 3D images.

Acknowledgments
This work was supported in part by Conicyt-Chile,
under grant Fondecyt 1030924.

You might also like