You are on page 1of 31

ANT COLONY

OPTIMIZATION
FOR
EDGE
Chintan
GuideKhanna
Dr.
OP
Verma
DETECTION IN IMAGES
Mtech (IS)
1st SEM
2K14/ISY/19

OUTLINE

Introduction
Why ACO ?
ACO Technique
ACO in Images
ACO Pitfalls

INTRODUCTION

Swarm

Swarm of bees

Ant colony as swarm of ants

Flock of birds as swarm of birds

Traffic as swarm of cars

Immune system as swarm of cells

Swarm Intelligence/Agent Based Modeling

Model complex behavior using simple agents

INTUITIVE PHOTOGRAPHS

One Word Descriptions

Collaborative

Wander

Communicative

Goal

Efficient

Independent

Ant Colony Optimization

Stigmergy
is
a
mechanism of indirect
coordination between
agents or actions. The
principle is that the
trace
left in
the
environment by an
action stimulates the
performance of a next
action, by the same
or a different agent.

Ant Colony Explained


(non parametric)

What Humans Do..


Explore
Leave trail
Trail becomes more
pronounced with use
Trail
disintegrates
when not used

Ant Colony Explained


(non parametric)

Ants wander randomly

Each ant tries to find a route between its nest


and a food source

If food found Deposit pheromone along the


return path

More a path taken More Pheromone

Walk in the direction of


pheromone concentration

the

strongest

Ant Colony Explained


(parametric)
Nature

Computer Science

Natural habitat

Graph (nodes and edges)

Nest and food

Nodes in the graph: start and destination

Ants

Agents, our artificial ants

Visibility

The reciprocal of distance,

Pheromones

Artificial pheromones ,

Foraging behavior

Random walk through graph (guided by


pheromones)

Ant Colony Explained


(parametric)

Scheme:

Construct ant solutions


Define attractiveness , based on experience from
previous solutions
Define specific visibility function, , for a given
problem (e.g. distance)

Ant walk

Initialize ants and nodes (states)


Choose next edge probabilistically according
to the attractiveness and visibility

Ant Colony Explained


(parametric)

Pheromone Update

Parameter 0< p < 1 is called evaporation


rate

ACO In Images

Image is like a 2D graph

K ants located on image pixels randomly

Pheromone matrix of image is initialised

Ant moves based on the

probablistic information convey by pheromone matrix

Heuristic (captures edge property)

Edges are signified by large changes in intensity

ACO In Images

Edge property is captured by gradient

Ant walks for N steps and then deposits the


pheromone

Entire process is iterated

The result is that the ant does traverse edges


more

ACO In Images

Using adaptive thresholding on the pheromone


matrix create a binary image specifying edges.

ALGORITHM

Decide Heuristic Function

Pt1 = [i-1 j-1 ; i-1 j ; i-1 j+1 ; i j-1] ;


Pt2 = [i+1 j+1 ; i+1 j ; i+1 j-1 ; i j+1] ;
IM_Grad(I,j) = Pt1 Pt2 ;

i-2
j-1

i-2
j+1

I-1
j-2

I-1 j1

I-1 j

I-1
j+1

i-1
j+2

I
1

I,J

I
j+1

I+1
j-2

I+1
j-1

I+1
j

I+1
j+1

I+1
j+2

I+2
j-1

I+2
j+1

j-

Pt1 = [i-2 j-1 ; i-2 j+1 ; i-1 j+2 ; i+1 j+2 ;i-1 j-1 ; i-1 j ; i-1 j+1 ; i j1] ;
Pt2 = [i+2 j+1 ; i+2 j-1 ; i+1 j-2 ; i-1 j-2 ;i+1 j+1 ; i+1 j ; i+1 j-1 ; i
j+1] ;
IM_Grad(I,j) = Pt1 Pt2 ;

I1
J-1

I
J

Pt1 = [i-1 j-1 ] ;


Pt2 = [i j ] ;
IM_Grad(I,j) = Pt1 Pt2 ;

ALGORITHM

Two Ants cannot be at same


position

Ants possess memory

Ant randomly placed when no


suitable neighbour exist

ALGORITHM

Pheromone Updation 1- When each


ant takes one step

Pheromone = (1 - Evaporation_Rate) .* Pheromone + ;

Pheromone Updation 2- Once after


end of Tour

Pheromone = (1 - Evaporation_Rate) .* Pheromone + ;


Where,
(x,y) = (x,y) + Evaporation_Rate + * gl/max gl ;
is a constant
gl = abs(Current(x,y)- minval) and max gl = maxval - minval

ALGORITHM

Ants would become old,


subsequently die
Ants would reproduce for their
survival
Self Regulate Population

Self Regulation of
Population

Fitness of Ants

Age i.e hops


Resources fed upon (gradient)

Fitness function

Fitness(j) = Fitness(j) - decay + decay* gl/max gl


Where decay is a constant, decay = .0025

The ant decays with a probability P(j) = 1 Fitness(j)

Self Regulation of
Population

Reproduction cycle

Triggered when another ant is present


at neighbour
n is number of neighbour ants
(n) is the weighing factor depending
upon n
(n) = [0 .25 .5 .75 1 .75 0.5 .25 0]
Ants

3 4

Self Regulation of
Population

Reproduction Probability
Prob(i)r = (n) * ( + (1-) * (gl / max gl))
where some constant , 1.9
gl = abs(Current(x,y)- minval)
and max gl = maxval - minval

Self Regulation of
Population

Offspring can be placed

Parent ant
Randomly in the search space

Poor edge detection when placed


next to parent ant as compared to
placing it at random location

Analysis

Offspring at Parent location and


number of Offsprings twice of Initial

Offspring at random location and


number of Offsprings twice of Initial

Analysis

Analysis

Further Development

Future scope is to analyse the


response of algorithm by varying
the various parameters and
constants like pheromone
evaporation rate, decay parameter,
(n), , , , Number of Ants, no.
of steps, gradient matrix, study
behaviour of offsprings.

bibliography

[1]. www.wikipedia.com
[2]. An ant-inspired algorithm for detection of image edge features.
S. Ali Etemada, Tony
White
[3]. Ant System: Optimization by a Colony of Cooperating Agents
Marco Dorigo, Member, IEEE, Vittorio Maniezzo, and Albert0 Colorni. IEEE TRANSACTIONS ON
SYSTEMS, MAN, AND CYBERNETICS-PART B CYBERNETICS, VOL 26, NO 1, FEBRUARY 1996
[4]. Solving Traveling Salesman Problem by Using Improved Ant Colony Optimization Algorithm. Zar
Chi Su Su Hlaing and May Aye Khine, Member, IACSIT International Journal of Information and
Education Technology, Vol. 1, No. 5, December 2011
[5]. Wisdom of Artificial CrowdsA Metaheuristic Algorithm for Optimization. Roman V. Yampolskiy,
Leif Ashby, Lucas Hassan Journal of Intelligent Learning Systems and Applications, 2012, 4, 98-107
[6]. Low-Level Feature Extraction for Edge Detection Using Genetic Programming.
Wenlong Fu, Student Member, IEEE, Mark Johnston,
Member, IEEE, and Mengjie Zhang, Senior Member, IEEE
[7]. Self-Regulated Artificial Ant Colonies on Digital Image Habitats
Carlos Fernandes1, Vitorino Ramos2, Agostinho C. Rosa
[8].
Computational Chemotaxis in Ants and Bacteria over Dynamic Environments
Vitorino Ramos, Carlos Fernandes, Agostinho C. Rosa and Ajith Abraham
[9].
Image Edge Detection Using Ant Colony Optimization
ANNA VERONICA BATERINA1, CARLOS OPPUS

You might also like