A Fast LBG Codebook Training Algorithm for Vector Quantization Presented by 蔡進義 Motivation A fast codebook-training algorithm based on LBG algorithm. To reduce the computational cost in the codebook training processes. 2 Outline Introduction Previous Works Proposed Method Some Experiments Discussions and Conclusions 3 Image Compression techniques Block truncation coding Transform coding Hybrid coding Vector quantization Simple structure and low bit rate 4 VQ scheme The VQ scheme can be divided into three parts: Codebook generation Encoding procedure Decoding procedure encoding decoding Codebook Codebook 5 Codebook Generation The most important task for VQ scheme is to design a good codebook. LBG (Linde-Buzo-Gray) algorithm / Lloyd clustering algorithm The LBG algorithm is an iterative procedure. cb0 cb1 … cbn 6 Euclidean Distance The dimensionality of vector = k (= w*h) An input vector x = (x1, x2, …, xk) A codeword yi = (yi1, yi2, …, yik) The Euclidean distance between x and yi d ( x, yi ) x yi 2 k ( x j yij ) 2 j 1 7 Codebook Generation 8 VQ Codebook Training Codebook generation 0 1 . . . . . . N-1 N Training Images Training set 9 VQ Codebook Training Codebook generation 0 1 . . . . . . N-1 N Training set 0 1 . . . 254 255 Initial codebook Codebook initiation 10 VQ Encoding Procedure Image compression technique h w Image Index table Vector Quantization Encoder 11 VQ Decoding Procedure Image compression technique h w Image Index table Vector Quantization Decoder 12 Codebook search To reduce the computational cost for the segmentation procedure in the LBG algorithm, many fast algorithms for codebook search have been developed. Partial Distortion Search (PDS) Mean-distance-ordered Partial Codebook Search (MPS) Integral Projection Mean-sorted Partial Search (IPMPS) 13 Outline Introduction Previous Works Proposed Method Some Experiments Discussions and Conclusions 15 Goal To reduce the computation cost in finding the closest codeword in the codebook. PDS MPS IPMPS 16 Partial distortion search (PDS) Closest codeword search (a0, a1, a2, …, a15) input vector s ( x j yij ) d min 2 i 1 (b0, b1, b3, …, b15) codeword If the minimal distance of each input vector could not be found early, the PDS method can just reduce little computation time. 17 Mean-distance-ordered Partial Codebook Search Algorithm (MPS) The Squared Euclidean Distance (SED) m d E ( X , Yi ) ( x j yij ) 2 i 1 The Squared Mean Distance (SMD) m m d M ( X , Yi ) ( x j yij ) i 1 2 i 1 The minimal SED codeword is usually in the neighborhood of the minimal SMD codeword. 18 Mean-distance-ordered Partial Codebook Search Algorithm (MPS) m d E ( X , Ymin ) d MM ((X X,,Y Yii)) m d E ( X , Yi ) SMD m d E ( X , Ymin ) d M ( X , Yi ) reject SED 19 Integral Projection Mean-sorted Partial Search Algorithm (IPMPS) Based on multiple distortion measures with different levels of computational complexity. Three kinds of integral projections: n VPx ( j ) X (i, j ),1 j n i 1 n HPx ( j ) X (i, j ),1 i n j 1 n MPx i 1 n X (i, j ) j 1 20 Integral Projection Mean-sorted Partial Search Algorithm (IPMPS) Three distortion measures: d M ( X , Yi ) ( MPX MPYi ) 2 n d min d M ( X , Yi ) n d E ( X , Yi ) 2 2 n dV ( X , Yi ) (VPX (k ) VPYi (k )) 2 k 1 n d H ( X , Yi ) ( HPX (k ) HPYi (k )) 2 k 1 Test conditions For each codeword Yi d M ( X , Yi ) n d E ( X , Yi ) 2 dV ( X , Yi ) n d E ( X , Yi ) d H ( X , Yi ) n d E ( X , Yi ) n d min d M ( X , Yi ) 2 n d min dV ( X , Yi ) n d min d H ( X , Yi ) 21 Outline Introduction Previous Works Proposed Method Some Experiments Discussions and Conclusions 22 Generalized Integral Projection Model (GIP) To reduce the computational cost MPS and IPMPS IPMPS employs the concept of integral projection to reject further codeword in search. 23 Generalized Integral Projection Model (GIP) 1. Initially, choose one possible projection map of the pair (p, q). 2. 3. p segments with q pixels in each segment For each input vector, compute the projection PX(k) of these p segments. The distortion measure corresponding to this projection map is defined as: p d ( p ,q ) ( X , Yi ) ( PX (k ) PYi (k )) 2 k 1 24 Generalized Integral Projection Model (GIP) 4. For each codeword, the following inequality can be easily proven true d ( p ,q ) ( X , Yi ) q d E ( X , Yi ) 5. The test condition for this projection map can be constructed. q d min d ( q , p ) ( X , Yi ) pair(p, q) possible projection map test condition m! ( p!)( q!) p 25 Segment maps 26 Fast LBG Algorithm 1. 2. 3. Initially, select a set of test conditions by repeatedly applying the GIP model with different projection maps of the desired pair (p, q). Sort the current codebook by the mean values of the codewords. For each vector, find the corresponding closest codeword. 27 Fast LBG Algorithm 4. Record the index of the closest codeword for each training vector. 5. Update each codeword 6. Overall averaged distortion 28 Outline Introduction Previous Works Proposed Method Some Experiments Discussions and Conclusions 29 Experiment Methods 512*512 image LBG PDS MPS 30 Experiment Results the property of the training set FLBG-1a FLBG-1b 31 Outline Introduction Previous Works Proposed Method Some Experiments Discussions and Conclusions 32 Conclusions A generalized integral projection model is developed to produce the test conditions for the speedup of the search process for the VQ codebook design. To use these test conditions to eliminate the need of calculating the squared Euclidean distance. The property of image By choosing proper sets of test conditions for different training sets, a great deal of computation cost can be reduced. 33