Images without foreground cass in the training #1140
-
Is it a problem to have a portion of the training image without any foreground class? I think it won't help training the network since the dice score and entropy loss cannot be computed for those cases ; is it correct? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi, this should not be a problem at all. There might be some stdout warning that you can ignore. I would still include these cases in the training because the model will be more robust if it also sees cases where nothing should be predicted. The dice loss is defined for those cases of course and it will push the network to predict nothing if nothing is present |
Beta Was this translation helpful? Give feedback.
-
Just to make sure I understand correctly: The dice loss is defined as:
So for images (or patches) without foreground case, the dice loss will be 0 no matter if there are false positives or not. That is why I said (too quickly) "the dice loss is not defined for those cases" ; I meant it will not be affected by those cases. But looking more closely, I understand that So if I have too many images without foreground classes, I might end up with batches without foreground class, which would not help the training? |
Beta Was this translation helpful? Give feedback.
Hi, this should not be a problem at all. There might be some stdout warning that you can ignore. I would still include these cases in the training because the model will be more robust if it also sees cases where nothing should be predicted. The dice loss is defined for those cases of course and it will push the network to predict nothing if nothing is present