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

Hausdorff Loss #146

Closed
Dale-Black opened this issue Jul 30, 2021 · 5 comments
Closed

Hausdorff Loss #146

Dale-Black opened this issue Jul 30, 2021 · 5 comments

Comments

@Dale-Black
Copy link

Dale-Black commented Jul 30, 2021

I would like to add a simple Hausdorff Loss as proposed in (DOI: 10.1109/TMI.2019.2930068)

It approximates the Hausdorff distance to allow for direct minimization of the HD during training

function hd_loss(ŷ, y, ŷ_dtm, y_dtm)
    M =.- y) .^ 2 .* (ŷ_dtm .^ 2 .+ y_dtm .^ 2)
    loss = mean(M)
end

Should I open a PR for this?

@Dale-Black
Copy link
Author

It might also be nice to add in a dice loss too even though this is already in Flux?

function dice_loss(ŷ, y)
    ϵ = 1e-5
    loss = 1 - ((2 * sum.* y) + ϵ) / (sum.* ŷ) + sum(y .* y) + ϵ))
end

@juliohm
Copy link
Member

juliohm commented May 22, 2022

@Dale-Black can you please try to draft a PR following the current interface?

@Dale-Black
Copy link
Author

Yes I would love to do that, but it might be 1.5 weeks once finals are over. Is there a way to have GitHub remind me about this in like 2 weeks??

@juliohm
Copy link
Member

juliohm commented May 22, 2022

@Dale-Black I don't know of any feature in GitHub for reminders, but you can always set it in your own personal calendar.

We are cleaning up this repo once more, and it would be nice to have more contributors/maintainers. 👍🏽

@juliohm
Copy link
Member

juliohm commented Nov 27, 2024

Closing as inactive. The Hausdorff distance is a distance between sets. I've implemented it in ImageDistances.jl in case someone needs a kickstart. Feel free to open a new issue if this feature is still needed, and we can see if it fits into the package scope.

@juliohm juliohm closed this as completed Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants