Multi-ellipses detection on images inspired by collective animal behavior
PPlease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Multi-ellipses detection on images inspired by collective animal behavior
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M.
Departamento de Ciencias Computacionales Universidad de Guadalajara, CUCEI Av. Revolución 1500, Guadalajara, Jal, México { erik.cuevas, mauricio.gonzalez }@cucei.udg.mx Abstract
This paper presents a novel and effective technique for extracting multiple ellipses from an image. The approach employs an evolutionary algorithm to mimic the way animals behave collectively assuming the overall detection process as a multi-modal optimization problem. In the algorithm, searcher agents emulate a group of animals that interact to each other using simple biological rules which are modeled as evolutionary operators. In turn, such operators are applied to each agent considering that the complete group has a memory to store optimal solutions (ellipses) seen so-far by applying a competition principle. The detector uses a combination of five edge points as parameters to determine ellipse candidates (possible solutions) while a matching function determines if such ellipse candidates are actually present in the image. Guided by the values of such matching functions, the set of encoded candidate ellipses are evolved through the evolutionary algorithm so that the best candidates can be fitted into the actual ellipses within the image. Just after the optimization process ends, an analysis over the embedded memory is executed in order to find the best obtained solution (the best ellipse) and significant local minima (remaining ellipses). Experimental results over several complex synthetic and natural images have validated the efficiency of the proposed technique regarding accuracy, speed and robustness.
Keywords:
Ellipse Detection, Collective Animal Behavior, Metaheuristic algorithms, Optimization.
1. Introduction
Ellipse is one of the most commonly occurring geometric shapes in real images. Even perfect circles in 3D space are projected into elliptical shapes in the image. Therefore, the extraction of ellipses from images is a key problem in computer vision and pattern recognition. Applications include, among others, human face detection [1], iris recognition [2], driving assistance [3], industrial applications [4] and traffic sign detection [5].
Ellipse detection in real images is an open research problem since long time ago. Several approaches have been proposed which traditionally fall under three categories: Symmetry-based, Hough transform-based (HT) and Random sampling. In symmetry-based detection [5]-[7], the ellipse geometry is taken into account. The most common elements used in ellipse geometry are the ellipse center and axis. Using these elements and edges in the image, the ellipse parameters can be found. Ellipse detection in digital images is commonly solved through the Hough Transform [8]. It works by representing the geometric shape by its set of parameters, then accumulating bins in the quantized parameter space. Peaks in the bins provide the indication of where ellipses may be. Obviously, since the parameters are quantized into discrete bins, the intervals of the bins directly affect the accuracy of the results and the computational effort. Therefore, for fine quantization of the space, the algorithm returns more accurate results, while suffering from large memory loads and expensive computation. In order to overcome such a problem, some other researchers have proposed other ellipse detectors following the Hough transform principles by using random sampling. In random sampling-based approaches [9,10], a bin represents a candidate shape rather than a set of quantized parameters, as in the HT. However, like the HT, random sampling approaches go through an accumulation process for the bins. The bin with the highest score represents the best approximation of an actual ellipse in the target image. McLaughlin’s work [11] shows that a random sampling-based approach produces improvements in accuracy and computational lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications complexity, as well as a reduction in the number of false positives (non existent ellipses), when compared to the original HT and the number of its improved variants. As an alternative to traditional techniques, the problem of ellipse detection has also been handled through optimization methods. In general, they have demonstrated to give better results than those based on the HT and random sampling with respect to accuracy, speed and robustness [12]. Such approaches have produced several robust ellipse detectors using different optimization algorithms such as Genetic algorithms (GA) [13,14] and Particle Swarm Optimization (PSO) [15]. In the detection, the employed optimization algorithms perform well in locating a single optimum (only one shape) but fail to provide multiple solutions. Since extracting multiple ellipses primitives falls into the category of multi-modal optimization, they need to be applied several times in order to extract all the primitives. This entails the removal of detected primitives from the image, one at a time, while iterating, until there are no more candidates left in the image which results in highly time consuming algorithms. Multimodal optimization is used to locate all the optima within the searching space, rather than one and only one optimum, and has been extensively studied by many researchers [16]. Many algorithms based on a large variety of different techniques have been proposed in the literature. Among them, ‘niches and species’, and a fitness sharing method [17] have been introduced to overcome the weakness of traditional evolutionary algorithms for multimodal optimization. Here, a new optimization algorithm based on the collective animal behavior is proposed to solve multimodal problems, and then put into use in the application of multi-ellipse detection. Many studies have been inspired by animal behavior phenomena in order to develop optimization techniques such as the Particle swarm optimization (PSO) algorithm which models the social behavior of bird flocking or fish schooling [18]. In recent years, there have been several attempts to apply the PSO to multi-modal function optimization problems [19,20]. However, the performance of such approaches presents several flaws when it is compared to the other multi-modal metaheuristic counterparts [21]. Recently, the concept of individual-organization [22, 23] has been widely used to understand collective behavior of animals. The central principle of individual-organization is that simple repeated interactions between individuals can produce complex behavioral patterns at group level [22, 24, 25]. Such inspiration comes from behavioral patterns seen in several animal groups, such as ant pheromone trail networks, aggregation of cockroaches and the migration of fish schools, which can be accurately described in terms of individuals following simple sets of rules [26]. Some examples of these rules [25, 27] include keeping current position (or location) for best individuals, local attraction or repulsion, random movements and competition for the space inside of a determined distance. On the other hand, new studies have also shown the existence of collective memory in animal groups [28]-[30]. The presence of such memory establishes that the previous history, of group structure, influences the collective behavior exhibited in future stages. Therefore, according to these new developments, it is possible to model complex collective behaviors by using simple individual rules and configuring a general memory. This paper presents an algorithm for automatic detection of multiple ellipse shapes that considers the overall process as a multi-modal optimization problem. In the detection, the approach employs an evolutionary algorithm based on the way animals behave collectively. In such algorithm, searcher agents emulate a group of animals that interact to each other by simple biological rules which are modeled as evolution operators. Such operators are applied to each agent considering that the complete group has a memory which stores the optimal solutions seen so-far by applying a competition principle. The detector uses a combination of five edge points to determine ellipse candidates (possible solutions). A matching function determines if such ellipse candidates are actually present in the image. Guided by the values of such matching functions, the set of encoded candidate ellipses are evolved through the evolutionary algorithm so that the best candidates can be fitted into the actual ellipse within the image. Following the optimization process, the embedded memory is analyzed in order to find the best ellipse and significant local minima (remaining ellipses). Experimental results over several complex synthetic and natural images have validated the efficiency of the proposed technique regarding accuracy, speed and robustness. lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications The paper is organized as follows: Section 2 provides information regarding the evolutionary algorithm based on the way animals behave collectively. Section 3 depicts the implementation of the proposed ellipse detector. The complete multiple ellipse detection procedure is presented by Section 4. Experimental results for the proposed approach are stated in Section 5 and some relevant conclusions are discussed in Section 6.
2. Collective Animal Behavior Algorithm (CAB)
The CAB algorithm assumes the existence of a set of operations that resembles the interaction rules that model the collective animal behavior. In the approach, each solution within the search space represents an animal position. The “fitness value” refers to the animal dominance with respect to the group. The complete process mimics the collective animal behavior. The approach in this paper implements a memory for storing best solutions (animal positions) mimicking the aforementioned biologic process. Such memory is divided into two different elements, one for maintaining the best locations at each generation ( g M ) and the other for storing the best historical positions during the complete evolutionary process ( h M ). Following other metaheuristic approaches, the CAB algorithm is an iterative process that starts by initializing the population randomly (generated random solutions or animal positions). Then, the following four operations are applied until a termination criterion is met (i.e. the iteration number NI ): 1. Keep the position of the best individuals. 2.
Move from or to nearby neighbors (local attraction and repulsion). 3.
Move randomly. 4.
Compete for the space within a determined distance (update the memory).
The algorithm begins by initializing a set A of p N animal positions ( { , , , } p N = A a a a K ). Each animal position i a is a D -dimensional vector containing parameter values to be optimized. Such values are randomly and uniformly distributed between the pre-specified lower initial parameter bound lowj a and the upper initial parameter bound highj a . , rand(0,1) ( ); low high lowj i j j j a a a a = + (cid:215) -
1, 2, , ; 1, 2, , . p j D i N = = K K (1) with j and i being the parameter and individual indexes respectively. Hence, , j i a is the j th parameter of the i th individual. All the initial positions A are sorted according to the fitness function (dominance) to form a new individual set { , , , } p N = X x x x K , so that we can choose the best B positions and store them in the memory g M and h M . The fact that both memories share the same information is only allowed at this initial stage. lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Analogous to the biological metaphor, this behavioral rule, typical from animal groups, is implemented as an evolutionary operation in our approach. In this operation, the first B elements ( { , , , } B a a a K ), of the new animal position set A , are generated. Such positions are computed by the values contained inside the historical memory h M , considering a slight random perturbation around them. This operation can be modeled as follows: ll h = + a m v (2) where { }
1, 2, , l B ˛ K while lh m represents the l -element of the historical memory h M . v is a random vector with a small enough length. From the biological inspiration, animals experiment a random local attraction or repulsion according to an internal motivation. Therefore, we have implemented new evolutionary operators that mimic such biological pattern. For this operation, a uniform random number m r is generated within the range [0,1]. If m r is less than a threshold H , a determined individual position is moved (attracted or repelled) considering the nearest best historical position within the group (i.e. the nearest position in h M ); otherwise, it goes to the nearest best location within the group for the current generation (i.e. the nearest position in g M ). Therefore such operation can be modeled as follows: ( ) with probability ( ) with probability (1- ) nearesti h ii nearesti g i r Hr H – (cid:215) - = – (cid:215) - x m xa x m x (3) where { }
1, 2, , p i B B N ˛ + + K , nearesth m and nearestg m represent the nearest elements of h M and g M to i x , while r is a random number. Following the biological model, under some probability P , one animal randomly changes its position. Such behavioral rule is implemented considering the next expression: with probability with probability (1- ) i i P P = ra x (4) being { }
1, 2, , p i B B N ˛ + + K and r a random vector defined in the search space. This operator is similar to re-initialize the particle in a random position, as it is done by Eq. (1). Once the operations to keep the position of the best individuals, such as moving from or to nearby neighbors and moving randomly, have all been applied to the all p N animal positions, generating p N new positions, it is necessary to update the memory h M . lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Fig. 1.
Dominance concept as it is presented when two animals confront each other inside of a r distance. The concept of dominance is used to update the memory h M . Animals that interact within a group maintain a minimum distance among them. Such distance r depends on how aggressive an animal behaves [31,32]. Hence, when two animals confront each other inside such distance, the most dominant individual prevails meanwhile the other withdraws. Figure 1 depicts the process. In the proposed algorithm, the historical memory h M is updated considering the following procedure: 1. The elements of h M and g M are merged into U M ( U h g = ¨
M M M ). 2.
Each element iU m of the memory U M is compared pair-wise to remaining memory elements ( { } , , , BU U U - m m m K ). If the distance between both elements is less than r , the element getting a better performance in the fitness function prevails meanwhile the other is removed. 3. From the resulting elements of U M (from step 2), it is selected the B best value to build the new h M . Unsuitable values of r yield a lower convergence rate, a longer computational time, a larger function evaluation number, the convergence to a local maximum or to an unreliable solution. The r value is computed considering the following equation: ( )10 D high lowj jj a aD r = -= (cid:215) (cid:213) (5) where lowj a and highj a represent the pre-specified lower and upper bound of the j -parameter respectively, in an D -dimensional space. The computational procedure for the proposed algorithm can be summarized as follows: Step 1: Set the parameters p N , B , H , P and NI . Step 2: Generate randomly the position set { , , , } p N = A a a a K using Eq.1 Step 3: Sort A according to the objective function (dominance) to build { , , , } p N = X x x x K . r lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Step 4: Choose the first B positions of X and store them into the memory g M . Step 5: Update h M according to Section 2.1.5. (during the first iteration: h g = M M ). Step 6: Generate the first B positions of the new solution set A ( { , , , } B a a a K . Such positions correspond to the elements of h M making a slight random perturbation around them. ll h = + a m v ; being v a random vector of a small enough length. Step 7: Generate the rest of the A elements using the attraction, repulsion and random movements. for i = B +1: p N if ( r < P ) then attraction and repulsion movement { if ( r < H ) then ( ) nearesti i h i r = – (cid:215) - a x m x else if ( ) nearesti i g i r = – (cid:215) - a x m x } else if random movement { i = a r } end for where , , rand(0,1) r r r ˛ Step 8: If NI is completed, the process is finished; otherwise go back to step 3. The best value in h M represents the global solution for the optimization problem.
3. Ellipse detection using CAB
In order to detect ellipse shapes, candidate images must be preprocessed first by the well-known Canny algorithm which yields a single-pixel edge-only image. Then, the ( , ) i i x y coordinates for each edge pixel i p are stored inside the edge vector { } , , , p N P p p p = K , with p N being the total number of edge pixels. Each candidate solution E (ellipse candidate) uses five edge points. Under such representation, edge points are selected following a random positional index within the edge array P . This procedure will encode a candidate solution as the ellipse that passes through five points i p , j p , k p , l p and m p ( { , , , , } i j k l m E p p p p p = ).Thus, by substituting the coordinates of each point of E into Eq. 6, we gather a set of five simultaneous equations which are linear in the five unknown parameters , , , a b c f ¢ ¢ ¢ ¢ and g ¢ . a x h xy b y g x f y c ¢ ¢ ¢ ¢ ¢ ¢+ + + + + = (6) Then, solving the involved parameters and dividing by the constant , c ¢ it yields: lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications ax hxy by gx fy + + + + + = (7) Considering the configuration of the edge points shown by Figure 2, the ellipse center ( , ) x y , the radius maximum ( max r ), the radius minimum ( min r ) and the ellipse orientation ( q ) can be calculated as follows: , hf bgx C -= (8) , gh afy C -= (9) max r C a b R - D= + - (10) min r C a b R - D= + + (11) ha b q = - (12) where ( ) 4 R a b h = - + and C ab h = - (13)
Fig. 2.
Ellipse candidate (individual) built from the combination of points i p , j p , k p , l p and m p . Optimization refers to choosing the best element from one set of available alternatives. In the simplest case, it means to minimize an objective function or error by systematically choosing the values of variables from their valid ranges. In order to calculate the error produced by a candidate solution E , the ellipse coordinates are calculated as a virtual shape which, in turn, must also be validated, i.e. if it really exists in the edge image. The test set is represented by { , , , } s N S s s s = K , where s N are the number of points over which the existence of an edge point, corresponding to E , should be tested. p j ( , ) x y min r max r p i p k p m p l x y q lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications The set S is generated by the Midpoint Ellipse Algorithm (MEA) [33] which is a searching method that seeks required points for drawing an ellipse. Any point ( x , y ) on the boundary of the ellipse with a,h,b,g and f satisfies the equation ( , ) ellipse x y x y f x y r x r y r r @ + - . However, MEA avoids computing square-root calculations by comparing the pixel separation distances. A method for direct distance comparison is to test the halfway position between two pixels (sub-pixel distance) to determine if this midpoint is inside or outside the ellipse boundary. If the point is in the interior of the ellipse, the ellipse function is negative. Thus, if the point is outside the ellipse, the ellipse function is positive. Therefore, the error involved in locating pixel positions using the midpoint test is limited to one-half the pixel separation (sub-pixel precision). To summarize, the relative position of any point ( x , y ) can be determined by checking the sign of the ellipse function: Circle x yf x y x yx y < = > (14) The ellipse-function test in Eq. 14 is applied to mid-positions between pixels nearby the ellipse path at each sampling step. Figure 3a and 4a are shows the midpoint between the two candidate pixels at sampling position. The ellipse is used to divide the quadrants into two regions the limit of the two regions is the point at which the curve has a slope of -1 as shown in Figure 4. (a) (b) Fig. 3 . (a) symmetry of the ellipse: an estimated one octant which belong to the first region where the slope is greater than -1, b) In this region the slope will be less than -1 to complete the octant and continue to calculate the same so the remaining octants. In MEA the computation time is reduced by considering the symmetry of ellipses. Ellipses sections in adjacent octants within one quadrant are symmetric with respect to the dy/dy=-1 line dividing the two octants. These symmetry conditions are illustrated in Figure 4. The algorithm can be considered as the quickest providing a sub-pixel precision [34]. However, in order to protect the MEA operation, it is important to assure that points lying outside the image plane must not be considered in S. k y - k y - k y - k y k y + b x a y a b + - = (1 / 2) k y - k y - k y - k y - k y k y + b x a y a b + - = (1 / 2) k y - k x k x + ( , ) y x ( , ) y x - ( , ) x y - ( , ) x y - - ( , ) y x - - ( , ) y x - ( , ) x y - ( , ) x y k x - k x - k x + k x + k x + k x lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Fig. 4.
Midpoint between candidate pixels at sampling position k x along an elliptical path The objective function J ( E ) represents the matching error produced between the pixels S of the ellipse candidate E and the pixels that actually exist in the edge image, yielding: ( , )( ) 1 Ns v vv
G x yJ E Ns = = - ∑ (15) where ( , ) i i G x y is a function that verifies the pixel existence in ( , ) v v x y , with ( , ) v v x y S ˛ and s N being the number of pixels lying on the perimeter corresponding to E currently under testing. Hence, function ( , ) v v G x y is defined as: v vv v x yG x y = (16) A value of J ( E ) near to zero implies a better response from the “ellipsoid” operator. Figure 5 shows the procedure to evaluate a candidate action E with its representation as a virtual shape S . Figure 5(a) shows the original edge map, while Figure 5(b) presents the virtual shape S representing the individual { , , , , } i j k l m E p p p p p = . In Figure 5(c), the virtual shape S is compared to the original image, point by point, in order to find coincidences between virtual and edge points. The individual has been built from points i p , j p , k p , l p and m p which are shown by Fig. 5(a). The virtual shape S , obtained by MEA, gathers 52 points ( s N = 52) with only 35 of them existing in both images (shown as darker points in Fig. 5(c)) and yielding: ( , ) 35 Ns v vv
G x y = = ∑ , therefore J ( E )=0.327. (a) (b) (c) Fig. 5.
Evaluation of a candidate solution E : the image in (a) shows the original image while (b) presents the generated virtual shape drawn from points i p , j p , k p , l p and m p . The image in (c) shows coincidences between both images which have been marked by darker pixels while the virtual shape is also depicted through a dashed line The implementation of the proposed algorithm can be summarized in the following steps: i p j p k p l p m p lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Step 1: Adjust the algorithm parameters p N , B , H , P and NI . Step 2: Randomly generate a set of candidate ellipses (position of each animal) { , , , } p N E E E = E K set using Eq.1 Step 3: Sort E according to the objective function (dominance) to build { , , , } p N = X x x x K . Step 4: Choose the first B positions of X and store them into the memory g M . Step 5: Update h M according to Section 2.1.5 (during the first iteration: h g = M M ). Step 6: Generate the first B positions of the new solution set E ( { , , , } B E E E K . Such positions correspond to the elements of h M making a slight random perturbation around them. ll h E = + m v ; being v a random vector of a small enough length. Step 7: Generate the rest of the E elements using the attraction, repulsion and random movements. for i = B +1: p N if ( r < P ) then attraction and repulsion movement { if ( r < H ) then ( ) nearesti i h i E r = – (cid:215) - x m x else if ( ) nearesti i g i
E r = – (cid:215) - x m x } else if random movement { i E = r } end for where , , rand(0,1) r r r ˛ Step 8: If NI is completed, the process is finished; otherwise go back to step 3. The best values in h M represents the best solutions (the best found ellipses).
4. The multiple ellipse detection procedure.
Most detectors simply apply a one-minimum optimization algorithm to detect multiple ellipses yielding only one ellipse at a time and repeating the same process several times as previously detected primitives are removed from the image. The algorithm iterates until no more candidates are left in the image. On the other hand, the method at this paper is able to detect single or multiples ellipses through only one optimization step. The multi-detection procedure can be summarized as follows: guided by the values of a matching function, the whole group of encoded candidate ellipses is evolved through the set of evolutionary operators. The best ellipse candidate (global optimum) is considered to be the first detected ellipse over the edge-only image. An analysis of the incorporated historical memory h M is thus executed in order to identify other local optima (other ellipses). In order to find other possible ellipses contained in the image, the historical memory h M is carefully examined. The approach aims to explore all elements, one at a time, assessing which of them represents an actual ellipse in the image. Since several elements can represent the same ellipse (i.e. ellipses slightly shifted or holding small deviations), a distinctiveness factor , A B D is required to measure the mismatch between two given ellipses ( A and B ). Such distinctiveness factor is defined as follows: lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications , 0 0 0 0 min min max max A B A B A B A BA B A B
D x x y y r r r r = - + - + - + - + - q q (17) being ( ) , , ,
A A A A x y r r and A q , the central coordinates, the lengths of the semi-axes and the orientation of the ellipse A E , respectively. Likewise, ( ) , , , B B B B x y r r and B q represent the corresponding parameters of the ellipse B E . One threshold value Th is also calculated to decide whether two ellipses must be considered different or not. Th is computed as: ( ) max max min min / 2 h l h l r r r rTh s - + -= (18) where max max , l h r r and min min , l h r r are the feasible semi-axes ranges and s is a sensitivity parameter. By using a high value for s , two very similar ellipses would be considered different while a smaller value for s would consider them as similar. In this work, after several experiments, the s value has been set to 2. Thus, since the historical memory h M { } , , , B E E E
M M M K groups the elements in descending order according to their fitness values, the first element E M , whose fitness value represents the best value F M , is assigned to the first ellipse. Then, the distinctiveness factor , ( ) E E D M M over the next element E M is evaluated with respect to the prior E M . If , E E
D Th > M M , then E M is considered as a new ellipse otherwise the next element E M is selected. This process is repeated until the fitness value i F M reaches a minimum threshold TH F . According to such threshold, other values above TH F represent individuals (ellipses) that are considered as significant while other values lying below such boundary are considered as false ellipses and hence they are not contained in the image. After several experiments the value of TH F is set to ( /10) F M .
5. Experimental results
Experimental tests have been developed in order to evaluate the performance of the ellipse detector. The experiments address the following tasks: (1) Ellipse localization, (2) Shape discrimination, (3) Ellipse approximation: occluded ellipse and ellipsoidal detection. Table 1 presents the parameters for the CAB algorithm at this work. They have been kept for all test images after being experimentally defined. p N H P B NI
30 0.5 0.1 12 200
Table 1.
CAB detector parameters
The experimental setup includes the use of several synthetic images of 400x300 pixels. All images contain a different amount of ellipsoidal shapes and some have also been contaminated by added noise as to increase lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications the complexity of the localization task. The algorithm is executed over 50 times for each test image, successfully identifying and marking all required ellipse in the image. The detection has proved to be robust to translation and scaling still offering a reasonably low execution time. Figure 6 shows the outcome after applying the algorithm to two images from the experimental set. (a) (b) (c) (d) Fig. 6. Ellipse localization over synthetic images. The image (a) shows the original image while (b) presents the detected ellipses. The image in (c) shows a second image with salt & pepper noise and (d) shows the detected ellipses in red overlay. (a) (b)
Fig. 7. Ellipse detection algorithm over natural images: the image in (a) shows the original image while (b) presents the detected ellipses in a red overlay. lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications This experiment tests the ellipse detection on several real images which contain a different number of ellipse shapes. The image set has been captured by a digital camera in an 8-bit format. Each image is pre-processed by the Canny edge detection algorithm. Figure 7 shows the results after the algorithm CAB has been applied to one image from the experimental set.
This section discusses on the algorithm’s ability to detect elliptical patterns despite some other different shapes being present in the image. Figure 8 shows four shapes in the image of 400x300 pixels. The image has been contaminated by local noise in order to increase the complexity on the localization task. Figure 9 repeats the experiment over a real-life image. (a) (b)
Fig. 8.
Shape discrimination over synthetic images: (a) shows the original image (b) presents the detected ellipse as a red overlay. (a) (b)
Fig 9.
Shape discrimination in real-life images: (a) shows the original image and (b) presents the detected ellipse as an overlay.
The CAB detector algorithm is able to detect occluded or imperfect ellipses as well as partially defined shapes such as arc segments. The relevance of such functionality comes from the fact that imperfect ellipses are lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications commonly found in typical computer vision applications. Since ellipse detection has been considered as an optimization problem, the CAB algorithm allows finding ellipses that may approach a given shape according to fitness values for each candidate. Figure 10(a) shows some examples of ellipse approximation. Likewise, the proposed algorithm is able to find ellipse parameters that better approach an arc or an occluded ellipse. Figure 10(b) and 10(c) show some examples of this functionality. A small value for J ( C ), i.e., near zero, refers to an ellipse while a slightly bigger value accounts for an arc or an occluded circular shape. Such a fact does not represent any problem as ellipses can be shown following the obtained J ( C ) values. (a) (b) (c) Fig. 10
CAB Approximating ellipsoidal shapes and arc detections lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications In order to enhance the performance analysis, the proposed approach is compared to the GA-based algorithm [14] and the RHT [10] method over a common image set. The GA-based algorithm follows the proposal of Yao et al. [14], which considers two different subpopulations (each one of 50 individuals), a crossover probability of 0.55, the mutation probability being 0.10 and the number of elite individuals chosen as 5. The roulette wheel selection and the 1-point crossover operator are also applied. The parameter setup and the fitness function follow the configuration suggested in [14]. Likewise, the RHT method has been implemented as it is described in [10]. Images rarely contain perfectly-shaped ellipses. In order to test the accuracy for a single-ellipse, the detection is challenged by a ground-truth ellipse, which is determined manually from the original edge-map. The parameters ( , , , , ) true true true true true x y r r q of the ground-truth ellipse are computed considering the best fitted ellipse that a human observer can identify through a drawing software (MSPaint©, CorelDraw©, etc). If the parameters of the detected ellipse are defined as , , , D D D D x y r r and D q , then an error score (Es) is defined as follows: ( ) max max min min1 0 0 0 0 2 3 Es= 2 true D true Dtrue D true D true D r r r rP x x y y P P - + - - + - + + - q q (19) The central point difference ( ) true D true D x x y y - + - represents the center shift for the detected ellipse as it is compared to the ground-truth ellipse. The averaged radio mismatch ( ) ( ) max max min min / 2 true D true D r r r r - + - accounts for the difference between their radii. Finally, the angle error ( ) true D θ θ - corresponds to the orientation difference between the ground-truth and detected ellipses. , P P and P represent three weighting parameters, which are applied to the central point difference, to the radius mismatch and to the angle error in order to impose a relative importance in the final error Es. In this study, they are chosen as P P = = and P = . This particular choice ensures that the angle error would be strongly weighted in comparison to the previous terms which account for the difference in the central ellipse positions and the averaged radii differences of manually detected and machine-detected ellipses, respectively. In order to use an error metric for multiple-ellipse detection, the averaged Es resulting from each ellipse in the image, is considered. The multiple error (ME) is thus calculated as follows: NC RR NC = (cid:215) ∑ (20) where NC represents the number of ellipses actually present the image. In case of ME being less than 1, the algorithm is considered successful; otherwise it is said to have failed in the detection of the ellipse set. Notice that for P P = = and P = , an ME<1 is generated accounting for a maximal tolerated average difference for radius (10 pixels long) and a mismatch limit of 5 degrees whereas the maximum average mismatch for the centre location can be up to 20 pixels. In general, the Success Rate (SR) can thus be defined as the percentage of achieving success after a certain number of trials. Fig. 11 and 12 show six images (three synthetic and three natural) that have been used to compare the performance of the GA-based algorithm [14], the RHT method [10] and the proposed approach. The performance is analyzed by considering 35 different executions for each algorithm over six images. Table 2 presents the averaged execution time, the success rate (SR) in percentage and the averaged multiple error (ME). The best entries are bold-cased in Table 2. Closer inspection reveals that the proposed method is able to lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications achieve the highest success rate with the smallest error and still requires less computational time for most cases. Fig. 11 and 12 also exhibit the resulting images after applying the correspondent detector over each image. Such results present the median cases obtained throughout 35 runs. (a) (b) (c) Original images GA-based algorithm
RHT
CAB
Fig. 11.
Synthetic images and their detected ellipses for: GA-based algorithm, the RHT method and the proposed CAB algorithm. lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications (d) (e) (f) Original images GA-based algorithm
RHT
CAB
Fig. 12.
Real-life images and their detected ellipses for: GA-based algorithm, the RHT method and the proposed CAB algorithm. lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications Image Averaged execution time ± Standard deviation (s) Success rate (SR) (%) Averaged ME ± Standard deviation GA RHT CAB GA RHT CAB GA RHT CAB (a) 4.32±(0.81) 2.82±(0.77)
90 100 (b) 6.83±(1.23) 3.75±(0.92)
97 88 (c) 5.28±(0.11) 3.18±(0.89) (d) 7.08±(1.27) 3.82±(0.67)
70 100 (e) 6.83±(1.77) 3.55±(0.54) (f) 6.77±(1.23) 3.88±(0.78)
93 90
Table 2.
The averaged execution-time, success rate and the averaged multiple error for the GA-based algorithm, the RHT method and the proposed CAB algorithm, considering the six test images shown in Fig. 9
In order to statistically analyze the results in Table 2, a non-parametric significance proof known as the Wilcoxon’s rank test [35]-[37] has been conducted. Such proof allows assessing result differences among two related methods. The analysis is performed considering a 5% significance level over multiple error (ME) data. Table 3 reports the p -values produced by Wilcoxon’s test for a pair-wise comparison of the multiple error (ME), considering two groups gathered as CAB vs. GA and CAB vs. RHT. As a null hypothesis, it is assumed that there is no difference between the values of the two algorithms. The alternative hypothesis considers an existent difference between the values of both approaches. All p -values reported in the Table 3 are less than 0.05 (5% significance level) which is a strong evidence against the null hypothesis, indicating that the best CAB mean values for the performance are statistically significant which has not occurred by chance. Image p -Value CAB vs. GA CAB vs. RHT
Synthetic images (a) (b) (c)
Natural Images (a) (b) (c) 1.7201e-004
Table 3. p -values produced by Wilcoxon’s test comparing CAB to GA and RHT over the averaged ME from Table 2. Conclusions
This paper discusses a novel and effective technique for extracting multiple ellipses from an image that considers the overall detection process as a multi-modal optimization problem. In the detection, the approach employs an evolutionary algorithm based on the way animals behave collectively. In such algorithm, searcher agents emulate a group of animals which interact to each other using simple biological rules that are modeled as evolutionary operators. Such operators are applied to each agent considering that the complete group has a memory to store the optimal solutions (ellipses) seen so-far by applying a competition principle. The detector uses a combination of five edge points as parameters to determine ellipse candidates (possible solutions). A matching function determines if such ellipse candidates are actually present in the image. Guided by the values of such matching functions, the set of encoded candidate ellipses are evolved through the evolutionary algorithm so that the best candidates can be fitted into actual ellipses within the image. Just after the optimization process ends, an analysis over the embedded memory is executed in order to find the best obtained solution (the best ellipse) and significant local minima (remaining ellipses). The overall approach lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications generates a fast sub-pixel detector which can effectively identify multiple ellipses in real images despite ellipsoidal objects exhibiting a significant occluded or distorted portion. Classical Hough transform methods for ellipse detection use five edge points to cast a vote for the potential elliptical shape in the parameter space. However, they would require a huge amount of memory and longer computational time to obtain a sub-pixel resolution. Moreover, HT-based methods rarely find a precise parameter set for a given ellipse in the image [38]. In our approach, the detected ellipses hold a sub-pixel accuracy inherited directly from the ellipse equation and the MEA method. In order to test the ellipse detection performance, both its speed and accuracy have been compared. Score functions are defined by Eqs. 19 and 20 in order to measure accuracy and effectively evaluate the mismatch between manually detected and machine-detected ellipses. We have demonstrated that the CAB method outperforms both the GA (as described in [14]) and the RHT (as described in [10]) within a statistically significant framework (Wilcoxon test). References [1] Pietrocew, A. (2003). Face detection in colour images using fuzzy Hough transform. Opto-Electronics Review, 11(3), 247–251. [2] Toennies, K., Behrens, F., & Aurnhammer, M. (2002). Feasibility of Hough-transform based iris localisation for real-time-application. In Proc. of the 16th international conference on pattern recognition. [3] Hardzeyeu, V., & Klefenz, F. (2008). On using the Hough transform for driving assistance applications. In: Proc. of the fourth international conference on intelligent computer communication and processing. [4] C. Teutsch, D. Berndt, E. Trostmann, M. Weber, Real-time detection of elliptic shapes for automated object recognition and object tracking, in: Proceedings of Machine Vision Applications in Industrial Inspection XIV, San Jose, CA, USA, January 2006, pp. 171–179. [5] A. Soetedjo, K. Yamada, Fast and robust traffic sign detection, in: Proceedings of IEEE International Conference on Systems, Man and Cybernetics, Waikoloa, Hawaii, October 2005, pp. 1341–1346. [6] Ho, C-T., & Chen, L-H. (1995). A fast ellipse/circle detector using geometric symmetry. Pattern Recognition, 28(1), 117–124. [7] Kuang Chung Chen, Nizar Bouguila, Djemel Ziou. Quantization-free parameter space reduction in ellipse detection, Expert Systems with Applications 38 (2011) 7622–7632. [8] Hough, P.V.C., 1962. Method and Means for Recognizing Complex Patterns. US Patent 3069654, December 18. [9] Wang, C. M., Hwang, N. C., Tsai, Y. Y., & Chang, C. H. (2004). Ellipse sampling for monte carlo applications. Electronics Letters, 40(1), 21–22. [10] Wei Lu, Jinglu Tan. Detection of incomplete ellipse in images with strong noise by iterative randomized Hough transform (IRHT), Pattern Recognition 41 (2008) 1268 – 1279. [11] McLaughlin RA (1998) Randomized hough transform: improved ellipse detection with comparison. Pattern Recognit Lett 19(3–4):299–305. [12] Ayala-Ramirez, V., Garcia-Capulin, C. H., Perez-Garcia, A. and Sanchez-Yanez, R. E. Circle detection on images using genetic algorithms. Pattern Recognition Letters, 2006, 27, pp. 652–657. lease cite this article as:
Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications [13] Lutton E, Martinez P (1994) A genetic algorithm for the detection of 2D geometric primitives in images. In: Proceedings of the 12th international conference on pattern recognition, Jerusalem, Israel, 9–13 October 1994, 1:526–528. [14] Jie Yao, Nawwaf Kharma, Peter Grogono. A multi-population genetic algorithm for robust and fast ellipse detection, Pattern Anal Applic (2005) 8, 149–162. [15] H.D. Cheng, Yanhui Guo, Yingtao Zhang. A novel Hough transform based on eliminating particle swarm optimization and its applications, Pattern Recognition, 42(9), 2009, 1959-1969. [16] Y.G. Petalas, C.G. Antonopoulos, T.C. Bountis, M.N. Vrahatis, Detecting resonances in conservative maps using evolutionary algorithms, Phys. Lett. A 373 (2009) 334–341. [17] D.E. Goldberg, J. Richardson, Genetic algorithms with sharing for multimodal function optimization, in: Proc. of the Second International Conference on Genetic Algorithms, ICGA, New Jersey, 1987. [18] J. Kennedy, R.C. Eberhart, Particle swarm optimization, in: Proceedings of the 1995 IEEE International Conference on Neural Networks, vol. 4, 1995, pp. 1942–1948. [19] Liang, Jj, Qin, A.K., Suganthan, P.N. Comprehensive learning particle swarm optimizer for global optimization of mult-imodal functions. IEEE Transactions on Evolutionary Computation10(3), (2006), 281–295. [20] Chen, D.B., Zhao, C.X. .Particle swarm optimization with adaptive population size and its application. AppliedSoftComputing9(1), (2009), 39–48. [21] Xu, Q., Lei, W., Si, J. Predication based immune network for multimodal function optimization. Engineering Applications of Artificial Intelligence 23, (2010), 495–504. [22] Sumper D. The principles of collective animal behaviour. Philos Trans R Soc Lond B Biol Sci. 361(1465), 2006, 5–22. [23] Petit, O., Bon, R. Decision-making processes: The case of collective movements. Behavioural Processes 84 (2010) 635–647. [24] Kolpas, A., Moehlis, J., Frewen, T., Kevrekidis, I. Coarse analysis of collective motion with different communication mechanisms. Mathematical Biosciences 214 (2008) 49–57. [25] Couzin, I. Collective cognition in animal groups. Trends in Cognitive Sciences 13(1), (2008) 36–43. [26] Couzin, I.D. and Krause, J. Self-organization and collective behavior in vertebrates. Adv. Stud. Behav. 32, (2003). 1–75. [27] Bode, N, Franks, D., Wood, A. Making noise: Emergent stochasticity in collective motion. Journal of Theoretical Biology 267, (2010), 292–299. [28] Couzi, I., Krause, I., James, R., Ruxton, G., Franks, N. Collective Memory and Spatial Sorting in Animal Groups. J. theor. Biol. (2002) 218, 1–11. [29] Couzin, I.D. Collective minds. Nature 445, (2007), 715-728. [30] Bazazi, S., Buhl, J., Hale, J.J., Anstey, M.L., Sword, G.A., Simpson, S.J., Couzin, I.D. Collective motion and cannibalism in locust migratory bands. Curr. Biol. 18, (2008) 735–739. [31] Hsu, Y., Earley, R., Wolf, L. Modulation of aggressive behaviour by fighting experience: mechanisms and contest outcomes. Biological Reviews 81(1), (2006), 33–74. lease cite this article as: Cuevas, E., González, M., Zaldívar, D., Pérez-Cisneros, M. Multi-ellipses detection on images inspired by collective animal behavior,
Neural Computing and Applications , 24(5), (2014), 1019-1033
This is a preprint copy that has been accepted for publication in Neural Computing and Applications21