Chat with us, powered by LiveChat Face recognition Perform a face identification task. For training, you are given 4 facial images of a person DG and 4 facial images of a person KS. For testing, you are gi - Writeedu

## 29 Jun Face recognition Perform a face identification task. For training, you are given 4 facial images of a person DG and 4 facial images of a person KS. For testing, you are gi

Hello , I need help doing a homework using MATLAB, it's about facial recognition with principal-component analysis.

It is pretty simple, not that advanced

Question 1 – Face recognition

Perform a face identification task. For training, you are given 4 facial images of a person DG and 4 facial images of a person KS. For testing, you are given a facial image X that is known to be of

either DG or KS. The task is to determine the likelihood ratio 𝑝(𝑋|𝐷𝐺) 𝑝(𝑋|𝐾𝑆)

and on that basis to

decide which of the 2 persons is depicted by X and to state the level of confidence you have in the decision.

To begin, use the Matlab function call load([folder,'images.mat']) to load the 9 images into Matlab, where folder is the folder on your PC where the file images. Mat resides, for example folder=’C:UsersKateDocumentsUniBiometrics’. The 9 images are stored in a Matlab cell array images, where bitmaps dg1…dg4 are accessed as

images{1}…images{4}, ks1…ks4 as images{5}…images{8}, and xx1 as images{9}.

Each bitmap is a 70×50 matrix of uint8 values representing grey-scale pixels. The faces have already been extracted from larger images and normalised such that the person’s right pupil is in a standard position. (You may also inspect the bmp images to confirm your result, but visual inspection and subjective judgment alone do not attract any marks!) In parts a) to c) of the question, you perform principal-component analysis on the training data.

a) Load the 8 training files into Matlab and convert each 70×50 matrix to a 3500×1 vector of double values by stacking the 50 matrix columns. Convert all values to double. Each vector then has all the 3500 components of the corresponding matrix, but double instead of uint8. [Hint: Use the Matlab functions load( ), reshape( ) and double( )]

Print the first 5 components of each (transposed) vector in your homework. [1.5 marks]

b) Determine the 3500×1 mean vector and the 3500×3500 covariance matrix of the 8 training vectors, then compute the first 7 principal axes of the feature space. [Hint: Combine the 8 training vectors into a 3500×8 matrix, then use the Matlab functions mean( ), cov( ) and eigs( )]

Print the first 5 components of the (transposed) mean vector and the top-left 5×5 components of the covariance matrix in your homework. [1.5 marks]

c) Project the training vectors onto the principal axes, thereby reducing each vector from 3500 components to 7 components. [Hint: Multiply the matrix of mean-normalised training vectors from the left with the transposed matrix of eigenvectors. Use the Matlab function repmat( ).]

Print ALL components of each (transposed) projected vector in your homework. [1 mark]

At this point, principal-component analysis is complete. Next, you have to calculate the models for Person DG and Person KS.

d) From the 4 projected training vectors of DG, compute the 7×1 DG mean vector and the 7×7 DG covariance matrix. Then diagonalise the covariance matrix. Do the same for KS. Together, the mean vector and diagonal covariance matrix of each person form that person’s face model. [Hint: Use the Matlab function diag( ).]

Print ALL components of the 2 (transposed) mean vectors and ALL components of the diagonals of the 2 covariance matrices in your homework. [1 mark]

At this point, training is complete. Finally, you need to calculate the PDFs of the test face given, respectively, the DG model and the KS model.

e) Load the test file and convert it to a 3500×1 vector of type double as in Q1a).

Print the first 5 components of the (transposed) vector in your homework.

f) Project the test vector onto the principal axes as in Q1c). [0.5 marks]

Print ALL components of the (transposed) projected vector in your homework. [0.5 marks]

g) For each of the 2 models, determine the probability density (PDF) that the test vector is

produced by that model and calculate the likelihood ratio 𝑝(𝑋|𝐷𝐺) 𝑝(𝑋|𝐾𝑆)

.

[Hint: Use the Matlab function mvnpdf( ).]

Print the 2 resulting PDFs, the likelihood ratio and the log10-likelihood ratio in your homework. [1 mark]

h) Finally and assuming equal priors and one-zero decision costs, state whether your statistical evidence supports the hypothesis 𝐻(𝐷𝐺|𝑋) that the test face belongs to Person DG or the hypothesis 𝐻(𝐾𝑆|𝑋) that the test face belongs to Person KS. How confident are you of the decision? Use the likelihood ratio you calculated to support your conclusion.

,

Biometric Identification and Verification Seminar

Assignment 3 – Hints

1. Some linear algebra: If 𝒙 is a vector in a 5-dim space ℝ5, 𝒀 is a 5×2 matrix of two 5-

dimensional basis vectors 𝒚(1) and 𝒚(2) of a (2-dimensional) subspace, and the 2-

dimensional vector �̃� is the projection of 𝒙 into that subspace then �̃� = 𝒀𝑡 (𝒙 − 𝝁𝒙).

2. Some Matlab: In your assignment, you have to project eight (in fact 9) 3500-dimensional

vectors into a 7-dimensional subspace, and you may already guess that you don’t have

to write a for loop with eight iterations. The first step is to normalise the training vectors

by subtracting their mean from each one of them. For this, the Matlab function

repmat(X,I,j) is convenient. If X is the (3500×8) matrix of the training vectors, you

can replicate the (3500×1) mean vector mu 8 times horizontally by calling

repmat(mu,1,8) and do all 3500×8 subtractions in one go.

3. To be continued…

Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.

Do you need an answer to this or any other questions?

Do you need help with this question?

Get assignment help from WriteEdu.com Paper Writing Website and forget about your problems.

WriteEdu provides custom & cheap essay writing 100% original, plagiarism free essays, assignments & dissertations.

With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.

Chat with us today! We are always waiting to answer all your questions.