qubvel / segmentation_models

Segmentation models with pretrained backbones. Keras and TensorFlow Keras.
MIT License
4.66k stars 1.03k forks source link

Incorporating sample weights in loss function #578

Open marlens123 opened 7 months ago

marlens123 commented 7 months ago

hey, thanks for providing this great repository! I am working on using the sm.Unet model for semi-supervised segmentation with categorical focal dice loss function. My current goal is to implement sample weights in the loss function to scale the loss depending on the quality of the sample, as is possible in tf loss functions (e.g. https://www.tensorflow.org/api_docs/python/tf/keras/losses/CategoricalCrossentropy). I was wondering if anyone here has worked on this before, and would be happy to exchange ideas!