Project-MONAI / tutorials

MONAI Tutorials
https://monai.io/started.html
Apache License 2.0
1.85k stars 681 forks source link

Add Tutorial for UNETR (3D Multi-organ Segmentation) #262

Closed ahatamiz closed 3 years ago

ahatamiz commented 3 years ago

Is your feature request related to a problem? Please describe. Add tutorial for UNETR using 3D multi-organ Segmentation task with BTCV challenge dataset.

Describe the solution you'd like A notebook which contains all steps for training and validation addresses this feature request.

ahatamiz commented 3 years ago

@wyli @Nic-Ma

talhaanwarch commented 3 years ago

@ahatamiz can you tell me please, why you have used softmax instead of sigmoid. I am talking in sense of multi-label and multi-class. In multi-label, I think we use sigmoid and in multi-class softmax is used. Similarly, why DiceCELoss is used instead of DiceLoss.

As single CT scan can have more than one organ which make it multilabel, according to my understanding. Correct me if I am wrong.

ahatamiz commented 3 years ago

Hi @talhaanwarch. For the first question, a multi-class semantic segmentation problem can be considered as pixel-level classification. The output layer has 14 channels (classes), hence we use Softmax to classify each pixel into its desired class. On the other hand, Sigmoid is typically used for binary segmentation wherein the goal is to segment foreground and background. You can use Sigmoid for multi-label semantic segmentation problem, if each channel is considered separately (intuitively, binary segmentation for each channel separately). That is more common for problem involving over-lapping structures (e.g. brain tumor region segmentation).

For the second question, you can also use DiceLoss, but DiceCELoss seems to perform better in most cases. The reasoning behind this is that these loss functions are complementary to each other; DiceLoss works on the basis of matching prediction and label masks while cross-entropy considers the prediction of each voxel/pixel independently. As a result, combining them enhances the chances of capturing more details and improve model performance .

Hope this was useful.

talhaanwarch commented 3 years ago

thanks a lot. it really helps, especially the brain tumor reference, because I was thinking the brain tumor tutorial use sigmoid and why you have used softmax. It clear now. thanks once again