JuliaWolleb / Diffusion-based-Segmentation

This is the official Pytorch implementation of the paper "Diffusion Models for Implicit Image Segmentation Ensembles".
MIT License
271 stars 35 forks source link

multi-class segmentation discuss #54

Open smallboy-code opened 8 months ago

smallboy-code commented 8 months ago

Hi @JuliaWolleb , thank you for your great work. I want to solve the multi-class segmentation problem and I delete the "label = torch.where(label > 0, 1, 0).float()". Now, I got some output looks not well as follows: 2 3 5 6 8 7

So, can you give me some advices about this problem?

JuliaWolleb commented 8 months ago

Hi How did you train this multi-class approach? It seems like you trained on a segmentation mask with a single channel, but different values (0,1,2,3) for the different classes? I suggest you train with one-hot-encoding, i.e., one binary mask for each of the classes.

smallboy-code commented 8 months ago

Yes, I trained on a segmentation mask with a single channel with different values (0,1,2,3) for the different classes. The one binary mask for each of the classes means training on a segmentation mask with three channels with WT,TC and ET?

JuliaWolleb commented 8 months ago

yes exactly, all three classes will have a separate binary channel each.

smallboy-code commented 8 months ago

Yes, I have also try to do this, but I found the finnal output will be like this: 图片1 WT,TC,ET,respectively. I think the results are worse than one channel.

ZhengChen6 commented 3 months ago

Yes, I have also try to do this, but I found the finnal output will be like this: 图片1 WT,TC,ET,respectively. I think the results are worse than one channel.

Hi, I also want to use multi-class segmentation for training, have you solved this problem? @smallboy-code

smallboy-code commented 3 months ago

It remains unresolved. @ZhengChen6