An Image Edge Detection Method based on Improved Ant Colony Algorithm

. This paper raises an improved ant colony algorithm, for the detection of weak edge of complex background image, considering edge positioning accuracy, edge pixels, edge continuity and interference edges. This algorithm is improved in two aspects: first, we improved the expression of pheromone; second, we improved the calculation of Heuristic information. Compared with traditional Canny detector indicates, the improved method is proved to be accurate in edge detection, good continuity and less interference by experiment.


Introduction
In 1991, Dorigo [1] [2] [3], and some other Italian scholars did research on the similarity between ants' searching food and traveling salesman problem (TSP), and tried to solve the TSP problem using artificial process of ants' searching food.Ant colony algorithm's characteristics of discrete and parallel are suitable for digital image processing.In recent years, many researchers achieved results in image segmentation, image characters' extraction, image matching, image texture classification and other areas, using ant colony algorithm.Weide Gao [4] , Jing Tian [5] and the others raised an ant colony image edge searching method guided by gray gradient.Zhenzhong Wei [6] and the others raised a segment analysis method based on ant colony for low resolution and complicated background image.Haizhen Wu [7] and others raised an image segmentation method based on ant colony and support vector machine.Jinghu Zhang [8] raised a new CT image edge detection method adopting ant colony algorithm.

Ant Colony Algorithm Theory
Artificial ant colony is raised by imitation of ant colony's action.The theory of ant colony edge detection: locate K ants on the target image randomly, each ant occupies one pixel, initialize a pheromone matrix (the same size with image), ants' every move is based on a transfer probability, which is related on pheromone and heuristic information on next location, heuristic information is proportional with local changes of image gray scale, ants move towards to direction with higher transfer probability, means towards to direction with larger local gray scale change, at the end, ants will gather on the edge.Since each move of ants will change pheromone on the route, larger pheromone value will occur on image edge and reflect in pheromone matrix.Conduct rule for ants move from node i to node j is: ) ( ) , τ − is pheromone value connect node i and node j, i Ω is Kth ant's neighborhood and node i, α and β are concentration of pheromone and weight of heuristic information, , i j η is pheromone value from node i to node j, which is the same in each iteration.
During the whole algorithm, pheromone matrix is updated twice.After every iteration of each ant, pheromone matrix's value is updated.After the move of Kth ant in Nth step, pheromone value is updated by: ( 1)  ( 1) , , ( ) , ( 1) , (1 ) ρ is the rate of pheromone loss.After all the ants did one move, the matrix is updated again by: (1 ) ϕ is attenuation coefficient of pheromone.
Heuristic information can be calculated by neighborhood searching, by: , ( ) V I is function of neighborhood pixel's gray scale, defined by: , , ( ) ( ) λ is constant coefficient.After a number of iterations, we could determine the pheromone matrix's two-value, and select proper method to determine threshold T.Here we use Otsu algorithm: First, take the average of pheromone matrix as 0 T : Second, separate pheromone matrix into two classes by l T : first is larger than or equal to threshold; second is smaller than or equal to threshold, in which l is times of separation.Then calculate the average of these two different classes: x are classes smaller than threshold: Advanced Engineering Forum Vol. 1 The other type is larger than threshold: x are classes larger than threshold: x others x others

Improved Ant Colony Algorithm
First improvement: improve the pheromone's two times updating equation.The improved first time updating equation is: ( ) ( 1) kth ant visited pixel(i,j) others , i j τ ∆ is difference between pheromone of ant's next position and right now position, which is obtained by transfer probability action rules.ρ is evaporate rate of pheromone.The improved second time updating equation is: (1 ) (15) Second improvement: improve the equation of heuristic information.In the new algorithm, we get , ( ) (16) I ∆ represents difference between values of two pixels, which are on the arrow direction, determined by ants' searching neighborhood image.The differences compose in total 8 difference pairs:

Experiments of Improved Ant Colony Algorithm
Image size is 128*128, ants quantity is Above result shows that compared with the original algorithm, the performance of improved algorithm has been significantly improved by: 1) Higher positioning accuracy.From the experiment, the improved algorithm result reflects well.In Lena image, character's edges detected by the improved algorithm are smaller.Most object edges are one pixel width.In complex image part, main line's edges are well detected, most edges are one pixel width.Those results prove that the new algorithm improved a lot on edge positioning, compared with original method.2) Good anti-interference performance with complex background.This feature is evident from the comparison between ant colony algorithm experiment and improved algorithm.In experiment of improved algorithm, image background is very complex, but it doesn't cause significant interference to the detection.Background interface is reduced significantly by using the new algorithm.The two edges in image are extracted well.3) Extract the edge without breakpoint.The original image processing algorithm could distinguish the edges, but the edges are extracted with breakpoints.From the result, the new algorithm extracted two edges well connected, without breakpoint.4) To demonstrate some characteristics of ant colony algorithm, this paper compare the improved ant colony algorithm with traditional Canny edge extraction algorithm.Canny edge detection algorithm is one of classical edge detection algorithms with good performance.Many edge detection algorithms are compared with Canny operator.

Comparison between Improved Ant Colony Algorithm and Canny Edge Detection
Increase the threshold and maintain other values unchanged when using Canny operator parameters test image.It can be seen from the result that details of image reduce sharply.Although interface of image reduces, the detection result is not satisfied.There is breakpoint, marked out in figures.
To sum up, detecting main object in complex image, ant colony algorithm has following profits than Canny algorithm: reduce the background interface, creating conditions for following work.Although Canny algorithm can reduce background interface by taking higher threshold or increasing the smoothing factor, it affects the integrity of the edge.Low threshold or reducing the smoothing factor can detect more edges, but it draw in many unnecessary interference.Compared with Canny algorithm, ant colony algorithm has such disadvantages: 1) Ant colony algorithm takes much longer time than Canny algorithm.This is the fatal shortcoming of ant colony algorithm.In the above experiments, ant colony algorithm takes nearly 1 minute when image size is 128*128, takes nearly 3 minutes when image size is 256*256.While the Canny algorithm only takes 10 seconds when image size is 128 * 128.2) Ant colony algorithm's positioning accuracy is slightly worse than Canny algorithm.From the experiment, edges detected by Canny algorithm is one pixel width.Although most edges detected by ant colony algorithm can reach the edge width of one pixel, there are still some edges wider than one pixel.

Conclusion
Improved ant colony algorithm in several areas has greatly improved over the original algorithm.For example, the complex image weak edge detection, edge localization, complex background interference, the continuity of edge detection.The New algorithm has a better balance in extracting edge of object in image with complex background: extract the edges of target of the edge extraction meanwhile reduce the background interference.The disadvantage is ant colony algorithm takes longer time.

2
Colony edge detection Canny edge detection results and the results 1) The new algorithm can extract more complete edge.Results of 5 experiments show that Canny algorithm can't extract weak edges without breakpoint.Only the strong edges are somehow complete.In Experiment 1, Experiment 2, Canny algorithm detected some weak edges, but no one is complete.2) With complex background, ant colony algorithm has better anti-interference performance than the traditional Canny algorithm.Ant colony algorithm has a better balance on object edges extracted from complex background, which means extracting target's edges meanwhile Advanced Engineering Forum Vol. 1