SSL-contrastive icon indicating copy to clipboard operation
SSL-contrastive copied to clipboard

How should I change the code about the class_num=3 case

Open QuintinDong opened this issue 1 year ago • 2 comments

Sorry to bother the author. May I ask what changes I need to make to the code if I want to categorize a larger number, for example class_num=3? I would really appreciate your help. I will be grateful if you can answer!

QuintinDong avatar Nov 26 '23 14:11 QuintinDong

Thank you for expressing interest in our project. If you're interested in evaluating our method on a multi-organ dataset, extending the code is straightforward, as the primary component of the code involves a classical segmentation task. In the contrastive loss function 'compute_uxi_loss,' you will need to compute entropy for a multi-class scenario. For each class, define a prototype and, utilizing the candidate list within each class, work towards minimizing the distance to the prototype of that class.

rezazad68 avatar Nov 30 '23 19:11 rezazad68

Thank you for expressing interest in our project. If you're interested in evaluating our method on a multi-organ dataset, extending the code is straightforward, as the primary component of the code involves a classical segmentation task. In the contrastive loss function 'compute_uxi_loss,' you will need to compute entropy for a multi-class scenario. For each class, define a prototype and, utilizing the candidate list within each class, work towards minimizing the distance to the prototype of that class.

Thank you for your response. I would like to ask one more question. I changed num_classes to 3 in both training and testing, but there is still only foreground and background in the final visualization of the predictions, do I need to change anything else in the test file? I would appreciate if you could reply!

QuintinDong avatar Dec 02 '23 07:12 QuintinDong