Singular Value Decomposition Explained: Math + Applications

Flowchart of SVD: Factorization of Matrix into rotation scaling and rotation
Title: Geometric Interpretation of Singular Value Decomposition: Visualizing the Factorization of Matrix M into Sequential Steps of Rotation (VTV^T), Scaling (Σ\Sigma), and Rotation (UU).
Source: AIML.com Research

Introduction

Singular Value Decomposition (SVD) is one of the most powerful and universally used algorithms in linear algebra. At its core, SVD is a factorization technique: it takes a complex, messy matrix of data and breaks it down into three simpler, distinct component matrices. You can think of SVD as a prism for data. Just as a prism takes white light and separates it into a clear spectrum of colors, SVD takes a dataset, represented by a numerical matrix,  and separates it into its fundamental mathematical constituents.

While it is often hidden behind the scenes, SVD is the engine powering many technologies we use daily. Whether it is a recommender system guessing which movie you want to watch next, or a compression algorithm making an image file small enough to email, SVD is likely involved. It allows computers to filter out noise and focus on the most important “signals” within a dataset, making it an essential tool for dimensionality reduction and feature extraction.

The Mathematics

To understand how SVD works, we must look at linear algebra. Any matrix MM (which represents our data, such as an image or a table of user ratings) can be decomposed into the product of three specific matrices. Mathematically, this relationship is expressed as:

M=UΣVTM = U\Sigma V^T

UU (Left Singular Vectors): The columns of UU define orthonormal directions of variation in sample space. When scaled by the singular values in Σ\Sigma , it tells us where each image lies in a lower-dimensional feature space. Images with similar rows in UΣU\Sigma are similar in the sense captured by the dominant modes of variation.

Σ\Sigma (Singular Values): The diagonal entries of  Σ\Sigma measure the strength of each mode. Larger values correspond to dominant structure, while smaller ones often capture noise or redundancy.

VTV^T (Right Singular Vectors): The rows of VTV^T (columns of VV) form an orthonormal basis in feature space. When features are pixels, these vectors can be interpreted as eigen-images, which are fundamental patterns whose weighted combinations reconstruct the dataset.

Geometrically, you can visualize this process as a sequence of three transformations applied to space: a rotation (VTV^T), a scaling operation (Σ\Sigma), and another rotation (UU). SVD reveals that any linear transformation, no matter how complex, is really just a combination of rotating and stretching space. 

Visualization of matrix multiplication form in SVD.
Title: Visualization of the matrix multiplications in singular value decomposition. Here, V∗V^* is another expression of VTV^T, meaning the conjugate transpose of VV
Source: Wikipedia

Dimensionality Reduction and Truncated SVD

The true power of SVD lies in the concept of Truncated SVD. Because the singular values in Σ\Sigma are sorted by importance, we can discard the smaller values without losing much information. By keeping only the top kk singular values (and their corresponding vectors in UU and VTV^T), we create a compressed approximation of the original matrix.

This is fundamentally how noise reduction and data compression work. If you have a high-resolution photo, SVD can identify that 90% of the visual data is contained in just the top 10% of the singular values. By reconstructing the image using only those top components, you get a recognizable image that takes up a fraction of the memory. This process transforms a massive, unmanageable dataset into a smaller, cleaner version that retains the most significant patterns.

Application in Computer Vision: Epipolar Geometry

Beyond data compression, SVD is critical in geometric computer vision, specifically in the 8-point algorithm used to estimate the Fundamental Matrix (F). The Fundamental Matrix captures the geometric relationship between two stereo images, defining how a point in one image relates to a line in the other (the epipolar line).

Steps to solve Fundamental Matrix

SVD solves this problem in two distinct steps: (a) Solving the Linear System, and (b) Enforcing the Risk Constraint

Solving the Linear System:

Each pair of corresponding points (x,x′)(x, x’) gives us a linear equation x′TFx=0x’^TFx = 0. With 8 or more points, we can stack these into a matrix equation Mf=0Mf = 0. To find the solution that minimizes error (least squares), we perform SVD on the matrix MM. When we decompose MM into UΣVTU \Sigma V^{T}, the diagonal matrix Σ\Sigma contains scaling factors (singular values) sorted from largest to smallest. To minimize the final result, we must align our vector with the direction where MM exerts the least “stretch” or energy. That direction is strictly defined by the singular vector associated with the smallest singular value (σmin⁡\sigma_{\min}) . Therefore, in short, the solution vector ff is simply the right singular vector in VV corresponding to the smallest singular value. This effectively finds the direction where the data has the least variance, which corresponds to the solution space.

Python
import numpy as np
# A is our constructed matrix from 8+ point correspondences (Nx9)
U, S, Vh = np.linalg.svd(A)
# Vh is the transpose of V (different from MATLAB which returns V directly).
# The last row of Vh corresponds to the last column of V,
# which is the vector associated with the SMALLEST singular value.
F_vector = Vh[-1, :]
# We reshape the 9-element vector back into a 3x3 matrix because
# F is mathematically defined as a 3x3 transformation matrix.
# Input:  [f1, f2, f3, f4, f5, f6, f7, f8, f9] (Shape: 9,)
# Output: [[f1, f2, f3],
#          [f4, f5, f6],
#          [f7, f8, f9]] (Shape: 3,3)
F = np.reshape(F_vector, (3, 3))

Enforcing the Rank Constraint:

Theoretically, the Fundamental Matrix must have a determinant of zero (det(M)=0det(M) = 0), meaning it is rank-deficient. Specifically, it must be Rank 2, meaning it has only two independent columns (unlike a full Rank 3 matrix which describes a general 3D transformation). However, due to noise in the image points, our initial estimate from Step 1 will likely be full rank (Rank 3). We use SVD a second time to force this constraint. By decomposing the estimated matrix FF into UΣVTU\Sigma V^T, we can manually set the smallest singular value in Σ\Sigma to zero and reconstruct the matrix. This creates the closest possible valid Fundamental Matrix to our noisy estimate.

Python
U, S, Vh = np.linalg.svd(F)
# Force the Rank 2 constraint
S[-1] = 0 # set the smallest singular value (the 3rd one) to 0
# Reconstruct the matrix using the cleaned singular values
# The @ symbol represents matrix multiplication in Python
F_final = U @ np.diagflat(S) @ Vh

Note: It is important to remember that this estimation method becomes degenerate if the scene being observed is purely planar (flat). “Degenerate” in this mathematical context means the data lacks the complexity required to solve the problem uniquely; the equations become redundant because the points lie on a single 2D plane rather than in 3D space. In such cases, the geometry collapses, and alternative models (like homographies) must be used.

Conclusion

Singular Value Decomposition is far more than a theoretical concept in linear algebra; it is a fundamental prism through which we can understand and manipulate complex data. By decomposing a matrix into interpretable steps of rotation and scaling (M=UΣVTM = U\Sigma V^T), SVD allows us to separate signal from noise and isolate the most critical features of a dataset.

As we have seen, this is a powerful technique. In dimensionality reduction, it powers efficient data compression by identifying and retaining only the most significant singular values. In computer vision, it serves as a robust solver for geometric problems, such as estimating the Fundamental Matrix, by minimizing error in the least-squares sense and enforcing rank constraints. Whether for simplifying massive datasets or solving precise geometric equations, mastering SVD provides the mathematical intuition necessary to tackle some of the most challenging problems in machine learning and engineering.

Video Explanation

  • This video “Singular Value Decomposition – 5 Minutes with Cyrill” provides a detailed exploration of the mathematical foundations of SVD. It is excellent for grasping the core theoretical concepts behind the decomposition. (Runtime: 5 mins).
YouTube video
Singular Value Decomposition – 5 Minutes with Cyrill by Cyrill Stachniss on Youtube
  • This video “SVD Visualized, Singular Value Decomposition explained | SEE Matrix , Chapter 3 #SoME2” explains the overview of SVD and its application with visualization. It’s good for people who want to study more mathematical background and application. (Runtime: 16 mins) 
YouTube video
SVD Visualized, Singular Value Decomposition explained | SEE Matrix , Chapter 3 #SoME2 by Visual Kernel on Youtube

Reference

  1. Singular value decomposition.
  2. CS1430 slides, Brown University

Related Article

Author

Help us improve this post by suggesting in comments below:

– modifications to the text, and infographics
– video resources that offer clear explanations for this question
– code snippets and case studies relevant to this concept
– online blogs, and research publications that are a “must read” on this topic

Leave the first comment

Partner Ad
Find out all the ways that you can
Contribute