SlideShare une entreprise Scribd logo
1  sur  10
Name: Shivakumar Koppad
Date: 12/03/2015
Submitted to: Dr. Richard Conway
Description
Two samplefiles G.dat and I.datwith genuine and imposter sample scores
respectively were given and the following should be obtained from those.
 Plot the scoredistributions for both
 DET curve
 Determining EER
 Operation point to minimize the cost
MATLAB 2013a has been used to show the requirements
Scores Distributioncurve
The following code has been used to generate the graph to plot the score for
distribution curve.
%Name: Shivakumar Koppad
clc;
clear all;
close all;
% Importing data
load('G.dat');
load('I.dat');
% Implementing G file
gen=[0 0 0 0 0 0 0 0 0 0];
for g=1:1:1200
if 0<=G(g)<0.1
gen(1)=gen(1)+1;
elseif 0.1<=G(g)<0.2
gen(2)=gen(2)+1;
elseif 0.2<=G(g)<0.3
gen(3)=gen(3)+1;
elseif 0.3<=G(g)<0.4
gen(4)=gen(4)+1;
elseif 0.4<=G(g)<0.5
gen(5)=gen(5)+1;
elseif 0.5<=G(g)<0.6
gen(6)=gen(6)+1;
elseif 0.6<=G(g)<0.7
gen(7)=gen(7)+1;
elseif 0.7<=G(g)<0.8
gen(8)=gen(8)+1;
elseif 0.8<=G(g)<0.9
gen(9)=gen(9)+1;
else
gen(10)=gen(10)+1;
end
end
% Implementing I file
imp=[0 0 0 0 0 0 0 0 0 0];
for i=1:1:1200
if 0<=I(i)<0.1
imp(1)=imp(1)+1;
elseif 0.1<=I(i)<0.2
imp(2)=imp(2)+1;
elseif 0.2<=I(i)<0.3
imp(3)=imp(3)+1;
elseif 0.3<=I(i)<0.4
imp(4)=imp(4)+1;
elseif 0.4<=I(i)<0.5
imp(5)=imp(5)+1;
elseif 0.5<=I(i)<0.6
imp(6)=imp(6)+1;
elseif 0.6<=I(i)<0.7
imp(7)=imp(7)+1;
elseif 0.7<=I(i)<0.8
imp(8)=imp(8)+1;
elseif 0.8<=I(i)<0.9
imp(9)=imp(9)+1;
else
imp(10)=imp(10)+1;
end
end
% Defining Score
Score=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9];
hold on;
plot(Score,imp,'color','r');
plot(Score,gen,'color','b');
hold off;
xlabel('Scores')
ylabel('No. of users')
title('Distribution Diagram')
legend('genuine','imposter')
% End
Result:
In the below output of the graph, X-axis represents the scores and Y-axis
represents the count for both genuine and imposter users.
DET curve
Detection Error Tradeoff curves areROC (receiver operating characteristic) type
curves showing therange of operating points of systems performing detection
tasks as a threshold is varied to alter the miss and false alarmrates and plotted
using a normal deviate scale for each axis. DET curves have the property that if
the underlying scoredistributions for the two types of trials are normal, the curve
becomes a straightline. They havebeen widely used to present the performance
characteristics of speaker recognition systems
The below code is used to generate the DET curve. A new function name called
DET curveis created to generate the graph and to find the EER equal error rate on
the curve.
%Name: Shivakumar Koppad
%ID: 14043513
%Title: Assignment 1
%
%Submitted to: Dr.Richard Conway
function [TPR,FPR] = DETCurve(G,I)
load('G.dat');
load('I.dat');
% Creates a matrix
TPR = zeros(1, 1000);
FPR = zeros(1, 1000);
P = 1200;
N = 1200;
index = 0;
% Assume the threshold as 0.005
for threshold = 0:0.005:1
TP = 0;
FP = 0;
%Provides the genuine users count
for i = 1:1200
if (G(i) >= threshold)
TP = TP + 1;
end
end
% Provides the Imposters count
for i1 = 1:1200
if(I(i1) >= threshold)
FP = FP + 1;
end
end
index = index + 1;
% Calculating true positive rate
TPR(index) = TP/P;
% Calculating false positive rate
FPR(index) = FP/N;
end
% Calculating false negative rate(FNR) using TPR+FNR=1
FNR = (1-TPR);
x = 0:0.1:1;
y = x;
[x(i),y(i)] = polyxpoly(x,y,FPR,FNR);
fprintf('EER(X): %d n', x(i));
fprintf('EER(Y): %d n', y(i));
plot(FPR,FNR,'LineWidth',2, 'color','g');
hold on;
plot(x,y,x,1-y, 'color','r');
plot (x(i),y(i),'X','MarkerSize',10, 'LineWidth', 2,'Color','b');
hold off;
title('DET CURVE');
xlabel('False Positive Rate (FPR) ');
ylabel('False Neagtive Rate (FNR) ');
end
Result
The below is the DET curve generated
Equal error rate
A biometric security systempredetermines the threshold values for its false
acceptance rate and its false rejection rate, and when the rates are equal, the
common value is referred to as the equal error rate. The value indicates that the
proportion of falseacceptances is equal to the proportion of false rejections. The
lower the equal error rate value, the higher the accuracy of the biometric system.
Fromabove figurewe can determine EER fromthe DET curve
EER(X, Y) = (FPR, FNR) = (0.08611, 0.08611)
Cost minimization
OP_min_costis created to find a suitable point on the DET curve which minimizes
the cost
FromBayesian statistics, the Cost (C) is calculated as:
C=CFAPIFAR(T) + CFRPGFRR(T)
Where,
CFA is the costof a single false accept
CFR is the cost of a single false reject
PI is probability of imposter users
PG is probability of genuine users
Given
Cost of False accept rate is 17
Cost of false reject rate is 27
Probability of Imposter users is 0.5
Probability of Genuine users is 0.5 (Weare assuming equal probabilities)
C = 17*0.5*FAR(T) +27*0.5*FRR(T)
C = 8.5*FAR(T) +13.5*FRR(T)
13.5*FRR(T) =C- 8.5*FAR(T)
FRR(T) = [C- 8.5*FAR(T)]/13.5
FRR(T) = -0.6296*FAR(T) +C/13.5
This is in the form of y= mx+c
The following code has been used to generate the graph which can be used to
find FRR(T) and FAR(T) the point operated to minimize the cost
function [FAR, FRR] = OPcost(G,I)
load('G.dat');
load('I.dat');
%Creates a matrix
FRR = zeros(1, 1000);
FAR = zeros(1, 1000);
i = 1200;
j = 1200;
index = 0;
%Assume the threshold as 0.001
for threshold = 0:0.001:1
FN = 0;
FP = 0;
for i = 1:1200
if (G(i) <= threshold)
FN = FN + 1;
end
end
for i1 = 1:1000
if(I(i1) >= threshold)
FP = FP + 1;
end
end
index = index + 1;
FRR(index) = FN/i;
FAR(index) = FP/j;
end
hold on;
plot(FAR,FRR,'LineWidth',1,'color','c');
%To start with assume the minimum cost as 100
min = 100;
min_new=0;
for i1=1:1000
if 17*0.5*FAR(i1) + 27*0.5*FRR(i1) < min
min = 17*0.5*FAR(i1) + 27*0.5*FRR(i1);
min_new = i1;
end
end
plot(FAR(min_new),FRR(min_new),'x','MarkerSize',14);
Xmin = 0:0.05:1;
Ymin = (-0.33)*Xmin + 0.06989*min;
plot (Xmin,Ymin,'color', 'm');
hold off;
title('Operating point to minimise cost');
xlabel('FAR ');
ylabel('FRR ');
Result
According to the graph
FAR(T) = 0.02333
FRR(T) = 0.1092
Now,
13.5*FRR(T) =C- 8.5*FAR(T)
13.5*0.1092=C-8.5*0.02333
1.4742=c-0.198305
Therefore, C = 1.6725
So the cost C is 1.6725

Contenu connexe

Tendances

Noise recognition in digital image
Noise recognition in digital imageNoise recognition in digital image
Noise recognition in digital imageReyad Hossain
 
Applications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldApplications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldAshwani Srivastava
 
Independent Component Analysis
Independent Component AnalysisIndependent Component Analysis
Independent Component AnalysisTatsuya Yokota
 
Lecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard TransformLecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard TransformVARUN KUMAR
 
Face detection and recognition
Face detection and recognitionFace detection and recognition
Face detection and recognitionPankaj Thakur
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationMostafa G. M. Mostafa
 
GAN in medical imaging
GAN in medical imagingGAN in medical imaging
GAN in medical imagingCheng-Bin Jin
 
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdf
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdfDigital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdf
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdfssuserbe3944
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothningVinay Gupta
 
Image Registration (Digital Image Processing)
Image Registration (Digital Image Processing)Image Registration (Digital Image Processing)
Image Registration (Digital Image Processing)VARUN KUMAR
 
Bit plane slicing
Bit plane slicingBit plane slicing
Bit plane slicingAsad Ali
 
Lung Cancer Detection on CT Images by using Image Processing
Lung Cancer Detection on CT Images by using Image ProcessingLung Cancer Detection on CT Images by using Image Processing
Lung Cancer Detection on CT Images by using Image Processingijtsrd
 
Biometric recognition using deep learning
Biometric recognition using deep learningBiometric recognition using deep learning
Biometric recognition using deep learningSwatiNarkhede1
 
Introduction to the Artificial Intelligence and Computer Vision revolution
Introduction to the Artificial Intelligence and Computer Vision revolutionIntroduction to the Artificial Intelligence and Computer Vision revolution
Introduction to the Artificial Intelligence and Computer Vision revolutionDarian Frajberg
 
Lossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image ProcessingLossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image Processingpriyadharshini murugan
 
Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)thanh nguyen
 
Crop Yield Prediction using Machine Learning.pptx
Crop Yield Prediction using Machine Learning.pptxCrop Yield Prediction using Machine Learning.pptx
Crop Yield Prediction using Machine Learning.pptxSravyaDasari3
 
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...Bernard Marr
 

Tendances (20)

Image processing
Image processingImage processing
Image processing
 
Noise recognition in digital image
Noise recognition in digital imageNoise recognition in digital image
Noise recognition in digital image
 
Applications of Digital image processing in Medical Field
Applications of Digital image processing in Medical FieldApplications of Digital image processing in Medical Field
Applications of Digital image processing in Medical Field
 
Independent Component Analysis
Independent Component AnalysisIndependent Component Analysis
Independent Component Analysis
 
Lecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard TransformLecture 15 DCT, Walsh and Hadamard Transform
Lecture 15 DCT, Walsh and Hadamard Transform
 
Face detection and recognition
Face detection and recognitionFace detection and recognition
Face detection and recognition
 
Digital Image Processing: Image Segmentation
Digital Image Processing: Image SegmentationDigital Image Processing: Image Segmentation
Digital Image Processing: Image Segmentation
 
GAN in medical imaging
GAN in medical imagingGAN in medical imaging
GAN in medical imaging
 
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdf
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdfDigital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdf
Digital Image Processing 3rd edition Rafael C. Gonzalez, Richard E. Woods.pdf
 
Digital image processing img smoothning
Digital image processing img smoothningDigital image processing img smoothning
Digital image processing img smoothning
 
Image Registration (Digital Image Processing)
Image Registration (Digital Image Processing)Image Registration (Digital Image Processing)
Image Registration (Digital Image Processing)
 
Bit plane slicing
Bit plane slicingBit plane slicing
Bit plane slicing
 
Lung Cancer Detection on CT Images by using Image Processing
Lung Cancer Detection on CT Images by using Image ProcessingLung Cancer Detection on CT Images by using Image Processing
Lung Cancer Detection on CT Images by using Image Processing
 
Object detection
Object detectionObject detection
Object detection
 
Biometric recognition using deep learning
Biometric recognition using deep learningBiometric recognition using deep learning
Biometric recognition using deep learning
 
Introduction to the Artificial Intelligence and Computer Vision revolution
Introduction to the Artificial Intelligence and Computer Vision revolutionIntroduction to the Artificial Intelligence and Computer Vision revolution
Introduction to the Artificial Intelligence and Computer Vision revolution
 
Lossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image ProcessingLossless predictive coding in Digital Image Processing
Lossless predictive coding in Digital Image Processing
 
Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)
 
Crop Yield Prediction using Machine Learning.pptx
Crop Yield Prediction using Machine Learning.pptxCrop Yield Prediction using Machine Learning.pptx
Crop Yield Prediction using Machine Learning.pptx
 
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...
Artificial Intelligence Can Now Generate Amazing Images – What Does The Mean ...
 

En vedette

Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.
Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.
Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.Shiv Koppad
 
CIsco ACL- Network and host security
CIsco ACL- Network and host securityCIsco ACL- Network and host security
CIsco ACL- Network and host securityShiv Koppad
 
Data Forensics-Tool to display the deleted partition information
Data Forensics-Tool to display the deleted partition informationData Forensics-Tool to display the deleted partition information
Data Forensics-Tool to display the deleted partition informationShiv Koppad
 
IT Asset Management System for UL-Software Engineering
IT Asset Management System for UL-Software EngineeringIT Asset Management System for UL-Software Engineering
IT Asset Management System for UL-Software EngineeringShiv Koppad
 
How to read a receiver operating characteritic (ROC) curve
How to read a receiver operating characteritic (ROC) curveHow to read a receiver operating characteritic (ROC) curve
How to read a receiver operating characteritic (ROC) curveSamir Haffar
 

En vedette (8)

Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.
Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.
Shivkumar_koppad_14043513_EE6093_FInal Ecopy submission.
 
CIsco ACL- Network and host security
CIsco ACL- Network and host securityCIsco ACL- Network and host security
CIsco ACL- Network and host security
 
Data Forensics-Tool to display the deleted partition information
Data Forensics-Tool to display the deleted partition informationData Forensics-Tool to display the deleted partition information
Data Forensics-Tool to display the deleted partition information
 
IT Asset Management System for UL-Software Engineering
IT Asset Management System for UL-Software EngineeringIT Asset Management System for UL-Software Engineering
IT Asset Management System for UL-Software Engineering
 
Instagram Posts
Instagram PostsInstagram Posts
Instagram Posts
 
Roc
RocRoc
Roc
 
How to read a receiver operating characteritic (ROC) curve
How to read a receiver operating characteritic (ROC) curveHow to read a receiver operating characteritic (ROC) curve
How to read a receiver operating characteritic (ROC) curve
 
14047721
1404772114047721
14047721
 

Similaire à BIometrics- plotting DET and EER curve using Matlab

Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
LAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfLAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfRavinReddy3
 
Interactive Transmission System Computation Unit
Interactive Transmission System Computation UnitInteractive Transmission System Computation Unit
Interactive Transmission System Computation Unitmayankraj0805
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignmentSaket Pathak
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7alish sha
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classificationYanchang Zhao
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxSALU18
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxNithya K
 
Runtime Code Generation and Data Management for Heterogeneous Computing in Java
Runtime Code Generation and Data Management for Heterogeneous Computing in JavaRuntime Code Generation and Data Management for Heterogeneous Computing in Java
Runtime Code Generation and Data Management for Heterogeneous Computing in JavaJuan Fumero
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2Don Dooley
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab FileKandarp Tiwari
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programsAnanda Kumar HN
 

Similaire à BIometrics- plotting DET and EER curve using Matlab (20)

Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
LAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfLAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdf
 
Interactive Transmission System Computation Unit
Interactive Transmission System Computation UnitInteractive Transmission System Computation Unit
Interactive Transmission System Computation Unit
 
C++ lab assignment
C++ lab assignmentC++ lab assignment
C++ lab assignment
 
Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7Dam31303 dti2143 lab sheet 7
Dam31303 dti2143 lab sheet 7
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
C faq pdf
C faq pdfC faq pdf
C faq pdf
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
RDataMining slides-regression-classification
RDataMining slides-regression-classificationRDataMining slides-regression-classification
RDataMining slides-regression-classification
 
05-Debug.pdf
05-Debug.pdf05-Debug.pdf
05-Debug.pdf
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Gpus graal
Gpus graalGpus graal
Gpus graal
 
statistics assignment help
statistics assignment helpstatistics assignment help
statistics assignment help
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
 
Runtime Code Generation and Data Management for Heterogeneous Computing in Java
Runtime Code Generation and Data Management for Heterogeneous Computing in JavaRuntime Code Generation and Data Management for Heterogeneous Computing in Java
Runtime Code Generation and Data Management for Heterogeneous Computing in Java
 
2 EPT 162 Lecture 2
2 EPT 162 Lecture 22 EPT 162 Lecture 2
2 EPT 162 Lecture 2
 
Computer Networks Lab File
Computer Networks Lab FileComputer Networks Lab File
Computer Networks Lab File
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 

BIometrics- plotting DET and EER curve using Matlab

  • 1. Name: Shivakumar Koppad Date: 12/03/2015 Submitted to: Dr. Richard Conway Description
  • 2. Two samplefiles G.dat and I.datwith genuine and imposter sample scores respectively were given and the following should be obtained from those.  Plot the scoredistributions for both  DET curve  Determining EER  Operation point to minimize the cost MATLAB 2013a has been used to show the requirements Scores Distributioncurve The following code has been used to generate the graph to plot the score for distribution curve. %Name: Shivakumar Koppad clc; clear all; close all; % Importing data load('G.dat'); load('I.dat'); % Implementing G file gen=[0 0 0 0 0 0 0 0 0 0]; for g=1:1:1200 if 0<=G(g)<0.1 gen(1)=gen(1)+1; elseif 0.1<=G(g)<0.2 gen(2)=gen(2)+1; elseif 0.2<=G(g)<0.3 gen(3)=gen(3)+1; elseif 0.3<=G(g)<0.4 gen(4)=gen(4)+1; elseif 0.4<=G(g)<0.5 gen(5)=gen(5)+1; elseif 0.5<=G(g)<0.6 gen(6)=gen(6)+1; elseif 0.6<=G(g)<0.7 gen(7)=gen(7)+1; elseif 0.7<=G(g)<0.8 gen(8)=gen(8)+1;
  • 3. elseif 0.8<=G(g)<0.9 gen(9)=gen(9)+1; else gen(10)=gen(10)+1; end end % Implementing I file imp=[0 0 0 0 0 0 0 0 0 0]; for i=1:1:1200 if 0<=I(i)<0.1 imp(1)=imp(1)+1; elseif 0.1<=I(i)<0.2 imp(2)=imp(2)+1; elseif 0.2<=I(i)<0.3 imp(3)=imp(3)+1; elseif 0.3<=I(i)<0.4 imp(4)=imp(4)+1; elseif 0.4<=I(i)<0.5 imp(5)=imp(5)+1; elseif 0.5<=I(i)<0.6 imp(6)=imp(6)+1; elseif 0.6<=I(i)<0.7 imp(7)=imp(7)+1; elseif 0.7<=I(i)<0.8 imp(8)=imp(8)+1; elseif 0.8<=I(i)<0.9 imp(9)=imp(9)+1; else imp(10)=imp(10)+1; end end % Defining Score Score=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9]; hold on; plot(Score,imp,'color','r'); plot(Score,gen,'color','b'); hold off; xlabel('Scores') ylabel('No. of users') title('Distribution Diagram') legend('genuine','imposter') % End Result: In the below output of the graph, X-axis represents the scores and Y-axis represents the count for both genuine and imposter users.
  • 4. DET curve Detection Error Tradeoff curves areROC (receiver operating characteristic) type curves showing therange of operating points of systems performing detection tasks as a threshold is varied to alter the miss and false alarmrates and plotted using a normal deviate scale for each axis. DET curves have the property that if the underlying scoredistributions for the two types of trials are normal, the curve becomes a straightline. They havebeen widely used to present the performance characteristics of speaker recognition systems The below code is used to generate the DET curve. A new function name called DET curveis created to generate the graph and to find the EER equal error rate on the curve. %Name: Shivakumar Koppad %ID: 14043513 %Title: Assignment 1 % %Submitted to: Dr.Richard Conway
  • 5. function [TPR,FPR] = DETCurve(G,I) load('G.dat'); load('I.dat'); % Creates a matrix TPR = zeros(1, 1000); FPR = zeros(1, 1000); P = 1200; N = 1200; index = 0; % Assume the threshold as 0.005 for threshold = 0:0.005:1 TP = 0; FP = 0; %Provides the genuine users count for i = 1:1200 if (G(i) >= threshold) TP = TP + 1; end end % Provides the Imposters count for i1 = 1:1200 if(I(i1) >= threshold) FP = FP + 1; end end index = index + 1; % Calculating true positive rate TPR(index) = TP/P; % Calculating false positive rate FPR(index) = FP/N; end % Calculating false negative rate(FNR) using TPR+FNR=1 FNR = (1-TPR); x = 0:0.1:1; y = x; [x(i),y(i)] = polyxpoly(x,y,FPR,FNR); fprintf('EER(X): %d n', x(i)); fprintf('EER(Y): %d n', y(i)); plot(FPR,FNR,'LineWidth',2, 'color','g'); hold on; plot(x,y,x,1-y, 'color','r'); plot (x(i),y(i),'X','MarkerSize',10, 'LineWidth', 2,'Color','b'); hold off; title('DET CURVE'); xlabel('False Positive Rate (FPR) '); ylabel('False Neagtive Rate (FNR) '); end
  • 6. Result The below is the DET curve generated
  • 7. Equal error rate A biometric security systempredetermines the threshold values for its false acceptance rate and its false rejection rate, and when the rates are equal, the common value is referred to as the equal error rate. The value indicates that the proportion of falseacceptances is equal to the proportion of false rejections. The lower the equal error rate value, the higher the accuracy of the biometric system. Fromabove figurewe can determine EER fromthe DET curve EER(X, Y) = (FPR, FNR) = (0.08611, 0.08611) Cost minimization OP_min_costis created to find a suitable point on the DET curve which minimizes the cost FromBayesian statistics, the Cost (C) is calculated as: C=CFAPIFAR(T) + CFRPGFRR(T) Where, CFA is the costof a single false accept CFR is the cost of a single false reject PI is probability of imposter users PG is probability of genuine users Given Cost of False accept rate is 17 Cost of false reject rate is 27 Probability of Imposter users is 0.5 Probability of Genuine users is 0.5 (Weare assuming equal probabilities) C = 17*0.5*FAR(T) +27*0.5*FRR(T)
  • 8. C = 8.5*FAR(T) +13.5*FRR(T) 13.5*FRR(T) =C- 8.5*FAR(T) FRR(T) = [C- 8.5*FAR(T)]/13.5 FRR(T) = -0.6296*FAR(T) +C/13.5 This is in the form of y= mx+c The following code has been used to generate the graph which can be used to find FRR(T) and FAR(T) the point operated to minimize the cost
  • 9. function [FAR, FRR] = OPcost(G,I) load('G.dat'); load('I.dat'); %Creates a matrix FRR = zeros(1, 1000); FAR = zeros(1, 1000); i = 1200; j = 1200; index = 0; %Assume the threshold as 0.001 for threshold = 0:0.001:1 FN = 0; FP = 0; for i = 1:1200 if (G(i) <= threshold) FN = FN + 1; end end for i1 = 1:1000 if(I(i1) >= threshold) FP = FP + 1; end end index = index + 1; FRR(index) = FN/i; FAR(index) = FP/j; end hold on; plot(FAR,FRR,'LineWidth',1,'color','c'); %To start with assume the minimum cost as 100 min = 100; min_new=0; for i1=1:1000 if 17*0.5*FAR(i1) + 27*0.5*FRR(i1) < min min = 17*0.5*FAR(i1) + 27*0.5*FRR(i1); min_new = i1; end end plot(FAR(min_new),FRR(min_new),'x','MarkerSize',14); Xmin = 0:0.05:1; Ymin = (-0.33)*Xmin + 0.06989*min; plot (Xmin,Ymin,'color', 'm'); hold off; title('Operating point to minimise cost'); xlabel('FAR '); ylabel('FRR ');
  • 10. Result According to the graph FAR(T) = 0.02333 FRR(T) = 0.1092 Now, 13.5*FRR(T) =C- 8.5*FAR(T) 13.5*0.1092=C-8.5*0.02333 1.4742=c-0.198305 Therefore, C = 1.6725 So the cost C is 1.6725