Neural Comput & Applic (2006) 15: 245–251 DOI 10.1007/s00521-006-0026-1
O R I GI N A L A R T IC L E
Kwang-Baek Kim Æ Sungshin Kim Æ Gwang-Ha Kim
Vector quantizer of medical image using wavelet transform and enhanced SOM algorithm
Received: 26 May 2005 / Accepted: 4 January 2006 / Published online: 8 February 2006 Springer-Verlag London Limited 2006
Abstract Vector quantizer takes care of special image features like edges, and it belongs to the class of quantizers known as the second-generation coders. This paper proposes a novel vector quantization method using the wavelet transform and the enhanced SOM algorithm for the medical image compression. We propose the enhanced self-organizing algorithm to resolve the defects of the conventional SOM algorithm. The enhanced SOM, at first, reflects the error between the winner node and the input vector to the weight adaptation by using the frequency of the selection of the winner node. Secondly, it adjusts the weight in proportion to the present weight change and the previous one as well. To reduce the blocking effect and the computation requirement, we construct training image vectors involving image features by using the wavelet transform and apply the enhanced SOM algorithm to them for generating a well-defined codebook. Our experimental results have shown that the proposed method energizes the compression ratio and the decompression quality.
1 Introduction Computer graphics and medical imaging applications have started to make inroads into our everyday lives due to the global spread of information technology. This has made image compression an essential tool in computing K.-B. Kim (&) Department of Computer Engineering, Silla University, Busan, South Korea E-mail:
[email protected] S. Kim Department of Electrical Engineering, Pusan National University, Busan, South Korea G.-H. Kim Department of Internal Medicine, Pusan National University College of Medicine, Busan, South Korea
with workstations, personal computers and computer networks. Videoconferencing, desktop publishing and archiving of medical and remote sensing images, etc. entail the use of image compression for the storage and transmission of image data [1]. Image compression can also be viewed as a form of classification, since it assigns a template or a code word to a set of input pixel vectors drawn from a large pixel set in such a way as to provide a good approximation of representation. Vector quantization (VQ) is the wellknown method as a component algorithm for loss compression methods, and many loss compression methods are using the LBG algorithm for the VQ, which was developed by Linde et al. [2]. But, the LBG algorithm is iterative and requires a considerable computation time to get optimal code vectors [3]. The quantization method using the artificial neural network is well suitable to the application that the statistical distribution of the original data changes as the time passes, since it supports the adaptive learning to data [4, 5]. Also, the neural network has a huge parallel structure and the possibility for high-speed processing. The hardware implementation of vector quantizer using the neural network supports O(1)’s codebook search and does not require designing the extra structure for designing the codebook. The VQ for the color image requires the analysis of image pixels for generating the codebook previously not known, and the self-organizing map (SOM) algorithm, which is a self-learning model of the neural network, is widely used for the VQ. However, the VQ using the SOM shows an underutilization in which only some code vectors are heavily used [6, 7]. This defect is incurred because it is difficult to estimate correctly the center of the data, with no prior information of the distribution of the data. In this paper, we propose the enhanced SOM algorithm to solve the defects of the VQ using the conventional SOM, and integrated the wavelet transform and the enhanced SOM algorithm to support the efficient VQ for medical image compression. Also, we implemented
246
and evaluated the proposed VQ and image compression algorithms.
2 Related research 2.1 Definition of vector quantization A minimum distortion data compression system or source coder can be modeled as a VQ by mapping of input vectors into a finite collection of templates or reproduction code words called a codebook [3]. In VQ, the original image is first decomposed into k-dimensional image vectors, and each decomposed image vector is mapped into a template vector having a minimal error from a codebook. That is, VQ can be defined as a mapping Q of k-dimensional Euclidean space Rk into a finite subset Y of Rk as following: Q : Rk ! Y ; Y ¼ ð~ x0i : i ¼ 1; . . . ; Nc Þ;
ð1Þ
where the codebook Y ¼ ð~ x0i : i ¼ 1; . . . ; Nc Þ is the set of reproduction vectors, Nc is the number of vectors in Y, which is the size of the codebook. It can be seen as a combination of two functions: an encoder, which takes the input vector ~ x and generates the address of the reproduction vector specified by Qð~ xÞ, and a decoder, which searches the reproduction vector ~ x0 using the encoded address. To measure the degree of distortion of the reproduction vector ~ x0 , a mean square error (MSE) is generally used as follows: MSE ¼
N 1X ð~ xi ~ x0i Þð~ xi ~ x0i ÞT ; N i¼1
ð2Þ
where N is the number of image vectors involved in the original image, ~ xi (i=1,...,N) is the image vector of the original image and ~ x0i is the reproduction vector corresponding to ~ xi .
2.2 LBG algorithm It is known that the LBG algorithm is most representative among the codebook generation algorithms. This algorithm generalizes the scalar quantizer designed by Lloyd and is called the generalized Lloyd algorithm [3]. The LBG algorithm maps all input vectors to representation vectors with minimum distortion and calculates the average of distortion degree. The LBG algorithm generates the optimal codebook according to the following steps: Step 1. All input vectors are mapped to code vectors with minimum error in the codebook. Step 2. MSE between input vectors and code vectors is calculated. Step 3. The error value is compared with the given allowance, and if the error value is greater than the allowance, the current codebook is adjusted by recalculating the centers of the code vectors. Otherwise, the
current codebook is determined to be optimal. The selection of the initial codebook is important to generate the optimal codebook in the LBG algorithm. The selection methods of the initial codebook are the random selection method, the separation method that divides all learning vectors into two groups, and the merging method that merges two adjacent vectors repeatedly from N clusters to the Nc’s codebook. Without regard to the initialization method, the LBG algorithm iteratively scans all image vectors to generate the optimal codebook and requires a high computation time for images of large size.
2.3 Vector quantization using neural network It is known that the SOM algorithm is widely applied in the VQ, which is the self-learning method among neural network algorithms [7, 8]. The SOM algorithm, which is derived from an appropriate stochastic gradient decent scheme, results in a natural clustering process in which the network performs competitive learning to perceive pattern classes based on data similarity. Smoothing of vector elements does not take place in this unsupervised training scheme. At the same time, since it doses not assume an initial codebook, the probability of getting caught in local minima is also small. The investigations for high-quality reconstructed pictures have led us to the edge preserving SOM. This greatly reduces the large computational costs involved in generating the codebook and finding the closest code word for each image vector. The process that adaptively adjusts the weight of the stored pattern in the SOM algorithm is the same as the process that dynamically generates a code vector in the codebook for the given input vector in the VQ. Therefore, the VQ using the SOM algorithm generates the codebook dynamically for color images. However, from practical experience, it is observed that additional refinements are necessary for the training algorithm to be efficient enough for practical applications [9]. And with no information of the distribution of training vectors, the VQ using the SOM algorithm randomly selects the initial code vectors and progresses the adaptive learning. Therefore, this adaptive VQ algorithm generates code vectors, which have never been used after the initial codebook generation, incurring the underutilization of the code vectors.
3 Medical image vector quantizer using wavelet transform and enhanced SOM algorithm We apply the enhanced SOM algorithm to training image vectors extracted from the wavelet transform of an original image, generating a well-defined codebook for the medical image compression as shown in Fig. 1.
247 R Encoder
G
Initialized the index of SOM model
Index
B Image
Wavelet Transform
A new input vector Decoder R
VQ using enhanced SOM
Code book
distance computation
r r d j = f j ⋅ d ( xi , w j (t ))
G B
Output
winner node setup
(O*j = Min(d j ))
Fig. 1 The processing structure of the proposed vector quantizer weight re-adjustment
r r r w j* (t + 1) = w j* (t ) + d j* (t + 1)
3.1 Enhanced SOM algorithm The VQ using the conventional SOM algorithm incurs the underutilization of code vectors. In order to solve this defect, we enhanced the conventional SOM algorithm by employing three methods for the efficient generation of the codebook. First, the error between the winner node and the input vector and the frequency of the selection of the winner node are reflected in the weight adaptation. Second, the weight is adapted in proportion to the present weight change and the previous one as well. Third, in the weight adaptation for the generation of the initial codebook, the weight of the adjacent nodes of the winner node is adapted together. The enhanced SOM algorithm is able to generate the codebook in real-time and provide the high recovery quality in the image compression based on the VQ. The procedure for generating a codebook by using the enhanced SOM algorithm is shown in Figs. 2 and 3. In the proposed method, the codebook is generated by scanning the entire image only two times. In the first scan, the initial codebook is generated to reflect the distribution of the given training vectors. The second scan uses the initial codebook and regenerates the codebook by moving to the center within the decision region. To generate the optimal codebook, it is necessary to select the winner node correctly and appropriately consider the distortion between the code vector and the input vector. For this management, the competitive learning algorithm uses the frequency of an output node to be selected as a winner node and the distortion of the selected winner node. Considering the two measures, we apply the following equation for the weight adaptation: ~ wj ðt þ 1Þ ¼ ~ wj ðtÞ þ að~ xi ~ wj ðtÞÞ; a ¼ f ð~ ej Þ þ f1j ; f ð~ ej Þ ¼ 1ð~ej Þ ;
ð3Þ
1þe
where ~ wj ðtÞ is the weight vector of k-dimension of the jth output node, a is the learning factor between 0 and 1 and is set between 0.25 and 0.75 in general and ð~ xi ~ wj ðtÞÞ is the error value representing the difference between ith input vector and jth code vector. Equation 3 means that weights are adapted in proportion to the size of the difference between the input vector and the representative code vector. Therefore, as the learning factor, we use the normalizing value that converts the output error of the winner node to the value between 0 and 1. ~ ej is the output error of
Frequency computation of winner node
Codebook generation Yes
No
Codebook completion Fig. 2 The enhanced SOM algorithm for generating the initial codebook
the jth neuron, f ð~ ej Þ is the sigmoid function that converts the value of ~ ej to the value between 0 and 1, and fj is the frequency for the jth neuron to be selected as the winner. The above method considers only the present change of weight, and in the weight adaptation, we consider the previous weight change as well as the present one. This concept corresponds to the momentum parameter of BP, and we will call this concept as a momentum factor. Based on the momentum factor, the equation for the weight adaptation can be modified as follows:
I Initialize the index of SOM model
An input vector (An each block of the image to compress)
Distance computation of present vector winner node setup
(O *j = Min in (d j ))) Codebook generation Yes
No
Codebook completion
Fig. 3 The procedure of index determination and codebook generation
248
~ wj ðtÞ þ ~ dj ðt þ 1Þ; wj ðt þ 1Þ ¼ ~ ~ xi ~ wj ðtÞÞ þ a~ dj ðtÞ: dj ðt þ 1Þ ¼ að~
the image, so that the VQ using the feature information of the wavelet transform is able to generate a codebook, reflecting well the features of the original image. The integration of the wavelet transform and the enhanced SOM algorithm is as follow: after applying the wavelet transform to each RGB plane of an original image, image blocks of 4·4 pixel size corresponding to feature pixels presented in the low-frequency region (LL region) of the wavelet transform are extracted from each original RGB plane in order to construct a training vector set. Next, the enhanced SOM algorithm is applied to the training vector set, generating a codebook by saving the original image vector into the codebook element coming under the index corresponding to a winner node for a training vector. The original image vector that is used instead of the wavelet-transformed image vector as a code word, removes the loss of information that is incurred by the down-sampling of the wavelet transform, and preserves the original information that is involved in the image. The low-frequency band filter of the wavelet transform embosses the strong feature region of an image and reduces the weak feature region, producing a smoothing effect of an image and reducing the image noise. So, the training vector set that was constructed based on the
ð4Þ ð5Þ
In (5), the first term represents the effect of the present weight change and the second term is the momentum factor representing the previous one. The whole algorithm is detailed in Fig. 4. 3.2 Application of wavelet transform Grouping of the image data can be done by the classified VQ in the region of the wavelet transform without the help of a classifier. The thickness of the image edges is not compartmentalized in the discrete cosine transform, but it is done in the region of the wavelet transform. And there is the advantage that the border phenomenon (or block effect) does not happen in the region of the wavelet transform. Therefore, we integrated the wavelet transform with the enhanced SOM algorithm to reduce the border phenomenon and heighten the image quality in the recovery of a quantized image. The low frequency region of the wavelet transform of an image presents well a variety of features involved in Fig. 4 The vector quantization method based on the enhanced SOM algorithm
Step 1. Initialize the network: Initialize weight vector (wj) from the k’s input nodes to the j-th output node to small random values. Set the initial neighborhood, Nc to be large. Fix the convergence tolerance limit for the vectors to be a small quantity. Settle the maximum number of iterations to be a large number. Divide the training set into image vectors of k-dimension. Step 2. Compute the mean and the variance of each training input vector. Step 3. Present the input xi . Step 4. Compute the Euclidean distance dj between the input and each output node j, given by r r d j = f j × d ( xi , w j (t ))
where fj is the frequency of the selection of the j-th neuron as a winner. Select the minimum distance. Designate the output node with minimum dj to be j*. Step 5. Update the weight for node j* and its neighbors defined by the neighborhood size Nc. The weights are updated as follows:
if i ∈ N c (t )
r
r
r
f j* = f j* + 1 , w j* (t + 1) = w j* (t ) + δ j* (t + 1) r
r
r
r
δ j* (t + 1) = α (t + 1)( xi – w j* (t )) + α (t + 1)δ j* (t ) r r r e j* = ( xi – w j* (t )), α (t + 1) = 1+ e
1 1 r + –(e j * ) f * j
if i ∉ N c (t ) r r w j* (t + 1) = w j* (t )
The neighborhood Nc(t) decreases in size as time goes on, thus localizing the area of maximum activity, and f(ej) is the normalization function. Step 6. Repeat by going to step 2 for each input vector presented, till a satisfactory match is obtained between the input and the weight or till the maximum number of iterations are complete.
249
horizontal direction
vertical direction h
x
g
x
h
x
h
g g
The image to use (O)
h : high frequency band pass g : low frequency band pass Fig. 5 The structure of wavelet transforms
Fig. 6 The filters used in wavelet transform
wavelet transform is compact, reflecting sufficiently the feature information of an original image, and the size of a codebook generated by using the training vector set becomes reduced. The VQ based on the integration of the wavelet transform and the enhanced SOM algorithm quantizes and compresses image vectors by using peculiar features of an original image. Figure 5 shows the structure of a wavelet transform [10] and Fig. 6 shows the example of the filters in high and low frequency.
4 Simulation results An experimental environment was implemented on an IBM-compatible Pentium III PC with C++ Builder. The images used in the experiment are the color medical images with 128·128 pixel size. Figure 7 shows samples
of the medical color image used in the experiment. Although the proposed VQ algorithm can be applied to grayscale images, the various color images were selected for the experiment because the proposed algorithm is for the color medical image. The color image is separated to three planes corresponding to RGB color channels and each plane is transformed and quantized to the compressed data. Also, each plane is divided into pixel blocks of 4·4 size and each block is represented by a vector of 16 bytes. Image blocks are encoded and decoded by using the codebook generated by the proposed VQ algorithm. In this paper, the proposed VQ algorithm and the LBG algorithm are compared mainly in performance. In the case of the codebook generation and image compression, the proposed VQ algorithm improves by five times in the computation time than the LBG algorithm, since the proposed algorithm generates the codebook by scanning all the image vectors only two times. This reduces the requirement of the memory space. The application of the wavelet transform lightens the blocking effect and improves the recovery quality. Table 1 compares the size of the codebooks generated by 4’s VQ algorithms such as the LBG algorithm, the SOM algorithm, the enhanced SOM one and the integration of the wavelet transform and the enhanced SOM for images given in Fig. 7. In Table 1, the proposed integration method shows a more improved compression ratio than the other methods. In the case of the second sample image showing the distribution of various colors, the compression ratio is low compared to the other images. For the comparison of decompression quality, we measured mean square error (MSE) between the original image and the recovered image and it is summarized in Table 2. As shown in Table 2, the proposed integration method shows the lowest MSE.
Fig. 7 Medical image samples used for experimentation
(a) Cell image
(b) Cancer image
(c) Endoscopic image 1
(d) Endoscopic image 2
Table 1 Comparison of the size of codebooks by VQ (unit: byte) Images
Cell image Cancer cell image Endoscopic image 1 Endoscopic image 2
Algorithms LBG
SOM
Enhanced SOM
Wavelet transform and enhanced SOM
32,376 33,357 33,232 33,127
35,080 36,213 37,081 37,034
34,648 35,457 36,649 36,593
27,365 29,645 28,377 28,321
250
Table 2 Comparison of MSE for compressed images Images
Algorithms
Cell image Cancer cell image Endoscopic image 1 Endoscopic image 2
LBG
SOM
Enhanced SOM
Wavelet transform and enhanced SOM
14.5 15.1 14.9 14.8
11.3 14.1 13.8 13.6
10.8 13.2 12.7 12.4
9.1 11.4 10.6 10.3
Also, as shown in Fig. 8 ,comparing the processing time for codebook generation, the LBG algorithm is worse than the other algorithms. The LBG algorithm generates 10’s temporary codebooks in the process for the creation of the optimal codebook and requires a high computation time. Conversely, the proposed algorithm generates only one codebook in the overall process and greatly reduces the computation time and the memory space required to generate the codebook. For each original image given in Fig. 7, Figs. 9, 10, 11 and 12 show the recovered images from the image compressions by the four VQ algorithms. These figures visually confirm the experiment result presented in Table 2.
Codebook generation time
12 10 8 6 4 2 0 SOM
Enhanced SOM wavelet and enhanced SOM
LBG
Fig. 8 Comparison of processing time for codebook generation
In conclusion, the enhanced SOM algorithm improves the compression ratio and the recovery quality more than the conventional SOM algorithm.
5 Conclusion The VQ method proposed in this paper can be summarized as follows: by using the enhanced SOM algorithm, the output error concept is introduced into the weight adaptation and the momentum factor is added. The VQ algorithm using the enhanced SOM algorithm performs the learning in two steps and the total learning vectors are used only once in each step. In the first step, it produces the initial codebook by reflecting well the distribution of the learning vectors. In the second step, it produces the optimal codebook by shifting to the current center of each code group based on the initial codebook. Also, in order to improve the recovery quality and reduce the computation time for the codebook generation, we constructed a training vector set reflecting sufficiently the feature information of an image by using the wavelet transform and we applied the enhanced SOM algorithm to them, generating the well-defined codebook. The simulation results showed that the integration of the wavelet transform and the enhanced SOM algorithm
Fig. 9 The recovered image for cell image
(a) original image
(b) LBG
(c) SOM
(d) Enhanced SOM
(e) Wavelet and Enhanced SOM
Fig. 10 The recovered image for cancer cell image
(a) original image
(b) LBG
(c) SOM
(d) Enhanced SOM
(e) Wavelet and Enhanced SOM
251 Fig. 11 The recovered image for endoscopic image 1
(a) original image
(b) LBG
(c) SOM
(d) Enhanced SOM
(e) Wavelet and Enhanced SOM
Fig. 12 The recovered image for endoscopic image 2
(a) original image
(b) LBG
(c) SOM
(d) Enhanced SOM
(e) Wavelet and Enhanced SOM
improve the defects of VQ such as the processing time and memory space caused by the complex computation and the block effect of the recovered images.
References 1. Rabbani M, Jones PW (1991) Digital image compression technique. SPIE Optical Engineering Press, pp 144–169 2. Linde Y, Buzo A, Gray RM (1980) An algorithm for vector quantizer design. IEEE Trans Commun 1(1):84–95 3. Gray RM (1984) Vector quantization. IEEE ASSP Magazine, pp 4–29 4. Kohonen T (1990) Improved versions of learning vector quantization. Proc IJCNN 1:545–550
5. Godfrey KRL, Attikiouzel Y (1993) Self-organized color image quantization for color image data compression. Proc ICNN 3:1622–1626 6. Kim KB, Cha EY (1996) A fuzzy self-organizing vector quantization for image. Proc IIZUKA 2:757–760 7. Madeiro F, Vilar RM, Fechine JM, Aguiar Neto BG (1999) A self-organizing algorithm for vector quantizer design applied to signal processing. Int J Neural Syst 9(3):219–226 8. Oehler KL, Gray RM (1997) Combining image compression and classification using vector quantization. IEEE Multimedia, pp 36–45 9. Seo S, Bode M, Obermayer K (2003) Soft nearest prototype classification. IEEE Trans Neural Netw 14(2):390–398 10. Strang G, Nguyen T (1996) Wavelets and filter banks. Wellesley-Cambridge Press