An image is just a matrix of numbers. Everything this part has built — eigenvalues, PSD-ness, low-rank truncation — was leading here: compress a real image by keeping only its matrix's biggest singular values, and watch the picture reappear almost perfectly from a fraction of the numbers.
reconstruction error = 8.944 (energy retained: 0%)
A 4x4 toy "image," reconstructed from 0, 1, or 2 of its singular components. Rank 0 is blank; rank 1 is already a recognizable (if blurred) sketch; rank 2 is the original back exactly.
Every image matrix (real or toy) has a singular value decomposition, and its best rank- reconstruction is the same truncated-SVD formula from the previous chapter:
- — the image, treated as a plain matrix of pixel intensities.
- — the -th singular value and left/right singular vectors of .
- — the rank- compressed reconstruction of the image.
- What compression actually means here
Storing only requires singular values plus vectors of each length — for a large image, singular components can cost far fewer numbers than the raw pixel grid.
- Where 'eigenfaces' comes from
Applied to a collection of face images stacked into one matrix, the same patterns become eigenfaces: reusable visual building blocks that any face in the set can be approximated from.
- The tradeoff is exact, not fuzzy
Exactly as in the previous chapter, — you can compute precisely how much reconstruction error a given compression ratio costs, before storing anything.
Pattern 1 (uniform across every row) alone captures 80% of the image's total energy — a single rank-1 term already does most of the work.
The toy image is built from two clean row-patterns: with , and with (each pattern used as both its own left and right singular vector, since the image is symmetric):
- Rank-1 reconstruction
: every entry of is , so is a flat image with every pixel equal to .
- The error, by direct subtraction
Reconstruct itself, since it was never written down: .
-
The second term has entries — positive where 's two entries share a sign, negative where they don't:
-
Adding that to 's flat s gives — a matrix of s and s, each exactly away from 's :
So is exactly the matrix from step 1, in all 16 cells, and .
-
- Confirm it matches Eckart-Young
The formula predicts — exactly what direct subtraction gave. Energy retained: .
Click the smallest rank whose reconstruction error drops below 4.5 (compute each rank's error by hand from the singular values 8 and 4).
Image compression, latent feature extraction, and eigenfaces are the same operation wearing different names: truncate a matrix's SVD and keep only the directions carrying the most energy. This closes out Part II — every idea here (projections, determinants, eigenvalues, PSD-ness, low-rank truncation) was building toward this single, reusable move, which reappears throughout the rest of this course wherever a large matrix needs to be summarized by a small one.