vector quantization - oregon state...
TRANSCRIPT
![Page 1: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/1.jpg)
Lecture 13:Vector Quantization
Thinh NguyenOregon State University
![Page 2: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/2.jpg)
Vector Quantization
![Page 3: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/3.jpg)
Vector
![Page 4: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/4.jpg)
Vector Quantization Facts
![Page 5: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/5.jpg)
Examples
![Page 6: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/6.jpg)
Scalar vs. Vector Quantization
Pixels within a block are correlated.This tends to minimize the number of codewords needed to represent the vectors well.
More flexibility:Different size blocks.Different size codebooks.
![Page 7: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/7.jpg)
Scalar vs. Vector Quantization
Encoding:
Scan the a x b blocks of the image. For eachblock, find the nearest codeword in the codebook and output its index.
This is a “Nearest neighbor search.”
Decoding:
For each index, output the codeword with that index into the destination image.This is a table lookup.
![Page 8: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/8.jpg)
The Codebook
Both encoder and decoder must have the same codebook.
The codebook must be useful for many images and be stored somewhere.
The codebook must be designed properly to be effective.
Design requires a representative training set.
These are major drawbacks to VQ.
![Page 9: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/9.jpg)
The Codebook
Both encoder and decoder must have the same codebook.
The codebook must be useful for many images and be stored somewhere.
The codebook must be designed properly to be effective.
Design requires a representative training set.
These are major drawbacks to VQ.
![Page 10: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/10.jpg)
The Codebook Design Problem
![Page 11: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/11.jpg)
Generalized Lloyd Algorithm (GLA)The Generalized Lloyd Algorithm (GLA) extends the Lloyd algorithm for scalars.
Also called LBG after inventors Linde, Buzo, Gray (1980).
It can be very slow for large training sets.
![Page 12: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/12.jpg)
Example
![Page 13: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/13.jpg)
Example
![Page 14: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/14.jpg)
Example
![Page 15: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/15.jpg)
Example
![Page 16: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/16.jpg)
Example
![Page 17: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/17.jpg)
Example
![Page 18: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/18.jpg)
Example
![Page 19: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/19.jpg)
Example
![Page 20: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/20.jpg)
Example
![Page 21: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/21.jpg)
Example
![Page 22: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/22.jpg)
Example
![Page 23: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/23.jpg)
Example
![Page 24: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/24.jpg)
GLA Algorithm
![Page 25: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/25.jpg)
Codebook
![Page 26: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/26.jpg)
Codeword Splitting
![Page 27: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/27.jpg)
Example of Splitting
![Page 28: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/28.jpg)
Example of Splitting
![Page 29: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/29.jpg)
Example of Splitting
![Page 30: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/30.jpg)
Example of Splitting
![Page 31: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/31.jpg)
Example of Splitting
![Page 32: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/32.jpg)
Example of Splitting
![Page 33: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/33.jpg)
Example of Splitting
![Page 34: vector quantization - Oregon State Universityweb.engr.oregonstate.edu/.../vector_quantization.pdf · 2006-05-23 · Scalar vs. Vector Quantization Encoding: Scan the a x b blocks](https://reader030.vdocuments.us/reader030/viewer/2022040322/5e5f8e705e52e105cb7350a3/html5/thumbnails/34.jpg)
GLA Advices
Time per iteration is dominated by the partitioning step, which is m nearest neighbor searches where m is the training set size.
Average time per iteration O(m log n) assuming is small.
Training set size:
Training set should be at least 20 training vectors per code word to get reasonable performance.Too small a training set results in “over training.”
Number of iterations can be large.