MIC-DKFZ / nnDetection

nnDetection is a self-configuring framework for 3D (volumetric) medical object detection which can be applied to new data sets without manual intervention. It includes guides for 12 data sets that were used to develop and evaluate the performance of the proposed method.
Apache License 2.0
542 stars 94 forks source link

[Question] Defining test_labels and target_class for custom dataser #232

Closed salusanga closed 5 months ago

salusanga commented 7 months ago

Hi, I have a custom dataset for brain metastasis detection. It is a binary task, in the original dataset "1" is the FG and "0" is BG. I brought it to the nnDetection format, with the instances in the masks and the new FG class being "0".

In this context, how should I set "test_labels" and "target_class"?

Thanks a lot! Best, Sara

mibaumgartner commented 6 months ago

Hey,

sorry for the delay, I needed to take care of some deadlines first :)

please make sure, that you have used some heuristic to cluster the original metastasis into individual objects otherwise you will only generate a single bounding box around all of them (since the original dataset seems to be in a semantic segmentation format).

test_labels simply indicates if you are planning to split a test set which will have test labels as well. If you there is one, set it to True otherwise to False.

target_class is targeted towards patient wise evaluation with multiple classes, you can either leave it empty or set it to 0.

Best, Michael

salusanga commented 6 months ago

Dear Michael, thanks a lot for the explanation. Just to make sure for "test_labels": with "test set which will have test labels as well", do you mean the existence of the folder "labelsTs/" with the same classes as the training? Or something else? So far I was running my code with "test_labels=False" and it seemed to work reasonably, now I am wondering if I missed something. Best, Sara

mibaumgartner commented 6 months ago

Yes, if you are planning to use imagesTs & labelsTs than you should set test_labels=True, that will simply trigger the processing for the test images & labels as well (since for the evaluation of the test set the boxes need to be extracted from the test labels). nnDetection was designed for use cases where the test set labels might be unknown (e.g. during a challenge) and thus it won't automatically process the labels.

Training etc. don't use the test set - the test set is really intended as a true test set i.e. you should only predict it once at the very end of the model development. This is done by separate commends i.e. running nndet_predict and nndet_eval with the --test option.

Best, Michael

salusanga commented 6 months ago

Thanks and best. Sara

mibaumgartner commented 6 months ago

Best, Michael

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.