LossFunctions.jl icon indicating copy to clipboard operation
LossFunctions.jl copied to clipboard

Hausdorff Loss

Open Dale-Black opened this issue 2 years ago • 4 comments

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 avatar Jul 30 '21 21:07 Dale-Black

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

Dale-Black avatar Jul 30 '21 21:07 Dale-Black

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

juliohm avatar May 22 '22 14:05 juliohm

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??

Dale-Black avatar May 22 '22 17:05 Dale-Black

@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 avatar May 22 '22 18:05 juliohm