# How do I evaluate the performance of a segmentation algorithm?

I'm currently on a project of liver tumor segmentation. I segmented the liver using region growing, and I have to assess how accurate the result is. I recently learnt that there are certain metrics for assessing the accuracy of the region growing algorithm segmentation, like Tanimoto Coefficient, Correlation, etc. But I don't know how to implement them in Matlab. Check out https://stackoverflow.com/questions/9553204/tanimoto-coefficient-using-matlab

• – Emre Mar 16 '12 at 9:43
• You should elaborate on what work you have done so far. It is okay to refer to your other question on the same topic, but people should have reasonable idea about the context of the question. – Dipan Mehta Mar 16 '12 at 9:56
• Actually I have used region growing approach for segmentation and extracted the liver region. I recently learnt that there are certain metrics for assessing the accuracy of the region growing algorithm segmentation, like Tanimoto Coefficient, Correlation, etc. But I don't know how to implement them in Matlab. Check out stackoverflow.com/questions/9553204/… Kindly guide me. – Gomathi Mar 16 '12 at 15:37
• So you have got farther than you you lead us to believe. Which part of the algorithm are you having difficulty in implementing? – Emre Mar 16 '12 at 17:25
• @Emre :Tanimoto Coefficient. I don't know how to implement it in Matlab. Someone told me that for a correct result, it involves several loops. But, am new to Matlab and image processing. That's why am unable to implement it. Can you kindly guide me? – Gomathi Mar 22 '12 at 14:22

Given that you are working only on Tanimoto Coefficient, i am trying to be more specific rather than giving generic answer with various different approaches.

The basic notation of Tanimoto Coefficient is as follows:

$$T(A,B) = { N_{AB} \over N_A + N_B - N_{AB} }$$

where $T$ is the desired result, over $A$ and $B$ images.

In this measure, we identify pixels either as belonging to a given segment i.e. it is segment pixel or it is background.
$N$ refers to number of pixels that are classified as segment pixel in the respective image. And $N_{AB}$ refers to the number of pixels which are classified as segment pixel in both images.

In this measure all pixels which qualifies as neither in A nor B is not calculated; only the pixels.

Also, both image must have same resolution and must have identical locations to for the segmented objects else even if the segmentation shape is right, the resultant overlap may not be right.

I am not getting into your MATLAB code, but here is the pseudo code that looks like.

Initialize N_A, N_B, N_AB;
for( all pixels @ x,y)
{
if(image_A[x][y] == SEGMENT_CLASS_PIXEL)
N_A += 1;

if(image_B[x][y] == SEGMENT_CLASS_PIXEL)
N_A += 1;

if(image_A[x][y] == SEGMENT_CLASS_PIXEL
&& image_B[x][y] == SEGMENT_CLASS_PIXEL)
N_AB += 1;

}

T = N_AB / (N_A + N_B - N_AB);

• Thank you so much Sir. I got a good idea about it now. I will try implementing it. Thanks, again. – Gomathi Mar 27 '12 at 5:44