Gray-Scale Image Compression Using FFT

0 downloads 0 Views 1MB Size Report
(A/D) converters that are traditionally used for encoding ... Converting the Inverse Fast Fourier Transform ... Figure(6) show calculated FFT for 1.bmp image and.
Gray-Scale Image Compression Using Fast Fourier Transform (FFT)Algorithm and Multilayer Perceptron Network Hind Rostom Mohammed Assistant Professor/ Computer science Department Faculty of Mathematics & Computer Science Kufa University, Iraq [email protected]

Elaf Jabbar Abdul Razzaq Al-Taee Assistant Lecturer/ Law Department Faculty of Law and Political Science Kufa University, Iraq [email protected]

.

Abstract

In the present paper, Gray-Scale image compression using Fast Fourier Transform (FFT) Algorithm and Multilayer Perceptron Network (MLPN) bases properties are studied. To analyze the performance of the Fast Fourier Transform (FFT) Algorithm and Multilayer Perceptron Network (MLPN) with the gray scale images and binary images we fixed the loss amount of the data in the compressed image (Quality of the compressed image will be same for each function used and calculated their respective Compression Measures. (FFT) Algorithm with (MLPN) gives the maximum compression for a specific type of gray scale images and better than (FFT) Algorithm for gray scale images. The experimental results confirm the effectiveness of the proposed (FFT) Algorithm with (MLPN) .

Keywords

Gray-Scale Image , binary images , Fast Fourier Transform, Multilayer Perceptron Network, Image Compression, Compression Measures.

1. Introduction

Data compression is the technique to reduce the redundancies in data representation in order to decrease data storage requirements and hence communication costs. Reducing the storage requirement is equivalent to increasing the capacity of the storage medium and hence communication bandwidth. Thus the development of efficient compression techniques will continue to be a design challenge for future communication systems and advanced multimedia applications. Data is represented as a combination of information and redundancy. Information is the portion of data that must be preserved permanently in its original form in

1

order to correctly interpret the meaning or purpose of the data. [1] Image data compression continues to be an important subject in many areas such as communication, data storage, and computation. The existing traditional techniques mainly are based on reducing redundancies in coding, inter pixel and psycho visual representation [1]. In addition, new soft computing technologies such as neural networks are being developed for image compression. [2] There are numerous lossy and lossless image compression techniques. Considering X-ray images or ECG data where each bit of information is essential a lossless compression must be used. On the other hand, for the still digital image or video, which have been already lossy digitalized, a lossy compression is preferred. There are numerous lossy compression techniques. [3] The rest of the paper is organized as follows: Section 2 gives a brief outline of the Fast Fourier Transform and Multi-Layer Neural Networks for image compression, section 3 describes the compression measures, section 4 describes the process of building results and experiments and shows the experimental results obtained using our method. section 5 gives concluding remarks.

2. Fast Fourier Transform and MultiLayer Neural Networks for Image Compression Fast Fourier Transform (FFT) Filters provide precisely controlled low- and high-pass filtering (smoothing and sharpening, respectively) using a Butterworth characteristic. The image is converted into spatial frequencies using a Fast Fourier Transform, the appropriate filter is

applied, and the image is converted back using an inverse FFT . [ 4] The FFT is ancient algorithm for computing the sum: ..…(1) where N is typically a power of 2. The algorithm reduces the number of multiplications in the required N summations from an order of N2 to that of Nln2.N., a very considerable reduction. We present in this section the details for writing the integration (5) as an application of the summation . Using the trapezoid rule for the integral on the right-hand side of (5) and setting ., an approximation for C.k. is:

3. Comprission Measures

If I(r,c) : The original image, g(r,c) : The decompressed image , r,c : Row and column and L : the number of gray levels (e.g., for 8 bits L =256). It is most easily defined via the mean squared error (MSE) which for image as: The Root-Mean-square error ..…(5) The Root-Mean-Square Signal-to-Noise- Ratio is: ..…(6) The Peak Signal-to-Noise- Ratio is :

..…(2) Multi-Layer neural networks with backpropagation algorithm can directly be applied to image compression . [2] Multilayer perceptrons (MLPs) can be used in image-sensing applications, to implement lowcomplexity compression schemes that map vectors of analog samples directly into binary code words. This direct mapping saves hardware by completely eliminating the analog-to-digital (A/D) converters that are traditionally used for encoding each pixel value before digital image compression is done .[5] After initializing the network, the network training is originated using train command. The resulting MLP network is called network training is:

Net1=train(net,x,y)

..…(3)

Where net =initial MLP x= measured input vector y=measured output vector

Where net1 =final MLP And x=input vector

2

The MSE / PSNR is most commonly used as a measure of quality of reconstruction of lossy compression codec's (e.g., for image compression).The signal in this case is the original data, and the noise is the error introduced by compression. When comparing compression codec's it is used as an approximation to human perception of reconstruction quality, therefore in some cases one reconstruction may appear to be closer to the original than another, even though it has a lower PSNR (a higher PSNR would normally indicate that the reconstruction is of higher quality). One has to be extremely careful with the range of validity of this metric; it is only conclusively valid when it is used to compare results from the same codec (or codec type) and same content. [7]

4. Results and Experiments

To test how well the resulting MLP net1 approximates the data, sim command is applied. The measured output is y. The output of the MLP network is simulated with sim command and called test network.

Net2=sim(net1,x)

..…(7)

..…(4)

In this section a detailed experimental comparison of the above stated algorithms has been presented. We have used gray images and binary images databases. The flowchart for system show in figure (1) and figure (2) show the sample of gray scale images while figure (3) show the sample of binary images testing in this paper.

Start

Read the image file

Converting image file from NxN 2-Dimensional to N2 1- Dimensional Matrix

Apply the Fast Fourier Transform

Figure (2) : The sample of gray scale images Apply the Multilayer Perceptron Network

Image equal to (256x256) matrix of values

Apply the Inverse Fast Fourier Transform

Converting the Inverse Fast Fourier Transform coefficients from N2 1- Dimensional to NxN 2-Dimensional Matrix ,result is (Reconstructed Image)

Calculate RMSE

Figure (3): The sample of binary images Calculate SNRrms

Calculate SNRpeak

End

Figure (1) : flowchart for system

3

Then we took from gray scale images ( format .PNG and .JPG ) segment block size ( 100*100 ) figure (4) show the result of segment.

The number of input node is one in MLP network ,one output and 10 nodes for hidden layers figure (7) show the MLP neural network used in this paper.

Figure (4) : Segmentation for 1 and 2 images (size 100*100).

Input

Figure (5) show the data for segment 1 image (size 100*100)

Figure (7) : The MLP neural network

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 23

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 14 31 42

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 19 36 46 50

0 0 0 0 0 0 0 0 0 0 0 0 0 2 8 25 40 48 51 55

0 0 0 0 0 0 0 0 0 0 0 0 2 14 29 42 49 53 57 61

0 0 0 0 0 0 0 0 0 0 0 2 17 34 44 49 53 57 61 66

0 0 0 0 0 0 0 0 0 0 6 21 36 46 50 55 59 61 66 70

0 0 0 0 0 0 0 0 0 8 23 38 46 51 55 59 61 66 70 72

Hidden

Layer

0 0 0 0 0 0 0 0 10 25 40 46 51 55 59 63 67 70 74 76

Figure(5) : data for segment 1 image (size 100*100) When the FFT was calculated the entire image seemed to show noise all over. Since no boundary had been set for the frequencies, hence noise intrusion was very large and hence noise[4]. Figure(6) show calculated FFT for 1.bmp image and 2.png image.

Output

Layer

Layer

Figure(8) show the draw for training MLP neural network for gray image. 6000

7000

5000

6000 5000

4000

4000 3000

3000 2000

2000 1000

1000

0 -1000 0

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

-1000 0

0.1

0.2

0.3

0.4

0.5

0.6

0.8

0.9

Figure (8) : draw for training MLP neural network for gray Image After executed inverse fast fourier transform the result show in figure(9).

Figure (6) : FFT for 1.bmp image and 2.png image. Figure (9) : Inverse fast fourier transform for gray image

4

0.7

1

Then We took from binary images(format .bmp and .png) segment block size(100*100) figure (10) show the result of segment

Figure (13 ) : draw for training MLP neural network for binary image

Figure (10) : Segmentation for 4 and 5 images (size 100*100).

1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1 1

1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1

Figure (11) :data for segment 1 image (size 100*100)

1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 0

Figure (14) : Inverse fast fourier transform for gray image Tables (1-4) contains comparison of objective quality standards for recovered images (gray / binary) using the FFT algorithm and by using (FFT with MLPN) for different size.

Conclusion

Applied the algorithm (FFT) on the system images (gray / binary) and most of the kinds of images formats and found the following: 1-The objective quality standards used (RMSE , SNRrms , SNRpeak) In the case of the recovered gray scale images compression by used FFT algorithm best compression of binary images retrieved by used FFT algorithm. 2- The objective quality standards used(RMSE , SNRrms , SNRpeak) In the case of the recovered gray scale images compression by used FFT with Multilayer Perceptron Network algorithm best compression of binary images retrieved by used FFT with Multilayer Perceptron Network algorithm.

Figure(12) : FFT for 1.bmp image and 2.png image

5

3- The objective quality standards used(RMSE , SNRrms , SNRpeak) In the case of the recovered gray scale images compression by used FFT algorithm best compression of gray scale images retrieved by used FFT with Multilayer Perceptron Network algorithm.

References [1] Analysis Of Image Compression Algorithm Using DCT, Maneesha Gupta, Dr.Amit Kumar Garg , Maneesha Gupta, Dr.Amit Kumar Garg / International Journal of Engineering Research and Applications (IJERA), Vol. 2, Issue 1, Jan-Feb 2012. [2] A Complexity-Based Approach in Image Compression using Neural Networks, Hadi Veisi, Mansour Jamzad, International Journal of Information and Communication Engineering 5:2 2009. [3] A Multilayered Perception Reconfigurable ANN (Artificial Neural Networks) Architecture for Image Compression & Decompression, Pramod.V.Patil, M.N.Shanmukha Swamy& Cyril Prasanna RajP, Proceedings of International Conference on Computer Science, Information and Technology, Pune, ISBN-978-93-81693-83-4, 23rd June, 2012. [4] Vinay Kumar and Manas Nanda ,Image processing in frequency domain using matlab: a study for beginners, inria00321613, version 1 - 15 Sep 2008. [5] A complexity comparison between multilayer perceptrons applied to on-sensor image compression, Jos´e Gabriel R. C. Gomes, Sanjit K. Mitra, Rui J. P. de Figueiredo, ICASSP 2004. [6] Walker, J.S., Fast Fourier Transforms, CRC Press, 1996. [7] Maneesha Gupta and Amit Kumer,Maneesha Gupta, Dr.Amit Kumar Garg / International Journal of Engineering Research and Applications (IJERA),Vol.2 , Issue 1, 2012.

6

Table 1: Comparison of objective quality standards for recovered images (gray / binary) using the FFT algorithm

Algorithm

FFT

System of Image Gray Binary

Type of Image JPEG BMP BNG JPEG BMP BNG

Size of Image Pixel 256 x 256

RMSE 1.3429 1.3882 1.2800 2.4881 2.4773 2.4739

Parameters SNRrms 3.5205 3.2883 3.0736 2.8693 3.1186 2.9158

SNRpeak 3.6557 3.6528 3.6598 3.6021 3.6025 3.6026

Table 2: Comparison of objective quality standards for recovered images (gray / binary) using an algorithm (FFT with MLPN)

Algorithm

System of Image

FFT with MLPN

Gray Binary

Type of Image JPEG BMP BNG JPEG BMP BNG

Size of Image Pixel 256 x 256

RMSE 1.2076 1.2686 1.1158 2.3291 2.5967 2.1762

Parameters SNRrms 3.9145 3.5983 3.5259 3.0652 2.9752 3.3146

SNRpeak 3.6649 3.6606 3.6718 3.6079 3.5984 3.6138

Table 3: Comparison of objective quality standards for recovered images (gray / binary) using the FFT algorithm

Algorithm

FFT

System of Image

Type of Image

Gray

BMP

Binary

BMP

Size of Image Pixel 100 x 100

Parameters RMSE SNRrms SNRpeak 6.7788

4.4923

3.7150

7.3741

3.6193

3.7077

Table 4: Comparison of objective quality standards for recovered images (gray / binary) using an algorithm (FFT with MLPN)

Algorithm

FFT with MLPN

7

System of Image

Type of Image

Gray

BMP

Binary

BMP

Size of Image Pixel 100 x 100

RMSE

Parameters SNRrms SNRpeak

6.1347

5.3999

3.7237

6.5222

3.7617

3.7184

‫‪Gray-Scale Image Compression Using Fast Fourier Transform‬‬ ‫‪(FFT)Algorithm and Multilayer Perceptron Network‬‬ ‫ﺿﻐﻂ اﻟﺼﻮرة اﻟﺮﻣﺎدﯾﺔ ﺑﺎﺳﺘﺨﺪام ﺧﻮارزﻣﯿﺔ ﺗﺤﻮﯾﻞ ﻓﻮرﯾﯿﮫ اﻟﺴﺮﯾﻊ ﻣﻊ ﺷﺒﻜﺔ اﻟﻌﺼﺒﯿﺔ اﻟﻤﺘﻌﺮف‬ ‫اﻟﻤﺘﻌﺪدة اﻟﻄﺒﻘﺎت‬ ‫ﺗﻢ دراﺳﺔ‬ ‫اﻟﻄﺒﻘﺎت ﻣﻊ ﺧﺼﺎﺋﺼﮭﺎ ﻓﻲ ھﺬا اﻟﺒﺤﺚ‪.‬‬ ‫)‪ Fast Fourier Transform (FFT‬واﻟ ﺸﺒﻜﺔ‬ ‫ا ﻟﺨﺎص ﺑ‬ ‫ﺗﻢ إﺟﺮاء‬ ‫ف اﻟﻤﺘﻌﺪدة ا ﻟﻄﺒﻘﺎت ‪(MLPN) and Multilayer Perceptron Network‬‬ ‫ا ﻟﻤ ﺘ ﻌﺮ‬ ‫وﺻﻮر اﻟﺜﻨﺎﺋﯿﺔ ﺗﻢ ﺗﺜﺒﯿﺖ ﻛﻤﯿﺔ ﻓﻘﺪان اﻟﺒﯿﺎﻧﺎت ﻓﻲ اﻟﺼﻮرة اﻟﻤﻀﻐﻮطﺔ )ﺑﺤﯿﺚ ﺗﻜﻮن ﺟﻮدة اﻟﺼﻮرة اﻟﻤﻀﻐﻮطﺔ ﻧﻔﺴﮫ ﻓﻲ‬ ‫ﻛﻞ داﻟﺔ ﻣﺴﺘﺨﺪﻣﺔ( وﯾﺘﻢ اﺣﺘﺴﺎب ﻣﻘﺎﯾﯿﺲ اﻟﻀﻐﻂ ﻟﻜﻼ اﻟﻄﺮﯾﻘﺘﯿﻦ‪.‬‬ ‫)‪ Fast Fourier Transform (FFT‬اﻟ ﺸﺒﻜﺔ‬ ‫إن‬ ‫ﺼﻰ ﺿﻐﻂ‬ ‫أ ﻗ‬ ‫ف اﻟﻤﺘﻌﺪدة ا ﻟﻄﺒﻘﺎت ‪(MLPN) and Multilayer Perceptron Network‬‬ ‫اﻟﻌﺼﺒﯿﺔ ا ﻟﻤ ﺘ ﻌﺮ‬ ‫ﻟﻠﺼﻮر اﻟﺮﻣﺎدﯾﺔ ﺗﻜﻮن‬ ‫‪.(MLPN‬‬ ‫اﻟﻜﻠﻤﺎت اﻟﺪاﻟﺔ‬ ‫اﻟﺼﻮرة ﻟﺮﻣﺎدﯾﺔ ‪ ،‬اﻟﺼﻮر اﻟﺜﻨﺎﺋﯿﺔ‪ ،‬ﺗﺤﻮﯾﻞ ﻓﻮرﯾﯿﮫ اﻟﺴﺮﯾﻊ‪ ،‬ﺷﺒﻜﺔ اﻟﻤﺘﻌﺮف اﻟﻤﺘﻌﺪدة‬ ‫اﻟﻀﻐﻂ‪.‬‬

‫‪8‬‬