Fractal image compression (FIC) is recognized as a NP-hard problem, and it suffers from a high number of mean square error (MSE) computations. In this paper, a two-phase algorithm was proposed to reduce the MSE computation of FIC. In the first phase, based on edge property, range and domains are arranged. In the second one, imperialist competitive algorithm (ICA) is used according to the classified blocks. For maintaining the quality of the retrieved image and accelerating algorithm operation, we divided the solutions into two groups: developed countries and undeveloped countries. Simulations were carried out to evaluate the performance of the developed approach. Promising results thus achieved exhibit performance better than genetic algorithm (GA)-based and Full-search algorithms in terms of decreasing the number of MSE computations. The number of MSE computations was reduced by the proposed algorithm for 463 times faster compared to the Full-search algorithm, although the retrieved image quality did not have a considerable change.
Image compression is the current mainstream research topic in image processing [1, 2] and is still a viable research area, owing to the growing need for multimedia data transmission and storage . Fractal image compression (FIC) is a lossy compression method developed in the late 1980s by Barnsley and Lurd . Jacquin  presented an automatic algorithm called baseline fractal image compression. In [6, 7], classification methods for determining the domain blocks were proposed. In , the information existing within the matched range block (a neighborhood matching method) is used for the encoding process, but is based on the spatial correlation between the range and the domain block. Truong and Jeng  proposed the use of the discrete cosine transform (DCT) inner product-based algorithm for removing the redundancy that exists while the eight mapping of the domain block is computed. Furao and Hasegawa  introduced a no-search encoding fractal algorithm for faster encoding process by choosing a domain block with the same center as the range block; in essence, the domain block is encoded as a matched block.
In recent years, some literature combined the genetic algorithm (GA) with the FIC method to address the encoding time problem. In [11–17], the chromosome fitness for the evolutionary process was determined by calculating the distance from domain to range blocks. In , the use of Fisher classification, the genetic compression algorithm, and quad-tree partitioning were adopted for faster encoding time. In their work, the avoidance of premature convergence of GA was taken into consideration as one of the ways to minimize computation time. A spatial correlation GA was introduced in  for speeding up FIC. Their approach were of two stages, performing the spatial correlation in image for both range block and domain block so as to obtain local optima, but if the local optima was not the actual optima, a self-similarity approach is adopted to determine the best match within the image blocks. In , schema genetic algorithm was proposed; in their approach, the genetic operators based on the schema theorem within the evolutionary process are used to accelerate the encoding process and also conserve the image quality. In , classification of image blocks based on DCT coefficients was applied with GA to minimize encoding time. In , Similar Extension algorithms as well as an algorithm for partitioning the images by means of irregular region in the FIC have been introduced, which were purposed for constructing the irregular region transformation. They increased considerably the compression ratios that were obtained by conventional block-based partition. Based on local fractal dimensions, dynamic classification scheme is presented in . In , a FIC scheme was introduced based on the fact that the affine similarity between two blocks in FIC is equivalent to the absolute value of Pearson's correlation coefficient between them. Despite all the proposed methods for encoding time reduction discussed here, the problem of encoding time still exists, especially for natural scene images. Imperialist competitive algorithm (ICA) is an optimization algorithm introduced through socio-political process of imperialistic competition that was proposed in 2008 . The aforementioned process is responsible for handling various optimization tasks. In different domains, several characteristics of ICA such as effectiveness, limitedness, and applicability have been investigated. Improvements in both global optima and convergence rate are the major achievements of ICA. This paper aims at speeding up fractal encoding through an ICA. The proposed algorithm is composed of two steps: First, according to the image blocks' edge property, classify all image blocks using the DCT coefficients. Second, using results obtained from the first step, the algorithm divides the countries into two groups - developed countries and undeveloped countries. For reducing the mean square error (MSE) computations, we calculate just the MSE value.
The paper is composed of four further sections. Section 2 introduces the basic theory behind FIC. In Section 3, the concept behind the ICA is discussed, while in Section 4, the implementation of the fractal encoding strategy using the proposed ICA is presented. The experimental results of the proposed approach are presented in Section 5. Finally, the conclusion is drawn and possible future of the research is presented.
2 Fractal image compression
Fractal image compression (FIC) can be practically implemented if we assume that f is a given 256 × 256 gray level image. The range pool R is considered as the set of all non-overlapping blocks of size 8 × 8, making up 1,024 blocks. D denotes the domain pool, which specifies the set of the whole possible blocks of the size 16 × 16 of image f, which makes up 58,081 blocks . In the case of each block v from the range pool, fractal transformation (FT) is generated by searching all elements that exist within the domain pool D and exploring the most resembled block . Let u signify a subsampled domain block with a size similar to v. The similarity that exists between v and u is assessed by mean square error (MSE) which is shown as follows:
where M × N is the image size.
FT allows the dihedral transformation of the domain blocks to be done. It is performed by rotating the domain blocks at angles 270°, 180°, 90°, and 0° (counter clockwise) and flipping the angle with respect to the point where y = x. In so doing, the eight orientations of the domain blocks could be generated. To achieve the most similar block from the domain pool, there exist 464,648 MSE computations for a particular block from the range pool. As a result, to encode completely the image by means of the basic algorithm of fractal compression (Full-search), 475,799,552 computations are totally required.
For a particular range block v, FT also allows the brightness q and the adjustment of the contrast p on the subsample domain block u. The similarity of u and v is determined by the quantity d = ‖p. uk + q - v‖, where uk, 1 ≤ k ≤ 8 represents the eight transformations of u, in which q and p can be obtained as follows:
where N = 64.
The fractal code of v is determined based on the location of the most similar domain block, the orientation k, the contrast p, and the brightness q. Practically, 16 bits are needed to represent the location of the domain block for a 256 × 256 image. Given q, p, and the orientation k, the bits values of 7, 5, and 3 bits are needed, respectively. The encoding process is completed when v completed execution across the 1,024 range blocks in R.
3 Imperialist competitive algorithm
Imperialist competitive algorithm (ICA) is an evolutionary algorithm for optimizing computation field. Atashpaz and Lucas  developed the ICA based on the evolution of human's socio-political societies. The ICA solutions are not strictly fixed at the local optima, which makes it applicable to problems requiring near-optimal solution. ICA was shown in  to be effective, especially in cases where a space of a problem exists among many local optima. This characteristic of the ICA makes it appropriate for FIC. Like other evolutionary algorithms, ICA can be defined by populating similar things into a group, which can be referred to as ‘country’. Two groups of countries called the imperialists and colonies are determined from the population group. At the initial stage of this algorithm, some countries are generated and their powers are measured based on the cost function. Then, imperialists are selected among the most powerful countries, and others are considered as colonies of the imperialists. To assign colonies to the imperialists proportionally, the normalized cost of each is used. One of most significant issues in ICA is the assimilation policy where the countries move toward their imperialist (minimum optima). The assimilation requires that the colonies move individually on the line connecting them to their assigned imperialist .
Another factor that plays an important role in ICA is the imperialistic competition during which the empires with less power will lose their colonies, and by so doing, the colonies will be owned by other imperialists. For calculating the total power of an imperialist, two powers should be considered: its own power and that of its colonies. In each of the iteration, some colonies that are of less power are selected based on the revolution rate and replaced with new ones, randomly. Similar to other evolutionary algorithms, several conditions can lead to termination, which are when no more iteration occurs or there is no improvement to the final results.
4 Proposed ICA-based fractal image compression
In this section, the strategy proposed in the current study is explained in detail. The strategy has two phases: first, partitioning all blocks of the image which is performed based on the edge property which is specified by the coefficients of DCT; and second, encoding each range block via ICA in which an appropriate mechanism for finding the best candidate empire is employed to decrease MSE computation.
4.1 Phase 1: image partitioning based on DCT coefficient
The classification algorithm mainly aims at categorizing the whole image blocks (i.e., range and domain blocks) into three discrete classes. From the spatial domain, a block of image could be transformed to the frequency domain by means of DCT transformation. Within the frequency domain, the DCT coefficient that is situated in the upper left of the image block signifies the image block's low-frequency information and its rough contour, whereas the DCT coefficient that is situated in the lower right of the image block signifies the image block's high-frequency information and its fine texture. Therefore, we can explore the class of the image block by considering its lower-higher frequency DCT coefficients.
Therefore, for executing the classification, we used F(1,0) which indicates the lowest vertical coefficient and F(0,1) which represents the lowest horizontal coefficient. The DCT function is presented as follows:
where m,n = 0,1,…,N - 1, and
If a block is smooth, it means that it has a small F(1,0) and F(0,1), so its block does not have a clear texture. Therefore, this block could be categorized as a smooth type and represented by S type. A far distance between F(1,0) and F(0,1) indicates the edge in the block. If F(1,0) is large and F(0,1) is small, it indicates a vertical edge. On the contrary, if F(1,0) is small and F(0,1) is large, it indicates a horizontal edge. In both conditions, we classify this image block as a horizontal/vertical edge that is represented by HV type. In another condition, if F(1,0) is large and also F(0,1) is large, it indicates that this block is either a subdiagonal or a diagonal edge. In this situation, this block is classified as DS type.
For determining the types of image blocks, first, the DCT transformation is executed for finding their F(0,1) and F(1,0) values that, in turn, can indicate the class of the blocks. For each image block, a DCT absolute coefficient pair (|F(1,0)|, |F(0,1)|) is constituted based on absolute values of its F(1,0) and F(0,1). After that, we should normalize these absolute coefficient pairs; thereafter, they are known as (|F(1,0)|N, |F(0,1)|N). The obtained values are labeled on a Cartesian coordinate system in which |F(1,0)|N and |F(0,1)|N are x and y coordinates, respectively. Figure 1 shows the coefficient pair before normalization. As we can see in Figure 1a, all points are scattered throughout the Cartesian coordinate system, while in Figure 1b, the whole points are located on the first quadrant. It was performed to facilitate the classification of the points. In Figure 2, normalized coefficient pairs that are placed upon the first quadrant's unit circle are presented.
For all points, the distance and angle are calculated from and to the first point of the Cartesian coordinate system. TD and TA are two thresholds that are used for classification; TD is the distance threshold, and TA is the angle threshold. Therefore, according to Figure 2, if an image block is located on the unit between TA and 90 - TA and its distance value is more than TD, it is classified as DS type. All blocks whose distance value is less than TD are classified as S type. The remaining blocks are classified as HV class.
The algorithm of classification is shown as follows:
4.2 Phase 2: DCT imperialist competitive algorithm for FIC
As it can be observed in the ICA algorithm, the values of power of countries (i.e., MSE) should be calculated for all countries existing in the algorithm. Based on the edge property of the blocks, the domain blocks will be considered as proper candidates if and only if they are in a class with the same label as that of the range block. To avoid the useless computations, countries could be divided into two groups: developed countries and undeveloped countries. A suitable country is one which is able to be matched with the range block. Countries of a certain class are more likely to be matched with the range block of the same class. These are developed countries that have also the chance to be selected as empire. On the other hand, those countries whose class is not matched with the range block are known as undeveloped countries which, consequently, have less chance for being an empire. It is hoped that these countries will be developed and get a better position in the future decades. The power will be calculated merely for the developed countries. For the undeveloped countries, - Inf is assumed as their powers, which reduce MSE computation size. Based on the power of countries, the algorithm chooses NE countries as empire. Pseudo code of this proposed algorithm is shown below:
The stages of this pseudo code are explained as follows:
➢ Country formation
The stages of formation are a key part of DCTICA of FIC; in order to create the fractal encoding for the country using the partitioned iterated function system (PIFS), dihedral transformation pt and the location (px, py) of the domain block for each country are considered. As demonstrated in Figure 3, the country has three parts that are allocated px, py, and pt, where px represents the domain blocks in the horizontal direction, py its vertical position, and pt the transformation at rotation 0°, 90°, 180°, 270°, horizontal, vertical flip, relative to 135°, and flip relative to 45°.
➢ Calculate the country power
For calculating the power of each country within the population, the similarity characteristic is measured using MSE. The countries with less MSE are more similar to the candidate range block, and consequently, they will be more powerful.
➢ Initializing the empires and their colonies
More powerful countries are selected to be emperors; other counties are designated as colonies, which are dominated by one of the emperors. The colonies are distributed between the empires but on the basis of the empires' power; empires with more power will obtain more colonies. Based on the power of countries, the algorithm chooses NE countries as empire. As a result, three conditions may arise: (1) If NE is greater than the total number of developed countries, all these countries will be assigned as empire and the remaining empires will be selected randomly among undeveloped countries. (2) If NE is smaller than the number of members of the developed countries, NE members are selected as the empire and the remaining will be distributed as colony among the empire. (3) If NE is equal to the developed countries, all will be selected as empire. The undeveloped countries will be distributed ultimately among the emperors according to the empires' power.
➢ Moving the colonies toward their relevant imperialist
Here, the integration policy that each country requires in order to move toward their local minimum optima is determined. As the emperor is more powerful than its colonies, optimal solutions are located more probably around them. Therefore, each colony should move toward its corresponding emperor. In essence, the colonies have the chances of getting a new position that may be better than their last position.
➢ The colony position exchange
In new positions, developed countries and undeveloped countries are formed. The power of developed countries is calculated merely. For the undeveloped countries, - Inf is assumed as their powers. If a colony possesses a higher power in comparison with its imperialist, that colony can become the new imperialist, and this can be termed exchange.
In each imperialist, according to the revolution rate, a country can be selected and is then moved to a new position. This stage is performed randomly. In the proposed algorithm, when a revolution takes place in a country, it is hoped that this country would be directed to a better position. As we know, better situation for the country is that it could join the developed countries group. Therefore, if the revolution takes place in a developed country, and after revolution, it is positioned as an undeveloped one, and then we can ignore the revolution and consider its former position as the current one. On the other conditions, the new position obtained by the countries after revolution would be recorded for them.
➢ Computing the total cost
Here, for computing the total cost of each imperialist, first, we calculate the mean power of the developed countries belonging to that empire, and then we add a proportion of this value to the power of the empire itself. Equation 5 presents this operation. n stands for the number of developed countries of this imperialist, and ξ is a number considered to be between 0 and 1.
In this step, the weak colonies from the weak empires are picked and then added with high power imperialist.
➢ Eliminating the powerless empires
The weakest empires are those with no colony. If an empire is the weakest, its imperialism will be eliminated and replaced by a country that we consider as a colony with powerful empire.
➢ Terminating condition
Steps 23 to 51 would be repeated until Decade = 0 or just one imperialist would remain in the cycles. This empire is considered as the best solution for the supposed range block. For each range block, steps 6 to 53 are done.
5 Experimental results
Some tests are conducted on the proposed algorithm, and its performance has been compared to that of the Vences-GA , Wu-GA1 , Wu-GA2 , ICAFIC, and basic algorithm of fractal compression (Full-search) in terms of the number of MSE computation and peak signal-to-noise ratio (PSNR). The application of the proposed approach is checked on standard images F16, Pepper, Baboon, and Lena with the size of 256 × 256 in gray-scaled mode. The size of range blocks and domain blocks is fixed at 8 × 8 and 16 × 16, respectively. The PSNR is applied for comparing the results.
Parameters in ICA are set by γ = .0.5, β = 1, and both the number of decades and the number of initial imperialists are set to 10. For each chromosome, the crossover rate in GA is fixed to 0.6 and the probability of mutation to 0.01. The angle threshold for the Lena picture is set to 17.65, and for other pictures, it is set to 17.75. Table 1 presents the values of TA and TD for each picture. These values have been obtained via several experiments. Table 2 shows the number of elements existing in each class of range blocks and domain blocks. The results obtained from the experiments carried out on the proposed algorithm and GAs are demonstrated in Tables 3, 4, 5, and 6. In Table 3, the parameter of ICA for number of initial countries and parameter of GA for the number of population are set to 160, whereas in Table 4, they are set to 200, and in Tables 5 and 6, they are set to 250. The results presented in Table 6 obtained from GA are based on elitism.
For more evaluation of the algorithm performance, we set the number of initial countries by 300 for the image of Lena, and the results are presented in Table 7 and Figure 4.
According to Tables 3, 4, 5, 6, and 7, the proposed algorithm has been successful in improving the performance of FIC. As Tables 3, 4, 5, 6, and 7 clearly demonstrate, DCTICA has a better performance than the GAs, even those that are based on the elitism. Obviously, ICA could be suitably applied in FIC. Although in terms of the PSNR, the Full-search algorithm is better than the proposed algorithm; the proposed algorithm has a lower computational complexity, so it could be more advantageous than the other one. As an example, for Lena image, the Full-search method performs 475,799,552 MSE calculations, while the proposed method, with 200 initial countries and 10 initial empires, performs 1,026,341 MSE computations; it means about 463 times less than the Full-search algorithm. The method proposed in this research obtains an acceptable result with much less computational complexity. The PSNR per initial imperialist for Lena image shows in Figure 4 that the number of initial countries is set by 300.
The main problem of FIC is the high number of MSE computations that has classified it in the NP-hard problems. In this paper, for reducing the MSE computation, a two-phase algorithm is proposed. In the first phase, all image blocks were divided into three classes according to the image blocks' edge property. In the second one, the ICA algorithm found the suitable domain blocks using the results obtained in the first phase. For accelerating the algorithm, countries were divided into two groups - developed and undeveloped countries - and the value of MSE is computed only for the developed ones. Finally, results of the experiments carried out on the standard images demonstrated an improvement on FIC. Moreover, these results revealed that our method performance was more successful than the Wu-GAs and Vences-GA methods in terms of the retrieved image quality and the amount of MSE computation. It is noticeable that the amount of MSE computation in the Baboon picture has been 502 times more than that of the basic FIC algorithm, while the PSNR value is just 0.41 less than that of the basic FIC algorithm.
Kaarna A, Zemcik P, Kalviainen H: Multispectral image compression. In Proceedings of Fourteenth International Conference on Pattern Recognition. Brisbane, Australia; 1998:16-20.
Qorbani A, Ali N, Ali A, Saeed N: Square function for population size in quantum evolutionary algorithm and its application in fractal image compression. In Sixth International Conference on Bio-Inspired Computing Theories and Applications (BIC-TA). Penang, Malaysia; 2011:27-29.
This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (
), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.