cvlab-stonybrook / SAMPath

Repository for "SAM-Path: A Segment Anything Model for Semantic Segmentation in Digital Pathology" (MedAGI2023, MICCAI2023 workshop)
30 stars 6 forks source link

Question about the number of classes for the BCSS dataset. #6

Closed windygoo closed 10 months ago

windygoo commented 10 months ago

In the config file, I see the number of classes for the BCSS dataset is set to 6. However, shouldn't the number of categories be 5: Tumor, Stroma, Inflammatory, Necrosis and Others?

jingweizhang-xyz commented 10 months ago

The BCSS dataset contains some unlabeled regions. Unlike the 5 classes, they should not be included in metrics calculation. We use class 0 to represent this case and ignore it in the metrics calculation (Line 35 in main.py).

windygoo commented 10 months ago

The BCSS dataset contains some unlabeled regions. Unlike the 5 classes, they should not be included in metrics calculation. We use class 0 to represent this case and ignore it in the metrics calculation (Line 35 in main.py).

Thanks for your quick reply!

I see. But since the class number has been increased by 1 in the config file, why it is increased further in the codes (Line 32 in main.py) and (Line 161 in network/sam_network.py) ?

jingweizhang-xyz commented 10 months ago

I can not remember clearly. That's probably because of a background class for calculating losses. The CRAG dataset contains a class background which should be included in loss calculation but not in metrics calculation. You can have a try to remove the +1 to see if there will be a problem. Even if there is an extra class, I think it would not affect the performance.

windygoo commented 10 months ago

I can not remember clearly. That's probably because of a background class for calculating losses. The CRAG dataset contains a class background which should be included in loss calculation but not in metrics calculation. You can have a try to remove the +1 to see if there will be a problem. Even if there is an extra class, I think it would not affect the performance.

Thanks !