qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mIoU of semantic segmentation for incorrect Prediction.

Gil-TakKong opened this issue · comments

Hi!

I am wondering about mIoU method.
When I calculate mIoU of an image with incorrect prediction, if there are wrong label region, the IoU of the label is nan, not 0.

Here is the example.

Class in Ground Truth : Background, L1, L2
Class in Prediction : Background, L1, L2, L3

(1) mIoU = {IoU(BG) + IoU(L1) + IoU(L2)} / 3
Is it right?

I think, the formular should be
(2) mIoU = {IoU(BG) + IoU(L1) + IoU(L2) + IoU(L3)} / 4

If (1) is right, could you explain about why the IoU of L3 is not included?

Thank you.