Learning goals: students learn to use the SVD to find good approximations to matrices and to compute the pseudoinverse.

Similar documents
Singular Value Decompsition

Singular Value Decomposition and Digital Image Compression

Singular Value Decomposition

6 The SVD Applied to Signal and Image Deblurring

8 The SVD Applied to Signal and Image Deblurring

8 The SVD Applied to Signal and Image Deblurring

Image Compression. 1. Introduction. Greg Ames Dec 07, 2002

Image Compression Using the Haar Wavelet Transform

Linear Algebra Review. Fei-Fei Li

Conceptual Questions for Review

Singular Value Decomposition. 1 Singular Value Decomposition and the Four Fundamental Subspaces

Lecture 6 Positive Definite Matrices

Maths for Signals and Systems Linear Algebra in Engineering

Singular Value Decomposition

Singular Value Decomposition

1 Linearity and Linear Systems

Image Compression Using Singular Value Decomposition

UNIT 6: The singular value decomposition.

Linear Algebra Review. Fei-Fei Li

Lecture: Face Recognition and Feature Reduction

MITOCW ocw f99-lec31_300k

4 ORTHOGONALITY ORTHOGONALITY OF THE FOUR SUBSPACES 4.1

Linear Algebra, part 3 QR and SVD

Dimensionality Reduction: PCA. Nicholas Ruozzi University of Texas at Dallas

Linear Algebra, part 3. Going back to least squares. Mathematical Models, Analysis and Simulation = 0. a T 1 e. a T n e. Anna-Karin Tornberg

What is Image Deblurring?

Information Retrieval

Exercise Sheet 1. 1 Probability revision 1: Student-t as an infinite mixture of Gaussians

The Singular Value Decomposition

Lecture: Face Recognition and Feature Reduction

The Haar Wavelet Transform: Compression and. Reconstruction

MIT Final Exam Solutions, Spring 2017

The Singular Value Decomposition (SVD) and Principal Component Analysis (PCA)

Math Fall Final Exam

(a) If A is a 3 by 4 matrix, what does this tell us about its nullspace? Solution: dim N(A) 1, since rank(a) 3. Ax =

COMP 558 lecture 18 Nov. 15, 2010

. = V c = V [x]v (5.1) c 1. c k

Singular Value Decomposition (SVD)

GAUSSIAN ELIMINATION AND LU DECOMPOSITION (SUPPLEMENT FOR MA511)

22A-2 SUMMER 2014 LECTURE 5

Singular Value Decomposition: Compression of Color Images

The Haar Wavelet Transform: Compression and Reconstruction

Applications of Singular-Value Decomposition (SVD)

Linear Algebra Section 2.6 : LU Decomposition Section 2.7 : Permutations and transposes Wednesday, February 13th Math 301 Week #4

Notes on singular value decomposition for Math 54. Recall that if A is a symmetric n n matrix, then A has real eigenvalues A = P DP 1 A = P DP T.

B553 Lecture 5: Matrix Algebra Review

Solution Set 3, Fall '12

1. Background: The SVD and the best basis (questions selected from Ch. 6- Can you fill in the exercises?)

Linear Least Squares. Using SVD Decomposition.

Chapter 3: Theory Review: Solutions Math 308 F Spring 2015

The Singular Value Decomposition and Least Squares Problems

Linear Algebra Primer

2.3. Clustering or vector quantization 57

Linear Systems. Carlo Tomasi. June 12, r = rank(a) b range(a) n r solutions

Linear algebra for MATH2601: Theory

18.06 Problem Set 10 - Solutions Due Thursday, 29 November 2007 at 4 pm in

The SVD-Fundamental Theorem of Linear Algebra

Karhunen-Loève Transform KLT. JanKees van der Poel D.Sc. Student, Mechanical Engineering

Stat 159/259: Linear Algebra Notes

Linear Algebra and Eigenproblems

IV. Matrix Approximation using Least-Squares

Dimensionality Reduction

SINGULAR VALUE DECOMPOSITION

Getting Started with Communications Engineering

Linear Algebra Methods for Data Mining

Lecture 5: Web Searching using the SVD

L2-7 Some very stylish matrix decompositions for solving Ax = b 10 Oct 2015

Matrix Algebra. Learning Objectives. Size of Matrix

Multiplying matrices by diagonal matrices is faster than usual matrix multiplication.

7.6 The Inverse of a Square Matrix

Singular Value Decomposition

13 Searching the Web with the SVD

9 Searching the Internet with the SVD

COMP6237 Data Mining Covariance, EVD, PCA & SVD. Jonathon Hare

Roberto s Notes on Linear Algebra Chapter 9: Orthogonality Section 2. Orthogonal matrices

be a Householder matrix. Then prove the followings H = I 2 uut Hu = (I 2 uu u T u )u = u 2 uut u

Linear Systems. Carlo Tomasi

Computational Methods. Eigenvalues and Singular Values

CS168: The Modern Algorithmic Toolbox Lecture #10: Tensors, and Low-Rank Tensor Recovery

Structured matrix factorizations. Example: Eigenfaces

Numerical Methods for Inverse Kinematics

MAT 343 Laboratory 6 The SVD decomposition and Image Compression

Machine Learning (Spring 2012) Principal Component Analysis

LEC 2: Principal Component Analysis (PCA) A First Dimensionality Reduction Approach

ANSWERS. E k E 2 E 1 A = B

Pseudoinverse & Moore-Penrose Conditions

Bindel, Fall 2009 Matrix Computations (CS 6210) Week 8: Friday, Oct 17

Matrix Arithmetic. j=1

Matrix-Product-States/ Tensor-Trains

Math 240 Calculus III

Properties of Matrices and Operations on Matrices

Linear Least-Squares Data Fitting

Numerical Methods. Elena loli Piccolomini. Civil Engeneering. piccolom. Metodi Numerici M p. 1/??

Extraction of Individual Tracks from Polyphonic Music

Quick Introduction to Nonnegative Matrix Factorization

Computational Methods CMSC/AMSC/MAPL 460. EigenValue decomposition Singular Value Decomposition. Ramani Duraiswami, Dept. of Computer Science

Stat 206: Linear algebra

Large Scale Data Analysis Using Deep Learning

Introduction to SVD and Applications

Math 102, Winter Final Exam Review. Chapter 1. Matrices and Gaussian Elimination

Transcription:

Application of the SVD: Compression and Pseudoinverse Learning goals: students learn to use the SVD to find good approximations to matrices and to compute the pseudoinverse. Low rank approximation One use of the SVD is to approximate a matrix by one of low rank. One way of looking at the product UΣV T gives!! σ 1 " v 1 "!! " σ 1 v 1 " u 1 " u m σ 2! = u 1 " u m!!! # " v n "!! " σ n v n " which multiples out in the column-times-row picture as σ 1 u 1 v T 1 + σ 2 u 2 v T 2 +! + σ r u r v T r where r is the rank of A (the σ beyond this are all zero). This is a sum of rank one matrices. Now since the σ are in decreasing order, and the u s and v s are all unit vectors, these rank one matrices are written in decreasing order of size (at least in one way of measuring size of a matrix). So if we want a low-rank approximation to A we should just stop this sum after a few terms. The first term tells us about the single direction that gets magnified the most by the matrix A; the second tells us about the direction that gets magnified second most, and so on. SVD image compression We can use this to our advantage. A digitized picture is essentially just a big matrix of numbers. For instance, these could be the gray-levels in a black-and-white image, or the color levels in a color image. Let s say our image is 1000 2000 pixels. That requires 2 million numbers. But if the picture could be accurately approximated by, say, a ten term SVD decomposition we would only have to store 10 u s (10000 numbers), 10 v s (20000 numbers) and 10 σ s (10 numbers). Our storage costs drop to just over 30000, for a compression ration of over 650 : 1. Here is an example: (original image 480 640, 256 gray levels, 307,200 bytes)

Next I used Mathematica to compute the singular value decomposition of the underlying matrix of numbers. When I keep just one term approximating the matrix with a rank one matrix, here is the result (480 + 640 bytes for the vectors, 4 bytes for the singular value (which will be a real number), total 1124 bytes for a compression ratio of over 273 : 1) Can t really see much, although you can see the light and dark patches where the children are wearing lighter-colored clothes. Let s try two terms (compression ratio over 136 : 1) Still no good, really. It s like looking through distortion glass. We can look at the error (true picture approximation) and it looks like the image on the right. In the difference, you can clearly make out the children even though they re kind of ghostly (appropriate for the Halloween picture, no?). So we ll up the number of terms we use.

Trying ten terms (compression ratio now about 27 : 1) gives us Now the picture is clearly discernable, though still quite distorted. The error picture is getting harder to make out, but still clearly shows the kids outlines. Next, we try 30 terms (compression ratio of about 9 : 1) The error picture is now almost all black, so is very hard to see. The picture looks pretty good a little blocky as if taken by a low-resolution camera, but clearly discernable. Finally, we try 90 terms (compression ratio 3 : 1)

Now we re nearly perfect. Compression is small (only 3 : 1) but we get a very good picture and still some substantial savings. Note that the bar of light color across the top is not an error or artifact of the technique go back and check that it was in the original picture. Now while this is a nifty idea, it is not as good a picture compression scheme as some other techniques out there. The discrete cosine transform (DCT) is related to the fast Fourier transfor (FFT) so can be done fast, is used for JPEG image files and it can achieve compression ratios of around 20 : 1 with very good image quality. Wavelets are used in other image formats (JPEG2000). Some wavelet schemes can produce compression of upward of 100 : 1 without perceptible image distortion. Web searching Search engines like Google use enormous matrices of cross-references which pages link to which other pages, and what words are on each page. When you do a Google search, the higher ranks usually go to pages with your key words that have lots of links to them. But there are billions of pages out there, and storing a billion by billion matrix is trouble, not to mention searching through it. Here is where SVD shines. In searching, you really only care about the main directions that the Web is taking. So the first few singular values create a very good approximation for the enormous matrix, can be searched relatively quickly (just a few billion entires) and provide compression ratios of millions to one. The proof is in the pudding Google works. The pseudoinverse In an entirely different direction, the SVD can give us the best we can do toward inverting an arbitrary, even non-square, matrix. Note that A sends the row space to the column space in an invertible fashion, while the nullspace gets sent to 0. The best we could hope for is to send the column space back to where it came from in the row space, and perhaps send the left nullspace to 0. But that is easy with the SVD! Since we sent the basis vector v i to σ I u i, we ought to send the basis vector u i back to (1/σ I )v i. But from our description of the matrices U, V and Σ this can be done by using the matrix A + = VΣ + U T, where Σ + is simply the transposed Σ with its nonzero entries reciprocated.

Definition: if A has SVD UΣV T, then its pseudoinverse is the matrix A + = VΣ + U T. (Note, however, that this is NOT the SVD for the pseudoinverse, because the entries in the singular value matrix would be in increasing order.) As advertised, if x is in the row space, and y = Ax, then x = A + y. For x = a 1 v 1 +! + a r v r, and v i T x = a i. Thus V T x = (a 1, a 2,, a r, 0,, 0). The zeroes are there because x is in the row space, which is orthogonal to the nullspace, and the last few rows of V T contain basis vectors for the nullspace. Thus y = UΣ(a 1,, a r, 0,, 0) = U(σ 1 a 1,, σ r a r, 0,, 0) = σ 1 a 1 u 1 +! + σ r a r u r. Multiplying this by A + = VΣ + U T reverses this to recover x. Corollary: if A is actually invertible, the A + = A 1. For now A is n n with rank n. Thus U, V and Σ are all n n with rank r. In particular, Σ is a diagonal matrix with no zero entries on the diagonal, and so Σ + really is its inverse. Thus A + = VΣ + U T = VΣ 1 U 1 = (UΣV 1 ) 1 = A 1. Corollary: the shortest least squares solution to Ax = y (that is, the solution to A T Ax = A T y ) is given by x = A + y. It is shortest because it is purely in the rowspace (which is the column space of A + ). The pseudoinverse automatically drops the leftnullspace portion of y, and finds the row space solution to the normal equation. Reading: 6.7, 7.3 (p. 403 405) Problems: 6.7: 1 4, 6, 7, 9, 10, 11, 12, 13, 15, given A with SVD UΣV T, find the SVD for a) 4A, b) A T, c) A 1 7.3: 1 6, 7, 15, 16, 17, 18