Ant Colony Optimization (ACO)

Ant Colony Optimization ACO
Fractal Image Compression
鄭志宏
義守大學 資工系 高雄縣大樹鄉
J. H. Jeng
Department of Information Engineering
I-Shou University, Kaohsiung County
1
Outline






Fractal Image Compression (FIC)
Encoder and Decoder
Transform Method
Evolutionary Computation Methods
Ant Colony Optimization ()
ACO for FIC
2
Multimedia vs 心經

眼耳鼻舌身意 色聲香味觸法


眼:Text, Graphics, Image, Animation, Video
耳:Midi, Speech, Audio
鼻:電子鼻, 機車廢氣檢測
舌:成份分析儀, 血糖機, Terminator III
身:壓力, 溫度感測器, 高分子壓電薄膜
意:Demolition Man

7-th “Sensor”




3
Digital Image Compression

Finite Set
• a, b, c, … ASCII
• 你, 我, … Big 5

Geometric Pattern
• Circle --- (x,y,r)
• Spline --- control points and polynomials

Fractal Image
• Procedure, Iteration

Natural Image
• JPEG, GIF
4
Fractal Image
–having details in every scale
5
Fractal Image
6
Affine Transformations
0  x
 x  1 / 2
w1    
 y
y
0
1
/
2
  
 
0  x  0 
 x  1 / 2
w2    
 



 y   0 1 / 2  y  1 / 2
0   x  1 / 2
 x  1 / 2
w3    
 



 y   0 1 / 2  y   0 
W  w1  w2  w3
7
Local Self-Similarity
8
Fractal Image Compression





Proposed by Barnsley in 1985, Realized by Jacquin
in1992
Partitioned Iterated Function System (PIFS)
Explore Self-similarity Property in Natural Image
Lossy Compression
Advantage:
• High compressed ratio
• High retrieved image quality
• Zoom invariant

Drawback:
• Time consuming in encoding
9
Search for Best Match
Original Image
…….
r0 r1
…….
…….
d 6538
d1922
Domain Pool (D)
Range Pool (R)
10
Expanded Codebook

Search Every Vector in the Domain Pool

For Each Search Entry:
• Eight orientations
• Contrast adjustment
• Brightness adjustment
11
The Best Match

v : range block to be encoded

u (i, j ) : search entry in the Domain Pool

uk (i, j ): eight orientations, 1  k  8
 (v)  min { ( p  uk (i, j )  q)  v }
2
i , j ,k , p ,q
12
Eight Orientations (Dihedral Group)
1
T  t1 , t 2 , t3 , t 4 , t5 , t6 , t7 , t8 
2
90
4
3
flip
1
2
4
3
t5  3
2
4
1
t1 
t2 
2
3
1
4
t6 
4
3
1
2
t3 
3
4
2
1
t7 
1
4
2
3
t4 
4
1
3
2
t8 
2
1
3
4
13
Matrix Representations
Rotate 0º
1 2
case 1 : 
 0
Flip of case 1
0
1 2
Flip of case 6
 1 2
case 2 : 
 0
0
1 2
 0
case 6 : 
1 2
 1 2
0 
Rotate 270º
0 
 1 2
Rotate 180º
 1 2
case 4 : 
 0
1 2
0 
Rotate 90º
Flip of case 7
1 2
case 3 : 
 0
 0
case 5 : 
1 2
 0
case 7 : 
 1 2
1 2
0 
Flip of case 4
0 
 1 2
 0
case 8 : 
 1 2
 1 2
0 
14
Contrast and Brightness
 (i, j )  min { k  ( pk  uk (i, j )  qk )  v }
2
k 1.. 8
N 1 N 1
N 1 N 1
[ N  uk , v   uk (i, j ) v(i, j )]
2
pk 
i 0 j 0
i 0 j 0
N 1 N 1
[ N 2  uk , uk  ( uk (i, j )) 2 ]
i 0 j 0
N 1 N 1
1  N 1 N 1
qk  2  v(i, j )  pk  uk (i,
N  i 0 j 0
i 0 j 0

j )

15
Affine Transform and Coding Format
 x   ak
W  y    ck
 z   0
bk
dk
0
0  x  i 
0   y    j 
p   z  q 
x, y : The
position of a pixel
z : The gray level of a pixel
i, j : position
ak , bk , ck , d k : dihedral group
p : contrast scale
q : intensity offset
(i, j , Tk , p, q)
(8, 8, 3 , 5 , 7 )
16
De-Compression




Make up all the Affine Transformations
Choose any Initial Image
Perform the Transformation to Obtain a New
Image and Proceed Recursively
Stop According to Some Criterions
17
The Decoding Iterations
Init Image
Iteration=3
Iteration=1
Iteration=2
Iteration=4
Iteration=8
18
Full Search Coder
Original 256256 Lena image


Encoding time = 22.4667 minutes
PSNR=28.515 dB
19
Complexity
Image Size = 256256
Original Image
…….
r0
r1
…….
…….
d 6538
d1922
Domain Pool (D)
Range Pool (R)
Domain block=1616 down to 8*8
Range block = 88
#Domain blocks = 256  16  12  58081
2
#Range block = 256 / 8  1024
#MSE= 580818 = 464648
Contrast and Brightness Adjustment
20
Deterministic


Contrast and Brightness: Optimization
The Dihedral Group: Transform Method
 (i, j )  min { k  ( p  uk (i, j )  q)  v }
2
k 1.. 8
  min { (i, j )}
i, j
21
Non-Deterministic



Classification Method
Correlation Method
Soft Computing Method
 (i, j )  min { k  ( p  uk (i, j )  q)  v }
2
k 1.. 8
  min { (i, j )}
i, j
22
Soft Computing

Machine Learning
• ANN, FNN, RBFN, CNN
• Statistical Learning, SVM

Global Optimization Techniques
• Branch and Bound, Tabu Search
• MSC, SA
• GA, PSO, ACO

To infinity and beyond
23
Global Optimization Techniques

Deterministic
• Branch and Bound (Decision Tree)

Stochastic
• Monte-Carlo Simulation
• Simulated Annealing (Physics)

Heuristics
• Tabu Search
• Evolutionary Computation (Survival of the Fittest)
24
Evolutionary Computation

Genotype and Phenotype
•
•
•
•
•

Genetic Algorithms (GA)
Memetic Algorithm (MA)
Genetic Programming (GP)
Evolutionary Programming (EP)
Evolution Strategy (ES)
Social Behavior
• Particle Swarm Optimization (PSO)
• Ant Colony Optimization (ACO)
25
Genetic Algorithm



Developed by John Holland in 1975
Mimicking the natural selection and natural
genetics
Advantage:
• Global search technique
• Suited to rough landscape

Drawback:
• Final solution usually not optimal
26
Spatial Correlation Genetic Algorithm (1)

Two stage GA: 1. spatial correlation
W
SV
L
S D1
d D1
dV
SH
r D1
rV
rH
rj
r D2
S D2
d D2
dH
27
Particle Swarm Optimization (PSO)

Particle Swarm Optimization
•
•
•
•
•

Introduced in 1995 by Kennedy and Eberhart
Swarm Intelligence
Simulation of a social model
Population-based optimization
Evolutionary computation
Social Psychology Principles
• Bird flocking
• Fish schooling
• Elephant Herding
28
Edge-Property Adapted PSO for FIC

Hybrid Method vs Fused Methods

Visual-Salience Tracking
Edge-type Classifier, 5 Edge Types
Predict the Best k (Dihedral Transformation)
Intuitively Direct the Swarm Velocity Direction
according to Edge Property



29
Behavior of Ants



Secrete and Lay Pheromone
Detect and Follow with High Probability
Reinforce the Trail
30
Ant Colony Optimization (ACO)



Proposed by Dorigo et al. (1996)
Learn from real ants
Pheromone
• Intensity
• Accumulation
• Communication
31
Artificial Ants
E
t=0
E
t=1
E
30 ants
30 ants
d=1
D
H
C
10 ants
D
d=0.5
H
C
D
H
20 ants
C
20 ants
d=1
d=0.5
B
10 ants
B
B
30 ants
30 ants
A
A
A
32
Ant system


Proposed by Dorigo et al. (1996)
Characteristics of AS to solve TSP
• Choose the town with a probability
•
•
Town distance
Amount of trail (pheromone)
• Force the ant to make legal tours
•
Disallow visited towns until a tour is completed
• Lay trail on each edge (i, j ) visited when it
completes a tour
33
TSP

Traveling Salesman Problem

Problem of finding a minimal length closed
tour that visits each town once.

Parameters
• n : a set of towns
• d ij : the length of the path between to wns i and j
34
Probability of selecting town




k
[
τ
(
t
)]

[

]
ik
pij (t )   kallowedk ik

0
[ ij ( t )] [ij ]

if j  allowed k
otherwise
• allowed k  {N  tabu k }
•  ij : visibility ( ij  1 d )
ij
•  ,  : control the relative importance of trail versus
visibility

Transition probability is a trade-off between
visibility and trail intensity at time t
35
Pheromone Accumulation

 ij (t  n)    ij (t )   ij
• 1   : the evaporation of trail ( 0    1)
•  ij (t ) : the intensity of trail on edge (i, j ) at time
•  ij : the sum of trail on edge (i, j ) by the ants
between time t and t  n
m

 ij    ijk
k 1
36
Global update

 LQ
k

 ijk  
0

if kth ants uses edge (i,j) in its tour
(between time t and t+n)
otherwise
• Q : constant
• Lk : the tour length of the kth ant
37
Local update

Ant-density model
Q if the kth ant goes from i and j between time t to t+1
•    otherwise
0
k
ij

Ant-quantity model
Q

k
d ij if the kth ant goes from i and j between time t to t+1
•  ij  
 0 otherwise
• Shorter edges are made more desirable
38
TSP (Traveling Salesman Problem)

特性
•規則簡單
•計算複雜
•

拜訪42個城市需走過
演算法比較
•
•
•
•
螞蟻演算法 (Ant Colony Optimization)
彈性網路 (Elastic Net)
基因演算法 (Genetic Algorithm)
人腦
39
TSP result

演算法比較
推銷員問題
彈性網絡
螞蟻王國
基因演算法
人腦(平均)
Att48
5.81%
2.86%( 875)
3.0%(3256)
!4.41%(7)
Berlin52
6.90%
1.52%(1388)
7.4%(3816)
!5.18%(6)
Eil101
9.10%
7.64%(1488)
14.2%(5000)
8.83%(6)
Eil51
3.37%
4.41%(1115)
4.4%(5000)
8.98%(3)
St70
4.16%
3.42%( 283)
5.9%(4408)
7.03%(3)
Ulysses16
1.30%
0%(3289)
-0.1%( 901)
!1.05%(2)
Ulysses22
1.57%
0%(4562)
0.3%(1364)
N/A
40
TSP result

種子數為 10,20,…100產生30個城市
推銷員問題
彈性網絡
螞蟻王國(1000)
螞蟻王國(2000)
基因演算法
#1
4.442
4.597( 62)
4.442(2244)
#2
4.053
4.053(602)
4.053(2887)
#3
4.634
4.480(367)
4.480(2117)
#4
4.744
4.744(170)
4.480(1207)
4.799(2149)
#5
4.869
4.759(994)
4.737(1759)
4.737(1344)
#6
4.316
4.214(120)
#7
5.498
5.061(467)
#8
4.621
4.601(416)
4.846(1153)
#9
4.362
4.358(250)
4.387(1776)
#10
5.535
5.211(139)
5.454(2237)
Average
4.707
4.608(359)
4.601(629)
4.689(1972)
Variance
0.236
0.128
0.125
0.192
4.369(1734)
5.049(1365)
5.322(1083)
41
ACO for FIC

Ant: range block
• Secrete pheromone at cities instead of on the path
between two cities


City: domain block
Visibility: reciprocal of the MSE
• Between the agent (range block) and the city
(domain block)
 ( i (t ))  (i (t )) 



g
(

(
t
))

(

(
t
))
u
pi (t )    u
 uJ g ( t )
0
, if i  J g (t )
, otherwise
42
Lena FIC-ACO
(a) Original image
(b) Full search, 28.90 dB
(c) ACO, 27.66 dB
43
Pepper FIC-ACO
(a) Original image
(b) Full search, 30.40 dB
(c) ACO, 28.78 dB
44
Various pheromone evaporate rates
Pheromone
evaporate
rate
Quality
(PSNR)
Average
(PSNR)
0.1
27.59
27.48
27.53
27.67
27.55
27.56
0.2
27.63
27.60
27.59
27.60
27.55
27.59
0.3
27.56
27.57
27.52
27.57
27.53
27.55
0.4
27.54
27.55
27.58
27.63
27.59
27.58
0.5
27.55
27.66
27.46
27.60
27.56
27.57
0.6
27.50
27.57
27.55
27.55
27.53
27.54
0.7
27.63
27.57
27.62
27.51
27.54
27.57
0.8
27.58
27.50
27.61
27.59
27.66
27.59
0.9
27.53
27.58
27.49
27.56
27.53
27.54
45
Various parameters


1
1
27.58 27.50 27.61 27.59 27.66
27.59
2
1
27.17 27.23 27.27 27.24 27.10
27.20
1
2
26.71 26.59 26.67 27.03 26.61
26.72
2
2
26.62 26.34 26.63 26.51 26.65
26.55
Quality
(PSNR)
Average
(PSNR)
46
Result on various images
Full
search
method
Lena
Baboon
F16
Pepper
Quality
(PSNR)
28.90
20.13
26.09
30.41
Time
3620
3716
3684
3709
27.58
19.75
25.70
28.74
27.50
19.77
25.81
28.78
27.61
19.80
25.74
28.69
27.59
19.72
25.80
28.80
27.66
19.78
24.48
28.69
Average
(PSNR)
27.59
19.76
25.52
28.74
Time
144
145
144
146
Speedup
25.1
25.6
25.8
25.2
Quality
(PSNR)
Proposed
method
47
Thanks
48