speeding up fractal image compression by genetic

4 downloads 0 Views 161KB Size Report
Genetic coding , fractals , compression , image processing. 1. Introduction .... 583-594, 1995. [6] Mandelbrot, Benoit B. Fractals: form, chance, and dimension.
SPEEDING UP FRACTAL IMAGE COMPRESSION BY GENETIC CODING Faraoun Kamel Mohamed

BOUKELIF Aoued

Evolutionary Engineering and Distributed Information Systems Laboratory, EEDIS Computer Science Department University of Sidi Bel-Abbès, Algeria Tel/Fax: (213)-48-57 77 50

Laboratoire des télécommunications et du traitement numérique de signal, équipe de recherche des techniques vidéo Département Electronique,Université de S.B.A. Tel 213-48-57 82 81 [email protected]

Email : [email protected]

ABSTRACT : The main problem of all fractal compression implementations is the execution time. So the major variants of the standard algorithm were proposed to speed up computation time. But most of them lead to a bad quality, or a lower compression ratio. For example, the Fisher’s proposed classification pattern has greatly accelerated the algorithm, but image quality was poor, due to the search space reduction imposed by the classification, which eliminates a lot of good solutions. By using genetic algorithms to address the problem, we want to optimize the domain blocks search, we explore all domain blocks presents in the image, but not in exhaustive way (like standard algorithm), and without omitting any possible block (solution) like does classification pattern. A genetic algorithm is the unique method to satisfy theses constraints. And it is away to be a random search, because the genetic one is directed by fitness selection which produce optimal solutions. Our goal in this work is to use genetic algorithm to solve the IFS inverse problem, and build a fractal compression algorithm based on genetic optimization of domain blocks search. We deduced an optimal set of values for the best parameters combination, and we can also specify the best combination for each desired criteria: best compression ratio, best image quality or quick compression process. By running many test images ,we experimentally found the following set of optimal values of all the algorithm parameters which ensure compromise between execution time and solutions optimality : Population Size=100 ; Maximum generations = 20 ; Crossover rate = 0.7 ;Mutation rate = 0.1 ;RMS limit = 5 ; Decomposition error limit = 10 ;Flips and isometrics count = 8. In our proposed algorithm, results were much better than those obtained in both Vences & Rudomin [43] and Marc M. Lankhorst [46] approaches. KEY WORDS : Genetic coding , fractals , compression , image processing. 1. Introduction

The major inconvenient of the current fractal compression algorithm, is its high computational demands. To find existing redundancies (called self-similarities in fractal terms), this algorithm must perform many tests and comparisons between different areas of the compressed image. We cannot find easily similar parts in any natural images, so algorithm complexity is very high, which lead to a very slow compression process. The genetic algorithms are principally destined to complex problems, were no exact solution exist, and an exhaustive brows of the related search space lead to an NP-Hard problem, or high computation time. Our goal

1

is to accelerate the compression process, by improving the standard compression algorithm with a genetic search technique. Our approach uses genetic algorithm to optimise the search of similarities in the target image, the standard optimisation methods are sufficient for the calculation of related parameters when the similarity is detected .

2. Our algorithm : improving standard method with genetic algorithms

The fractal compression scheme for a single image can be seen as in the following algorithm. /* Genetic algorithm for FIC */ 1. P ← generate(LIFS) randomly 2. For all LIFS pi ∈ P evaluate by applying (pi) to generate an image and measuring its distance (using the L1 or L2 metric) to the original image 3. While termination criteria not met 4. Do reproduce pi ∈ P according to evaluation 5.Apply the desired mutation operator (simple or modified) to some pi ∈ P, selected in some way, creating new LIFS 6. Apply the desired mating operator (simple or modified) to some pi , pj ∈ P selected in some way, creating new LIFS 7. Evaluate new LIFS (as above) 8. Replace the worst old strings with the best new strings.

2

2.1. The parameters of the algorithm The behaviour of the genetic algorithm can be controlled using many initial conditions and parameters .We can control convergence speed, solutions quality and algorithm evolution when adjusting and modifying these parameters. In our algorithm, we have two different sets of parameters : those which control genetic evolution, and those controlling the fractal compression pattern. The set of parameters of genetic control is given by : • • •

Population size : specify the number of individuals in each generated population (constant during all steps); Crossover rate: specify the probability used to select individuals submitted to crossover operator; Mutation rate : specify the probability used to select individuals submitted to mutation operator; Maximum generations: specify the maximum number of generations to evaluate before assuming that a particular run has converged prematurely, and should be aborted.

The second set of parameters, which control and specify the fractal compression pattern is equivalent to the one used in standard compression algorithm, it control the partition size, the decomposition pattern and the transformations quantification parameters, we have : • • • • • •

The range blocks decomposition size (used with regular partitioning); The lowest block size used for ranges decomposition (in the case of Quadtree pattern); The number of flips and isometrics applied to each domain block to be compared with the current range block; The decomposition error limit, this parameter is introduced to improve the Quadtree decomposition pattern, as above mentioned in the Quadtree algorithm description (see section 1.2 in the current chapter). The RMS error limit fixed to decide if a given transformation is accepted. The fitness value of the best individual in each population is compared to this value, and if it is lower, the individual is selected as the optimal solution and the algorithm is stopped. The number of bits used to quantify and code luminance and contrast parameters, fixed experimentally to 5 and 7 bits respectively.

2.2. The structure of the algorithm

Based on all this elements, the genetic compression algorithm operate on an input image according to the following general steps : Algorithm Genetic-Compression (Input I :256x256 grey scale image, Output W: Coded IFS);

1- Decompose the input image into range blocks according to the used partitioning pattern; 2- For each block R in Ranges(I) do - Generate a random population of chromosomes (transformations); - While (No optimal domain block is found) and (population maximum is not reached) do • Compute fitness value for all individuals; • Apply crossover operator on population individuals (selected with the crossover rate); • Apply Mutation operator on population individuals (selected with the crossover rate); • Generate the new population; End Do; End While; - Write obtained transformation parameters to the output W; End For;

3

3.Simulation results :

All tests were executed on a PIII-INTEL 800MHz with 128Mo of RAM size.

3.3. Genetic algorithms with Quadtree decomposition : The best Solution The genetic compression algorithm was used with Quadtree partitioning. Different parameters were used for each test, and the obtained results are given in both table forms and graphical forms. Examples of reconstructed images are also given to illustrate reconstruction quality.

Table 1. Different compression results of Lena image while applying different values of RMS error limit RMS Limit 0.0 2.0 4.0 5.0 8.0 10.0 15.0 20.0 25.0

Execution Time 2 min 44 sec 1 min 56 sec 49 sec 43 sec 36 sec 33 sec 21 sec 14 sec 15 sec

Quality (dB) 35.66 dB 35.03 dB 34.89 dB 34.80 dB 34.50 dB 30.50 dB 22.33 dB 19.36 dB 19.01 dB

Compression Ratio 4.29 :1 6.35 :1 9.28 :1 9.82: 1 9.95 :1 10.05 :1 13.66 :1 19.34 :1 26.25 :1

Ranges count 4069 blocks 2770 blocks 2023 block 1792 blocks 1768 blocks 1750 blocks 1288 blocks 910 blocks 670 blocks

3.3.1. Effect of parameters controlling genetic evolution Effect of population size The second parameter to be tested is the population size, results obtained with different sizes of population are illustrated in table 1. the best value for this parameter is 100 individual. It is a good compromise between execution speed and image quality. The same work has been done with both crossover rate and mutation rate, these parameters are less important than RMS error or population size, but crossover rate must always be greater than mutation one to ensure best selection of optimal solutions. All the obtained results are summarized in the following graphs.

Graph 1. Boat image compression time variation according to crossover rate values

Graph 2. Boat image compression ratio variation according to crossover rate values

4

Graph 3. Boat image compression time variation according to mutation rate values

Graph 4. Boat image compression ratio variation according to mutation rate values

3.3.2. Conclusion and Optimal parameters values From the previous presented results, we can deduce an optimal set of values for the best parameters combination, and we can also specify the best combination for each desired criteria: best compression ratio, best image quality or quick compression process. The following tables summarize different combinations obtained from to the previous tests. The compromise is always difficult to find. A global comparison of the three presented compression algorithms for which best results are given in the tables 2, 3 ,4 and 5.

Table 2. Optimal compromise parameters for the genetic compression algorithm Population Size Maximum generations Crossover rate Mutation rate RMS limit Decomposition error limit Flips and isometrics count

Population Size Maximum generations Crossover rate Mutation rate RMS limit Decomposition error limit Flips and isometrics count

100 20 0.7 0.1 5.0 10.0 8

Table 4. Parameters for the genetic compression algorithm which give best quality Population Size Maximum generations Crossover rate Mutation rate RMS limit Decomposition error limit Flips and isometrics count

Table 3. Parameters for the genetic compression algorithm which give best ratio

Table 5. Parameters for the genetic compression algorithm which give faster compression Population Size Maximum generations Crossover rate Mutation rate RMS limit Decomposition error limit Flips and isometrics count

1000 20 0.8 0.1 2.0 5.0 8

5

500 20 0.8 0.1 10.0 20.0 8

50 20 0.8 0.1 10.0 20.0 8

Table 6. Results obtained on different used images using quadtree partitioning pattern

Standard Algorithm Image Lena

Rate Quality 11.48 :1 32.01 dB

Genetic Algorithm

Classification Algorithm

Time 1:10:11

Rate 9.88 :1

Quality 33.25 dB

Time 42 s

Rate 9.73 :1

Quality 30.05 dB

Time 2m 55s

Boat

8.88:1

26.56 dB

1:27:04

8.17 :1

28.05 dB

50 s

7.9 :1

25.86 dB

3m 22s

Barb

10.85:1

27.07 dB

1:22:15

8.49 :1

28.99 dB

52 s

8.62 :1

29.65 dB

4m 12s

Peppers

24.56:1

33.07 dB

1:05:17

10.16 :1 30.24 dB

45 s

10.16 :1

29.36 dB

2m 45s

8. REFERENCES [1] E. Reusens, “Partitioning complexity issue for iterated function systems based image coding," Proc. VII-the European Signal Processing Conference EUSIPCO, Edinburgh, vol. 1, pp. 171{174, 1994). [2] “Lambda Saupe, D., Ruhl, M., Evolutionary fractal image compression, in: Proc. ICIP-96 IEEE [3] Jacobs, E. W., Fisher, Y., Boss, R. D., Image compression: A study of the iterated function systems [4] Fisher, Y., Fractal Image Compression, Fractals 2,3 (1994) 325-334. [5] Caso, G., Obrador, P., Kuo, C.-C. J., Fast methods for fractal image encoding, in: Proc. SPIE VCIP 1995, Vol. 2501, pp. 583-594, 1995. [6] Mandelbrot, Benoit B. Fractals: form, chance, and dimension. Translation of Les objets fractals. W. H. Freeman, San Francisco, 1977. [7] M.F. Barnsley and S. Demko. Iterated function systems and the global construction of fractals. In Proceedings of the Royal Society of London A399, pages 243–275, 1985.

6