-
Couldn't load subscription status.
- Fork 147
Allow segmentation model inference to run on datasets without segmentations or partial segmentations #459
Description
Inference should become more flexible to work also on datasets where we do not have segmentations yet, or only some of the structures segmented.
Example for Prostate model (model outputs segmentations all of bladder, prostate, rectum, femurs, etc):
- Running on a set of CT scans where there are no segmentations present
- No channels associated with mask or ground_truth_ids
- Running on CT scans where some of the segmentation are present
- Model has ground_truth_ids = ["lung_l", "lung_r", "heart"], but dataset only has a channel for "heart"
- Ideally a report should be generated still for all patients and structures where a channel is present in the dataset
We may want to add a flag that triggers the current behaviour, where all of the model's ground truth ids are expected in the dataset.
Example datasets that should be considered valid after this change (for a model that segments ["lung_l", "lung_r"]:
no segmentations, only the CT scan is present: On such a dataset, we would not be able to compute any metrics. Inference should only output the model predictions.
1,ct,1/ct.nii.gz
2,ct,2/ct.nii.gz
Subject 1 only has lung_l segmented, subject 2 has all segmentation that the model knows about, Subject 3 has nothing segmented: Again, the inference run should output all predictions (lung_l and lung_r) for all 3 subjects. Report should state that lung_l was only present in 2 out of 3 subjects, and the average Dice score over those 2 should be computed. Report should say that lung_r was only present in 1 out of 3 subjects, and report average Dice (degenerate average over only 1 subject)
1,ct,1/ct.nii.gz
1,lung_l,1/lung_l.nii.gz
2,ct,2/ct.nii.gz
2,lung_l,2/lung_l.nii.gz
2,lung_r,2/lung_r.nii.gz
3,ct,3/ct.nii.gz
Changes should be made as part of the current metrics computation at inference time, and should not distinguish if training was running before or not.