问题
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