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

decode.acc_seg and aux.acc_seg are high but mIoU is very low #794

Closed
PangXuejiao opened this issue Aug 16, 2021 · 7 comments
Closed

decode.acc_seg and aux.acc_seg are high but mIoU is very low #794

PangXuejiao opened this issue Aug 16, 2021 · 7 comments
Assignees

Comments

@PangXuejiao
Copy link

When I train my own dataset, the decode.acc_seg and aux.acc_seg can reach more than 80%, but the mIoU is only about 10%. Does anyone know why? And how to calculation the decode.acc_seg and aux.acc_seg?which file I can find the functions in?

@MengzhangLI
Copy link
Contributor

Hi, @PangXuejiao

I guess it is because the decode.acc_seg is calculated with both foreground and background. We all know many background pixels can be correctly classified as background label. And when calculating mIoU, only foreground counts!

For example, see this config and its log:

WXWorkCapture_16290834772030

WXWorkCapture_16290835676254

This phenomenon is same as your claim because the foreground pixels (i.e., vessel of medical image) is way too less than background.
image
image

Best,

@PangXuejiao
Copy link
Author

Hi, @PangXuejiao

I guess it is because the decode.acc_seg is calculated with both foreground and background. We all know many background pixels can be correctly classified as background label. And when calculating mIoU, only foreground counts!

For example, see this config and its log:

WXWorkCapture_16290834772030

WXWorkCapture_16290835676254

This phenomenon is same as your claim because the foreground pixels (i.e., vessel of medical image) is way too less than background.
image
image

Best,

Thank you for your timely reply. However, I used "fcn_unet_s5-d16_128x128_40k_chase_db1.py" to train my dataset. My dataset contains three categories, no background category, and the proportion of the three categories is similar. And how does the code know where the background is? Your answer inspired me. I'll see the code and try again

@MengzhangLI
Copy link
Contributor

Do you mean your customized dataset does not have label 0? I mean your three kinds labels should be set 0, 1 and 2, respectively. It still has problem because the calculation in log mixing all pixels while in test mode or evaluation only certain foreground counts.

@PangXuejiao
Copy link
Author

Do you mean your customized dataset does not have label 0? I mean your three kinds labels should be set 0, 1 and 2, respectively. It still has problem because the calculation in log mixing all pixels while in test mode or evaluation only certain foreground counts.

My three kinds labels have be set 0, 1 and 2, respectively. But my dataset is like ade, specifically,the '0' label also represents a specific category rather than a background. So, the '0' label is also need to be calculated when calculating mIoU. Meanwhile, how to calculate the mIoU of the adk and cityscapes dataset (the datasets have no background)

@MengzhangLI
Copy link
Contributor

Just debug whether various kinds labels make mIoU metric different first.

@PangXuejiao
Copy link
Author

Just debug whether various kinds labels make mIoU metric different first.

Thank you very much. I use 'labelme' to label my dataset, and then I delete the 'background' . According to your suggection, I keep the background. And then, the 'mIoU' returns to normal.

@MengzhangLI
Copy link
Contributor

Great to hear that!

Now I will close this issue but welcome to create the issue or pull request in the future!

Best,

wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this issue Dec 3, 2023
…open-mmlab#794)

* rename md2yml.py to update_model_index.py and update to take file list as input
* register update_model_index.py into pre-commit hooks
* organize tools folder
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