face recognition

% Network creation step of neurons and learning
%Num_Neuron_Hidden=20 ;% number of neurons in the hidden layer
%net=init(net); % Reintialisation weights and bias
%net = newff(P,T,Num_Neuron_Hidden,{},’traingd’);% Num_Neuron_Hidden=20
net = feedforwardnet(25);
net.trainparam.epochs=10000;% Maximum iteration
%net.trainParam.lr=0.001;
%net.trainParam.max_perf_inc=0.000001; %Maximum performance increase
%net.trainParam.min_grad=1e-9; %Minimum performance gradient
net.trainparam.goal=0.0001; % Error to respect
net=train(net,P,T); % Start learning
% End learning

~60%

Face extraction

Generally eye and nose can be identified correctly but it seems to be a bit difficult to recognise mouth.

Original image:

Too many “mouths” are identified even the pattern on the clothes.

original

Head-cropped image:

Still there are too many incorrect mouths are detected on the face

face-crop

Head-cropped image(with grey scale):

No difference when the image is grey-scale.

head-crop (grey)

Face-cropped image:

Mouth detection is improved but face detection went wrong

face-crop2face-crop

 Improved quantized head-cropped image:

Cropped-quantize

Binarized improved head-cropped image:

Only face is able to be recognized.

binarized image

cropped quantized blur image

Put cropped quantized blur image K1-4 and V1-4 into the database

K5:

The nearest class is number 1

with a distance equal to 1.3080e+04

The distance from Face Space is 1.6181e+04.

K6:

The nearest class is number 1

with a distance equal to 5.5489e+03

The distance from Face Space is 8.4010e+03

K7:

The nearest class is number 1

with a distance equal to 5.8456e+03

The distance from Face Space is 8.6654e+03

K8:

The nearest class is number 1

with a distance equal to 1.0162e+04

The distance from Face Space is 7.0128e+03

V5:

The nearest class is number 2

with a distance equal to 1.0708e+04

The distance from Face Space is 1.2425e+04

V6:

The nearest class is number 2

with a distance equal to 1.1395e+04

The distance from Face Space is 1.2353e+04

V7:

The nearest class is number 2

with a distance equal to 1.2915e+04

The distance from Face Space is 1.3246e+04

V8:

The nearest class is number 2

with a distance equal to 1.0520e+04

The distance from Face Space is 1.3401e+04

cropped quantized gabor image

Put cropped quantized gabor image K1-4 and V1-4 into the database

K5:

The nearest class is number 1

with a distance equal to 1.3251e+03

The distance from Face Space is 1.5250e+04

K6:

The nearest class is number 1

with a distance equal to 3.7954e+03

The distance from Face Space is 9.6707e+03

K7:

The nearest class is number 1

with a distance equal to 4.0918e+03

The distance from Face Space is 9.9891e+03

K8:

The nearest class is number 1

with a distance equal to 4.2576e+03

The distance from Face Space is 9.6539e+03

V5:

The nearest class is number 2

with a distance equal to 1.0058e+04

The distance from Face Space is 1.3568e+04

V6:

The nearest class is number 2

with a distance equal to 8.8338e+03

The distance from Face Space is 1.5459e+04

V7:

The nearest class is number 1

with a distance equal to 9.6513e+03

The distance from Face Space is 1.3697e+04

V8:

The nearest class is number 2

with a distance equal to 5.8110e+03

The distance from Face Space is 1.8340e+04

Distance from Face Space is smaller but there is a slightly error firstly happen in the face recognition

Cropped quantized binarizied image

Put cropped quantized binarizied image K1-4 and V1-4 into the database

K5:

The nearest class is number 1

with a distance equal to 3.5326e+04

The distance from Face Space is 5.4135e+04

K6:

The nearest class is number 1

with a distance equal to 1.3932e+04

The distance from Face Space is 3.9892e+04

K7:

The nearest class is number 1

with a distance equal to 1.6146e+04

The distance from Face Space is 4.0177e+04

K8:

The nearest class is number 1

with a distance equal to 1.6146e+04

The distance from Face Space is 4.0177e+04

V5:

The nearest class is number 2

with a distance equal to 2.9540e+04

The distance from Face Space is 5.4218e+04

V6:

The nearest class is number 2

with a distance equal to 3.5323e+04

The distance from Face Space is 5.9521e+04

V7:

The nearest class is number 2

with a distance equal to 3.5536e+04

The distance from Face Space is 5.8937e+04

V8:

The nearest class is number 2

with a distance equal to 2.8393e+04

The distance from Face Space is 5.8851e+04

Result is worsen when the image is binarizied 

Cropped quantized image

Put cropped quantized image K1-4 and V1-4 into the database

K5:

The nearest class is number 1

with a distance equal to 8.9954e+03

The distance from Face Space is 1.6963e+04

K6:

The nearest class is number 1

with a distance equal to 6.4824e+03

The distance from Face Space is 9.2673e+03

K7:

The nearest class is number 1

with a distance equal to 7.1385e+03

The distance from Face Space is 9.5618e+03

K8:

The nearest class is number 1

with a distance equal to 1.1030e+04

The distance from Face Space is 8.2181e+03

V5:

The nearest class is number 2

with a distance equal to 1.4722e+04

The distance from Face Space is 1.3229e+04

V6:

The nearest class is number 2

with a distance equal to 1.5407e+04

The distance from Face Space is 1.3004e+04

V7:

The nearest class is number 2

with a distance equal to 1.6933e+04

The distance from Face Space is 1.3963e+04

V8:

The nearest class is number 2

with a distance equal to 1.4567e+04

The distance from Face Space is 1.3984e+04

Angelina Jolie:

The nearest class is number 2

with a distance equal to 1.7992e+04

The distance from Face Space is 6.2368e+04

Daniel:

The nearest class is number 2

with a distance equal to 5.2660e+03

The distance from Face Space is 4.0036e+04

Emma:

The nearest class is number 2

with a distance equal to 8.6878e+03

The distance from Face Space is 4.8671e+04

Rihanna:

The nearest class is number 2

with a distance equal to 1.4793e+04

The distance from Face Space is 5.3269e+04

Sunset:

The nearest class is number 2

with a distance equal to 1.5427e+04

The distance from Face Space is 5.0384e+04

Wall:

The nearest class is number 1

with a distance equal to 8.7240e+03

The distance from Face Space is 2.8686e+04

Distance from face space is lower when the image is cropped.

Quantized face image

Put Quantized image k1-3 into database

K4:

The nearest class is number 1

with a distance equal to 8.5376e+03

The distance from Face Space is 3.5367e+04

K5:

The nearest class is number 1

with a distance equal to 723.0722

The distance from Face Space is 4.4369e+04

K6:

The nearest class is number 1

with a distance equal to 367.1292

The distance from Face Space is 5.0511e+04

Angelina Jolie:

The nearest class is number 1

with a distance equal to 3.7826e+03

The distance from Face Space is 1.0377e+05

V1:

The nearest class is number 1

with a distance equal to 4.5324e+03

The distance from Face Space is 5.4952e+04

V2:

The nearest class is number 1

with a distance equal to 3.9223e+03

The distance from Face Space is 5.5210e+04

V3:

The nearest class is number 1

with a distance equal to 4.5775e+03

The distance from Face Space is 5.6665e+04

Put Quantized image k1-3 and V1-3 into database

K4:

The nearest class is number 1

with a distance equal to 1.5946e+04

The distance from Face Space is 3.4547e+04

K5:

The nearest class is number 1

with a distance equal to 1.7071e+04

The distance from Face Space is 4.1237e+04

K6:

The nearest class is number 1

with a distance equal to 2.3233e+04

The distance from Face Space is 4.5922e+04

V4:

The nearest class is number 2

with a distance equal to 7.1595e+03

The distance from Face Space is 2.2549e+04

V5:

The nearest class is number 2

with a distance equal to 4.6862e+03

The distance from Face Space is 1.8208e+04

V6:

The nearest class is number 2

with a distance equal to 7.2160e+03

The distance from Face Space is 1.9150e+04

Angelina Jolie:

The nearest class is number 2

with a distance equal to 2.6368e+04

The distance from Face Space is 9.7914e+04

Sunset:

Error using –
Matrix dimensions must agree.

Error in facerec (line 230)

*Matrix multiplication requires the number of columns in the first matrix to equal the number of rows in the second.

Therefore the threshold for K group of image is around 3e+04 to 4e+04 and for V is around 1e+04 to 2e+04.

Although Angelina Jolie is classified as group V but the distance from face space is too high (9.7914e+04) compare with the other matched image data (1e+04 to 2e+04), it is classified as an unknown face but similar to group V.

Face Recognition (without image border)

Put K1-4 and V1-4 into the database

K5:

The nearest class is number 1

with a distance equal to 2.6624e+04

The distance from Face Space is 3.5547e+04

K6:

The nearest class is number 1

with a distance equal to 3.3199e+04

The distance from Face Space is 4.0072e+04

K7:

The nearest class is number 1

with a distance equal to 3.3403e+04

The distance from Face Space is 4.1105e+04

K8:

The nearest class is number 1

with a distance equal to 3.2373e+04

The distance from Face Space is 3.8482e+04

V5:

The nearest class is number 2

with a distance equal to 2.2086e+03

The distance from Face Space is 1.4671e+04

V6:

The nearest class is number 2

with a distance equal to 6.1145e+03

The distance from Face Space is 1.6848e+04

V7:

The nearest class is number 2

with a distance equal to 6.9064e+03

The distance from Face Space is 2.1447e+04

V8:

The nearest class is number 2

with a distance equal to 985.3006

The distance from Face Space is 1.1851e+04

Wall:

The nearest class is number 1

with a distance equal to 2.4917e+04

The distance from Face Space is 5.1738e+04

Sunset:

The nearest class is number 2

with a distance equal to 6.7423e+03

The distance from Face Space is 6.3302e+04

Angelina Jolie:

The nearest class is number 2

with a distance equal to 2.5813e+04

The distance from Face Space is 9.6881e+04

Emma Watson:

The nearest class is number 2

with a distance equal to 1.1359e+04

The distance from Face Space is 8.8046e+04

Rihanna:

The nearest class is number 2

with a distance equal to 1.2748e+04

The distance from Face Space is 7.3516e+04

Daniel:

The nearest class is number 2

with a distance equal to 1.3620e+04

The distance from Face Space is 6.9321e+04