1 / 16

CSSE463: Image Recognition Day 26

Explore the applications of PCA for image recognition, focusing on eigenvectors, eigenfaces, and face-space dimensionality reduction. Learn how to project points, detect faces, and interpret eigenvectors in practice.

pewitt
Download Presentation

CSSE463: Image Recognition Day 26

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSSE463: Image Recognition Day 26 • This week • Today: Applications of PCA • Weds: k-means lab due. • Sunday night: project plans and prelim work due • Questions?

  2. Principal Components Analysis • Given a set of samples, find the direction(s) of greatest variance. • We’ve done this! • Example: Spatial moments • Principal axes are eigenvectors of covariance matrix • Eigenvalues gave relative importance of each dimension • Note that each point can be represented in 2D using the new coordinate system defined by the eigenvectors • The 1D representation obtained by projecting the point onto the principal axis is a reasonably-good approximation size weight girth height

  3. Covariance Matrix (using matrix operations) Place the points in their own column. Find the mean of each row. Subtract it. Multiply N * NT You will get a 2x2 matrix, in which each entry is a summation over all n points.You could then divide by n Q1

  4. Generic process • The covariance matrix of a set of data gives the ways in which the set varies. • The eigenvectors corresponding to the largest eigenvalues give the directions in which it varies most. • Two applications • Eigenfaces • Time-elapsed photography

  5. “Eigenfaces” • Question: what are the primary ways in which faces vary? • What happens when we apply PCA? • For each face, create a column vector that contains all the pixels from that face • This is a point in a high dimensional space (e.g., 65536 for a 256x256 pixel image) • Create a matrix F of all M faces in the training set. • Subtract off the “average face”, m, to get N • Compute the rcxrc covariance matrix C = N*NT . M. Turk and A. Pentland, Eigenfaces for Recognition, J Cog Neurosci, 3(1)

  6. “Eigenfaces” • Question: what are the primary ways in which faces vary? • What happens when we apply PCA? • The eigenvectors are the directions of greatest variability • Note that these are in 65536-D; thus form a face. • This is an “eigenface” • Here’s the first 4 from the ORL face dataset. Q2-3

  7. “Eigenfaces” • Question: what are the primary ways in which faces vary? • What happens when we apply PCA? • The eigenvectors are the directions of greatest variability • Note that these are in 65536-D; thus form a face. • This is an “eigenface” • Here are the first 4 from the ORL face dataset. http://upload.wikimedia.org/wikipedia/commons/6/67/Eigenfaces.png; from the ORL face database, AT&T Laboratories Cambridge Q2-3

  8. Interlude: Projecting points onto lines • We can project each point onto the principal axis. How? size weight girth height

  9. Interlude: Projecting a point onto a line • Assuming the axis is represented by a unit vector u, we can just take the dot-product of the point p and the vector. • u*p = uTp(which is 1D) • Example: Project (5,2) onto line y=x. • If we want to project onto two vectors, u and v simultaneously: • Create w = [uv], then compute wTp, which is 2D. • Result: p is now in terms of u and v. • This generalizes to arbitrary dimensions. Q4

  10. Application: Face detection • If we want to project a point onto two vectors, u and v simultaneously: • Create w = [uv], then compute wTp, which is 2D. • Result: p is now in terms of u and v. • This generalizes to arbitrary dimensions. • You can represent a face in terms of its eigenfaces; it’s just a different basis. • The M most important eigenvectors capture most of the variability: • Ignore the rest! • Instead of 65k dimensions, we only have M (~50 in practice) • Call these 50 dimensions “face-space”

  11. “Eigenfaces” • Question: what are the primary ways in which faces vary? • What happens when we apply PCA? • Keep only the top M eigenfaces for “face space”. • We can project any face onto these eigenvectors. Thus, any face is a linear combination of the eigenfaces. • Can classify faces in this lower-D space. • There are computational tricks to make the computation feasible

  12. Time-elapsed photography • Question: what are the ways that outdoor images vary over time? • Form a matrix in which each column is an image • Find eigs of covariance matrix See example images on Dr. B’s laptop or at the link below. N Jacobs, N Roman, R Pless, Consistent Temporal Variations in Many Outdoor Scenes. IEEE Computer Vision and Pattern Recognition, Minneapolis, MN, June 2007.

  13. Time-elapsed photography • Question: what are the ways that outdoor images vary over time? • The mean and top 3 eigenvectors (scaled): • Interpretation? N Jacobs, N Roman, R Pless, Consistent Temporal Variations in Many Outdoor Scenes. IEEE Computer Vision and Pattern Recognition, Minneapolis, MN, June 2007. Q5-6

  14. Time-elapsed photography • Recall that each image in the dataset is a linear combination of the eigenimages. mean PC1 PC2 PC3 = + 4912* - 217* +393* = - 2472* + 308* +885* N Jacobs, N Roman, R Pless, Consistent Temporal Variations in Many Outdoor Scenes. IEEE Computer Vision and Pattern Recognition, Minneapolis, MN, June 2007.

  15. Time-elapsed photography • Every image’s projection onto the first eigenvector N Jacobs, N Roman, R Pless, Consistent Temporal Variations in Many Outdoor Scenes. IEEE Computer Vision and Pattern Recognition, Minneapolis, MN, June 2007.

  16. Research idea • Done: • Finding the PCs • Using to detect latitude and longitude given images from camera • Yet to do: • Classifying images based on their projection into this space, as was done for eigenfaces

More Related