An Image Compression Algorithm For Wireless Endoscopy and Its ASIC Implementation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

An Image Compression Algorithm for Wireless

Endoscopy and Its ASIC Implementation


Yingke Gu1,3, Hanjun Jiang1*, Xiang Xie1, Guolin Li2 and Zhihua Wang1
1
Institute of Microelectronics, Tsinghua University, Beijing, China
2
Department of electronics engineering, Tsinghua University, Beijing, China
3
Beijing National Railway Research & Design Institute of Signal & Communication Group Co., Ltd., Beijing, China
*
Email: jianghanjun@tsinghua.edu.cn

Abstract—This paper proposes an image compression relatively low, which are less than 81%.
algorithm for wireless capsule endoscopy with high compression For improving the compression rate as well as assuring high
rate, low computation complexity and high quality. By analyzing quality, some works based on discrete cosine transformation
the WCE images properties, the algorithm proposes a color space
transform to de-correlate the R-G1-G2-B color components in (DCT) have been introduced in [5]– [10]. Those compression
the Bayer pattern image. Then a 4×4 integer Discrete Cosine algorithms get higher compression rate due to the high energy
Transformation is adopted to reduce the spatial redundancy in compaction capability of DCT. However, the high
the image with the consideration of its low complexity. For computational complexity of DCT, including multiplications,
increasing compression rate furthermore, run-length encoding on additions, data scheduling and data buffering, results in high
four adjacent blocks is proposed. The compression rate and peak hardware cost and high power consumption.
signal-to-noise of the image compression algorithm are 93.6%
This paper proposes a novel compression algorithm for the
and 40.9dB respectively. Its corresponding pipeline hardware
architecture with distributed storage is also proposed for Bayer pattern WCE images. Compared with the above image
minimizing the memory size and reducing power consumption. compression methods, the proposed image compression has
The ASIC design of the compressor has been implemented in a the highest compression rate as well as relatively low
0.18 μm CMOS process, whose area is 1.5mm×2.0mm and computational complexity. The corresponding hardware
power consumption is 1.03mW at 2 fps with 480×480 resolution. implementation is also discussed in this paper. A pipeline
architecture with the distributed memory is proposed for
Keywords—WCE; image compression; ASIC minimizing the memory area and reducing the power
consumption.
I. INTRODUCTION
Wireless capsule endoscopy (WCE) is a state-of-art II. IMAGE COMPRESSION ALGORITHMS
technology in the development of the medical diagnostics [1]. A. Overview of the proposed algorithm
It first allows painless optical imaging of the whole small
bowel. Due to its intrinsic limitations, the WCE still has some Wireless capsule endoscopy images have two properties
drawbacks, such as low image acquisition rate and short that can be exploited for the efficient image compression. The
battery life. In order to reduce the power consumption and first one is that the color information of the WCE images is
solve the wireless communication bandwidth bottleneck, the more monotonous than the natural images. The second one is
image compression plays a key role in WCE [2] [3]. that the WCE images are much smoother in the spatial domain.
According to the WCE images properties, an image
For obtaining high quality reconstructed images, some
compression algorithm with high compression rate, low
lossless (near-lossless) compression algorithms have been computation complexity and high quality is proposed for the
implemented in the wireless endoscopic capsule. Among Bayer pattern WCE images. The proposed algorithm scheme
many image compression standards, JPEG-LS can be a good consists of color components de-correlation, block
choice for WCE application, because it can work with pixels transformation, quantization and entropy encoding. The
coming in progressive scanning fashion. In [2] and [3], design following parts will discuss the algorithm in detail.
of image compressors based on JPEG-LS algorithm have been
described, a low-pass filter has been applied for improving the B. Color components de-correlation
compression rate. Another algorithm is developed in [4] that The compression method proposed in this paper aims at the
consists of a differential pulse coded modulation (DPCM) Bayer pattern WCE images. As shown in Fig.1, four color
followed by Golomb–Rice encoding. Several subsampling components are defined for the Bayer pattern images, including
schemes on the chrominance components are also applied Red (R), Green1 (G1), Green2 (G2) and Blue (B). Green
based on the nature of endoscopic images. The above image components are divided into two parts for the symmetry
compression algorithms have low computation complexity. consideration. The color components of the Bayer pattern
image, R-G1-G2-B, are still highly correlated. For efficient
However, the compression rates of the algorithms are
compression, the color components should be de-correlated.

978-1-5090-2959-4/16/$31.00 2016 IEEE 103


Authorized licensed use limited to: VISVESVARAYA NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on February 15,2024 at 17:48:48 UTC from IEEE Xplore. Restrictions apply.
quantization tables below are acquired under this PSNR
Y  R 
    constraint [12].
 D 1  K G 1  32 64 128 128   64 64 128 128 
 D 2 G 2  64
   
 64 128 256 5 12  256 256 5 12 
E  B  QY   Q D1  
128 256 512 512  128 256 512 512 







   
128 5 12 512 5 12  128 5 12 512 5 12 
Fig.1 Color components de-correlation
 64 128 128 256   64 128 256 256 
The de-correlation process can be expressed as a matrix 128 128 5 12 
256 256 5 12  256 512
transformation. As shown in Fig.1, four adjacent color QD 2  QE  
128 256 512 512   256 512 512 512 
components can be seemed as a vector. A new vector is    
 256 5 12 512 5 12   256 5 12 512 5 12 
formed after the transformation. The process also can be
represented by mathematical expression shown in Fig.1. The D. Entropy Encoding
Bayer pattern image is rearranged to be a new matrix with four The next important step is to find a suitable and efficient
rows. Each row represents a color component. After a 4×4 variable-length encoding scheme. The objective is to produce
de-correlation matrix K acting on it, another matrix is as fewer bits as possible. In order to improve the encoding
generated and the components in it have very weak correlation. efficiency, run-length encoding and Huffman encoding are
The new components are defined as Y, D1, D2 and E. Hence, applied, like in the JPEG standard.
finding a matrix K with good de-correlation property and low The DC coefficients of adjacent 4×4 blocks of same color
computation complexity is quite important. component are strongly correlated. They often contain a
Suppose that the matrix KL is the K-L transform matrix for significant fraction of the total image energy also. Therefore,
de-correlating the color components of the Bayer pattern they are coded differentially [13].
image. It is found that the result of KL has convergence when The remaining AC coefficients are run-length encoded. For
increasing sample size. The reason for it is that most of the improving the encoding efficiency, the run-length encoding
WCE images are similar with each other, especially their color should be applied for multiple blocks. The AC coefficients of
components distribution. For computation feasibility, we set the adjacent color components Y-D1-D2-E, are combined
the sample size as one frame of image. And then the average together for the run-length encoding. Y^, D1^, D2^ and E^
of K-L transform matrices for about 200 different images is represent the 4 × 4 blocks after block transformation and
used as the de-correlation transform matrix, as shown in (1). quantization. The run-length encoding orders the highest-
For reducing computation complexity, integer approximation energy coefficients first, maximizing the number of
is used, and the de-correlation matrix K is shown in (2). consecutive zero-valued coefficients appearing in the scan to
 0 . 523 0 . 598 0 . 522 0 . 487 
(1) reduce the total encoding length. And zig-zag order is used in
 0 . 653 0 . 012 
0 . 007 - 0 . 762 
KL   one block [13]. After the former color space transform, the
 - 0 . 511 0 . 534 0 . 572 - 0 . 611 
  new color component Y occupies the most energy, followed
 0 . 011 0 . 712 - 0 . 732 0 . 001 
by D1, D2 and E in order. Following this principle, the AC
1 1 1 1  (2) coefficients in the four blocks are scanned in the fashion
1 0 0  1
K   shown in Fig.2. The number in the bracket represents its order.
 1 1 1  1
 
0 1 1 0  Next, they are encoded in a 2-step process [13]. In the first
step sequence of quantized coefficients is converted into an
C. Block transformation and quantization intermediate sequence of symbols (L, v), where L is the
For improving the compression rate, we choose block number of consecutive zero-valued AC coefficients in the
transformation based method to remove the spatial redundancy above sequence order preceding the nonzero AC coefficient v.
of the WCE images. To reduce the computation complexity In the second step Huffman encoding variable-length codes
and buffer memory of the proposed algorithm, a 4×4 integer are assigned to the symbols (L, v).
DCT [11] matrix T is used as shown in (3).
1 1 1 1 
2 1 -1 - 2 
(3)
T 
1 -1 -1 1 
 
1 -2 2 -1
Based on the features of human visual system, quantization
is applied after the block transformation for getting a high
compression rate. The quantization table for Y-D1-D2-E will
have 64 parameters. The elements of the quantization table are
set to 2n to eliminate the division operations as follows. By
experimenting with different WCE images, we find that the
Fig.2 Combined Run-length Encoding order
there is no visual difference between the reconstructed image
and the original image, when PSNR is more than 40dB. The

104
Authorized licensed use limited to: VISVESVARAYA NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on February 15,2024 at 17:48:48 UTC from IEEE Xplore. Restrictions apply.
III. ASIC IMPLEMENTATION
Fig.3 shows the overall block diagram of the proposed
image compressor. The image compressor consists of data
path and controller. The data path is pipelined and is
composed of color de-correlation module, block transform
module and encoder module. The controller is implemented by
several finite-state machines generating control signals to all
the components in the data path.
As shown in Fig.3, the color de-correlation module and Fig.5 Block transform sub-module
block transform module are both composed of data buffer and The 2-D DCT operation is achieved by pipelining the two
matrix transform unit. For minimizing the memory area and 1-D DCT modules as shown in Fig.5. The transpose buffer
reducing power consumption, distributed memory architecture which converts row operations to column operations also
and dedicated operation sequence are proposed. In the encoder functions as the desired pipelining registers. Quantization
module, divided Huffman table storage architecture is applied operation is performed right after the DCT operation. By
for reducing power consumption in this stage. algorithm optimization, quantization can be performed by shift
operation.
The quantized data are then sent to the entropy encoder for
encoding. The DC coefficient is encoded in a manner
described earlier through differential encoding and Huffman
encoding. The arranged AC coefficients are sent to the run-
length encoder firstly. According to the run-length encoding
algorithm, the AC run-length encoder mainly consists of zero
detector and zero counter.
The run-length code is then sent to the Huffman encoder.
Each Huffman encoding process can be seemed as a memory
Fig.3 Proposed image compressor block diagram
read operation. The run-length code is set as the address of the
The color de-correlation module contains input buffer and Huffman table memory. The power consumption of the read
color transform unit. The input buffer consists of two random operation is mainly determined by the memory size. A divided
access memories (RAM), as shown in Fig.4. For color de- Huffman table memory architecture is proposed for power
correlation, the RAMs can store one row of Bayer image data. reduction. The store architecture is shown in Fig.6. It consists
The color transform unit is designed according to the data of two memories, one small memory Memory-H and one large
flow diagram also shown in Fig.4. It consists of adders, memory Memory-L. As we know, the short Huffman code has
subtractors and it is pipelined. high occurrence frequency. So the short Huffman codes are
stored in the small memory and the rest Huffman codes are
stored in the large memory.

Fig.6 Encoder module architecture

Fig.4 Color De-correlation module IV. IMPLEMENTATION RESULTS


The memory in Block Transform module is used for In order to evaluate the proposed compression algorithm,
buffering the progressive image data to the block the algorithm is applied for WCE images with different
transformation. At the top level, this block transform module patterns. Compression rate (CR) and peak signal noise ratio
consists of four block transform sub-modules for the four (PSNR) are computed for all the images. The average CR and
color components Y-D1-D2-E, respectively, as shown in Fig.3. PSNR are 93.6% and 40.9dB, respectively.
Each sub-module consists of buffer memory, 2-D DCT unit The original WCE images and reconstructed images with
and quantization unit. The distributed memory structure is also different patterns are shown in Fig.7. There is almost no visual
applied in the sub-module level. As shown in Fig.5, the buffer difference between the original images and reconstructed
memory used is divided into three parts. Each part is used for images.
storing the color components in one row. The proposed image compression algorithm is implemented

105
Authorized licensed use limited to: VISVESVARAYA NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on February 15,2024 at 17:48:48 UTC from IEEE Xplore. Restrictions apply.
in a 0.18μm CMOS technology. It is integrated into a SoC V. CONCLUSION
chip which has been applied in a wireless endoscopic capsule. This paper proposes an image compression algorithm for
Fig.8 shows the layout of the proposed image compressor Bayer pattern WCE images. Considering the WCE images
inside the SoC chip. It occupies about 1.5mm×2.0mm area. properties and apply environment, this algorithm consists of
Its chief performance has been shown in Table 1. color de-correlation, 4 × 4 integer DCT, quantization and
entropy encoding. For improving compression rate, combined
run-length encoding and optimized Huffman encoding are
proposed. An ASIC implementation of the proposed algorithm
is also proposed in this paper. In order to minimize the
memory area and reduce power consumption, distributed
memory architecture is applied. A divided Huffman table
memory architecture is proposed for reducing power
consumption furthermore. The compression rate and peak
signal-to-noise of the image compression algorithm are 93.6%
and 40.9dB respectively. The image compressor ASIC
Fig.7 Original images and reconstructed images occupies 1.5mm×2.0mm. Its power consumption is 1.03mW
at 2fps with 480×480 image resolution.

REFERENCES
[1] Iddan, Gavriel, et al. "Wireless capsule endoscopy." Nature 405 (2000):
417.
[2] Chen, Xinkai, et al. "A wireless capsule endoscope system with low-
power controlling and processing ASIC." Biomedical Circuits and
Systems, IEEE Transactions on 3.1 (2009): 11-22.
[3] Xie, Xiang, et al. "A low-power digital IC design inside the wireless
endoscopic capsule." Solid-State Circuits, IEEE Journal of 41.11 (2006):
2390-2400.
Fig.8 Chip layout [4] Khan, Tareq Hasan, and Khan A. Wahid. "Low power and low
complexity compressor for video capsule endoscopy." Circuits and
TABLE 1 Systems for Video Technology, IEEE Transactions on 21.10 (2011):
CHIEF PERFORMANCE OF THE CHIP 1534-1546.
Performance Performance [5] Wahid, Khan, Seok-Bum Ko, and Daniel Teng. "Efficient hardware
implementation of an image compressor for wireless capsule endoscopy
Technology 0.18 μm CMOS applications." Neural Networks, 2008. IJCNN 2008.(IEEE World
Congress on Computational Intelligence). IEEE International Joint
Chip Area 1.5mm×2.0mm Conference on. IEEE, 2008.
Max Frequency 121MHz [6] Turcza, P., and M. Duplaga. "Low-power image compression for
wireless capsule endoscopy." Imaging Systems and Techniques, 2007.
Power consumption 1.03mW at 2fps IST'07. IEEE International Workshop on. IEEE, 2007.
In Table 2, we compare the proposed image compressor [7] Lin, Meng-Chun, Lan-Rong Dung, and Ping-Kuo Weng. "An ultra-low-
power image compressor for capsule endoscope." Biomedical
with other related works (all using 0.18μm technology and engineering online 5.1 (2006): 14.
aiming at Bayer pattern images). Here, we see that the [8] Mostafa, Atahar, Khan Wahid, and Seok-Bum Ko. "A low-power
proposed compressor has the similar hardware cost with the subsample-based image compression algorithm for capsule endoscopy."
implementations in [2], [3], [7] and [9]. And the proposed Circuits and Systems (ISCAS), 2012 IEEE International Symposium on.
IEEE, 2012.
compressor has the highest compression rate. So it has better
[9] Dung, Lan-Rong, et al. "A modified H. 264 intra-frame video encoder
hardware implementation efficiency. Furthermore, the for capsule endoscope." Biomedical Circuits and Systems Conference,
proposed compressor can solve the wireless communication 2008. BioCAS 2008. IEEE. IEEE, 2008.
bottleneck effectively because of its high compression rate. [10] Mostafa, Atahar, Khan Wahid, and Seok-Bum Ko. "An efficient YUV-
TABLE 2 based image compression algorithm for wireless capsule endoscopy."
COMPARISON WITH OTHER RELATED WORKS Electrical and Computer Engineering (CCECE), 2011 24th Canadian
Conference on. IEEE, 2011.
Gate Buffer
CR PSNR(dB) Power [11] Schwarz, Heiko, Detlev Marpe, and Thomas Wiegand. "Overview of the
Count memory
scalable video coding extension of the H. 264/AVC standard." Circuits
[2] 56.7% 46.4 19.5K 2.19kB 0.9mW and Systems for Video Technology, IEEE Transactions on 17.9 (2007):
[3] 72.7% 46.8 18K 2.19kB 3.2mW 1103-1120.
[7] 79.6% 32.5 31K Yes 14.92mW [12] Hung, Andy C., and TH-Y. Meng. "Optimal quantizer step sizes for
transform coders." Acoustics, Speech, and Signal Processing, 1991.
[9] 82.0% 36.2 60K Yes 0.91mW ICASSP-91., 1991 International Conference on. IEEE, 1991.
proposed 93.6% 40.9 30K 4.5kB 1.03mW [13] Wallace, Gregory K. "The JPEG still picture compression standard."
Consumer Electronics, IEEE Transactions on 38.1 (1992): xviii-xxxiv.

106
Authorized licensed use limited to: VISVESVARAYA NATIONAL INSTITUTE OF TECHNOLOGY. Downloaded on February 15,2024 at 17:48:48 UTC from IEEE Xplore. Restrictions apply.

You might also like