matlab code for far and frr calculation
#1

Hi I m alok, I need matlab code to calculate FAR and FRR
Reply
#2

function [EER confInterEER OP confInterOP]=EER_DET_conf(clients,imposteurs,OPvalue,pas0)

% function: EER_DET_conf
%
% DESCRIPTION:
% It plots traditional curves and gives also some interesting values in
% order to evaluate the performance of a biometric verification system.
% The curves are:
% - Receiver Operating Characteristic (ROC) curve
% - Detection Error Trade-off (DET) curve
% - FAR vs FRR
% The values are:
% - Equal Error Rate (EER) which is computed as the point where
% FAR=FRR
% - Operating Point (OP) which is defined in terms of FRR (%)
% achieved for a fixed FAR
% A 90% interval of confidence is provided for both values (parametric
% method).
%
% INPUTS:
% clients: vector of genuine/client scores
% imposteurs: vector of impostor scores
% OPvalue: value of FAR at which the OP value is estimated
% pas0: number of thresholds used the estimate the score distributions
% (10000 is advised for this parameter)
%
% OUTPUTS:
% EER: EER value
% confInterEER: error margin on EER value
% OP: OP value
% confInterOP: error margin on OP value
%
%
% CONTACT: aurelien.mayoue[at]int-edu.eu
% 19/11/2007


%%%%% estimation of thresholds used to calculate FAR et FRR

% maximum of client scores
m0 = max (clients);

% size of client vector
num_clients = length (clients);

% minimum impostor scores
m1 = min (imposteurs);

% size of impostor vector
num_imposteurs = length (imposteurs);

% calculation of the step
pas1 = (m0 - m1)/pas0;
x = [m1:pas1:m0]';

num = length (x);

%%%%%

%%%%% calculation of FAR and FRR

for i=1:num
fr=0;
fa=0;
for j=1:num_clients
if clients(j)<x(i)
fr=fr+1;
end
end
for k=1:num_imposteurs
if imposteurs(k)>=x(i)
fa=fa+1;
end
end
FRR(i)=100*fr/num_clients;
FAR(i)=100*fa/num_imposteurs;
end

%%%%%

%%%%% calculation of EER value

tmp1=find (FRR-FAR<=0);
tmps=length(tmp1);

if ((FAR(tmps)-FRR(tmps))<=(FRR(tmps+1)-FAR(tmps+1)))
EER=(FAR(tmps)+FRR(tmps))/2;tmpEER=tmps;
else
EER=(FRR(tmps+1)+FAR(tmps+1))/2;tmpEER=tmps+1;
end

%%%%%

%%%%% calculation of the OP value

tmp2=find (OPvalue-FAR<=0);
tmpOP=length(tmp2);

OP=FRR(tmpOP);

%%%%%

%%%%% calculation of the confidence intervals
[FARconfMIN FRRconfMIN FARconfMAX FRRconfMAX]=ParamConfInter(FAR/100,FRR/100,num_imposteurs,num_clients);

% EER
confInterEER=EER-100*(FARconfMIN(tmpEER)+FRRconfMIN(tmpEER))/2;

% Operating Point
confInterOP=OP-100*FRRconfMIN(tmpOP);

%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%% plotting of curves

% FAR vs FRR
figure(1);
plot (x,FRR,'r');
hold on;plot (x,FAR,'b');
xlabel ('Threshold');
ylabel ('Error');
title ('FAR vs FRR graph');

% interpolation for the plotting
equaX=x(tmps)*(FRR(tmps+1)-FAR(tmps+1))+x(tmps+1)*(FAR(tmps)-FRR(tmps));
equaY=FRR(tmps+1)-FAR(tmps+1)+FAR(tmps)-FRR(tmps);
threshold=equaX/equaY;
EERplot=threshold*(FAR(tmps)-FAR(tmps+1))/(x(tmps)-x(tmps+1))+(x(tmps)*FAR(tmps+1)-x(tmps+1)*FAR(tmps))/(x(tmps)-x(tmps+1));

% ROC curve
figure(2);
plot (FAR,100-FRR,'r');
xlabel ('Impostor Attempts Accepted = FAR (%)');
ylabel ('Genuine Attempts Accepted = 1-FRR (%)');
title ('ROC curve');
hold on;scatter (EERplot,100-EERplot,'ok');
hold on;scatter (FAR(tmpOP),100-FRR(tmpOP),'xk');
AXIS([0 50 50 100]);

% DET curve
figure(3);
h = Plot_DET(FRR/100,FAR/100,'r');
hold on; Plot_DET(EERplot/100,EERplot/100,'ok');
hold on; Plot_DET(FRR(tmpOP)/100,FAR(tmpOP)/100,'xk');
title ('DET curve');
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: equation for far and frr, how far away does, matlab code for sinr calculation in wireless network, matlab code for far and frr calculation, powered by mybb far northern regional center, calculation of far and frr matlab code, matlab code for far false acceptance rate,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  Request for mini hacksaw driven by beam engine calculation 0 8,605 30-03-2021, 02:13 AM
Last Post:
  industrial self supporting chimney design calculation 0 8,258 11-02-2021, 05:11 PM
Last Post:
  well-spring some homemade barbecue backchat and moistureless rubs and the actuality 0 1,025 10-09-2019, 05:48 PM
Last Post:
  agent some homemade barbecue cheek and prosaic rubs and suit 0 942 10-09-2019, 07:04 AM
Last Post:
  pass some homemade barbecue coolness and arid rubs and module 0 898 09-09-2019, 06:35 PM
Last Post:
  matlab code 1 3,438 31-01-2019, 02:52 PM
Last Post: [email protected]
  underwater optical communication matlab code 0 3,290 02-11-2018, 07:32 PM
Last Post: Guest
  source code for blood group detection in matlab 0 6,362 22-10-2018, 10:59 AM
Last Post: Guest
  hackchina matlab code 0 621 27-09-2018, 10:45 PM
Last Post: Guest
  heart disease prediction system source code for matlab 0 764 27-09-2018, 04:40 PM
Last Post: Guest

Forum Jump: