LBG Algo
LBG Algo
LBG algorithm is like a K-means clustering algorithm which takes a set of input vectors S = {xi Rd | i = 1, 2, . . . , n} as input and generates a representative subset of vectors C = {cj Rd | j = 1, 2, . . . , K } with a user specied K << n as output according to the similarity measure. For the application of Vector Quantization (VQ), d = 16, K = 256 or 512 are commonly used. LBG Algorithm 1. Input training vectors S = {xi Rd | i = 1, 2, , n}. 2. Initiate a codebook C = {cj Rd | j = 1, 2, , K }. 3. Set D0 = 0 and let k = 0. 4. Classify the n training vectors into K clusters according to xi Sq if xi cq p xi cj p for j = q . 5. Update cluster centers cj , j = 1, 2, , K by cj = 6. Set k k + 1 and compute the distortion Dk =
1 | Sj | K j =1 xi Sj xi Sj
xi . xi cj p .
7. If (Dk1 Dk )/Dk > (a small number ), repeat steps 4 6. 8. Output the codebook C = {cj Rd | j = 1, 2, , K }, The convergence of LBG algorithm depends on the initial codebook C , the distortion Dk , and the threshold , in implementation, we need to provide a maximum number of iterations to guarantee the convergence.