Noisy images edge detection : Ant colony optimization algorithm

The edges of an image define the image boundary. When the image is noisy, it does not become easy to identify the edges. Therefore, a method requests to be developed that can identify edges clearly in a noisy image. Many methods have been proposed earlier using filters, transforms and wavelets with Ant colony optimization (ACO) that detect edges. We here used ACO for edge detection of noisy images with Gaussian noise and salt and pepper noise. As the image edge frequencies are close to the noise frequency band, the edge detection using the conventional edge detection methods is challenging. The movement of ants depends on local discrepancy of image’s intensity value. The simulation results compared with existing conventional methods and are provided to support the superior performance of ACO algorithm in noisy images edge detection. Canny, Sobel and Prewitt operator have thick, non continuous edges and with less clear image content. But the applied method gives thin and clear edges.


Introduction
One of the basic issues in image processing and computer vision is identifying the sudden changes of brightness in an image, or edge detection [1][2][3][4][5][6].The edges are defined as the boundary between the objects and the background or the boundary between overlapping objects.If the edges are recognized correctly, the location of all objects in the image can be identified exactly and some basic characteristics, such as the surface and the geometry of the objects will be measured easily [7].There are many methods for extracting and detecting the edges [6].Most edge detector programs determine the color or the intensity values of the edge pixels.In images without noise, edges are recognized by the gray level changing at a specific pixel [8].The higher is the gray level changing, the easier is the detection.However, in some images the gray level changes gradually, and no specific pixel can be identified as the edge pixel.Moreover, noise may cause some grey level changes which are not true.In other words, when affected by noise, two pixels with the same grey levels may find different grey levels in the image [9].Noise is a random phenomena arising from many sources, such as light intensity, type of camera and lens, mobility, temperature, atmospheric effects, and moisture.The random gray level changes of the pixels appear as some discontinuities in the detected edges.Hence, edge detection in noisy images is a nontrivial problem due to the random damage in the image [8].To reduce noise effects, Gaussians filtering [10], and some algorithms based on Wavelet Transform [11], mathematical morphology [12], neural networks [13], fuzzy networks [14,15] and an enhanced median filter [16] have been proposed.The ACO algorithm in [1] and [2] and [17] are proposed for edge detection in without noise images, but in this paper, we used the ACO algorithm for edge detection in image with presence noise.So far this algorithm is not used for edge detection of noisy image.However, a majority of edge detector algorithms, proposed so far, are incapable to remove noise effects precisely.
Instead, they optimize their performance in terms of noise effects removal [9].We show that ACO algorithm can detect edges with presence noise in images.
The remainder of the paper is organized as follows.ACO is introduced briefly in section 2, and ACO implementation for the edge detection problem is explained in section 3. The numerical results are demonstrated in section 4 and the paper is concluded in section 5.

Ant colony optimization
ACO algorithms are inspired by the natural behavior of ants which find the shortest paths between their nest and food sources using the deposited pheromone on the ground in an iterative process.Similarly, ACO prepares a set of solution components (paths) and updates it based on a pheromone model (weights of the paths) in each iteration.ACO algorithm constructs the solution with a probabilistic mechanism from the components.The pheromone model is a set of values representing a probability distribution over the search space.The pheromone update is performed to increase the probability of constructing good solutions from the components [17].ACO algorithm definition Using of the variables used in references [18,19].To implement ACO algorithm, K artificial moving ants in an area consisting of M1×M2 nodes are considered.The ants construct the components by their probabilistic movement based on the transition probability matrix, P n .The probability of moving from node i to node j depends on two values associated to the connection of node i to node j: the pheromone value and the heuristic value.The algorithm implementation steps are listed in table 1.

Table 1. ACO algorithm. process step
Initializing the positions of all K ants and the pheromone matrix τ 0 Accordingly, ACO should perform two main processes iteratively: modifying the probabilistic transition matrix, p (n) and updating pheromone matrix, which are explained in the following.At the n-th step of the algorithm, the k-th ant moves from node i to node j with a probability of: ) where, τi.j (n-1) is the pheromone value of node i to node j connection; ηi,j represents the heuristic information of going from node i to node j and is assumed to be the same for each construction-step; Ωi is the set of neighbor nodes of the ant ak that is on node i; α and β are positive constants representing the relation between pheromone information and heuristic information.The pheromone matrix needs to be updated twice during the process.First, the pheromone matrix is updated as: . ( , ) where, ρ is the evaporation rate; τi.j (n-1) is the pheromone value of node i to node j connection; Δ (k)  i,j is given by the heuristic matrix.Then, the second update is performed after the movement of all K ants within each construction-step as: ( .
where, ψ is the pheromone decay coefficient.

EDGE detection with ACO
In the edge detection problem, ACO detects the image edges with the ants moving on the image edges and recording the intensity values as estimated pheromone in a matrix which shows the edges information in each situation [1,17].A number of ants move on a two-dimensional image.Their move with the initial probability on any image pixel is determined with pheromone matrix.This matrix is created according to the definition of edge.In other words, pheromone matrix is created when the difference between two adjacent edges is more than a certain amount.Thus, the ants are led by the changes in the intensity values of edge pixels.This algorithm performs for the first steps and then in the nth step of construction, one ant being randomly chosen from K total ants and this ant will move over the image for L steps.Ultimately, decision-making Stage is done to determine edges.These steps in order are:

1) Initialization stage
According to the ant system [19], a number of ants are randomly distributed on an image with a size of M1×M2.The primary value of each component of the pheromone matrix, τ(0), is set to a constant value, τinit.

2) Construction stage
At this stage, a random ant is randomly chosen to perform L movement steps from node (l,m) to a neighboring node (i,j) according to the transition probability [21] (4) ) where, τi.j (n-1) is the pheromone value of node i to node j connection; ηi,j represents the heuristic information of going from node i to node j and is assumed to be the same for each construction-step; Ωi is the set of neighbor nodes of the ant ak that is on node i; α and β are positive constants representing the relation between pheromone information and heuristic information.The heuristic value, η (i,j), should be determined according to the possible position of pixel (i,j) [22], as: . .

()
where, ( ) Function f(0) in ( 6) is determined using the following four functions [23]: where, λ adjusts the shapes of the function ( 7)- (10).The second issue is to determine the range of the ant's movement.To determine the ant moves range four or eight connection is used.

3) Updating stage
The algorithm performs two updating.After moving an ant, each component of the pheromone matrix is updated by [20]: (11) If (i,j) is visited by the current kth ant Other wise ( 1) .
. , where, ρ is the evaporation rate; Δ (k) i,j is given by the heuristic matrix; τi.j (n-1) is the pheromone value of node i to node j connection The second update is performed after moving all ants according to (3).

4) Decision stage
A pixel either belongs or does not belong to the edge.Therefore, the decision process is a binary one.A threshold value, T, with an initial value, T (0) which equals the average amount of pheromone matrix, is chosen.The pixels that in two groups can be classified according to the value less than T (0) or greater than T (0) .The initial T (0) is computed as follows: ( ) ( ) ., 1: 1: (0) 1 2 where, the iteration index L=0.Then, Matrix pheromone τ (N) is divided in two groups using T (L) , the first group amounts is less than T (L) and the second group greater than T (L) .Mean these two calculate using the following formula that can be [1]: () , 1: 1: () () , 1: 1: ( ) () , 1: 1: () () , 1: 1: ( ) The new threshold value is the average of the two above values.The iteration index is set to l =l +1.
If │T (l) -T (n-1) │> ε, where ε is a very small number, the iteration stages stops then a binary decision to determine edge pixel, is made on each pixel location (i,j), to determine whether it is an edge pixel.

1, 0
Summary of ACO method in figure 1

Simulation results
We evaluate the performance of ACO algorithm in this section.First, a noisy image should be generated.Two types of noise, Gaussian noise, and salt and pepper noise are examined.Algorithm run for image with size 2  × 2  and otherwise are resized.The image size is 128 × 128.The initial values of the pheromone matrix components represent the probability of each pixel to be an edge pixel, which is the same for all pixels at the beginning of the iterations.K ants start moving on the edges, hence the probability of being an edge pixel changes.This process is repeated for L steps, and the pixels probabilities change according to the edge intensity values compared to the ones of the neighboring pixels.At the end, the edge pixels are the ones with the highest number of passing ants.The rest of the algorithm parameters are set in such a way that using initial values of reference [20] trial and error method obtained: k: total number of ants, which here functions [x] shows high right values that are smaller or equal to x. τinit = 0.0001 initial value of each component of the pheromone matrix.α = 3: weighting factor of pheromones information in (4).β = 0.2: weighting factor of the heuristic information in (4).Ω: the permissible ant's movement range in (4).λ=1: the adjusting factor of the functions in ( 7)- (10).ρ=0.2: the evaporation rate in (11).L = 40: total number of ant's movement-steps within each construction-step.φ = 0.05: the pheromone decay coefficient in (12).
To view the algorithm performance two images are examined.

Discussion
The purpose of this paper was to find the edges of the image in noisy images.Many methods were applied for this purpose.However, a majority of edge detector algorithms, proposed so far, are incapable to remove noise effects precisely.This paper finds edges in noisy image using ant colony algorithm.Algorithm finds edges in the presence of white Gaussian noise and salt and pepper noise.
After the running algorithm gets four different edges of the four types, experiments were conducted to evaluate the performance of the ACO approach in noisy images.The results of this algorithm were compared with the results of the algorithm used in reference [1] that the results of this reference shown in figure 5.
The algorithm used in this article is performed only by the presence of white Gaussian noise, while the ACO algorithm can be performed by other noises.After running the algorithm gets four different edges of the four types of relationships, that can use in applications according to type and applied fields.Otherwise, edges can combine using operators such as OR.Thus, the used algorithm can be better and be more complete.

Figure. 1 A
Figure. 1 A review of the performance of ACO algorithm.

Figure 2 .
Figure 2. (a) original image (b) edge detection without noise (c) edge detection with salt and pepper noise and intensity= 0.02 (d) edge detection with salt and pepper noise and intensity=0.05(e) edge detection with Gaussian noise and Intensity=0.05.

Figure 2 (Figure 3 .
Figure 2(a) is the Cameraman image.First, the algorithm is applied to the image without noise.The corresponding results are shown in figure 2(b).Four images obtained according to the four equations in 7-10.Then, figure 2(c) shows the image with salt and pepper noise and intensity=0.02.ACO succeeds in finding the edges.In the next step, noise intensity increases in the image.The computed edges are observed in

Figure 3 (Figure 4 .Figure 5 .
Figure 3(a) is original image, figure 3(b) is edge detection without noise, figure (c) is edge detection with salt and pepper noise and figure 3(d) is edge detection with Gaussian noise.ACO succeeds in finding the edges.In the next step, edges of same noisy image detection by, Sobel, figure 4(a), Prewitt figure 4(b), and Canny operators figure 4(c).Comparing the eyes of results can see that Canny, Sobel and Prewitt results depended noise effect, but ACO shows better results.