pca based face recognition system
TRANSCRIPT
Face Recognition using PCA Algorithm
PCA-
Principal Component Analysis
Goal-
Reduce the dimensionality of the data by retaining as much as variation
possible in our original data set.
The best low-dimensional space can be determined by best principal-
components.
Eigenface Approach
Pioneered by Kirby and Sirivich in 1988
There are two steps of Eigenface Approach
Initialization Operations in Face Recognition
Recognizing New Face Images
Steps
Initialization Operations in Face Recognition
Prepare the Training Set to Face Vector
Normalize the Face Vectors
Calculate the Eigen Vectors
Reduce Dimensionality
Back to original dimensionality
Represent Each Face Image a Linear Combination of all K Eigenvectors
Recognizing An Unknown Face
β¦β¦β¦..
112 Γ 92
10304 Γ 1ππ
Face vector space
Images converted to vector
Each Image size
column vector
π= 16 images in the training set Convert each of face images in
Training set to face vectors
Average face vector/Mean image (π³)
π= 16 images in the training set
β¦β¦β¦.. π³
Converted
Face vector space
Mean Image π³
ππ
Calculate Average face vector
Save it into face vector space
Subtract the Mean from each Face Vector
β¦β¦β¦..
Π€π
π³
Converted
Face vector space
π= 16 images in the training set
β =
ππ πΏ Π€π
Normalized Face vector
Calculate the Covariance Matrix (πͺ)
C = π=116 Π€πΠ€π
π
= π΄π΄π
= {(π2Γπ). (π Γ π2)}
= π2Γ π2
= (10304 Γ 10304)
Where π΄ = {Π€1, Π€2, Π€3, β¦β¦β¦ ., Π€16}
[π = ππ Γπ]β¦β¦β¦.. π³
Π€π
Face vector space
Converted
π= 16 images in the training set
Converted
C = 10304 Γ 10304
10304 eigenvectors
β¦β¦β¦
Each 10304Γ1 dimensional
β¦β¦β¦.. π³
Π€π
Face vector space
ππ
Converted
π= 16 images in the training set
In πͺ, π΅π is creating πππππ eigenvectors
Each of eigenvector size is πππππ Γ π dimensional
Calculate Eigenvector (ππ)
C = 10304 Γ 10304
10304 eigenvectors
Each 10304Γ1 dimensional
β¦β¦β¦.. π³
Π€π
Face vector space
Converted
β¦β¦β¦
ππ
π= 16 images in the training set
Find the Significant π²ππ eigenfaces
Where, π² < π΄
C = 10304 Γ 10304
10304 eigenvectors
Each 10304Γ1 dimensional
β¦β¦β¦.. π³
Π€π
Face vector space
Converted
β¦β¦β¦
ππ
π= 16 images in the training set
Make system slow
Required huge calculation
Consider lower dimensional subspace
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
π= 16 images in the training set
π³ = π¨π»π¨
= π΄Γπ΅2 π΅2 Γπ΄
= π΄Γπ΄
= 16 Γ 16β¦β¦ . .
16 eigenvectors
Each 16 Γ1 dimensional
Calculate eigenvectors ππ
ππ
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
π= 16 images in the training set
Calculate Co-variance matrix(π³)
of lower dimensional
π³ = π¨π»π¨
= π΄Γπ΅2 π΅2 Γπ΄
= π΄Γπ΄
= 16 Γ 16β¦β¦ . .
16 eigenvectors
Each 16 Γ1 dimensional
ππ V/S ππ
ππ
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
10304 eigenvectors
β¦β¦β¦
Each 10304Γ1 dimensional
ππ
C = 10304 Γ 10304
v/s
π images in the training set
π³ = π¨π»π¨
= π΄Γπ΅2 π΅2 Γπ΄
= π΄Γπ΄
= 16 Γ 16
Select K best eigenvectors
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
β¦β¦ . .
16 eigenvectors
Each 16 Γ1 dimensional
ππ
Selected K eigenfaces MUST be inThe ORIGINAL dimensionality of theFace vector space
π³ = π¨π»π¨
= π΄Γπ΅2 π΅2 Γπ΄
= π΄Γπ΄
= 16 Γ 16
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
β¦β¦ . .
16 eigenvectors
Each 16 Γ1 dimensional
ππ
A=
ππ = π¨ππ
10304 eigenvectors
β¦β¦β¦
Each 10304Γ1 dimensional
ππ
π= 16 images in the training set
π³ = π¨π»π¨
= π΄Γπ΅2 π΅2 Γπ΄
= π΄Γπ΄
= 16 Γ 16
β¦β¦β¦.. π³
Π€π
Lower dimensional Sub-space
Face vector space
Converted
β¦β¦ . .
16 eigenvectors
Each 16 Γ1 dimensional
ππ
A=
ππ = π¨ππ
10304 eigenvectors
β¦β¦β¦
Each 10304Γ1 dimensional
ππ
π images in the training set
C = π΄π΄π
10304 eigenvectors
β¦β¦β¦
Each 10304Γ1 dimensional
ππ
The K selected eigenface
β¦β¦β¦.. π³
Π€π
Face vector space
Converted
π= 16 images in the training set
ππ ππ ππ ππ ππ ππβ―β―β―
+ π³ (Mean Image)
Each face from Training set can be represented a weighted sum of the K Eigenfaces + the Mean face
ππ ππ ππ ππ ππ ππβ―
+ π³ (Mean Image)
The K selected eigenface
Each face from Training set can be represented aweighted sum of the K Eigenfaces + the Mean face
β¦β¦β¦..
Π€π
π³
Converted
Face vector space
π= 16 images in the training set
Weight Vector (π΄π)
ππ ππ ππ ππ ππ ππβ―
+ π³ (Mean Image)
= π΄π =
π1π
π2π
π3π
.
.
.ππ²π
Each face from Training set can be represented aweighted sum of the K Eigenfaces + the Mean face
A weight vector ππ’ which is the eigenfaces representation of
the πππ face. We calculated each faces weight vector.
Convert the
Input to Face
Vector
Normalize the
Face Vector
Project Normalize Face Vector onto the Eigenspace
Get the Weight
Vector
π΄πππ =
ππππππ...ππ²
Euclidian Distance
(E) = (ππππ βππ)
If
π¬ < π½π
No
Unknown
Yes
Input of a unknown Image
Recognized as