orobix / retina-unet

Retina blood vessel segmentation with a convolutional neural network
1.26k stars 468 forks source link

uncertainty of label #33

Closed Cherry2410 closed 6 years ago

Cherry2410 commented 7 years ago

Hi,I am running this model on another data set.For this code,I have two questions.

  1. In the training process, ./lib help_functions the method of mask_Unet
           if  masks[i,j] == 0:
                new_masks[i,j,0]=1
                new_masks[i,j,1]=0
            else:
                new_masks[i,j,0]=0
                new_masks[i,j,1]=1

    why do you always make the value of 'new_masks[i,j,1]' equal to the 'masks[i,j]'s'? Suppose there are 3 classes,

    if  masks[i,j] == 0:
           new_masks[i,j,0]=0
           new_masks[i,j,1]=0
           new_masks[i,j,2]=0
    elif masks[i,j] == 1:
           new_masks[i,j,0]=0
           new_masks[i,j,1]=0
           new_masks[i,j,2]=1
    else:
           new_masks[i,j,0]=0
           new_masks[i,j,1]=1
           new_masks[i,j,2]=0

    whether it is correct or not? 2.Correspondingly,in the predict process,./lib help_function the method of pred_to_imgs

    if mode=="original":
        for i in range(pred.shape[0]):
            for pix in range(pred.shape[1]):
                pred_images[i,pix]=pred[i,pix,1]

    I want to know the reason why pred_images[i,pix]=pred[i,pix,1] instead of pred_images[i,pix]=pred[i,pix,0]. Is it correct thatthe pred_images[i,pix]=max(pred[i,pix,:]) takes place of pred_images[i,pix]=pred[i,pix,1]? your help is greatly appreciated. Thanks.