8. ACO
Introduction
Overview:
In the real world, ants (initially) wander randomly, and upon
finding food return to their colony while laying down
pheromone trails.
Over time, however, the pheromone trail starts to evaporate,
thus reducing its attractive strength.
In a short path pheromone density remains high.
Thus, when one ant finds a good (i.e., short) path from the
colony to a food source, other ants are more likely to follow
that path.
9. ACO
Natural behavior of ant
Ant Algorithms – (P.Koumoutsakos – based on notes L. Gamberdella (www.idsia.ch)
11. ACO
Edge Detection Model
ACO algorithm
Initialize
SCHEDULE_ACTIVITIES
Construct Ant Solutions
Do Daemon Actions (optional)
Update Pheromones
END_SCHEDULE_ACTIVITIES
12. ACO
Edge Detection Model
Initialize:
Set the parameters and assigning the initial pheromone value.
Schedule Activities:
1. Construct Ant Solutions:
• Here, τij(t) represents quality of pheromone on the edge.
• ηij represents the heuristic information.
otherwise
allowedki
t
t
tp
k
allowedk
ijij
ijij
k
ij
k
0
f
)(
)(
Where
to GO??
13. ACO
Edge Detection Model
2. Do Daemon Actions:
Performed by multiple ants to improve the solution or search
process.
3. Update Pheromones:
The goal of the pheromone update is to increase the
pheromone values associated with good solutions and
decrease those associated with bad ones.
Update is done by:
τij(t + n) = р × τij(t) + ∆ τij
here p, is pheromone evaporation rate and ∆ τij is the
quantity of pheromone laid on edge.
15. ACO
ACO-based Image Edge Detection
• A pixel is connected to every pixel that touches one
of its edges or corners.
• An ant cannot move to a pixel if it is not
connected to the pixel where the ant is
currently located.
• An ant can move only to an adjacent pixel.
16. ACO
ACO-based Image Edge Detection
• Artificial ants are distributed over the image.
• The goal is to construct a final pheromone matrix that reflects
the edge information.
• Each element in the pheromone matrix corresponds to a
pixel in the image and indicates whether a pixel is an edge
or not.
i-1,j-1 i-1,j i-1,j+1
i,j-1 i,j i,j+1
i+1,j-1 i+1,j i+1,j+1
17. ACO
ACO-based Image Edge Detection
1. Initialization Process :
• K ants are assigned random positions in the M1 X M2 image.
• The initial value of each element in the pheromone matrix
is set to a constant τinit.
• The heuristic information at pixel (i,j) is determined by the
local statistics at that position:
• Here Ii,j is the intensity value at (i,j), and
max
,
,
)(
v
Iv jic
ji
1,1,1,11,1,1,11,11,1, )( jijijijijijijijijic IIIIIIIIIv
i-1,j-1 i-1,j i-1,j+1
i,j-1 i,j i,j+1
i+1,j-1 i+1,j i+1,j+1
18. ACO
ACO-based Image Edge Detection
2. Iterative Construction and Update Process:
• On every iteration, an ant moves from the pixel to an
adjacent pixel according to the pseudorandom proportional
rule.
• Each time an ant visits a pixel, it immediately performs a
local update on the associated pheromone.
• The amount of pheromone on the pixel on the iteration,
is updated based on the equation for ACS local
pheromone update.
init
n
ji
n
ji .).1( )(
,
)(
,
19. ACO
ACO-based Image Edge Detection
2. Iterative Construction and Update Process:
After all the ants finish the construction process, global
pheromone update is performed on pixels that have been
visited by at least one ant:
Here, is the amount of pheromone deposited by each ant
on each pixel.
)(
,
)1(
,
)(
,
1
.).1( K
ji
n
ji
n
ji
K
K
)(
,
K
ji
20. ACO
ACO-based Image Edge Detection
3. Decision Process:
• The final pheromone matrix is used to classify each pixel either as an
edge or a non-edge.
• The decision is made by applying a threshold on the final pheromone
matrix.
Do initialization procedures
for each iteration n = 1:N do
for each construction_step l = 1:L do
for each ant k = 1:K do
Select and go to next pixel
Update pixel’s pheromone (local)
end
end
Update visited pixels’ pheromones (global)
end