Skip to content

Conversation

@imadtoubal
Copy link
Contributor

@imadtoubal imadtoubal commented Sep 17, 2023

Integrating an existing implementation publicly available on GitHub by Patryk Rygiel into the MONAI framework.

Fixes #6993.
Fixes #3481
Fixes #1039

Description

Hausdorff distance is widely used in evaluating medical image segmentation methods. Adding an objective/loss function directly to optimize this distance can be instrumental in optimizing this score [1].

Hausdorff Distance

An existing implementation is publicly available on GitHub by Patryk Rygiel, although it might take some engineering work to integrate within the MONAI framework.

I was able to train a 3D segmentation model successfully using MONAI's SwinUNETR with this implementation and I would like to contribute the code for this loss so that it's more widely available and easier to integrate with MONAI-based repositories.

References:
[1] Karimi, D., & Salcudean, S. E. (2019). Reducing the Hausdorff distance in medical image segmentation with convolutional neural networks. IEEE Transactions on medical imaging, 39(2), 499-513.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

Integrating an existing implementation publicly available on GitHub
by Patryk Rygiel into the MONAI framework.

Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

thanks!

imadtoubal and others added 7 commits September 18, 2023 15:01
Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Add a `skipUnless` decorator to skip the
monai.utils.module.OptionalImportError: `from scipy.ndimage.morphology
import distance_transform_edt`

Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Signed-off-by: Imad Toubal <imad.toubal@gmail.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: Wenqi Li <831580+wyli@users.noreply.github.com>
@wyli
Copy link
Contributor

wyli commented Sep 19, 2023

/build

@wyli wyli enabled auto-merge (squash) September 19, 2023 07:06
Copy link
Contributor

@wyli wyli left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good to me, merging if all tests work fine.

@wyli wyli merged commit e5f9337 into Project-MONAI:dev Sep 19, 2023
@imadtoubal imadtoubal deleted the 6993-hausdorff-loss branch September 19, 2023 15:09
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.

Hausdorff distance loss support Introduce Boundary loss and Hausdorff loss Mean Hausdorff metric/loss function

3 participants