fast image vector quantization with self-organizing maps

medium is error-prone, like the storage space of an ob- serving satellite or the ... rithm proposal will be described in section 3.. The sec- ... For example, when the.
65KB taille 1 téléchargements 232 vues
FAST IMAGE VECTOR QUANTIZATION WITH SELF-ORGANIZING MAPS Christophe F OUCHER, Daniel L E G UENNEC and Gilles VAUCHER Sup´elec/ETSN, avenue de la Boulaie, BP 81127, 35511 Cesson S´evign´e C´edex, France, email: [email protected], WWW home page: http://www.supelec-rennes.fr/ren/rd/etsn/

Abstract Vector quantization (VQ) is an efficient technique for lossy image compression, but it often suffers from computing complexity. We propose to reduce coding time in image vector quantization by using natural inter-block correlations and a topologically ordered codebook. Such a codebook is obtained by a self-organizing map (SOM), a neural unsupervised learning algorithm. During coding, when block content changes smoothly, the search for a code vector is limited to the previously used code vector’s neighbourhood instead of the entire codebook (exhaustive search). In both exhaustive and non exhaustive coding modes, the Partial Distance Search (PDS) is used to find the nearest neighbour. The algorithm was tested and we obtained a coding time reduction of up to 54% comparing to PDS and 85% comparing to full search. Keywords: image compression, vector quantization, coding time, self-organizing map.

1.

Introduction

Applications of Vector Quantization (VQ) are numerous. One of them is lossy image compression so as to occupy less bandwidth during transmission or less memory when storing the image. Sometimes, the storage/transmission medium is error-prone, like the storage space of an observing satellite or the radio transmission by cellular phones. A fixed length coding is then naturally more robust to data corruption and VQ is well-suited for that purpose. If the quantization indices are coded with the same number of bits, a single error will affect only one block of pixels. To maximize reconstruction quality, a vector quantiser generally performs the Nearest Neighbour Search (NNS): α(x) = i ⇔ ∀j d(x, yi ) ≤ d(x, yj ), where α(x) is the quantization index for x, yi is the ith code vector and d, the distortion measure is the squared euclidian distance. If NNS is performed by full search, N distortions are computed, where N is the number of code vectors. These are computationally expensive. Several research works were conducted aiming at reducing computational complexity of the NNS. Some

approaches apply constraints to code vectors position[8]. Many others use geometrical inequalities[3, 4, 9] and/or use precomputed additional information[1]. Partial Distance Search[2] is often integrated to other algorithms[3, 4, 6, 10] because it is more efficient than full search and is quite general. That approach will also be followed here. The following section recalls the codebook design with one-dimensional Self-Organizing Maps. Our algorithm proposal will be described in section 3.. The section 4. presents the experiments we carried on to verify algorithm’s performance. A discussion is then given in the last part.

2.

Codebook Design with Self-Organizing Map

A good vector quantiser must maximize mean reconstruction quality. For given resolution r and vector dimension k, the mean quality depends on the codebook. A design algorithm will build such a codebook starting from a training set containing representative vectors for a given application. Several algorithms work off-line like the GLA and the splitting algorithm[8]. Neural competitive learning algorithms like simple competitive learning or self-organizing maps[12] work on-line. The codebook is modified after each presentation of a learning vector. Obtained mean reconstruction quality is approximately the same with the different algorithms[7]. With SOMs, the codebook is topologically ordered. The codebook’s topology is defined by a proper distance function between code vectors. For example, when the code vectors are referenced by one index, the distance is the absolute index difference. Two codewords are called neighbours if their distance (in the map) is small. The learning algorithm may be defined as follows1 . For each learning vector x, • find the nearest neighbour, let i∗ be its index • move the nearest code vector and its neighbours : ∀i ∈ N (i∗ ) yi ← yi + ν(x − yi ) where ν is a decreasing learning coefficient and N (i∗ ) = [i∗ − N 0 , i∗ + N 0 ] . The neighbourhood size N 0 is also decreasing. 1 We

use here a rectangular neighbourhood function.

4500 4000 3500 3000 2500 2000 1500 1000 500 0

-40

-20

0

20

40

4500 4000 3500 3000 2500 2000 1500 1000 500 0

3.

Proposed Algorithm

In this section, will be recall that topological ordering and correlation between successive input vectors imply correlations between successive quantization indices. We will then propose to use that property so as to reduce coding time with a non exhaustive nearest neighbour search.

3.1

Block Correlations and Quantization Indices

As the coding cost is exponential with the vector dimension, k is upper bounded for practical reasons and in natural images, there is correlation left between successive image blocks. That property is used by several algorithms like predictive VQ, finite state VQ or adaptive VQ[8]. As a result, when several successive vectors are in the same quantization cell, they will be coded by the same index. This is a first level of correlation. The figure 1 shows the histogram (restricted to the interval [-50,50]) of the difference between two successive quantization indices when coding the Lena image with 256 16-dimensional non ordered code vectors. The central peak corresponds to vectors quantized with the same code vector as their predecessor. They represent about 25% of all vectors. With a non ordered codebook, the correlation is lost if two successive vectors, even close to each other, are located apart a cell boundary. On the contrary, if two code vectors are close in the input space, they have a higher probability to have close indices in a topologically ordered codebook. It is a second level of correlation. The figure 2 shows the histogram obtained with a topologically ordered codebook. About the same number of vectors are quantized with the same code vector as their predecessor. But for 77% of the output indices,

-20

0

20

40

Figure 2. Index Difference Histogram with SOM

Figure 1. Index Difference Histogram with Non-Ordered Codebook

The resulting codebook is topologically ordered. When two code vectors are close in the map, they are close in the input space.

-40

difference from the previous index is lower than 25 (including the 25% of the central peak).

3.2

Using that Correlation to Perform Non Exhaustive Search

Ordered Codebook With a topologically ordered codebook, there’s a significant probability that the nearest neighbour is in the previous code vector’s neighbourhood. So, our algorithm limits the NNS to that neighbourhood. The search is then non exhaustive. As there is sometimes discontinuities in block content (when an object boundary is crossed in the image), it is then suitable to search the entire codebook. To measure the continuity, we propose to use the distortion between current input vector and the previously used code vector. If this distortion is lower than a given threshold T , the search will be non exhaustive. Otherwise the entire codebook is search for the nearest neighbour. The coding procedure is thus : if d(yα(t−1) , x(t)) < T then NNS(x(t), C, max(α(t − 1) − N 0 , 1), min(α(t − 1) + N 0 , N )) else NNS(x(t), C, 1, N) where α(t) is the quantization indices sequence, C is the codebook containing N code vectors y1 , . . . , yN and NNS (x, C, i0 , i1 ) is the nearest neighbour search for x in C restricted to the index interval [i0 , i1 ]. Non-Ordered Codebook When coding in non exhaustive mode with a non ordered codebook, there is only the first level of correlation. The neighbourhood size N 0 can then be reduced to zero and the previous quantization index is replicated without NNS. Of course, the distortion threshold must then be lower than when using topology. Any existing algorithm may be used to perform the NNS, in either exhaustive and non exhaustive mode. As already said, we choose the PDS. The next part will show that care must be taken regarding the search order in non exhaustive mode when using PDS.

3.3

It was shown that PDS efficiency may be improved if each NNS is initialized with a good candidate (one of the nearest neighbours), and the previously used code vector is such a good candidate[11]. In non exhaustive mode, the search is reduced to the previous code vector’s neighbourhood. All that code vectors may be good candidates and no particular order will lead to clearly better performances. On the contrary, in exhaustive mode, the already computed distortion shows that the previous code vector is a bad candidate. So are its neighbours. As a consequence, search should be started elsewhere in the codebook. If the input statistics is unknown, it should be preferable to search the codebook in random order so as to cover the entire input space more rapidly. In image coding, input statistics are generally known, and a suited predictor can be designed for the quantization index. This predictor does not have to be perfect. The aim is just to find a good code vector candidate so as to speed up PDS. For example, if input vectors are blocks directly extracted from natural images, the mean vector component is the main input direction. It bears the most of the variability. A 1D SOM will naturally order itself along that direction and a linear mapping between mean input vector component and index space will suffice. Such a mapping is obtained with the formula : i0 = 1 + b(N − 1)

Pk

j=1

xj

255k

c

where b.c stands for the float-to-integer conversion. In our experiments, this search order resulted in a reduction of about 20% of the coding time.

4. 4.1

Experiments Experimental Protocol

Two codebooks were designed using Simple Competitive Learning. The first CC is initialized by randomly picking learning vectors. The second one, CS is initialized by constructing a Self-Organizing Map, like described in [5]. CS is thus topologically ordered while CC is not. The vector dimension, k is set to 16 (4 × 4 blocks) and the vector quantiser’s resolution is 8 bits per vector. Coding time and reconstruction PSNR were measured for execution on a Pentium II 300 MHz personal computer. The test image, Lena does not belong to the training set.

4.2

relative distortion threshold 1 5 10

Search Order and PDS

coding time (s) 1.00 0.80 0.72

PSNR (dB) 28.9 28.8 28.6

Table 1. Example Performance Values

used the following values for distortion threshold : 0.1, 0.5, 1, 5, 10, 50 and 100. Among the results obtained, several had particularly low PSNR. We retained only the results above 28 dB, because that is the value obtained with exhaustive search with a 7 bits per vector codebook. The figure 3 shows the obtained results with the two codebooks. Indeed, the retained points for CC correspond to low or null values for neighbourhood. This is due to the absence of topological order in that codebook. On the contrary, several points show that the use of topological order may result in shorter coding time, for same quality. The three most better points (circled in the figure 3) were obtained with a relative neighbourhood value of 0.1. This means 20% of the codebook was search in non exhaustive mode. The table 1 details the distortion threshold, encoding time and PSNR. These results may be compared to full search (complete computation of each distortion measure): 4.88 s with both codebooks. With plain PDS (search initialized with the first code vector in the codebook), we obtained at best 1.56 seconds. Thus, our algorithm, with a degradation of only 0.1 dB performed 6.1 times faster than full search, and 2.0 times faster than PDS (relative distortion threshold 5 in the table 1).

5.

Conclusions

A new algorithm was proposed for reducing coding time in image vector quantization. It makes use of a topologically ordered codebook. A choice is made between two coding modes based upon the distortion between the current input vector and the previously used code vector. If that distortion is lower than a given threshold, the search space for NNS is reduced to the neighbourhood of the previous code vector. In both modes, PDS is used for NNS. In exhaustive mode, the quantization index is predicted from the mean vector component so as to improve PDS efficiency. A coding time reduction of up to 84% relatively to full search and 49% relatively to PDS was obtained for a reduced decrease in quality.

Results References

The algorithm was experimented with several values for distortion threshold and neighbourhood size. Relatively to codebook size, the following values were used for neighbourhood size : 0, 0.01, 0.05, 0.1, 0.5 and 1. Relatively to mean distortion on the learning set, 1500, we

[1] SeongJoon Baek, BumKi Jeon, and Koeng-Mo Sung. A fast encoding algorithm for vector quantization. IEEE Signal Processing Letters, 4(12):325– 327, December 1997.

29 28.8

PSNR (dB)

28.6 28.4 28.2 CS CC

28 27.8 0.6

0.8

1

1.2 coding time (s)

1.4

1.6

1.8

Figure 3. Performance Measure with r = 8 and k = 16 and Test Image Lena

[2] Chang-Da Bei and Robert M. Gray. An improvement of the minimum distortion encoding algorithm for vector quantization. IEEE Transactions on Communications, COM-33(10):1132–1133, October 1985.

[9] Mary Holland Johnson, Richard E. Ladner, and Eve A. Riskin. Fast nearest neighbor search of entropy-constrained vector quantization. IEEE Transactions on Image Processing, 9(8):1435– 1437, 2000.

[3] Tian Bin, Tian Hong-xin, and Yu Ke-Chu. A fast codebook design algorithm for vector quantization. In IEEE International Conference on Signal Processing, pages 2004–2007, 2000.

[10] James McNames. Rotated partial distance search for faster vector quantization encoding. IEEE Signal Processing Letters, 7(9), September 2000.

[4] Chok-Kwan Cheung and Lai-Man Po. Normalized partial distortion search algorithm for block motion estimation. IEEE Transactions on Circuits and Systems for Video Technology, 10(2):417–422, April 2000. [5] Eric de Bodt, Marie Cottrell, and Michel Verleysen. Using the kohonen algorithm for quick initialisation of simple competitive learning algorithm. In european symposium on artificial neural networks, 1999. [6] C. Foucher, F. Durbin, D. Le Guennec, P. Leray, A. Tissot, G. Vaucher, and J. Weiss. Coding time reduction in image vector quantization by linear transforms and partial distorsion evaluation. In IMVIP, Irish Machine Vision & Image Processing Conference, 2001. [7] C. Foucher, D. Le Guennec, P. Leray, and G. Vaucher. Algorithmes neuronaux et non neuronaux de construction de dictionnaire pour la quantification vectorielle en traitement d’images. In Journ´ees Neurosciences et Sciences de l’Ing´enieur (NSI), pages 165–168, 2000. [8] Allen Gersho and Robert M. Gray. Vector quantization and signal compression. Kluwer Academic, 1992.

[11] J. Ngwa-Ndifor and T. Ellis. Predictive partial search algorithm for vector quantisation. Electronics Letters, 27(19):1722–1723, September 1991. [12] Syed A. Rizvi and Nasser M. Nasrabadi. Neural networks for image coding: A survey. In IS&T/SPIE Conference on Applications of Artificial Neural Networks in Image Processing, pages 46– 57, 1999.