Pattern Recognition Letters 24 (2003) 1361–1373 www.elsevier.com/locate/patrec
A TASOM-based algorithm for active contour modeling Hamed Shah-Hosseini, Reza Safabakhsh
*
Computer Engineering Department, Amirkabir University of Technology, Tehran 15914, Iran Received 17 March 2002; received in revised form 30 October 2002
Abstract Active contour modeling is a powerful technique for modeling object boundaries. Various methods introduced for this purpose, however, have certain difficulties such as getting stuck in local minima, poor modeling of long concavities, and producing inaccurate results when the initial contour is chosen simple or far from the object boundary. A modified form of time adaptive self-organizing map network with a variable number of neurons is proposed here for active contour modeling which does not show such difficulties and automatically determines the required number of control points. The initial contour for the object boundary can be defined inside, outside, or across the boundary. This contour can be open or closed, may be as simple as desired, and can be placed far from the object boundary. In addition, the boundary may contain long concavities. The proposed algorithm is tested for modeling different objects and shows very good performance. Ó 2002 Elsevier Science B.V. All rights reserved. Keywords: Active contour modeling; Snakes; Self-organizing map; Time adaptive; TASOM
1. Introduction Active contour modeling (ACM) was introduced by Kass et al. (1988) for modeling object boundaries in 1988. Since then, a substantial number of algorithms have been suggested in the literature for active contour modeling (Amini et al., 1991; Cohen, 1991; Malladi et al., 1995; Caselles et al., 1993; Xu and Prince, 1997; Cho et al., 2001; Lam and Yan, 1994).
*
Corresponding author. E-mail addresses:
[email protected] (H. Shah-Hosseini),
[email protected] (R. Safabakhsh).
An ACM algorithm takes an initial contour defined for an object boundary and modifies it until the contour satisfactorily approximates the object boundary. The initial contour is a rough approximation and the final contour is an accurate representation of the object boundary. ACM can be achieved by introducing an energy functional, and minimizing that functional (Kass et al., 1988). A problem with the minimization methods is that they may get stuck in local minima. Moreover, the methods usually fail to fully model the concavities of the object boundary. There are methods that use geometric techniques for ACM (Malladi et al., 1995; Caselles et al., 1993). One major disadvantage of these methods is that the direction of movement of the contour
0167-8655/03/$ - see front matter Ó 2002 Elsevier Science B.V. All rights reserved. PII: S 0 1 6 7 - 8 6 5 5 ( 0 2 ) 0 0 3 7 7 - X
1362
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
must be given to the algorithm in advance. Another problem is that the initial contour must fully be inside or outside the object boundary. Modeling contours of objects using self-organizing map (SOM) based networks has also been introduced in the literature (Abrantes and Marques, 1996). The simplest case is to use the batch mode of training for an SOM network whose neurons form a closed chain in the lattice. After the weights of the neurons converge, the concatenation of line segments between every two adjacent neurons constitutes the desired contour of the object. Here, the input data are usually the twodimensional coordinates of the feature points of the object. These feature points are often the edges of the object, which are detected by some suitable edge detection algorithm (Parker, 1997). Some other modifications in SOM training are also necessary as explained in (Abrantes and Marques, 1996). The disadvantage of using the batch SOM is that due to its simplicity, it can be used only for simple objects. A more recent modification of the SOM algorithm for active contour modeling has been introduced in (Venkatesh and Rishikesh, 2000). The method uses a modified SOM algorithm with a fixed number of neurons and a chain topology, which can be used for open and closed contours. But the algorithm requires that the initial contour be close to the object boundary, and the number of points on the contour remains fixed. These points are the image pixels that intersect with the initial contour. Placing this large number of points on the contour slows down the convergence of the algorithm. However, the method converges to the correct solutions for the examples used in the experiments. A problem with implementing contour modeling through basic SOM-based networks is that some parts of the initial contour might be closer to the feature points of the object than the other parts. Using the basic SOM training in such cases makes the contour folded, or some parts of the contour never approach the feature points of the object, especially when the object boundary includes concave segments. Non-uniform spread of control points on the contour is another problem that occurs in the contour modeling algorithms
which keep the number of control points on the contour fixed including those based on the basic SOM networks. Time adaptive self-organizing map (TASOM) networks are modified forms of the SOM networks. Similar to the SOM networks, a TASOM network is composed of two layers: an input layer receiving the input vectors, and an output layer encompassing the neurons of the network. There is an individual learning rate and neighborhood function for each neuron of the TASOM, which are updated with the incoming input vectors. In contrast, the SOM has a time decreasing learning rate and neighborhood function which are common to all neurons. Since neurons move toward input data according to the weight updating rule used in TASOM, which is the same as the one used in SOM, the algorithm always converges. When neurons come close to the input data, the learning parameters of TASOM decrease. This guarantees the stability of the algorithm. At first, it might seem that using individual learning rates and neighborhood functions will make the algorithm slow. It is true that each iteration of the TASOM algorithm takes more time than that of the basic SOM; but the number of iterations needed for convergence of the TASOM algorithm is much smaller than that of the basic SOM. This capability comes from the dynamic updating of the learning rates and neighborhood functions. When the input data are far from the TASOM weights, the learning rates and neighborhood functions increase, resulting in faster movement of the weights toward the input data. The learning rates and neighborhood functions decrease when the weights come close to the input data in order to let the weights better approximate the input distribution. A mathematical discussion on TASOM is given in (Shah-Hosseini and Safabakhsh, in press). Due to the environment-dependent learning parameters of the TASOM networks, they are utilized in both stationary and non-stationary environments (Shah-Hosseini and Safabakhsh, 2000a,b). The TASOM networks have been used for bilevel thresholding (Shah-Hosseini and Safabakhsh, 2000a), adaptive pattern classification (Shah-Hosseini and Safabakhsh, 2000c), quadra-
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
ture amplitude modulation (Shah-Hosseini and Safabakhsh, 2001a), and adaptive principal component analysis (Shah-Hosseini and Safabakhsh, 2001b). In this paper, we propose an ACM algorithm using a TASOM network. Next section introduces the proposed TASOM-based ACM algorithm. Experimental results obtained by the proposed algorithm are presented in Section 3. For comparison, the method of Venkatesh and Rishikesh (2000) is also implemented in this section. Section 4 contains the concluding remarks.
2. The proposed TASOM-based ACM algorithm Some interesting properties of the TASOM networks make them a good choice for use in ACM. One property of the TASOM is that it uses individual learning rate and neighborhood function for each neuron of the lattice (the output layer). This makes TASOM more flexible in approximating the input distribution. Another property of the TASOM networks is that they use time-independent learning rates and neighborhood functions, which are updated on the basis of the environment conditions in each iteration of the TASOM learning algorithm. Thus, the TASOM overcomes the problems caused by using timedecreasing learning rates and neighborhood functions in SOM networks. The learning rate and neighborhood function of the basic SOM are at their highest values at the beginning of learning. Then, they decrease with time so that the feature map stabilizes and learns the topographic map of the environment. This is, in fact, the reason why the basic SOM cannot work in non-stationary environments. Another problem is that neuron addition or deletion cannot be implemented in the basic SOM. The TASOM can continuously learn and follow environment changes. This feature makes the TASOM less sensitive to the values of its constant parameters and suitable for use in non-stationary environments. It also makes neuron addition and deletion easy to implement. Neuron addition or deletion is especially necessary when the TASOM network is used for ACM.
1363
Another interesting property of the TASOM is that although it is more complex than the SOM network, it converges faster than the SOM algorithm. It has been shown (Shah-Hosseini and Safabakhsh, in press) that between the computational complexity of the basic SOM, o(SOM), and that of the TASOM, o(TASOM), the following relation approximately exists: oðTASOMÞ ¼ ð4=3ÞoðSOMÞ
ð1Þ
However, the convergence speed of TASOM in input approximation is much higher. As shown in (Shah-Hosseini and Safabakhsh, 2002), the SOM needs at least five times more input vectors (epochs) than TASOM for convergence. So, the relative convergence time of the TASOM to that of the SOM will be ð4=15Þ 0:267. However, this is not a fixed relation and may be different for different applications. For example, for pattern classification, SOM sometimes needs eight times more input data than the TASOM, as shown in (Shah-Hosseini and Safabakhsh, 2000c). 2.1. The idea behind the proposed algorithm The TASOM-based ACM algorithm uses a TASOM network with a chain topology. This chain of neurons may be closed or open, depending on the shape of the object boundary. For an open boundary, the open topology and for a closed boundary, the closed topology is used. The boundary of an object is modeled by a sequence of N control points ðp1 ; p2 ; . . . ; pN Þ. The object boundary is thus approximated by the line segments joining the consecutive control points pj and pjþ1 . For an object with a closed boundary, the line segment between the first and the last control points, p1 and pN , is also included. An abstract form of the proposed algorithm can be summarized in the following six stages: (a) Weight initialization: for all j, we set wj pj . (b) Weight modification: weights wj are trained by the TASOM algorithm using the feature points x 2 fx1 ; x2 ; . . . ; xK g. (c) Contour updating: for all j, we update pj as follows:
1364
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
pj
pj þ Dpj
ð2Þ
q ðwj pj Þ kwj pj k
ð3Þ
and Dpj ¼
where q is a scalar quantity, and k k is the Euclidean norm. (d) Weight updating: for all j, we set: wj pj . (e) Neuron addition or deletion to the TASOM network. (f) Going to step (b) until some stopping criterion is satisfied. It is assumed that the initial contour is given by a user through the selection of a number of control points inside or outside the object boundary. Stage (a) of the method uses the initial control points as the initial weight vectors of a TASOM network. These weight vectors wj are modified by the TASOM algorithm in stage (b). The input data, which are used for weight modification, are included in the feature point set fx1 ; x2 ; . . . ; xK g of the object. In this paper, the edge points of the object boundary are used as the feature points. Each neuron j of the TASOM network has two special parameters, closeness flag cfðjÞ and influence radius irðjÞ, which are also updated in stage (b) using the feature points. The closeness flag indicates whether the neuron is close enough to the object boundary. To determine the desired closeness, a parameter named closeness distance, dxw , is defined. The neuron j with the weight vector wj is defined to be close enough to the object boundary if dðxk ; wj Þ < dxw , where dð:; :Þ is the Euclidean distance function and xk is a feature point. In this case, we set cfðjÞ true and irðjÞ rmin . Otherwise, for the other neurons i, we set cfðiÞ false and irðiÞ rmax . Here, rmax > rmin > 0 and dxw > 0. By doing this, the neurons far from the object boundary are allowed to compete for a large set of the feature points, while the neurons near the boundary are restricted to compete for a smaller set of the feature points. After each complete pass or epoch over all the feature points, the control points pj are updated by the weight vectors wj as specified in stage (c). The control points pj move with a constant speed q
equal to qmin or qmax in the direction of their corresponding weight vectors wj , as formulated in Eqs. (2) and (3). Here, the speed refers to the amount of displacement of a control point from one epoch of training to the next. For the speed parameters, qmax > qmin P 0. The speed parameter qmin is used when cfðjÞ ¼ true; otherwise, the speed parameter qmax is used. The parameter qmin should be very small, preferably close to zero, whereas qmax should be chosen close to one. Large values for qmax may cause thin boundaries of the object to be crossed and unsatisfactory performance result. In stage (d), the weight vectors wj are updated by their corresponding control points pj . In stage (e), any unused neurons are identified and deleted from the TASOM network. These are the neurons that have not won any competition during the complete pass over the feature points. Any two close adjacent neurons j and j þ 1 are replaced by one neuron if dðwj ; wjþ1 Þ < #l . On the other hand, a new neuron is inserted between any two distant adjacent neurons j and j þ 1 if dðwj ; wjþ1 Þ > #h . The two constant parameters #l and #h determine the accuracy of the TASOM network in approximating the object boundary. Choosing small values for the mentioned parameters produces accurate contours. It should be noted that #h > #l P 0. It is reminded that since the weights in the TASOM algorithm always move toward the boundary, the weights finally reach the boundary and thus converge. Neuron addition or deletion has no effect on convergence. In the final stage of the algorithm, stage (f), the whole process is repeated by going to stage (b) unless two conditions are satisfied. The first condition is that no new neuron has been added to the TASOM network during the last epoch. The second condition is that for all j, cfðjÞ is true. The first condition is for uniform spread of control points over the final contour such that the desired accuracy in object boundary approximation is achieved. The second condition requires that all neurons be close enough to the object boundary as desired. 2.2. The complete proposed ACM algorithm In this section, the proposed ACM algorithm is presented in 13 steps. The first five steps are exe-
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
cuted once. The remaining steps are sequentially executed until the stopping criterion is satisfied. Step (7) of the ACM algorithm is devoted to the training of the TASOM network employed in the proposed algorithm. This step itself is composed of five sub-steps. The proposed TASOM-based ACM algorithm is specifically explained in the following steps: (1) The constant parameters #l and #h control the lowest and highest allowed distances between any two adjacent neurons, respectively. Moreover, the closeness distance parameter dxw represents the desired closeness of neurons to the feature points of the image. The speed parameters qmin and qmax are used for controlling the movement speed of the control points toward the object boundary. The influence radius parameters rmin and rmax are used for setting the influence radius of each neuron. In this paper, dxw ¼ 1, qmin ¼ 0:01, qmax ¼ 1, rmin ¼ 5, rmax ¼ þ1. The values of #l and #h depend on the size of object and the required accuracy. (2) The initial contour is represented by a number of control points ðp1 ; p2 ; . . . ; pN Þ. (3) The set of feature points X ¼ fx1 ; x2 ; . . . ; xK g of the image is extracted. (4) A TASOM network with an open or closed chain topology of neurons j with weights wj is constructed. The number of neurons is set equal to the number of the control points on the initial contour. Now, we initialize the weights wj by the feature points pj : ðw1 ; w2 ; . . . ; wN Þ
ðp1 ; p2 ; . . . ; pN Þ
ð4Þ
(5) The initial parameters of the TASOM network are chosen appropriately: the learning-rate parameters gj ð0Þ are initialized with values close to one. The scaling value slð0Þ should be set to some positive value, preferably one. The parameters Ek ð0Þ and E2k ð0Þ may be initialized with some small random values. Neighboring neurons of any neuron j in a lattice are included in the set NHj . To have a closed topology on the lattice, for any neuron j, we set NHj ¼ fj 1; j þ 1g, where NH1 ¼ fN ; 2g and NHN ¼ fN 1; 1g. For an open topology, the set NHj is defined as before, but the other two sets are defined as NH1 ¼ f2g and NHN ¼ fN 1g.
1365
(6) For all neurons j, we set cfðjÞ false and irðjÞ rmax . (7) For each feature point xk 2 X , we update the closeness flag cfðjÞ and influence radius irðjÞ of each neuron j having the weight vector wj : cfðjÞ true if dðxk ; wj Þ 6 dxw then we set irðjÞ rmin ð5Þ (8) The feature points xk 2 X of the image are used to train the TASOM weights wj : (8.1) For the current input vector (feature point) xk , the winning neuron iðxk Þ is found: iðxk Þ ¼ arg minfdðxk ; wj ðnÞÞj j
where dðxk ; wj ðnÞÞ 6 irðjÞg
ð6Þ
and j ¼ 1; 2; . . . ; N . (8.2) Adjust the neighborhood width ri ðnÞ of the winning neuron iðxÞ by the following equation: ri ðn þ 1Þ ¼ ð1 bÞri ðnÞ þ bg
X 1 kwi ðnÞ wj ðnÞk sg slðnÞ jNHi jj2NHi
!
ð7Þ
where the function j j gives the cardinality of a set. The neighborhood widths of the other neurons do not change. The parameter b is a constant value between zero and one which controls how fast the neighborhood widths should follow the normalized neighborhood errors. Here, the selected value for b is equal to 0.1. The parameter sg is a positive constant, which is used in gð Þ for controlling its slope. Function gð Þ is used for normalization of the weight distances which is a scalar function such that ðdgðzÞ=dzÞ P 0 for z > 0, and for one-dimensional lattices of N neurons gð0Þ ¼ 0 and 0 6 gðzÞ < N . The function used for gðzÞ in this paper is gðzÞ ¼ ðN 1Þðz=1 þ zÞ. (8.3) Adjust the learning-rate parameters gj ðnÞ of all neurons j in TASOM by: gj ðn þ 1Þ ¼ ð1 aÞgj ðnÞ 1 þ af kxk wj ðnÞk for all j sf slðnÞ ð8Þ
1366
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
The parameter a is a constant value between zero and one which controls how fast the learning rates should follow the normalized learning rate errors. Here, the selected value for a is equal to 0.1. The parameter sf is a positive constant, which is used in f ð Þ for controlling its slope. Function f ð Þ is used for normalization of the distance between the weight and input vectors, and is a monotonically increasing scalar function such that for each positive z we have 0 < f ðzÞ 6 1 and f ð0Þ ¼ 0. The function used for f ðzÞ here is f ðzÞ ¼ ðz=1 þ zÞ. It should be noted that the forms of the two functions f ð Þ and gð Þ can be different and their choice is deliberate as long as the properties stated for these functions exist. (8.4) Adjust the weights of all neurons in the TASOM network: wj ðn þ 1Þ ¼ wj ðnÞ þ gj ðn þ 1Þhj;i ðn þ 1Þ ðxðnÞ wj ðnÞÞ for all j
ð9Þ
where index i stands for the winning neuron and index j stands for other neurons of the network. The Gaussian neighborhood function hj;i ðnÞ ¼ 2 expððdj;i =r2i ðnÞÞÞ is centered at the winning neuron i. The distance between neurons j and i, de2 noted by dj;i , is calculated in the lattice space. For the closed topology on the lattice, we define dj;i ¼ minðkj ik; N kj ikÞ. For the open topology, 2 we define dj;i ¼ kj ik2 . Here, since the neurons are indexed by scalar values, the Euclidean norm k k can be replaced by the absolute norm. (8.5) Update the scaling value slðn þ 1Þ so that it incrementally estimates the standard deviation or the diameter of the input distribution using equation: ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi rX slðn þ 1Þ ¼ sl ðn þ 1Þ ð10Þ l
where sl ðnþ1Þ ¼ ðE2l ðnþ1ÞEl ðnþ1Þ2 Þþ , E2l ðnþ 1Þ ¼ E2l ðnÞþas ðx2k;l ðnÞE2l ðnÞÞ, El ðnþ1Þ ¼ El ðnÞþ bs ðxk;l ðnÞEl ðnÞÞ, and l ¼ 1;2. The function ðzÞþ ¼ maxðz;0Þ. Here, the selected values for the parameters as and bs are equal to 0.01. The parameters El ðnÞ and E2l ðnÞ incrementally approximate Eðxk;l Þ and Eðx2k;l Þ, respectively; with more emphasis on the recent input data. Eð Þ represents the statistical expectation. The scaling value slðnÞ is used in Eqs.
(7) and (8) to make the TASOM network invariant to scaling transformations. (9) Contour Updating: After one epoch training of TASOM by the feature points, the control points pj 2 fp1 ; p2 ; . . . ; pN g are updated: ! 8 w p > j j > > pj þ qmin if cfðjÞ is true > < kwj pj k ! pj ¼ > wj pj > > > pj þ qmax else : kwj pj k ð11Þ (10) The weights wj are updated by the control points pj . Specifically, for all neurons j, wj pj . (11) Any neuron not used during each epoch of training on X is identified and is deleted from the TASOM network. However, neuron deletion should be avoided for the first several epochs, especially when the initial contour has very few control points. In this paper, this step starts after the third epoch of training. (12) Between any two adjacent neurons j and j þ 1, a new neuron k is inserted if dðwj ; wjþ1 Þ > #h , such that: wj þ wjþ1 rj þ ojþ1 ; rk ¼ ; 2 2 gj þ gjþ1 and gk ¼ 2
wk ¼
ð12Þ
(13) Any two adjacent neurons j and j þ 1 are replaced by a new neuron k if dðwj ; wjþ1 Þ < #l . The weight vector and learning parameters of neuron k are obtained as specified in Eq. (12). (14) If no new neuron is added to the TASOM network, and all the closeness flags cfðjÞ of neurons j are true, the desired contour is obtained by concatenating the control points pj ; otherwise, for all neurons j, pj wj . Then, training is continued by going to step (6). Determination of the constant parameters sf and sg , used in Eqs. (8) and (7) depends on the application for which the TASOM algorithm is employed. Here, they should be tuned for the application using the available object examples. Since the number of feature points may be very large, the parameter sf should be set to a large value to include the effect of all the feature points in the
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
learning of TASOM. The parameter sg controls the smoothing and compactness of the approximated contour. Here we choose sf ¼ 10; 000 and sg ¼ 20.
3. Experimental results In this section, we use the proposed algorithm for active contour modeling. First, several experiments are conducted for closed and open boundaries. Then, some experiments are performed to further evaluate the proposed ACM algorithm. 3.1. Closed contour modeling To model the closed contours as explained in the proposed algorithm, a chain topology in the lattice of the TASOM network is used. The initial contour is selected by a user through selecting some control points inside or outside the object. The first test image contains a snowflake. The edge points of the snowflake are used as the feature points of the image. These points occupy most of the inside and boundary of the snowflake and are detected by an edge detection algorithm. The initial contour is selected outside the snowflake, as shown in Fig. 1(a). This initial contour could not be chosen inside the snowflake since inside the snowflake is full of feature points which prevent any contour modeling algorithm from reaching the boundary of the snowflake. For each epoch on the feature points of the snowflake, the contour obtained by the proposed algorithm for #l ¼ 1 and #h ¼ 3 is shown in Fig. 1(b). The final contour, estimated by the algorithm, is superimposed on the image of snowflake, and is shown in Fig. 1(c). The estimated contour very accurately approximates the boundary of the snowflake. The next experiment uses the star image shown in Fig. 1(d). The initial contour contains four control points selected such that the contour crosses the star. Thus, some parts of the starÕs boundary are inside and some outside the initial contour. The edge points are used by the TASOMbased algorithm for contour modeling of the star image. After each epoch on the feature (edge)
1367
points, the approximated contour for #l ¼ 1 and #h ¼ 3, is shown in Fig. 1(e). The original image, along with the final contour, obtained by the method is shown in Fig. 1(f). Again, the boundary of the object is covered accurately by the approximated final contour. Although the initial contour is selected across the star image, the algorithm finds the boundary and satisfactorily models it. It should be noted that since the initial contour has several intersection points with the boundary, a larger value for the speed parameter qmin is used to allow the neurons located on the feature points to move faster. Here, we set qmin ¼ 0:05. The last experiment of this section uses the horse image shown in Fig. 1(g). The initial contour this time is selected inside the object boundary. Theoretically, it makes no difference for the algorithm whether the initial contour is selected inside or outside the object boundary. However, there are usually some feature points in the feature point set that are not located on the object boundary. These false feature points may hinder the progress of the contour toward the boundary. Selecting the initial contour inside or outside the object boundary depends on where false feature points exist. The initial contour should be chosen on that side of the object boundary for which as it moves toward the boundary, it faces as few false feature points as possible. The feature points may contain some noisy points, too. Thus, they are filtered by a median filter before being used by the algorithm. The intermediate contours obtained after each complete pass over the feature points for #l ¼ 1 and #h ¼ 4, are shown in Fig. 1(h). The final contour and the original horse image are shown in Fig. 1(i). The proposed TASOM-based algorithm is seen to model even complex closed boundaries very accurately. 3.2. Open contour modeling In this section, object images having open boundaries are used to test the proposed algorithm for modeling open contours. The first test image shown in Fig. 2(a) contains the shape of a hand against a dark background. An edge detection algorithm is employed to detect the boundary
1368
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
Fig. 1. The results for closed boundaries obtained by the proposed TASOM-based algorithm. (a) The snowflake image and the initial contour with four control points. (b) and (c) The approximated contours by the algorithm and the final contour, respectively. (d) The star image and the initial contour crossing the star, with four control points. (e) and (f) The approximated contours by the algorithm and the final contour, respectively. (g) The horse image and the initial contour with four control points. (h) and (i) The approximated contours by the algorithm and the final contour, respectively.
points of the hand. These boundary points are the feature points that are used for training the algorithm. For modeling open contours, the algorithm uses a TASOM network having a linear array topology in its lattice, as explained in Section 2. The initial contour for an open boundary can have two or more control points with the property that the first and the last control points must be placed close to the head and tail of the object boundary. The initial contour chosen for the hand is very simple and contains only two control points lo-
cated on the wrist of the hand image as shown by a white line segment in Fig. 2(a). The initial contour, along with the approximated contours obtained after each epoch on the feature points of the hand for #l ¼ 1 and #h ¼ 3, is shown in Fig. 2(b). The contour after each epoch moves closer to the feature points, and gradually covers even the deep concavities of the hand. After the algorithmÕs stopping criteria are satisfied, the final approximated contour is obtained. The final contour, superimposed on the original hand image, is shown
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
1369
Fig. 2. The results for open boundaries obtained by the proposed TASOM-based algorithm. (a) The hand image and the initial contour with two control points. (b) and (c) The approximated contours by the algorithm and the final contour, respectively. (d) The house image and the initial contour with three control points. (e) and (f) The approximated contours by the algorithm and the final contour, respectively. (g) The lion image and the initial contour with four control points. (h) and (i) The approximated contours by the algorithm and the final contour, respectively.
in Fig. 2(c). The resulted contour is quite satisfactory. All the concavities have been modeled while the initial contour was a simple line segment, joining one end of the open boundary to the other end. The next test uses the house image and a simple four-point initial contour shown in Fig. 2(d). The initial contour along with the intermediate contours for #l ¼ 1 and #h ¼ 5 are shown in Fig. 2(e). The final contour and the house image are combined in one image in Fig. 2(f). The result is interesting since the boundary of the house is almost
completely separated from its background by the final contour. The last test image, the lion image, along with the selected initial contour is shown in Fig. 2(g). As before, the initial contour is very simple and composed of only four control points. The proposed algorithm is used for modeling the boundary of the lion and cliff against their background. The contours for #l ¼ 1 and #h ¼ 4, obtained after each complete pass over the feature points of the lion image are shown in Fig. 2(h). The final contour is superimposed on the lion image, and the
1370
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
result is shown in Fig. 2(i). The final contour carefully separates the background from the foreground image while the initial contour was a very rough estimate of this final contour. 3.3. Discussion on the proposed ACM algorithm For the proposed ACM algorithm, the number of epochs on the feature points that is needed for convergence of the contour depends on various factors. It partly depends on the parameters of the algorithm. Specifically, we may say that the speed of convergence inversely depends on the values of qmax , #l , and #h . For example, by increasing the value of #h from 3 to 4, the number of epochs of the proposed algorithm decreases from 85 to 76. There are also other effective factors that are common to all ACM algorithms. The shape and size of the initial contour are such factors. For example, the closer the initial contour to the object boundary, the shorter the convergence time will be. The convergence time is also dependent on the shape and size of the object boundary. For a complex boundary containing long concavities, the convergence will take longer in comparison to a simple object boundary. There are three steps that control the number of neurons in the proposed ACM algorithm. Steps (11) and (13) are for neuron deletion whereas step (12) is for neuron addition. Step (13) of the algorithm checks to assure that the TASOM network does include the necessary number of neurons. It also helps in the uniform spread of the control points on the contour. Using additional neurons will increase the convergence time and will slightly affect the quality of the final contour. Assume that the ellipse image shown in Fig. 3(a) is used as a test image. The initial contour is chosen to be a rectangle with four control points as shown around the ellipse in Fig. 3(a). The proposed algorithm uses this initial contour and tries to model and approximate the ellipse boundary. The contours, from the initial one, intermediate ones, and the final one are shown in Fig. 3(b). The algorithm needs 45 epochs to converge. Now, we use the proposed algorithm with its step (11) eliminated. The algorithm this time needs 1100 epochs to converge to Fig. 3(c). This experiment
clearly shows that step (11) in which unused neurons are removed substantially reduces the convergence time. This effect will be felt more strongly as the initial contour is chosen farther from the object boundary. Step (12) of the algorithm is the only step that may let the number of neurons increase. Without this step, the number of control points (neurons) will always reduce or at best remain constant. The algorithm without step (12) is used for contour modeling of the ellipse image with the initial contour selected as before. The results are shown on Fig. 3(d). As it might be expected, the number of control points are reduced from four to three, and the final contour contains two control points which form a line segment along the long axis of the ellipse. This final contour is obviously far from the desired one. So, step (12) is essential in contour modeling, especially when the initial contour contains few control points and the final contour needs many more control points to model the contour. In Sections 3.1 and 3.2, we see that the proposed ACM algorithm works very well in approximating and modeling contours of different kind of objects. However, it should be mentioned that the ACM algorithm is sensitive to salt and pepper noise. In the presence of such noise, there will be some sparse and false feature points that might hinder the contourÕs moving correctly toward the object boundary. For example, consider the horse image of Fig. 1(g) as the test image. As explained in Section 3.2, the edge points are filtered by the median filter before being used by the algorithm. The median filter removes salt and pepper noise. We intentionally do not apply the median filter to see the effect of false feature (edge) points on the algorithm. The results are shown in Fig. 3(e). Due to presence of some noise, the contour cannot go deep enough into the horseÕs legs. Moreover, the contour is attracted falsely to some feature points inside the horse body. This in fact hinders the contourÕs moving toward the object boundary as desired. In contrast, such problems do not appear in Fig. 1(h). As a result, using an appropriate filter such as the median filter is necessary to reduce the number of false feature points that will finally help the ACM algorithm to better approximate the object boundary. A filter
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
1371
Fig. 3. (a) The ellipse image along with the initial contour composed of four control points. (b) The intermediary contours obtained by the proposed ACM algorithm. (c) The intermediary contours obtained by the proposed algorithm without using step (11). (d) The intermediary contours obtained by the proposed algorithm without using step (12). (e) The intermediary contours obtained by the proposed ACM algorithm for the horse image of Fig. 1(g) when the median filter is not applied on the feature points.
such as the median filter can be used in the edge detection process to improve the results, unless we are sure that the objectÕs image is completely noisefree. It is reminded that a low pass filtering can also be used before the edge detection process to reduce the effect of noise on the ACM algorithm. For comparison, the method of Venkatesh and Rishikesh (2000) is implemented for the horse image of Fig. 1(g), the star image of Fig. 1(d), and the hand image of Fig. 2(a). The initial contours here have the same shapes used for the proposed ACM algorithm but with many more control points. The initial contours for the above images contain 96, 256, and 129 control points, respectively. The results are shown in Fig. 4(a)–(c). The three contours cross themselves, and do not go into concavities of the boundaries. Some neurons also remain far from boundary without being used in the contour modeling. This fact is more obvious in Fig. 4(b) and (c). We know that there is no mechanism for removing unused neurons (control points) in this method. So such problems are unavoidable. Since the method of Venkatesh and Rishikesh needs the initial contour to be close enough to the
object boundary, we select three initial contours close to the boundaries of the images as shown by dot signs in Fig. 4(d)–(f). The initial contours contain 146, 160, and 131 control points, respectively. The results obtained by the method are shown by star signs in Fig. 4(d)–(f). For the horse image, the contour partially crosses over itself; but the final contour is still far from the desired one. Median filtering of the feature points of the horse image is also fulfilled here. For the star image, the final contour correctly models the object boundary and is satisfactory. It must be emphasized that this result was obtained after trying several different initial contours. For the hand image, the final contour does not cross itself, but it incorrectly models the object boundary and cannot cover the concavities of the boundary. The common problem that exists in all the six final contours of Fig. 4 is that the control points are non-uniformly distributed. So, some parts of the boundaries are approximated with high quality whereas the other parts are approximated poorly. This problem happens since the method has no mechanism for controlling the uniformity among the control points of the contour.
1372
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373
Fig. 4. The final contours obtained by the method of Venkatesh and Rishikesh shown by star signs for the horse image, the star image, and the hand image, respectively. The initial contours for (a)–(c) have the same shapes as those used for the proposed algorithm but with much more control points. For (d)–(f), the initial contours are shown by dot signs. The method performs poorly in comparison to the results obtained by the proposed TASOM-based algorithm, shown in Figs. 1 and 2.
In the proposed ACM algorithm, steps (12) and (13) preserve the uniformity of the control points over the contour. Moreover, unused neurons are removed by step (11) of the algorithm. So, the above problems do not appear in the proposed algorithm. It is reminded that the algorithm uses only the directions of the weights of TASOM for contour movement, and the control points move with constant speed. This way the whole part of the contour moves monotonically and no crossing is probable in the contour. Another interesting point in the algorithm is that the control points on the object boundary move very slowly. Thus the contour never crosses the boundary, whereas such crossing is quite probable in the method of Venkatesh and Reishikesh.
4. Conclusion The TASOM networks are modified forms of SOM networks with dynamic learning rates and neighborhood functions. Some interesting properties of the TASOM make it attractive for utilization in active contour modeling. An algorithm
was proposed for this purpose using a TASOM network. Experimental results show that the algorithm can work with different kinds of object boundaries and initial contours while the uniformity of control points over the contour is persevered, and the number of control points is variable. As the experiments show the performance of the TASOM-based method is far superior to that of the SOM-based method. References Abrantes, A.J., Marques, J.S., 1996. A class of constrained clustering algorithms for object boundary extraction. IEEE Trans. Image Process. 5 (11), 1507–1521. Amini, A., Weymouth, T.E., Jain, R.C., 1991. Using dynamic programming for solving variational problems in vision. IEEE Trans. Pattern Anal. Machine Intell. 12 (9), 855–867. Caselles, V., Catte, F., Coll, T., Dibos, F., 1993. A geometric model for active contours. Numerische Mathematik. 66, 1–31. Cho, W.-P., Lam, K.M., Siu, W.-C., 2001. An adaptive active contour model for highly irregular boundaries. Pattern Recognit. 34, 323–331. Cohen, L.D., 1991. On active contour models and balloons. CVGIP: Image understanding 53 (2), 211–218. Kass, M., Witkin, A., Terzopoulos, D., 1988. Snakes: Active contour models. Internat. J. Comput. Vision 1, 321–331.
H. Shah-Hosseini, R. Safabakhsh / Pattern Recognition Letters 24 (2003) 1361–1373 Lam, K.M., Yan, H., 1994. Fast greedy algorithm for active contours. Electron Lett. 30 (1), 21–22. Malladi, R., Sethian, J.A., Vemuri, B.C., 1995. Shape modeling with front propagation: A level set approach. IEEE Trans. Pattern Anal. Machine Intell. 17 (2), 158–175. Parker, J.R., 1997. Algorithms for Image Processing and Computer Vision. John Wiley & Sons, New York. Shah-Hosseini, H., Safabakhsh, R., 2000a. TASOM: The time adaptive self-organizing map. In: Proc. Internat. Conf. on Information Technology: Coding and Computing. IEEE Computer Society Press, Las Vegas, Nevada, pp. 422–427. Shah-Hosseini, H., Safabakhsh, R., 2000b. The time adaptive self-organizing map with neighborhood functions for bilevel thresholding. In: Proc. of AISÕ 2000 Conf., Tucson, Arizona, pp. 123–128. Shah-Hosseini, H., Safabakhsh, R., 2000c. Pattern classification by the time adaptive self-organizing map. In: Proc. of Internat. Conf. on Electronics, Circuits, and Systems. IEEE, Beirut, Lebanon, pp. 495–498.
1373
Shah-Hosseini, H., Safabakhsh, R., 2001a. Automatic adjustment of learning rates of the self-organizing feature map. Scientia Iranica 8 (4), 277–286. Shah-Hosseini, H., Safabakhsh, R., 2001b. TAPCA: Time adaptive self-organizing maps for adaptive principal components analysis. In: Proc. of IEEE International Conf. on Image Processing. Thessaloniki, Greece, pp. 509–512. Shah-Hosseini, H., Safabakhsh, R., 2002. The time adaptive self-organizing map for distribution estimation. Internat. J. Eng. 15 (1), 23–34. Shah-Hosseini, H., Safabakhsh, R., in press. TASOM: A new time adaptive self-organizing map. IEEE Trans. Systems, Man and Cybern., Part B. Venkatesh, Y.N., Rishikesh, N., 2000. Self-organizing neural networks based on spatial isomorphism for active contour modeling. Pattern Recognit. 33 (7), 1239–1250. Xu, C., Prince, J.L., 1997. Gradient vector flow: A new external force for snakes. In: IEEE Proc. Conf. Computer Vision Pattern Recognition. pp. 66–71.