How to handle the mean Intersection Over Union (mIOU) for unknown class in semantic segmentation?

旧巷老猫 提交于 2019-12-12 21:48:55

问题


I implemented a FCN network to do semantic segmentation. I am using Cityscapes as my dataset. As you know, there are some classes in Cityscapes that you ignore during the training and it is labeled as 255. I used weighted loss to ignore the loss for the unknown classes(set the loss to zero for unknown class). Now I want to exclude unknown class from my evaluation metric(mean Intersection Over Union (mIOU)).It is not clear for me how to exclude the unknown class at this point.

At the moment I am considering all the classes including the unknown class like this using tensorflow method:

 miou, confusion_mat = tf.metrics.mean_iou(labels=annotation, predictions=pred_annotation, num_classes=num_cls)

with tf.control_dependencies([tf.identity(confusion_mat)]):
    miou = tf.identity(miou)

I tried this , but it give an error for unbound label(for the unkonwn label)

miou, confusion_mat = tf.metrics.mean_iou(labels=annotation, predictions=pred_annotation, num_classes=(num_cls-1))

来源:https://stackoverflow.com/questions/55104471/how-to-handle-the-mean-intersection-over-union-miou-for-unknown-class-in-seman

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!