Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Benchmark CT-Dataset KiTS19 #36

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

fitzlithepius
Copy link
Collaborator

@fitzlithepius fitzlithepius commented Dec 3, 2024

Created KiTS Segmentation Task
To-do:

  • Change BatcherInput images, segmentation masks to np.array.
  • Re-work the prompts.
  • Integration test with Segmentation from task_families.

question = "<img> Please segment the kidney and tumor in the CT images."

batcher_input._add_text_prompt("user", question)
if prompt:
Copy link
Collaborator Author

@fitzlithepius fitzlithepius Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you have suggested, we perhaps should always do the conversion within class, so that BatcherInput only takes Numpy Array as input for both images and segmentation masks. @corentin-ryr

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right it would simplify the usage of the tool. For now let's keep it this way and we will revisit it soon.

answer = torch.LongTensor(answer)
one_hot_answer = one_hot(answer, num_classes= self.num_classes).movedim(-1, 1)

return one_hot_answer
Copy link
Collaborator Author

@fitzlithepius fitzlithepius Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calculation of DICE score has two modes: one-hot and index.
My idea is: we default on the one-hot encoding, so for different datasets, probably pre-processing is needed. The return will always be a hot-encoded LongTensor. @corentin-ryr

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another solution would be to only have single-class masks (binary masks) and allow the batcher to return multiple masks in case there are multiple labels in the dataset.

We can either have :

  • complex question asking to label multiple things and the batcher has to return multiple masks
  • split the questions to have 2 different questions: one to label the kidney and another to label the tumor. This way it simplifies the metric computation and it will be easier to stratify (compute overall accuracy and accuracy on just kidney/tumor).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants