Recent from talks
Nothing was collected or created yet.
Eigenface
View on Wikipedia
An eigenface (/ˈaɪɡən-/ EYE-gən-) is the name given to a set of eigenvectors when used in the computer vision problem of human face recognition.[1] The approach of using eigenfaces for recognition was developed by Sirovich and Kirby and used by Matthew Turk and Alex Pentland in face classification.[2][3] The eigenvectors are derived from the covariance matrix of the probability distribution over the high-dimensional vector space of face images. The eigenfaces themselves form a basis set of all images used to construct the covariance matrix. This produces dimension reduction by allowing the smaller set of basis images to represent the original training images. Classification can be achieved by comparing how faces are represented by the basis set.
History
[edit]The eigenface approach began with a search for a low-dimensional representation of face images. Sirovich and Kirby showed that principal component analysis could be used on a collection of face images to form a set of basis features.[2] These basis images, known as eigenpictures, could be linearly combined to reconstruct images in the original training set. If the training set consists of M images, principal component analysis could form a basis set of N images, where N < M. The reconstruction error is reduced by increasing the number of eigenpictures; however, the number needed is always chosen less than M. For example, if you need to generate a number of N eigenfaces for a training set of M face images, you can say that each face image can be made up of "proportions" of all the K "features" or eigenfaces: Face image1 = (23% of E1) + (2% of E2) + (51% of E3) + ... + (1% En).
In 1991 M. Turk and A. Pentland expanded these results and presented the eigenface method of face recognition.[3] In addition to designing a system for automated face recognition using eigenfaces, they showed a way of calculating the eigenvectors of a covariance matrix such that computers of the time could perform eigen-decomposition on a large number of face images. Face images usually occupy a high-dimensional space and conventional principal component analysis was intractable on such data sets. Turk and Pentland's paper demonstrated ways to extract the eigenvectors based on matrices sized by the number of images rather than the number of pixels.
Once established, the eigenface method was expanded to include methods of preprocessing to improve accuracy.[4] Multiple manifold approaches were also used to build sets of eigenfaces for different subjects[5][6] and different features, such as the eyes.[7]
Generation
[edit]A set of eigenfaces can be generated by performing a mathematical process called principal component analysis (PCA) on a large set of images depicting different human faces. Informally, eigenfaces can be considered a set of "standardized face ingredients", derived from statistical analysis of many pictures of faces. Any human face can be considered to be a combination of these standard faces. For example, one's face might be composed of the average face plus 10% from eigenface 1, 55% from eigenface 2, and even −3% from eigenface 3. Remarkably, it does not take many eigenfaces combined together to achieve a fair approximation of most faces. Also, because a person's face is not recorded by a digital photograph, but instead as just a list of values (one value for each eigenface in the database used), much less space is taken for each person's face.
The eigenfaces that are created will appear as light and dark areas that are arranged in a specific pattern. This pattern is how different features of a face are singled out to be evaluated and scored. There will be a pattern to evaluate symmetry, whether there is any style of facial hair, where the hairline is, or an evaluation of the size of the nose or mouth. Other eigenfaces have patterns that are less simple to identify, and the image of the eigenface may look very little like a face.
The technique used in creating eigenfaces and using them for recognition is also used outside of face recognition: handwriting recognition, lip reading, voice recognition, sign language/hand gestures interpretation and medical imaging analysis. Therefore, some do not use the term eigenface, but prefer to use 'eigenimage'.
Practical implementation
[edit]To create a set of eigenfaces, one must:
- Prepare a training set of face images. The pictures constituting the training set should have been taken under the same lighting conditions, and must be normalized to have the eyes and mouths aligned across all images. They must also be all resampled to a common pixel resolution (r × c). Each image is treated as one vector, simply by concatenating the rows of pixels in the original image, resulting in a single column with r × c elements. For this implementation, it is assumed that all images of the training set are stored in a single matrix T, where each column of the matrix is an image.
- Subtract the mean. The average image a has to be calculated and then subtracted from each original image in T.
- Calculate the eigenvectors and eigenvalues of the covariance matrix S. Each eigenvector has the same dimensionality (number of components) as the original images, and thus can itself be seen as an image. The eigenvectors of this covariance matrix are therefore called eigenfaces. They are the directions in which the images differ from the mean image. Usually this will be a computationally expensive step (if at all possible), but the practical applicability of eigenfaces stems from the possibility to compute the eigenvectors of S efficiently, without ever computing S explicitly, as detailed below.
- Choose the principal components. Sort the eigenvalues in descending order and arrange eigenvectors accordingly. The number of principal components k is determined arbitrarily by setting a threshold ε on the total variance. Total variance , n = number of components, and represents component eigenvalue.
- k is the smallest number that satisfies
These eigenfaces can now be used to represent both existing and new faces: we can project a new (mean-subtracted) image on the eigenfaces and thereby record how that new face differs from the mean face. The eigenvalues associated with each eigenface represent how much the images in the training set vary from the mean image in that direction. Information is lost by projecting the image on a subset of the eigenvectors, but losses are minimized by keeping those eigenfaces with the largest eigenvalues. For instance, working with a 100 × 100 image will produce 10,000 eigenvectors. In practical applications, most faces can typically be identified using a projection on between 100 and 150 eigenfaces, so that most of the 10,000 eigenvectors can be discarded.
Matlab example code
[edit]Here is an example of calculating eigenfaces with Extended Yale Face Database B. To evade computational and storage bottleneck, the face images are sampled down by a factor 4×4=16.
clear all;
close all;
load yalefaces
[h, w, n] = size(yalefaces);
d = h * w;
% vectorize images
x = reshape(yalefaces, [d n]);
x = double(x);
% subtract mean
mean_matrix = mean(x, 2);
x = bsxfun(@minus, x, mean_matrix);
% calculate covariance
s = cov(x');
% obtain eigenvalue & eigenvector
[V, D] = eig(s);
eigval = diag(D);
% sort eigenvalues in descending order
eigval = eigval(end: - 1:1);
V = fliplr(V);
% show mean and 1st through 15th principal eigenvectors
figure, subplot(4, 4, 1)
imagesc(reshape(mean_matrix, [h, w]))
colormap gray
for i = 1:15
subplot(4, 4, i + 1)
imagesc(reshape(V(:, i), h, w))
end
Note that although the covariance matrix S generates many eigenfaces, only a fraction of those are needed to represent the majority of the faces. For example, to represent 95% of the total variation of all face images, only the first 43 eigenfaces are needed. To calculate this result, implement the following code:
% evaluate the number of principal components needed to represent 95% Total variance.
eigsum = sum(eigval);
csum = 0;
for i = 1:d
csum = csum + eigval(i);
tv = csum / eigsum;
if tv > 0.95
k95 = i;
break
end;
end;
Computing the eigenvectors
[edit]Performing PCA directly on the covariance matrix of the images is often computationally infeasible. If small images are used, say 100 × 100 pixels, each image is a point in a 10,000-dimensional space and the covariance matrix S is a matrix of 10,000 × 10,000 = 108 elements. However the rank of the covariance matrix is limited by the number of training examples: if there are N training examples, there will be at most N − 1 eigenvectors with non-zero eigenvalues. If the number of training examples is smaller than the dimensionality of the images, the principal components can be computed more easily as follows.
Let T be the matrix of preprocessed training examples, where each column contains one mean-subtracted image. The covariance matrix can then be computed as S = TTT and the eigenvector decomposition of S is given by
However TTT is a large matrix, and if instead we take the eigenvalue decomposition of
then we notice that by pre-multiplying both sides of the equation with T, we obtain
Meaning that, if ui is an eigenvector of TTT, then vi = Tui is an eigenvector of S. If we have a training set of 300 images of 100 × 100 pixels, the matrix TTT is a 300 × 300 matrix, which is much more manageable than the 10,000 × 10,000 covariance matrix. Notice however that the resulting vectors vi are not normalised; if normalisation is required it should be applied as an extra step.
Connection with SVD
[edit]Let X denote the data matrix with column as the image vector with mean subtracted. Then,
Let the singular value decomposition (SVD) of X be:
Then the eigenvalue decomposition for is:
- , where Λ=diag (eigenvalues of )
Thus we can see easily that:
- The eigenfaces = the first () columns of associated with the nonzero singular values.
- The ith eigenvalue of ith singular value of (i.e., )
Using SVD on data matrix X, it is unnecessary to calculate the actual covariance matrix to get eigenfaces.
Use in facial recognition
[edit]Facial recognition was the motivation for the creation of eigenfaces. For this use, eigenfaces have advantages over other techniques available, such as the system's speed and efficiency. As eigenface is primarily a dimension reduction method, a system can represent many subjects with a relatively small set of data. As a face-recognition system it is also fairly invariant to large reductions in image sizing; however, it begins to fail considerably when the variation between the seen images and probe image is large.
To recognise faces, gallery images – those seen by the system – are saved as collections of weights describing the contribution each eigenface has to that image. When a new face is presented to the system for classification, its own weights are found by projecting the image onto the collection of eigenfaces. This provides a set of weights describing the probe face. These weights are then classified against all weights in the gallery set to find the closest match. A nearest-neighbour method is a simple approach for finding the Euclidean distance between two vectors, where the minimum can be classified as the closest subject.[3]: 590
Intuitively, the recognition process with the eigenface method is to project query images into the face-space spanned by eigenfaces calculated, and to find the closest match to a face class in that face-space.
- Pseudo code[8]
-
- Given input image vector , the mean image vector from the database , calculate the weight of the k-th eigenface as:
- Then form a weight vector
- Compare W with weight vectors of images in the database. Find the Euclidean distance.
- If , then the mth entry in the database is a candidate of recognition.
- If , then U may be an unknown face and can be added to the database.
- If is not a face image.
- Given input image vector , the mean image vector from the database , calculate the weight of the k-th eigenface as:
The weights of each gallery image only convey information describing that image, not that subject. An image of one subject under frontal lighting may have very different weights to those of the same subject under strong left lighting. This limits the application of such a system. Experiments in the original Eigenface paper presented the following results: an average of 96% with light variation, 85% with orientation variation, and 64% with size variation.[3]: 590
Various extensions have been made to the eigenface method. The eigenfeatures method combines facial metrics (measuring distance between facial features) with the eigenface representation. Fisherface uses linear discriminant analysis[9] and is less sensitive to variation in lighting and pose of the face. Fisherface uses labelled data to retain more of the class-specific information during the dimension reduction stage.
A further alternative to eigenfaces and Fisherfaces is the active appearance model. This approach uses an active shape model to describe the outline of a face. By collecting many face outlines, principal component analysis can be used to form a basis set of models that encapsulate the variation of different faces.
Many modern approaches still use principal component analysis as a means of dimension reduction or to form basis images for different modes of variation.
Review
[edit]Eigenface provides a relatively simple way to realize face recognition in that:
- Its training process is completely automatic and easy to code.
- Eigenface adequately reduces statistical complexity in face image representation.
- Once eigenfaces of a database are calculated, face recognition can be achieved in real time.
- Eigenface can handle large databases.
However, the deficiencies of the eigenface method are also obvious:
- It is very sensitive to lighting, scale and translation, and requires a highly controlled environment.
- Eigenface has difficulty capturing expression changes.
- The most significant eigenfaces are mainly about illumination encoding and do not provide useful information regarding the actual face.
To cope with illumination distraction in practice, the eigenface method usually discards the first three eigenfaces from the dataset. Since illumination is usually the cause behind the largest variations in face images, the first three eigenfaces will mainly capture the information of 3-dimensional lighting changes, which has little contribution to face recognition. By discarding those three eigenfaces, there will be a decent amount of boost in accuracy of face recognition, but other methods such as fisherface and linear space still have the advantage.
See also
[edit]References
[edit]- ^ Navarrete, Pablo; Ruiz-Del-Solar, Javier (November 2002). "Analysis and Comparison of Eigenspace-Based Face Recognition Approaches" (PDF). International Journal of Pattern Recognition and Artificial Intelligence. 16 (7): 817–830. CiteSeerX 10.1.1.18.8115. doi:10.1142/S0218001402002003. S2CID 7130804. Archived from the original (PDF) on 2017-08-10. Retrieved 2016-11-28.
- ^ a b L. Sirovich; M. Kirby (1987). "Low-dimensional procedure for the characterization of human faces". Journal of the Optical Society of America A. 4 (3): 519–524. Bibcode:1987JOSAA...4..519S. doi:10.1364/JOSAA.4.000519. PMID 3572578.
- ^ a b c d Turk, Matthew A; Pentland, Alex P (1991). "Face recognition using eigenfaces". Proceedings. 1991 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (PDF). pp. 586–591. doi:10.1109/cvpr.1991.139758. ISBN 0-8186-2148-6.
- ^ Yambor, Wendy S.; Draper, Bruce A.; Beveridge, J. Ross (2002). "Analyzing PCA-based Face Recognition Algorithms: Eigenvector Selection and Distance Measures" (PDF). Empirical Evaluation Methods in Computer Vision. Series in Machine Perception and Artificial Intelligence. Vol. 50. WORLD SCIENTIFIC. pp. 39–60. doi:10.1142/9789812777423_0003. ISBN 978-981-02-4953-3. ISSN 1793-0839.
- ^ Belhumeur, P.N.; Kriegman, D.J. (1996). "What is the set of images of an object under all possible lighting conditions?". Proceedings CVPR IEEE Computer Society Conference on Computer Vision and Pattern Recognition. pp. 270–277. doi:10.1109/cvpr.1996.517085. ISBN 0-8186-7259-5.
- ^ Burnstone, James; Yin, Hujun (2011). "Eigenlights: Recovering Illumination from Face Images". Intelligent Data Engineering and Automated Learning - IDEAL 2011. Lecture Notes in Computer Science. Vol. 6936. pp. 490–497. doi:10.1007/978-3-642-23878-9_58. ISBN 978-3-642-23877-2.
- ^ Moghaddam, B.; Wahid, W.; Pentland, A. (1998). "Beyond eigenfaces: Probabilistic matching for face recognition". Proceedings Third IEEE International Conference on Automatic Face and Gesture Recognition. pp. 30–35. doi:10.1109/afgr.1998.670921. ISBN 0-8186-8344-9.
- ^ M. Turk; A. Pentland (1991). "Eigenfaces for recognition" (PDF). Journal of Cognitive Neuroscience. 3 (1): 71–86. doi:10.1162/jocn.1991.3.1.71. PMID 23964806. S2CID 26127529.
- ^ Belhumeur, P.N.; Hespanha, J.P.; Kriegman, D.J. (July 1997). "Eigenfaces vs. Fisherfaces: recognition using class specific linear projection" (PDF). IEEE Transactions on Pattern Analysis and Machine Intelligence. 19 (7): 711–720. CiteSeerX 10.1.1.5.1467. doi:10.1109/34.598228. ISSN 0162-8828. Archived (PDF) from the original on March 29, 2018.
Further reading
[edit]- M. Kirby; L. Sirovich (1990). "Application of the Karhunen-Loeve procedure for the characterization of human faces". IEEE Transactions on Pattern Analysis and Machine Intelligence. 12 (1): 103–108. doi:10.1109/34.41390.
- A. Pentland, B. Moghaddam, T. Starner, O. Oliyide, and M. Turk. (1993). "View-based and modular Eigenspaces for face recognition". Technical Report 245, M.I.T Media Lab.
- M. H. Yang (2000). "Face recognition using kernel eigenfaces". Proceedings International Conference on Image Processing. Vol. 1. pp. 37–40. doi:10.1109/ICIP.2000.900886.
- R. Cendrillon; B. Lovell (2000). "Real-time face recognition using eigenfaces" (PDF). Visual Communications and Image Processing. pp. 269–276. doi:10.1117/12.386642.
- T. Heseltine, N. Pears, J. Austin, Z. Chen (2003). "Face Recognition: A Comparison of Appearance-Based Approaches". Proc. VIIth Digital Image Computing: Techniques and Applications, vol 1. 59–68.
- D. Pissarenko (2003). Eigenface-based facial recognition.
- F. Tsalakanidoua; D. Tzovarasb; M.G. Strintzisa (2003). "Use of depth and colour eigenfaces for face recognition". Pattern Recognition Letters. 24 (9): 1427–1435. Bibcode:2003PaReL..24.1427T. doi:10.1016/S0167-8655(02)00383-5.
- Delac, K., Grgic, M., Liatsis, P. (2005). "Appearance-based Statistical Methods for Face Recognition". Proceedings of the 47th International Symposium ELMAR-2005 focused on Multimedia Systems and Applications, Zadar, Croatia, 08-10 June 2005, pp. 151–158
External links
[edit]- Face Recognition Homepage
- PCA on the FERET Dataset
- Developing Intelligence Eigenfaces and the Fusiform Face Area
- A Tutorial on Face Recognition Using Eigenfaces and Distance Classifiers
- Matlab example code for eigenfaces
- OpenCV + C++Builder6 implementation of PCA
- Java applet demonstration of eigenfaces Archived 2011-11-01 at the Wayback Machine
- Introduction to eigenfaces
- Face Recognition Function in OpenCV
- Eigenface-based Facial Expression Recognition in Matlab Archived 2017-06-04 at the Wayback Machine
Eigenface
View on GrokipediaFundamentals
Definition and Overview
Eigenfaces are a set of orthogonal basis vectors derived from the principal components of variation in a collection of face images, serving as characteristic features for representing facial patterns. These basis vectors, known as eigenfaces, emerge from applying principal component analysis to the covariance matrix of centered face images, capturing the most significant directions of variability across the dataset.[3] Visually, eigenfaces manifest as ghostly, averaged face-like patterns, where each eigenvector is displayed as an image highlighting the relative contributions of pixel locations to the overall variation. These patterns often resemble ethereal outlines of faces, emphasizing global structural elements rather than fine details, and they inherently encode major sources of difference such as pose and lighting across the training images.[3] The core purpose of eigenfaces lies in dimensionality reduction, transforming high-dimensional face images into a compact "face space" spanned by these basis vectors, which facilitates efficient storage, comparison, and classification of facial data. By projecting images onto this lower-dimensional subspace, eigenfaces enable pattern recognition systems to focus on essential features while discarding noise and minor variations.[3] In a basic workflow, eigenfaces are generated by training on a dataset of face images to compute the principal components, after which new face images are projected onto the resulting face space to yield coordinate representations for subsequent analysis.Principal Component Analysis in Images
Principal Component Analysis (PCA) is a statistical technique used to identify patterns in high-dimensional data by transforming it into a lower-dimensional space while maximizing the variance captured by the new coordinates, known as principal components. These components are orthogonal directions in the data that successively account for the largest amounts of variability, enabling dimensionality reduction that preserves essential information and facilitates analysis or visualization.[4] When applied to images, such as grayscale face photographs, PCA requires representing each image as a point in a high-dimensional vector space. For instance, a typical 256 by 256 pixel grayscale image is flattened into a one-dimensional vector of dimension 65,536, where each element corresponds to a pixel intensity value, allowing the set of images to form a dataset in this expansive space.[1] To apply PCA, the data is first centered by subtracting the mean image vector from each image vector, resulting in a mean-subtracted data matrix of size , where is the image dimension (e.g., 65,536) and is the number of training images. The covariance matrix of this centered data is then computed as , which captures the variance-covariance structure across the pixel dimensions.[1] The eigen decomposition of yields eigenvectors and eigenvalues , satisfying the equation for . Here, the eigenvectors represent the principal components (termed eigenfaces in the context of face images), and the corresponding eigenvalues quantify the amount of variance explained by each component, with larger indicating greater importance.[1] Principal components are selected by sorting the eigenvectors in descending order of their eigenvalues and retaining the top such that they capture a substantial portion of the total variance, often determined by a threshold on the cumulative explained variance ratio . For example, components are chosen to retain at least 95% of the total variance, balancing dimensionality reduction with information preservation.Historical Development
Origins and Key Publications
The eigenfaces technique originated in the late 1980s at the MIT Media Laboratory, where researchers Matthew Turk and Alex Pentland developed an appearance-based method for face recognition by adapting principal component analysis (PCA) from earlier pattern recognition applications to the domain of human faces. This work built upon foundational studies, such as those by Sirovich and Kirby, who in 1987 demonstrated PCA's utility for low-dimensional representation of face images under controlled conditions.[1] The seminal publication introducing eigenfaces as a practical recognition tool was the 1991 paper "Eigenfaces for Recognition" by Turk and Pentland, published in the Journal of Cognitive Neuroscience. In this work, they presented a system that encodes face images as vectors in a high-dimensional space and uses PCA to derive a set of orthogonal basis images—termed eigenfaces—that capture the principal variations among faces, enabling efficient comparison and identification. The method was designed for near-real-time performance, addressing challenges in automated face tracking and recognition within computer vision.[1] Early experiments in the paper utilized a custom database of over 2,500 face images from 16 subjects, captured under varying conditions including three lighting directions, three head sizes, and three orientations to simulate real-world variability. These tests demonstrated the technique's robustness, achieving high recognition accuracy by projecting novel faces onto the eigenface subspace and measuring Euclidean distances to known subjects, thus establishing eigenfaces as a foundational benchmark in face recognition research.[1]Evolution and Impact
Following the seminal 1991 work by Turk and Pentland introducing eigenfaces as a principal component analysis-based approach to face recognition, the method rapidly expanded in the early 1990s through integrations into practical systems.[1] In the late 1990s and early 2000s, eigenfaces influenced commercial biometric security applications, such as user authentication and physical access control systems.[5] This integration facilitated near-real-time processing, enabling deployments in security and surveillance.[6] Academically, eigenfaces exerted profound influence on computer vision and machine learning, with the original paper amassing over 21,500 citations as of 2025, underscoring its role in popularizing subspace learning methods.[7] The approach established PCA as a foundational tool for dimensionality reduction in image analysis, inspiring subsequent algorithms like Fisherfaces and modular eigenspaces that addressed limitations in holistic representations.[8] Its impact extended to education, where PCA-based eigenface techniques became a staple in introductory computer vision curricula, providing an accessible entry point for teaching feature extraction and pattern recognition concepts.[8] Key milestones in the evolution included 1994 extensions by Pentland and colleagues, who developed view-based and modular eigenspaces to enable pose-invariant recognition by decomposing faces into component-specific subspaces, such as eyes and nose, rather than treating the entire image holistically. This advancement improved robustness to viewpoint variations and influenced benchmarking practices, notably through the FERET dataset introduced in 1996, where eigenfaces served as a primary baseline for evaluating face recognition algorithms across thousands of images under controlled conditions.[9] These developments solidified eigenfaces' legacy in shaping standardized evaluation protocols for the field.[8]Computation Methods
Data Preparation and Training
The preparation of data for eigenface generation begins with assembling a training dataset consisting of grayscale face images captured under controlled conditions to minimize extraneous variations. These images are typically aligned and cropped to focus on the facial region, with a standard resolution such as 92×112 pixels to ensure uniformity across the set.[10] In seminal implementations, datasets like the AT&T (Olivetti) database are employed, featuring 400 grayscale images from 40 subjects, each with 10 variations in pose and lighting.[11] For robust eigenfaces, training sets generally range from 100 to 500 images across 20 to 50 subjects, providing sufficient diversity while remaining computationally feasible.[12] Preprocessing steps are essential to standardize the images and address common challenges in face data. Initial face detection and cropping isolate the face from background elements, often using techniques like elliptical masking to exclude non-facial areas.[13] Images are converted to grayscale to simplify representation and reduce color-induced noise, resulting in pixel intensity vectors suitable for analysis.[14] Normalization handles variations in scale, orientation, and illumination; this may involve resizing to fixed dimensions, rotating for alignment based on facial landmarks (e.g., eyes and nose), and applying histogram equalization to mitigate lighting differences.[15] These steps ensure the dataset captures intrinsic facial structure rather than environmental artifacts.[1] A key aspect of preparation is centering the data around the mean face to highlight deviations that define individual characteristics. The mean face is calculated as the average of all training images , where indexes the images in the set.[1] Each image is then centered by subtracting this mean: , producing a mean-subtracted set that facilitates subsequent statistical analysis.[1] This centering step, performed after initial normalization, aligns the data distribution for effective principal component extraction.[16]Eigenvector Extraction and SVD Connection
The computation of eigenfaces begins with the formation of the covariance matrix from the prepared, mean-subtracted training images. Let denote the vectors representing these centered images, each of dimension (where is the total number of pixels). The sample covariance matrix is then given by which is a symmetric positive semi-definite matrix capturing the variance structure across the training set.[17] Direct extraction of the eigenvectors of yields the eigenfaces, as these eigenvectors satisfy , where are the eigenvalues representing the amount of variance explained by each direction. However, for typical face images (e.g., to ), the eigen decomposition of this full covariance matrix is computationally prohibitive, requiring operations and substantial memory for such high dimensionality.[17] To make the computation feasible, especially when , the eigenvectors are derived from the much smaller matrix , where is the data matrix with columns . The eigenvalue decomposition of provides eigenvectors such that , and the corresponding eigenfaces are obtained as , which are proportional to the true eigenvectors of (with eigenvalues related by ). This approach reduces the complexity to , which is practical for modest (e.g., tens to hundreds of training images).[17] The connection to singular value decomposition (SVD) offers an equivalent and often preferred numerical method for extracting these components. Applying SVD to the centered data matrix yields , where is a orthogonal matrix whose columns are the left singular vectors, is a diagonal matrix of singular values , and is orthogonal. The columns of , scaled by the singular values, correspond to the eigenfaces , and the eigenvalues of are given by . This formulation ensures numerical stability, particularly in implementations using libraries like LAPACK, and directly aligns with the PCA basis without explicit covariance formation.[18] Once computed, the eigenfaces are sorted by their associated eigenvalues in descending order, retaining only the top (where ) dominant components that account for the majority of the data variance, typically 90-99% in face datasets. This ranking prioritizes the most informative directions for subsequent dimensionality reduction.[17]Applications in Recognition
Face Recognition Pipeline
The face recognition pipeline using eigenfaces begins with the projection of a new input face image, denoted as , onto the precomputed face space. This involves subtracting the mean face from and computing the projection coefficients, or weights, for each of the selected eigenfaces , where and is typically much smaller than the original image dimensionality (e.g., out of hundreds of principal components). These weights form the vector , which represents the input image as coordinates in the low-dimensional face space spanned by the eigenfaces.[1] In the classification stage, the projected vector is compared to the stored weight vectors from the training set of known faces using the Euclidean distance metric . The system identifies the input as the known face whose training vector yields the minimum distance, effectively finding the nearest neighbor in the face space. To distinguish faces from non-faces, a distance threshold is applied: if the minimum distance exceeds , the input is rejected as not belonging to any known class or as a non-face.[1] The pipeline operates in two primary modes: verification and identification. In verification mode, the system performs a one-to-one comparison between the input and a specific target's , accepting the match if , where is a class-specific error threshold tuned to balance false positives and negatives. In identification mode, it conducts a one-to-many search across all stored training vectors to find the overall closest match, again using the Euclidean distance and thresholds to confirm or reject the result. Error handling relies on these adjustable thresholds, such as for overall face detection (measuring deviation from the face space, e.g., if projected onto the origin-shifted space) and for classification, which can achieve high accuracy (e.g., 96%) while allowing rejection of unknowns at rates up to 20%.[1]Practical Implementation Examples
Practical implementations of eigenfaces typically follow a structured pseudocode outline for training and testing phases, emphasizing efficient matrix operations to handle image data. In the training phase, images are loaded and vectorized into a matrix where each column represents a centered face image; the mean face is subtracted from each, forming centered vectors ; the covariance matrix is approximated via where is the matrix of centered vectors (to avoid computing the full matrix when ); eigenvalues and eigenvectors of are computed; and the top eigenvectors are mapped back to the original space as to obtain the eigenfaces.[19][20] For the testing phase, an input image is vectorized and centered (); it is projected onto the eigenfaces subspace to get weights where ; and classification occurs by finding the minimum Euclidean distance to stored training weights, , with a threshold to determine matches.[19][20] Toolkits facilitate these steps through built-in functions for matrix operations and decomposition. In MATLAB, the process leverageseig or pca on the centered image matrix for eigenvector extraction, with image loading via imread and vectorization using reshape.[21] OpenCV supports eigenfaces via cv::PCA::compute on a matrix of flattened grayscale images (e.g., 100x100 pixels), handling I/O with cv::imread and enabling real-time extensions through its face module, though modern versions favor alternatives like LBPH for production.[22] For Python prototyping, scikit-learn's PCA module simplifies implementation by fitting on a 2D array of reshaped images (e.g., pca = PCA(n_components=150); eigenfaces = pca.fit_transform(flattened_faces)), often combined with OpenCV for preprocessing.[23]
Integration with public datasets requires handling file I/O and normalization for reproducibility. The Yale Face Database, containing 165 grayscale images of 15 subjects under varying lighting and expressions (11 images per subject, cropped to 320x243 pixels), serves as a standard benchmark; images are loaded sequentially, converted to vectors (e.g., via flattening rows), and normalized to zero mean and unit variance before feeding into the training matrix.[24]
Computational considerations highlight scalability limits, with time complexity dominated by centering (O(N d)) and covariance approximation (O(N^2 d)), plus eigendecomposition (O(N^3)) for N training images and d pixels per image (typically d ≈ 10^4 for 100x100 images), necessitating GPU acceleration or dimensionality reduction for datasets exceeding thousands of images on standard hardware.[25]
A simple example involves training on 10 images (two per subject for five individuals, vectorized from 64x64 grayscale faces), yielding approximately 5 dominant eigenfaces after selecting those with eigenvalues above a variance threshold (e.g., retaining 95% explained variance), enabling basic nearest-neighbor classification with recognition rates around 80-90% on held-out images from the same subjects under controlled conditions.[20]
