Loss functions for segmentation tasks in the field of computer vision.
- Hausdorff Loss computations for 1D, 2D, and 3D data.
- Dice Loss computations for 1D, 2D, and 3D data.
To get started, you'll need to import the Losers package:
using Losers
The Hausdorff loss can be used to compute the loss between two data structures. Here's an example for 1D data:
using DistanceTransforms: transform # Losers pairs nicely with this library
y = rand([0, 1], n)
ŷ = y
y_dtm = transform(y)
ŷ_dtm = transform(ŷ)
hausdorff_loss(ŷ, y, ŷ_dtm, y_dtm)
Dice loss can be computed similarly. Here's an example for 1D data:
y = rand([0, 1], n)
ŷ = y
dice_loss(ŷ, y)