Skip to content

Update Dice Metric/Loss Documentation #8385

@ericspod

Description

@ericspod

Is your feature request related to a problem? Please describe.
The docstring descriptions for DiceLoss, DiceMetric, DiceHelper, and compute_dice should include more information about the expectations of inputs, implications of various arguments, and better examples. There's been some confusion about why results from the loss don't match expectations given the value of metrics, this is related to the extra features in the loss such as the smoothing values as well as misunderstanding about activation or thresholding/one-hot formatting.

Describe the solution you'd like
A few things should be changed or added:

  • Docstring for DiceMetric should make it clear the ground truth and prediction can be either single-channel label maps or multi-channel one-hot tensors.
  • The values of the inputs do matter since no thresholding is done in the metrics themselves.
  • The softmax parameter of DiceHelper is confusing in that it appears to indicate softmax will be applied if it's true, rather than the expectation that this was already done to the prediction. This should be renamed to argmax and the old name deprecated. It should also be noted that this parameter becomes the opposite value to sigmoid if not given a value.
  • Using compute_dice probably should be discouraged in favour of the DiceMetric class, and it should be mentioned that they do the same computation. It's possible this function isn't used by anyone and can be deprecated entirely.
  • An example in the docstring of how to use the metric and the loss to get expected results should be included.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions