How to Plot precision recall curve for semantic segmenttaion
2 views (last 30 days)
Show older comments
I have done training and testing for semantic segmentation. I want to make a graph of my precision recall. I have got precision and recall values when validating images. but i don't know how to plot percurve charts. The following is the code that I made
pic = 8;
I = readimage(imdsTest, pic); %ib
Ib = readimage(pxdsTest,pic);
BC = labeloverlay(I, Ib,'Colormap',cmap,'Transparency',0.5);
C = semanticseg(I, net);
B = labeloverlay(I,C,'Colormap',cmap,'Transparency',0.5);%cb
imshowpair (B, BC,'montage')
pixelLabelColorbar(cmap, classes)
title ('prediction vs groundtruth')
expectedResult = readimage(pxdsTest,pic);
actual = uint8(C);
expected = uint8(expectedResult);
imshowpair(actual,expected)
iou = bfscore(C,expectedResult);
[recall,precision,prediction]=bfscore(C,expectedResult)
table(classes',recall ,precision, iou)
the results of this program are as follows
ans =
Var1 recall precision iou
____________ _______ _________ _______
"crack" 0.34446 0.25696 0.34446
"background" 0.53501 0.60656 0.53501
to be able to make precision recall plots. What should I do? Please help me
1 Comment
Answers (1)
Chinmay Budhiraja
on 18 Jun 2020
Hi,
According to my understanding, you want to study the precision recall curve for a task. We use ROC curve (Receiver Operating Characteristic Curve) for the same. Consider the following example:
load simplecluster_dataset
net = patternnet(20);
net = train(net,simpleclusterInputs,simpleclusterTargets);
simpleclusterOutputs = sim(net,simpleclusterInputs);
plotroc(simpleclusterTargets,simpleclusterOutputs)
0 Comments
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!