Closed dljve closed 2 years ago
The equation of Dice coefficient is 2∣X⋂Y∣/(∣X∣+∣Y∣)
.The general denominator is (∣X∣+∣Y∣)
, or it can be(∣X∣^2+∣Y∣^2)
. Here jaccard represents the way (∣X∣^2+∣Y∣^2)
.
Okay, thanks for the clarification. I was confused by the naming then, I understand that this form doesn't necessarily refer to the jaccard index.
Edit: I see that your second formulation is also the one that is used in the V-Net paper.
New Issue Checklist
Issue Description
I am wondering about the implementation of the 'Jaccard' Dice coefficient in the
tensorlayer.cost
module.Does the
loss_type
jaccard
refer here to the Jaccard index. Because the Jaccard index should be calculated as (X∩Y)/(X∪Y). In the code below it uses the same numerator of the Sorensen Dice, but it squares both the output and the target in the denominator:Shouldn't the denomiator for the Jaccard Index be:
tf.reduce_sum(output, axis=axis) + tf.reduce_sum(target, axis=axis) - tf.reduce_sum(output * target, axis=axis)
or |X|+|Y|-X∩Y.And the nominator should not have the factor 2.
I am confused what metric the option
jaccard
is actually computing here. It gives me a different output from the regular Jaccard Index. Is there another name this metric is known by?Reproducible Code