DiceMetric: mean_batch and mean_channel reduction modes appear to be swapped
#8605
gauthamk02
started this conversation in
General
Replies: 1 comment
-
|
Hi @gauthamk02, thanks for reporting this. Line 113 in 69f3dd2 Line 119 in 69f3dd2 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
The
mean_batchandmean_channelreduction modes inDiceMetric.aggregate()appear to be swapped.mean_batchreturns one value per channel (instead of per batch), andmean_channelreturns one value per batch (instead of per channel).Is this the intended behavior, or am I misunderstanding how data should be accumulated or passed to DiceMetric? In the below example, the dimension of the data is BCHW.
To Reproduce
Run:
Expected behavior
mean_batch should average across channels and return one value per batch: shape [3]
mean_channel should average across batches and return one value per channel: shape [5]
Environment
Ensuring you use the relevant python executable, please paste the output of:
Additional context
The problem appears to be in
monai/metrics/utils.py:do_metric_reduction()lines 113-121. I am not sure if the bug affects other metrics using this function too.Beta Was this translation helpful? Give feedback.
All reactions