I am trying to implement a U-Net with Keras with Tensorflow backend for an image segmentation task. I have images of size (128,96) as input to the network together with mask ima
In my experience, also with a U-net for segmentation. It tends to do this:
I also use the "train just one image" method to find that convergence, then adding the other images is ok.
But I had to try a lot of times, and the only time it worked pretty fast was when I used:
But I wasn't using "relu" anywhere...perhaps that influences a little the convergence speed...? Thinking about "relu", which has only 0 or positive results, there is a big region in this function that does not have a gradient. Maybe having lots of "relu" activations creates a lot of "flat" areas without gradients? (Must think better about it to confirm)
Try a few times (and have patience to wait for many many epochs) with different weight initializations.
There is a chance that your learning rate is too big too.
About to_categorical()
: have you tried to plot/print your masks? Do they really seem like what you expect them to?