MATLAB Answers

Sir, am having the four mat files, which of two contains features from minutie and other two contains feature from invarient moment, can i make fusion of those features by combining it then how?

1 view (last 30 days)
Balaji M. Sontakke
Balaji M. Sontakke on 19 Jun 2018
Edited: Andrei Bobrov on 22 Jun 2018
Sir, am having the four mat files, which of two contains features from minutiae and other two contains feature from invariant moment, can i make fusion of those features by combining it then how?

Answers (1)

Andrei Bobrov
Andrei Bobrov on 19 Jun 2018
Edited: Andrei Bobrov on 22 Jun 2018
V = {load('db1.mat'),load('db2.mat'),load('db3.mat'),load('db4.mat')};
n = cellfun(@fieldnames,V,'un',0);
V1 = cellfun(@(x,y)[x.(y)],V,[n{:}],'un',0);
V2 = cell2mat(reshape(cat(1,V1{:}]),1200,[]));
V3 = mat2cell(V2,4*ones(size(V2,1)/4,1),7);
out = mat2cell(V3,[400,800],1);

  3 Comments

Balaji M. Sontakke
Balaji M. Sontakke on 20 Jun 2018
sir, I did classification by loading first two mat files (see following code), In your code out is a cell array, how i get reduced_testdata and reduced_traindata for further processing.
clear all;
clc;
tic; %%calculating elapsed time for execution
%load mat files
load('db3.mat');
load('db4.mat');
%%reshape into row vector
reduced_testdata = reshape(reduced_testdata,1,4,100);
reduced_traindata = reshape(reduced_traindata,1,4,200);
%%adjust dimension
% Adjust matrix dimension
P_test = cell2mat(reduced_testdata); % Convert cell array to matrix
P_train = cell2mat(reduced_traindata);
%%rearranges the dimensions of P_test and P_train
C = permute(P_test,[1 3 2]);
P_test = reshape(C,[],size(P_test,2),1);
C = permute(P_train,[1 3 2]);
P_train = reshape(C,[],size(P_train,2),1);
%%labeling class
train_label=load('train_label.txt');
test_label=load('test_label.txt');
%%Normalisation by Z - Scores
P_train = zscore(P_train,0,2);
P_test =zscore(P_test,0,2);
%%classfication
predictlabel = knnclassify(P_test, P_train, train_label,3,'euclidean','nearest');
cp = classperf(test_label,predictlabel);
Conf_Mat = confusionmat(test_label,predictlabel);
disp(Conf_Mat);
%%Evaluate Performance
[FPR, TPR,Thr, AUC, OPTROCPT] = perfcurve(predictlabel, test_label,1);
figure,
plot(TPR,FPR,'r-','LineWidth',4);
xlabel('False positive rate')
ylabel('True positive rate')
title('ROC Curve for Classification ')
Tbl = table(FPR, TPR,Thr)
[FPR, FNR, Thr] = perfcurve(predictlabel, test_label,1,'xCrit','fall','xCrit','miss');
Thr = Thr/10;
figure,
plot(Thr,FPR,'r--','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10);
xlabel('Threshold')
ylabel('False positive rate / FAR')
title('False Acceptance Rate / FAR ')
figure,
plot(Thr,FNR,'r--','LineWidth',2,'MarkerEdgeColor','k','MarkerFaceColor','g','MarkerSize',10);
xlabel('Threshold')
ylabel('False Negative rate / FRR')
title('False Rejection Rate / FRR ')
Tbl = table(FPR, FNR,Thr)
fprintf('\n\n Overall accuracy:%f%%\n',cp.CorrectRate*100);
%%calculating elapsed time for execution
toc

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!