HiLab-git / WSL4MIS

Scribbles or Points-based weakly-supervised learning for medical image segmentation, a strong baseline, and tutorial for research and application.
MIT License
198 stars 34 forks source link

the format of the label image #3

Closed wwjwy closed 3 years ago

wwjwy commented 3 years ago

Hi Luo, Thank you very much for your codebase. I modified your code so that it can be used for weakly supervised semantic segmentation of RGB images. I encountered some problems when preparing the dataset. My dataset contains two categories, background and spalling. The mask I made is shown in the following image, black scribble(background) and white scribble(spalling). I want to know is my way of labeling correct?

Luoxd1996 commented 3 years ago

Hi, For the pCE loss, the background is labeled as 0 and the foreground is labeled as 1, the others is x which can be seen as ignore_index=x. Best, Xiangde.

wwjwy commented 3 years ago

Hi, For the pCE loss, the background is labeled as 0 and the foreground is labeled as 1, the others is x which can be seen as ignore_index=x. Best, Xiangde.

In other words, for the mask, I only need to label a few scribbles or points, and the other parts in the image remain the same, right?

Luoxd1996 commented 3 years ago

No, the mask just consists of [0,1,x], x means the unlabeled region. You'd better read some weakly-supervised papers. Best, Xiangde.

wwjwy commented 3 years ago

No, the mask just consists of [0,1,x], x means the unlabeled region. You'd better read some weakly-supervised papers. Best, Xiangde.

I got it, thank you!