1
$\begingroup$

I'm working on an image classification problem where each test image (query image) is compared with a set of candidate images (of which several images are considered as "correct answers" or "relevant"). From this comparison, a similarity measure is computed. The candidates are sorted decreasingly based on their similarity to the query image. So, basically, we are generating a ranking such as the ones generated by search engines. To evaluate such systems, it's typical to use mean average precision (MAP) and precision-vs-recall plots. However, I came across something with which I'm not familiar, which is the rank-vs-identification plot. From its name, I assume that this plot shows the identification rate at each rank. My problem is how to compute the chance curve for such a plot. Specifically, I have the following piece of code, which was extracted from the code used to generated Figure 3 of the following paper:

http://crcv.ucf.edu/papers/cvpr2014/Resemblance_CVPR14.pdf

This code is for the chance curve only. I am hoping that someone would help me understand how the chance plot was generated and what the variables x and xMax stand for.

%%A snippet of Matlab code:

fSize = 15;

% Compute Chance xMax = 54; ranks = [1 2 3 4 5:5:xMax]'; x = 8;% x value in the equation. c = ones(length(ranks),1); % the equation that calculates the chance value for r = 1 : length(ranks) if ranks(r) >= xMax; break; end % c(r) = 1 - (nchoosek(xMax-1,ranks(r)) / nchoosek(xMax,ranks(r))); % c(r) = 1 - (xMax - ranks(r))/xMax; c(r) = 1 - newc(xMax-ranks(r),x) / newc(xMax,x); end

leg1 = {'Chance'}; figure(1); semilogx(ranks,c,'linewidth',3,'color',[1,0,0]); set(gca,'FontSize',fSize); hold on; psAll = zeros(length(ranks)); figure(1); legend(leg1,'Location','SouthEast','FontSize',fSize); grid; xlim([1 1000]) xlabel('Rank','FontSize',fSize,'FontWeight','bold'); ylabel('Identification Rate','FontSize',fSize,'FontWeight','bold'); xMaxStr = num2str(xMax); set(gca,'XTick',[1 10 100 1000]);

% newc function used in the above piece of code

function res = newc(n,x)

res = n - x + 1 : 1 : n; res = prod(res);

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.