A Swarm Optimization Algorithm for Multimodal Functions and Its Application in Multicircle Detection

In engineering problems due to physical and cost constraints, the best results, obtained by a global optimization algorithm, cannot be realized always. Under such conditions, if multiple solutions (local and global) are known, the implementation can be quickly switched to another solution without much interrupting the design process. This paper presents a new swarm multimodal optimization algorithm named as the collective animal behavior (CAB). Animal groups, such as schools of fish, flocks of birds, swarms of locusts, and herds of wildebeest, exhibit a variety of behaviors including swarming about a food source, milling around a central location, or migrating over large distances in aligned groups.These collective behaviors are often advantageous to groups, allowing them to increase their harvesting efficiency to follow bettermigration routes, to improve their aerodynamic, and to avoid predation. In the proposed algorithm, searcher agents emulate a group of animals which interact with each other based on simple biological laws that are modeled as evolutionary operators. Numerical experiments are conducted to compare the proposed method with the state-of-the-art methods on benchmark functions. The proposed algorithm has been also applied to the engineering problem of multi-circle detection, achieving satisfactory results.


Introduction
A large number of real-world problems can be considered as multimodal function optimization subjects.An objective function may have several global optima, that is, several points holding objective function values which are equal to the global optimum.Moreover, it may exhibit some other local optima points whose objective function values lay nearby a global optimum.Since the mathematical formulation of a real-world problem often produces a multimodal optimization issue, finding all global or even these local optima would provide to the decision makers multiple options to choose from [1].
Several methods have recently been proposed for solving the multimodal optimization problem.They can be divided into two main categories: deterministic and stochastic (metaheuristic) methods.When facing complex multimodal optimization problems, deterministic methods, such as gradient descent method, the quasi-Newton method, and the Nelder-Mead's simplex method, may get easily trapped into the local optimum as a result of deficiently exploiting local information.They strongly depend on a priori information about the objective function, yielding few reliable results.
Traditional GAs perform well for locating a single optimum but fail to provide multiple solutions.Several methods have been introduced into the GA's scheme to achieve multimodal function optimization, such as sequential fitness sharing [15,16], deterministic crowding [17], probabilistic crowding [18], clustering-based niching [19], clearing procedure [20], species conserving genetic algorithm [21], and elitist-population strategies [22].However, algorithms based on the GAs do not guarantee convergence to global optima because of their poor exploitation capability.GAs exhibit other drawbacks such as the premature convergence which results from the loss of diversity in the population and becomes a common problem when the search continues for several generations.Such drawbacks [23] prevent the GAs from practical interest for several applications.
Using a different metaphor, other researchers have employed artificial immune systems (AIS) to solve the multimodal optimization problems.Some examples are the clonal selection algorithm [24] and the artificial immune network (AiNet) [25,26].Both approaches use some operators and structures which attempt to algorithmically mimic the natural immune system's behavior of human beings and animals.
Several studies have been inspired by animal behavior phenomena in order to develop optimization techniques such as the particle swarm optimization (PSO) algorithm which models the social behavior of bird flocking or fish schooling [27].In recent years, there have been several attempts to apply the PSO to multimodal function optimization problems [28,29].However, the performance of such approaches presents several flaws when it is compared to the other multi-modal metaheuristic counterparts [26].
Recently, the concept of individual organization [30,31] has been widely used to understand collective behavior of animals.The central principle of individual organization is that simple repeated interactions between individuals can produce complex behavioral patterns at group level [30,32,33].Such inspiration comes from behavioral patterns seen in several animal groups, such as ant pheromone trail networks, aggregation of cockroaches, and the migration of fish schools, which can be accurately described in terms of individuals following simple sets of rules [34].Some examples of these rules [33,35] include keeping current position (or location) for best individuals, local attraction or repulsion, random movements, and competition for the space inside of a determined distance.On the other hand, new studies have also shown the existence of collective memory in animal groups [36][37][38].The presence of such memory establishes that the previous history, of group structure, influences the collective behavior exhibited in future stages.Therefore, according to these new developments, it is possible to model complex collective behaviors by using simple individual rules and configuring a general memory.
On the other hand, the problem of detecting circular features holds paramount importance in several engineering applications.The circle detection in digital images has been commonly solved through the circular Hough transform (CHT) [39].Unfortunately, this approach requires a large storage space that augments the computational complexity and yields a low processing speed.In order to overcome this problem, several approaches which modify the original CHT have been proposed.One well-known example is the randomized Hough transform (RHT) [40].As an alternative to Hough-transform-based techniques, the problem of shape recognition has also been handled through optimization methods.In general, they have demonstrated to deliver better results than those based on the HT considering accuracy, speed, and robustness [41].Such approaches have produced several robust circle detectors using different optimization algorithms such as genetic algorithms (GAs) [41], harmony search (HSA) [42], electromagnetism-like (EMO) [43], differential evolution (DE) [44], and bacterial foraging optimization (BFOA) [45].Since such evolutionary algorithms are global optimizers, they detect only the global optimum (only one circle) of an objective function that is defined over a given search space.However, extracting multiple-circle primitives falls into the category of multi-modal optimization, where each circle represents an optimum which must be detected within a feasible solution space.The quality for such optima is characterized by the properties of their geometric primitives.Big and well-drawn circles normally represent points in the search space with high fitness values (possible global maximum) whereas small and dashed circles describe points with fitness values which account for local maxima.Likewise, circles holding similar geometric properties, such as radius and size, tend to represent locations with similar fitness values.Therefore, a multi-modal method must be applied in order to appropriately solve the problem of multishape detection.In this paper, a new multimodal optimization algorithm based on the collective animal behavior is proposed and also applied to multicircle detection.
This paper proposes a new optimization algorithm inspired by the collective animal behavior.In this algorithm, the searcher agents emulate a group of animals that interact with each other based on simple behavioral rules which are modeled as evolutionary operators.Such operations are applied to each agent considering that the complete group has a memory which stores its own best positions seen so far by applying a competition principle.Numerical experiments have been conducted to compare the proposed method with the state-of-the-art methods on multi-modal benchmark functions.Besides, the proposed algorithm is also applied to the engineering problem of multicircle detection, achieving satisfactory results.
This paper is organized as follows.Section 2 introduces the basic biological aspects of the algorithm.In Section 3, the proposed algorithm and its characteristics are described.A numerical study on different multi-modal benchmark functions is presented in Section 4. Section 5 presents the application of the proposed algorithm to multi-circle detection whereas Section 6 shows the obtained results.Finally, in Section 7 the conclusions are discussed.

Biological Fundaments
The remarkable collective behavior of organisms such as swarming ants, schooling fish, and flocking birds has long captivated the attention of naturalists and scientists.Despite a long history of scientific investigation, just recently we are beginning to decipher the relationship between individuals and group-level properties [46].Grouping individuals often have to make rapid decisions about where to move or what behavior to perform, in uncertain and dangerous environments.However, each individual typically has only relatively local sensing ability [47].Groups are, therefore, often composed of individuals that differ with respect to their informational status, and individuals are usually not aware of the informational state of others [48], such as whether they are knowledgeable about a pertinent resource or of a threat.
Animal groups are based on a hierarchic structure [49] which differentiates individuals according to a fitness principle known as dominance [50].Such concept represents the domain of some individuals within a group and occurs when competition for resources leads to confrontation.Several studies [51,52] have found that such animal behavior leads to stable groups with better cohesion properties among individuals.
Recent studies have illustrated how repeated interactions among grouping animals scale to collective behavior.They have also remarkably revealed that collective decisionmaking mechanisms across a wide range of animal group types, ranging from insects to birds (and even among humans in certain circumstances), seem to share similar functional characteristics [30,34,53].Furthermore, at a certain level of description, collective decision-making in organisms shares essential common features such as general memory.Although some differences may arise, there are good reasons to increase communication between researchers working in collective animal behavior and those involved in cognitive science [33].
Despite the variety of behaviors and motions of animal groups, it is possible that many of the different collective behavioral patterns are generated by simple rules followed by individual group members.Some authors have developed different models, such as the self-propelled particle (SPP) model which attempts to capture the collective behavior of animal groups in terms of interactions between group members following a diffusion process [54][55][56][57].
On other hand, following a biological approach, Couzin et al. [33,34] have proposed a model in which individual animals follow simple rules of thumb: (1) keep the position of best individuals, (2) move from or to nearby neighbors (local attraction or repulsion), (3) move randomly, and (4) compete for the space inside of a determined distance.Each individual thus admits three different movements: attraction, repulsion, or random, while holding two kinds of states: preserve the position or compete for a determined position.In the model, the movement experimented by each individual is decided randomly (according to an internal motivation); meanwhile the states are assumed according to fixed criteria.
The dynamical spatial structure of an animal group can be explained in terms of its history [54].Despite this, the majority of the studies have failed in considering the existence of memory in behavioral models.However, recent researches [36,58] have also shown the existence of collective memory in animal groups.The presence of such memory establishes that the previous history of the group structure influences the collective behavior exhibited in future stages.Such memory can contain the position of special group members (the dominant individuals) or the averaged movements produced by the group.
According to these new developments, it is possible to model complex collective behaviors by using simple individual rules and setting a general memory.In this work, the behavioral model of animal groups is employed for defining the evolutionary operators through the proposed metaheuristic algorithm.A memory is incorporated to store best animal positions (best solutions) considering a competitiondominance mechanism.

Collective Animal Behaviour Algorithm (CAB)
The CAB algorithm assumes the existence of a set of operations that resembles the interaction rules that model the collective animal behavior.In the approach, each solution within the search space represents an animal position.The "fitness value" refers to the animal dominance with respect to the group.The complete process mimics the collective animal behavior.
The approach in this paper implements a memory for storing best solutions (animal positions) mimicking the aforementioned biologic process.Such memory is divided into two different elements, one for maintaining the best found positions in each generation (M  ) and the other for storing best history positions during the complete evolutionary process (M ℎ ).

Description of the CAB Algorithm.
Like other metaheuristic approaches, the CAB algorithm is also an iterative process.It starts by initializing the population randomly, that is, generating random solutions or animal positions.The following four operations are thus applied until the termination criterion is met, that is, the iteration number  is reached as follows.
(1) Keep the position of the best individuals.
(2) Move from or nearby neighbors (local attraction and repulsion).
(4) Compete for the space inside of a determined distance (updating the memory).( with  and  being the parameter and individual indexes, respectively.Hence,  , is the th parameter of the th individual. All the initial positions A are sorted according to the fitness function (dominance) to form a new individual set X = {x 1 , x 2 , . . ., x   }, so that we can choose the best  positions and store them in the memory M  and M ℎ .The fact that both memories share the same information is only allowed at this initial stage.

Keep the Position of the Best Individuals.
Analogously to the biological metaphor, this behavioral rule, typical in animal groups, is implemented as an evolutionary operation in our approach.In this operation, the first  elements of the new animal position set A({a 1 , a 2 , . . ., a  }) are generated.Such positions are computed by the values contained in the historic memory M ℎ considering a slight random perturbation around them.This operation can be modelled as follows: where  ∈ {1, 2, . . ., } while m  ℎ represents the -element of the historic memory M ℎ and v is a random vector holding an appropriate small length.

Move from or to Nearby Neighbours.
From the biological inspiration, where animals experiment a random local attraction or repulsion according to an internal motivation, we implement the evolutionary operators that mimic them.For this operation, a uniform random number   is generated within the range [0, 1].If   is less than a threshold , a determined individual position is moved (attracted or repelled) considering the nearest best historical value of the group (the nearest position contained in M ℎ ); otherwise it is considered the nearest best value in the group of the current generation (the nearest position contained in M  ).Therefore, such operation can be modeled as follows: where  ∈ {+1, +2, .
where  ∈ { + 1,  + 2, . . .,   } and r is a random vector defined within the search space.This operator is similar to reinitialize the particle in a random position as it is done by (1).

Compete for the Space Inside of a Determined Distance (Updating the Memory).
Once the operations to preserve the position of the best individuals, to move from or to nearby neighbors and to move randomly, have all been applied to all the   animal positions, generating   new positions, it is necessary to update the memory M ℎ .
In order to update the memory M ℎ , the concept of dominance is used.Animals that interact in a group keep a minimum distance among them.Such distance  depends on how aggressive the animal behaves [50,58].Hence, when two animals confront each other inside of such distance, the most dominant individual prevails as the other withdraws.Figure 1 shows this process.
In the proposed algorithm, the historic memory M ℎ is updated considering the following procedure.
(1) The elements of M ℎ and M  are merged into (2) Each element m   of the memory M  is compared pairwise with the remainder memory elements ({m 1   , m 2  , . . ., m 2−1  }).If the distance between both elements is less than , the element holding a better performance in the fitness function will prevail; meanwhile the other will be removed.
(3) From the resulting elements of M  (as they are obtained in Step 2), the  best value is selected to integrate the new M ℎ .
Unsuitable values of  result in a lower convergence rate, longer computation time, larger function evaluation number, convergence to a local maximum, or unreliability of solutions.
The  value is computed considering the following equation: where  low  and  high  represent the prespecified lower bound and the upper bound of the -parameter, respectively, within a -dimensional space.
3.1.6.Computational Procedure.The computational procedure for the proposed algorithm can be summarized as follows.
Step 4. Choose the first  positions of X and store them into the memory M  .
Step 5. Update M ℎ according to Section 3.1.5(for the first iteration M ℎ = M  ).
Step 6. Generate the first  positions of the new solution set A = {a 1 ,a 2 , . . ., a  }.Such positions correspond to elements of M ℎ making a slight random perturbation around them: a  = m  ℎ + v, v being a random vector holding an appropriate small length.
Step 7. Generate the rest of the A elements using the attraction, repulsion, and random movements: attraction and repulsion movement {if ( 2 < ) then else if where  1 ,  2 ,  ∈ rand(0, 1).
Step 8.If  is completed, the process is thus completed; otherwise go back to Step 3.

Optima Determination.
Just after the optimization process has finished, an analysis of the final M ℎ memory is executed in order to find the global and significant local minima.
For it, a threshold value Th is defined to decide which elements will be considered as a significant local minimum.Such threshold is thus computed as where max fitness (M ℎ ) represents the best fitness value among M ℎ elements.Therefore, memory elements whose fitness values are greater than Th will be considered as global and local optima as other elements are discarded.
3.1.8.Capacities of CAB and Differences with PSO.Evolutionary algorithms (EAs) have been widely employed for solving complex optimization problems.These methods are found to be more powerful than conventional methods based on formal logics or mathematical programming [59].Exploitation and exploration are two main features of the EA [60].The exploitation phase searches around the current best solutions and selects the best candidates or solutions.The exploration phase ensures that the algorithm seeks the search space more efficiently in order to analyze potential unexplored areas.
The EAs do not have limitations in using different sources of inspiration (e.g., music-inspired [11] or physic-inspired charged system search [9]).However, nature is a principal inspiration for proposing new metaheuristic approaches, and the nature-inspired algorithms have been widely used in developing systems and solving problems [61].Biologically inspired algorithms are one of the main categories of the nature-inspired metaheuristic algorithms.The efficiency of the bio inspired algorithms is due to their significant ability to imitate the best features in nature.More specifically, these algorithms are based on the selection of the most suitable elements in biological systems which have evolved by natural selection.
Particle swarm optimization (PSO) is undoubtedly one of the most employed EA methods that use biologically inspired concepts in the optimization procedure.Unfortunately, like other stochastic algorithms, PSO also suffers from the premature convergence [62], particularly in multi modal problems.Premature convergence, in PSO, is produced by the strong influence of the best particle in the evolution process.Such particle is used by the PSO movement equations as a main individual in order to attract other particles.Under such conditions, the exploitation phase is privileged by allowing the evaluation of new search position around the best individual.However, the exploration process is seriously damaged, avoiding searching in unexplored areas.
As an alternative to PSO, the proposed scheme modifies some evolution operators for allowing not only attracting but also repelling movements among particles.Likewise, instead of considering the best position as reference, our algorithm uses a set of neighboring elements that are contained in an incorporated memory.Such improvements allow increasing the algorithm's capacity to explore and to exploit the set of solutions which are operated during the evolving process.
In the proposed approach, in order to improve the balance between exploitation and exploration, we have introduced three new concepts.The first one is the "attracting and repelling movement", which outlines that one particle cannot be only attracted but also repelled.The application of this concept to the evolution operators (3) increases the capacity of the proposed algorithm to satisfactorily explore the search space.Since the process of attraction or repulsion of each particle is randomly determined, the possibility of premature convergence is very low, even for cases that hold an exaggerated number of local minima (excessive number of multimodal functions).
The second concept is the use of the main individual.In the approach, the main individual, that is considered as pivot in the equations (in order to generate attracting and repulsive movements), is not the best (as in PSO) but one element (m nearest ℎ or m nearest  ) of a set which is contained in memories that store the best individual seen so far.Such pivot is the nearest element in memory with regard to the individual whose position is necessary to evolve.Under such conditions, the points considered to prompt the movement of a new individual are multiple.Such fact allows to maintain a balance between exploring new positions and exploiting the best positions seen so-far.
Finally, the third concept is the use of an incorporated memory which stores the best individuals seen so far.As it has been discussed in Section 3.1.5,each candidate individual to be stored in the memory must compete with elements already contained in the memory in order to demonstrate that such new point is relevant.For the competition, the distance between each individual and the elements in the memory is used to decide pair-wise which individuals are actually considered.Then, the individual with better fitness value prevails whereas its pair is discarded.The incorporation of such concept allows simultaneous registering and refining of the best-individual set seen so far.This fact guarantees a high precision for final solutions of the multi-modal landscape through an extensive exploitation of the solution set.
3.1.9.Numerical Example.In order to demonstrate the algorithm's step-by-step operation, a numerical example has been set by applying the proposed method to optimize a simple function which is defined as follows: Considering the interval of −5 ≤  1 ,  2 ≤ 5, the function possesses two global maxima of value 2 at ( 1 ,  2 ) = (0, 0) and (0, −4).Likewise, it holds two local minima of value 1 at (−4, 4) and (4, 4).Like all evolutionary approaches, CAB is a populationbased optimizer that attacks the starting point problem by sampling the objective function at multiple, randomly chosen, initial points.Therefore, after setting parameter bounds that define the problem domain, 10 (  ) individuals (i 1 , i 2 , . . ., i 10 ) are generated using (1).Following an evaluation of each individual through the objective function (7), all are sorted decreasingly in order to build vector X = (x 1 , x 2 , . . ., x 10 ).The new 10 individuals (a 1 , a 2 , . . ., a 10 ) are evolved at each iteration following three different steps: (1) keep the position of best individuals, (2) move from or nearby neighbors, and (3) move randomly.The first new four elements (a 1 , a 2 , a 3 , a 4 ) are generated considering the first step (keeping the position of best individuals).Following such step, new individual positions are calculated as perturbed versions of all the elements which are contained in the M ℎ memory (that represent the best individuals known so far).Such perturbation is done by using a  = m  ℎ + v ( ∈ 1, . . ., 4). Figure 2(d) shows a comparative view between the memory element positions and the perturbed values of (a 1 , a 2 , a 3 , a 4 ).
The remaining 6 new positions (a 5 , . . ., a 10 ) are individually computed according to Steps 2 and 3 of the numerical example.For such operation, a uniform random number  1 is generated within the range [0, 1].If  1 is less than 1 − , the new position a  ( ∈ 5, . . ., 10) is generated through Step 2; otherwise, a  is obtained from a random reinitialization (Step 3) between search bounds.
In order to calculate a new position a  at Step 2, a decision must be made on whether it should be generated by using the elements of M ℎ or M  .For such decision, a uniform random number  2 is generated within the range [0, 1].If  2 is less than , the new position a  is generated by using , where m nearest ℎ and m nearest  represent the closest elements to x  in memory M ℎ and M  , respectively.In the first iteration, since there is not available information from previous steps, both memories M ℎ and M  share the same information which is only allowed at this initial stage.Figure 2(e) shows graphically the whole procedure employed by Step 2 in order to calculate the new individual position a 8 whereas Figure 2(f) presents the positions of all new individuals (a 1 , a 2 , . . ., a 10 ).
Finally, after all new positions (a 1 , a 2 , . . ., a 10 ) have been calculated, memories M ℎ and M  must be updated.In order to update M ℎ , new calculated positions (a 1 , a 2 , . . ., a 10 ) are arranged according to their fitness values by building vector X = (x 1 , x 2 , . . ., x 10 ).Then, the elements of M ℎ are replaced by the first four elements in X (the best individuals of its generation).In order to calculate the new elements of M ℎ , current elements of M ℎ (the present values) and M  (the updated values) are merged into M  .Then, by using the dominance concept (explained in Section 3.1.5)over M  , the best four values are selected to replace the elements in M  .Figures 2(g) and 2(h) show the updating procedure for both memories.Applying the dominance (see Figure 2 ℎ , m 1  ) are less than  = 3, elements with better fitness evaluation will build the new memory M ℎ .Figure 2(h) depicts final memory configurations.The circles and solid circles points represent the elements of M  and M ℎ , respectively, whereas the bold squares perform as elements shared by both memories.Therefore, if the complete procedure is repeated over 30 iterations, the memory M ℎ will contain the 4 global and local maxima as elements.Figure 2(i) depicts the final configuration after 30 iterations.

Results on Multimodal Benchmark Functions
In this section, the performance of the proposed algorithm is tested.Section 4.1 describes the experiment methodology.Sections 4.2 and 4.3 report on a comparison between the CAB experimental results and other multimodal metaheuristic algorithms for different kinds of optimization problems.

Experiment Methodology.
In this section, we will examine the search performance of the proposed CAB by using a test suite of 8 benchmark functions with different complexities.They are listed in Tables 1 and 2. The suite mainly contains some representative, complicated, and multimodal functions with several local optima.These functions are normally regarded as difficult to be optimized as they are particularly challenging to the applicability and efficiency of multimodal metaheuristic algorithms.The performance measurements considered at each experiment are the following: (i) the consistency of locating all known optima; (ii) the averaged number of objective function evaluations that are required to find such optima (or the running time under the same condition).
Since the approach solves real-valued multimodal functions, we have used, in the GA approaches, consistent real coding variable representation, uniform crossover, and

Search space Sketch
Deb's function 5 optima mutation operators for each algorithm seeking a fair comparison.The crossover probability   = 0.8 and the mutation probability   = 0.1 have been used.We use the standard tournament selection operator with a tournament size of 2 in our implementation of sequential fitness sharing, clearing procedure, CBN, clonal selection algorithm, and SCGA.On the other hand, the parameter values for the AiNet algorithm have been defined as suggested in [25], with the mutation strength  = 100, the suppression threshold  () = 0.2, and the update rate  = 40%.
In the case of the CAB algorithm, the parameters are set to   = 200,  = 100,  = 0.8, and  = 0.6.Once they have  To avoid relating the optimization results to the choice of a particular initial population and to conduct fair comparisons, we perform each test 50 times, starting from various randomly selected points in the search domain as it is commonly given in the literature.An optimum   is considered as found if ∃  ∈ Pop( = ) | (  ,   ) < 0.005, where Pop( = ) is the complete population at the end of the run  and   is an individual in Pop( = ).

Mathematical Problems in Engineering
All algorithms have been tested in MATLAB over the same Dell OptiPlex GX260 computer with a Pentium 4 2.66 G HZ processor, running Windows XP operating system over 1 Gb of memory.Next sections present experimental results for multimodal optimization problems which have been divided into two groups with different purposes.The first one consists of functions with smooth landscapes and welldefined optima (local and global values), while the second gathers functions holding rough landscapes and complex location optima.

Comparing CAB Performance for Smooth Landscapes
Functions.This section presents a performance comparison for different algorithms solving multimodal problems  1 - 4 in Table 1.The aim is to determine whether CAB is more efficient and effective than other existing algorithms for finding all multiple optima of  1 - 4 .The stopping criterion analyzes if the number-identified optima cannot be further increased over 10 successive generations after the first 100 generations; then the execution will be stopped.Four measurements have been employed to evaluate the performance: (i) the average of optima found within the final population (NO); (ii) the average distance between multiple optima detected by the algorithm and their closest individuals in the final population (DO); (iii) the average of function evaluations (FE); (iv) the average of execution time in seconds (ET).3, CAB has obtained the best score for all the multimodal problems except for  3 .In the case of  3 , the solution precision of CAB is only worse than that of clearing procedure.On the other hand, CAB has smaller standard deviations in the NO and DO measures than all other algorithms and hence its solution is more stable.
From the FE measure in Table 3, it is clear that CAB needs fewer function evaluations than other algorithms considering the same termination criterion.Recall that all algorithms use the same conventional crossover and mutation operators.It can be easily deduced from results that the CAB algorithm is able to produce better search positions (better compromise between exploration and exploitation), in a more efficient and effective way than other multimodal search strategies.
To validate that CAB improvement over other algorithms occurs as a result of CAB producing better search positions over iterations, Figure 3 shows the comparison of CAB and other multimodal algorithms for  4 .The initial populations for all algorithms have 200 individuals.In the final population of CAB, the 100 individuals belonging to the M ℎ memory correspond to the 100 multiple optima, while, on the contrary, the final population of the other nine algorithms fail consistently in finding all optima, despite that they have superimposed several times over some previously found optima.
When comparing the execution time (ET) in Table 3, CAB uses significantly less time to finish than other algorithms.The situation can be registered by the reduction of the redundancy in the M ℎ memory due to competition (dominance) criterion.All these comparisons show that CAB generally outperforms all other multimodal algorithms regarding efficacy and efficiency.

Comparing CAB Performance in Rough
Landscapes Functions.This section presents the performance comparison among different algorithms solving multimodal optimization problems which are listed in Table 2.Such problems hold lots of local optima and very rugged landscapes.The goal of multimodal optimizers is to find as many global optima as possible and possibly good local optima.Rastrigin's function  5 and Griewank's function  7 have 1 and 18 global optima, respectively, becoming practical as to test whether a multimodal algorithm can find a global optimum and at least 80 higher fitness local optima to validate the algorithms' performance.
Our main objective in these experiments is to determine whether CAB is more efficient and effective than other existing algorithms for finding the multiple high fitness optima of functions  5 - 8 .In the experiments, the initial population size for all algorithms has been set to 1000.For sequential fitness sharing, clearing procedure, CBN, clonal selection, SCGA, and AEGA, we have set the distance threshold   to 5. The algorithms' stopping criterion checks whenever the number of optima found cannot be further increased in 50 successive generations after the first 500 generations.If such condition prevails, then the algorithm is halted.We still evaluate the performance of all algorithms using the aforementioned four measures NO, DO, FE, and ET.
Table 4 provides a summary of the performance comparison among different algorithms.From the NO measure, we observe that CAB could always find more optimal solutions for the multimodal problems  5 - 8 .For Rastrigin's function  5 , only CAB can find all multiple high fitness optima 49 times out of 50 runs and its average successful rate for each run is higher than 97%.On the contrary, other algorithms cannot find all multiple higher fitness optima for any run.For  6 , 5 algorithms (clearing procedure, SCGA, AEGA, clonal selection algorithm, AiNet, and CAB) can get all multiple higher fitness maxima for each run, respectively.For Griewank's function ( 7 ), only CAB can get all multiple higher fitness optima for each run.In case of the modified Griewank's function ( 8 ), it has numerous optima whose value is always the same.However, CAB still can find all global optima with an effectiveness rate of 95%.From the FE and ET measures in Table 4, we can clearly observe that CAB uses significantly fewer function evaluations and a shorter running time than all other algorithms under the same termination criterion.Moreover, deterministic crowding leads to premature convergence as CAB is at least 2.5, 3.8, 4, 3.1, 4.1, 3.7, 1.4, 7.9, and 4.9 times faster than all others, respectively, according to Table 4 for functions  5 - 8 .

Individual Representation.
In order to detect circle shapes, candidate images must be preprocessed first by the well-known Canny algorithm which yields a single-pixel edge-only image.Then, the (  ,   ) coordinates for each edge pixel   are stored inside the edge vector  = { 1 ,  2 , . . .,    }, with   being the total number of edge pixels.Each circle  uses three edge points as individuals in the optimization algorithm.In order to construct such individuals, three indexes   ,   , and   are selected from vector , considering the circle's contour that connects them.Therefore, the circle  = {  ,   ,   } that crosses over such points may be considered as a potential solution for the detection problem.
Considering the configuration of the edge points shown by Figure 4, the circle center ( 0 ,  0 ) and the radius  of  can be computed as follows:

Objective Function.
In order to calculate the error produced by a candidate solution , a set of test points is calculated as a virtual shape which, in turn, must be validated, that is if it really exists in the edge image.The test set is represented by  = { 1 ,  2 , . . .,    }, where   is the number of points over which the existence of an edge point, corresponding to , should be validated.In our approach, the set  is generated by the midpoint circle algorithm (MCA) [63].
The MCA is a searching method which seeks the required points for drawing a circle digitally.Therefore MCA calculates the necessary number of test points   to totally draw the complete circle.Such a method is considered the fastest because MCA avoids computing square-root calculations by comparing the pixel separation distances among them.The objective function () represents the matching error produced between the pixels  of the circle candidate  (animal position) and the pixels that actually exist in the edge image, yielding where (  ,   ) is a function that verifies the pixel existence in (  ,   ), with (  ,   ) ∈ , and   being the number of pixels lying on the perimeter corresponding to  currently under testing.Hence, function (  ,   ) is defined as A value near zero of () implies a better response from the "circularity" operator.Figure 5 shows the procedure to evaluate a candidate solution  with its representation as a virtual shape .In Figure 5(b), the virtual shape is compared to the original image, point by point, in order to find coincidences between virtual and edge points.The virtual shape is built from points   ,   , and   shown by Figure 5(a).The virtual shape  gathers 56 points (  = 56) with only 18 of such points existing in both images (shown as blue points plus red points in Figure 5(c)) yielding ∑   =1 (  ,   ) = 18 and therefore () ≈ 0.67.

The Multiple-Circle Detection
Procedure.In order to detect multiple circles, most detectors simply apply a oneminimum optimization algorithm, which is able to detect only one circle at a time, repeating the same process several times as previously detected primitives are removed from the image.Such algorithms iterate until there are no more candidates left in the image.
On the other hand, the method in this paper is able to detect single or multiples circles through only one optimization step.The multidetection procedure can be summarized as follows: guided by the values of a matching function, the whole group of encoded candidate circles is evolved through the set of evolutionary operators.The best circle candidate (global optimum) is considered to be the first detected circle over the edge-only image.An analysis of the historical memory M ℎ is thus executed in order to identify other local optima (other circles).
In order to find other possible circles contained in the image, the historical memory M ℎ is carefully examined.The approach aims to explore all elements, one at a time, assessing which of them represents an actual circle in the image.Since several elements can represent the same circle (i.e., circles slightly shifted or holding small deviations), a distinctiveness factor  , is required to measure the mismatch between two given circles ( and ).Such distinctiveness factor is defined as follows:  the corresponding parameters of the circle   .One threshold value   Th is also calculated to decide whether two circles must be considered different or not.Th is computed as: where [ min ,  max ] is the feasible radii's range and  is a sensitivity parameter.By using a high  value, two very similar circles would be considered different while a smaller value for  would consider them as similar shapes.In this work, after several experiments, the  value has been set to 2. Thus, since the historical memory M ℎ { M 1 ,  M 2 , . . .,  M  } groups the elements in descending order according to their fitness values, the first element  M 1 , whose fitness value represents the best value ( M 1 ), is assigned to the first circle.Then, the distinctiveness factor (  M 1 , M 2 ) over the next element  M 2 is evaluated with respect to the prior 2 is considered as a new circle; otherwise the next element  M 3 is selected.This process is repeated until the fitness value ( M  ) reaches a minimum threshold  Th .According to such threshold, other values above  Th represent individuals (circles) that are considered significant while other values lying below such boundary are considered as false circles and hence they are not contained in the image.After several experiments the value of  Th is set to (( M 1 )/10).The fitness value of each detected circle is characterized by its geometric properties.Big and well-drawn circles normally represent points in the search space with higher fitness values whereas small and dashed circles describe points with lower fitness values.Likewise, circles with similar geometric properties, such as radius and size tend to represent locations holding similar fitness values.Considering that the historical memory M ℎ groups the elements in descending order according to their fitness values, the proposed procedure allows the cancelling of those circles which belong to the same circle and hold a similar fitness value.

Implementation of CAB Strategy for Circle Detection.
The implementation of the proposed algorithm can be summarized in the following steps.
Step 4. Choose the first  positions of X and store them into the memory M  .
Step 6. Generate the first  positions of the new solution set C({ 1 ,  2 , . . .,   }).Such positions correspond to the elements of M ℎ making a slight random perturbation around them: = m  ℎ + v, with being v a random vector of a small enough length. ( Step 7. Generate the rest of the C elements using the attraction, repulsion, and random movements: attraction and repulsion movement {if ( 2 < ) then } end for where  1 ,  2 ,  ∈ rand(0, 1).
Step 8.If  is not completed, the process goes back to Step 3. Otherwise, the best values in M ℎ { M 1 ,  M 2 , . . .,  M  } represent the best solutions (the best found circles).
Step 9.The element with the highest fitness value ( M 1 ) is identified as the first circle  1 .
The number of candidate circles   is set considering a balance between the number of local minima to be detected and the computational complexity.In general terms, a large value of   suggests the detection of a great amount of circles at the cost of excessive computer time.After exhaustive experimentation, it has been found that a value of   = 30 represents the best tradeoff between computational overhead and accuracy and therefore such value is used throughout the study.

Results on Multicircle Detection
In order to achieve the performance analysis, the proposed approach is compared to the BFAO detector, the GA-based algorithm, and the RHT method over an image set.
The GA-based algorithm follows the proposal of Ayala-Ramirez et al. [41], which considers the population size as 70, the crossover probability as 0.55, the mutation probability as 0.10, and the number of elite individuals as 2. The roulette wheel selection and the 1-point crossover operator are both applied.The parameter setup and the fitness function follow the configuration suggested in [41].The BFAO algorithm follows the implementation from [45] considering the experimental parameters as  = 50,   = 350,   = 4,  ed = 1,  ed = 0.25,  attract = 0.1,  attract = 0.2,  repellant = 10, ℎ repellant = 0.1,  = 400, and  = 6.Such values are found to be the best configuration set according to [45].Both, the GA-based algorithm and the BAFO method use the same objective function that is defined by (12).Likewise, the RHT method has been implemented as it is described in [40].Finally, Table 5 presents the parameters for the CAB algorithm used in this work.They have been kept for all test images after being experimentally defined.the detection results, the detection rate (DR) is introduced as a performance index.DR is defined as the percentage of reaching detection success after a certain number of trials.For "success" it does mean that the compared algorithm is able to detect all circles contained in the image, under the restriction that each circle must hold the condition Es < 1.Therefore, if at least one circle does not fulfil the condition of Es < 1, the complete detection procedure is considered as a failure.
In order to use an error metric for multiple-circle detection, the averaged Es produced from each circle in the image is considered.Such criterion, defined as the multiple error (ME), is calculated as follows: where  represents the number of circles within the image according to a human expert.Figure 6 shows three synthetic images and the resulting images after applying the GA-based algorithm [41], the BFOA method [45], and the proposed approach.Figure 7 presents experimental results considering three natural images.The performance is analyzed by considering 35 different executions for each algorithm.Table 6 shows the averaged execution time, the detection rate in percentage, and the averaged multiple error (ME), considering six test images (shown by Figures 6 and 7).The best entries are boldfaced in Table 6.Close inspection reveals that the proposed method is able to achieve the highest success rate keeping the smallest error, still requiring less computational time for most cases.
In order to statistically analyze the results in Table 6, a nonparametric significance proof known as the Wilcoxon's rank test [64][65][66] for 35 independent samples has been conducted.Such proof allows assessing result differences among two related methods.The analysis is performed considering a 5% significance level over multiple error (ME) data.Table 7 reports the  values produced by Wilcoxon's test for a pairwise comparison of the multiple error (ME), considering two groups gathered as CAB versus GA and CAB versus BFOA.As a null hypothesis, it is assumed that there is no difference between the values of the two algorithms.The alternative hypothesis considers an existent difference between the values of both approaches.All  values reported in Table 7 are less than 0.05 (5% significance level) which is a strong evidence against the null hypothesis, indicating that the best CAB mean values for the performance are statistically significant which has not occurred by chance.
Figure 8 demonstrates the relative performance of CAB in comparison with the RHT algorithm as it is described in [40].All images belonging to the test are complicated and contain different noise conditions.The performance analysis is achieved by considering 35 different executions for each algorithm over the three images.The results, exhibited in Figure 8, present the median-run solution (when the runs were ranked according to their final ME value) obtained throughout the 35 runs.On the other hand, Table 4 reports the corresponding averaged execution time, detection rate (in %) and average multiple error (using (10)) for CAB and RHT algorithms over the set of images (the best results are boldfaced).Table 8 shows a decrease in performance of the RHT algorithm as noise conditions change.Yet the CAB algorithm holds its performance under the same circumstances.

Conclusions
In recent years, several metaheuristic optimization methods have been inspired from nature-like phenomena.In this paper, a new multimodal optimization algorithm known as the collective animal behavior algorithm (CAB) has been introduced.In CAB, the searcher agents emulate a group of animals that interact with each other depending on simple behavioral rules which are modeled as mathematical operators.Such operations are applied to each agent considering that the complete group hold a memory to store its own best positions seen so far, using a competition principle.CAB has been experimentally evaluated over a test suite consisting of 8 benchmark multimodal functions for optimization.The performance of CAB has been compared to some other existing algorithms including deterministic crowding [17], probabilistic crowding [18], sequential fitness sharing [15], clearing procedure [20], clustering-based niching (CBN) [19], species conserving genetic algorithm (SCGA) [21], elitist-population strategies (AEGA) [22], clonal selection algorithm [24], and the artificial immune network (aiNet) [25].All experiments have demonstrated that CAB generally outperforms all other multimodal metaheuristic algorithms regarding efficiency and solution quality, typically showing significant efficiency speedups.The remarkable performance of CAB is due to two different features: (i) operators allow a better exploration of the search space, increasing the capacity to find multiple optima; (ii) the diversity of solutions contained in the M ℎ memory in the context of multimodal optimization is maintained and even improved through of the use of a competition principle (dominance concept).
The proposed algorithm is also applied to the engineering problem of multicircle detection.Such a process is faced as a multimodal optimization problem.In contrast to other heuristic methods that employ an iterative procedure, the proposed CAB method is able to detect single or multiple circles over a digital image by running only one optimization cycle.The CAB algorithm searches the entire edge map for circular shapes by using a combination of three noncollinear edge points as candidate circles (animal positions) in the edge-only image.A matching function (objective function) is used to measure the existence of a candidate circle over the edge map.Guided by the values of such matching function, the set of encoded candidate circles is evolved using the CAB algorithm so that the best candidate can be fitted into an actual circle.After the optimization has been completed, an analysis of the embedded memory is executed in order to find the significant local minima (remaining circles).The overall approach generates a fast subpixel detector which can effectively identify multiple circles in real images despite that some circular objects exhibit a significant occluded portion.
In order to test the circle detection performance, both speed and accuracy have been compared.Score functions are defined by (17) and (18) in order to measure accuracy and effectively evaluate the mismatch between manually detected and machine-detected circles.We have demonstrated that the CAB method outperforms both the GA (as described in [41]) and the BFOA (as described in [45]) within a statistically significant framework (Wilcoxon test).In contrast to the CAB method, the RHT algorithm [40] shows a decrease in performance under noisy conditions.Yet the CAB algorithm holds its performance under the same circumstances.Finally, Table 6 indicates that the CAB method can yield better results on complicated and noisy images compared with the GA and the BFOA methods.

Figure 1 :
Figure 1: Dominance concept, presented when two animals confront each other inside of a  distance.
Figure 2(b) depicts the initial individual distribution in the search space.Then, both memories M  (m 1  , . . ., m 4  ) and M ℎ (m 1 ℎ , . . ., m 4 ℎ ) are filled with the first four () elements present in X.Such memory elements are represented by solid points in Figure 2(c).

Figure 2 :
Figure 2: CAB numerical example.(a) 3D plot of the function used as example.(b) Initial individual distribution.(c) Initial configuration of memories M  and M ℎ .(d) The computation of the first four individuals (a 1 , a 2 , a 3 , a 4 ).(e) It shows the procedure employed by Step 2 in order to calculate the new individual position a 8 .(f) Positions of all new individuals (a 1 , a 2 , . . ., a 10 ).(g) Application of the dominance concept over elements of M  and M ℎ .(h) Final memory configurations of M  and M ℎ after the first iteration.(i) Final memory configuration of M ℎ after 30 iterations.

Figure 3 :Figure 4 :
Figure 3: Typical results of the maximization of  4 .(a)-(j) Local and global optima located by all ten algorithms in the performance comparison.

Figure 5 :
Figure 5: Evaluation of candidate solutions : the image in (a) shows the original image while (b) presents the virtual shape generated including points   ,   , and   .The image in (c) shows coincidences between both images marked by blue or red pixels while the virtual shape is also depicted in green.

Figure 6 :
Figure 6: Synthetic images and their detected circles for GA-based algorithm, the BFOA method, and the proposed CAB algorithm.

10 .
The distinctiveness factor   M  , M −1 of circle  M  (element ) with the next highest probability is evaluated with respect to  M −1 .If   M  , M −1 > Th, then  M  is considered as a new circle; otherwise the next action is evaluated.

Figure 7 :
Figure 7: Real-life images and their detected circles for GA-based algorithm, the BFOA method, and the proposed CAB algorithm.

m nearest ℎ and m nearest 𝑔 represent the nearest elements of M ℎ and M 𝑔 to x 𝑖
. .,   }, , while  is a random number between [−1, 1].Therefore, if  > 0, the individual position x  is attracted to the position m nearest

Table 1 :
The test suite of multimodal functions for Experiment 4.2.

Table 2 :
The test suite of multimodal functions used in the Experiment 4.3.

Table 3
provides a summarized performance comparison among several algorithms.Best results have been bold faced.From the NO measure, CAB always finds better or equally optimal solutions for the multimodal problems  1 - 4 .It is evident that each algorithm can find all optima of  1 .For function  2 , only AEGA, clonal selection algorithm, aiNet, and CAB can eventually find all optima each time.For function  3 , clearing procedure, SCGA, AEGA, and CAB can get all optima at each run.For function  4 , deterministic crowding leads to premature convergence and all other algorithms cannot get any better results, but CAB yet can find all multiple optima 48 times in 50 runs and its average successful rate for each run is higher than 99%.By analyzing the DO measure in Table

Table 3 :
Performance comparison among the multimodal optimization algorithms for the test functions  1 - 4 .The standard unit in the column ET is seconds.(For all the parameters, numbers in parentheses are the standard deviations.)Bold faced letters represent best obtained results.

Table 4 :
Performance comparison among multimodal optimization algorithms for the test functions  5 - 8 .The standard unit of the column ET is seconds (numbers in parentheses are standard deviations).Bold faced letters represent best results.

Table 6 :
The averaged execution time, detection rate, and the averaged multiple error for the GA-based algorithm, the BFOA method, and the proposed CAB algorithm, considering six test images (shown by Figures6 and 7).

Table 7 :
values produced by Wilcoxons test comparing CAB to GA and BFOA over the averaged ME from Table2.

Table 8 :
Average time, detection rate, and averaged error for CAB and HT, considering three test images.