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

feature request : please add cldice loss #5938

Closed
dirtycomputer opened this issue Feb 4, 2023 · 11 comments · Fixed by #6763
Closed

feature request : please add cldice loss #5938

dirtycomputer opened this issue Feb 4, 2023 · 11 comments · Fixed by #6763

Comments

@dirtycomputer
Copy link

Is your feature request related to a problem? Please describe.
clDice - a Novel Topology-Preserving Loss Function for Tubular Structure Segmentation
The abstract of this paper:⬇️

Accurate segmentation of tubular, network-like structures, such as vessels, neurons, or roads, is relevant to many fields of research. For such structures, the topology is their most important characteristic; particularly preserving connectedness: in the case of vascular networks, missing a connected vessel entirely alters the blood-flow dynamics. We introduce a novel similarity measure termed centerlineDice (short clDice), which is calculated on the intersection of the segmentation masks and their (morphological) skeleta. We theoretically prove that clDice guarantees topology preservation up to homotopy equivalence for binary 2D and 3D segmentation. Extending this, we propose a computationally efficient, differentiable loss function (soft-clDice) for training arbitrary neural segmentation networks. We benchmark the soft-clDice loss on five public datasets, including vessels, roads and neurons (2D and 3D). Training on soft-clDice leads to segmentation with more accurate connectivity information, higher graph similarity, and better volumetric scores.

Describe the solution you'd like
Official code repo
Please integrate the code in Monai project, that will help lots of researchers who working on vessels, neurons, tree or tabular structure. This official code repo has already implemented 2D and 3D version clDice loss, it will be easy to merge to current MONAI project. Thank you.

@yashika-git
Copy link
Contributor

@wyli, can I work on implementing this?

@wyli
Copy link
Contributor

wyli commented Feb 10, 2023

sure, I'm assigning this to you, thanks!

@dirtycomputer
Copy link
Author

Any update?

@dirtycomputer
Copy link
Author

@wyli

@wyli
Copy link
Contributor

wyli commented Jun 23, 2023

no visible progress at the moment, unassigning this ticket...

I saw a PR #6632 by @zilima but was closed now (would you still be interested in contributing? @zilima)

wyli pushed a commit that referenced this issue Jul 25, 2023
Fixes #5938

### Description

This PR aims to add the `SoftclDiceLoss` and the `SoftDiceclDiceLoss`
from [clDice - a Novel Topology-Preserving Loss Function for Tubular
Structure
Segmentation](https://openaccess.thecvf.com/content/CVPR2021/papers/Shit_clDice_-_A_Novel_Topology-Preserving_Loss_Function_for_Tubular_Structure_CVPR_2021_paper.pdf)

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] 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).
- [x] 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`.
- [x] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: Saurav Maheshkar <sauravvmaheshkar@gmail.com>
@jocpae
Copy link

jocpae commented Nov 3, 2023

Hi, first author of clDice here. Thank you for bringing clDice to Monai. We checked the implementation and it is correct. What are the steps to make it part of the main release?

@wyli
Copy link
Contributor

wyli commented Nov 3, 2023

thanks for confirming @jocpae, the module is available in monai 1.3.0 -- pip install monai==1.3.0.

@jocpae
Copy link

jocpae commented Nov 3, 2023

Great, thank you! I do not find it in the docs https://docs.monai.io/en/stable/losses.html yet. Should we prepare something?

@zma-rapidai
Copy link

zma-rapidai commented Nov 4, 2023 via email

@jocpae
Copy link

jocpae commented Jun 11, 2024

We would also like to add clDice as a metric to Monai we would do a PR soon?

@KumoLiu
Copy link
Contributor

KumoLiu commented Jun 25, 2024

We would also like to add clDice as a metric to Monai we would do a PR soon?

Hi @jocpae, we have a LossMetric which is a wrapper to make loss_fn available as a cumulative metric. Would that be helpful?

class LossMetric(CumulativeIterationMetric):

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

Successfully merging a pull request may close this issue.

6 participants