Sei sulla pagina 1di 5

Efficient Hardware Implementation of an Image Compressor for

Wireless Capsule Endoscopy Applications


Khan Wahid, Seok-Bum Ko, and Daniel Teng


AbstractThe paper presents an area- and power-efficient


implementation of an image compressor for wireless capsule
endoscopy application. The architecture uses a direct mapping
to compute the two-dimensional Discrete Cosine Transform
which eliminates the need of transpose operation and results in
reduced area and low processing time. The algorithm has been
modified to comply with the JPEG standard and the
corresponding quantization tables have been developed and the
architecture is implemented using the CMOS 0.18um
technology. The processor costs less than 3.5k cells, runs at a
maximum frequency of 150 MHz, and consumes 10 mW of
power. The test results of several endoscopic colour images
show that higher compression ratio (over 85%) can be achieved
with high quality image reconstruction (over 30 dB).

I. INTRODUCTION

HE advanced technology has made it possible to design


swallowable electronic radio-telemetry capsules for the
study of Gastrointestinal (GI) physiological parameters
allowing physicians to wirelessly diagnose for diseases of
the small intestine [1]. These endoscopic capsules, ingestible
pill-shaped devices designed to capture images from inside
the digestive tract, have been around for a while. These
capsules need to be small enough to be swallowable easily
and to pass through human GI tract. The noninvasiveness
design improves patients comfort and alleviates pain.
Several commercial products such as PillCam [2] and
Sayaka [2] allow such wireless GI endoscope. The captured
images of the small intestine (from inside patients body) are
used to diagnose for various GI diseases. Generally, it takes
around 24 hours (range is 10-48 h) for the capsule to move
from mouth to evacuation [4], which leaves no time for the
capsule to check the large intestine. Moreover, the
diagnostic is error-prone because of the low resolution of the
reconstructed image; especially, the images may be distorted
while physicians apply zooming to perform detailed
diagnosis. Increasing the resolution causes huge increase in
power consumption in the RF transmission. Much research
has been conducted to improve the performance [5]-[8], but
in most cases, the addition of on-chip memory and complex
architecture cause higher area consumption and power
dissipation.
Therefore, an optimized image compression algorithm is
required for saving in power dissipation, as well as,
improving visual image quality. Here, we discuss an
advanced scalable image compressor that can deliver a com-

pressed 256x256 colour image. Instead of using the


conventional binary floating point approach, an error-free
algebraic integer encoding has been applied that guarantees
lossless computation. The architecture uses a direct 2-D
mapping of the 4x4 Discrete Cosine Transform (DCT)
eliminating the requirement of using transpose buffer. This
significantly reduces hardware space, as well as, processing
time. The quantization tables to achieve JPEG compression
have been developed. Finally, the implementation details of
the transformation and quantization units are discussed.
II. DCT-BASED IMAGE COMPRESSION
The block diagram of a typical wireless endoscopic system
is shown in Fig. 1. It consists of an electronic capsule, a
workstation, and a wireless transreceiver. The capsule to be
swallowed by the patient is hermetically packaged. There
are two LEDs inside the capsule to illuminate. The output
image data from the compressor (initially captured by the
CMOS sensor) are transmitted by a wireless RF transmitter
to outside of the body where they are received and stored,
and eventually reconstructed for subsequent diagnosis. The
controller controls the operation of the compressor as per the
operators instructions (from the workstation). The battery
consumes a significant space inside the capsule, and to have
a low-power design for longer battery life is highly
desirable.

Fig. 1. Block diagram of a typical endoscopic system

The function of the image compressor is shown in Fig. 2.


It starts in the format of Bayer patterns and separately
processes R-G1-G2-B signals of the raw image; thus, we
avoid the need for color-space conversion. Finally, it
computes the 2-D DCT, quantizes, and outputs the encoded
bit-stream for transmission.

The authors are with the Department of Electrical and Computer


Engineering, University of Saskatchewan, 57 Campus Drive, Saskatoon,
SK, S7N5A9, Canada; Phone: 1-306-966-5474; Fax: 1-306-966-5407; Email: khan.wahid@usask.ca

Fig. 2. Functional diagram of the image compressor

2761
c
978-1-4244-1821-3/08/$25.002008
IEEE

A. The 4-point two-dimensional DCT


This section explains the proposed algebraic integer
quantization (AIQ) based DCT. Rather than approximating
the irrational transform coefficients, we employ algebraic
integers to map them error-freely. The forward transform
matrix of a 4-point 2-D classical DCT is defined as follows
(where, ck cos kS ) [9]:
16
c4
c4
c4 c4

1 c2 c6 c6 c2
(1)
C
2 c4 c4 c4 c4

c6 c2 c2 c6
Now we consider the expressions: c4

4S
cos
16

1
,
2

2S
cos
16

2 2
6S
2 2
, and c6 cos
.
c2
2
16
2
c
Then we compute: 2 1  2 . If we choose z 1  2
c6
as an algebraic integer [10], the transform matrix, shown in
eqn. (1), can be expressed exactly in terms of z with integer
coefficients as shown in eqn. (2) [where (O) is the Hadamard
or Schur product].
1 1 1 1
z 1 1  z
(2)

C AIQ ( z ) S x
1 1 1 1

1  z z 1
The scaling factor, S as given in eqn.(3), will be incorporated in the next stage (scaling and quantization). Thus,
the implementation is simplified with a final reconstruction
(where the value of z is substituted back) using 8-bit
precision, as given by eqn. (4).

c4 2

c4c6
c4 2

c4c6

c4 c6
c6 2
c4c6
c6 2

c4 2
c4 c6
c4 2
c4 c6

c4 c6

c6 2
c4 c6

c6 2

z 1  2 | 10.10 1010

(3)

1

3

22 2 2

5

(4)

proposed scheme, only 11 adders (compared to 14 for FP)


are required to perform a 4x4 1-D DCT. Taking the advantage of the architectures simplicity, we now present a new
AIQ mapping to compute the 2-D DCT directly that
eliminates the need of transpose operation. The 2-D mapping is shown below in Fig. 4. The scheme can be extended
for the 8x8 2-D DCT.
x0

s0

x1

The signal flow graphs for both the conventional finite


precision (FP) binary and the proposed AIQ approaches are
shown in Fig. 3. From the figure, we can see that using the

2762

s2

w2

x4
x2

s1

w1

Z
x5

x8

x3

s3

w3

x7

s7

w7

x11

s11

x6
x9
x12
x10
x13
w11

x14

Z
x15

s15

w15

Fig. 4. Signal flow graph of 4x4 2-D AIQ-based DCT

B. JPEG-based Image Compression


In image compression using JPEG standard, it is possible
to control the compression ratio and the image quality by
controlling values in the quantization table (or matrix). This
table contains 4x4 (or 8x8) coefficients, where each coefficient determines the bit allocation in the spatial frequency
domain. In our algorithm, the first step of the quantization is
to incorporate the scaling factors (from eqn. (3)). For the
finite-precision (FP) approach, the 4x4 JPEG quantization
table for R-G-B will have 16 parameters, as shown in Fig.
5(a) (extracted from the 8x8 JPEG quantization table [11]).
16
17
35
92
32
64
128
512

(a)
(b)
Fig. 3. Signal flow graph for 4x4 1-D DCT: (a) conventional FP
approach; (b) proposed AIQ approach

w0

19
29
64
98

58
87
109
121

61
80
113
120

32
64
128
512

(a)
64
128 512
64
256 1024
256 512 1024
1024 1024 2048
(c)

64
128
128
512

64
128
128 256
256 512
1024 1024
(b)
128 128
256 256
256 512
1024 1024
(d)

512
1024
1024
2048
512
1024
1024
2048

Fig. 5. JPEG Quantization tables: (a) FP approach for RGB; (b)


Standardized for AIQ approach for R; (c) for G; (d) for B

In order to achieve the JPEG-defined compression, the Qtables for the proposed AIQ-based DCT (incorporating the
post-scaling parameters) have been developed for all three

2008 International Joint Conference on Neural Networks (IJCNN 2008)

colour signals, R-G-B and shown in Fig. 5(b)-(d). These


modified parameters are power-of-twos, thus avoiding any
division operation and making the quantization unit virtually
cost-free in terms of both space and power consumption
(only shift operations are required).
Note that rather than using the conventional Y-Cr-Cb
quantization, we have proposed an R-G-B quantization that
eliminates the need for demosaicking and colour space
conversion. Previous research has shown that the R-G-B
quantization can achieve similar compression ratio, as well
as, reconstructed image quality as its Y-Cr-Cb counterpart
[15]. The input image size to the DCT unit is 262,144 bytes
(256 x 256 x 8 x 4). Our goal is to reduce the data size and
achieve a low bit rate in the digital representation of
endoscopic medical images without perceived loss of
quality. It is previously shown that the energy distribution of
the transformed coefficients of these images has higher
frequency component in axial direction compared to
azimuthal direction [12]. It allows us to quantize the lower
frequency components densely.
Table I shows the hardware savings (in terms of adder and
divider units) that have been achieved using the proposed
scheme compared to the conventional FP approach.
TABLE I
EQUIVALENT HARDWARE COMPARISON
FP-based DCT

AIQ-based DCT

Equivalent
Hardware

FT

FT

Dividers (D)

14

Adders (A)

112

88

Total

112 A + 14 D

are performed, the data are sent to the quantization unit all at
once (12-bits per coefficient). The quantization unit is
composed with three modified quantizer tables (Fig. 5(b)(d)) that involves shift operations only. The quantized
coefficients (6-bits per coefficients) are then fed to the
encoder that finally outputs the encoded bit streams.

Fig. 6. Block diagram of the compressor unit

In the FRS unit, the inter-stage data are needed to be


multiplied with the algebraic variable (z) for the final binary
output. In this implementation, the FRS multipliers are based
on add-shift operations with a precision of 8 bits (as a way
to minimize the hardware and optimize the operations). This
operation is completed in one clock cycle. The block
diagram of the FRS unit is shown in Fig. 7. Once the
pipeline is filled, the entire process requires only four clock
cycles to complete (remember that there is no transpose
operation).

0
88 A + 0 D

FT = Forward Transform; Q = Quantization

C. Coefficients Encoding
The quantized coefficients are encoded using Lempel-Ziv
(LZ) coding [13]. The advantage of using the LZ algorithm
is that it avoids look-up tables and complex computations,
which eventually results in more power savings compared to
other entropy encoders (such as the Huffman coding and the
Arithmetic coding). In order to achieve our target
compression ratio (which is 85% at a minimum), the
window size and the maximum matching length of the LZ
algorithm are determined to be (64, 16) [8].
III. HARDWARE IMPLEMENTATION
The architecture is organized as a linear multistage
pipeline in order to achieve high throughput. It is based on
2s complement arithmetic in order to naturally handle
signed numbers. The block diagram (Fig. 6) shows the
functional units of the compressor. The image, captured by
the CMOS sensor, is the input to the architecture in a rowwise order at a rate of one pixel (8-bits per pixel) per clock
cycle. It is then stored in a buffer which allows the
synchronization of serial data generation and parallel data
production, enabling pipelined implementation.
The 2-D encoding scheme, shown in Fig. 4, is
implemented onto the architecture. Once the intermediate
additions, mapping, and the FRS (final reconstruction stage)

Fig. 7. Block diagram of the FRS unit

IV. PERFORMANCE ANALYSIS


In this work, we have used several GI test colour images
of 256x256 resolutions for simulation. These images are
first transformed and quantized using both the conventional
FP and the proposed AIQ-based algorithms (Fig. 3 and Fig.
5). The JPEG images are then reconstructed after the dequantization and the inverse transform. The results and the
reconstructed images are shown in Fig. 8 and 9 respectively.
The compression ratio (CR) is defined as the ratio of the
raw image size to the compressed image size (given in eqn.
(5)). The results show that the modified JPEG quantization
table, obtained by the proposed AIQ algorithm, improves the
visual image quality in terms of peak-signal-to-noise-ratio
(PSNR, given in eqn. (6)) compared with the JPEG specifications (FP algorithm) while maintaining similar
compression ratio. In all cases, the PSNR of the
reconstructed images are well above 30 dB, which is highly
acceptable to medical doctors for diagnosis [14]. The
average compression ratio of the proposed compressor is
87.13% and the average PSNR is 32.95 dB.

2008 International Joint Conference on Neural Networks (IJCNN 2008)

2763

100

CR (%), PSNR (dB)

80

60

40

20

0
Image 1

Image 2

JPEG-FP CR (%)

Image 3

Image 4

JPEG-FP PSNR (dB)

Image 5

Image 6

JPEG-AIQ CR (%)

Image 7

Image 8

JPEG-AIQ PSNR (dB)

Fig. 8. Comparisons of compression ratio (%) and PSNR (dB) between FP and AIQ schemes: Image 1 = Rectal Tubulovillous Adenoma; Image 2 =
Oesophageal Stricture reflex Disease; Image 3 = Duodenal Ulcer; Image 4 = Surgical Anastomose; Image 5 = Sigmoid Diverticular Colon Disease;
Image 6 = Caecal Cancer; Image 7 = Oesophageal Squamocellular Cancer; Image 8 = Radiation Proctitis

no. of zeros
CR
u100%
256 u 256

(5)

3 u 256 u 256 u 2552


(6)
PSNR 10 log10 3 256 256
2
reconstruct
original

i, j  x
i, j
x
1 1 1

The proposed architecture is implemented in Verilog HDL


and synthesized onto Xilinx FPGA (xcv50ecs144-8). It is
then synthesized using the CMOS 0.18um technology. The
image compressor can operate at a maximum frequency of
150 MHz and costs 3466 cells. When operating at 1.8V
supply, it consumes 10 mW of power. The overall silicon
area is 325,557 P m . While comparing the results with
other works, our proposed design has lower area and higher
frequency of operation (as shown in Table II).
2

V. CONCLUSION
In this paper, we have presented the first prototype with a
detailed algorithm of an image compressor to be used for a
wireless capsule endoscopy application. A direct mapping of
the 2-D DCT and the modified JPEG quantization tables are
provided. The use of algebraic integer quantization
eliminates the matrix transpose operation and results in
implementation-friendly quantization parameters. Our tests
show that the processor runs at a very high frequency and
consumes low hardware and power. Moreover, the
reconstructed images are of better quality and highly
comparable with conventional JPEG compressors. Future
research will be concerned on the standard cell VLSI
implementation of the video compressor, along with suitable
transmission protocol and efficient error correction
encoding.

TABLE II
COMPARISON OF IMPLEMENTATION RESULTS

M. Lin et al.
[8]
X. Xie et al.
[6]*
Proposed

REFERENCES

Area, P m 2

Frequency,
MHz

Power, mW

Supply
Voltage, V

390 k

12.58

14.92

1.8

12600k

40.0

6.2

1.8

325 k

150

10

1.8

[1]
[2]
[3]
[4]
[5]

* Includes analog transmission circuitry and SRAM

For a 256x256 GI image, the total power dissipation of is


18 mW (= 10 mW for image compressor + 6 mW for RF
Transmitter + 2 mW for LEDs). Assuming that two
commercially available batteries are installed and the
average capacity of each battery is 70 mAh @ 1.55 V, the
continuous function time of the capsule is approximately
(70 u1.55 u 2) /18 |12 hours.

2764

[6]

[7]

[8]

[9]

F. Gong, P. Swain, and T. Mills, Wireless Endoscopy, Gastrointestinal Endoscopy, vol. 51, no. 6, pp. 725-729, 2000.
PillCam, Given Imaging Ltd., www.givenimaging.com/en-us/
Sayaka, RF System Lab, www.rfamerica.com/sayaka
G. Iddan, G. meron, A. Glukhovsky, and P. Swain, Wireless Capsule
Endoscopy, Nature, vol. 405, pp. 417, May 25, 2000.
H. Park, et al., Design of Bi-directional and Multi-channel
Miniaturized telemetry Module for Wireless Endoscopy, Proc. of the
IEEE-EMBS Special Topic Conference on Microtechnologies in
Medicine and Biology, pp. 273-276, 2002.
X. Xie, G. Li, X. Chen, X. Li, and Z. Wang, A Low Power Digital IC
Design Inside the Wireless Endoscopic Capsule, IEEE Journal of
Solid-State Circuits, vol. 41, no. 11, pp. 2390-2400, November 2006.
P. Turcza and M. Duplaga, Low-Power Image Compression for
Wireless Capsule Endoscopy, Proc. of the IEEE Int. Workshop on
Imaging Systems and Technology, pp. 1-4, 2007.
M. Lin, L. Dung, and P. Weng, An Ultra Low Power Image Compressor for Capsule Endoscope, BioMedical Engineering Online
2006, vol. 5:14.
K. Rao and P. Yip, Discrete Cosine Transform: Algorithms, Advantages, and Applications, NY: Academic, 1990.

2008 International Joint Conference on Neural Networks (IJCNN 2008)

[10] K. Wahid, V. Dimitrov, and G. Jullien, On the Error-Free Realization


of a Scaled DCT Algorithm and Its VLSI Implementation, IEEE
Trans. on Circuits and Systems - II, vol. 54, no. 8, pp. 700-704, 2007.
[11] G. K. Wallace, The JPEG Still Picture Compression Standard, Com.
of the ACM, vol. 34, pp. 30-44, April 1999.
[12] K. Hamamoto, Standardization of JPEG Quantization Table for
Medical Ultrasonic Echo Images, Proc. of the 6th IEEE Int. Conference on Electronics, Circuits and Systems, pp. 683-686, 1999.

(a)

[13] J. Ziv and A. Lempel, A Universal Algorithm for Sequential Data


Compression, IEEE Trans. on Information Theory, vol. 23, no. 3, pp.
337-343, May 1977.
[14] P. Cosman, R. Gray, and R. Olshen, Evaluating Quality of Compressed Medical Images: SNR, Subjective Rating, and Diagnostic
Accuracy, Proc. of the IEEE, vol. 82, no. 6, pp. 919-932, June 1994.
[15] M. Orchard and C. Bouman, Color Quantization of Images, IEEE
Trans. on Signal Processing, vol.39, no.12, pp. 2677-2690, Nov. 1991.

Image 1

Image 5

Image 2

Image 6

Image 3

Image 7

Image 4

Image 8

(b)

(a)

(b)

Fig. 9. Reconstructed JPEG images: (a) using conventional FP algorithm; (b) using proposed AIQ algorithm

2008 International Joint Conference on Neural Networks (IJCNN 2008)

2765

Potrebbero piacerti anche