Skip to content
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

2-classed segmentation, IoU and Acc are 0.0 and nan respectively #2111

Closed
lifan724 opened this issue Sep 26, 2022 · 1 comment
Closed

2-classed segmentation, IoU and Acc are 0.0 and nan respectively #2111

lifan724 opened this issue Sep 26, 2022 · 1 comment
Assignees

Comments

@lifan724
Copy link

I set the num_classes==2 to model a 2-classes problem。The "CrossEntropyLoss" and "DiceLoss" both got validatied results show below:
+------------+-------+-------+-------+--------+-----------+--------+
| Class | IoU | Acc | Dice | Fscore | Precision | Recall |
+------------+-------+-------+-------+--------+-----------+--------+
| background | 95.43 | 98.46 | 97.66 | 97.66 | 96.88 | 98.46 |
| human | 0.0 | nan | 0.0 | nan | 0.0 | nan |
+------------+-------+-------+-------+--------+-----------+--------+

where the input label of my dataset is a gray mask with 2 different values 0 and 255. The loss configs is "loss_decode=dict(
type='DiceLoss', loss_weight=1.0)" or "loss_decode=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0))"

@MengzhangLI
Copy link
Contributor

Hi, if you only have one foreground class, I suggest you use binary segmentation with latest MMSegmentation version and check out PR here.

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
* fuse attention mask

* lint

* use 0 beta when no attention mask re: @Birch-san
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants