DeepLabV3FineTuning icon indicating copy to clipboard operation
DeepLabV3FineTuning copied to clipboard

Questions about accuracy

Open Krissy93 opened this issue 4 years ago • 2 comments

I have some questions about the iou function in train.py. According to literature, for segmentation tasks it is computed as the intersection over union and it should be the mean over the number of classes for multiclass segmentation.

  1. Why do you compute union as tot_class_preds + tot_class_labels - intersection? I think it's wrong because the union should be just tot_class_preds + tot_class_labels...
  2. Why do you exclude the background class in the iou computation?

Plus, I suggest to add sorted in the dataloader to ensure that images and masks are loaded in correct order (otherwise the pairing may not be right):

self.imgs_files = sorted(glob.glob(os.path.join(folder_path,'Images','*.*')))
self.masks_files = sorted(glob.glob(os.path.join(folder_path,'Masks','*.*')))

Krissy93 avatar May 13 '21 09:05 Krissy93

Ah, nevermind, I found the answer to my first question! Basically by doing tot_class_preds + tot_class_labels we are considering the overlaying pixels twice, hence we should remove them to get the correct union!

Krissy93 avatar May 14 '21 09:05 Krissy93

@Krissy93 , did you find the answer to the second question too?

fabrizioschiano avatar Nov 23 '21 18:11 fabrizioschiano