Abstract
This paper discusses a novel and effective technique for extracting multiple ellipses from an image, using a genetic algorithm with multiple populations (MPGA). MPGA evolves a number of subpopulations in parallel, each of which is clustered around an actual or perceived ellipse in the target image. The technique uses both evolution and clustering to direct the search for ellipses—full or partial. MPGA is explained in detail, and compared with both the widely used randomized Hough transform (RHT) and the sharing genetic algorithm (SGA). In thorough and fair experimental tests, using both synthetic and real-world images, MPGA exhibits solid advantages over RHT and SGA in terms of accuracy of recognition—even in the presence of noise or/and multiple imperfect ellipses in an image—and speed of computation.
Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Avoid common mistakes on your manuscript.
1 Introduction
In this paper, we propose a novel Multi-population genetic algorithm (MPGA) for accurate and efficient detection of multiple perfect/partial ellipses in noisy images. The capability the algorithm provides is genuinely useful for many real-world image processing applications, such as object detection and pattern recognition, scene characterization and event detection, etc.
Similar to the Island Model of genetic algorithms, we evolve a number of separate subpopulations that cluster around potential local optima. Communications between these subpopulations are governed by a clustering mechanism, which is closely interwoven with the local evolutionary processes of each subpopulation. In addition, the MPGA uses two complementary measures of fitness, which contribute to the diversity of the subpopulations. This algorithm also uses a special constructive form of mutation, which considerably enhances the probability of creating fitter individuals (from the original ones). These improvements in technique result in a robust and efficient algorithm, which performs very well on images with multiple ellipses, imperfect ellipses, and those containing significant levels of noise. Our experiments confirm that, and show that MPGA has clear advantages over the widely used randomized Hough transform (RHT) [18], as well as the sharing GA (SGA) [10].
Section 2 provides the reader with some necessary background material as well as a discussion between related techniques. In Sect. 3, the new algorithm is explained in detail. Section 4 presents and analyzes the experimental results with a comparison of MPGA, RHT and SGA. Section 5 concludes the paper and summarizes planned future work.
2 Background
This section provides a review of previous research work on the detection of primitive geometric shapes, as well as on multi-modal search and optimization.
2.1 Geometric primitive detection
There exist various techniques for detecting geometric primitives. In [19], short straight lines are extracted first, using a fast line extraction algorithm. The arc segments are then formed from these straight lines using a least-square algorithm. Finally, the arc segments are merged and used to calculate ellipse/circle parameters, using a least-square ellipse fitting algorithm.
Ke et al. [20] uses a Tabu search technique. Tabu search uses a tabu list (short-term memory), which keeps track of recent solutions, to prevent the search from becoming trapped in a local minimum. At each iteration, a number of new solutions around the current solution are generated. Among them, the best solution that is not tabu, or that is tabu but satisfies certain so-called aspiration conditions is set as the current solution. The search stops when a certain termination criterion is satisfied.
The Upwrite method [21] uses a spot algorithm to compute local models of pixels within a small resolution radius r. If r is small enough, the data in the neighborhood can be modeled with a straight line. The set of local models positioned along the same geometric primitive are then grouped together. Finally, each geometric feature is characterized by Zernike moments as: lines, circles, ellipses or other.
The Hough transform (HT) is one of the most widely used techniques for the detection of various geometric shapes [8]. It works by representing a geometric shape by a set of appropriate parameters, then accumulating bins in the quantized parameter space. Peaks in the bins provide the best indication of where shapes may be. Obviously, since the parameters are quantized into discrete bins, the intervals of the bins directly affect the accuracy of the results and the computational effort. For fine quantization of the space, the algorithm returns more accurate results, while suffering from large memory loads and expensive computation—especially in high-dimensional feature spaces. Hence, the SHT is most commonly used in 2D or 3D feature spaces and is unsuitable for higher dimensional spaces.
One of the fastest and most widely used variant of the Hough transform is the RHT proposed by Xu et al. [18]. In the RHT, a bin represents a candidate shape, rather than a set of quantized parameters, as in the SHT. However, like the SHT, the RHT goes through an accumulation process for the bins. The bin with the highest score represents the best approximation of an actual shape in the target image. McLaughlin’s work [13] shows that RHT produces improvements in accuracy and computational complexity, as well as a reduction in the number of false positives (non existent ellipses), when compared with the original HT and number of its improved variants.
Many HT-based methods have been developed. They improve on the efficiency of the HT by exploiting geometric characteristics of the ellipses, such as slope [5, 22, 24] and symmetry [7, 9], or by using intelligent means of dimensionality reduction [5, 7, 9, 22–24].
In [5] and [22], pairs of points on the ellipse are used to form lines that intersect at the center of the ellipse. Then, the semi-axis ratio and orientation of the ellipse are found, through a process that employs two 2D accumulators. Finally, the parameters of the major and minor axes of the ellipse are computed, using the set of four parameters found previously.
Cheng and Liu [24] use three points on an ellipse to locate the centre of the ellipse, with a mechanism similar to that used in [5] and [22], above. Then, they use an accumulator, similar to that used by the RHT, with bins representing candidate ellipses. However, they improve the efficiency of the RHT by applying the transform to a restricted sub-set of points, selected by a labeling algorithm.
Ho et al. [7] and Lei et al. [9] use properties of geometric symmetry of ellipses to calculate some parameters of an ellipse, such as the co-ordinates of the center, followed by the computation of the remaining parameters, such as the lengths of the major and minor axes.
Xie and Ji [23] use the two endpoints of the major axis and a third point on the ellipse to calculate various possible lengths for the minor axis, and then use a 1D accumulator to identify the most likely length of the minor axis.
The genetic algorithm (GA) is another interesting way for extracting ellipses. As early as 1992, Roth et al. [15] proposed a way of extracting geometric shapes using Genetic Algorithms. Since then, a number of GA-based techniques have been developed for the purpose of detecting specific geometric shapes such as straight lines [2], ellipses [10–12, 14, 25], and polygons [10–12].
Inspired by natural evolution, a GA encodes a potential solution as a chromosome, and evolves a population of chromosomes iteratively, until a satisfactory solution is found. A GA performs a parallel beam search, which may be viewed as a combination of a hill climber and a random searcher.
Kasemir and Betzler [25] combine a modified version of the Hough transform (HT) with a GA to detect ellipses of limited eccentricity. The HT identifies the best set of candidates, with a preset ellipse center. The GA searches a 2D space of ellipse centers, to locate the best center. As the authors state, given a population of size N, each iteration of the GA’s main loop, requires N runs of the HT. Therefore, this specific algorithm has very high computational demands.
Yin [26] adopts a hybrid scheme, which consists of a GA phase, and a local search phase. During the GA phase, a number of candidates with fitness values above a certain threshold are fed into the next phase. During the local search phase, a heuristic is used to produce the best set of candidate solutions, starting from the set of GA-generated candidates.
Lutton et al. [10] uses a SGA, first introduced by Goldberg et al. [3], to detect geometric primitives. We will explain the SGA, in some detail, in the next section.
Procter et al. [14] made an interesting comparison between GA and RHT. These two techniques have the following features in common:
-
Representation of geometric shapes using minimal sets of parameters.
-
Random sampling of image data.
-
Sequential extraction of multiple shapes.
Their experiments clearly demonstrate that GA-based techniques return superior results to those produced by RHT methods when a high level of noise is present in the image, but RHT methods are more attractive for relatively noise-fee images.
Indeed, for an elliptical curve with length L pixels in an image with a total of A pixels, the probability of locating this curve from a single sample is
where n is the dimensionality of the geometric shape and Cy X is the unordered selection of y pixels from the complete pixel set X.
With the same probability P, for each sampling and the same number of samples (say N), RHT gets N independent chances of detection when exploring the search space sequentially. In contrast, a GA explores the search space in parallel (using a population with size M), while guiding the search towards promising areas within N/M generations. Moreover, unlike the RHT, which locates peaks in the fitness surface after an exhaustive search of the space, a GA generates new improved individuals from existing ones, mainly through crossover and mutation. The RHT executes a blind sequential search, while a GA is able to search the space iteratively with feedback and in parallel. Hence, GA based algorithms have inherent strengths which, if properly used, can make them a better approach than any RHT based algorithm.
Of course, if there is only a small amount of noise in the image (L ≈ A and P ≈ 1), RHT will converge quickly, since each sampling has a high probability of locating the target shape. However, in cases where there is a lot of noise, multiple ellipses, or partial ellipses with some noise, RHT tends to overlook small elliptical curves, since Cn L decreases dramatically with a small L, which leads to an extremely small P. In this case, a GA-based algorithm is likely to converge faster, and exhibit more robustness as well as accuracy than the RHT. This conclusion matches the experimental results of Procter et al. [14] and is further supported by our own experiments (see Sect. 4).
In summary, the core of an HT-based technique is a polling process, which is equivalent to a blind sequential search of the search space. On the other hand, the core of a GA-based technique is a parallel semi-directed search of the search space. This inherent difference between these two approaches is at the root of their widely differing performances, as exhibited in our own experiments.
2.2 Multi-modal optimization
Roth and Levine [27] have shown that extracting a single geometric primitive is an optimization problem. Extracting multiple geometric primitives, therefore, falls into the category of multi-modal optimization, where several optima are sought.
An intuitive solution is to extract the primitives sequentially, as in [2, 14, 15], via appropriate ways of search. This entails removing detected primitives from the image, one at a time, and iterating, until there are no more candidates left in the image. Obviously this approach does not make good usage of GA’s implicit power of parallelism and suffers from high computational redundancy.
A standard GA, however, drives the population towards a single global optimum. In the presence of multiple optima, the final winner is obtained randomly. Moreover, when there are both perfect and imperfect candidates, the latter, being locally optimum, will most likely be replaced with better individuals during evolution, and eventually ignored.
Various methods have been used to enhance the diversity within a GA. Most of them fall into two broad categories: genetic operator-based techniques and population-based techniques. Sharing [3, 10] and Crowding [28] are examples of operator-based techniques, which use special genetic operators to reduce genetic drift. On the other hand, the multinational GA [29] and the forking GA [30] preserve diversity by explicitly manipulating a group of subpopulations, which are evolved independently, with little-to-no interbreeding between the subpopulations.
The SGA [3, 10] maintains the diversity of the population by scaling up the fitness of local optima, so that they would stand out. In this scheme, fitness is shared among similar individuals, and hence, the fitness of those individuals with many neighbors is decreased. Thus, population diversity is maintained by encouraging the exploration of less crowded regions of the fitness surface.
Unfortunately, Sharing is based on the assumption that the neighborhoods of local optima are less crowded than the neighborhood of the global optimum and therefore, the fitness of local optima will be enhanced by sharing. This assumption is not valid for the application of primitive extraction, as imperfect primitives may attract many neighbors with a high probability P, as long as they contain a sufficiently large number of pixels [refer to Eq. (1)]. This will deflect the search from exploring potentially promising areas, and will, often, result in missed candidates.
Figure 1 provides a concrete example. After running the SGA, to convergence, with a population size of 100, the individual at the center of the densest subpopulation is represented in Fig. 1b by an overlaid grey ellipse. Naturally, the left ellipse will attract more individuals around it since it is larger, while it corresponds to a local optimum (with suboptimal fitness). If the sharing function is applied, the fitness of the suboptimal individual will be shared with the rest of its dense neighborhood, resulting an even worse fitness than before. Therefore, sharing in this example defeats the purpose of the exercise.
Furthermore, Smith et al. [16] highlighted the fact that the computation of the distance of an individual to any/all other individuals in a population has a time complexity of O(N2), where N is the size of the population.
Another issue associated with the SGA technique is that it runs an overall population of fixed size, with a number of variable-sized niches centered around different optima. Without a priori knowledge about the actual number of optima, it will be hard to estimate the appropriate size of the overall population, which, if too small, would result in missed potential optima, due to limited resources.
Unlike the SGA, the other school of GA variants, including the multinational GA [29] and the forking GA [30], maintain a variable number of fixed-sized subpopulations, with the number depending on the number of optima present. Therefore, every potential optimum is assured the same amount of computational resources, during exploration.
Taking into account the nature of the application, we developed and tested a new multiple-population GA, with the following key features:
-
A bi-objective fitness evaluation mechanism, which effectively enhances the diversity of the GA population.
-
Interwoven clustering and evolution processes, which maintain convergence of each sub-population towards the original local optimum (about which the cluster had been formed).
-
A specially designed mutation operator, which is effective in generating fitter candidate ellipses.
Experiments show that this algorithm works well with presence of multiple perfect/imperfect ellipses and high noise.
3 The multi-population genetic algorithm
The overall operation of the MPGA is presented graphically in Fig. 2.
Initially, a single population is created by creating a number of chromosomes whose genes (see Sect. 3.2) are randomly selected from the set of foreground pixels in the image. The population is then evaluated and ranked using both fitness terms. A clustering technique divides the chromosomes into a number of clusters (or subpopulations), if necessary. From that moment on, all the subpopulations are evolved, in parallel. If one of them converges on an optimal chromosome, the whole subpopulation and corresponding ellipse in the image are removed. This has a positive side effect of accelerating the search process, since the search space is shrunk. The program, as a whole, terminates when all (full and partial) ellipses are found, or when a pre-set maximum number of generations is reached.
The following sections elaborate the details of key steps in our algorithm, starting with an introduction to elliptic geometry and concluding with evolution.
3.1 Ellipse geometry
Chromosomes, in the MPGA, are no more than candidate ellipses, and hence understanding the geometry of ellipses is essential to understanding chromosomal representation. The ellipse equation can be written as:
Assuming we have five distinct points on the perimeter of an ellipse, we can solve five linear equations to obtain a, h, b, g and f. Hence, the geometric parameters (the long and short radii of an ellipse, the co-ordinates of the center and the orientation with respect to the X axis) for an ellipse are computed, by substituting the values of a, h, b, g and f into a set of five equations, listed in [14].
3.2 Representation and initialization
We represent chromosomes with a minimal set of points on the shape’s perimeters, as in [15]. Specifically for ellipses, each chromosome contains five genes, each of which is a point with its horizontal and vertical coordinates.
There are, in the literature, alternative ways of chromosomal encoding. For example, Mainzer [11, 12] represents an ellipse directly using its five geometric parameters, i.e., major/minor axes, center, and orientation. While Lutton et al. [10] encode an ellipse using the center O; a point on its perimeter P; and rotation angle a. They claim that their representation is preferable to Roth’s representation, as the latter allows for redundancy, since different chromosomes (with different sets of five points) may refer to the same ellipse.
Nevertheless, the encoding of ellipses via their geometric parameters is problematic, as this does not guarantee the actual existence of the corresponding candidate ellipse. Unlike the minimal point-set representation, which uses five pixels on the perimeter of an ellipse (or elliptic curve), and only deals with real points on real curves, the parameter-based technique will spend at least part of their time evaluating non-existent ellipses.
We allow for phenotype duplicates, while ignoring the redundancy problem identified by Mainzer. A chromosome with a good genotype (i.e., one with five points, all lying on an actual ellipse) does not necessarily have optimum fitness. This is due to the digital displacement error of pixels. Redundancy enhances the possibility of obtaining new fitter chromosomes via (a) crossover of phenotypically close parents or (b) mutation of a highly fit chromosome.
The MPGA creates an initial population of 40 chromosomes. The five points comprising each new chromosome are selected, at random, from the set of foreground (or black) pixels in the target image.
3.3 Fitness evaluation
Most of the reported work in this area, such as [10–12], evaluates the fitness of a chromosome by, essentially, counting the number of black pixels in the target image that coincide with the perimeter of the candidate ellipse.
To enhance the robustness of the matching function, Mainzer [11, 12] distinguishes pixels lying near the perimeter of an ideal ellipse from those far from it, and assigns a penalty to the latter. Mainzer defines fitness S of a given candidate ellipse as
Where E(x+i, y+j) is a function that returns 1 if there exists a foreground pixel (x+i, y+j) co-incident with, or close to a pixel (x,y) on the candidate ellipse. Otherwise the function returns 0. i and j are the horizontal and vertical displacements, respectively, between the two pixels. c is a constant determined by the nature of the image. Finally, MAX returns a maximal value over all combinations of i and j. The maximum is obtained whenever E(x+i, y+j) returns 1 and the second-term 1/c(|i|+|j|) returns a minimum. Equivalently, MAX looks for an appropriate pixel (x+i, y+j) that is closest to (x, y).
Lutton et al. [10] use a Chamfer distance map with each pixel assigned a grey value indicating its distance to the nearest contour point. This distance map is computed from the original image using two morphological masks. Like Mainzer, they also punish points not exactly on the perimeter of a candidate ellipse, using a displacement factor. The manual tuning of the two distance parameters in the mask requires extra preparatory work, before the algorithm can be used.
Lutton et al. [10] also introduced another fitness term that counts effective contour pixels “to favor bigger primitives”. However, bigger primitives are not necessarily better ones; and the extent to which an actual pattern matches a candidate shape has nothing to with the pattern’s absolute length or size.
In order to detect full as well as partial multiple ellipses with varying types and degrees of imperfections, we propose a bi-objective scheme, i.e., the fitness of a chromosome is measured in two terms: Similarity and Distance.
3.3.1 Similarity (S)
How much the actual pixels match the perimeter of an ideal complete ellipse. S is defined as:
Like Mainzer’s definition above, for a given point (x, y) on the candidate ellipse, the term E(x+i,y+j) returns one, if there is a point (x+i, y+j) that coincides with, or is close to (x, y); otherwise E(x+i,y+j) returns 0. The terms i and j represent the horizontal and vertical displacements, respectively, between the “ideal” pixel (x, y) and the actual pixel (x+i, y+j). #total is the total number of pixels on the candidate ellipse’s perimeter. dx,y is a distance factor (note that it is different from the fitness term distance defined later) used to punish those pixels far away from the ideal pixel (x, y). It is given by
where e is the natural logarithm base, and i and j are the same terms of i and j in Eq. 4
Figure 3 shows how an actual point (Q) is determined with respect to an ideal point (P) and how the distance factor dx,y between them is computed. The dashed arc belongs to an ideal template with center C. The solid arcs are the actual pixels in the image. If P does not coincide with any point in the image, a line is originated from C passing through P. A fast search, based on Brensenham’s algorithm [6], is initiated from P, both outward and inward, along this line, until the first actual point is reached (Q). The horizontal and vertical displacements i and j between them are used to compute dx,y as in Eq. 5.
To compute S efficiently, we further assume that the ideal template is centered at the origin of co-ordinates with a horizontally aligned long axis (Fig. 4). A classic midpoint ellipse algorithm [6] is then used to traverse the perimeter of this candidate ellipse. This algorithm favors integer computation and only computes a quarter of the ellipse’s perimeter. All the other points in the remaining three quadrants are obtained from symmetry. Each computed pixel is matched to its “actual” ideal position using
Where (x, y) are the original coordinates, (x′,y′) are the transformed coordinates, and θ is the orientation. Finally, the term E(x+i,y+j) is replaced by E′(x+i,y+j), giving us the final form of the similarity equation
3.3.2 Distance (D)
how far or close is the actual pattern to the ideal ellipse. It is defined as:
The term dx,y is defined in Eq. 5 above.#eff is the total number of actual points that are successfully matched with points on the ideal ellipse.
Figure 5 and Table 1 provide an intuitive explanation of these two fitness terms. The dashed arcs are ideal templates, with the detected ellipses, drawn using solid arcs. Ellipse 1 is a perfect ellipse, with Similarity S=0.995758 and Distance D=0.010167. (Ideally, the values should be 1 and 0, respectively. However, they are as such, due to digital rounding errors). Ellipse 2 is an incomplete pattern with the lowest Similarity among the three ellipses, while its Distance is as good as ellipse 1, since all its actual points lie exactly on the ideal template. Ellipse 3 is a complete but irregular ellipse. Its Similarity value lies between those for ellipses 1 and 2, while its Distance value is greater than both, due to its irregular segment AB, which is somewhat distant from the ideal trace.
The bi-objective fitness scheme enhances the probability of survival of candidate ellipses that have low fitness relative to one of the two fitness terms and high fitness relative to the other term. Indeed, if only one of the two fitness terms is used, then many imperfect but promising ellipses (such as ellipse 2 or 3) will eventually be deselected, resulting in a significant reduction in population diversity.
It is also worth stressing that the detection of more than one primitive shapes, ellipse or otherwise, in an image, is in essence a multi-modal optimization problem, where several optima are present. The essential challenge of such problems is to craft algorithms that do not focus the search on any one optimum point. Instead, the algorithm should proceed to explore all areas of potential optima. Hence, measures that increase the diversity of a GA population, such as the use of two (or more) fitness terms, may well lead to a more comprehensive search and, as our results will show, more comprehensive results.
3.4 Clustering: migration, splitting, and merging
The clustering process in the MPGA algorithm involves migration, splitting, and merging. The Euclidean distance ED between a chromosome and various existing cluster centers determines whether it remains in its own cluster or migrates. ED is computed as follows: given two sets of ellipse parameters (a1, b1, x1, y1, ω1) and (a2, b2, x2, y2, ω2):
a i and b i are the long- and short-axes, respectively; (x i , y i ) is the center and ω i is the orientation. When a chromosome migrates from subpopulation A to subpopulation B, it replaces the weakest chromosome in the latter, and the vacancy in the former is filled by the processes of evolution (see Sect. 3.5).
3.4.1 Migration
If the Euclidean distance between a chromosome and its own cluster centre is lower than a pre-defined threshold, this chromosome migrates to another cluster with the closest centre to it.
3.4.2 Splitting
If there is not any cluster sufficiently close to the migrating chromosome, a new cluster is created around this chromosome. This action is called splitting.
3.4.3 Merging
An empirically derived threshold is used to define the minimum allowable Euclidean distance between any two different cluster centers. As two different clusters may evolve toward the same optimum, any two clusters sufficiently close to each other are merged, by mixing all chromosomes of them and taking the fittest 50% in the new cluster. This action is called merging.
All clusters are checked periodically to see whether some of them could be merged. Merging is barred, however, for earlier generations in order to allow steady clusters formed around the optima. Splitting and migration occur whenever a new chromosome (e.g., offspring, mutated individual, etc.) should be moved.
3.5 Evolution: selection and diversification
The MPGA is a bi-objective GA, since its fitness evaluation scheme uses two fitness terms. However, it is not a typical multi-objective optimizer that seeks a set of Pareto-optimal solutions [31], which satisfy several (usually conflicting) objective functions. The two objectives used in MPGA do not conflict with each other. On the contrary, they usually reach their optima concurrently. Therefore, the evolutionary strategies used are especially tailored to meet our requirements, and are not meant as general multiple-objective optimization strategies.
3.5.1 The evolutionary process
Evolution proceeds mainly via selection and diversification. Selection eliminates those chromosomes in the population that are not very fit, focusing the search on promising areas of the fitness surface. On the other hand, diversification directs the search towards new and potentially promising areas. In MPGA, selection is realized using elitism and fitness ranking selection. Diversification is realized via crossover and mutation.
Two rank-based lists are compiled for each subpopulation: one for Similarity and the other for Distance. Elitism copies the fittest 5% of the chromosomes in each of the two lists into the next generation, without modification. Following that, the parent pairs are selected based on a probability P. If P is larger than 0.5, the parents are randomly selected from the Similarity list, otherwise they are taken from the Distance list. In both cases, rank-based selection is performed, i.e., the probability of a chromosome to be selected is proportional to its relative ranking, rather than its raw fitness, in the subpopulation. The parents are mated, and offspring are put into the new generation.
Crossover continues until the number of chromosomes in the new generation reaches 90% of the preset subpopulation size. The remaining 10% is filled by randomly creating new chromosomes as described in Sect. 3.2. This operation is equivalent to discarding the worst 10% of a subpopulation and replacing them with newly created chromosomes.
Finally, mutation is applied to the whole subpopulation with a probability of 5%. Mutation is described in Sect. 3.5.3.
As stated in Sect. 3.4, every new chromosome introduced into the next generation is tested to see if it belongs to a different (or none of the) subpopulation(s) from the subpopulation that its predecessor(s) belonged to. If that is the case, an immediate action is taken, to either move the chromosome to a different existing subpopulation, or create a new subpopulation for it. This embedding of clustering within evolution ensures that the original direction of convergence within a subpopulation is maintained, despite the possible appearance of new highly fit and potentially distracting chromosomes.
3.5.2 Crossover
Given the fact that each chromosome is defined by a set of points on the perimeter of an ellipse, we can assert that simple single point crossover is an effective method. A pivot is selected at random, and the parent chromosomes’ genes on either side of the pivot are swapped to create the offspring, as shown in Fig. 6. A possible positive effect of the crossover is shown in Fig. 7.
3.5.3 Mutation
A standard mutation randomly selects a gene (in our case: a pixel), and reassigns it a new value. This operation is global, in the sense that the new value of the gene is picked, at random, from all foreground pixels in an image. As an alternative, we define a localized mutation operator configured specifically for our application. First, a point is randomly selected from the chromosome (P1P2P3P4P5) that we intend to mutate, as shown in Fig. 8. Starting from this point (P1), a local path r is then traversed with a trace tracking algorithm, until a preset maximum number of points, or an end/intersection point, is reached. If r is large enough, the remaining four genes Q2–Q5 are picked, at random, from it. Therefore, the original chromosome (P1P2P3P4P5) is mutated into a new one (P1Q2Q3Q4Q5), with all the genes (P1, Q2, Q3, Q4, and Q5) lying on the same curve. Clearly, as long as the starting point lies on a promising candidate, it is highly possible that the other four points will too.
In summary, a localized mutation actually replaces four genes within a chromosome, while a standard mutation replaces only one; the former randomly picks up new points on a local path originating from a selected starting point, while the latter picks up new points, indiscriminately, from the whole image. Therefore, the new localized mutation enhances the possibility of mutating an existing candidate into a fitter one.
4 Experimental results and analysis
This section compares the performances of the MPGA, SGA, and RHT algorithms, using synthetic and real-world images. To carry out a fair comparison, we use the same numerical technique for computing the geometric parameters of an ellipse (see Sect. 3.1) and the same method for computing fitness (described in Sect. 3.3). For GA-based techniques (SGA and MPGA), the same genetic operators are used (e.g., crossover and mutation).
We have two main categories of test data, which are synthetic images and real world images. Accuracy is defined as the ratio of correctly detected ellipses with respect to the total number of ellipses actually present in the target image. Over detection is reflected in the false positive (fp) statistics. All the experiments were run on an Intel Xeon 2.66 GHz w/ 512 KB of cache, 512 MB DDR RAM and running Red Hat Linux 8.0.3.2–7.
4.1 Synthetic images
The synthetic images are comprised of two sets, set A and set B. Set A is partitioned into seven collections of 50 images each, totaling 350 images. These collections are used to test the algorithms’ performances on images with different number of ellipses. The first collection contains 50 images of single ellipse, the second collection contains images of two ellipses, and so on. The last collection contains 50 images of seven ellipses.
Set B, on the other hand, is used to test the algorithms’ performance on noisy images. This set is made of five collections of 50 images each, totaling 250 images. The first, second, third, fourth and fifth collections contain images with 0, 0.5, 1, 3 and 5% salt-and-pepper noise, respectively.
The ellipses in the synthetic image database are not all full and perfectly formed ellipses; we make sure that some images in both sets have at least one partial or deformed ellipse. A typical example is presented in Fig. 9, in which there are five ellipses, two of which are malformed. The figure also shows the results of applying MPGA, RHT, and SGA to this image.
As seen in Fig. 9c, RHT misses the smallest ellipse since (in line with Eq. 1) the probability of locating it is smaller than the probability of locating the other larger ellipses. The fitness values shown in Table 2 are Similarity only because Similarity is the only measure/factor of fitness used by all these three algorithms. Uniquely and exclusively, the bi-objective scheme is part of the core mechanism of the MPGA algorithm, while RHT and SGA do not use a second fitness term.
In reference to Table 2, MPGA returns better fitness values than RHT for ellipses 1, 2 and 3. This is because MPGA, via evolution, executes an iterative and parallel search, focused at different localities of the search space, and is able to progressively improve the fitness of the candidates; while the RHT carries out a one-shot blind search through the whole space.
Figure 10 contrasts the performance of the three algorithms in terms of accuracy as well as average CPU running time. Figure 10a shows that the accuracy of SGA decreases dramatically as the number of ellipses increase. Similarly, the accuracy of RHT also decreases gradually from 100% for one ellipse to approximately 80% for seven ellipses. In contrast, MPGA outperforms the other two algorithms by maintaining an almost perfect level of detection accuracy, and slightly dipping to around 98%, for images with seven ellipses.
Figure 10b demonstrates the clear advantage that MPGA has over both RHT and SGA with regards to speed. It graphs the amount of CPU time used by various algorithms with 1–7 ellipses. There is almost no difference in speed for images with four or less ellipses. However, for five or more ellipses, MPGA realizes a clear and widening gap.
Figure 11a shows a typical image with 5% pepper-and-salt noise (Table 3). Ellipses detected by MPGA are shown in Fig. 11b and Table 3.
Generally, RHT is more liable to false positives (i.e., the detection of non existing ellipses), as demonstrated in Fig. 11c.
Figure 12 shows the performance of these algorithms on noisy images. Again, MPGA shows considerable robustness in the presence of salt-and-pepper noise, while simultaneously operating faster than the other two algorithms.
Many false positives are observed for RHT with high noise, as Fig. 13 shows. This fact further fortifies our claim (in Sect. 1) that RHT searches the space and accumulates votes blindly.
4.2 Real-world images
A large, carefully constructed database of synthetic images (600, in our case) provides the bases for comprehensive tests, which give specific feedback about potential problems with detection algorithms. Nevertheless, it is real-world images that determine the difference between a genuinely useful and purely academic novel algorithm. Hence, we have amassed three databases of intentionally different types of images: hand-written English letters, microscopic cell images and road signs. The databases are of varying size, but contain images that were collected, prior to even the design of MPGA. From each of the databases, 50 images are selected at random and used for assessing the real-world performance of MPGA, RHA, and SGA. On visual inspection, we noticed that these images contain: all kinds of combinations of perfect and deformed ellipses, noise levels, and other geometric shapes (e.g. lines, polygons).
Figure 14a shows a typical handwritten character with elliptical curves detected.
In Table 4, we can see that MPGA is slower than RHT. As discussed in Sect. 1, when the image is relatively simple, noise-free and does not have many overlapping patterns, RHT is expected to run faster than MPGA. However, RHT still suffers from false positives, as Fig. 14c shows.
Figure 15a is a typical microscopic image of cells (Table 5). Again, MPGA shows its obvious advantage over RHT and SGA in both accuracy and speed. Although RHT approximates all eight cells, it suffers from large misplacement (see cells labeled: a, b, c and d in Fig. 15d, Table 5) and long running time; SGA fails to detect even a single ellipse.
Figure 16 is a typical image of a road sign (Table 6). We can see that neither RHT nor SGA is able to detect partial ellipses, especially when there are also perfect ellipses in the image. They are generally slower than MPGA in this kind of complicated images.
Table 7 gives out the overall performance for real-world images. From the table, we can see that SGA is almost totally ineffective with complicated real world images; it returns an average accuracy of less than 20%. RHT suffers from long computation times and high fp rate. There are some fp (6.9048%) for MPGA as well, because the algorithm may sometimes approximate polygons with ellipses. One possible solution is to detect low-dimensional shapes first (e.g., lines) and remove them from the image, before detecting circles and ellipses. This way, the process can be both made more efficient and more accurate.
5 Conclusions and future work
This paper presents a multi-population based GA, using a novel bi-objective scheme, specially configured genetic operator (e.g., mutation), and an elaborate process of evolution-clustering, to efficiently and accurately detect multiple, potentially deformed, full and partial ellipses in noisy images. This algorithm was thoroughly tested on a large number of synthetic and three types of real-world images, and compared to the very widely used RHT and one of the best-available GA-based ellipse detection technique—SGA. Despite the conceptual complexity of the MPGA algorithm, the program is, generally speaking, more efficient and accurate than both RHT and SGA. It can be easily extended to detect other geometric primitives. However, this does not mean that there is no room for improvements.
We intend to improve the MPGA by getting to
-
1.
Detect other geometric primitives (e.g., lines and polygons) in order to analyze complicated scenery;
-
2.
Run without the need for prior tuning of GA parameters, such as mutation and crossover probabilities. This can be done by incorporating the ideas of Parameterless GAs, which we have already successfully experimented with, but only using mathematically defined fitness surfaces.
References
Ballard DH (1981) Generalizing the hough transform to detect arbitrary shapes. Pattern Recognit 13(2):111–122
Chakraborty S, Deb K (1998) Analytic curve detection from a noisy binary edge map using genetic algorithm. PPSN, pp 129–138
Goldberg DE, Richardson J (1987) Genetic algorithms with sharing for multimodal function optimization. In: Grefenstette JJ (ed) Proceeding of the 2nd international conference on genetic algorithms. Lawrence Erlbaum, Hillsdale, pp 41–49
Grimson WEL, Huttenlocher DP (1990) On the sensitivity of the Hough transform for object recognition. IEEE Trans Pattern Anal Mach Intel 12(3):255–274
Guil N, Zapata EL (1997) Lower order circle and ellipse Hough transform. Pattern Recognit 30(10):1729–1744
Hearn, Baker MP (1997) Computer graphics C, Version D. Prentice Hall, Eagleeood Cliff
Ho CTA, Chen LH (1995) A fast ellipse/circle detector using geometric symmetry. Pattern Recognit 28(1):117–124
Hough PVC (1959) Machine analysis of bubble chamber pictures. In: International conference on high energy accelerators and instrumentation, CERN
Lei Y, Wong KC (1999) Ellipse detection based on symmetry. Pattern Recognit Lett 20(1):41–47
Lutton E, Martinez P (1994) A genetic algorithm for the detection of 2D geometric primitives in images. In: Proceedings of the 12th international conference on pattern recognition, Jerusalem, Israel, 9–13 October 1994, 1:526–528
Mainzer T (2002) Genetic algorithm for traffic sign detection. Appl Electron
Mainzer T (2002) Genetic algorithm for shape detection, Technical report no. DCSE/TR-2002–06, University of West Bohemia
McLaughlin RA (1998) Randomized hough transform: improved ellipse detection with comparison. Pattern Recognit Lett 19(3–4):299–305
Procter S, Illingworth J. A comparison of the randomized hough transform and a genetic algorithm for ellipse detection. In: Gelsema E, Kanal L (eds) Pattern recognition in practice IV: multiple paradigms, comparative studies and hybrid systems. Elsevier Science Ltd., pp 449–460
Roth G, Levine MD (1994) Geometric primitive extraction using a genetic algorithm. IEEE Trans Pattern Anal and Mach Intel 16(9):901–905
Smith RE, Forrest S, Perelson AS (1992) Searching for diverse, cooperative populations with genetic algorithms, TCGA Report No. 92002, The University of Alabama, Department of Engineering Mechanics
Press WH et al (1992) Numerical recipes in C, The art of scientific computing, 2nd edn, Chapter 2. Cambridge University Press, pp 43–50
Xu L, Oja E, Kultanen P (1990) A new curve detection method: randomized hough transform (RHT). Pattern Recognit Lett 11(5):331–338
Kim E, Haseyama M, Kitajima H (2002) Fast and robust ellipse extration from complicated images. in: International conference on informatio technology and applications
Ke Q, Jiang T, Ma S (1997) A tabu search method for geometric primitive extraction. Pattern Recognit Lett 18(14):1443–1452
McLaughlin RA, Alder MD (1998) The hough transform versus the upwrite. IEEE Trans Pattern Anal Mach Intel 20(4):396–400
Zhang SC, Liu ZQ (2005) A robust, real-time ellipse detector. Pattern Recognit 38:273–287
Xie Y, Ji Q (2002) A new efficient ellipse detection method. ICPR, pp 957–960
Cheng Z, Liu Y (2004) Efficient technique for ellipse detection using restricted randomized hough transform. in: International conference on information technology: coding and computing
Kasemir KU, Betzler K (2003) Detecting ellipses of limited eccentricity in images with high noise levels. Image Vision Comput 21:221–227
Yin PY (1999) A new circle/ellipse detector using genetic algorithms. Pattern Recognit Lett 20:731–740
Roth G, Levine MD (1993) Extracting geometric primitives. CVGIP: image understanding 58(1):1–22
Jong KAD (1975) An analysis of the behavior of a class of genetic adaptive systems. PhD Thesis. University of Michigan
Ursem RK (1999) Multinational evolutionary algorithms. in: Proceedings of the congress on evolutionary computation 3:1633–1640
Tsutsui S, Fujimoto Y (1993) Forking genetic algorithm with blocking and shrinking modes (FGA). In: Proceedings of the 5th international conference on genetic algorithms, pp 206–215
Coello C, Carlos A (2000) An updated survey of GA-based multiobjective optimization techniques. ACM Comput Surv 32(2):109–143
Acknowledgments
Any one who wishes to receive a copy of the image databases or the program can send an e-mail to kharma@ece.concordia.ca .
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Yao, J., Kharma, N. & Grogono, P. A multi-population genetic algorithm for robust and fast ellipse detection. Pattern Anal Applic 8, 149–162 (2005). https://doi.org/10.1007/s10044-005-0252-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10044-005-0252-7