Submitted by jantonio78 t3_ydggf6 in deeplearning
Hello there!
I'm trying to segment masses in medical images with a modified u-net network. The medical images are big files (with a corresponding mask) that are split into small square images that are then used to train the model, using dice score as metric and 1-dice as loss. The thing is that most square images do not have any mass in them, so the data is very unbalanced and I get a really low dice score that improves very slowly.
I'm using Keras, and I fit the model with a generator. I tried returning a custom weight array for each sample (Keras allows this). For example, if I have a (32, 32, 1) image, with a (32, 32, 1) mask, I also return a (32, 32, 1) array that has a 1 where the mask has a 0 and a 100 where the mask has a 1. While that changes the loss value, the dice score doesn't improve faster.
I would really appreciate any help, hint or advice to make this work.
pornthrowaway42069l t1_itsbufj wrote
I'd try some baseline/simpler models on the same data and see how it performs. Maybe the model just can't do any better, that's always a good one to check before panicking.
You can also try to use K-means or DBSCAN or something like that, and try to get 2 clusters of results - see if those algos can segment your data better than your network. If so, maybe the network is set up incorrectly somehow, if not, maybe something funky happening to your data in pipeline.