Applications: Image Processing and Statistics
Principal component analysis diagonalizes the covariance matrix of a data set, producing uncorrelated variables ordered by variance. The leading components capture most of the variation, which reduces dimension, compresses images through low-rank SVD approximation, and connects directly to the singular values of the data matrix.
╌╌╌╌
Principal component analysis applies the singular value decomposition and the Spectral Theorem to multivariate data: a collection of objects, each described by several measurements, so each datum is a vector in . PCA finds new coordinates in which the measurements are uncorrelated and sorted by decreasing variance, then discards the coordinates with little variance.
For example, a chemical plant might test each of plastic samples on eight properties: melting point, density, tensile strength, and so on. Each report is a vector in , and the set forms an matrix of observations. A satellite image measured in three spectral bands assigns each pixel a vector in ; a two-megapixel image is then a matrix. The dimension that PCA reduces is the number of measurements per object, not the number of objects.
Mean, deviation, and covariance
Let be a matrix of observations. The sample mean is the average vector
the center of the data cloud. Subtracting it recenters every observation: , and the matrix is said to be in mean-deviation form, with zero mean.
Because has the form , it is symmetric and positive semidefinite: . Its entries carry the spread and coupling of the measurements:
- Variances on the diagonal. The entry is the variance of the -th measurement — how widely the -th coordinate ranges over the data.
- Covariances off the diagonal. The entry () is the covariance of measurements and . When the two are uncorrelated.
- Total variance is the trace , the sum of the individual variances.
Analysis is easiest when the covariance matrix is diagonal, meaning all measurements are mutually uncorrelated; PCA produces exactly this.
Principal component analysis
PCA looks for an orthogonal change of variable that decorrelates the data. With the observations in mean-deviation form, find an orthogonal giving new coordinates , equivalently , so that the new variables are uncorrelated and ordered by decreasing variance. The covariance matrix of the transformed data is , and making it diagonal is orthogonal diagonalization of .
Since is symmetric, the Spectral Theorem supplies the diagonalizing . The eigenvalue is the variance of the new variable , and the -th principal component defines that variable as a weighted combination of the originals: if has entries , then
The weights are the entries of the eigenvector, and has the largest variance any unit-weighted combination can achieve. This last claim is the extreme-values-on-the-unit-sphere theorem of the constrained optimization lesson: for a unit vector , the variance of is , whose maximum over unit is the top eigenvalue , attained at . Each later component maximizes variance subject to being uncorrelated with the ones before.
Multispectral imaging
Reducing dimension
An orthogonal change of variable preserves total variance, because does not change lengths: . So the variance is redistributed across the new variables,
and the fraction of total variance captured by is . When a few eigenvalues dominate, the corresponding components describe most of the data.
For the Railroad Valley image, the total variance is , split as
| Component | Eigenvalue | Fraction of variance |
|---|---|---|
| First | ||
| Second | ||
| Third |
The first component alone holds of the variation, so a single grayscale image displays almost all the information the three bands carry. The third component is nearly constant across the scene; the data effectively lie in a plane, and largely along one line within it. Three-dimensional data has been compressed to essentially one dimension with a loss.
The SVD route
Diagonalizing directly is not the preferred computation. Forming squares the data, magnifying errors, the same hazard noted for in the SVD lesson. Instead, run the SVD on the data matrix itself. Set
an matrix. Then , so:
- The squares of the singular values of are the eigenvalues of , hence the variances of the principal components.
- The right singular vectors of are the eigenvectors of , hence the principal components themselves.
Computing the SVD of iteratively is faster and more accurate than an eigenvalue decomposition of , and the gap widens with dimension. For a hyperspectral image with bands, PCA runs in seconds this way. The numerical SVD lesson develops the algorithm.
Low-rank approximation and compression
The rank-one expansion orders the pieces of by singular value, so truncating after terms,
gives the best rank- approximation of : no other rank- matrix is closer in either the operator or Frobenius norm. Image compression uses this truncation directly. A grayscale image is an matrix of pixel intensities; storing it in full takes numbers. Storing takes only : the singular values, plus vectors of length and of length . When the singular values decay quickly, a small reconstructs the image with little visible loss at a fraction of the storage.
The choice of is read off the singular value spectrum: keep enough terms to capture a target fraction of the total energy , and drop the tail where the singular values are negligible. The same truncation denoises, since noise usually spreads across the small singular values that get discarded.
The ratio of largest to smallest retained singular value is the condition number, a measure of how close the matrix sits to rank-deficiency and how sensitive its inverse problems are. PCA itself is equivalent to orthogonal regression: the line through the mean along minimizes the sum of squared perpendicular distances to the data.
╌╌ END ╌╌