Edge Detection by Genetic Algorithm

download Edge Detection by Genetic Algorithm

of 3

Transcript of Edge Detection by Genetic Algorithm

  • 8/18/2019 Edge Detection by Genetic Algorithm

    1/3

    EDGE DETECTION BY GENETIC ALGORITHM

    M. K. Lee*,S, W.Leung**, T,L. Pun and H. L. Cheung*Alex.M.K.Lee @plink.cityu.edu.hk

    **eeswl @cityu.edu. k

    Department of Electronic Engineering

    City University of Hong Kong

    Hong Kong China

    AppliedImage

    ABSTRACT

    Trained Resultb Filter b Image

    This paper presents a novel edge detection method basedon Genetic Algorithm (CA). Only a simple image dataset is required for constructing the edge filter. The dataset, which consists of a simple image and its expectededge features, is used for training by the GA. The merit

    of this method is that an effective edge extraction filtercan be easily constructed. Results and examples areillustrated in the paper.

    1 INTRODUCTION

    Laplacian and Sobel [ 13 are classical mathematicalmethods for edge detection. The Laplacian EdgeDetection method uses a two-dimensional linear filter toapproximate the 2 d order derivative of pixel values ofthe image. The Sobel edge detection method uses twotwo-dimensional linear filters to process vertical edgesand horizontal edges separately. In general, theseclassical methods utilize linear function of the form

    with edgeImage feature

    j l

    to represent the required edge information edgefeature. Different coefficients, w, n), epresent differentedge filter characteristics. This paper presents new edgedetection method which constructs the edge filter by

    optimising the coefficients, w,{n , directly using a CAlearning alorigthm.The schematic diagram of the proposed edge

    detection method is illustrated in Figure 1 The input ofthe algorithm consists of two images. One is a simpleimage and the other its corresponding edge image suchas those shown in Figure 2. These two images are usedas the input in the C training algorithm for optimizingthe coefficients, w, n). The trained filter is then appliedto other images for edge detection; results are illustratedin later sections.

    (i) input image (ii) input edge image

    Figure 2: Training Set Circle

    2. GA TRAINING ALGORITHM

    A simple genetic algorithm [3] is used here to optimizethe coefficients, wi n), of the edge detection filter. Allthe coefficients are converted into bit format andcombined into bit array called chromosomes thefundamental elements of the GA method.

    For the fitness calculation, chromosomes areconverted back to filter coefficients and applied to the

    7 80-7803-6297-7100/ 10.00 2000 IEEE

    mailto:cityu.edumailto:cityu.edu

  • 8/18/2019 Edge Detection by Genetic Algorithm

    2/3

    training image. A resultant edge image can be formed.This image is then compared with the input edge featureimage to calculate the fitness value for similarity. Thosetwo binary images is compared pixel by pixel. Whentwo pixels from the resultant image and the input edgefeature image in the same coordinate are the same, thefitness value of that chromosome will be increased byone; otherwise, the fitness value will be decreased byone.

    The utility operations defined in the edge detectionGA algorithm are as follows:

    Selection : Fitness-proportional selection-Thechromosome with minimum fitnessvalue and another randomly chosenchromosome are selected from theparent pool to process crossover andmutation.

    Crossover : three-point crossover to speed up theprocessing time.

    Mutation : classical GA mutation by randomlyflipping some of the bits in achromosome.

    3. THRESHOLDING

    An edge always occurs when there is a large differencebetween values of neighbouring pixels, i.e. a sharpchange in grayscale level. A threshold, based on thedistribution of the grayscale level, is introduced in theGA training algorithm for controlling the detectionsensitivity of the edge filter. This thresholding performs

    edge sharpening and the edges extracted are one pixel inwidth.

    The concept is to consider the rate of change of pixelintensity of edge feature. In fact, the trained edgeextraction filter can extract edge features of image. Andthe rate of change of edge feature can be obtained, bysimple difference equations:

    horizontal:

    d ( x ,Y)‘ e(x ,Y - e(x ,Y

    vertical:

    d ( x , y ) = e ( x , y ) - e (x - l , y )where e(x,y ) is the intensity of the edge feature image inpixel at row x and column y and d(x,y ) is the intensity ofthe rate of change of edge feature in pixel at row x andcolumn y. When the value of a center pixel exceeds thevalue of both the previous pixel and the following pixel,either vertically or horizontally, there is a sharp change.In addition, when this center pixel is larger than

    threshold, it is classified as an edge.4. RESULTS DISCUSSION

    The result of the proposed method is compared withclassic methods, the Laplacian algorithm, the Sobel filter,and the Canny-Deriche method. Since the output fromthe Laplacian algorithm and the Sobel filter are in greylevel, a simple one-level quantization to edge or ot e geis applied for comparison purpose.

    Figure 3 illustrates original images of ‘House’ and‘Peppers’, and results of the proposed CA Edge

    LaDlacian Sobel Cannv

    eppers; Second Rowedge detection with trainingset ‘Circle’;Third Column Laplacian method; Fourth Column Sobel iter; FifthColumn Canny edge detection.

    79

  • 8/18/2019 Edge Detection by Genetic Algorithm

    3/3

    Detection method, the Laplacian method, the Sobelmethod and Canny edge detection method. The simpletraining set, ‘Circle’ (Figure 2), is input to the GAtraining algorithm to optimize the filter coefficients,w,{n . This demonstrates that the GA learning algorithmis able to extract an edge using even a simple training

    set. In the resultant image ‘House’ obtained by theLaplacian filter, there are many edge points which arenoisy particularly in the area of the “wall”. Results ofthe proposed GA edge detection illustrate the capabilityof noise reduction. By observing results of the appliedimage ‘Pepper’, the Laplacian filter is found to be toosensitive to noise. Although it can be improved byconsidering the variance [ 13, calculation complexityincreases and the noise nearby the real edge still cannotbe removed. The Sobel filter works better in such noisysituations but fails to extract edges with one pixel width.This is illustrated in Figure 3.

    The proposed GA edge detection is also comparedwith an optimized edge detection method, the Cannyedge detector [2]. As shown in Figure 3, the result of theCanny edge detection is better. Its edges are continuousdue to the used hysteresis thresholding. This is a kind ofcontouring, using two-level thresholding and tracing ofpossible edge paths. However, the proposed method usesonly a simple one-level thresholding technique.Hysteresis thresholding may be the further works forenhancement.

    According to the, results of both the proposedmethod and the Canny edge detection in Figure 4, we canfind that the performance of Canny degrade at thecorners of the rectangle, the corners become round, butthe proposed method does not. Smoothing corners isbecause the first step of Canny edge detection is toconvolve the image with a gaussian filter. This filter islike a “smoother” so the corners of the rectangle becomeround.

    (i) Result of Canny (ii) Result of GAFigure 4: Edge images

    5 CONCLUSION

    is also included. Results so far indicate that GAalgorithm performs well compared to both the Sobel andLaplacian algorithms, and provides a method which cansimply and easily construct an effective edge extractionfilter.

    6. REFERENCES

    [ l ] Jan S Lim, “Two-Dimensional Signal and ImageProcessing”, Prentice Hall, 1990, pp.476 494.

    [2] Canny, J.F. “A Computational Approach to EdgeDetection”. IEEE Transactions on Pattern Analysisand Machine Intelligence. 1986,8(6) pp.679-698.

    [3] Melanie Mitchell, “An introduction to geneticalgorithm”, Massachusett, 1996.

    [4] Tzay Y. Young, King-Sun Fu R. Nevatia,“Handbook of Pattern Recognition and Image

    Processing”, Academic Press, 1986, pp.215-222.

    [5] James C. Bezdek, Ramachandran Chandrasekhar,Yianni Attikiouzel, “A Geometric Approach to EdgeDetection”, IEEE Transactions on Fuzzy systems,1998, pp.52-72.

    [6] Ch. Hafner and J. Frohlich, “Generalized GeneticProgramming for Solving Engineering Problems”,Proc. PIERS Symposium, (Boston), p. 672, July1997.

    This paper has presented an edge detection method basedon Genetic Algorithm (GA). Results and examples ofthe algorithm are compared with those of the Sobel andLaplacian algorithms; the Canny Edge Detection method

    480