A Fast Multilevel Fuzzy Transform Image Compression Method

: We present a fast algorithm that improves on the performance of the multilevel fuzzy transform image compression method. The multilevel F-transform (for short, MF-tr) algorithm is an image compression method based on fuzzy transforms that, compared to the classic fuzzy transform (F-transform) image compression method, has the advantage of being able to reconstruct an image with the required quality. However, this method can be computationally expensive in terms of execution time since, based on the compression ratio used, di ﬀ erent iterations may be necessary in order to reconstruct the image with the required quality. To solve this problem, we propose a fast variation of the multilevel F-transform algorithm in which the optimal compression ratio is found in order to reconstruct the image in as few iterations as possible. Comparison tests show that our method reconstructs the image in at most half of the CPU time used by the MF-tr algorithm


Introduction
F-transform is a technique introduced in [1] by I. Perfilieva to create a fuzzy approximation of a continuous function.It has been widely used in numerous data and image analysis applications.In particular, this technique has been applied as a lossy image compression method [2][3][4][5] in which the bidimensional discrete F-transform was applied to coding/decoding images; in [2,3] it was proved that the performance obtained by applying this method for image compression is better than that obtained with lossy image compression based on fuzzy relations and is comparable with that obtained by applying the well-known JPEG algorithm.
Being a lossy image compression method, the F-transform can be used in all cases where a loss of image information can be tolerable, such as, for example, in coding/decoding images published on Web pages or captured by lower-end digital cameras on mobile phones.When applying a lossy compression method to images in which the loss of information is presupposed, such as medical images or high-resolution remote sensing images, it is not easy to determine the best compression ratio to reach a trade-off between the advantages of reducing the image size and preserving the image quality.
In order to reach this trade-off, a method called multilevel F-transform (for short, MF-tr) was proposed in [6].It is based on a multilevel framework similar to the framework used in the Laplacian pyramid compression method (e.g., [7][8][9][10]) and in the wavelet transform (e.g., [11][12][13][14]), and its structure is similar to that used in F-transform image fusion [15][16][17][18].In the MF-tr algorithm, the bidimensional direct and inverse F-transforms are used to code and decode the image, respectively, at any level.The reconstructed image is given by the sum of the decoded images obtained at any level.
The image is compressed with a specified compression ratio; the input image at level zero is the source image, and the one in the succeeding level is given by the difference between the decoded (reconstructed) image and the input image in the previous level (the error).
If the quality of the reconstructed image is acceptable, then the process stops; otherwise, the error image is calculated and considered as an input image at the next level.This process is iterated until the reconstructed image is of acceptable quality.The quality of the reconstructed image is measured by computing the Peak Signal-to-Noise Ratio (PSNR) index: the quality of the reconstructed image is acceptable if the PSNR value exceeds a selected threshold.
In Figure 1, the architecture of the MF-tr method is schematized.In the MF-tr algorithm, the bidimensional direct and inverse F-transforms are used to code and decode the image, respectively, at any level.The reconstructed image is given by the sum of the decoded images obtained at any level.
The image is compressed with a specified compression ratio; the input image at level zero is the source image, and the one in the succeeding level is given by the difference between the decoded (reconstructed) image and the input image in the previous level (the error).
If the quality of the reconstructed image is acceptable, then the process stops; otherwise, the error image is calculated and considered as an input image at the next level.This process is iterated until the reconstructed image is of acceptable quality.The quality of the reconstructed image is measured by computing the Peak Signal-to-Noise Ratio (PSNR) index: the quality of the reconstructed image is acceptable if the PSNR value exceeds a selected threshold.
In Figure 1, the architecture of the MF-tr method is schematized.The main problem of this method results from a chosen compression ratio: If it is high, so that the compression is weak, the process ends quickly, leaving space for further compression.If, on the other hand, the compression ratio is small, i.e., the compression is strong, the computation time is longer because of many needed iterations.Therefore, it is not possible to determine a priori the functional behavior of the PSNR index with respect to the compression ratio because this function depends on many characteristics of the image.As a result, it is recommended to estimate the PSNR index for images reconstructed using various compression ratios and to find the best compression ratio a posteriori as a trade-off between the compression ratio that allows us to reach an acceptable quality of the reconstructed image and the execution time.
The compression ratio is a parameter in the range [0,1] used to characterize compression by the ratio between the sizes of the compressed and source images.The aim of this research was to improve the MF-tr algorithm by proposing an approach to find the best compression ratio in the sense explained above.This compression ratio is the one which provides a reconstructed image with the quality required to pass the chosen threshold.Subsequently, the proposed MF-tr algorithm with the selected compression ratio is executed with guaranteed quality of the reconstructed image.Comparative tests with the previously proposed MF-tr algorithms were performed, and the execution times are displayed.
In Section 2, we recall the concept of bidimensional discrete direct and inverse F-transforms and describe the MF-tr method.In Section 3, we present the fast MF-tr image compression method; in The main problem of this method results from a chosen compression ratio: If it is high, so that the compression is weak, the process ends quickly, leaving space for further compression.If, on the other hand, the compression ratio is small, i.e., the compression is strong, the computation time is longer because of many needed iterations.Therefore, it is not possible to determine a priori the functional behavior of the PSNR index with respect to the compression ratio because this function depends on many characteristics of the image.As a result, it is recommended to estimate the PSNR index for images reconstructed using various compression ratios and to find the best compression ratio a posteriori as a trade-off between the compression ratio that allows us to reach an acceptable quality of the reconstructed image and the execution time.
The compression ratio is a parameter in the range [0,1] used to characterize compression by the ratio between the sizes of the compressed and source images.The aim of this research was to improve the MF-tr algorithm by proposing an approach to find the best compression ratio in the sense explained above.This compression ratio is the one which provides a reconstructed image with the quality required to pass the chosen threshold.Subsequently, the proposed MF-tr algorithm with the selected compression ratio is executed with guaranteed quality of the reconstructed image.Comparative tests with the previously proposed MF-tr algorithms were performed, and the execution times are displayed.In Section 2, we recall the concept of bidimensional discrete direct and inverse F-transforms and describe the MF-tr method.In Section 3, we present the fast MF-tr image compression method; in Section 4, the experimental results are shown and discussed; and the conclusions are reported in Section 5.

Discrete Dircct and Inverse F-Transforms for Coding/Decoding Images
The F-transform is a well-known technique proposed in [2] to approximate a continuous function f : X → Y in a closed interval [a,b] based on the knowledge of the value of f in a discrete set of points.The F-transform deals with a fuzzy partition of the domain X given by fuzzy sets called basic functions.
Let p 1 , . . ., p N be a set of points in [a,b] on which the values assumed by the function f are known.We call this set of points sufficiently dense with respect to the fuzzy partition {A 1 , A 2 , . . ., A n } if for each basic function A i , i = 1, . . ., n, there exists at least a point p j , j = 1, . . ., N, such that A i (p j ) > 0. In this case we can define the n-dimensional vector F = [F 1 , . . ., F n ] with components called the discrete direct fuzzy transform of f with respect to the fuzzy partition {A 1 , A 2 , . . ., A n }.We define the discrete inverse F-tr of the function f with respect to {A 1 , A 2 , . . ., A n } to be the following function defined in the same points p 1 , . . ., p m of [a,b]: where f F,n is called the discrete inverse fuzzy transform of f with respect to the fuzzy partition {A 1 , A 2 , . . ., A n }.Let f(x) be assigned on a set P of points p 1 , . . ., p m of [a,b].Then, for every ε > 0, it is proved [2] that there exist an integer n(ε) and a related fuzzy partition {A 1 , A 2 , . . ., A n(ε) } of [a,b] such that P is sufficiently dense with respect to {A 1 , A 2 , . . ., A n(ε) } and the inequality |f(p j ) − f F,n(ε) (p j )| < ε holds true for every p j ∈ [a, b], j = 1, . . ., m. , where i = 1, . . ., N and j = 1, . . ., M, be a set of (N × M)-many points on which the values assumed by the function f are known.If the sets P = {p 1 , . . ., p N } and Q = {q 1 , . . ., q M } of these points are sufficiently dense, respectively, with respect to the partitions {A 1 , A 2 , . . ., A n } and {B 1 , . . ., B m }, then we define the bidimensional discrete direct fuzzy transform of f given by the matrix F with components We define the bidimensional discrete inverse fuzzy transform with respect to {A 1 , A 2 , . . ., A n } and {B 1 , . . ., B m } to be given by In [2][3][4], the bidimensional discrete direct F-transform was applied to compressed images.
We can apply the discrete direct F-transform (3) to compress the image I and the discrete inverse F-transform (4) to obtain the decoded image.
In [3,4], the matrix I was divided into submatrices I B of N B × M B size, called blocks.For any block we consider the function I B : (i, j)∈{1, . . ., N B } × {1, . . ., M B } ® [0,1]), compressing the block via direct F-transform to a block of size n B × m B with n B < N B and m B < M B , obtaining The block is reconstructed via the inverse F-transform, obtaining The reconstructed blocks are subsequently joined to form the decompressed image.Similarly, the compressed blocks are subsequently joined to form the compressed image.

Multilevel F-Transform Image Compression
The MF-transform image compression method is an iterative method proposed in [6] where the source image is initially compressed via direct F-transform and the difference between the image reconstructed via inverse F-transform and the source image is calculated in a new image called the error.The error image is the input image of the successive phase, compressed via direct F-transform, and then the image error is calculated as well.
This process continues iteratively until the quality of the reconstituted image is higher than a fixed threshold.
Formally, let I 0 be the source image.At Level 1, it is coded and decoded by using the direct and inverse F-transforms, respectively.Let I F 1 be the decoded image.In [6], a set of criteria was fixed for stopping the iterations.If the iteration stop criteria are reached, the algorithm stops and the final reconstructed image is given by I 1 M = I 1 F ; otherwise, the error at Level 1, I 1 = I F 1 − I 0 , is calculated, and the process is iterated at Level 2 where the image I 1 is coded and decoded by using the direct and inverse F-transforms.
In general, if at Level s the iteration stop criteria are reached, the final reconstructed image obtained by applying the MF-transform method algorithm will be Otherwise, the error image at Level s is calculated by and the process is iterated at Level s + 1.
In Figure 2, the MF-tr algorithm is schematized.The algorithm is shown in pseudocode in [6].
In [6], three stop iteration criteria based on the peak signal-to-noise ratio (PSNR) index were applied.
The PSNR index [19,20] measures the quality of the reconstructed image compared with the source image.The PSNR of the image reconstructed at Level s is obtained by calculating the mean square error MSE), given by The PSNR index is given by the formula where L is the number of gray levels of the image.The PSNR index is measured in decibels; it is greater the lower the value of the MSE is; that is, the smaller the mean square error compared to the original image, the closer the PSNR approaches infinity.Then, a higher PSNR value provides a higher image quality.
The MF-tr algorithm stops if at least one of the following criteria is met:

•
The PSNR of the reconstructed image at Level h is greater than a prefixed threshold PSNR th .In this case, the quality of the reconstructed image obtained is already acceptable;

•
The difference between the PSNR at the sth level and the PSNR at the (s − 1)th level is less than a difference threshold DPSNR th .The algorithm stops because the contribution to the improvement of the image quality obtainable in the subsequent iterations will be of little significance;

•
The process has reached the maximum number of iterations s max .
The parameters PSNR th , DPSNR th , and s max and the compression ratio ρ are set by the user.The execution time increases with the number of levels to be reached before meeting at least one of the three criteria defined above.Therefore, the execution time depends on the choice of the compression ratio: a compression ratio that provides at Level 1 a reconstructed image of much lower quality than that required (when PSNR PSNR th ) would imply a high execution time as many cycles will be required to obtain a reconstructed image of the required quality.and the process is iterated at Level s + 1.In Figure 2, the MF-tr algorithm is schematized.The algorithm is shown in pseudocode in [6].In [6], three stop iteration criteria based on the peak signal-to-noise ratio (PSNR) index were applied.
The PSNR index [19,20] measures the quality of the reconstructed image compared with the source image.The PSNR of the image reconstructed at Level s is obtained by calculating the mean square error MSE), given by The PSNR index is given by the formula

The Fast Multilevel F-Transform Image Compression Method
In order to set an optimal value for the compression ratio, we constructed a preprocessing phase in which the image is coded/decoded via F-transform by using a set of compression ratios.
Let I 0 be the source image of size N × M and PSNR th be the threshold of the PSNR index.We apply the F-transform method considering the set D of compression ratios ρ 1 < ρ 2 < . . .< ρ n in the range between ρ min and ρ max .
The PSNR index increases with increasing compression ratio.Thus, to find the best compression ratio, the algorithm applies the binary search strategy considering an initial compression ratio ρ First given by the median value in the set D of compression ratios.Then, the PSNR index is calculated.If the PSNR is greater than PSNR th , then a stronger compression is performed and the previously used compression ratio is set; otherwise, a weaker compression is performed and the succeeding Axioms 2019, 8, 135 7 of 13 compression ratio is used.Now we suppose that, at a certain moment, the calculated PSNR index is greater than the threshold PSNR th , while in the previous cycle it was less than PSNR th : in this case the process stops and the compression ratio used in the previous cycle is set.Otherwise, if the PSNR index is less than PSNR th while in the previous cycle it was greater than PSNR th , the process stops and the current compression ratio is set.
Below, the Fast MF-tr Algorithm 1 is shown in pseudocode.

RETURN reconstructed image
Then, the F-tr algorithm is applied using the optimal compression ratio detected.This approach allows us to decrease the processing time and to reach the minimum number of iterations that will guarantee the selected quality of the reconstruction.

Test Results
We tested our method on a set images of sizes 256 × 256 and 512 × 512 from the Southern California Signal and Image Processing Institute (USC-SIPI) Image Database (http://sipi.usc.edu/database/) using an Intel Core i7-59360X processor with a clock frequency of 3 GHz.
We set the PSNR th threshold as the value of the PSNR index for which the trend of the PSNR index varying with the compression ratio showed an approximate plateau for gradually weaker compressions.
Here, we present the results obtained with the 256 × 256 image Lena, shown in Figure 3a.We set the threshold PSNR th to 28.Table 1 shows the comparison results obtained by using the MF-tr and the proposed algorithm.In addition to the PSNR, the calculated value of the structural similarity index (SSIM) for measuring the quality of the reconstructed image is also shown.These results highlight that the CPU time needed for coding the image obtained by using the Fast F-tr algorithm was about half that required by running the MF-tr algorithm.The reconstructed image has the same quality as the image reconstructed by the MF-tr algorithm method, as measured using the PSNR and SSIM indices.Initially we used the median compression ratio ρ = 4.00 × 10 −2 , obtaining a PSNR value of 23.87.In Figure 3b, we show the decompressed image obtained.The best compression ratio was ρ Best = 0.11.In Figure 3c, we show the corresponding decompressed (reconstructed) image; the PSNR was 27.68.Using a smaller compression ratio than ρ = 0.11, we obtained PSNR = 28.41,which is greater than the threshold value.In Figure 3d, we show the final reconstructed image obtained by applying the Fast MF-tr algorithm.It was computed at Level 2, and the final PSNR was 28.29.Applying the MF-tr algorithm by considering an initial compression ratio of ρ = 4.00 × 10 −2 , the reconstructed image was obtained at Level 6.
Table 1 shows the comparison results obtained by using the MF-tr and the proposed algorithm.In addition to the PSNR, the calculated value of the structural similarity index (SSIM) for measuring the quality of the reconstructed image is also shown.These results highlight that the CPU time needed for coding the image obtained by using the Fast F-tr algorithm was about half that required by running the MF-tr algorithm.The reconstructed image has the same quality as the image reconstructed by the MF-tr algorithm method, as measured using the PSNR and SSIM indices.Below we show the results obtained using the source 512 × 512 gray image Bridge (Figure 4a).We set the threshold PSNR th to 25.By using the median compression ratio ρ = 4.00 × 10 −2 , we obtained a PSNR value of 20.79 (Figure 4b); the best compression ratio was ρ Best = 6.25 × 10 −2 , and the corresponding PSNR was 24.38 (Figure 4c).The final image was reconstructed at the second level, obtaining PSNR = 25.16 (Figure 4d).Table 2 shows the comparison results with respect to the MF-tr algorithm.Using the MF-transform algorithm, a reconstructed image with PSNR = 25.15 and SSIM = 0.91 was obtained at the fifth level, with a CPU time of 74.65 s.Using the Fast MF-tr algorithm, the reconstructed image (PSNR = 25.16,SSIM = 0.92) was obtained at the second level, and the CPU time (33.28 s) was, also in this case, about half that obtained via the MF-tr algorithm.Finally, we show the results obtained with the source 1024 × 1024 gray image Airport (Figure 5a).The threshold PSNRth was set to 28.By using the median compression ratio ρ = 4.00 × 10 −2 , we obtained a PSNR value of 22.05 (Figure 4b); the best compression ratio was ρ Best = 0.11 and the corresponding PSNR was 27.87 (Figure 5d).The final image was reconstructed at the third level, obtaining PSNR = 28.10 (Figure 5e).
Table 3 shows the comparison results with respect to the MF-tr algorithm.Using the MF-transform algorithm, a reconstructed image with PSNR = 28.12 and SSM = 0.94 was obtained at the fifth level, with a CPU time of 151.18 s.Using the Fast MF-tr algorithm, the reconstructed image (PSNR = 28.10,SSIM = 0.94) was obtained at the third level; the CPU time was 54.86-almost one-third of that obtained via the MF-tr algorithm.In the histogram in Figure 6, we show the respective mean CPU times obtained by applying the two algorithms on images with sizes 256 × 256, 512 × 512, and 1024 × 1024.
The last column in Table 4 shows the ratio between the mean CPU time obtained by using the Fast MF-tr algorithm and the mean CPU time obtained by using the MF-tr algorithm.This ratio is always less than 0.5 and decreases with increasing image size.These results show that the execution times measured using the Fast MF-tr algorithm were always less than half the execution times measured using the MF-tr algorithm.Table 3 shows the comparison results with respect to the MF-tr algorithm.Using the MFtransform algorithm, a reconstructed image with PSNR = 28.12 and SSM = 0.94 was obtained at the fifth level, with a CPU time of 151.18 s.Using the Fast MF-tr algorithm, the reconstructed image (PSNR = 28.10,SSIM = 0.94) was obtained at the third level; the CPU time was 54.86-almost onethird of that obtained via the MF-tr algorithm.The last column in Table 4 shows the ratio between the mean CPU time obtained by using the Fast MF-tr algorithm and the mean CPU time obtained by using the MF-tr algorithm.This ratio is always less than 0.5 and decreases with increasing image size.

Size
Mean CPU Time (s)

Figure 2 .
Figure 2. The multilevel F-transform image reconstruction process.

Figure 2 .
Figure 2. The multilevel F-transform image reconstruction process.

Table 3
PSNR, SSIM, and CPU times obtained for the 512 × 512 gray image Airport.Algorithm Levels PSNR SSIM CPU Time (s) the histogram in Figure 5, we show the respective mean CPU times obtained by applying the two algorithms on images with sizes 256 × 256, 512 × 512, and 1024 × 1024.

Figure 6 .
Figure 6.Histogram of the mean CPU times for images with different size.

Table 4 .
Mean CPU times obtained for different image sizes.

Table 4
Mean CPU times obtained for different image sizes.