mednet.models.segment.losses¶
Specialized losses for semanatic segmentation.
Classes
|
Implement Equation 3 in [IGLOVIKOV-2018] for the multi-output networks such as HED or Little W-Net. |
Weighted Binary Cross-Entropy Loss for multi-layered inputs (e.g. for Holistically-Nested Edge Detection in [XIE-2015]). |
|
|
Implement the generalized loss function of Equation (3) in. |
Calculates sum of weighted cross entropy loss. |
- class mednet.models.segment.losses.WeightedBCELogitsLoss[source]¶
Bases:
ModuleCalculates sum of weighted cross entropy loss.
Implements Equation 1 in [MANINIS-2016]. The weight depends on the current proportion between negatives and positives in the ground- truth sample being analyzed.
- class mednet.models.segment.losses.SoftJaccardBCELogitsLoss(alpha=0.7)[source]¶
Bases:
ModuleImplement the generalized loss function of Equation (3) in.
[IGLOVIKOV-2018], with J being the Jaccard distance, and H, the Binary Cross-Entropy Loss:
\[L = \alpha H + (1-\alpha)(1-J)\]Our implementation is based on
torch.nn.BCEWithLogitsLoss.- Parameters:
alpha (
float) – Determines the weighting of J and H. Default:0.7.
- class mednet.models.segment.losses.MultiWeightedBCELogitsLoss[source]¶
Bases:
WeightedBCELogitsLossWeighted Binary Cross-Entropy Loss for multi-layered inputs (e.g. for Holistically-Nested Edge Detection in [XIE-2015]).
- class mednet.models.segment.losses.MultiSoftJaccardBCELogitsLoss(alpha=0.7)[source]¶
Bases:
SoftJaccardBCELogitsLossImplement Equation 3 in [IGLOVIKOV-2018] for the multi-output networks such as HED or Little W-Net.
- Parameters:
alpha (float) – Determines the weighting of SoftJaccard and BCE. Default:
0.3.