Fractal Image Compression by Local Search and Honey Bee Mating Optimization
Fractal Image Compression by Local Search and Honey Bee Mating Optimization
(1)
S is the contrast control parameter obtained from the
following equation [9] and must be constrained in [-1,1]:
(2)
O is the luminance control parameter obtained as follows:
(3)
For a range block with n pixels, each with intensity ri and a
decimated domain block with n pixels, each with intensity di,
the objective is to minimize the quantity:
(4)
(5)
For each range block R
i
and domain block Di, if E (R
i
, D
i
) <=
error, this domain block is marked as matching block of R
i
.
Then the domain block position, the orientation of eight
dihedral transformations and S,O parameters are saved as
encoding information and the algorithm proceeds to the next
block. If the condition is not met then another domain block is
taken from the domain pool and compared to the range block.
This process is repeated until all range blocks are processed.
III. QUADTREE AND NO-SEARCH FRACTAL
IMAGE CODING
A. Quadtree scheme
As mentioned above, All proposed approaches try to find
a compromise between time executions, reconstruction quality,
and compression ratio. for traditional fractal compression
methods, a very significant process is quickly locating a
suitable domain block, which could cover the range block well.
However, there is a certain possibility that we are not able to
find a domain block satisfying the match requirements within
the image. This is especially true for the situations that require
high quality of reconstructed images. The quadtree partition
scheme is a good choice to solve the problem without loss of
reconstruction quality. Quadtree scheme is one of the
techniques that can be used to reduce the range blocks and
improve the encoding speed and compression ratio. There are
regions that could be covered well with larger range blocks as
well as regions that are difficult to cover well this way. In a
quadtree partition, a square in the image is broken up into 4
equally sized sub-squares, when it is not covered well enough
by a domain. This process repeats recursively starting from the
whole image and continuing until the squares are small enough
to be covered within some specified rms tolerance. Small
squares can be covered better than large ones because
contiguous pixels in an image tend to be highly correlated[3].
In this paper, we use the adaptive rms tolerance to improve
the performance of the quadtree scheme. The reason is, for
large range blocks, we hope the reconstruction fidelity be
higher in order to assure the decoding quality of the whole
image; and for small range blocks, we have to loose the
threshold criterion to get satisfied compression ratio. In this
experiment ,linear relation
T
n+1
=2*T
n
+1 (6)
is used to change the tolerance. Here n means the quadtree
level, T
n
means the error threshold of the n level.
B. no-search scheme
No-search scheme is one of the method which is able to
improve the speed of fractal image Compression and
compression ratio greatly. In this method we dont need to
store the coordinates of domain blocks and it is useful for
improvement compression ratio .The following algorithm
gives the detail for this scheme.
(1) Give one threshold error T, separate the original image
into range blocks R
i
with size B
ini
and mark all range blocks
uncovered.
(2) While there are uncovered range blocks R
i
, suppose the
position of R
i
is (row, col), size of R
i
is B_B, take the domain
block in position (rowB/2, ColB/2), and calculate the
scaling parameter, contrast and error E.
(3) If B = B
min
or E<T, store transformation parameters.
(4) If E>T, separate the range block into four equally sized
sub-blocks, increase the threshold value T corresponding to
such blocks, mark these sub-blocks as uncovered range blocks
and remove R
i
from the list of uncovered range blocks, turn to
(2).
Fig. 1, is the geometric description of the relation
between range block R and domain block D.
Fig 1: Position relationship between range block R and
domain block D.
IV. HONEY BEE MATING OPTIMIZATION
- 705 -
Reducing the complexity of search space for matching
range block and domain block in fractal image compression is
an aim for researchers to solve this problem in recent decades .
Today, due to the complexity and various problems in
optimization problems, extensive efforts to use randomized and
approximate algorithms have been taken. Although these
algorithms does not guarantee the global optimum, but an
appropriate optimal solution can be found in reasonable
number of iterations.
Over the last decade ,modeling the behavior of social
insects, such as ants and bees ,for the purpose of search and
problem solving has been the context of the emerging area of
swarm intelligence. Honeybees are among the most closely
studied social insects. Honeybee mating may also be
considered as a typical swarm-based approach to optimization,
in which the search algorithm is inspired by the process of
marriage in real honeybee. Honeybee has been used to model
agent-based systems[11] .In a recent work, Abbass [10]
developed an optimization algorithm based on the honeybee
marriage process.
A honeybee colony typically consists of a single egg-laying
long-lived queen, anywhere from zero to several thousands
drones. Queens are specialized in egg laying .A queen bee may
live up to 5 or 6 years, whereas worker bees and drones never
live more than 6 months. There usually several hundred drones
that live with the queen and worker bees. Mother Nature has
given the drones just one task, which is to provide the queen
with some sperm. After the mating process, the drones die
.They are haploid and act to amplify their mothers genome
without altering their genetic composition, except through
mutation. Workers specialized in brood care and sometimes lay
eggs. Broods arise either from fertilized or unfertilized eggs. In
the marriage process, the queen(s) mate during their mating
flights far from the nest. A mating flight starts with a dance
where the drones follow the queen and mate with her in the air.
In a typical mating-flight, each queen mates with seven to
twenty drones. In each mating, sperm reaches the spermatheca
and accumulates there to form the genetic pool of the colony.
Each time a queen lays fertilized eggs, she retrieves at random
a mixture of the sperms accumulated in the spermatheca to
fertilize the egg (Page, 1980). Insemination ends with the
eventual death of the drone, and the queen receiving the
mating sign. The queen mates multiple times but the drone
inevitably only once. These features make bees-mating the
most spectacular mating among insects.
First solution to solve the optimization problem using this
algorithm, is the determining decision variables .These
variables include: determine the drone genes ,define fitness
function for optimization, Select a function for drone mating
with the queen is been considered ,therefore A drone mates
with a queen probabilistically using an annealing function as
follows:
e
D Q prob
t S
f
) (
) , (
'
(6)
where Prob(Q, D) is the probability of adding the sperm of
drone D to the spermatheca of queen Q (that is, the probability
of a successful mating); ( f ) is the absolute difference between
the fitness of D (i.e., f (D)) and the fitness of Q (i.e.,f (Q)); and
S(t) is the speed of the queen at time t. It is apparent that this
function acts as an annealing function, where the probability
of mating is high when either the queen is still in the start of
her matingflight and therefore her speed is high, or when the
fitness of the drone is as good as the queens. After each
transition in space, the queens speed, S(t), and energy, E(t),
decay using the following equations:
J
D
) ( ) 1 (
) ( ) 1 (
t E t E
t S t S
(7)
where is a factor [0, 1] and is the amount of energy
reduction after each transition.
Thus, an Honey-Bees Mating Optimization (HBMO)
algorithm may be constructed with the following five main
stages :
1. The algorithm starts with the matingflight, where a
queen (best solution) selects drones probabilistically to form
the spermatheca (list of drones). A drone is then selected from
the list at random for the creation of broods.
2. Creation of new broods (trial solutions) by
crossoverring the drones genotypes with the queens.
3. Use of workers (heuristics) to conduct local search on
broods (trial solutions).
4. Adaptation of workers fitness based on the amount of
improvement achieved on broods.
5. Replacement of weaker queens by fitter broods
The main steps of the HBMO algorithm presented in Fig. 2.
Fig 2: HBMO algorithm
V. THE PROPOSED FRACTAL ENCODING
METHOD
- 706 -
In this section, our proposed method is presented. As you
know, compression ratio and image quality have an inverse
relation with each other. The aim of this paper is to increase the
compression ratio with improvement image quality.
As mentioned above ,Quadtree scheme is one of the
techniques that can be used to reduce the range blocks and
improve the encoding speed and compression ratio .also No-
search scheme is One of the method which is able to improve
the speed of fractal image Compression and compression ratio
greatly. Because of we dont need to store the coordinates of
domain blocks and it is useful for improvement compression
ratio. Therefore, this paper has chosen these two approaches.
Since Search in blocks with large size decrease the
possibility that the number of range blocks and thus improve
the rate of compression, is so high, so A new method we have
proposed to determine a new local search window with
variable size on each level quadtree it can reduce the search
space .also in the search window has been selected HMBO
algorithm to search.
According to our proposed ,the proposed fractal encoding
algorithm is listed below:
** Give one threshold error T; Initial search window size
,determine broods genotype, number of brood ,drone and
worker s bees , queens speed and energy ,separate the
original image to range blocks with size B
ini
and mark all
range blocks uncovered.
** While there are uncovered range blocks R
i
; do
{
1. Suppose the position of R
i
is(row
R
; col
R
) size of R
i
is
B * B; take the domain block in position (rowB/2,
ColB/2), and calculate the scaling parameter
,contrast and error .
2. If B = B
min
or E<T, store transformation parameters
and mark R
i
as covered.
3. else If error>T; search window with variable size is
generated and HBMO algorithm for search in this
window is used .if the candidate domain block is
found below threshold within the generated search
window, the position of the best matched domain
block, the value of s , the value of o are stored and
mark R
i
as covered.
4. Else separate the range block into four equally sized
sub-blocks, increase the threshold value T
corresponding to such blocks, decrease size of search
window, mark these sub-blocks as uncovered range
blocks and remove R
i
from the list of uncovered
range blocks.
}
Suppose the position of range block is (row
R
; col
R
) and size
of search window is (w*w).position of search window is
determined as follows:
For those range blocks with position (row
R
<w/2, col
R
<w/2),we
choose the search window in (row
R
, col
R
). For those range
blocks with position (row
R
<w/2) or (col
R
<w/2), we choose the
search window in (row, Col-w/2) or (row-w/2, Col) ,otherwise
we choose the search window in (row-w/2, Col-w/2).
In Fig.I ,the block diagram of proposed method is shown.
VI. EXPERIMENTAL RESULTS
The algorithm is implemented in Matlab7 software.
Execution is carried out on a Personal Computer with Intel
Pentium Dual E2160 processor at a clock frequency of 1.8
GHz, with 1.0 GB of RAM.
Suppose the position of range block is (row
R
; col
R
) we check
Lena(128*128*8) Girl and Baboon(128*128*8) and
pepper(128*128*8) with our Algorithm. The initial B is set as
16 and B
min
is set as 4. In this paper we change the
compression ratio to(bit per pixel) bpp to make the
compression convenient. The performance of the decoded
image quality is measured by PSNR (peak signal-to-noise
ratio).
For every range block, we use 13 bits to store
transformation parameters,5 bits for the scaling parameter (s)
and 7bits to store the mean of range blocks (o) and 1bit To
determine methods selected(no-search or HBMO) .if the
candidate domain block is obtained from HBMO we must to
store coordinate domain block. In the quadtree structure, we
considered Three levels, starting at 16 _ 16 blocks and
finishing in 4 _ 4 blocks .The rms error threshold T will be
changed by T
n+1
=2*T
n
+1 ,n :1, 2 ,3 . we just store a sequence
of bits that indicate the order of decomposition to recopute the
coordinate in the decompression process: a bit 1 indicate that
the block is decomposed and a 0 indicate that the block is not
decomposed.
Size of search window is supposed 128*128 in level 32-32,
64*64 in level 16-16 ,32 *32 in level 8-8 and 16*16 in level 4-
4 .
In Table I ,the set of optimal value of HBMO algorithm is
given .These value ensure compromise between execution time
and solutions optimality .After each transition in space, the
queens speed, S(t), and energy, E(t), decay using (7),we
choose the initial queens energy a random number in [0.5-1]
and after each transition decreases.
Table II, shows results obtained from lena image in our
algorithm, with different error threshold T
n
for two different
quadtrees levels.
TABLE I. OPTIMAL PARAMETERS OF HBMO ALGORITHM
TABLE II. RESULTS OBTAINED WITH DIFFERENT ERROR THRESHOLD TN
Initial population
size
For selecting
queen
Max drone in
Mating-flight
probability of a successful
mating
100 80 0.25
Initial Speed
Queen
Number of bee
worker
Rms limit
80 80 30
- 707 -
As is clear, if the error threshold is increased then image
quality is decreased and compression ratio increases.
Table III, presented the results of comparison between the
proposed algorithm and other two methods .In this table, the
size of each range block in the full search algorithm and in the
spatial-correlation algorithm is supposed 4 * 4. For a true
comparison, We run these two algorithms in the same
condition with the proposed algorithm. Table III shows that the
proposed algorithm is a good choice to replace with the
pervious algorithms. We have been able to obtain, high
compression ratio with reduce the encoding time while
retaining the quality of the retrieved image.
Also ,Table IV presents the image retrieved by the
proposed algorithm.
TABLE III. EXPERIMENTAL RESULTS OF DIFFERENT ENCODING METHODS
VII. CONCLUSION
The present paper offered a new technique which improves
fractal image compression through the use of no-search scheme
and local search with honey bee mating optimization to
improves the compression ratio , reduce the encoding time
while retaining the quality of the retrieved image. In this paper
for improvement compression ratio and increase image quality
,at first quadtree method was selected ,then no-search method
was used for speed up in encoding phase and improvement
compression ratio ,if suitable domain block didnt get with this
method, it should used from a new search window with
variable size for local search with HBMO algorithm until
decrease number of range block possible and then increase
compression ratio .In this method ,decrease window size at
each quadtree level . The reason of we selected variable
window size at each level is at initial level the size of domain
block is large and with selection large size window increases
the chance of suitable domain block in this environment and
with decrease size of domain block , search environment is
decreased. proposed algorithm is a good choice to replace with
the pervious algorithms .
REFERENCES
[1] Jacquin AE. Image coding based on a fractal theory of iterated
contractive image transformations. IEEE Trans Image Process
1992;1:1830.
[2] M. Barnsley, Fractal image compression, in: Blackledge J.M.(Ed.),
Image Processing: Mathematical Methods and Applications, Clarendon
Press, Oxford, 1997, pp. 183210.
[3] Fisher Y. Fractal image compression: theory and application. Berlin:
Springer-Verlag; 1995.
[4] Wang Z, Zhang D, Yu Y. Hybrid image coding based on partial fractal
mapping. Signal Process Image Commun 2000;15:76779.
[5] Furao S, Hasegawa O. A fast no search fractal image coding method.
Signal Processing and Image Communication 2004;19(5):393404.
[6] Ming-Sheng Wu, Spatial correlation genetic algorithm for fractal image
compression, Chaos, Solitons and Fractals 28 (2006) 497510
[7] Ming-Huwi Horng, A multilevel image thresholding using the honey
bee mating optimization, Applied Mathematics and Computation 215
(2010) 33023310
[8] S. Hsiung, J. H. Jeng, Contrast Prediction for Fractal Image
Compression, The 24th Workshop on Combinatorial Mathematics and
Computation Theory, pp. 325-329, 2007
[9] Ch. ZHOU, K. MENG, Z. QIU, A Fast Fractal Image Compression
Algorithm Based on Average-Variance Function, IEICE Transactions
on Information and Systems, vol. E89D, no. 3, pp. 1303-1308, 2006.
[10] Bozorg Haddad O, Afshar A, Marin MA (2005) Honeybees mating
optimization algorithm (HBMO); a new heuristic approach for
engineering optimization. Proceeding of the First International
Conference on Modeling, Simulation and Applied Optimizatio
(ICMSA0/05), Sharjah, UAE
[11] Horng, M.H.: Multilevel Minimum Cross Entropy Threshold selection
based on Honey Bee Mating Optimization. In: 3rd WSEAS
International conference on Circuits, systems, signal and
Telecommunications, CISST 2009, Ningbo, pp. 2530 (2009)
[12] Truong TK, Kung CM, Jeng JH, Hsieh ML. Fast fractal image
compression using spatial correlation. Chaos, Solitons & Fractals
2004;3:10716.
Encoding
Time(min)
bpp
Psnr(db)
Encoding
method
Image
256256
4356 1.67 33.12 Full search[1]
Lena
2634 1.40
32.56
Spatial
correlation[12]
20 0.98
30
Proposed
algorithm
4301 1.67 32.12 Full search[1]
pepper
2298 1.39
33.30
Spatial
correlation[12]
25 0.91
28.12
Proposed
algorithm
3921 1.67 23.4 Full search[1]
Baboon
2512 1.41
19.9
Spatial
correlation[12]
35 1.03
19.01
Proposed
algorithm
- 708 -
2
(a)
Lena
256256
(b)
Baboon
256256
FIG
T
Original Ima
G I .
TABLE IV.
age
PSNR= 3
PSNR=19
BLOCK DIAGRAM
DECODED IM
0(db) b
.01(db)
M OF PROPOSED M
MAGES BY PROPO
bpp=0.98 Enco
bpp=1.03
METHOD
OSED METHOD
Decoded Ima
oding time=30
encoding time=8
age
80
- 709 -