简体   繁体   中英

CNN Semantic segmentation network (UNET) performing poorly when tested with images

我正在构建一个 UNET 语义分割网络,为了检测眼睛图像中的虹膜,我们使用 DICE 损失函数,我们实现了超过 90% 的训练平均 IOU 和大约 87% 的验证数据,但验证损失和平均 IOU 在此期间显示出波动200 个时期,当我们测试我们的网络时,它显示出非常糟糕的结果,即使我们使用训练集中的图像,输出图像也与真实情况完全不同,它仍然表现不佳,关于我们可以做些什么来克服这个问题的任何建议.

Is the dataset public? You can find some good resources and guidance here: https://github.com/NVIDIA/DeepLearningExamples/tree/master/TensorFlow2/Segmentation/UNet_Medical you will find also benchmark results. I think they are usinf ADAM optimizer with 0.0001 learning rate. More details in the training process section.

What does your implementation of the DSC Loss look like? And what is the activation function you're using? I've personally used:

def dice_coef(y_true, y_pred, smooth=1e-3):
    y_true_f = K.flatten(y_true)
    y_pred_f = K.flatten(y_pred)
    intersection = K.sum(y_true_f * y_pred_f)
    dice = (2. * intersection + smooth) / (K.sum(y_true_f) + K.sum(y_pred_f) + smooth)
    return dice

def dice_coef_loss(y_true, y_pred):
    return 1 - dice_coef(y_true, y_pred)

as the loss function and metric in several U-Net segmentation architectures, and sigmoid as the activation function (assuming it's a binary classification problem). Also, if you're optimizing for IOU, you may want to change your loss to be an IOU loss - something along the lines of:

def iou(y_true, y_pred, smooth=1e-3):
    intersection = K.sum(K.abs(y_true * y_pred), axis=-1)
    union = K.sum((y_true,-1) + K.sum(y_pred,-1) - intersection
    return (intersection + smooth) / ( union + smooth)

def iou_loss(y_true, y_pred):
    return -iou_coef(y_true, y_pred)

Hope this helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM