jakeret / tf_unet

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

dice coefficient not improving accuracy, stuck at 50.1% #250

Open I-CANT-CODE opened 5 years ago

I-CANT-CODE commented 5 years ago

Wondering why the dice coefficient isn't working. it pretty much stays stuck at 50.1% accuracy and -.4986 = loss each epoch. prediction images aren't doing well either. when I keep everything else the same except for the cost function, the network trains up to 80% accuracy using cross entropy. any ideas?

jis478 commented 5 years ago

Is your data imbalanced? Then can you try a modified version I've made based on this repo? I'm wondering my approach also works for other imbalanced problems.

You can simply try the below jupyter notebook file. https://github.com/jis478/Tensorflow/tree/master/Unet_modified/example/membrane/code/Unet_modified_execution.ipynb

I-CANT-CODE commented 5 years ago

@jis478 Hey, so I was looking at your repo, but I can't find the portion of the code where you modify the dice cost. Can you link me to specifically where it Is modified?

I-CANT-CODE commented 5 years ago

@jis478 Hey, so I looked at your code and found where you add a modified dice coefficient. I added this to my version of the code and I'm running it, but it doesn't seem to be helping.

I-CANT-CODE commented 5 years ago

didn't mean to close the issue my bad

jis478 commented 5 years ago

Sorry for my late reply. You can first try with the jupyter notebook with your dataset to see the improvements. I modified some parts of the original codes so you'd better start with my code to see the improvements. Please leave open an issue on my repo if it doesn't work then I can help you promptly.

stiv-yakovenko commented 5 years ago

Dear jis478, thank you so much for contributing your loss to the community, it helped me to solve my segmentation problem, otherwise it didn't work. did you have idea to merge this to this repository directly?

jis478 commented 5 years ago

You can give my repo a star then :) I will make a pull request to the original unet code as soon as possible. Thanks!