orobix / retina-unet

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

U-net Architecture of expansion path #50

Open AllBecomesGood opened 6 years ago

AllBecomesGood commented 6 years ago

Hey,

I'm curious about your expansion path. From retina-unet/src/retinaNN_training.py:

    up1 = UpSampling2D(size=(2, 2))(conv3)
    up1 = concatenate([conv2,up1],axis=1)
    conv4 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(up1)
    conv4 = Dropout(0.2)(conv4)
    conv4 = Conv2D(64, (3, 3), activation='relu', padding='same',data_format='channels_first')(conv4)

I am not 100% sure, but I think there's a 2x2 convolution missing. From the U-net white paper:

Every step in the expansive path consists of an upsampling of the feature map followed by a 2x2 convolution (“up-convolution”) that halves the number of feature channels, a concatenation with the correspondingly cropped feature map from the contracting path, and two 3x3 convolutions, each followed by a ReLU.

So: Upsampling then 2x2 Convolution then the concatenation then 3x3 convolution then a second 3x3 convolution

I have to admit, I find the wording of the paper a bit confusing, so I wanted to ask you, what you think about this. Did you maybe leave the layer out on purpose? Or just an oversight? I'm currently trying to get a U-net for MRI brain tumour segmentation going, but I'm running out of ideas why it fails (It reproduces the full brain rather than only the tumour area) so in my search I came across your repo and the difference in layer architecture.

Kind regards

Edit: I believe maybe in Keras 1 and 2 the setup of the layers is a bit different.

mariogarcc commented 1 year ago

Has this been fixed? I (as an amateur) don't really understand what's missing from the code.