MaskFocalLoss<T>

Models & Types · AiDotNet.ComputerVision.Segmentation.Losses

Focal loss for mask prediction (addresses class imbalance).

For Beginners

Focal loss down-weights easy examples (confident predictions) and focuses training on hard examples. This helps with the severe class imbalance in instance segmentation where background dominates.

Constructors

Constructor Summary
MaskFocalLoss(double alpha, double gamma, double eps) Creates a new mask focal loss.

Methods

Method Summary
T Compute(Tensor<T> predicted, Tensor<T> target) Computes focal loss between predicted and target masks.