Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

stough 202-

Preview: Spanning PCA dimensions.

In this visualization, we sort all the faces by their coefficient in the 0th (most important) pca dimension. Then we just loop over them.

Second, we also show the abstract ‘face’ ±2σ\pm 2\sigma in the 0th pc.

The goal is to understand what a principal component means. A component is a direction in the space of faces. Walking along it (keeping every other coefficient fixed at the average) should change faces in one consistent way. We’ll see this two ways: with real faces ordered by their coefficient, and with synthetic faces built as the mean plus a multiple of the component. See Face Space for the setup.

 

Faces sorted along the first principal component.

Expected output (what the cell above should show, if you can’t run it)
expected output

The left and right images are the faces with the lowest and highest first PCA coefficient, and the middle animates through all 400 faces in order of that coefficient, which is printed at the bottom. As it plays, notice what changes steadily from one end to the other. (Individual faces vary in many other ways at the same time, so look for the overall trend.)

 

±2σ\pm 2\sigma on PC0PC_0

makeinterp builds a synthetic face: the mean face plus coeff standard deviations along the first component, μ+w0 σ0 v0\boldsymbol{\mu} + w_0\,\sigma_0\,\mathbf{v}_0. Since nearly all real faces have coefficients within about ±2.5σ\pm 2.5\sigma, the slider’s range spans the realistic extremes. The two end faces are no particular person. They show what “more” or “less” of this component looks like, with everything else held at average.

Expected output (what the cell above should show, if you can’t run it)
expected output

Slide back and forth. For the ORL faces, the first component mostly changes how bright the face is against its background, more a matter of lighting and exposure than of who is in the photo. That’s typical: the largest variations in a set of photos are often about the photography rather than the subject, which is one reason eigenface recognizers often skip the first few components. Try changing [0] to [1] or [2] in makeinterp and the face definitions, to explore the next components. You’ll find mixtures of lighting direction, hairline, glasses, and head position. Unlike the measurements of the Iris flowers, face components rarely have clean names.