Skip to content

about dice evaluation #10

Description

@hu2274898

Thank you for your response.☺️ I have an additional question regarding the computation of the Dice score.

I first convert the discrete segmentation of the template into a one-hot encoding. This one-hot segmentation is then warped using the predicted deformation field via trilinear interpolation. After warping, I apply an argmax over the channel dimension to convert the warped one-hot map back into a discrete label segmentation. Finally, I compute the Dice score between this discrete warped template segmentation and the discrete ground-truth segmentation of the target image.

Concretely, the evaluation code looks like this:

dice_metric = DiceMetric(include_background=False, reduction="mean", get_not_nans=False)
svf_warped_atlas_segs = bilinear(atlas_seg, pos_deform_field)
(svf_warped_atlas_segs and inf_src_segs are one-hot segmentation maps)
dice_metric(
y_pred=svf_warped_atlas_segs.argmax(dim=1, keepdim=True),
y=inf_src_segs.argmax(dim=1, keepdim=True),
)
dice_avg = dice_metric.aggregate().item()
dice_metric.reset()

I also noticed that this “argmax + hard Dice” approach tends to give higher Dice scores than using a soft Dice computed directly on the continuous warped one-hot maps. I would like to confirm whether this evaluation protocol is consistent with yours, and whether you also evaluate Dice on discrete labels obtained after argmax.😊

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions