I want to make sure I understood the concept behind SVD for image compression.

So, we start off with a rectangular $m \times n$ matrix that stores all the pixel values of the image. We then compute the SVD of this matrix to get two orthogonal matrices that contain information about the rows and the columns of the original matrix and a diagonal matrix which contains singular values that determine the importance of each rank-$1$ matrix. We then truncate some of the rank-$1$ matrices if their corresponding coefficient in the diagonal matrix is below some threshold value. Say, the number of modes is $k$, the total number of values we need to keep track of will be $k(m + n +1)$.

But once we need to reconstruct the image , we'll have to multiply the three matrices together resulting in a $m \times n$ matrix again.

So, the image is represented as the $3$ matrices in memory but when we want to view the image, only then, does the processor reconstructs the image from the $3$ matrices. Otherwise, the image is just saved in the form of $3$ matrices to save memory.

  • 1
    $\begingroup$ You may want to take a look at this. $\endgroup$ – Rodrigo de Azevedo May 6 at 7:38
  • $\begingroup$ Saving three matrices instead of one does not save space, does it ? $\endgroup$ – Yves Daoust May 6 at 9:51
  • $\begingroup$ It does, right? Instead of saving m x n bytes you're storing k(m +n + 1) bytes $\endgroup$ – Sathvik Swaminathan May 6 at 10:06

The SVD decomposes a matrix as a weighted sum of matrices which are themselves outer product of two vectors. Hence you trade $mn$ coefficients for $k(m+n)$, where $k$ is the number of weights retained.

For compression to be effective,

$$k(m+n)\ll mn$$ must hold.

| cite | improve this answer | |
  • $\begingroup$ Also, 3 matrices are stored in memory, right? $\endgroup$ – Sathvik Swaminathan May 6 at 10:17
  • $\begingroup$ @FreeRadical: I am not sure you followed my comments. Or you confuse matrix and vector. $\endgroup$ – Yves Daoust May 6 at 10:19
  • $\begingroup$ I read your comments. It mentions that using SVD, we trade mn coefficients for k(m+n) coefficients meaning that we actually store the values in the orthogonal and diagonal matrices and not the values in the reconstructed matrix because that'd again result in mn coefficients. Just want to make sure I understood it right. $\endgroup$ – Sathvik Swaminathan May 6 at 10:25
  • 1
    $\begingroup$ @FreeRadical: the purpose of compression is to save storage space. This should answer your question. $\endgroup$ – Yves Daoust May 6 at 10:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.