Clear Filters
Clear Filters

How can I find the recognition rate of my face recognition program and plot a graph?

1 view (last 30 days)
I am doing a project on face recognition using sparse representation. I am getting a desired output. Now,I want to calculate the recognition rate and plot a graph or a histogram. How can I do it?

Accepted Answer

John D'Errico
John D'Errico on 18 Mar 2015
I'm a bit confused. You have a set of images, some with faces, some with none. You run your program on each. It tells you if and where the face was. You can then verify if it was right.
The recognition rate is simply the number of times your code recognized a face that was there.
There would also be false positive rates, so the fraction of times it saw a face and there was none to be found at that location in that image.
And finally, you would care about a false negative rate, so the fraction of times it missed a face that was there.
But all of these things are simply a ratio: number of events divided by total number of images. So what is the problem?
As for a plot, I'm not sure what you want to plot, but I would think a bar chart of those rates would be of minor interest.
help bar
  3 Comments
John D'Errico
John D'Errico on 19 Mar 2015
For each image, you know if it has a face (or faces) and where they are, or if there are none. So count the events. Pencil and paper will suffice.
Of those 400 images, some should have faces, some should not, otherwise you are not running a fair test. And some of those images that lack a face, should still have something that is in some way, close to a face. Again, if not, then you are not testing your algorithm. So an image should have a roughly round patch that might be flesh colored, or nearly so. So an image with a pastel pinkish balloon in it would be one good test. An image with a picture of an ape of some sort. Your test set should contain pictures of men with beards, etc.
As for how to take the ration, a ratio is one number divided by another. What is the problem here?
falsePositiveRate = (number of faces seen that were not there)/...
(number of images with no faces)
falseNegativeRate = (number of faces not seen, when there was a face to be seen)/...
(number of images with a face in them)
SAMVIT MAHARAJ
SAMVIT MAHARAJ on 19 Mar 2015
Thank You Sir,
I am still struggling to understand a few things you said. I am using ORL database so it has faces in all pictures.
400 images as in faces of 40 person with 10 distinct expressions. Faces are seen in all cases. No beard or any occlusion. So as per your definition of FAR and FRR I dont think it exists in my database.
And the ratio thing.... Suppose I have img1 as my test image and imag2 as my output recognized image ....with this how am I going to calculate the recognition rate. From all the conversation till now I understood that recognition rate is number of recognized images divided by total number of image. How am I going to find out these recognized images? Do I have to calculate manually? As in 10 images,Of these 10 images how many exactly match divided by 10?

Sign in to comment.

More Answers (3)

Image Analyst
Image Analyst on 19 Mar 2015
You want to construct an "ROC curve". See Wikipedia for more info: http://en.wikipedia.org/wiki/Receiver_operating_characteristic
  3 Comments
Image Analyst
Image Analyst on 20 Mar 2015
Sorry, I don't have any ROC Curve programs. Maybe you can look in the File Exchange. I think that one of the toolboxes has ROC stuff in it but I don't remember which one - maybe Statistics?

Sign in to comment.


Ragavendran Govindaraj Rangaraj
I need the same plot. Did you find the way ?, if so please try to help me I have totally 35 set of images and I have run the algorithm and I have taken FNR, FPR, I don't know how to plot the graph.

Meghna Ramsnehi
Meghna Ramsnehi on 26 Feb 2017
I'm doing PCA, i have done implementing algorithm. but i'm confused with plotting this ROC curve. had anyone got that? Can anyone help. Please revert soon.

Community Treasure Hunt

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

Start Hunting!