Circle detection on images based on the Clonal Selection Algorithm ...

2 downloads 0 Views 827KB Size Report
(AIO) technique, known as the Clonal Selection Algorithm (CSA). The CSA is an effective method for searching and optimising following the Clonal Selection ...
Circle detection on images based on the Clonal Selection Algorithm (CSA) E. Cuevas*1, V. Osuna-Enciso2 and D. Oliva3 Bio-inspired computing has demonstrated to be useful in several application areas. Over the last decade, new bio-inspired algorithms have emerged with applications for detection, optimisation and classification for use in computer vision tasks. On the other hand, automatic circle detection in digital images is considered an important and complex task for the computer vision community. Consequently, a tremendous amount of research has been devoted to find an optimal circle detector. This article presents an algorithm for the automatic detection of circular shapes from complicated and noisy images with no consideration of the conventional Hough transform principles. The proposed algorithm is based on newly developed Artificial Immune Optimisation (AIO) technique, known as the Clonal Selection Algorithm (CSA). The CSA is an effective method for searching and optimising following the Clonal Selection Principle (CSP) in the human immune system which generates a response according to the relationship between antigens (Ags), i.e. patterns to be recognised and antibodies (Abs), i.e. possible solutions. The algorithm uses the encoding of three points as candidate circles (x,y,r) over the edge image. An objective function evaluates if such candidate circles (Ab) are actually present in the edge image (Ag). Guided by the values of this objective function, the set of encoded candidate circles are evolved using the CSA so that they can fit to the actual circles on the edge map of the image. Experimental results over several synthetic as well as natural images with varying range of complexity validate the efficiency of the proposed technique with regard to accuracy, speed and robustness. Keywords: Circle detection, Artificial immune Systems, Artificial immune optimisation, Clonal selection principle, Bio-inspired computing

Introduction Bio-inspired computing1 lies within the realm of Natural Computing, a field of research that is concerned with both the use of biology as an inspiration for solving computational problems and the use of the natural world experiences to solve real world problems. The increasing interest in this field lies in the fact that nowadays the world is facing more and more complex, large, distributed and ill-structured systems, while on the other hand, people notice that the apparently simple structures and organisations in nature are capable of dealing with most complex systems and tasks with ease. Bio-inspired computing has proved to be useful in various application areas. Following features from optimisation, pattern recognition, shape detection and machine learning, the bio-inspired algorithms have

1

Departamento de Electro´nica, Universidad de Guadalajara, CUCEI, Av. Revolucio´n 1500, Guadalajara, Jal, Me´xico Departamento de Ingenierı´as, CUTONALA, Universidad de Guadalajara, Sede Provisional Casa de la Cultura - Administracio´n: Morelos #180, Tonala´, Jalisco, 45400, Me´xico 3 Department of Ingenierı´a del Software e Inteligencia Artificial, Facultad Informa´tica, Universidad Complutense, 28040 Madrid, Spain 2

*Corresponding author, email [email protected]

34

ß 2015 The Royal Photographic Society Received 19 February 2012; accepted 13 June 2014 DOI 10.1179/1743131X14Y.0000000079

recently gained considerable research interest from the computer vision community. Currently, bio-inspired algorithms are widely applied to solve challenging computer vision problems. For instance, Chih-Chih2 has applied the Particle Swarm Optimisation (PSO) algorithm for image segmentation. Le He´garat-Mascle et al.3 proposed a non-stationary Markov model-based image regularisation algorithm, which uses another swarm intelligence algorithm known as Ant Colony Optimisation. Hammouche et al.4 proposed a multilevel method that allows the determination of the appropriate number of thresholds for image segmentation. Such method combines a Genetic Algorithm (GA) with a wavelet transform. More recently, Bas¸tu¨rk and Gu¨nay5 have proposed an image edge detector based on a cellular neural network which is optimised by the Differential Evolution (DE) algorithm. The problem of detecting circular features holds paramount importance for image analysis, in particular for industrial applications, such as automatic inspection of products and components, aided vectorisation of drawings, target detection, etc.6 Many methods have been developed to solve the shape-detection problem.7 Solving the object location is normally approached from two viewpoints: deterministic techniques which include the application of Hough transform,8 geometric

The Imaging Science Journal

2015

VOL

63

NO

1

Cuevas et al.

hashing, template or model matching techniques.9,10 On the other hand, stochastic techniques include random sample consensus,11 simulated annealing12 and GAs.13 Template and model matching techniques are the first approaches to be successfully applied to shape localisation. Shape coding techniques and combination of shape properties are used to represent such objects. The main drawback of these techniques is related to the contour extraction from real images. Additionally, it is difficult for models to deal with pose invariance unless only simple objects are considered. Commonly, circle detection in digital images is performed by means of Circular Hough Transform.14 A typical Hough-based approach employs an edge detector and uses edge information to infer locations and radius values. Peak detection is then applied by averaging, filtering and histogramming the transform space. However, such approach requires a large storage space, given the three-dimensional cells needed to store the parameters (x,y,r), the computational complexity yielding low processing speeds. The accuracy of the detected circle’s parameters is poor, under noisy conditions.15 The required processing time for Circular Hough Transform makes it prohibitive to be deployed in real time applications, in particular for digital images with significant width and height and a densely populated area around edge pixels. In order to overcome such a problem, other researchers have proposed new approaches based on the Hough Transform (HT) such as the probabilistic HT,16,17 the randomised HT (RHT)18 and the fuzzy Hough transform (FHT).19 Lu and Tan20 proposed a novel approach based on RHT called Iterative Randomised Hough Transformation (IRHT) that achieves better results on complex images and noisy environments. The algorithm iteratively applies the RHT to a region of interest in the image which is determined from the latest estimation of ellipse/circle parameters. Shape recognition can also be approached using stochastic search methods such as GA.24 In particular, GA has recently been applied to important shape detection tasks, e.g. Roth and Levine proposed use of GA for primitive extraction of images.21 Lutton et al. developed a further improvement of the aforementioned method.22 Yao et al. came up with a multi-population GA method to detect ellipses.23 In Lu and Tan,20 GA was used for template matching when the pattern has been the subject of an unknown affine transformation. AyalaRamirez et al. presented a GA-based circle detector25 that is capable of detecting multiple circles on real images but it fails frequently when detecting imperfect circles. Recently, Dasgupta et al. in an excellent work26 proposed an automatic circle detector using the Bacterial Foraging Algorithm (BFA) as optimisation method. For the case of ellipsoidal detection, Rosin27 proposed an ellipse fitting algorithm that uses five points. On the other hand, biological inspired methods can successfully be transferred into novel computational paradigms as shown by the successful development of artificial neural networks, evolutionary algorithms, swarming algorithms and so on. The human immune system is a highly evolved, parallel and distributed adaptive system28 that exhibits remarkable abilities that can be imported into important aspects in the field of computation. This emerging field is known as artificial

Circle detection on images based on CSA

immune system (AIS),29 which is a computational system fully inspired by the immunology theory and its functions, including principles and models. AIS have recently reached considerable research interest from different communities,30 focusing on several aspects of optimisation, pattern recognition, abnormality detection, data analysis and machine learning. Artificial immune optimisation (AIO) has been successfully applied to tackle numerous challenging optimisation problems with remarkable performance in comparison to other classical techniques.31 Clonal Selection Algorithm (CSA)32 is one of the most widely employed AIO approaches. The CSA is a relatively novel evolutionary optimisation algorithm which has been built on the basis of the Clonal Selection Principle (CSP)33 of human immune system. The CSP explains the immune response when an antigenic pattern is recognised by a given antibody (Ab). In the clonal selection algorithm, the antigen (Ag) represents the problem to be optimised and its constraints, while the Abs are the candidate solutions of the problem. The Ab– Ag affinity indicates as well the matching between the solution and the problem. The algorithm performs the selection of Abs based on affinity either by matching against an Ag pattern or by evaluating the pattern via an objective function. In mathematical grounds, CSA has the ability of getting out of local minima while simultaneously operating over a pool of points within the search space. It does not use the derivatives or any of its related information as it employs probabilistic transition rules instead of deterministic ones. Although CSA presents several similarities with other evolutionary algorithms such as GA, PSO, DE and BFA, there are some significant differences to be discussed: CSA does not use recombination (crossover) among elements in order to generate new individuals as is done by GA or DE.34 Instead of it, CSA employs a set of mutations applied over multiple copies of the best individuals. CSA does not depend upon the best member within the population in order to control the individual’s motion as is done by PSO;35 it does not also require of all individuals for computing the final fitness value provided by an individual, as is demanded by BFA.36 In contrast, CSA uses a fixed number of elements to produce new potential solutions, contributing towards augmenting the population diversity.37 Different to DE and GA, CSA does not require a stochastic selection operation that allows individuals to access a fair chance of being selected for generating new individuals.34,37 In CSA, such operation is substituted by fixing the number of individuals to be evolved or eliminated. In contrast to the local particle modifications executed by BFA and PSO, CSA employs the mutation operation that tolerate modifications over the full search space for each parameter, avoiding typical oscillations around the optimum produced by BFA.36 The performance of CSA has been compared with other optimisation methods such as GA, DE and PSO.37–39 The results showed that CSA can produce optimal solutions and thus is more effective than other methods in several optimisation problems. Such characteristics have motivated the use of CSA to solve different sorts of engineering problems such as multi-objective optimisation,40 signal processing41 and electromagnetic problems.42 This article presents an algorithm for the automatic detection of circular shapes from complicated and noisy

The Imaging Science Journal

2015

VOL

63

NO

1

35

Cuevas et al.

Circle detection on images based on CSA

images with no consideration of the conventional Hough transform principles. The proposed algorithm is based on a recently developed AIO technique, known as the CSA. The algorithm uses the encoding of three noncollinear edge points as candidate circles (x,y,r) in the edge image of the scene. An objective function evaluates if such candidate circles (Ab) are actually present in the edge image (Ag). Guided by the values of this objective function, the set of encoded candidate circles are evolved using the CSA so that they can fit into the actual circles within the edge map of the image. The approach generates a sub-pixel circle detector, which can effectively identify circles in real images despite circular objects exhibiting a significant occluded portion. Experimental evidence shows the effectiveness of such method for detecting circles under different conditions. Comparison to one state-of-the-art GA-based method19 and a randomised Hough transform approach (IRHT)12 on multiple images demonstrates a better performance of the proposed method. The paper is organised as follows. The section on ‘CSA’ provides a brief CSA explanation. The section on ‘Circle detection using CSA’ formulates the approach and studies the main features of the CSA method as it is used to detect circles in images. The section on ‘Experimental results’ shows the experimental results of applying our method to the recognition of circles in different image conditions. Finally, the section on ‘Conclusions’ discusses several conclusions.

In natural immune systems, only the Abs which are able to recognise the intrusive Ags (non-self cells) are to be selected to proliferate by cloning.28 Therefore, the fundament of the clonal optimisation method is that only capable Abs will proliferate. Particularly, the underlying principles of the CSA are borrowed from the CSP as follows: maintenance of memory cells which are functionally disconnected from repertoire selection and cloning of most stimulated Abs suppression of non-stimulated cells affinity maturation and re-selection of clones showing the highest affinities mutation rate proportional to Abs affinities. From immunology concepts, an Ag is any substance that forces the immune system to produce Abs against it. Regarding the CSA systems, the Ag concept refers to the pending optimisation problem which focuses on circle detection. In CSA, B cells, T cells and Ag-specific lymphocytes are generally called Abs. An Ab is a representation of a candidate solution for an antigen, e.g. the prototype circle in this work. A selective mechanism guarantees that those Abs (solutions) that better recognise the Ag and therefore, may elicit the response, are to be selected holding long life spans. Therefore, such cells are to be named memory cells (M).

N N N N N

Definitions In order to describe the CSA, the notation includes boldfaced capital letters indicating matrices and boldfaced small letters indicating vectors. Some relevant concepts are also revisited below: 1. Ag: the problem to be optimised and its constraints (circle detection).

The Imaging Science Journal

Im ~fD : D~ðd1 , d2 , . . . , dm Þ, dk [I, 1ƒkƒmg (1) where the positive integer m is the size of Ab population D5{d1,d2,…,dm}, which is an m-dimensional group of Ab d, being a spot within the Ab space I.

CSA operators Based on Gong et al.,43 the CSA implements three different operators: the clonal proliferation operator A (TPC ), the affinity maturation operator (TM ) and the C clonal selection operator (TS ). A(k) is the Ab population at time k that represents the set of Abs a, such as A(k)5{a1(k), a2(k),…,an(k)}. The evolution process of CSA can be described as follows: TPC

TA M

TC S

A(k) {? Y(k) {? Z(k)|A(k) {? A(kz1)

(2)

Clonal proliferation operator (TPC )

Define

CSA

36

2. Ab: the candidate solutions of the problem (circle candidates). 3. Affinity: the objective function measurement for an Ab (circle matching). The limited-length character string d is the coding of variable vector x as d5encode(x); and x is called the decoding of Ab d following x5decode(d). Set I is called the Ab space, namely d[I. The Ab population space is thus defined as:

2015

VOL

63

NO

1

  Y(k)~TPC (A(k))~ TPC (a1 (k)), TPC (a1 (k)), . . . , TPC (an (k)) (3) Y(k)~TPC (A(k))~ei :ai (k),

where i51, 2, …, n, and ei is a qi-dimensional identity column vector. Function round(x), gets x to the least integer bigger than x. There are various methods for calculating qi. In this work, it is calculated as follows: " # F (ai (k)) : ði~1, 2, . . . , nÞ (4) qi (k)~round Nc Pn j~1 F (aj (k)) where Nc is called the clonal size. The value of qi(k) is proportional to the value of F(ai(k)). After clonal proliferation, the population becomes Y(k)~fY1 (k), Y2 (k), . . . , Yn (k)g

(5)

where n o n o Yi (k)~ yij (k) ~ yi1 (k), yi2 (k), . . . , yiqi (k) and yij (k)~a1 (k), j~1, 2, . . . , qi , i~1, 2, . . . , n

(6)

A Affinity maturation operator (TM )

The affinity maturation operation is performed by hypermutation. Random changes are introduced into the Abs just like it happens in the immune system. Such changes may lead to increase the affinity. The hypermuA tation is performed by the operator TM which is applied to the population Y(k) as it is obtained by clonal C proliferation Z(k)~TM (Y(k)). The mutation rate is calculated using the following equation:44

Cuevas et al.

Circle detection on images based on CSA

1 Hypermutation rate versus fitness, considering some size steps :

a~eð{r F(ab)Þ

(7)

being a the mutation rate, F being the objective function value of the antibody (ab) as it is normalised within [0, 1] and r being a fixed step. In Cutello et al.,45 it is demonstrated the importance of including the factor r into equation (7) to improve the algorithm performance. The way r modifies the shape of the mutation rate is shown by Fig. 1. The number of mutations held by a clone with objective function value F, is equal to L?a, considering L as the length of the Ab —22 bits are used in this paper. For the binary encoding, mutation operation can be done as follows: each gene within an Ab may be replaced by its opposite number (i.e. 0–1 or 1–0). Following the affinity maturation operation, the population becomes: Z(k)~fZ1 (k), Z2 (k), . . . , Zn (k)g     Zi (k)~ zij (k) ~ zi1 (k), zi2 (k), . . . , ziq1 (k) and A zij (k)~TM (yij (k)), j~1, 2, . . . , q1 , i~1, 2, . . . , n

(8)

A where TM is the operator as it is defined by equation (7) and applied onto the Ab yij.

Clonal selection operator (TSC )

Define ;i51,2,…,n, bi (k)[Zi (k) as the Ab with the highest affinity in Zi(k), then ai (kz1)~TSC (Zi (k) |ai (k)), where TSC is defined as:  bi (k) if F (ai (k))vF (bi (k)) TSC (Zi (k)|ai (k))~ (9) ai (k) if F (ai (k))§F (bi (k)) where i51, 2, …, n Each step of the CSA may be defined as follows: 1. Initialise randomly a population (Pinit), a set h5Przn of candidate solutions of subsets of memory cells (M) which is added to the remaining population (Pr), with the total population being PT5PrzM, with M holding n memory cells. 2. Select the n best individuals of the population PT to build A(k), according to the affinity measure (objective function). 3. Reproduce (TPC ) population A(k) proportionally to their affinity with the Ag and generate a temporary population of clones Y(k). The clone number is an

2 Basic flow (CSA)

diagram

of

Clonal

Selection

Algorithm

increasing function of the affinity with the Ag (equation (4)). A ) the population Y(k) of clones 4. Mutate (TM according to the affinity of the Ab to the Ag (equation (7)). A maturated Ab population Z(k) is thus generated. 5. Re-select (TSC ) the best individuals from Z(k) and A(k) to compose a new memory set M5A(kz1). 6. Add random Pr novel Abs (diversity introduction) to the new memory cells M to build PT. 7. Stop if any criteria are reached, otherwise return to Step 2. Figure 2 shows the full draw of the CSA. The clone number in Step 3 is defined according to equation (4). Although a unique mutation operator is used in Step 5, the mutated values of individuals are inversely proportional to their fitness by means of equation (7), i.e. the more Ab shows a better fitness, the less it may change. The similarity property46 within the Abs can also affect the convergence speed of the CSA. The idea of the Ab addition based on the immune network theory is introduced for providing diversity to the newly generated Abs in M, which may be similar to those already in the old memory M. Holding such a diverse Ab pool, the CSA can avoid being trapped into local minima,47 contrasting to well-known GAs which usually tend to bias the whole population of chromosomes towards only the best candidate solution.48 Therefore, it can effectively handle challenging multimodal optimisation tasks.49–52 The management of population includes a simple and direct searching algorithm for globally optimal multimodal functions. This is also another clear difference in comparison to other evolutionary algorithms, such as GA, because it does not require crossover but only

The Imaging Science Journal

2015

VOL

63

NO

1

37

Cuevas et al.

Circle detection on images based on CSA

The following discussion clearly explains the required steps to formulate the circle detection task just as an AIO problem.

Individual representation Each Ab C of the pool uses three edge points as elements. In this representation, the edge points are stored according to one index that is relative to their position within the edge array P. In turn, the procedure will encode an Ab as the circle that passes through three points pi, pj and pk (C5{pi, pj, pk}). Each circle C is represented by three parameters: x0, y0 and r, being (x0,y0) the (x,y) coordinates of the centre of the circle and r its radius. The equation of the circle passing through the three edge points can thus be computed as follows: ðx{x0 Þ2 zðy{y0 Þ2 ~r2 3 Circle candidate (individual) built from the combination of points pi, pj and pk

cloning and hyper-mutation of individuals in order to use affinity as selection mechanism. The CSA is adopted in this work in order to find the circle parameters (x,y,r) that better represent the actual circles in the image.

38

considering " 2 # xj zy2j {(x2j zy2i ) 2:(yj {yi ) A~ , x2k zy2k {(x2i zy2i ) 2:(yk {yi ) " : # 2 (xj {xi ) x2j zy2j {(x2i zy2i ) B~ 2:(xk {xi ) x2k zy2k {(x2i zy2i ) det(A) , 4((xj {xi )(yk {yi ){(xk {xi )(yj {yi ))

Circle detection using CSA

x0 ~

Circles are represented in this work by means of parameters of a well-known second degree equation (equation (10)), that passes through three points13 in the edge space of the image. Images are preprocessed by an edge detection method which uses a single-pixel contour detector. Such task is accomplished by the classical Canny algorithm which stores locations for each edge point. Therefore, such points are the only potential candidates to define circles by considering triplets. All the edge points in  the image are then stored within a vector array P~ p1 , p2 , . . . , pNp with Np as the total number of edge pixels contained in the image. The algorithm stores the (xi,yi) coordinates for each edge pixel pi in the edge vector. In order to construct each of the circle candidates (or Abs within the AIS-framework), the indexes i1, i2 and i3 of three non-collinear edge points must be combined, assuming the circle’s contour goes through points pi1 ; pi2 ; pi3 . A number of candidate solutions are generated randomly for the initial pool. The solutions will thus evolve through the application of the CSA as the evolution takes place over the pool until a minimum is reached and the best individual is considered as the solution for the circle detection problem. Applying classic methods based on HT for circle detection would normally require huge amounts of memory and consume large computation time. In order to reach a sub-pixel resolution — just like the method discussed in this paper, they also consider three edge points to cast a vote for the corresponding point within the parameter space. Such methods also require an evidence-collecting step, which is also implemented by the method in this paper. As the overall evolution process evolves, the objective function improves at each generation by discriminating non-plausible circles and locating others by avoiding a visit to other image points.

det(B) y0 ~ 4((xj {xi )(yk {yi ){(xk {xi )(yj {yi ))

The Imaging Science Journal

2015

VOL

63

NO

1

(10)

(11)

(12)

and  1=2 r~ (x0 {xd )2 z(y0 {yd )2

(13)

being det(.) the determinant and d[fi, j, kg. Figure 3 illustrates the parameters defined by equations (10)–(13). Therefore, it is possible to represent the shape parameters (for the circle, [x0, y0, r]) as a transformation 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 computations of x0, y0 and r. By exploring each index as an individual parameter, it is possible to sweep the continuous space looking for the shape parameters using the AIO through the CSA. This approach reduces the search space by eliminating unfeasible solutions.

Objective function or matching function A circumference may be calculated as a virtual shape in order to measure the matching factor between C and the presented circle in the image (antigenic). It must be also validated, i.e. if it really exists in the edge image. The test for such points is S~fs1 , s2 , . . . , sNs g, with Ns representing the number of test points over which the existence of an edge point will be verified. The test S is generated by the Midpoint Circle Algorithm (MCA)53 which determines the required points for drawing a circle considering the radius r and the centre point (x0,y0). The MCA employs the circle equation x2zy25r2 with only the first octant. It draws a curve starting at point (r,0) and proceeds upwards-left

Cuevas et al.

by using integer additions and subtractions. See full details in Ref. 54. The MCA aims to calculate the points Ns which are required to represent the circle considering coordinates S~fs1 , s2 , . . . , sNs g. Although the algorithm is considered the quickest providing a sub-pixel precision, it is important to assure that points lying outside the image plane must not be considered as they must be included in Ns, thus protecting the MCA operation. The matching function or objective function J(C) represents the matching (or error) resulting from pixels S for the circle candidate and the pixels that actually exist in the edge image, yielding: Ns P

J(C)~1{

Ns

(15)

with E(xi,yi) accumulating the number of expected edge points (the points in S) that are actually present in the edge image. Ns is the number of pixels within the perimeter of the circle that correspond to C, currently under testing. Therefore, the algorithm aims to minimise J(C), given that a smaller value implies a better response (matching) of the ‘circularity’ operator. The optimisation process can thus be stopped after the maximum number of epochs is reached and the individuals are clearly defined satisfying the threshold. The stopping criterion depends on the a priori knowledge about the application context.

Implementation of CSA In this work, an Ab will be represented (in binary form) by a bit chain of the form: c~Sc1 , c2 , :::, cL T

(16)

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

initial Ab pool by means of: AB~2: rand(N,Sp ){1

(19)

where Sp represents the bit size as it is assigned to each of N initial Abs — 22 for this work. In order to perform the mapping from binary string to base 10, it yields ! 21 X i ::: ðScL , , c2 , c1 TÞ ~ ci :2 ~r’ (20) 2

i~0

10

Finding the corresponding real value for r: r~r’:

rmax 22 2 {1

(21)

by using rmax to represent Np.

E(xi ,yi )

i~1

Circle detection on images based on CSA

(17)

The CSA implementation can be stated as follows: 1. An original pool of N Abss is generated, considering the size of 22 bits. 2. The n best Abs are selected based on the matching function. They will represent the memory set. 3. Best Abs are cloned. 4. Perform hypermutation of the cloned Abs following the affinity between Abs and Ags while generating one improved antibody pool. 5. From the hypermutated pool, the Abs with the highest affinity are to be re-selected. 6. As for the original pool, the Abs with the lowest affinity are replaced improving the overall cells set. Once the above steps are completed, the process is started again, until one Ab shows the best matching, i.e. finding the minimum value of J(C). In this work, the algorithm considers three index points embedded into a single Ab to represent one circle. Each single index has the variable Pi (with i51, 2, 3) representing the Hamming shape-space by means of a 22-bits word over the following range:   (18) Pi : 1, Np considering Np the total number of edge pixels contained in the image. Hence, the first step is to generate the

Experimental results Parametric set-up Table 1 presents the parameters of CSA used in this work. Once they have been determined experimentally, they are kept for all the test images through all experiments. All the experiments are performed on a Pentium IV 2?5 GHz computer under C language programming. All the images are preprocessed by the standard Canny edge-detector using the image-processing toolbox for MATLAB R2008a. For comparison purposes, the CSA algorithm is tested against the IRHT and the GA circle detectors to each image individually. For the GA algorithm described in Ayala-Ramirez et al.,25 the population size is 70, the crossover probability is 0?55, the mutation probability is 0?10 and the number of elite individuals is 2. The roulette wheel selection and the one-point crossover are applied. The parameter set-up and the fitness function follow the configuration suggested in.25 For the IRHT algorithm proposed by Lu and Tan,20 the parameter values are defined as suggested by Lu and Tan.20 In IRHT, the most important parameters are grouped into the vector Dc which defines the desired set of enlargements of the circle/ellipse parameters to build a new region of interest. In this comparison, Dc is considered asDc ~ ½ 0:5:sx 0:5:sx 0:5:sa 0:5:sb 0 . Such configuration is chose according to Lu and Tan20 as such values make the algorithm insensitive to noise images.

Error score and success rate Real-life images rarely contain perfectly-shaped circles. Therefore in order to test the accuracy of the CSA approach, the results are compared to a ground-truth circle26, which is manually detected from the original edge-map. The parameters (xtrue,ytrue,rtrue) of the ground-truth circle are computed using the equations (10)–(13), over the three circumference points from the manually detected circle. If the centre and the radius of such circle are found by the algorithm, defining (xD,yD) and rD, then the error score defined as follows: Table 1 Parameter set-up for the CSA detector h

n

Nc

r

Pr

L

Te

ITER

120

100

80

10

20

22

0.01

400

The Imaging Science Journal

2015

VOL

63

NO

1

39

Cuevas et al.

Circle detection on images based on CSA

4 Synthetic images and their detected circles

Es~g:ðjxtrue {xD jzjytrue {yD jÞzm:jrtrue {rD j

(22)

The first term represents the shift of the centre of the detected circle as it is compared to the ground-truth circle. The second term accounts for the difference between their radii. g and m are two weights associated to each term in expression 22. They may be chosen according to the required accuracy as g50?005 and m50?1. This particular choice of parameters ensures that the radii difference is strongly weighted than difference of centre positions between the manually detected and the machine-detected circle. It is assumed that if the Es is found to be less than 1, then the algorithm gets a success. Otherwise, it is considered to have failed in detecting the edge-circle. Notice that g50?005 and m50?1 yields Es,1, which means that the maximum tolerated difference of radius length is 10 pixels, while the maximum mismatch in the location of the centre can be up to 20 pixels. From this viewpoint, the success rate is defined as percentage of reaching success after a certain number of trials.

Presentation of results Figure 4 provides three synthetic images and their counterparts after processing with CSA. Figure 5 presents the same experimental results on natural images. In order to test the robustness of the algorithm, salt and pepper noise have been added to the synthetic images before applying the algorithm. Likewise, the natural image shown by Fig. 5b is also corrupted with salt and pepper noise. It also illustrates the performance

40

The Imaging Science Journal

2015

VOL

63

NO

1

of the algorithm considering noisy and corrupted pixels. As real-life images rarely contain perfectly-shaped circles, the proposed algorithm must approximate the circle that better fits into imperfect shapes within a noisy image. Such circle would therefore correspond to the better match in the objective function J(C). Considering the benchmark images and their corresponding edge maps shown by Fig. 4, Fig. 5 provides a visual performance illustration of the GA algorithm,25 the IRHT algorithm20 and the proposed approach, over three challenging problem instances, i.e. occluded circle, uneven circumference and synthetic noisy image). The results are averaged over 35 independent runs of each algorithm. It is interesting to observe that the deviation between the detected circle and actual circle is the smallest under the CSA detector. Table 2 shows the averaged execution time, the success rate (in %) and averaged error score — following equation (22), for the three competitor algorithms over six test images shown by Figs. 4 and 5. Table 3 contents the results after processing noisy images shown by Fig. 4. The best results are marked in bold for both Tables. A close inspection of Tables 2 and 3 reveals that the CSA method is able to achieve the highest success rate and minimum error tracking least computational time in majority of the cases.

Conclusions This work has presented an algorithm for the automatic detection of circular shapes from complicated and noisy

Cuevas et al.

Circle detection on images based on CSA

5 Natural images and their detected circles

Guided by the values of the objective function, the set of encoded candidate circles are evolved using the CSA so that they can fit into the actual circles in the edge map of the image. As it can be observed from the results shown by Figs. 4, 5 and 7, our approach detects the circle in complex images with little visual distortion despite the presence of noisy background pixels. An important feature is to consider the circle detection problem as an optimisation approach. Such

images with no consideration of the conventional HT principles. The proposed method is based on a newly developed AIO technique, known as the CSA. To the best of our knowledge, the CSA has not been yet applied to any such circle detection task until date. The algorithm uses the encoding of three non-collinear edge points as circle candidates within the edge image of the scene. An objective function evaluates if a given circle candidate is actually present in the edge image (Ag).

Table 2 Averaged execution time and success rate of the GA, the IRHT and the proposed CSA method, over the six test images shown by Figs. 4 and 5

Image

Average time¡standard deviation (s)

Success rate (SR) (%)

Es¡standard deviation

GA

Synthetic images (a) 1.18¡0.20 (b) 1.24¡0.39 (c) 2.16¡0.11 Natural images (a) 2.11¡0.51 (b) 2.91¡0.34 (c) 3.82¡0.97

IRHT

CSA

GA

IRHT

CSA

GA

IRHT

CSA

2.10¡0.80 1.80¡0.65 3.18¡0.36

0?52¡0?10 0?46¡0?24 0?60¡0?19

100 95 91

92 81 82

100 98 100

0.77¡0.081 0.62¡0.050 0.60¡ 0.041

0.62¡0.070 0.45¡0.023 0.57¡0.041

0?40¡0?051 0?37¡0?085 0?31¡0?024

2.61¡0.52 3.21¡0.14 4.36¡0.17

1?12¡0?37 1?61¡0?17 1?95¡0?41

90 92 88

92 90 81

100 100 98

0.77¡0.031 0.97¡0.055 1.21¡0.102

0.82¡0.043 1.02¡0.136 1.42¡0.155

0?43¡0?055 0?51¡0?041 0?59¡0?073

The Imaging Science Journal

2015

VOL

63

NO

1

41

Cuevas et al.

Circle detection on images based on CSA

6 Complex benchmark images and their corresponding edge maps

et al.25) and the IRHT (as described in Lu and Tan20) within a statistically significant framework. Although the HT methods for circle detection also use three edge points to cast a vote for the potential circular shape in the parameter space, they would require huge amounts of memory and longer computational time to obtain a sub-pixel resolution. In the HT-based methods, the parameter space is quantised and the exact parameters for a circle are often not equal to the quantised parameters; therefore, it rarely finds the exact parameters of a circle in the image.55 However, the proposed CSA method does not employ the quantisation of the

view enables the algorithm to detect arcs or occluded circles still matching imperfect circles. The CSA is capable of finding circle parameters according to J(C) instead of making a review of all circle candidates towards detecting occluded or imperfect circles as it is commonly done by other methods. In order to test the circle detection accuracy, a score function is used (equation (22)) following the work by Dasgupta et al.26 It can objectively evaluate the mismatch between a manually detected circle and a machinedetected shape. We demonstrated that the CSA method outperforms both the GA (as described in Ayala-Ramirez

Table 3 Averaged execution time and success rate of the GA, the IRHT and the proposed CSA method over three noisy images shown by Fig. 4

Image

Average time¡standard deviation (s)

Success rate (SR) (%)

Es¡standard deviation

GA

CSA

GA

IRHT

CSA

GA

IRHT

CSA

0?57¡0?13 0?51¡0?11 0?64¡0?33

100 91 93

92 80 78

100 97 100

0.87¡0.071 0.67¡0.081 0.71¡0.036

0.71¡0.051 0.61¡0.048) 0.77¡0.044

0?54¡0?071 0?31¡0?015 0?42¡0?011

IRHT

Synthetic noisy images (a) 2.11¡0.31 3.04¡0.29 (b) 2.50¡0.39 2.80¡0.17 4.11¡0.71 (c) 3.02¡0.63

42

The Imaging Science Journal

2015

VOL

63

NO

1

Cuevas et al.

Circle detection on images based on CSA

7 Performance of the CSA method, the GA and the IRHT over complex images

parameter space. In our approach, the detected circles are directly obtained from equations (10)(13), still reaching sub-pixel accuracy. Although Fig. 6 indicates that the CSA method can yield better results on complicated and noisy images in comparison to the GA and the IRHT methods, it can be noticed that the aim of our paper is not intended to beat all the circle detector methods which have been proposed earlier, but to show that the AIS can effectively serve as an attractive alternative to evolutionary algorithms, which have been employed before to successfully extract circular shapes in images.

Acknowledgements The proposed algorithm is part of the system used by a biped robot supported under the grant CONACYT CB 181053.

References 1. Brabazon, A. and O’Neill, M. Biologically Inspired Algorithms for financial Modelling, 2006 (Springer, Berlin). 2. Chih-Chih, L. A novel image segmentation approach based on particle swarm optimization. IEICE Trans. Fundam. Electron. Commun. Comput. Sci., 2006, 89, 324–327.

3. Le He´garat-Mascle, S., He´garat-Mascle, L., Kallel, A. and Descombes, X. Ant colony optimization for image regularization based on a nonstationary markov modeling. IEEE Trans. Image Process., 2007, 16, 865–878. 4. Hammouche, K., Diaf, M. and Siarry P. Amultilevel automatic thresholding method based on a genetic algorithm for a fast image segmentation. Comput. Vis. Image Understand., 2008, 109, 163–175. 5. Bas¸tu¨rk, A. and Gu¨nay, E. Efficient edge detection in digital images using a cellular neural network optimized by differential evolution algorithm. Expert Syst. Appl., 2009, 36, 2645– 2650. 6. da Fontoura Costa, L. and Marcondes Cesar, Jr, R. Shape Analysis and Classification, 2001 (CRC Press, Boca Raton, FL). 7. Peura, M. and Iivarinen, J. In Advances in Visual Form Analysis (Ed. C. Arcelli, L. P. Cordella and G. S. di Baja), 1997, pp.443–451 (World Scientific, Singapore). 8. Yuen, H., Princen, J., Illingworth, J. and Kittler, J. Comparative study of Hough transform methods for circle finding. Image Vis. Comput., 1990, 8, 71–77. 9. Iivarinen, J., Peura, M., Sarela, J. and Visa, A. Comparison of combined shape descriptors for irregular objects, Proc. 8th British Machine Vision Conf., Cochester, UK, September 1997, University of Essex, pp. 430–439. 10. Jones, G., Princen, J., Illingworth, J. and Kittler, J. Robust estimation of shape parameters, Proc. British Machine Vision Conf., Oxford, UK, September 1990, BMVA, pp. 43–48. 11. Fischer, M. and Bolles, R. Random sample consensus: a paradigm to model fitting with applications to image analysis and automated cartography. Commun. ACM, 1981, 24, 381–395.

The Imaging Science Journal

2015

VOL

63

NO

1

43

Cuevas et al.

Circle detection on images based on CSA

12. Bongiovanni, G. and Crescenzi, P. Parallel simulated annealing for shape detection. Comput. Vis. Image Understand., 1995, 61, 60–69. 13. Roth, G. and Levine, M. D. Geometric primitive extraction using a genetic algorithm. IEEE Trans. Pattern Anal. Mach. Intell., 1994, 16, 901–905. 14. Muammar, H. and Nixon, M. Approaches to extending the Hough transform, Proc. Int. Conf. on Acoustics, speech and signal processing: ICASSP-89, Glasgow, UK, May 1989, IEEE, Vol. 3, pp. 1556–1559. 15. Atherton, T. J. and Kerbyson, D. J. Using phase to represent radius in the coherent circle Hough transform, Proc. IEE Coll. on the Hough transform, London, UK, May 1993, IEE. 269–278. 16. Shaked, D., Yaron, O. and Kiryati, N. Deriving stopping rules for the probabilistic Hough transform by sequential analysis. Comput. Vis. Image Understand., 1996, 63, 512–526. 17. Fischer, M. and Bolles, R. Random sample consensus: a paradigm to model fitting with applications to image analysis and automated cartography. Commun. ACM, 1981, 24, 381–395. 18. Xu, L., Oja, E. and Kultanen, P. A new curve detection method: randomized Hough transform (RHT). Pattern Recogn. Lett., 1990, 11, 331–338. 19. Han, J. H., Koczy, L. T. and Poston, T. Fuzzy Hough transform, Proc. 2nd IEEE Int. Conf. on Fuzzy systems, San Francisco, CA, USA, March 1993, IEEE, Vol. 2, pp. 803–808. 20. Lu, W and Tan, J. L. Detection of incomplete ellipse in images with strong noise by iterative randomized Hough transform (IRHT). Pattern Recogn., 2008, 41, 1268–1279. 21. Roth, G. and Levine, M. D. Geometric primitive extraction using a genetic algorithm. IEEE Trans. Pattern Anal. Mach. Intell., 1994, 16, 901–905. 22. Lutton, E. and Martinez, P. A genetic algorithm for the detection 2-D geometric primitives on images, Proc. of the 12th Int. Conf. on Pattern recognition, Jerusalem, Israel, October 1994, IEEE, Vol. 1, pp. 526–528. 23. Yao, J., Kharma, N. and Grogono, P. Fast robust GA-based ellipse detection, Proc. 17th Int. Conf. on Pattern recognition: ICPR-04, Cambridge, UK, August 2004, IEEE, Vol. 2, pp. 859– 862. 24. Yuen, S. and Ma, C. Genetic algorithm with competitive image labelling and least square. Pattern Recogn., 2000, 33, 1949–1966. 25. Ayala-Ramirez, V., Garcia-Capulin, C. H., Perez-Garcia, A. and Sanchez-Yanez, R. E. Circle detection on images using genetic algorithms. Pattern Recogn. Lett., 2006, 27, 652–657. 26. Dasgupta, S., Das, S., Biswas A. and Abraham, A. Automatic circle detection on digital images whit an adaptive bacterial foraging algorithm. Soft Comput., 2009, 14, 1151–1164. 27. Rosin, P. L. Further five point fit ellipse fitting, Proc. 8th British Machine Vision Conf., Cochester, UK, September 1997, University of Essex, pp.290–299. 28. Goldsby, G. A., Kindt, T. J., Kuby, J. and Osborne, B. A. Immunology, 2003, 5th edition (Freeman, New York). 29. de Castro, L. N. and Timmis, J. Artificial Immune Systems: A New Computational Intelligence Approach, 2002 (Springer, London). 30. Dasgupta, D. Advances in artificial immune systems. IEEE Comput. Intell. Mag., 2006, 1, 40–49. 31. Wang, X., Gao, X. Z. and Ovaska, S. J. Artificial immune optimization methods and applications — a survey, Proc. IEEE Int. Conf. on Systems, man, and cybernetics, The Hague, The Netherlands, October 2004, IEEE, pp.3415–3420. 32. de Castro, L. N. and von Zuben, F. J. Learning and optimization using the clonal selection principle. IEEE Trans. Evol. Comput., 2002, 6, 239–251. 33. Ada, G. L. and Nossal, G. The clonal selection theory. Sci. Am., 1987, 257, 50–57. 34. Ma, H. P., Simon, D., Fei, M. R. and Chen, Z. X. On the equivalences and differences of evolutionary algorithms. Eng. Appl. Artif. Intell., 2013, 26, 2397–2407.

44

The Imaging Science Journal

2015

VOL

63

NO

1

35. Eberhart, R. C. and Shi, Y. H. Comparison between genetic algorithms and particle swarm optimization. Lect. Notes Comput. Sci., 1998, 1447, 611–616. 36. Biswas, A., Das, S., Abraham, A. and Dasgupta, S. Stability analysis of the reproduction operator in bacterial foraging optimization. Theor. Comput. Sci., 2010, 411, 2127–2139. ¨ lker, E. D. and U ¨ lker, S. Comparisons study for clonal selection 37. U algorithm and genetic algorithm. Int. J. Comput. Sci. Inf. Technol., 2012, 4, 107–118. 38. Sheng, Q., Zhou, L. S. and Yue, Y. X. A clonal selection based differential evolution algorithm for double-track railway train schedule optimization, Proc. 2nd IEEE Int. Conf. on Advanced computer control: ICACC 2010, Shenyang, China, January 2010, IEEE, 155–158. 39. Yap, D. F. W., Koh, S. P. and Tiong, S. K. A comparative analysis on the performance of particle swarm optimization and artificial immune systems for mathematical test functions. Aust. J. Basic Appl. Sci., 2009, 3, 4344–4350. 40. Coello Coello, C. A. and Cortes, N. C. Solving multiobjective optimization problems using an artificial immune system. Genet. Program. Evolv. Mach., 2005, 6, 163–190. 41. Campelo, F., Guimaraes, F. G., Igarashi, H. and Ramirez, J. A. A clonal selection algorithm for optimization in electromagnetics. IEEE Trans. Magn., 2005, 41, 1736–1739. 42. Dong, W. S., Shi, G. M. and Li, Z. Immune memory clonal selection algorithms for designing stack filters. Neurocomputing 2007, 70, 777–784. 43. Gong, M., Jiao, L., Zhang, L. and Du, H. Immune secondary response and clonal selection inspired optimizers. Prog. Nat. Sci., 2009, 19, 237–253. 44. de Castro, L, N. and von Zuben, F. J. Learning and optimization using the clonal selection principle. IEEE Trans. Evol. Comput., 2002, 6, 239–251. 45. Cutello, V., Narzisi, G., Nicosia, G. and Pavone, M. Clonal Selection Algorithms: a comparative case study using effective mutation potentials. Lect. Notes Comput. Sci., 2005, 3627, 13–28. 46. Gong, M., Jiao, L. and Zhang, X. A population-based artificial immune system for numerical optimization. Neurocomputing, 2008, 72, 149–161. 47. Gao, X., Wang, X. and Ovaska, S. Fusion of clonal selection algorithm and differential evolution method in training cascade– correlation neural network. Neurocomputing, 2009, 72, 2483–2490. 48. Poli, R. and Langdon, W. B. Foundations of Genetic Programming, 2002 (Springer, Berlin). 49. Yoo, J. and Hajela, P. Immune network simulations in multicriterion design. Struct. Optimiz., 1999, 18, 85–94. 50. Wang, X., Gao, X. Z. and Ovaska, S. J. A hybrid optimization algorithm in power filter design, Proc. 31st Annual Conf. of the IEEE Industrial Electronics Society, Raleigh, NC, USA, November 2005, IEEE Industrial Electronics Society, pp.1335– 1340. 51. Xu, X. and Zhang, J. An improved immune evolutionary algorithm for multimodal function optimization, Proc. 3rd Int. Conf. on Natural computation, Haikou, China, August 2007, IEEE, pp.641– 646. 52. Tang, T. and Qiu, J. An improved multimodal artificial immune algorithm and its convergence analysis, Proc. 6th World Cong. on Intelligent control and automation, Dalian, China, June 2006, IEEE, pp.3335–3339. 53. Bresenham, J. E. A linear algorithm for incremental digital display of circular arcs. Commun. ACM, 1987, 20, 100–106. 54. van Aken, J. R. An efficient ellipse drawing algorithm. Comput. Graph. Appl., 1984, 4, 24–35. 55. Chen, T.-C. and Chung, K.-L. An efficient randomized algorithm for detecting circles. Comput. Vis. Image Understand., 2001, 83, 172–191.