 Open Access
 Total Downloads : 706
 Authors : Mr. Vishvas V. Kalunge, Prof. Varunakshi Bhojane
 Paper ID : IJERTV1IS10409
 Volume & Issue : Volume 01, Issue 10 (December 2012)
 Published (First Online): 28122012
 ISSN (Online) : 22780181
 Publisher Name : IJERT
 License: This work is licensed under a Creative Commons Attribution 4.0 International License
Time Optimization Of Fractal Image Compression By Using Genetic Algorithm
Mr. Vishvas V. Kalunge Prof. Varunakshi Bhojane
ME [Computer Engg.] Assistant Professor, Computer Dept. Pillai's Institute of Information Technology Pillais Institute of Information Technology
New Panvel, Navi Mumbai, India. New Panvel, Navi Mumbai, India.
Abstract
Compressing an image is nothing but storing that image in less number of bytes without degrading the quality of an image to an unaccepted level. Compressed image gives less data for the transmission, which results into fast transfer of data over limited bandwidth. Various techniques are available to compress the images. Fractal Image Compression (FIC) is the one which uses self similarity property of the image and compress the images compactly. But algorithm takes more time in order to find self similar parts within an image. This results into large amount of time to compress the image. The solution to this problem is to use of Genetic Algorithm (GA) to find similar parts in an image. With genetic algorithm the task of finding similar parts become very easy and can be completed in less time. So we are optimizing the time required to fractal image compression by using genetic algorithm.
Keywords: Fractals, Genetic algorithm, Image compression.

Introduction
The aim of this work is image compression with fractals in less time requirement. Fractal Image Compression is a lossy compression technique introduced by Michael F Barnsley and Jacquin [1],[8]. This method is best suited for textures and natural images, relying on the fact that parts of an image often resembles other parts of the same image.
The process of matching fractals does not involve looking for exact matches, but instead looking for
"best fit" matches based on the compression parameters (encoding time, image quality, and size of output) [8]. But the encoding process can be controlled to the point where the image is "visually lossless." That is, one shouldn't be able to notice where the data was lost.
Compression process is extremely computationally intensive [2] as Millions or billions of iterations are required to find the fractal patterns in an image. Depending upon the resolution and contents of the input bitmap data, and output quality, compression time, and file size parameters selected, compressing a single image could take anywhere from a few seconds to a few hours (or more) on even a very fast computer.
Solution to this problem is use of genetic algorithm which speed up computation time. By using genetic algorithms to address the problem, we want to optimize the domain blocks search [3].

Fractal Image Compression without applying GA.
The basic scheme of the fractal image compression is to partion a given image into non overlapping blocks of size r*r , called range blocks and form a domain pool containing all of possible overlapped blocks of size 2r*2r , called domain blocks [7]. Means original image is divided into several blocks twice. One to form the set of range blocks and other to form the set of domain blocks. After dividing the image into set of range blocks and set of domain blocks, algorithm try to find the best possible domain block for each and every range blocks (as shown in fig 1). The range
domain block matching process consists of searching the domain pool D for the Di, and an affine transformation wi, which minimizes the distance between the range block Ri and the transformed domain block wi*Di. It considers the first range block apply the various transformations on it and try to find best possible match for it from the domain pool. It continues the same process for the remaining range blocks. For one range block it apply around eight transformations separately and find the best possible match by comparing it with each and every domain blocks in domain pool. The domain and range matching is done based on the fitness function.
Fig 1:Domain range block transformation
2.1 Algorithm for FIC without applying GA

Input a square binary image.

Divide image with square range blocks. The total set of range blocks must cover image, without overlapping.

Introduce the domain blocks D; they must intersect with image.

Define a collection of transformations mapping domain block D to the range block Ri.

For each range block, choose a corresponding domain block and symmetry so that the domain block looks most like the part of the image in the range block.

Write the compressed data in the form of a local IFS code.

Apply a lossless data compression algorithm to obtain a compressed IFS code [2].
Normally the size of the domain block is double than the size of range block. While comparing the domain blocks with range block, we cannot compare it
directly because of size variation. In order to compare it, domain blocks must be compressed to 50% to make it similar to range block.
Easily we cannot find similar parts in any natural images, so algorithm complexity is very high, which leads to a very slow compression process [3].

Fractal Image Compression by applying GA

Genetic Algorithm
A genetic algorithm (GA) is a search heuristic that mimics the process of natural evolution. This heuristic is routinely used to generate useful solutions to optimization and search problems. Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to optimization problems using techniques inspired by natural evolution, such as mutation, selection, and crossover.
GA requires solutions in binary as strings of 0s and 1s. The evolution usually starts from a population of randomly generated individuals and happens in generations. In each generation, the fitness of every individual in the population is evaluated, multiple individuals are stochastically selected from the current population (based on their fitness), and modified (recombined and possibly randomly mutated) to form a new population. The new population is then used in the next iteration of the algorithm. Commonly, the algorithm terminates when either a maximum number of generations has been produced, or a satisfactory fitness level has been reached for the population. If the algorithm has terminated due to a maximum number of generations, a satisfactory solution may or may not have been reached.

Parameters that affects the output
There are so many parameters that affect the output. The parameters include parameters of fractal image compression and parameters of genetic algorithms. Few of them are as follows.

Range and domain block size.

Error limit.

Number of transformations used.

Fitness function.

Population Size.

Crossover rate.

Mutation rate.

Number of iterations.


Creating Chromosomes
Genetic algorithm works on the chromosomes. So creating chromosomes from the range blocks and domain blocks is the very critical step in applying genetic algorithm to fractal image compression. The transformation parameters obtained for each block coded on a fix number of bits. Such transformations are stored as chromosomes.
These parameters and number of bits required to store that transformation are as follows:

Xdom is the X coordinate of the domain block, which is coded by 8 bits

Ydom is the Y coorinate of the domain block, which is coded by 8 bits

S is scaling factor : which belong to [1,+1] and coded by 5 bits.

O is the contrast factor: which range from 0 to 255, code on only 7 bits.

The isometric flip parameters: take its values between 0 and 7 for 8 possible flips and rotations. So it can be coded by 3 bits [3].
With the help of above mentioned parameters we can create the chromosome for every domain block in 31 bits only. Once population of the chromosomes is created, genetic algorithm applies its crossover and mutation operators to create the new offsprings of better quality. It decides the quality of the offspring depend on its fitness function.


Fitness Function
In our implementation we used linear regression as a fitness function. Linear regression attempts to model the relationship between two variables by fitting a linear equation to observed data. In linear regression, data is modeled using linear predictor functions, and unknown model parameters are estimated from the data. Formula for linear regression is given below.
c = (xa*yb)'*(xa*yb) where
a = (xmeanx)'*(ymeany)/((ymeany)'*(ymeany))
b = (meanxa*meany); and
meanx = mean(x); meany = mean(y);

Applying Crossover operator
Crossover operator selects the two parents depend upon their fitness and try to create new Childs of better quality. Higher the fitness value, greater is the chance of selection for crossover. Crossover operator may be single point crossover or two point crossover. Crossover alters the genes of the parent chromosome as shown in fig 2.
Fig 2: Working of crossover operator

Applying mutation operator
Mutation is a genetic operator that alters one ore more gene values in a chromosome from its initial state. This can result in entirely new gene values being added to the gene pool. With these new gene values, the genetic algorithm may be able to arrive at better solution than was previously possible. Mutation operation is used to introduce the diversity in the chromosomes. Randomly it changes the piece of information depending upon the mutation rate.
Wend
Wend
– write obtained transformation parameters to the Output Coefficient;
Fig 3: Working of mutation Operator

Algorithm for fractal image compression by applying Genetic Algorithm.
Input: take a NxN square image
Initialize FIC parameters like range block size, fitness function, error limit, no. of iterations.
Initialize GA parameters like mutation rate, crossover rate;
Divide the input image into set of range blocks;
Divide the input image into set of domain blocks;
Generate a random population of chromosomes from region blocks;
While Loop (Number of iterations reached) While Loop (until all Regions not coded)
Select Region Blocks sequentially
While Loop (until last generation reached)

Compute fitness for all regions;

Depending upon the fitness search the optimal domain block from domain pool;

When optimal domain block found
Generate new population {Apply Selection, Crossover and Mutation operators};
Wend.
In this algorithm the task of finding the best domain block for each and every range block is carried out by the Genetic Algorithm (GA), which results in to the fast compression of the image.



Fractal Image Decompression
Fractal image decompression is quite faster than the compression. In our implementation we have taken random image as an input for decompression and generated the output image. Already IFS code prepared during compression contains the transformation and on which block that transformations are to be applied. At the time of decompression just apply that transformations iteratively to the respective block in reverse order [5]. After some iterations we get the decompressed image which is similar to the original image then the process should be stopped. The number of iterations required to decompress the image by using GA are less than the decompression done in normal way. Initial few iterations of decompression are as shown in fig 4.
1st Iteration 2nd 3rd 4th
Fig 4: Iterations of the decompression.

Results
We carried out this work on intel i3 processor with 220 GHz and 3 GB of RAM. In our implementation we have taken image size as 128*128, range block size as 4*4 and domain block size as 8*8. We got the results shown in table 1. The compression ratio
remains same for all same size images. Any change in range block size or domain block size or input image size, changes the output.
Table 1: Time comparison of FIC by applying GA and without applying GA.
Image
Input Image Size
Output Image Size
Time for Compressi on without
GA
Time for Compres sion with
GA
Lena
48
KB
5120
Bytes
184 sec
67 sec
Barbara
48 Kb
5120
Bytes
243 sec
66 sec
Fruits
48
KB
5120
Bytes
245 sec
62 sec
Apple
64
KB
5120
Bytes
196 sec
85 sec

Conclusion:
Fractal image compression is one of the best method to compress the image. But main drawback of FIC is, it takes more time to compress the image. In order to reduce the time required for the compression, we applied genetic algorithm. Experimental results show that GA achieves good optimization in time required for fractal image compression.
References

V. Chaurasia and Ajay , Review of novel techniques: Fractal image compression International journal on emerging technology, 2010.

Y. Chakrapani and K.Soundara Rajan,Genetic algorithm applied to fractal image compression, ARPN Journal of Engineering and Applied Sciences, VOL. 4, no. 1, february 2009

Aoued BOUKELIF] ,Optimization of Fractal Image Compression Based on Genetic Algorithms ,5th international conference: Sciences of Electronic,Technologies of Information Telecommunications March 2226, 2009 TUNISIA

Y. Chakrapani and K. Soundera Rajan, Implementation of Fractal Image Compression Employing Hybrid GeneticNeural Approach, international journal of computational cognition vol. 7, no. 3, September 2009.

PouYah Wu, Fast Fractal Image Compression, Dept. of Mathematics Education, National Tainan Teachers College, Taiwan, 2006

Miroslav Galabov,Fractal Image Compression International Conference on Computer Systems and Technologies – CompSysTecp003.

Mohamcd Elsherif, Mohsen rashwan, Alaa Elsayad, Matching Criteria in Fractal Image Compression IEEE Midwest Symp. On Circuits and Systems, Aug 2000.

Hannes Hartenstein, Associate Member, IEEE, Matthias Ruhl, and Dietmar Saupe, RegionBased Fractal Image Compression, IEEE Trans. on image processing, vol. 9, no. 7, july 2000.

M. F. Barnsley, Fractal everywhere, Academic Press, New York, 1988.

Y. Fisher, Ed., Fractal Image CompressionTheory and Application.New York: Springer, 1994.

Y. Fisher, Fractal Image CompressionTheory and Application. New York: SpringerVerlag, 1994.

Martin V Sewell, Fractal Image Compression, MSc Computing Science project report, 1994.

http://seminarprojects.com/Threadfractal image compressionseminarreport.