Reputation: 31
I used a detection algorithm to detect the object in 100 images, with each image containing exactly 2 truth, i.e., each image contains 2 objects. then I added noise and find the best one. I calculated the intersection area between detection result and the ground truth intArea, and also the union area unionArea = rectA + rectB - intArea. then I planned to use these ratios to draw ROC curve as follows:
init TP, FP as 100X1 array.
for threshold = 0..1, step = 0.01
curIdx = 1;
for each ratio(i), i = 1..100
if ratio(i) > threshold then
TP(curIdx) = TP(curIdx) + 1;
else
FP(curIdx) = FP(curIdx) + 1;
end
end
then I used TP/100 as Y axis value, and TP/(TP+FP) as X axis value to draw ROC curve. but the result is not as expected: (I can't post image now because I'm a new user -_-) https://lh4.googleusercontent.com/-cuNKyobdV7E/UMkiJmrhTFI/AAAAAAAAEQg/B5twqcZtlQA/s560/roc.jpg
So, would anyone plz help me and tell me where I was wrong? thank you all!
Upvotes: 3
Views: 2653
Reputation: 348
If you want to know the internals of ROC graph generation, you can read Tom Fawcett's report on ROC Graphs or his ScienceDirect article.
If you just want to generate the plots without going to its technicalities, you can use Yard phyton library or ROCR R package
Upvotes: 0
Reputation: 79
VLFeat implements a very easy way to draw ROC curve under the Matlab environment. Please check this link: http://www.vlfeat.org/overview/plots-rank.html
Upvotes: 1