Understanding include_background #1632
-
Let's say I have two tensors (1,3,224,224) and (1,3,224,224), representing prediction and target, with sigmoid being applied to the prediction tensor. 3 is the number of classes in the semantic segmentation problem, and (224x224) is the spatial dimensions. I see that there are several parameters to the dice loss and other relevant functions, one of which being include_backgrounds. How would you explain include_backgrounds here? Is it applicable? I am asking this question because in the monai tutorials, like brats3dsegmentation.ipynb, they use include_backgrounds despite having only 3 channels and no channel to represent the background images. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @25benjaminli, thanks for your interest here. |
Beta Was this translation helpful? Give feedback.
-
@KumoLiu thanks for your response. If this is the case, does the tutorial using swin unetr and segresnet use include_background incorrectly? As I mentioned, the outputs of their models are (b, 3, [spatial_dims]) which is being compared to (b, 3, [spatial dims]) label. Or do they just pretend that the "background label" is representing an actual label? |
Beta Was this translation helpful? Give feedback.
Yes, there are relevant tickets that talk about the name of the
include_background
, would be better to revisit it to avoid misunderstanding here.Project-MONAI/MONAI#6915 (comment)
Project-MONAI/MONAI#7056