Advances in Fuzzy Systems

Volume 2014, Article ID 365817, 17 pages

http://dx.doi.org/10.1155/2014/365817

## Edge Detection via Edge-Strength Estimation Using Fuzzy Reasoning and Optimal Threshold Selection Using Particle Swarm Optimization

Department of Electronics and Communication Engineering, Indian Institute of Technology Roorkee, Roorkee, Uttarakhand 247 667, India

Received 2 July 2014; Revised 13 November 2014; Accepted 14 November 2014; Published 14 December 2014

Academic Editor: Katsuhiro Honda

Copyright © 2014 Ajay Khunteta and D. Ghosh. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

An edge is a set of connected pixels lying on the boundary between two regions in an image that differs in pixel intensity. Accordingly, several gradient-based edge detectors have been developed that are based on measuring local changes in gray value; a pixel is declared to be an edge pixel if the change is significant. However, the minimum value of intensity change that may be considered to be significant remains a question. Therefore, it makes sense to calculate the edge-strength at every pixel on the basis of the intensity gradient at that pixel point. This edge-strength gives a measure of the potentiality of a pixel to be an edge pixel. In this paper, we propose to use a set of fuzzy rules to estimate the edge-strength. This is followed by selecting a threshold; only pixels having edge-strength above the threshold are considered to be edge pixels. This threshold is selected such that the overall probability of error in identifying edge pixels, that is, the sum of the probability of misdetection and the probability of false alarm, is minimum. This minimization is achieved via particle swarm optimization (PSO). Experimental results demonstrate the effectiveness of our proposed edge detection method over some other standard gradient-based methods.

#### 1. Introduction

Edge detection is an essential and important first step in object identification. An edge may be defined as a set of connected pixels lying at the boundary between the foreground and the background. Therefore, edge detection algorithms generally rely on detecting discontinuities within an image. Several gradient-based edge detectors are available in the literature which are based on measuring local changes in gray value; a pixel is declared to be an edge pixel if the change is significant. Accordingly, the underlying principle in most edge detection techniques is to compute the first- or second-order derivative of the intensity function within the image-detectors based on the first derivative looks for points where the derivative value is large while those using the second-order derivative find edges at zero-crossings of the image [1]. Several gradient operators, such as the Roberts, Prewitt, Sobel, and the Laplacian masks, exist which are used to estimate the first- and the second-order derivatives [2]. However, these detectors are generally very sensitive to noise and hence perform poorly in case of noisy images. In [3], Canny proposed a method to counter this noise problem by convolving the image with the first-order derivatives of Gaussian filter prior to edge detection. Some other edge detectors that incorporate linear filtering, local orientation analysis, fitting of analytical models, and local energy are available in the literature [4–7].

However, the operators mentioned above are referred to as “noncontextual” or general edge detectors since they do not make any distinction between edges originating from textured regions and object boundaries. “Contextual” edge detectors, on the other hand, selectively detect contours (object boundaries) that are of interest in the context of a specific computer vision task by taking into account additional information around an edge, such as local image statistics, image topology, perceptual differences in texture, and edge continuity. Contour detectors are mainly divided into local and global operators. Local detectors are mainly based on differential analysis, statistical approaches, phase congruency, rank-order filters, and their combinations. The latter class of detectors include computation of contour saliency, perceptual grouping, relaxation labeling, and active contours. The behavior of edges in the scale space has also been critically studied and evaluated [8]. Natural images generally contain edges with different levels of blurring. Further, the human visual system perceives different frequency ranges differently. Accordingly, multiresolution analysis finds importance in contour detection. Multiresolution contour detection may be classified into edge focusing and position-dependent blurring. Edge focusing can achieve both high noise rejection and good edge localization but at the cost of increased computational cost. Position-dependent blurring, on the other hand, is a better option for images that contain different degrees of blurring. Inspired by the surround suppression mechanism exhibited by the human visual system, contour detection methods using model for surround suppression via receptive field inhibition have also been developed [9–11]. The operator responds strongly to isolated lines and edges, region boundaries, and object contours, while suppressing texture edges. This yields better discrimination between object contours and texture edges, thereby improving contour detection performance. A comprehensive review on the various approaches to contour detection that have been developed in the past two decades is available in [12].

Gradient-based method for edge detection faces the challenge of edge localization in images that exhibit smooth transition in gray level. This is due to the ambiguous nature of the edge structures in such images. Also, since no absolute ground truth for the gradient threshold is available, clear demarcation between the pixels with high local intensity gradient (edge pixels) and those with low intensity gradient (non-edge pixels) does not exist. To deal with this ambiguity and vagueness in edge structures, some researchers used fuzzy logic theory in defining edges, as summarized below.

##### 1.1. Fuzzy-Based Edge Detection

Fuzzy logic plays key role in situation of ambiguity. This motivated researchers to employ fuzzy reasoning for edge detection. The earliest and the most typical fuzzy-based edge detection method is due to Pal and King [13] which used fuzzy based logic as a contrast intensifier to detect edges in X-ray image. This was followed by a series of works in the last three decades, [14–27] to name a few.

The method presented by Tao et al. in [14] is based on a set of sixteen fuzzy IF-THEN rules. All these rules are combined to generate a set of potential edge pixels. This method avoids the difficulty of selecting parameter values present in most other edge detectors. Russo and Ramponi used FIRE operator (set of fuzzy inference rules) to detect edges from noiseless as well as noisy images [15]. In [16], Russo used 3 × 3 window-based filtering followed by fuzzy reasoning to detect edges in the presence of noise. A fuzzy classifier was used by Liang and Looney [17] to classify image pixels corresponding to gray level variation in various directions by using a 3 × 3 mask. They used an extended Epanechnikov function as fuzzy set membership function for each class. The class assigned to each pixel is the one with the highest fuzzy membership. A fuzzy-based approach to edge detection in gray-level images is proposed in [18]. This fuzzy edge detector involves two phases: global contrast intensification and local fuzzy edge detection. In the first phase, a modified Gaussian membership function is chosen to represent each pixel in the fuzzy plane. This requires use of some parameters to enhance the image which are obtained by optimizing an entropy function. Rakesh et al. [19] proposed an edge detector in which thresholding is performed using statistical principles. Local standardization of threshold for each individual pixel, depending on the statistical variability of the gradient vector at that pixel, is taken into account for image binarization. In [20], Mendoza et al. applied Sobel operator on a digital gray-scale image and calculated the intensity gradients at each pixel position. This measure of intensity gradient gives the probability of occurrence of an edge. High pass and low pass filter masks are used to detect object boundaries in low contrast region. Finally, type-2 fuzzy inference is used to detect edges. Edge detection in blurry images was carried out by Wu et al. in [21]. For this, contrast of blurry image is first enhanced by means of fast multilevel fuzzy enhancement (FMFE) algorithm and then edges are extracted from the enhanced image by two-stage edge detection operator that identifies the edge candidates based on the local characteristics of the image. A novel edge detector based on fuzzy IF-THEN inference rules to model edge continuity criteria was proposed in [22]. Eight masks are used to get the gradient information. The maximum entropy principle is used for adjusting the parameter values and finally a set of fuzzy rules is used to decide edge pixels. Yang modified the classical Pal and King algorithm with a new fuzzy membership function [23]. To make the algorithm adaptive, membership function is defined automatically from the threshold of the image. In another paper [24], Madasu and Vasikarla proposed fuzzy edge detection in biometric systems. In this approach, edge detection is carried out by means of global (histogram of gray levels) and local (pixels within a window) information. The local information is fuzzified by employing a modified Gaussian membership function. Alshennawy and Aly proposed a method in [25] that is based on fuzzy logic reasoning for edge detection in digital images without determining the threshold value. The proposed approach begins by segmenting the images into regions using floating 3 × 3 binary matrix and finally the edge pixels are mapped to a range of values distinct from each other. An adaptive neurofuzzy inference system (ANFIS) for edge detection in digital images was used by Zhang et al. in [26]. The internal parameters of the proposed ANFIS edge detector are optimized by training with the help of very simple artificial images. The algorithm uses 81 rules and four 3 × 3 masks to detect edges in four directions. In [27], Melin et al. used morphological gradient and fuzzy logic to detect edges and an interval type-2 fuzzy inference system (IT2FIS) are used for improving the edge detection.

##### 1.2. Edge Detection Using Evolutionary Algorithms

Nature-inspired evolutionary algorithms like PSO, bacterial foraging algorithm (BFA), ant colony optimization (ACO), genetic algorithm (GA), and so forth have recently been also applied in solving many complex problems including edge detection. A GA-based edge detection technique for texture image was proposed as early as in 1997 [28]. In this method, the edge detection problem is formulated as a combinatorial optimization problem and detection of the edge is executed according to the variance of texture feature in the local area. The candidate edge regions are selected first and then GA is applied in order to decide the optimum edge regions. A novel approach for edge detection based on the theory of universal gravity was presented in [29]. The algorithm assumes that each image pixel is a celestial body with a mass represented by its gray-scale intensity. Accordingly, each celestial body exerts force onto its neighboring pixels and in return receives force from the neighboring pixels. These forces can be calculated by the law of universal gravity. The vector sum of all gravitational forces along the horizontal and the vertical directions is used to compute the magnitude and the direction of signal variation. Edges are characterized by high magnitude of gravitational forces along a particular direction and can therefore be detected. Edge detection based on the fusion of fuzzy heuristic and PSO has been developed in [30]. Edge detection using ant colony optimization and adaptive thresholding was proposed in [31]. Ant colony is used to obtain well-connected edge-map. Ant movements are guided by local variation in intensity values. A novel edge detection technique that combines BFA with probabilistic derivative was proposed by Verma et al. in [32]. In this approach, the direction of movement of the bacteria decided by probability matrix is computed using derivatives along the possible edge directions. To deal with noisy images, this method is modified in [33] by using fuzzy derivative in place of probabilistic derivative. A reliable and accurate method of edge detection via tuning of parameters in BFA-based optimization has also been proposed recently in [34].

##### 1.3. Objective of the Paper

In gradient-based image edge detection, thresholding is always a point of concern. Performance of classical edge detectors is very much dependent on the value of threshold chosen. This makes the use of these edge detectors relying on heuristic value manually selected by the user. However, proper choice of the threshold is necessary for selective detection of “contextual” edges that generally form object contours and region boundaries while leaving out “noncontextual” textured edges. Accordingly, in our work, we aim at developing user independent automatic method for determining the optimal threshold value such that only the object contours and region boundaries, which are relevant to object recognition, shape analysis, and image segmentation point of view, are detected.

Recently, we proposed a novel edge detection technique that uses a combination of fuzzy reasoning as well as threshold optimization for the purpose of edge detection [35]. The proposed method starts with intensity gradient calculation, similar to other gradient-based edge detectors. Following this, unlike conventional gradient-based edge detectors, we use a set of fuzzy rules to measure the possibility of a pixel to be an edge pixel rather than taking a hard decision at this stage. We refer to this measure as “*edge-strength.*” Edge-strength at every pixel point is estimated using a fuzzy rule-based inference mechanism. Pixels are subsequently classified as edge or non-edge pixels on the basis of an optimal edge-strength threshold. This optimal threshold is calculated such that the overall probability of error in edge detection is minimized. We propose to employ particle swarm optimization (PSO) [36] technique for the purpose of minimization wherein the objective function is the sum of the probability of misdetection and the probability of false alarm. The purpose of using PSO for minimization is that it is relatively simple metaheuristic algorithm that is easy to implement and capable of dealing with complex search spaces where only minimum knowledge is available. PSO provides relatively fast convergence to the global minimization through a heuristic search within a search space consisting of infinite search points. In this paper, we describe our earlier proposed edge detection algorithm in more details. This is presented in Sections 2 and 3. Our proposed method for edge-strength calculation using fuzzy rules is described in Section 2 while our proposed optimal threshold selection procedure is given in Section 3. In Section 4, we compared our proposed method with some other previously reported methods of edge-detection. Finally, we draw our conclusion in Section 5.

#### 2. Proposed Fuzzy Rule-Based Edge-Strength Calculation

The underlying principle behind gradient-based edge detection is to calculate the intensity gradient at every pixel point in the image and then labeling those pixels as edge pixels where the intensity gradient is* high*. Therefore, it is necessary to define a criterion for deciding* high* and* low* intensity gradients. In our proposed method, gradient at each image pixel is calculated by any available gradient operator following which a set of fuzzy rules is used to decide whether the edge-strength at a pixel point is low, medium, or high. This way an edge-strength map of the complete image is obtained.

We propose to use fuzzy theory for estimating the* edge-strength* at every pixel point in the input image. In our proposed approach, we first calculate the intensity gradients and along the horizontal and vertical directions, respectively, at every pixel in the image. Next, we determine the edge-strength at that pixel point using several fuzzy rules. A fuzzy inference system that uses these fuzzy rules gives a measure of the edge-strength which is subsequently fuzzified to assess the extent to which the pixel relates to a true edge in the image.

In our proposed method for edge detection, we first determine the edge-strength so that edges can be detected appropriately. For this, we propose to use some “IF THEN ” fuzzy rules and estimate the edge-strength using a fuzzy rule-based inference mechanism. A fuzzy rule typically includes a group of “antecedent clauses” which define conditions and a “consequent clause” which defines the corresponding output action and/or conclusion. These fuzzy rules give directives much similar to human-like reasoning. Such a rule, which is expressed in plain linguistic form, is translated into the more formal structure of a fuzzy operator.

As said above, edge pixels are identified by measuring local change in intensity followed by thresholding. The change in intensity may be measured by taking the first derivative of the image function. The derivative quantifies the rate of change in the intensity and hence yields high values at points of rapid transition. In continuous domain, the rate of change of a 2D image intensity function is given by the gradient vector, defined as
where and denote the rate of intensity change along the horizontal (-axis) and vertical (-axis) directions, respectively. The magnitude of the gradient vector , referred to as* gradient*, gives the measure of the rate of change in intensity at the pixel location . This is calculated as
To reduce the computational burden, the gradient is sometimes approximated as

However, the degree of edginess or edge-strength at a pixel point is to some extent a subjective issue that may not be necessarily quantified in terms of and , as in (2) and (3) above. On the other hand, the edge-strength at a point is in every way related to the rate of change in intensity at that point. That means the degree of edge-strength at a pixel point may be estimated on the basis of combined and information. This may be accomplished using fuzzy reasoning and fuzzy inferencing, the way similar to the human reasoning.

In discrete domain, as in case of digital images, it is a common practice to use the first difference in place of the first-order partial derivative. Accordingly, the digital gradients are generally computed using gradient operators consisting of two masks: one mask for computing the horizontal gradient and the other for computing the vertical gradient . Several gradient operators, such as the Roberts, Prewitt, and Sobel masks, are available in the literature for that purpose [2]. In our method, we propose to use any such gradient operator for computing the gradients and at a point in the image. These two gradient values are then combined to determine the edge-strength at that point using fuzzy reasoning. Thus, our proposed approach differs from the conventional gradient-based edge detectors. Our proposed method for edge-strength calculation uses deductive fuzzy inference system based on a set of four fuzzy rules, as stated below.(i)*Rule **1*. IF is low AND is low THEN edge-strength is low.(ii)*Rule **2*. IF is low AND is high THEN edge-strength is medium.(iii)*Rule **3*. IF is high AND is low THEN edge-strength is medium.(iv)*Rule **4*. IF is high AND is high THEN edge-strength is high.Thus, our fuzzy system is a two-input and one-output system: two input variables (antecedent clauses) are the two gradients and , and the resultant output variable (consequent clause) is the normalized edge-strength , at pixel position in the image. These four IF-THEN rules include two conditions (antecedent clauses) about the input variables and specify a consequent clause related to the output variable. Antecedent clauses are linked by fuzzy AND operator. Each clause is completely defined by the shape and position of a fuzzy set, which maps the corresponding variable to the real interval . Since the two input variables and are measures of the same quantity (intensity gradient) differing only in their directions of measure (horizontal and vertical directions), they may be defined by the same set of fuzzy sets. Two fuzzy sets for the antecedents and three fuzzy sets for the consequent are used, as represented in Figures 1 and 2. Fuzzy sets for the antecedents are labeled as “low gradient” and “high gradient.” Fuzzy sets for the consequent are “low edge-strength,” “medium edge-strength,” and “high edge-strength.”