Medical image compression using visual quantisation ...

2 downloads 0 Views 361KB Size Report
biij. Biomedical Imaging and Intervention Journal. ORIGINAL ARTICLE. Medical image compression using visual quantisation and modified run length encoding.
Available online at http://www.biij.org/2013/2/e5 doi: 10.2349/biij.9.2.e5

biij Biomedical Imaging and Intervention Journal ORIGINAL ARTICLE

Medical image compression using visual quantisation and modified run length encoding Cyriac M*,1, Chellamuthu C2 1 2

Department of IT, Jerusalem College of Engineering, Anna University, Chennai, India Department of EEE, RMK Engineering College, Anna University, Chennai, India

Received 16 March 2012; received in revised form 10 March 2012; accepted 22 April 2013

ABSTRACT

Purpose: To develop a spatial domain technique for increasing the efficiency of the standard RLE encoder with application to medical images. Materials and Methods: Multiple slices of Computer Tomography (CT) and Magnetic Resonance (MR) images are visually quantised and compressed using bit plane decomposition and modified run length encoding approach. The standard run length coder is modified by storing the run length values for selected pixels in the pixel value itself. The bits per pixel value is calculated using image processing software. The value is compared with the standard run length encoding technique. Results: Results show that the average bits per pixel (bpp) value with the modified approach is about 35% less than that of the standard run length encoder. Conclusions: The proposed method is visually lossless, and is suitable for real-time medical applications and transmission of 3-D medical information over the Internet. © 2013 Biomedical Imaging and Intervention Journal. All rights reserved. Keywords: Visual quantisation; run length encoder; bit plane decomposition; visually lossless; medical image compression.

INTRODUCTION

Recent advancements in the medical imaging modalities have increased the volume of data produced and stored in medical databases. The traditional lossless compression techniques fail to provide sufficient amount of compression for the large volume of data produced by the current 3-D modalities. Thus, there is a requirement to look into other alternatives for compressing medical images. In general, image compression can be implemented either in the spatial domain or in the

* Corresponding author. Address: Jerusalem College of Engineering, Velachery-Tambaram Main Road, Pallikkaranai, Chennai, India-600100. E-mail: [email protected] (Marykutty Cyriac)

transform domain. However, the current image compression techniques are mostly transform-based and the computational complexity of these methods is greater when compared to the spatial domain methods. Compressed image data is a primary requirement for applications like tele-medicine and the web-based medical consultations where real-time streaming of the image data is required. At the same time, the compression algorithm must be of low complexity with fast encoding and decoding capability. The spatial domain techniques are better suited to such requirements. Various algorithms have been reported for image compression in the spatial domain. The Run Length Encoding (RLE) is one of the earliest spatial domain methods used for compression. However, the primary

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

2 This page number is not for citation purposes

application for this technique is text compression. Compression of images using RLE is not effective because RLE does not exploit the pixel correlations present in images. It is particularly not efficient for natural images that do not have repeating patterns. Hence, other spatial domain methods utilising the correlation information are explored for images. One spatial domain method that makes use of the spatial correlation between the pixels is predictive modelling. A predictive coder predicts the value of the current pixel with the knowledge of its neighbouring pixels. The difference between the actual and predicted value i.e. the prediction error value, is encoded instead of encoding the actual pixel value. A simple linear prediction is used in the lossless mode of the JPEG standard and a non-linear predictor is used in the JPEG-LS standard. Another spatial domain approach is the Context-based Adaptive Lossless Image Coding (CALIC) algorithm [1]. This algorithm uses a group of pre-defined neighbourhood pixels as the context for the current pixel. Since the number of contexts is large for a grey scale image, context quantisation is employed along with predictive modelling. CALIC algorithm has been successfully implemented for image compression. However, due to the context quantisation and the presence of a large number of contexts, the context searching time in CALIC is high. RELATED WORKS

Some of the recent works in the spatial domain for image compression are now briefly explained. A lossless image compression algorithm using the duplication free Run-length Coding (RLC) is proposed in [2]. This approach is based on entropy, and variable length code words are generated using the rule-based coding method and the probability of pixels. The main advantage of this method is the elimination of the duplication problem present in the traditional RLC technique. In this method, two consecutive pixels of the same intensity are encoded into a single codeword which leads to compression. The standard test images are used to verify the performance of the method and the results show that there is no increase in the file size of the encoded images which generally happens with the traditional RLC. In [3], a technique is developed to reduce the encoding and decoding time for real-time imaging applications. An Improved Run Length encoding called IRLC is presented and compared to the S-Tree compression (STC) in respect of encoding and decoding time. Results have shown that the performance of IRLC is better than STree compression. A fast version of the SPIHT (Set Partitioning in Hierarchical Trees) algorithm is proposed for the progressive embedded applications in [4], which uses a progressive run-length coder. In this algorithm, self-similar curves are used for scanning the dominant pass which increases the compression efficiency significantly. The correlation of wavelet coefficients in the wavelet domain is exploited to develop a fast coding algorithm. The performance of the algorithm is comparable to SPIHT with lesser complexity. An

adaptive run length coding is proposed in [5] for transform coefficients. In this technique, the run length and the pixel value are coded separately using simple context modelling with an aim to maximise the compression ratio without an increase in the complexity. A low complexity, near-lossless image compression method is proposed in [6]. In this coder, a Trellis is made for every row of the image. The objective of this algorithm is to find a path through the image sequence and encode the resultant data using RLE leading to low computational complexity. However, the decompressed images are of poor quality with PSNR values ranging from 25dB to 34dB. A modified run length encoder is used for compressing the ECG data in literature [7]. This is a wavelet-based approach combining discrete wavelet transform and SPIHT algorithm. The existing system has high complexity due to the computational complexity of SPIHT. The computational complexity is reduced at the cost of compression performance. The colour image compression in YUV colour space is performed in [8], using the fuzzy logic algorithm. Clusters of YUV components are formed using the fuzzy logic algorithm and then RLE is used for final encoding with a PSNR of the order of 31dB. Using this method, the data compression occurs when there are large numbers of clusters; on the other hand, for a small number of clusters, the data is found to expand. An approach for the lossless binary image compression is explained in [9]. In this approach, the image is divided into blocks initially. Each block is then stored using variable bits. The pixel correlation information within each block is used for the calculation of variable bits length. The authors claim better compression efficiency as compared to LZW, RLE, and PNG etc. Another technique for the lossless image compression in the spatial domain for continuous-tone images is presented in [10] using a concept called image folding. Iterative column folding and row folding are applied to the image till the image size reduces to a smaller pre-defined value. In column folding, elements of even columns are subtracted from the elements of odd columns, and the difference is stored, encoded and transmitted. The approach is simpler having less computational complexity when compared to the standard SPIHT technique. Two lossless compression techniques that represent a two dimensional run-length encoding with high compression ratio are proposed in [11]. The input image is partitioned into blocks of rectangular pixels and further, each block is encoded using run length algorithm. The technique is effective when there are large blocks of black and white pixels, and it is tested for binary images. The bit plane decomposition technique has been successfully applied for steganography and watermarking applications in the transform domain [13–14]. Compared to the transform domain techniques, the spatial domain steganographic schemes are limited and some of the reported works are given in the literature [15–17]. All of them use LSB insertion methods and their variations for implementing the steganography technique. The basic

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

3 This page number is not for citation purposes

concept in all these approaches is hiding the data by embedding the image data in the LSB region. Selection of the LSB region for data hiding is justified as changes made in the LSB region are not perceived by the human eye. Variations of the bit plane decomposition method used for image compression are discussed next. A combination of bit-plane separation and context modelling is used for the compression of colour images, especially natural and palette images [18]. The contexttree based compression which has been previously designed for map images is now applied to the palette images. Four different methods for the bit plane separation are also explained. A few predictive coding techniques are tested at different colour depths and the performance is analysed. Bit plane and run length encoding has been previously applied for image coding in the wavelet domain [19], video coding [20] and audio coding [21]. In all these coders, RLE is used in the final stage for the entropy coding. In general, run length encoders are never used for direct image compression due to the expansive nature of the arrays used for storing the run length values and the additional buffer requirement for storing the run lengths. This problem is addressed in this paper. The run-length encoder is combined with the bit-plane separation method and a new approach for storing the run length is introduced at the expense of making the algorithm into a lossy one. The objective is to increase the efficiency of the existing RLE encoder with visually lossless results. The rest of the paper is organised as follows. Bit plane decomposition method is explained in Section 3. Section 4 gives an overview of the visual quantisation. The proposed coder is explained in Section 5. The performance of the proposed coder is evaluated and the results are discussed in Section 6. Finally, the conclusion is given in Section 7. BIT PLANE DECOMPOSITION

The bit plane decomposition is a spatial domain technique that is generally used to decompose an image into a series of binary images and encode the information present in the bit planes. In the bit-plane decomposition method, grey levels of an 8-bit image can be represented in the form of the base 2 polynomial [12].

per pixels is visual quantisation. This is a grey scale quantisation technique where, instead of the standard 8 bits representation, reduced number of bits per pixel is used. The effect of using less number of bits per pixel is the formation of constant grey level regions. The boundaries of these constant grey level regions are called contours [22]. One scheme suggested for reducing the effect of the contours is contrast quantisation [23]. The contrast quantisation is based on the observation that the human vision is not sensitive to just noticeable changes in the contrast. A non-linear representation of the contrast (C) is given in equation 2.

C   ln 1   u  , 0  u  1

(2)

where ‘α’ and ‘β’ are constants and ‘u’ is the normalised luminance value of the image. It has been shown through experiments that a 2% change in the contrast has been just perceptible and this requirement is equivalent to at least 50 contrast levels or about 6 bits per pixel [24]. Thus, if the pixels of an image are represented using at least 6 bits, the image becomes visually lossless or visually quantised. For further validation of this observation, one slice of a CT brain image is separated into eight bit planes as shown in Figure 1(a)–(h). After the decomposition, information in the bit planes 0 and 1 is cleared which represents the two Least Significant Bits (LSB) of the grey level. The removal of the information from the two LSB bits is equivalent to representing the pixels using 6 bits. This technique is called as visual quantisation in this work. Instead of sending the original image, the visually quantised image is sent to a lossless encoder. From Figure 1, it is clear that LSB 0 and LSB 1 do not contain any visible information. After clearing these bits, the image is assembled back from the bit planes. The original image and the quantised image are shown in Figure 2. The visual quality of the image is maintained due to the fact that the proposed visual quantisation technique alters the grey level value maximum by −3. Sample pixel values before and after the visual quantisation are shown in Table 1. To study the effect of quantisation on the grey level distribution, histograms for the original and the quantised image are plotted and shown in Figure 3. The reduction in the number of grey levels is clearly visible from the histogram.

x 7 27  x 6 26  x5 25  x 4 24  x3 23  x 2 22  x1 21  x 0 20 (1) The images are decomposed based on this property by separating the 8 coefficients of the polynomial into eight 1- bit planes. Bit plane 0 is generated by collecting x0 bit of all pixels, bit plane 1 is generated by collecting x1 bit of all pixels, and so on. VISUAL QUANTISATION

The general approach in quantisation is to minimise the mean square error between the original and the quantised image and not to minimise the number of bits per pixel. One approach to minimise the number of bits

PROPOSED CODER

Once an image is visually quantised, it can be sent to a spatial domain encoder for compression. Since the input image is already quantised, lossless algorithms should be used for compression. One of the simplest spatial domain lossless encoders is the run length encoder. However, direct application of the standard run length encoder for compressing the images is not efficient due to the following reasons:1. Natural images do not contain repeating patterns. 2. An extra byte is required to store the run length, which affects the compression ratio.

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

4 This page number is not for citation purposes

(a)

(b)

(c)

(d)

(e)

(f)

(g)

(h)

Figure 1 (a) Bit Plane 7; (b) Bit Plane 6; (c) Bit Plane 5; (d) Bit Plane 4; (e) Bit Plane 3; (f) Bit Plane 2; (g) Bit Plane 1; (h) Bit Plane 0.

(a) Figure 2 (a) Original image; (b) Visually quantised image.

(b)

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

5 This page number is not for citation purposes

(a)

(b)

Figure 3 (a) Histogram of the original image; (b) Histogram of the visually quantised image.

(a)

(b)

(c)

(d)

(e)

(f)

Figure 4 (a-f) Sample slices of various images.

These two problems are addressed in the proposed encoder. Even though natural images do not contain repeating patterns, an inspection of the grey level values of a medical image reveals certain interesting facts about their distribution. The background pixels of all the medical images are of low values and the pixel values differ by approximately ±3. Quantising these values will increase the pixel level correlation in the spatial domain. Thus repeating patterns can be made available in the

spatial domain for medical images through visual quantisation. Further, if the extra bytes required for storing the run length could be accommodated elsewhere, then the efficiency of the run length algorithm can be improved. In the proposed coder, the image is initially encoded using RLE and then the run length values 1, 2 and 3 are stored in the last two bits of the pixel value. This arrangement reduces the size of the encoded data considerably.

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

6 This page number is not for citation purposes

Table 1 The Original and the quantised pixel values. Original grey level

Binary Value

After Quantisation

New Grey level

Change in Grey level

80

1010000

1010000

80

0

81

1010001

1010000

80

−1

82

1010010

1010000

80

−2

83

1010011

1010000

80

−3

84

1010100

1010100

84

0

85

1010101

1010100

84

−1

86

1010110

1010100

84

−2

87

1010111

1010100

84

−3

Table 2 Bit rate comparison for various medical images. Image Type

Size

Average Bit rate

Average Bit rate

(Std RLE)

(Proposed)

Reduction in bitrate ( %)

CT head

256 × 256

4

2.1

47.5

MR brain

256 × 256

6.2

4.4

29.03

CT DICOM

512 × 512

7.2

4.1

43.0

MR abdomen

256 × 256

1.7

1.5

11.7

MR lung

256 × 256

3.6

2.7

25

Table 3 MSE and PSNR values for various images. Image name

MSE

PSNR

8bithead_img1

2.9

43.3

8bithead_img2

3.3

42.9

MR abdomen

1.02

46.2

MR lung

2.5

41.6

MR brain

3.2

37.6

The whole encoding algorithm consists of 6 steps which are given below:1. Decompose the original image into bit planes using bit plane slicing technique. 2. Form the visually quantised image by clearing the bit planes 0 and 1. 3. Convert the visually quantised image back to pixel form and encode using RLE. 4. Search the run length array for run lengths of value 1, 2 and 3. 5. Store the run length value in the corresponding pixel value itself. This is done by converting the grey level values to their binary equivalent and accessing the two least significant bits. 6. Do entropy encoding and transmit the image.

RESULTS AND DISCUSSIONS

To evaluate the performance of the proposed algorithm, medical images of different modalities and sizes are selected. CT test dataset contains 60 sagittal brain slices and are of size 256 × 256. Volumetric MR brain image dataset has 100 slices. CT DICOM image dataset consists of 250 slices with a bit depth of 12 and the image size is 512 × 512. CT and MR images are initially visually quantised by making the two LSB bits zero. They are compressed using the proposed technique and the bit rate is calculated. The bit rate is then compared with the value obtained using standard run length encoder. Since the objective of the proposed approach is to increase the compression efficiency of the standard RLE encoder, all the comparisons are made with the standard RLE only. The average bit rate for the test images is given in Table 2.

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

7 This page number is not for citation purposes

For all the images tested, the proposed encoder performs better than the standard RLE technique. The average bpp value for the proposed coder is 2.96 compared to the bpp value of 4.54 for the standard coder. This results in an average reduction of 34.8% in the bit rate. Maximum bit rate improvement is observed for CT head images which are generally smooth and homogeneous in nature. The improvement is significant for DICOM images also, but the processing time is found to be higher due to the large dimension of the image data. In the proposed method, the least two bit positions are only used for storing the run length values. Higher compression ratios are possible by using more bit positions for storing the run length values but at the expense of losing visually relevant data, which is not suitable for medical images.

do the encoding. This is in contrast to the transformbased techniques, especially wavelet-based techniques, where the whole image is brought to the memory and the transform is applied to the entire image. Due to this reason, this method is suitable for real-time medical applications and transmission of 3-D medical information over the Internet. REFERENCES 1.

2.

3. IMAGE QUALITY MEASUREMENT

Two widely used parameters for objective quality assessment of images are Mean Square Error (MSE) and Peak Signal-to-Noise Ratio (PSNR). Consider an image of size M × N. Let u(m,n) represent the pixels from the original image and v(m,n) represent the pixels from the visually quantised image. MSE and PSNR are now given by,

4.

5. 6.

2

MSE 

1 M N  u(m, n)  v(m, n) MN m 1 n 1

PSNR  10log10

255 MSE

(3)

7.

2

(4)

Using the equations given in (3) and (4), MSE and PSNR values are calculated for various visually quantised images and the results are shown in Table 3. From the PSNR values, it is apparent that the visually quantised images have high objective quality. For PSNR value of 40dB and above, orignal and the compressed images are visually indistinguishable to the human eye. Hence, the proposed approach is labelled as visually lossless.

8.

9.

10.

11. CONCLUSIONS

An approach for increasing the compression efficiency of the standard run length encoder for image compression by combining the visual quantisation and the bit plane encoding is proposed in this paper. The proposed algorithm is tested for CT and MRI radiological volumetric images for various types of scans and the results are presented. A new approach in run length encoding is developed where the pre-quantised image is sent to the encoder. The quality of the compressed image is known before the encoding process itself. Since the encoder is lossless, no further data loss occurs in the image. Results show that the proposed method outperforms the standard RLE with about 35% reduction in the bit rate with high visual quality. Another advantage of the method is that the whole image is not required for processing. A dynamic array is sufficient to

12. 13.

14.

15. 16. 17.

18.

Weinberger MJ, Seroussi G and Sapiro G. The LOCO-I lossless image compression algorithm: principles and standardization into JPEG-LS. IEEE Trans Image Process 2000; 9(8): 1309–1324. Al-Wahaib MS and Wong K. A lossless image compression algorithm using duplication free run-length coding. In: NETAPPS '10: Proceedings of the 2nd International Conference on Network Applications, Protocols and Services; 2010 Sep 22-23; Washington, USA: IEEE; 2010. p. 245-250. Huang W, Chen S and Zheng G. Improved run length coding for grey level images using using Gouraud shading method. In: Luo Q, eds. Advances in wireless networks and information systems. Berlin: Springer, 2010; 19–26. Berghorn W, Boskamp T, Lang M and Peitgen HO. Fast variable run-length coding for embedded progressive wavelet-based image compression. IEEE Trans Image Process 2001; 10(12): 1781–1790. Tu C, Liang J and Tran TD. Adaptive run-length coding. IEEE Signal Process Lett 2003; 10(3): 61–64. Nasr-Esfahani E, Samavi S, Karimi N and Shirani S. Near-lossless image compression based on maximization of run length sequences. In: Proceedings of the IEEE International Conference on Image Processing; 2007 Sep-Oct; San Antonio, Texas: IEEE; 2007. p. 177–180. Lee H-W, Hung K-C, Wu T-C and Ku C-T. A modified run-length coding towards the realization of a RRO-NRDPWT-based ECG data compression system. In: EUSIPCO-2011: Proceedings of the 19th European Signal Processing Conference; 2011 Aug-Sep; Barcelona, Spain: Hindawi; 2011. p. 1–8. Sura Zaki Naji. Utilizing a Gath-Geva algorithm and run length encode algorithm for YUV image compression. Eur J Sci Res 2011; 60(1): 105–118. Hassan SA and Hussain M. Spatial domain lossless image data compression method. In: ICICT2011: Proceedings of the IEEE International Conference on Information and Communication Technologies; 2011 Jul 23-24; Karachi, Pakistan: IEEE; 2011. p. 1–4. Yerva S, Nair S and Kutty K. Lossless image compression based on data folding. In: ICRTT-2011: Proceedings of the IEEE International Conference on Recent Trends in Information Technology; 2011 Jun 3-5; Chennai, India: IEEE; 2011. p. 999–1004. Kafashan M, Hosseini H, Beygiharchegani S, Pad P and Marvasti F. New rectangular partitioning methods for lossless binary image compression. In: Proceedings of the 10th IEEE International Conference on Signal Processing; 2010 Oct 24-28; Beijing, China: IEEE; 2010. p. 694–697. Gonzalez R and Woods R. Digital Image Processing, 2nd ed., India: Pearson Education; 2002. Noda H, Spaulding J, Shirazi MN and Kawaguchi E. Application of bit-plane decomposition steganography to JPEG2000 encoded images. IEEE Signal Process Lett 2002; 9(12): 410–413. Chen X-D, Sun F and Sun W. Detect LSB steganography with bit plane randomness tests. In: WCICA 2006: Proceedings of the 6th World Congress on Intelligent Control and Automation; 2006 Jun 21-23; Nanjing: IEEE; 2006. p. 10306–10309. Lee YK and Chen LH. High capacity image steganographic model. IEE Proc Vis Image Signal Process 2000; 147(3): 288–294. Darmstaedter V, Dei Aigle JF, Quisquater J and Macq B. Low cost spatial watermarking. Comput Graphics 1998; 22(4): 417–424. Langelaar GC, Lubbe JCA and Biemond J. Copy protection for multimedia data based on labelling techniques. In: Proceedings of the 17th Symposium on information theory; 1996 May 30-31; The Netherlands: IEEE; 1996. p. 282–289. Podlasov A and Fränti P. Lossless image compression via bit-plane separation and multilayer context tree modelling. J Electron

Cyriac and Chellamuthu Biomed Imaging Interv J 2013; 9(2):e5

8 This page number is not for citation purposes

Imaging 2006; 15(4): 1–11. 19. Goh KH. Wavelet Transform based adaptive bit-plane run-length coding for still images. IEEE Electron Lett 1994; 30(5): 395–396. 20. Chao H-Y, Wang J-S, Lin J-L and Yang K-C. High-performance low-complexity bit-plane coding scheme for MPEG-4 FGS. In: ICME 2005: Proceedings of the IEEE International Conference on Multimedia and Expo; 2005 Jul 6-8; Taiwan: IEEE; 2005. p. 89–92. 21. Hoang TMN, Ragot S, Oger M and Antonini M. A new bitplane coder for scalable transform audio coding. In: ICASSP 2009: Proceedings of the IEEE International Conference on Acoustics, Speech and Signal processing; 2009 April 19-24; Taipei, Taiwan: IEEE; 2009. p. 4137–4140. 22. Jain AK. Fundamentals of digital image processing, India: Prentice Hall; 1989. 23. Kretz F. Subjectively optimal quantization of pictures. IEEE Trans Commun 1975; 23(11): 1288–1292. 24. Rao KR and Yip PC. The transform and data compression handbook, India: CRC Press; 2000.