-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Same values returned from different confusion_matrix #7243
Comments
Hi @al3ms, it should be possible that f1, precision, and sensitivity are equal if the "fn==fp" in your case. Thanks! |
Dear KumoLiu, Regarding the result, I tested on five images, and all three metrics are the same for each image, which means something is wrong. Image 1 fScore: tensor([0.9975], device='cuda:0') Image 2 fScore: tensor([0.9934], device='cuda:0') Image 3 Image 4 Image 5 |
Hi @al3ms, I think I may have found the problem, for a binary classification task, there is no need for one-hot, otherwise, fn and fp will always be equal. |
Now I removed the one-hot from. Which makes sense! This is the result of one image: Test DSC: 0.8751203417778015 Again thanks a lot @KumoLiu for your support! |
Thanks for great framework Monai.
I have a problem when using the function ConfusionMatrixMetric. I want to calculate F1, precision, and sensitivity. However the function return the same output for all.
This is the code:
`
`
This is the output for the first two images:
/content/drive/MyDrive/data/******.nii.gz
Test loss: 0.2086484134197235
Image 1
Test DSC: 0.7914928197860718
Test HD: 6.062177658081055
Test SD: 1.5217657089233398
Test IoU: 0.7050783038139343
fScore: tensor([0.9975], device='cuda:0')
precision: tensor([0.9975], device='cuda:0')
sensitivity: tensor([0.9975], device='cuda:0')
/content/drive/MyDrive/data/******.nii.gz
Test loss: 0.3882635235786438
Image 2
Test DSC: 0.6110410094261169
Test HD: 12.599105834960938
Test SD: 4.4174981117248535
Test IoU: 0.5602081418037415
fScore: tensor([0.9934], device='cuda:0')
precision: tensor([0.9934], device='cuda:0')
sensitivity: tensor([0.9934], device='cuda:0')
The text was updated successfully, but these errors were encountered: