I am struggling to implement the generalized Dice loss for Caffe
as Python Layer
, which calculates loss for sub-volumes. I am hoping to get some help here. Or at least, if there is any code, please share the link.
I have 5 labels (0: background and labels1:4
for objects). Since I am getting a patch from 3D data, some of the subvolumes only contain the background. How the dice loss should be calculated for this sub-volumes?
Why in this line of code for creating One-hot
label, the author has separated the background voxels counting?
Do we calculate the volume overlap for the background voxels too?