Clear Filters
Clear Filters

how to find recognition rate for face recognition and analyze the confusion matix

2 views (last 30 days)
hello I have been working on face recognition using neural network as classifier. For this I have used ORL face database , which is having 400 images (40 person's 10 images). I have divided the data base as training_data(1st 8 images of 40 person=320 images) and test_data (remaining 2 images of 40 person=80 images). Target(40X320).Feature extraction is done for both training_data and test_data. 1. The code is as shown in below, please help me to know whether my code is correct or need some corrections. 2. If it is correct then how to analyse the confusion matrix 3. how to find the recognition rate? 4. please guide me some changes required in the code so that I can have better performance %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% [pn,ps] = mapminmax(input); % normalize the data in matrix in range [-1 1]
[I N]=size(pn);
[O N] =size(target);
I = 10304; N = 320; O = 40;
%% target [40X320]
ind=[1:40]; % generate numbers from 1 to 40
ind=repelem(ind,8);
target=full(ind2vec(ind));
%% test_dataset [10304X80]
[mag1] = testing_matrix(NOP,Path);
%% Create a Pattern Recognition Network
HiddenLayer=10;
net = patternnet(HiddenLayer);
%% % Train the Network
[net,tr] = train(net,pn,target);
%% % Test the Network
output = net(pn);
errors = gsubtract(target,output);
mse = perform(net,target,output)
perf = mse(net,target,output)
%% View the Network
view(net)
%% Confusion matrix
[c,cm,ind,per] = confusion(target,output);
please help

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!