ljwztc / CLIP-Driven-Universal-Model

[ICCV 2023] CLIP-Driven Universal Model; Rank first in MSD Competition.
Other
521 stars 58 forks source link

Question about 3D dice score #43

Closed SamuelWu2001 closed 8 months ago

SamuelWu2001 commented 8 months ago

Hello, I would like to ask you some algorithm questions regarding the 3D dice score.

Firstly, concerning the issue of the ground truth being entirely black, I noticed in your utils.py that when you are writing the dice_score function, it seems that you add 1 to the denominator but not to the numerator. With this approach, in the case where both the ground truth and the prediction are entirely black, will the dice score be calculated as 0?

Secondly, regarding the calculation method of the 3D dice score, in the GitHub repository of the Medical SAM Adapter paper (https://github.com/WuJunde/Medical-SAM-Adapter), I observed that they calculate the dice score for each slice of the 3D volume separately and then average the scores. However, it seems like your dice_score function computes the dice score for the entire volume together. I believe both methods are reasonable, but the MONAI dice score algorithm appears to follow the former approach. So, I wanted to ask if you know which algorithm was used during the MSD challenge (the experiment results in your paper), as I need to determine the dice algorithm to assess if my model achieves state-of-the-art performance.

I appreciate your answers to the above two questions.

ljwztc commented 8 months ago
  1. Sure. 0/1=0. adding 1 to denominator for avoiding NaN.
  2. Since SAM is designed for 2D image while ours are for 3D image, we use different processing way. We use 3D one for MSD challenge
SamuelWu2001 commented 8 months ago

Thank you for your response. Yet, I'd like to clarify the calculation method for the MSD's dice score. Is it computed in a 3D volume-based approach, in cases where the entire volume is black, treated as 0 in the calculation (thus potentially lowering the average dice score)? I have this concern because, if it's calculated on a 2D slice-based approach, there might be many slices that do not contain the target object (completely black), which could have a significant impact when calculated as 0. However, if it's based on a 3D volume approach, the issue of entire black volumes occurring is less likely, so the impact would be smaller.

Regarding the MONAI dice metrics, when dealing with 3D ground truth masks and predictions, it calculates 2D dice scores for each slice and then takes the average as the 3D dice score. This is why I have the aforementioned concern.

Regarding the issue of using a 2D model for MSA, my idea was to concatenate the results from the 2D model together to create a 3D prediction, which could then be compared to the 3D ground truth for dice score calculation. Therefore, your dice score algorithm should still be applicable in this case.

ljwztc commented 8 months ago

I'm not sure the official calculation method for MSD. But we use 3d one for validation.

SamuelWu2001 commented 8 months ago

Thank you very much.