The results you're observing stem from the intrinsic mechanics of Principal Component Analysis (PCA) as a dimensionality reduction technique when applied to the domain of facial images.
PCA works by finding a new set of orthogonal axes (principal components) that capture the directions of maximum variance in the data. The first principal component captures the most variance, the second captures the next most (under the constraint of being orthogonal to the first), and so on.
When you perform PCA on a set of facial images, each image is treated as a high-dimensional point in a space where each dimension corresponds to the intensity of a pixel. Before PCA can be applied effectively, it's important to "center" this high-dimensional data by subtracting the global mean, which is the average face in your dataset.
Subtracting the mean serves two main purposes:
-
Centering the Data: By removing the average, you effectively translate the dataset so that the mean is at the origin of the coordinate system. This ensures that PCA's resultant principal components reflect variations from a common reference point, allowing it to identify patterns of deviation (such as facial features differing from the average face) more effectively.
-
Numerical Stability: Centering can also lead to improved numerical stability by preventing the data from having large variance simply due to significant differences in the absolute magnitude of pixel values.
As for the reconstruction process, PCA allows you to approximate the original images by a linear combination of the top principal components (eigenfaces) and the mean face. The eigenfaces represent the principal axes of variation in the face dataset, with the first few capturing the most prevalent features across all faces.
When you reconstruct the images using all the principal components (PC=400 in your case), you effectively use the entire set of eigenfaces, which allows you to recreate the original images perfectly. In this case, omitting the mean would make all reconstructions appear off-centered or distorted since you removed that mean reference during the initial projection step.
When you reduce the number of principal components, you only capture the most significant axes of variance in the face data. With PC=200, you're using only half of the total principal components. This means you're approximating the original faces using less information, leading to blur and some level of distortion. This occurs because you're capturing less of the unique variances that differentiate one face from another.
With even fewer principal components (PC=50), you are retaining only the most dominant features shared across the dataset. The result is a significant loss of individual facial characteristics that make each face unique, resulting in more pronounced blur and more substantial discrepancies from the original faces.
Adding the global mean back during reconstruction is crucial because it restores the overall brightness and general facial structure that was common across all the original images. Without adding back this mean, the reconstructed images cannot accurately represent the original data; they become abstract versions that lack the characteristic baseline upon which the individual variances (captured by the principal components) are superimposed.
In essence, by removing the global mean, you normalize the face dataset around a common reference, enabling PCA to detect meaningful patterns in facial features. By adding it back during reconstruction, you re-introduce the basic structure of a face to the weighted sum of eigenfaces that contains the peculiarities uncovered by PCA.