image-segmentation-keras icon indicating copy to clipboard operation
image-segmentation-keras copied to clipboard

Loss Functions and Segmentation metrics

Open ansariyusuf opened this issue 4 years ago • 2 comments
trafficstars

Hi,

I trained the model as shown in the tutorial and noticed that the default loss function is cross-entropy. Is there a way I can train the network with other loss functions, like dice loss, IoU loss, combo loss, etc? Also, I would appreciate it if there is a way to evaluate the performance of the model on different segmentation metrics, like, precision, accuracy, IoU, dice coefficient, etc.

Kindly assist and provide potential directions

Yusuf

ansariyusuf avatar May 12 '21 09:05 ansariyusuf

yes, you can do that, you will need to play with train.py file, maybe add the loss you are interested in and call it under Line 114 https://github.com/divamgupta/image-segmentation-keras/blob/dc830bbd76371aaedbf8cb997bdedca388c544c4/keras_segmentation/train.py#L114

h-sami-ullah avatar May 15 '21 03:05 h-sami-ullah

Changing to custom loss and metric still reports accuracy and cross-entropy. It doesn't have errors, it simply just reports accuracy even if you change it.

mavaylon1 avatar Nov 29 '21 21:11 mavaylon1