jakeret / tf_unet

Generic U-Net Tensorflow implementation for image segmentation
GNU General Public License v3.0
1.9k stars 748 forks source link

Questions about UNet architecture and Dice loss #58

Open haichaoyu opened 7 years ago

haichaoyu commented 7 years ago

Hello,

I have two questions about the UNet architecture and Dice loss function:

  1. In the UNet paper, there is no Relu layer after the final conv. In experiments of my implemented version of UNet, such a Relu doesn't help. I don't whether the Relu in Line 136, unet.py helps or not.
  2. IMHO, Dice loss can be regarded as # of True Positives / (# of Positives + # of False Positives), but the Dice loss in Line 231, unet.py count both positives and negatives if I understand the code correctly.

Please correct me if I am wrong. Thanks.

jakeret commented 7 years ago

Hi @haichaoyu thanks for reporting this. 1) I think you're right. The code diverges from the paper architecture. There is no particular reason why I added this. ATM I'm not sure how it affects the performance.

2) Someone send a PR addressing this. Would love to hear your thoughts on this.

haichaoyu commented 7 years ago

@jakeret Hi, I added a new version of dice loss but did not test them. Sorry about that.

jakeret commented 7 years ago

Thanks I'll have a look