Automated Edge Detection Using Convolutional Neural Network

—The edge detection on the images is so important for image processing. It is used in a various fields of applications ranging from real-time video surveillance and traffic management to medical imaging applications. Currently, there is not a single edge detector that has both efficiency and reliability. Traditional differential filter-based algorithms have the advantage of theoretical strictness, but require excessive post-processing. Proposed CNN technique is used to realize edge detection task it takes the advantage of momentum features extraction, it can process any input image of any size with no more training required, the results are very promising when compared to both classical methods and other ANN based methods.


INTRODUCTION
Computer vision aims to duplicate the effect of human vision by electronically perceiving and understanding an image.Giving computers the ability to see is not an easy task.Towards computer vision the role of edge detection is very crucial as it is the preliminary or fundamental stage in pattern recognition.Edges characterize object boundaries and are therefore useful for segmentation and identification of objects in a scene.The idea that the edge detection is the first step in vision processing has fueled a long term search for a good edge detection algorithm [1].
Edge detection is a crucial step towards the ultimate goal of computer vision, and is an intensively researched subject; an edge is defined by a discontinuity in gray level values.In other words, an edge is the boundary between an object and the background.The shape of edges in images depends on many parameters: The geometrical and optical properties of the object, the illumination conditions, and the noise level in the images.Edges include the most important information in the image, and can provide the information of the object's position [2].Edge detection is an important link in computer vision and other image processing, used in feature detection and texture analysis.
Edge detection is frequently used in image segmentation.In that case an image is seen as a combination of segments in which image data are more or less homogeneous.Two main alternatives exist to determine these segments: 1) Classification of all pixels that satisfy the criterion of homogeneousness; 2) Detection of all pixels on the borders between different homogeneous areas.
Edges are quick changes on the image profile.These quick changes on the image can be detected via traditional difference filters [3].Also it can be also detected by using canny method [4] or Laplacian of Gaussian (LOG) method [5].In these classic methods, firstly masks are moved around the image.The pixels which are the dimension of masks are processed.Then, new pixels values on the new image provide us necessary information about the edge.However, errors can be made due to the noise while mask is moved around the image [6].The class of edge detection using entropy has been widely studied, and many of the paper , for examples [7], [8], [9].
Artificial neural network can be used as a very prevalent technology, instead of classic edge detection methods.Artificial neural network [10], is more as compared to classic method for edge detection, since it provides less operation load and has more advantageous for reducing the effect of the noise [11].An artificial neural network is more useful, because multiple inputs and multiple outputs can be used during the stage of training [12], [13].
Many edge detection filters only detect edges in certain directions; therefore combinations of filters that detect edges in different directions are often used to obtain edge detectors that detect all edges.This paper is organized as follows: Section 2 presents some fundamental concepts and we describe the proposed method used.In Section 3, we report the effectiveness of our method when applied to some real-world and some standard database set of images.At last Results, Discussion and Conclusion of this paper will be drawn in Section 4.

II. PIXEL BASED EDGE DETECTION
In digital image processing, we can write an image as a set of pixels q p f , and an edge detection filter which detects edges with direction  as a (template) matrix with elements m n w , , see Figure .1.We can then determine whether a pixel q p f , is an edge pixel or not, by looking at the pixel's neighborhood, see Figure 2, where the neighborhood has the same size as the www.ijacsa.thesai.orgedge detector template, say . We then calculate the discrete convolution.
where q p f , can be classified as an edge pixel if q p g , exceeds a certain threshold and is a local maximum in the direction perpendicular to  in the image q p g , .
Some examples of templates for edge detection are: The dependency on the edge direction  is not very strong; edges with a direction  ± 45° will also activate the edge detector [14].

III. CONVOLUTIONAL NEURAL NETWORKS
Typically convolutional layers are interspersed with subsampling layers to reduce computation time and to gradually build up further spatial and configurable invariance.A small sub-sampling factor is desirable however in order to maintain specificity at the same time.Of course, this idea is not new, but the concept is both simple and powerful [15].It combines three architectural ideas to ensure some degree of shift, scale and distortion invariance: local receptive fields, shared weights (or weights replications), and spatial or temporal sub-sampling [16].The input plane receive images, each unit in a layer receives input from a set of units located in a small neighborhood in the previous layer.With local receptive fields, neurons can extract elementary visual features such as oriented edges, end points, corners (or other features such as speech spectrograms).These features are then combined by the subsequent layers in order to detect higher-order features.The input hidden units in the m-th layer are connected to a local subset of units in the (M -1)-th layer, which have spatially contiguous receptive fields.We can illustrate this graphically as follows: Imagine that layer M-1 is the input retina.In the above, units in layer m have receptive fields of width 3 with respect to the input retina and are thus only connected to 3 adjacent neurons in the layer below (the retina).Units in layer m have a similar connectivity with the layer below.We say that their receptive field with respect to the layer below is also 3, but their receptive field with respect to the input is larger (it is 5).
The architecture thus confines the learnt "filters" (corresponding to the input producing the strongest response) to be a spatially local pattern (since each unit is unresponsive to variations outside of its receptive field with respect to the retina).As shown above, stacking many such layers leads to "filters" (not anymore linear) which become increasingly "global" however (i.e.spanning a larger region of pixel space).For example, the unit in hidden layer M +1 can encode a nonlinear feature of width 5 (in terms of pixel space) [17].

b) Shared Weights Neural Network:
Hidden units can have shift windows too this approach results in a hidden unit that is translation invariant.But now this layer recognizes only one translation invariant feature, what can make the output layer unable to detect some desired feature.To fix this problem, we can add multiple translation invariant hidden layers: A full connected neural network is not a good approach because the number of connections is too big, and it is hard coded to only one image size.At the learning stage, we should present the same image with shifts otherwise the edge detection would happen only in one position (what was useless).
Exploring properties of this application we assume: The edge detection should work the same way anywhere the input image is placed.This class of problem is called Translation Invariant Problem.The translation invariant property leads to the question: why to create a full connected neural network?There is no need to have full connections because we always work with finite images .The farther the connection, the less importance to the computation [18].

c) Max Pooling Another important concept of Convolutional Neural
Networks is that of max-pooling, which a form of non-linear down-sampling is.Max-pooling partitions the input image into a set of non-overlapping rectangles and, for each such subregion, outputs the maximum value.Max-pooling is useful in vision for two reasons: 1) It reduces the computational complexity for upper layers. 2

) It provides a form of translation invariance.
To understand the invariance argument, imagine cascading a max-pooling layer with a convolutional layer.There are 8 directions in which one can translate the input image by a single pixel.If max-pooling is done over a 2x2 region, 3 out of these 8 possible configurations will produce exactly the same output at the convolutional layer.For max-pooling over a 3x3 window, this jumps to 5/8.Since it provides additional robustness to position, max-pooling is thus a "smart" way of reducing the dimensionality of intermediate representations [19].a) graphical depiction of a model: Sparse, Convolutional layers and max-pooling are at the heart of the Convolutional Neural Network models.While the exact details of the model will vary greatly, Figure 6 shows a graphical depiction of a model.
Implementing the network shown in Figure 3, the input image is applied recursively to down-sampling layers reduces the computational complexity for upper layers and reduce the dimension of the input, also the network has a 3x3 receptive fields that process the sup sampled input and output the edge detected image, the randomly initialized model acts very much like an edge detector as shown in Figure 7.
The hidden layers activate for partial edge detection, somehow just like real neurons described in Eye, Brain and Vision (EBV) from David Hubel.Probably there is not "shared weights" in brains neurons, but something very near should be achieved with the presentation of patterns shifting along our field of view [20].www.ijacsa.thesai.orgThe following Figure 9 shows the output result and its PSNR value to a test Lena image at different statuses of epoch's number value.
Figure 9 shows the changes of the edge detected output image of the proposed technique, it is obvious that the best www.ijacsa.thesai.orgresult that gathers more expected edge pixels with least noise, PSNR = +5.33dB is reached when network was trained 100000 times, what approves the validity and efficiency of our proposed technique, the following Figure 10 shows the changes of the noise ratio in the output edge detected Lena image when applied to the proposed system during increasing the training epochs number from 400 to 100000 epoch, a significant changes occurred when we raised the epoch number to its maximum value.The results show that the best result is obtained when the test image is applied for the maximum epochs trained network either by the output result image intensity or the PSNR value.The Convolutional Neural Network model presented in Figure 1 is implemented using VC++ and trained using sharp edge images several times to increase its ability to automatically detect edges in any test image with a variant resolution, results are compared with classical edge detectors such as (Sobel, Canny, LOG, Prewitt) and technique proposed by [19] that presented a combined of entropy and pulse coupled Neural Network model for edge detection as in Figure 10   One of the main advantages of proposed technique it that it performs well when applied to high resolution and live images the following figure 12 shows the result for a modern house image with size 1024x711 pixels.This approach performs well with common standard images, high resolution size and live images.The proposed technique applied for standard images such as Lena, and Cameraman, also live non standard images with different size, resolution, intensity, lighting effects and other conditions.The technique shows a good performance when applied on all test images.


ijacsa.thesai.orgConvolutional Neural Networks exploit spatially local correlation by enforcing a local connectivity pattern between neurons of adjacent layers.

Fig. 8 .
Fig. 8. Edge and non edge Training Patterns V. EXPERIMENT DISCUSSION The training process passes many stage according to training epoch's number to reach the weight values that gives the best result, the epoch's number value ranges from 100 epoch to 100000 epoch as a maximum number performed.The PSNR (peak signal-to-noise ratio) is used to evaluate the network output during raising the epoch's number.

Fig. 9 .
Fig. 9. output and PSNR values for different network statues

Fig. 11 .
Fig. 11.comparison of different techniques Vs proposed technique.It is obvious to notice from Figure11that proposed technique achieves edge detection process efficiently compared with different known methods, where it gathers more expected edge pixels and left a little bit noise than other techniques as shown in Figure12.

Fig. 13 .
Fig. 13.output result for modern house image VII.CONCLUSION The Convolutional Neural Network is used as an edge detection tool.It was trained with different edge and non edge patterns several times so that it is able to automatically detect edges in any test image efficiently. :