Advertisement

医学图像肝脏分割(二)----评价函数

阅读量:
一、评价函数及其实现

**1、**开源代码评价指标(标准实现)。
Scoring Program for Codalab Lits-Challenge

2、使用DICE, IOU, ASD, 等。
IOU

复制代码
    def IoU(preds, truths):
    """
    preds: [B, H, W] 
    truths: [B, H, W]
    """
    batch_size = truths.shape[0]
    ious = []
    
    for batch in range(batch_size):
        for part in range(self.nCls):
            I = np.sum(np.logical_and(preds[batch] == part, truths[batch] == part))
            U = np.sum(np.logical_or(preds[batch] == part, truths[batch] == part))
            if U == 0: 
                continue
            else:
                ious.append(I/U)
    
    return np.mean(ious)

来源

来源

Origin

二、评价函数实现工具包

编码工具:medpy(如图所示) documentation website:http://loli.github.io/medpy/#tutorials

在这里插入图片描述

全部评论 (0)

还没有任何评论哟~