MONAI MeanDICE differs from scikit-learn f1 score for binary segmentation #8136
Unanswered
DanielHieber
asked this question in
Q&A
Replies: 1 comment
-
Hi @yiheng-wang-nv, could you please help take a look at this question? Thanks in advance. BTW, @DanielHieber, you can also use MONAI/monai/metrics/confusion_matrix.py Line 25 in 76ef9f4 |
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.
-
I have a problem with the
DiceMetric
I can't seem to figure out on my own. I am using MONAI for the first time in combination with PyTroch Lightning and tried scikit during validation for additional metrics to double-check my work. With scikit I manually compute the score (e.g.sklearn.metrics.f1_score
) for each output tensor of a step and calculate the mean of the batch. During theon_validation_epoch_end
I then calculate the mean of these batch means.When using the
DiceMetric
during validation I get different results compared to scikit-learn. UsingGeneralizedDiceScore
the score is the same as scikit learn. Manually computing the Dice/F1 returned the same results as scikit/GeneralizedDiceScore
.Can anyone point me to my error here?
Code runs in Python 3.10
monai==1.3.2
scikit-learn==1.5.2
Relevant example code
Beta Was this translation helpful? Give feedback.
All reactions