Top Banner
Automatic multiple circle detection based on artificial immune systems Erik Cuevas, Valentín Osuna-Enciso, Fernando Wario, Daniel Zaldívar , Marco Pérez-Cisneros Departamento de Ciencias Computacionales, Universidad de Guadalajara, CUCEI, Av. Revolución 1500, Guadalajara, Jal, Mexico article info Keywords: Artificial immune systems Computer vision Circle detection Clonal selection algorithms abstract Hough transform (HT) has been the most common method for circle detection, exhibiting robustness but adversely demanding a considerable computational load and large storage. Alternative approaches for multiple circle detection include heuristic methods built over iterative optimization procedures which confine the search to only one circle per optimization cycle yielding longer execution times. On the other hand, artificial immune systems (AIS) mimic the behavior of the natural immune system for solving com- plex optimization problems. The clonal selection algorithm (CSA) is arguably the most widely employed AIS approach. It is an effective search method which optimizes its response according to the relationship between patterns to be identified, i.e. antigens (Ags) and their feasible solutions also known as antibodies (Abs). Although CSA converges to one global optimum, its incorporated CSA-Memory holds valuable information regarding other local minima which have emerged during the optimization process. Accord- ingly, the detection is considered as a multi-modal optimization problem which supports the detection of multiple circular shapes through only one optimization procedure. The algorithm uses a combination of three non-collinear edge points as parameters to determine circles candidates. A matching function determines if such circle candidates are actually present in the image. Guided by the values of such func- tion, the set of encoded candidate circles are evolved through the CSA so the best candidate (global opti- mum) can fit into an actual circle within the edge map of the image. Once the optimization process has finished, the CSA-Memory is revisited in order to find other local optima representing potential circle candidates. The overall approach is a fast multiple-circle detector despite considering complicated con- ditions in the image. Ó 2011 Elsevier Ltd. All rights reserved. 1. Introduction The problem of detecting circular features holds paramount importance for image analysis, in particular for industrial applica- tions such as automatic inspection of manufactured products and components, aided vectorization of drawings, target detection, etc. (da Fontoura Costa & Marcondes Cesar, 2001). Solving object location challenges is normally approached from two types of tech- niques: deterministic techniques which include the application of Hough transform-based methods (Yuen, Princen, Illingworth, & Kittler, 1990), geometric hashing and template or model matching techniques (Iivarinen, Peura, Sarela, & Visa, 1997; Jones, Princen, Illingworth, & Kittler, 1990). On the other hand, stochastic tech- niques include random sample consensus techniques (Fischer & Bolles, 1981), simulated annealing (Bongiovanni & Crescenzi, 1995) and genetic algorithms (GA) (Roth & Levine, 1994). Template and model matching techniques were the first ap- proaches applied to shape detection. Numerous methods have been developed to solve the shape detection problem (Peura & Iivarinen, 1997). Shape coding techniques and combination of shape properties have been used to represent such objects. The main drawback of such techniques is related to the contour extrac- tion step from real images. Additionally, it is difficult for models to deal with pose invariance except for very simple objects. The circle detection in digital images is commonly implemented by means of the Circular Hough Transform (Muammar & Nixon, 1989). A typical Hough-based approach employs an edge detector and uses edge information to infer locations and radii values. Peak detection is then performed by averaging, filtering and histogram- ming within the transform space. However, such approach requires a large storage space as the 3-D cells include parameters (x, y, r), augmenting the computational complexity and yielding a low pro- cessing speed. The accuracy of the extracted parameters for the de- tected-circle is poor, particularly in presence of noise (Atherton & Kerbyson, 1993). In the particular case of a digital image holding a significant width and height and some densely populated edge pixels, the required processing time for Circular Hough Transform makes it prohibitive for real time applications. Hence new 0957-4174/$ - see front matter Ó 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.eswa.2011.07.063 Corresponding author. Tel.: +52 33 1378 5900x7715. E-mail addresses: [email protected] (E. Cuevas), valentin.osuna@ cucei.udg.mx (V. Osuna-Enciso), [email protected] (F. Wario), daniel. [email protected] (D. Zaldívar), [email protected] (M. Pérez- Cisneros). Expert Systems with Applications 39 (2012) 713–722 Contents lists available at ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa
10

Automatic multiple circle detection based on artificial immune systems

Jan 21, 2023

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automatic multiple circle detection based on artificial immune systems

Expert Systems with Applications 39 (2012) 713–722

Contents lists available at ScienceDirect

Expert Systems with Applications

journal homepage: www.elsevier .com/locate /eswa

Automatic multiple circle detection based on artificial immune systems

Erik Cuevas, Valentín Osuna-Enciso, Fernando Wario, Daniel Zaldívar ⇑, Marco Pérez-CisnerosDepartamento de Ciencias Computacionales, Universidad de Guadalajara, CUCEI, Av. Revolución 1500, Guadalajara, Jal, Mexico

a r t i c l e i n f o

Keywords:Artificial immune systemsComputer visionCircle detectionClonal selection algorithms

0957-4174/$ - see front matter � 2011 Elsevier Ltd. Adoi:10.1016/j.eswa.2011.07.063

⇑ Corresponding author. Tel.: +52 33 1378 5900x77E-mail addresses: [email protected] (E

cucei.udg.mx (V. Osuna-Enciso), fernando.wario@[email protected] (D. Zaldívar), marco.perezCisneros).

a b s t r a c t

Hough transform (HT) has been the most common method for circle detection, exhibiting robustness butadversely demanding a considerable computational load and large storage. Alternative approaches formultiple circle detection include heuristic methods built over iterative optimization procedures whichconfine the search to only one circle per optimization cycle yielding longer execution times. On the otherhand, artificial immune systems (AIS) mimic the behavior of the natural immune system for solving com-plex optimization problems. The clonal selection algorithm (CSA) is arguably the most widely employedAIS approach. It is an effective search method which optimizes its response according to the relationshipbetween patterns to be identified, i.e. antigens (Ags) and their feasible solutions also known as antibodies(Abs). Although CSA converges to one global optimum, its incorporated CSA-Memory holds valuableinformation regarding other local minima which have emerged during the optimization process. Accord-ingly, the detection is considered as a multi-modal optimization problem which supports the detection ofmultiple circular shapes through only one optimization procedure. The algorithm uses a combination ofthree non-collinear edge points as parameters to determine circles candidates. A matching functiondetermines if such circle candidates are actually present in the image. Guided by the values of such func-tion, the set of encoded candidate circles are evolved through the CSA so the best candidate (global opti-mum) can fit into an actual circle within the edge map of the image. Once the optimization process hasfinished, the CSA-Memory is revisited in order to find other local optima representing potential circlecandidates. The overall approach is a fast multiple-circle detector despite considering complicated con-ditions in the image.

� 2011 Elsevier Ltd. All rights reserved.

1. Introduction

The problem of detecting circular features holds paramountimportance for image analysis, in particular for industrial applica-tions such as automatic inspection of manufactured products andcomponents, aided vectorization of drawings, target detection,etc. (da Fontoura Costa & Marcondes Cesar, 2001). Solving objectlocation challenges is normally approached from two types of tech-niques: deterministic techniques which include the application ofHough transform-based methods (Yuen, Princen, Illingworth, &Kittler, 1990), geometric hashing and template or model matchingtechniques (Iivarinen, Peura, Sarela, & Visa, 1997; Jones, Princen,Illingworth, & Kittler, 1990). On the other hand, stochastic tech-niques include random sample consensus techniques (Fischer &Bolles, 1981), simulated annealing (Bongiovanni & Crescenzi,1995) and genetic algorithms (GA) (Roth & Levine, 1994).

ll rights reserved.

15.. Cuevas), [email protected] (F. Wario), [email protected] (M. Pérez-

Template and model matching techniques were the first ap-proaches applied to shape detection. Numerous methods havebeen developed to solve the shape detection problem (Peura &Iivarinen, 1997). Shape coding techniques and combination ofshape properties have been used to represent such objects. Themain drawback of such techniques is related to the contour extrac-tion step from real images. Additionally, it is difficult for models todeal with pose invariance except for very simple objects.

The circle detection in digital images is commonly implementedby means of the Circular Hough Transform (Muammar & Nixon,1989). A typical Hough-based approach employs an edge detectorand uses edge information to infer locations and radii values. Peakdetection is then performed by averaging, filtering and histogram-ming within the transform space. However, such approach requiresa large storage space as the 3-D cells include parameters (x, y, r),augmenting the computational complexity and yielding a low pro-cessing speed. The accuracy of the extracted parameters for the de-tected-circle is poor, particularly in presence of noise (Atherton &Kerbyson, 1993). In the particular case of a digital image holdinga significant width and height and some densely populated edgepixels, the required processing time for Circular Hough Transformmakes it prohibitive for real time applications. Hence new

Page 2: Automatic multiple circle detection based on artificial immune systems

714 E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722

approaches have been proposed on the grounds of the Houghtransform to overcome such a problem yielding the probabilisticHough transform (Shaked, Yaron, & Kiryati, 1996), the randomizedHough transform (RHT) (Xu, Oja, & Kultanen, 1990), thefuzzy Hough transform (Han, Koczy, & Poston, 1993) and someother topics presented by Becker, Grousson, and Coltuc (2002).

As an alternative to Hough transform-based techniques, theproblem of shape recognition in computer vision has also been han-dled through heuristic methods such as the GA-based circle detec-tor presented by Ayala-Ramirez, Garcia-Capulin, Perez-Garcia, andSanchez-Yanez (2006). Their approach is capable of detecting mul-tiple circles over real images but fails frequently to detect imperfectcircles. On the other hand, Dasgupta, Das, Biswas, and Abraham(2009) recently proposed an automatic circle detector using theBacterial Foraging Algorithm (BFAOA) as optimization procedure.However, in case of multiple circle detection both methods employan iterative scheme, executing the algorithm as many times as thenumber of circles to be found. Therefore only one circle can befound at each run yielding algorithms of long execution times.

Biological inspired methods can successfully be transferred intonovel computational paradigms as shown by the successful devel-opment of artificial neural networks, evolutionary algorithms,swarming algorithms and so. The Human Immune System (HIS)is a highly evolved, parallel and distributed adaptive system(Goldsby, Kindt, Kuby, & Osborne, 2003) that exhibits remarkableabilities that can be imported into important aspects in the fieldof computation. This emerging field is known as artificial immunesystems (AIS) (de Castro & Timmis, 2002). The overall computa-tional structure is fully inspired by the immunology theory andits functions, including principles and models. AIS have recentlyreached considerable research interest from different communities(Dasgupta, 2006), focusing on several aspects of optimization, pat-tern recognition, abnormality detection, data analysis and machinelearning. Artificial immune optimization has also been successfullyapplied to tackle numerous challenging optimization problemswith remarkable performance in comparison to other classicaltechniques (Wang, Gao, & Ovaska, 2004).

Clonal selection algorithm (CSA) (de Castro & von Zuben, 2002)is one of the most widely employed AIS approaches. The CSA is arelatively novel evolutionary optimization algorithm which hasbeen built on the basis of the Clonal Selection Principle (CSP)(Ada & Nossal, 1987) of HIS. The CSP explains the immune responsewhen an antigenic pattern is recognized by a given antibody. In theclonal selection algorithm, the antigen (Ag) represents the problemto be optimized and its constraints, while the antibodies (Ab) arethe candidate solutions of the problem. The antibody–antigenaffinity indicates a matching measurement between the solutionand the problem. The algorithm performs the selection ofantibodies based on affinity either by matching a given antigenpattern to an antibody or by evaluating the pattern through anobjective function. Just like the natural immune system whichmemorizes the resulting antibodies after a first infection, the effec-tiveness of the CSA in multi-modal objective functions is achievedby storing some high affinity antibodies in a memory which holdsinformation about the global and local optima. Despite to its sim-ple and straightforward implementation, CSA has been extensivelyemployed in the literature for solving several kinds of challengingengineering problems (see for instance Coello Coello and Cortes(2005), Campelo, Guimaraes, Igarashi, and Ramirez (2005) andWeisheng, Guangming, and Li (2007)).

This paper presents an algorithm for the automatic detection ofmultiple circular shapes from complicated and noisy images withno consideration of the conventional Hough transform principles.As the detection process is considered to be similar to a multi-modal optimization problem, the CSA can be applied to searchthe entire edge-map for circular shapes. The algorithm uses the

combination of three non-collinear edge points as candidate circlesin the edge image of the scene. A matching function is used to mea-sure the existence of a candidate circle (Ab) on the edge map (Ag).Guided by the values of this matching function, the set of encodedcandidate circles are evolved using the CSA so that the bestcandidate (global optimum) can fit into an actual circle withinthe edge map of the image. An analysis of the CSA-Memory, whichhas been obtained after the optimization process, is thus executedin order to find the local optima (other circles). The approachgenerates a fast sub-pixel detector which can effectively identifymultiple circles in real images despite circular objects exhibitinga significant occluded portion. Experimental evidence shows theeffectiveness of the method for detecting circles under various con-ditions. A comparison to one state-of-the-art GA-based method(Ayala-Ramirez et al., 2006) and the BFAOA (Dasgupta et al.,2009) on different images has been included to demonstrate thesuperior performance of the proposed method.

The organization of this paper is as follows: Section 2 provides abrief CSA explanation while Section 3 formulates the CSA methodand its use to detect circles within edge-only images. Section 4 pre-sents the multiple circle detection procedure and its experimentalresults are explained in Section 5. Finally, Section 6 discusses onsome relevant ideas and conclusions.

2. Clonal selection algorithm

In natural immune systems, only the antibodies (Abs) which areable to recognize the intrusive antigens (non-self cells) are to beselected to proliferate by cloning (Goldsby et al., 2003). Therefore,the fundament of the clonal optimization method is that only capa-ble Abs should proliferate. Particularly, the underlying principles ofthe CSA are borrowed from the CSP as follows:

� Maintenance of memory cells which are functionally discon-nected from repertoire,� selection and cloning of most stimulated Abs,� suppression of non-stimulated cells,� affinity maturation and re-selection of clones showing the high-

est affinities, and� mutation rate proportional to Abs affinities.

From immunology concepts, an antigen is any substance thatforces the immune system to produce antibodies against it.Regarding the CSA system, the antigen concept refers to the pend-ing optimization problem which focuses on circle detection. In CSA,B-cells, T-cells and antigen-specific lymphocytes are generallycalled antibodies. An antibody is a representation of a candidatesolution for an antigen, e.g. the prototype circle in this work.A selective mechanism guarantees that all antibodies (solutions)which can effectively recognize an antigen and therefore may actu-ally elicit a response are to be selected holding longer life spans.Therefore such cells are commonly known as memory cells (M).Such analogy is implemented by the CSA through the storing theglobal and local optima of the objective function.

2.1. Definitions

In order to describe the CSA, the notation includes boldfacedcapital letters indicating matrices and boldfaced small letters indi-cating vectors. Some relevant concepts are also revisited below:

(i) Antigen: the problem to be optimized and its constraints(circle detection).

(ii) Antibody: the candidate solutions of the problem (circlecandidates).

Page 3: Automatic multiple circle detection based on artificial immune systems

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

F

α

ρ= 20

ρ= 10

ρ= 5

ρ= 3

Fig. 1. Hypermutation rate versus fitness, considering some size steps.

E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722 715

(iii) Affinity: the objective function measurement for an anti-body (circle matching).

The limited-length character string d is the coding of variablevector x as d = encode(x); and x is called the decoding of antibodyd following x = decode(d).

Set I is called the antibody space namely d 2 I. The antibodypopulation space is thus defined as:

Im ¼ fD : D ¼ ðd1;d2; . . . ;dmÞ; dk 2 I; 1 6 k 6 mg ð1Þ

where the positive integer m is the size of antibody populationD = {d1, d2, . . ., dm} which is an m-dimensional group of antibodyd, being a spot within the antibody space I.

2.2. CSA operators

Following remarks on Chen and Chung (2001), the CSA imple-ments three different operators: the clonal proliferation operator(TC

P), the affinity maturation operator (TAM) and the clonal selection

operator (TCS ). A(k) is the antibody population at time k represent-

ing the set of antibodies a, such as A(k) = {a1(k), a2(k), . . ., an(k)}.The evolution process of CSA can be described as follows:

AðkÞ!TP

C YðkÞ!TA

M ZðkÞ [ AðkÞ!TC

S Aðkþ 1Þ ð2Þ

2.2.1. Clonal proliferation operator (TCP)

Define

YðkÞ ¼ TCPðAðkÞÞ ¼ TC

Pða1ðkÞÞ; TCPða1ðkÞÞ; . . . ; TC

PðanðkÞÞh i

ð3Þ

where YðkÞ ¼ TCPðAðkÞÞ ¼ ei � aiðkÞ i = 1, 2, . . ., n, and ei is a qi-dimen-

sional identity column vector. Function round(x), gets x to the leastinteger bigger than x. There are various methods for calculating qi.At this work, it is calculated as follows:

qiðkÞ ¼ round Nc �FðaiðkÞÞPnj¼1FðajðkÞÞ

" #i ¼ 1;2; . . . ;n ð4Þ

where Nc is called the clonal size. The value of qi(k) is proportionalto the value of F(ai(k)). After clonal proliferation, the populationbecomes

YðkÞ ¼ fY1ðkÞ;Y2ðkÞ; . . . ;YnðkÞg; ð5Þ

where

YiðkÞ ¼ fyijðkÞg ¼ fyi1ðkÞ; yi2ðkÞ; . . . ; yiqiðkÞg and

yijðkÞ ¼ a1ðkÞ; j ¼ 1;2; . . . ; qi; i ¼ 1;2; . . . ;nð6Þ

2.2.2. Affinity maturation operator (TAM)

The operation of affinity maturation relies on hypermutation.Random changes are introduced into the antibodies, just like ithappens in the immune system, under the assumption that suchchanges may lead to an increase on the affinity rate. The hyper-mutation is performed by the operator TA

M which is applied tothe population Y(k) as it is obtained by clonal proliferationZðkÞ ¼ TC

MðYðkÞÞ.The mutation rate is calculated using the following equation (de

Castro & von Zuben, 2002):

a ¼ eð�q�FðabÞÞ ð7Þ

being a the mutation rate and F being the objective function valueof the antibody (ab) which is normalized between [0, 1]. Also q isthe fixed step. In Cutello, Narzisi, Nicosia, and Pavone (2005), it isdemonstrated the importance of including the factor q into Eq. (7)

in order to improve the algorithm’s performance. The way q modi-fies the shape of the mutation rate is shown by Fig. 1.

The number of mutations held by a clone holding an objectivefunction value F, is equal to L � a, considering L as the length ofthe antibody (22 bits in this paper). For the binary encoding, muta-tion operation can be done by simple replacing each gene withinan antibody by its opposite number (i.e. 0–1 or 1–0).

Following the affinity maturation operation, the populationbecomes:

ZðkÞ ¼ fZ1ðkÞ;Z2ðkÞ; . . . ;ZnðkÞgZiðkÞ ¼ fzijðkÞg ¼ fzi1ðkÞ; zi2ðkÞ; . . . ; ziq1

ðkÞg and

zijðkÞ ¼ TAMðyijðkÞÞ; j ¼ 1;2; . . . ; q1 i ¼ 1;2; . . . ;n

ð8Þ

where TAM is the operator as it is defined by Eq. (7) and applied

to the antibody yij.

2.2.3. Clonal selection operator (TCS )

Define 8i ¼ 1;2; . . . ;n, bi(k) 2 Zi(k) as the antibody with thehighest affinity in Zi(k), then aiðkþ 1Þ ¼ TC

SðZiðkÞ [ aiðkÞÞ, whereTC

S is defined as:

TCS ðZiðkÞ [ aiðkÞÞ ¼

biðkÞ if FðaiðkÞÞ < FðbiðkÞÞaiðkÞ if FðaiðkÞÞP FðbiðkÞÞ

�ð9Þ

where i = 1, 2, . . ., n.Each step of the CSA may be defined as follows:

1. Initialize a random population (Pinit) and a set h = Pr + n of can-didate solutions of subsets of memory cells (M) which is addedto the remaining population (Pr). The total population is thusPT = Pr + M with M holding n memory cells.

2. Select the n best individuals of the population PT in order tobuild A(k) according to the affinity measure (objectivefunction).

3. Reproduce (TCP) the population A(k) proportionally to their affin-

ity with respect to the antigen and generate a temporary popu-lation of clones Y(k). The clone number is an increasing functionof the affinity with respect to the antigen (Eq. (4)).

4. Mutate (TAM) the population Y(k) of clones according to the affin-

ity between the antibody and the antigen (Eq. (7)). A maturatedantibody population Z(k) is thus generated.

5. Re-select (TCS ) the best individuals from Z(k) and A(k) to com-

pose a new memory set M = A(k + 1).6. Add random Pr novel antibodies (diversity introduction) to the

new memory cells M to build PT.7. Stop if any criterion is reached, otherwise return to step (2).

Page 4: Automatic multiple circle detection based on artificial immune systems

Pr

M

Select n

Pinit

2

1

5

3

4

6

CPT

A(k)

AMT

Y(k)

Z(k)

A(k+1)

CST

Fig. 2. Basic flow diagram of clonal selection algorithm (CSA).

716 E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722

Fig. 2 shows the full draw of the CSA. The clone number in Step3 is defined according to Eq. (4). Although a unique mutation oper-ator is used in Step 5, the mutated values of individuals are inver-sely proportional to their fitness following Eq. (7), i.e. the more Abshows a better fitness and the less it may change.

The similarity property (Gong, Jiao, & Zhang, 2008) within theAbs can also affect the convergence speed of the CSA. The idea ofthe antibody addition based on the immune network theory isintroduced for providing diversity to the newly generated Abs inM, which may be similar to those already present in the oldmemory M. By holding such a diverse Ab pool, the CSA can avoidbeing trapped into local minima (Gao, Wang, & Ovaska, xxxx),contrasting to well-known genetic algorithms (GA) which usuallytend to bias the whole population of chromosomes towards onlythe best candidate solution (Poli & Langdon, 2002). Therefore, itcan effectively handle challenging multimodal optimization tasks(Tang & Qiu, 2006; Wang, Gao, & Ovaska, 2005; Xu & Zhang,2007; Yoo & Hajela, 1999).

The management of population includes a simple and directsearching algorithm for globally optimal multi-modal functionswhich represents another important difference with respect toother evolutionary algorithms such as GA. The crossover is not re-quired as only cloning and hyper-mutation of individuals areneeded to use affinity as selection mechanism. The CSA is adoptedat this work in order to find the circle parameters (x, y, r) that bet-ter represent the actual circles in the edge-only image.

rip

jp

kp

0 0( , )x y

Fig. 3. Circle candidate (individual) built from the combination of points pi, pj

and pk.

3. Circle detection using CSA

Circles are represented by means of parameters of a well-known second degree equation (see Eq. (10)), that passes throughthree points (Roth & Levine, 1994). The image is preprocessed inadvanced by an edge detection method which uses a single-pixelcontour detector yielding a edge-only image. Such task is accom-plished by the classical Canny algorithm which stores locationsfor each edge point. Such points are the only potential candidatesto define circles by considering triplets. All the edge points in theimage are then stored within a vector array P ¼ fp1; p2; . . . ; pNp

gwith Np as the total number of edge pixels contained in the image.The algorithm stores the (xi, yi) coordinates for each edge pixel pi

within the edge vector.

In order to construct each of the circle candidates (or antibodieswithin the AIS-framework), the indexes i1, i2 and i3 of three non-collinear edge points must be combined, assuming the circle’s con-tour goes through points pi1 ; pi2 ; pi3 . A number of candidate solu-tions are generated randomly for the initial pool. The solutionswill thus evolve through the application of the CSA over the pooluntil a minimum is reached and the best individual is consideredas the solution for the circle detection problem.

The application of classic methods based on Hough Transformfor circle detection would normally require huge amounts of mem-ory and consume large computation time. In order to reach a sub-pixel resolution (just like the method discussed in this paper), theyalso consider three edge points to cast a vote for the correspondingpoint within the parameter space. An evidence-collecting step isalso required as the objective function improves at each generationby discriminating non-plausible circles and locating others byavoiding a visit to other irrelevant image points.

The following discussion clearly explains the required steps toformulate the circle detection task as an AIO optimization problem.

3.1. Individual representation

Each antibody C of the pool uses three edge points as elements.Under such representation, the edge points are stored according toone index that is relative to their position within the edge array P.In turn, the procedure will encode an Ab as the circle that passesthrough three points pi, pj and pk (C = {pi, pj, pk}). Each circle C isrepresented by three parameters: x0, y0 and r, being (x0, y0) the(x, y) coordinates of the center of the circle and r its radius. Theequation of the circle passing through the three edge points canthus be computed as follows:

ðx� x0Þ2 þ ðy� y0Þ2 ¼ r2 ð10Þ

considering

A ¼x2

j þ y2j � ðx2

j þ y2i Þ 2 � ðyj � yiÞ

x2k þ y2

k � ðx2i þ y2

i Þ 2 � ðyk � yiÞ

" #;

B ¼2 � ðxj � xiÞ x2

j þ y2j � ðx2

i þ y2i Þ

2 � ðxk � xiÞ x2k þ y2

k � ðx2i þ y2

i Þ

" #ð11Þ

x0 ¼detðAÞ

4ððxj � xiÞðyk � yiÞ � ðxk � xiÞðyj � yiÞÞ;

y0 ¼detðBÞ

4ððxj � xiÞðyk � yiÞ � ðxk � xiÞðyj � yiÞÞð12Þ

and

r ¼ffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiðx0 � xdÞ2 þ ðy0 � ydÞ

2q

ð13Þ

being det(.) the determinant and d 2 {i, j, k}. Fig. 3 illustrates theparameters defined by Equations (10)–(13).Therefore it is possible

Page 5: Automatic multiple circle detection based on artificial immune systems

E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722 717

to represent the shape parameters (for the circle, [x0, y0, r]) as atransformation R of the edge vector indexes i, j and k

½x0; y0; r� ¼ Rði; j; kÞ ð14Þ

with R being the transformation calculated after the previous com-putations of x0, y0, and r.

By exploring each index as an individual parameter, it is possi-ble to sweep the continuous space looking for the shape parame-ters using the AIO through the CSA. This approach reduces thesearch space by eliminating unfeasible solutions.

3.2. Objective function or matching function

A circumference may be calculated as a virtual shape in order tomeasure the matching factor between C and the presented circle inthe image (antigen). It must be also validated, i.e. if it really existsin the edge image. The test for such points is S ¼ fs1; s2; . . . ; sNsg,with Ns representing the number of test points over which the exis-tence of an edge point will be verified.

The test S is generated by the Midpoint Circle Algorithm (MCA)(Bresenham, 1987) which determines the required points fordrawing a circle considering the radius r and the center point(x0, y0). The MCA employs the circle equation x2 + y2 = r2 with onlythe first octant. It draws a curve starting at point (r, 0) and pro-ceeds upwards-left by using integer additions and subtractions.See full details in Van Aken (1984).

The MCA aims to calculate the points Ns which are required torepresent the circle considering coordinates S ¼ fs1; s2; . . . ; sNsg.Although the algorithm is considered the quickest providing asub-pixel precision, it is important to assure that points lying out-side the image plane must not be considered as they must be in-cluded in Ns, thus protecting the MCA operation.

The matching function (objective function) J(C) represents thematching (or error) resulting from pixels S for the circle candidateand the pixels that actually exist in the edge image, yielding:

JðCÞ ¼ 1�PNs

i¼1Eðxi; yiÞNs

ð15Þ

where E(xi, yi) validates the pixel existence in (xi, yi) and Ns repre-sents the number of pixels lying on the circle’s perimeter that cor-respond to C, currently under testing. Hence, the function E(xi, yi) isdefined as:

Eðxi; yiÞ ¼1 if the pixel ðxi; yiÞ is an edge point0 otherwise

�ð16Þ

The algorithm aims to minimize J(C) considering that a smallervalue implies a better response (matching) of the ‘‘circularity’’operator. The optimization process can thus be stopped after themaximum number of epochs is reached and the individuals areclearly defined satisfying the threshold. However, the stopping cri-terion depends on the a priori knowledge about the applicationcontext.

3.3. Implementation of CSA

In this work, an antibody will be represented (in binary form)by a bit chain of the form:

c ¼ hc1; c2; . . . ; cLi ð17Þ

where c representing a point in an L-dimensional (with L bits) space,

c 2 SL ð18Þ

The CSA implementation can be stated as follows:

1. An original pool of N antibodies is generated, considering thesize of 22 bits.

2. The n best Ab’s are selected based on the matching function.They will represent the memory set.

3. Best Ab’s are cloned.4. Perform hyper-mutation of the cloned Ab’s following the affin-

ity between antibodies and antigens while generating oneimproved antibody pool.

5. From the hyper-mutated pool, the Ab’s with the highest affinityare to be re-selected.

6. As for the original pool, the Ab’s with the lowest affinity arereplaced improving the overall cells set.

Once the above steps are completed, the process re-starts untilone Ab shows the best matching i.e. finding the minimum value ofJ(C). At this work, the algorithm considers three index pointsembedded into a single Ab to represent one circle. Each single in-dex has the variable Pi (with i = 1, 2, 3) representing the Hammingshape-space by means of a 22-bits word over the following range:

Pi : ½1;Np� ð19Þ

considering Np the total number of edge pixels contained in the im-age. Hence, the first step is to generate the initial antibody pool bymeans of:

AB ¼ 2 � �randðN; SpÞ � 1 ð20Þ

where Sp represents the bit size as it is assigned to each of N initialAbs – 22 for this work. In order to perform the mapping from binarystring to base 10, it yields

ðhcL; . . . ; c2; c1iÞ2 ¼X21

i¼0

ci � 2i

!10

¼ r0 ð21Þ

Finding the corresponding real value for r:

r ¼ r0 � rmax

222 � 1ð22Þ

by using rmax to represent Np.

4. The multiple circle detection procedure

The detection of multiple circles on images has followed theoptimization algorithms proposed by Ayala-Ramirez et al. (2006)and Dasgupta et al. (2009), which are capable of finding a circleat a time. However, the proposed method in this paper is able todetect single or multiple circles over a digital image through onlyone optimization procedure. Guided by the values of a matchingfunction (objective function), the set of encoded candidate circlesare evolved using the CSA so that the best candidate can fit intoan actual circle within the edge map of the image. A further anal-ysis on the CSA Memory pool is performed following the end of theoptimization procedure in order to detect other potential circularshapes which are strongly related to previously detected localminima.

The CSA preserves best individuals, holding memory for futureantigenic attacks, mimicking the real natural immune system.The best antibodies have been kept in memory during the algo-rithm’s evolution as they generate optimal (global) or quasi-opti-mal (local) values for the objective function. In order to find theother circles (local minimums contained in the CSA-Memory) a dis-tinctiveness factor Esdi

Dasgupta et al. (2009) to measure the mis-match between two circles is employed. It is defined as follows:

Esdi¼ jxA � xBj þ jyA � yBj þ jrA � rBj ð23Þ

Page 6: Automatic multiple circle detection based on artificial immune systems

718 E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722

being (xA, yA) and rA the center’s coordinates and radius of the circleCA and (xB, yB), rB the corresponding parameters of the circle CB. Athreshold value EsTH is thus calculated to decide whether two circlesmust be considered as different shapes:

EsTH ¼rmax � rmin

sð24Þ

where [rmin, rmax] is the feasible radii’s range and s is a sensitivityparameter. Considering a given high s, two circles which are verysimilar would be considered as different, while a small value for swould consider the two circles very similar.

The multiple circle detection procedure can be summarized inthe following steps:

Table 1Parameter setup for the CSA detector.

h n Nc q Pr L Te s rmin ITER

120 100 100 3 20 20 0.01 8 10 400

Fig. 4. Multiple circle detection. (a) The original image, (b) the edge-map, (c) detectedmatching fitness.

Step 1. The parameter of sensitivity s is set in order to defineEsTH .Step 2. The CSA-Memory is organized in descending orderaccording to their matching fitness.Step 3. The first memory element (the Ab with the highest affin-ity) is assigned as the first circle C1.Step 4. The distinctiveness factor Esdi

of the circle Cm

(m-memory element) with the next highest probability isevaluated with respect to Cm�1. If Esdi

> ESTH , then it is consid-ered Cm as a new circle otherwise, the next memory elementis evaluated.Step 5. The last step is repeated until the whole set of memoryelements has been analyzed.

5. Experimental results

5.1. Parametric setup

Several experimental tests have been developed in order toevaluate the performance of the multiple-circle detector underseveral circumstances.

circles and (d) memory elements organized in descending order according to their

Page 7: Automatic multiple circle detection based on artificial immune systems

E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722 719

Table 1 presents the parameters of the CSA detector which areto be experimentally set. Such values are to be kept for all testimages through all experiments. However the rmax value dependson the image size and it is, therefore computed considering the fol-lowing expression: rmax = min(rows, columns).

All the experiments are performed on a Pentium IV 2.5 GHzcomputer under C language programming. All the images arepreprocessed by the standard Canny edge-detector using theimage-processing toolbox for MATLAB R2008a.

For comparison purposes, the CSA algorithm is tested versus theBFAOA and the GA circle detectors to each image individually.The GA implementation follows the algorithm described byAyala-Ramirez et al. (2006), the population size is 70, the crossoverprobability is 0.55, the mutation probability is 0.10 and number of

Fig. 5. Synthetic images and their detected circles w

elite individuals is 2. The roulette wheel selection and the 1-pointcrossover are both applied. The parameter setup and the fitnessfunction also follow the configuration suggested in Ayala-Ramirezet al. (2006). The BFAOA algorithm follows the implementationfrom Dasgupta et al. (2009), which considers the following exper-imental parameter set: S = 50, Nc = 100, Ns = 4, Ned = 1, Ped = 0.25,dattract = 0.1, wattract = 0.2, wrepellant = 10, hrepellant = 0.1, k ¼ 400 andw = 6.

5.2. Error score and success rate

Images rarely contain perfectly-shaped circles. In order to testaccuracy, the results are compared to the ground-truth circleswhich are manually obtained from the original edge-map. The

hich have been considered by the comparison.

Page 8: Automatic multiple circle detection based on artificial immune systems

Fig. 6. Natural images and their detected circles which have been considered by the algorithm’s comparison.

720 E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722

Page 9: Automatic multiple circle detection based on artificial immune systems

Table 2The averaged execution-time and success rate of the GA-based algorithm, the BFAOA method and the proposed CSA algorithm, considering all six test images shown in Figs. 5and 6.

Image Average time ± standard deviation (s) Success rate (SR) (%) Es ± standard deviation

GA BFAOA CSA GA BFAOA CSA GA BFAOA CSA

Synthetic images(a) 4.18 ± (0.20) 3.40 ± (0.80) 0.22 ± (0.10) 90 100 100 0.77 ± (0.081) 0.62 ± (0.070) 0.40 ± (0.051)(b) 3.15 ± (0.39) 2.80 ± (0.65) 0.36 ± (0.24) 81 95 98 0.62 ± (0.050) 0.45 ± (0.023) 0.37 ± (0.085)(c) 4.21 ± (0.11) 3.18 ± (0.36) 0.20 ± (0.19) 79 91 100 0.60 ± (0.041) 0.57 ± (0.041) 0.31 ± (0.024)

Natural images(a) 6.24 ± (0.51) 4.22 ± (0.52) 1.12 ± (0.37) 89 95 100 0.77 ± (0.031) 0.82 ± (0.043) 0.43 ± (0.055)(b) 6.33 ± (0.34) 4.11 ± (0.14) 1.61 ± (0.17) 87 94 100 0.97 ± (0.055) 1.02 ± (0.136) 0.51 ± (0.041)(c) 7.62 ± (0.97) 5.36 ± (0.17) 1.95 ± (0.41) 88 90 98 1.21 ± (0.102) 1.42 ± (0.155) 0.59 ± (0.073)

E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722 721

parameters (xtrue, ytrue, rtrue) of all testing circles are computedusing Eqs. (10)–(13) for three circumference points from themanually detected circle. If the center and the radius of such circleare successfully found by the algorithm yielding (xD, yD) and rD,then an error score can be defined as follows:

Es ¼ g � ðjxtrue � xDj þ jytrue � yDjÞ þ l � jrtrue � rDj ð25Þ

The first term represents the shift of the center of the detectedcircle as it is compared to the benchmark circle. The second termaccounts for the difference between their radii. g and l are twoweights associated to each term in Eq. (25) and they are chosenaccordingly to agree to the required accuracy as g = 0.05 andl = 0.1. This particular choice of parameters ensures that the radiidifference would be strongly weighted in comparison to the differ-ence of center positions between the manually detected and themachine-detected circles.

If the value Es is less than 1, the algorithm gets a success, other-wise it has failed on detecting the edge-circle. Notice that forg = 0.05 and l = 0.1, it yields Es < 1 which accounts for a maximaltolerated difference on radius length of 10 pixels, whereas themaximum mismatch for the center location can be up to 20 pixels.In general, the success rate (SR) can thus be defined as the percent-age of reaching success after a certain number of trials.

5.3. Presentation of results

The first experiment considers the image shown by Fig. 4a whileFig. 4c exhibits the detected circles. After applying the CSA method,the memory set is organized following a descending order with re-spect to their matching fitness as it is shown by Fig. 4d.

Fig. 5 shows three synthetic images and their results afterapplying the GA-based algorithm (Ayala-Ramirez et al., 2006),the BFAOA (Dasgupta et al., 2009) and the proposed approach.Fig. 6 presents the same experimental results considering threenatural images. The results are averaged over 35 independent runsfor each algorithm. Table 2 shows the averaged execution time, thesuccess rate in percentage, and the averaged error score (Es) fol-lowing Equation (25) for all three algorithms, for all six test imagesshown by Figs. 5 and 6. Only the worst Es values are considered, i.e.the worst mismatch and the best entries are bold-cased in Table 2.A close inspection reveals that the proposed method is able toachieve the highest success rate portraying the smallest error, stillrequiring less computational time for most cases. Fig. 6 also showsthe CSA-Memory organized in descending order according to theirmatching fitness.

6. Conclusions

This paper has presented a method for the automatic detectionof multiple circular shapes over complicated and noisy images

with no consideration of the conventional Hough transformprinciples. As the detection process is considered to be similar toa multi-modal optimization problem, the proposed method is ableto detect single or multiple circles through only one execution ofthe optimization process, clearly contrasting to other heuristiciterative methods. The CSA can thus be applied to search the entireedge-map for circular shapes. The algorithm uses the combinationof three non-collinear edge points as candidate circles in the edgeimage of the scene. A matching function is used to measure theexistence of a candidate circle (Abs) on the edge map (Ags). Guidedby the values of this matching function, the set of encoded candi-date circles are evolved using the CSA so that the best candidatecan fit into an actual circle within the edge map of the image. Ananalysis of the CSA-Memory, which has been obtained after theoptimization process, is thus executed in order to find the localminima (other circles). The approach generates a fast sub-pixeldetector which can effectively identify multiple circles in realimages despite circular objects exhibiting a significant occludedportion. Experimental evidence shows the effectiveness of themethod for detecting circles under various conditions. A compari-son to one state-of-the-art GA-based method (Ayala-Ramirez et al.,2006) and the BFAOA (Dasgupta et al., 2009) on different imageshas been included to demonstrate the performance of the proposedmethod.

Although Hough Transform methods for circle detection alsouse three edge points to cast a vote for a potential circular shape,they require huge amounts of memory and longer computationaltime to obtain a sub-pixel resolution. In the HT-based methods,the parameter space is quantized and the exact parameters for acircle are often not equal to the quantized parameters, thereforeit is rarely able to find the exact parameter set of a circle (Chen& Chung, 2001). The proposed CSA method does not employ thequantization of the parameter space; rather the parameters are di-rectly obtained from Eqs. (10)–(13), still reaching sub-pixelaccuracy.

In order to test the overall performance of the circular detector,its speed and accuracy have been compared through the scorefunction defined by Eq. (25). It can effectively evaluate the mis-match between a manually detected circle and a machine-detectedshape. We have demonstrated that the CSA method outperformsboth the GA (as described in Ayala-Ramirez et al. (2006)) and theBFAOA (as described in Dasgupta et al. (2009)) within a statisticallysignificant framework.

Despite Table 2 indicates that the CSA method can yield betterresults on complicated and noisy images in comparison to the GAand the BFAOA methods, it should be noticed that the paper pur-pose is not intended to beat all the circle detector methods pro-posed earlier, but to show that the CSA algorithm can effectivelyserve as an attractive method to successfully extract circularshapes in images.

Page 10: Automatic multiple circle detection based on artificial immune systems

722 E. Cuevas et al. / Expert Systems with Applications 39 (2012) 713–722

References

Ada, G. L., & Nossal, G. (1987). The clonal selection theory. Scientific American, 257,50–57.

Atherton, T. J., & Kerbyson, D. J. (1993). Using phase to represent radius in thecoherent circle Hough transform. In Proceedings of the IEE colloquium on theHough transform. London: IEE.

Ayala-Ramirez, V., Garcia-Capulin, C. H., Perez-Garcia, A., & Sanchez-Yanez, R. E.(2006). Circle detection on images using genetic algorithms. Pattern RecognitionLetters, 27, 652–657.

Becker, J., Grousson S., & Coltuc D. (2002). From Hough transforms to integraltransforms. In Proceedings of the international geoscience and remote sensingsymposium, 2002 IGARSS_02 (Vol. 3, pp. 1444–1446).

Bongiovanni, G., & Crescenzi, P. (1995). Parallel simulated annealing for shapedetection. Computer Vision and Image Understanding, 61(1), 60–69.

Bresenham, J. E. (1987). A linear algorithm for incremental digital display of circulararcs. Communications of the ACM, 20, 100–106.

Campelo, F., Guimaraes, F. G., Igarashi, H., & Ramirez, J. A. (2005). A clonal selectionalgorithm for optimization in electromagnetics. IEEE Transactions on Magnetics,41, 1736–1739.

Chen, T.-C., & Chung, K.-L. (2001). An efficient randomized algorithm for detectingcircles. Computer Vision and Image Understanding, 83, 172–191.

Coello Coello, C. A., & Cortes, N. C. (2005). Solving multiobjective optimizationproblems using an artificial immune system. Genet. Program. Evolvable Mach., 6,163–190.

Cutello, V., Narzisi, G., Nicosia, G., & Pavone, M. (2005). Clonal selection algorithms:A comparative case study using effective mutation potentials. In C. Jacob et al.(Eds.), ICARIS 2005. LNCS (Vol. 3627, pp. 13–28).

da Fontoura Costa, L., & Marcondes Cesar, R. Jr., (2001). Shape analysis andclassification. Boca Raton, FL: CRC Press.

Dasgupta, D. (2006). Advances in artificial immune systems. IEEE ComputationalIntelligence Magazine, 1(4), 40–49.

Dasgupta, S., Das, S., Biswas, A., & Abraham, A. (2009). Automatic circle detection ondigital images whit an adaptive bacterial forganging algorithm. Soft Computing.doi:10.1007/s00500-009-0508-.

de Castro, L. N., & Timmis, J. (2002). Artificial immune systems: A new computationalintelligence approach. London, UK: Springer.

de Castro, L. N., & von Zuben, F. J. (2002). Learning and optimization using the clonalselection principle [Special issue on artificial immune systems]. IEEETransactions on Evolutionary Computation, 6(3), 239–251.

Fischer, M., & Bolles, R. (1981). Random sample consensus: A paradigm to modelfitting with applications to image analysis and automated cartography. CACM,24(6), 381–395.

Gao, X., Wang, X., & Ovaska, S. Fusion of clonal selection algorithm and differentialevolution method in training cascade-correlation neural network. doi:10.1016/j.neucom.2008.11.004.

Goldsby, G. A., Kindt, T. J., Kuby, J., & Osborne, B. A. (2003). Immunology (5th ed.).New York, NY: Freeman.

Gong, M., Jiao, L., & Zhang, X. (2008). A population-based artificial immune systemfor numerical optimization. Neurocomputing, 72, 149–161.

Han, J. H., Koczy, L. T., & Poston, T. (1993). Fuzzy Hough transform. InProceedings of the 2nd international conference on fuzzy systems (Vol. 2, pp.803–808).

Iivarinen, J., Peura, M., Sarela, J., & Visa, A. (1997). Comparison of combined shapedescriptors for irregular objects. In Proceedings of the 8th British machine visionconference, Cochester, UK (pp. 430–439).

Jones, G., Princen, J., Illingworth, J., & Kittler, J. (1990). Robust estimation ofshape parameters. In Proceedings of the British machine vision conference (pp.43–48).

Muammar, H., & Nixon, M. (1989). Approaches to extending the Hough transform.In Proceedings of the international conference on acoustics, speech and signalprocessing ICASSP_89 (Vol. 3, pp. 1556–1559).

Peura, M., & Iivarinen, J. (1997). Efficiency of simple shape descriptors. In C. Arcelli,L. P. Cordella, & G. S. di Baja (Eds.), Advances in visual form analysis. Singapore:World Scientific (pp. 443–451).

Poli, R., & Langdon, W. B. (2002). Foundations of genetic programming. Berlin,Germany: Springer.

Roth, G., & Levine, M. D. (1994). Geometric primitive extraction using a geneticalgorithm. IEEE Transactions on Pattern Analysis and Machine Intelligence, 16(9),901–905.

Shaked, D., Yaron, O., & Kiryati, N. (1996). Deriving stopping rules for theprobabilistic Hough transform by sequential analysis. Computer Vision andImage Understanding, 63, 512–526.

Tang, T., & Qiu, J. (2006). An improved multimodal artificial immune algorithm andits convergence analysis. In Proceedings of the sixth world congress on intelligentcontrol and automation, Dalian, China, June (pp. 3335–3339).

Van Aken, J. R. (1984). An efficient ellipse drawing algorithm. CG&A, 4(9), 24–35.Wang, X., Gao, X. Z., & Ovaska, S. J. (2004). Artificial immune optimization methods

and applications—A survey. In Proceedings of the IEEE international conference onsystems, man, and cybernetics, The Hague, The Netherlands, October (pp. 3415–3420).

Wang, X., Gao, X. Z., & Ovaska, S. J. (2005). A hybrid optimization algorithm in powerfilter design. In Proceedings of the 31st annual conference of the IEEE industrialelectronics society, Raleigh, NC, November (pp. 1335–1340).

Weisheng, D., Guangming, S., & Li, Z. (2007). Immune memory clonal selectionalgorithms for designing stack filters. Neurocomputing, 70, 777–784.

Xu, X., & Zhang, J. (2007). An improved immune evolutionary algorithm formultimodal function optimization. In Proceedings of the third internationalconference on natural computation, Haikou, China, August (pp. 641–646).

Xu, L., Oja, E., & Kultanen, P. (1990). A new curve detection method: RandomizedHough transform (RHT). Pattern Recognition Letters, 11(5), 331–338.

Yoo, J., & Hajela, P. (1999). Immune network simulations in multicriterion design.Structural Optimization, 18(2-3), 85–94.

Yuen, H., Princen, J., Illingworth, J., & Kittler, J. (1990). Comparative study ofHough transform methods for circle finding. Image and Vision Computing, 8(1),71–77.