01Why it matters
How few numbers does a picture need?
A 24 × 24 grayscale picture is 576 numbers. But most pictures aren't random: neighbouring rows look alike, and whole regions share the same pattern. The singular value decomposition (SVD) finds that shared structure and lists it from most to least important, so you can keep the important part and throw the rest away.
The same idea compresses images, removes noise, powers recommender systems and is the engine inside PCA.
02Key parts
The pieces you will see
- rank-1 piece
- A column pattern times a row pattern : every row of the piece is the same row pattern, scaled. It takes numbers instead of .
- singular value σ
- How strongly a piece counts. The SVD sorts them: .
- rank
- How many pieces have : the number of pieces that rebuild the matrix exactly.
- energy
- The share of that the pieces kept so far account for.
03See it work
Rebuild a face one piece at a time
Every matrix can be written as
with the 's perpendicular to each other, the 's too, and the 's in decreasing order. The first piece alone already has about 80% of the smiley's energy; by the fifth the face is clearly there. Each piece costs numbers, so five pieces are 245 numbers instead of 576.
Some pictures are simple enough to have only a couple of pieces at all:
There is also a geometric reading, the one the eigenvectors lesson prepares you for. Written as , any matrix acts in three moves: rotates (or reflects) the space, stretches it along the axes by the singular values, and rotates it again. A circle always lands on an ellipse whose half-axes are the 's.
04Predict
Your turn: how many pieces does a letter need?
Make 5 predictions: step forward and answer each question before the next step plays.
0 of 5 made05Try it
Compare pictures
Switch between the pictures and watch the bar chart of singular values:
- Plus sign and gradient: two pieces and the picture is exact. One is huge and the other tiny.
- Smiley and letter A: curves and diagonals need more pieces, but the 's still fall fast.
- Random noise: the 's fall slowly, so ten pieces still look like mush. Noise has no shared structure to find.
06Check yourself
Check yourself
Question 1 of 5
How many numbers does one rank-1 piece σ·u·vᵀ of a 24 × 24 picture take to store?
Your answer comes back in Review in a few days, so it sticks.
Question 2 of 5
A white picture with one full-width black stripe across it. What is its rank?
Question 3 of 5
You keep the first k pieces. What is the squared error ‖A − Aₖ‖²?
Question 4 of 5
Why does random noise compress so badly?
Question 5 of 5
A 24 × 24 picture is stored as its first 3 SVD pieces. What exactly is stored?
07Explain it back
Say it in your own words
How does the SVD compress a picture, and why does keeping the pieces with the largest singular values work so well?
08Recap
What to remember
- Any matrix is a sum of rank-1 pieces , sorted by singular value.
- The first pieces are the best rank- approximation; the error is the dropped 's.
- Fast-falling 's mean structure you can compress; flat ones mean noise.
- Geometrically, every matrix rotates, stretches along axes, and rotates again.