Sunteți pe pagina 1din 6

EUROCON 2007 The International Conference on “Computer as a Tool” Warsaw, September 9-12

Neural Networks Arbitration for Optimum DCT


Image Compression
Adnan Khashman*, Kamil Dimililer†
Near East University/Electrical and Electronic Engineering Department, Nicosia, Northern Cyprus
e-mail: *amk@neu.edu.tr, †kdimililer@neu.edu.tr

Abstract— Image compression using Discrete Cosine Image compression using DCT is a simple compression
Transform (DCT) is one of the simplest commonly used method that was first applied in 1974 [4]. It is a popular
compression methods. The quality of compressed images, transform used for some of the image compression
however, is marginally reduced at higher compression ratios standards in lossy compression methods. The
due to the lossy nature of DCT compression, thus, the need disadvantage of using DCT image compression is the high
for finding an optimum DCT compression ratio. An ideal loss of quality in compressed images, which is more
image compression system must yield high quality notable at higher compression ratios. Recent work on
compressed images with good compression ratio, while finding optimum compression suggested criteria that was
maintaining minimum time cost. Neural networks perform based on visual inspection and computed analysis of the
well in simulating non-linear relationships. This paper reconstructed images [3]. Visual inspection and
suggests that a neural network could be trained to recognize observation by humans is an empirical analysis that
an optimum ratio for DCT compression of an image upon involves a number of people who observe the smoothness
presenting the image to the network. The neural network and edge continuity of certain objects within reconstructed
associates the image intensity with its compression ratios in images and then decide which compression ratio provides
search for an optimum ratio. Experimental results suggest a compromise between high compression ratio and
that a trained neural network can simulate such non-linear minimal loss of quality [3],[5].
relationship and thus can be successfully used to provide an
intelligent optimum image compression system. Artificial neural networks implementations in image
processing applications has marginally increased in recent
Keywords—Image Compression, Discrete Cosine years. Image compression using DCT and a neural
Transform, Neural Networks, Optimum Compression network was suggested previously [6]. More recently,
different image compression techniques were combined
with neural network classifier for various applications
I. INTRODUCTION [7],[8],[9]. However, none of these works have suggested
Data compression in multimedia applications has using a neural network to determine optimum
become more vital lately where compression methods are compression ratio.
being rapidly developed to compress large data files such The aim of the work presented within this paper is to
as images [1]. Efficient methods usually succeed in develop an intelligent optimum image compression
compressing images, while retaining high image quality system using DCT compression and a neural network. The
and marginal reduction in image size [2]. novel method suggests that a trained neural network can
Recently the use of Wavelet Transforms and Discrete learn the non-linear relationship between the intensity
Cosine Transform (DCT) for image compression was (pixel values) of an image and its optimum compression
investigated [3]. The usability and efficiency of these ratio. Based on our hypothesis, a trained neural network
methods depend on the application areas that require could recognize the optimum DCT compression ratio of
either high transmission rate or high quality an image upon its presentation to the neural network. The
decompression. Lossless compression algorithm provides development and implementation of this system uses 60
a compression which, when decompressed the exact images of various objects, contrasts and intensities.
original data can be obtained. This is the case when binary The paper is organized as follows: Section II describes
data such as executables and documents are compressed. the image database which is used for the implementation
On the other hand, images might not be reproduced of our proposed system. Section III presents the neural
'exactly', but an approximation of the original image is network design and implementation. Section IV
enough for most purposes as long as the error between the introduces the evaluation method of the results and
original and the compressed image is tolerable. The provides an analysis of the system implementation.
general purpose of compression systems is to compress Finally, Section V concludes the work that is presented
images, but the result is less than optimal. within this paper and suggests further work.
Although the use of Wavelet Transforms was shown to
be more superior to DCT when applied to image II. IMAGE DATABASE
compression [3], some of the finer details in the image can The development and implementation of the proposed
be sacrificed for the sake of saving a little more bandwidth intelligent optimum image compression system uses 60
or storage space. This also means that lossy compression images from our database that have different objects,
techniques such as DCT can be used in this area. brightness and contrast. DCT compression has been

1-4244-0813-X/07/$20.00 2007 IEEE. 151


Original Image 10% 20% 30% 40%

50% 60% 70% 80% 90%


Fig. 1. An original image and its DCT compression at nine ratios

Fig. 2. Training image set examples Fig. 3. Testing image set 1 examples

applied to 50 images using 9 compression ratios (10%, and evaluate the efficiency of the trained neural
20%, 30%, … 90%) as shown in an example in Fig. 1. network. Examples of these testing images are shown
The optimum DCT compression ratios for the 50 images in Fig. 3.
were determined using the optimum compression criteria • Testing Image Set 2: contains 10 images with
based on visual inspection of the compressed images as unknown optimum compression ratios which are used
suggested in [3], thus providing 50 images with known to further test the trained neural network within the
optimum compression ratios and 10 images with unknown intelligent system. Examples of these testing images
optimum compression ratios. The image database is then are shown in Fig. 4.
organized into three sets:
• Training Image Set: contains 30 images with known The optimum ratios for DCT compression of the 30
optimum compression ratios which are used for the images in the training image set database can be seen
neural network within the intelligent system. listed in Table I, whereas examples of original images and
Examples of training image set are shown in Fig. 2. their compressed version using their optimum
• Testing Image Set 1: contains 20 images with known compression ratios prior to training the neural network are
optimum compression ratios which are used to test shown in Fig. 5.

152
TABLE I
PRE-DETERMINED OPTIMUM DCT COMPRESSION RATIOS (ODCR)
Image ODCR Image ODCR Image ODCR
12 30 % C.hane2 40 % Mutfak1 50 %
Amkam 40 % C.hane3 50 % Mutfak2 50 %
Ascan2 50 % Catorg 60 % Yatak 50 %
Barbara 30 % Celen 40 % Caff1 40 %
Boat 40 % Cicek 50 % Caff2 30 %
Boatuni 40 % Guven1 30 % Lena 40 %
Bosp2 50 % Otob1 30 % Ali 40 %
Building 40 % Otob2 30 % Peppers 50 %
Cafe 50 % Dunmuh 30 % Pup 40 %
C.hane1 40 % Akmguv 40 % Mutfak3 40 %

Fig. 4. Testing image set 2 examples

III. NEURAL NETWORK IMPLEMENTATION


The intelligent optimum image compression system Barbara Optimum Ratio (30%)
uses a supervised neural network based on the back
propagation learning algorithm, due to its implementation
simplicity, and the availability of sufficient “input /
target” database for training this supervised learner.
The hypothesis which is presented within this paper
suggests that a trained neural network can learn the non-
linear relationship between the image intensity (pixel
values) and its optimum compression ratio.
This relationship can be seen in Fig. 6 which shows the
different values of optimum compression ratios for the
database images. The neural network relates the image Peppers Optimum Ratio (50%)
intensity (pixel values) to the image optimum compression
ratio having been trained using images with predetermined
optimum compression ratios. The ratios vary according to
the variations in pixel values within the images. Once
trained, the neural network would select the optimum
compression ratio of an image upon presenting the image
to the neural network by using its intensity values.
The neural network consist of an input layer with 4096
neurons, one hidden layer with 80 neurons and an output
layer with 9 neurons. Training the neural network uses 30
images which are grey and of size (256x256) pixels.
Using Adobe Photoshop the size of each whole image is Building Optimum Ratio (40%)
initially reduced to (64x64) pixels prior to presenting the
whole image to the neural network using the one-pixel-
per-node approach, thus resulting in 4096 pixel values per
image. Further reduction to the size of the images was
attempted in order to reduce the number of input layer
neurons and consequently the training time, however,
meaningful neural network training could not be achieved
thus, the use of whole images of size (64x64) pixels. The
hidden layer of the neural network contains 80 neurons
which assures meaningful training while keeping the time
cost to a minimum. The output layer has nine neurons Lena Optimum Ratio (40%)
according to the number of possible compression ratios
(10% - 90%). During the learning phase, initial random Fig. 5. Original images and their optimum DCT compression

153
90
Optimum
80 Compression
70 Ratio
Compression Ratio (%)

60

50

40

30

20

10

0
1

10

13

16

19

22

25

28

31

34

37

40

43

46

49
Images

Fig. 6. Relationship between images and optimum compression ratios

1
1

2 1
O
2
D
C
R
Reduced Size
9
Image
Original Image (64x64) pixels
(256x256) pixels 80
4096 Compressed Image
(256x256) pixels
Input Hidden Output
Layer Layer Layer

Fig. 7. The intelligent optimum image compression system (ODCR: Optimum DCT Compression Ratio).

weights of values between 0.45 and -0.45 were used. The the final parameters of the successfully trained neural
learning coefficient and the momentum rate were network. Fig. 8 shows the error graph versus iterations
adjusted during various experiments in order to achieve during the neural network training.
the required minimum error value of 0.001; which was The evaluation of the training and testing results was
considered as sufficient for this application. Fig. 7 shows performed using two measurements: the recognition rate
the topology of this neural network within the intelligent and the accuracy rate. The recognition rate is defined as
image compression system. follows:
IV. RESULTS AND DISCUSSION
The neural network learnt and converged after 6479
iterations and within 103 minutes, whereas the running ⎛I ⎞
time for the generalized neural network after training and RRODC = ⎜⎜ ODC ⎟⎟ ∗ 100 , (1)
using one forward pass was 0.003 seconds. These results ⎝ IT ⎠
were obtained using a 1.6 GHz PC with 1 GB of RAM,
Windows XP OS and Matlab 6.5 software. Table II lists

154
TABLE III
OPTIMUM COMPRESSION DEVIATION AND CORRESPONDING RATES
Accuracy Rate Recognition Rate
OCD
(RAODC) (RRODC)
0 100 % 06/20 (30 %)
1 89 % 16/20 (80 %)
2 78 % 19/20 (95 %)
3 67 % 20/20 (100 %)

TABLE IV
OPTIMUM DCT COMPRESSION RATIOS (%) AS DETERMINED BY THE
TRAINED NEURAL NETWORK

Image ODCR Image ODCR


asaf 50 gitar 30
afykale 20 ayokul 40
kizcik 30 kamilc 40
Fig. 8. Error versus iteration graph during network training oglan 50 chicek 30
Yaris 30 ayna 40

TABLE II
TRAINED NEURAL NETWORK FINAL PARAMETERS The OCD is used to indicate the accuracy of the system,
Input Neurons 4096 and depending on its value the recognition rates vary.
Hidden Neurons 80
Table III shows the four considered values of OCD and
Output Neurons 9
their corresponding accuracy rates and recognition rates.
Learning Coefficient 0.004 The evaluation of the system implementation results
Momentum rate 0.50 uses (OCD = 2) as it provides a minimum accuracy rate
Minimum Error 0.001 of 78% which is considered sufficient for this
Iterations 6479 application.. The trained neural network recognized
Training time (minutes) 103 correctly the optimum compression ratios for all 30
Run time (seconds) 0.03 training images as would be expected, thus yielding
100% recognition of the training set. Testing the trained
neural network using 20 images that were not presented
to the network before yielded 95% recognition rate,
where RRODC is the recognition rate for the neural network where 19 out of the 20 images with known optimum
within the optimum DCT compression system, IODC is the compression ratios from the testing set were assigned the
number of optimally compressed images, and IT is the correct ratio.
total number of images in the database set.
The trained neural network was also tested using the
The accuracy rate RAODC for the neural network output remaining 10 images with unknown optimum
results is defined as follows: compression ratios from the testing set. The results of this
application are shown in Table IV, whereas Fig. 9 shows

RAODC = ⎜⎜1 −
( )
S p − S i ∗ 10 ⎞⎟
examples of the optimally compressed images as
determined by the trained neural network.
ST ⎟ * 100 , (2)
⎝ ⎠ V. CONCLUSION
A novel method to intelligent image compression is
where SP represents the pre-determined (expected) proposed in this paper. The method uses DCT
optimum compression ratio in percentage, Si represents compression with nine compression ratios and a
the optimum compression ratio as determined by the supervised neural network that learns to associate the
trained neural network in percentage and ST represents the grey image intensity (pixel values) with a single optimum
total number of compression ratios. compression ratio. The implementation of the proposed
The Optimum Compression Deviation (OCD) is method uses lossy DCT image compression where the
another term that is used in our evaluation. OCD is the quality of the compressed images degrades at higher
difference between the pre-determined or expected compression ratios. The aim of an optimum ratio is to
optimum compression ratio SP and the optimum combine high compression ratio with good quality
compression ratio Si as determined by the trained neural compressed image.
network, and is defined as follows: The proposed intelligent system was developed and
implemented using 60 images of various objects,
contrasts and intensities. The neural network within the
(
OCD = S p − S i ∗10 .) (3) system learnt to associate the 30 training images with
their predetermined optimum compression ratios within
103 minutes. Once trained, the neural could recognize the

155
Original Images Intelligent Compression Images Function”, IEEE Transactions Image Processing, vol. 12, no.1,
2003, pp. 58-70.
[2] K. Ratakonda and N. Ahuja, “Lossless Image Compression with
Multiscale Segmentation”, IEEE Transactions Image Processing,
vol. 11, no.11, 2002, pp. 1228-1237.
[3] A. Khashman and K. Dimililer, “Comparison Criteria for
Optimum Image Compression”, Proceeding of the IEEE
International Conference on ‘Computer as a Tool’
EUROCON’05, vol. 2, 2005, pp. 935-938.
[4] N. Ahmed, T. Natarajan, and K.R. Rao, “On Image Processing and
a Discrete Cosine Transform”, IEEE Transactions Computers C-
vol. 23, no. 1, 1974, pp. 90-93.
[5] B. Jahne, Digital Image Processing. New York: Springer-Verlag,
ch.1, 2002.
kizcik 30% Compression [6] K.S. Ng and L.M. Cheng, “Artificial Neural Network for Discrete
Cosine Transform and Image Compression”, Proceedings of the
fourth international conference on Document Analysis and
Recognition, vol. 2, 1997, pp. 675-678.
[7] M. Liying and K. Khashayar, “Adaptive Constructive Neural
Networks Using Hermite Polynomials for Image Compression”,
Lecture Notes in Computer Science, Springer-Verlag, vol. 3497,
2005, pp. 713-722.
[8] B. Karlik, “Medical Image Compression by Using Vector
Quantization Neural Network”, ACAD Sciences press in Computer
Science, vol. 16, no. 4, 2006 pp., 341-348.
[9] Y. Zhou., C. Zhang, and Z. Zhang, “Improved Variance-Based
Fractal Image Compression Using Neural Networks”, Lecture
bee 40% Compression Notes in Computer Science, Springer-Verlag, vol. 3972, 2006, pp.
575-580.

afykale 20% Compression

Fig. 9. Optimum DCT Compression using trained neural network

optimum compression ratio of an image within 0.03


seconds upon presenting the image to the network. The
trained system can use four minimum accuracy levels
which are determined depending on the application.
In this work, a minimum accuracy level of 78% was
used and a 95% recognition rate of correct optimum
compression ratio was obtained. This successful
implementation of our proposed method was shown
throughout the high recognition rate and the minimal time
cost (0.03 seconds) when running the trained neural
network.
Future work will include the implementation of this
intelligent system using biorthogonal wavelet transform
compression which produces higher quality compressed
images, and thus creates a more challenging task for the
neural network to recognize.

REFERENCES
[1] M.J. Nadenau, J. Reichel, and M. Kunt, “Wavelet Based Color
Image Compression: Exploiting the Contrast Sensitivity

156

S-ar putea să vă placă și