-1

I would like to ask if there are other good metrics for segmentation tasks in deep learning except for IOU (intersection over union)?

Because some times i got NaN results from IOU, Just wondering maybe there are some other metrics that can help to observe the performance of the model.

def IoU(
        targets: np.array,
        outputs: np.array,
) -> np.array:
    intersection = np.sum(
        outputs * targets,
        axis=(0, 1)
    )
    union = np.sum(
        outputs + targets,
        axis=(0, 1)
    ) - intersection

    return np.mean(intersection / union)
NickMa
  • 1
  • 1

1 Answers1

0

Try this method for IOU

intersection = np.logical_and(target, prediction)
union = np.logical_or(target, prediction)
iou_score = np.sum(intersection) / np.sum(union)
Abhishek Prajapat
  • 1,793
  • 2
  • 8
  • 19