Image Classification with PCA

Use principal component analysis for image classification.

← Linear Algebra projects

Learn Mathematics Linear Algebra

Question

How can an image be compressed while keeping the features needed for classification?

Goals

  • Find principal components from a collection of images.
  • Project, reconstruct, and classify images in a smaller space.

Method

Replace thousands of pixel values with a few directions that explain the most variation.

  • Turn each image into a vector, center the data, and compute a covariance matrix or SVD.
  • Keep the leading eigenvectors and project every image onto them.
  • Train a simple classifier and measure how the number of components affects accuracy.