Papers
Topics
Authors
Recent
Search
2000 character limit reached

HyTver: Hybrid Loss for MS Lesion Segmentation

Updated 9 July 2026
  • HyTver is a hybrid loss function for longitudinal MS lesion segmentation that combines a Tversky term and a modified cross-entropy to tackle both input and output imbalances.
  • It achieves a Dice score of 0.659 and competitive distance metrics, demonstrating enhanced segmentation accuracy and fine-tuning stability.
  • The method offers efficient O(N) PyTorch implementation and balanced false-positive/false-negative control compared to traditional loss functions.

Searching arXiv for the HyTver paper and directly related loss-function papers for support. HyTver is a hybrid loss function for longitudinal Multiple Sclerosis lesion segmentation that combines a region-based Tversky term with a modified cross-entropy term in order to address both input imbalance and output imbalance in lesion segmentation (Perera et al., 25 Aug 2025). It was introduced in "HyTver: A Novel Loss Function for Longitudinal Multiple Sclerosis Lesion Segmentation" (Perera et al., 25 Aug 2025), where the central claim is that loss-function choice materially affects practicality in this setting because lesions are much rarer than background and because small or new lesions induce an additional imbalance at the output level. Within the reported experiments, HyTver achieves a Dice score of 0.659 while also maintaining distance-based metrics that are comparable to other popular loss functions, and it is additionally evaluated for stability when fine-tuning a pre-trained model (Perera et al., 25 Aug 2025).

1. Problem setting and design objective

Longitudinal Multiple Sclerosis lesion segmentation is presented as a particularly challenging problem because it involves both input and output imbalance in the data and segmentation (Perera et al., 25 Aug 2025). The input imbalance corresponds to the setting in which lesions are much less frequent than background. The output imbalance corresponds to the fact that small or new lesions vary in size, so error distributions are not adequately described by a region-overlap term alone (Perera et al., 25 Aug 2025).

The paper positions HyTver against a common practice in which models use either Dice loss, Cross-Entropy loss, or their combination without much consideration (Perera et al., 25 Aug 2025). The stated motivation is that one must select an appropriate loss function because imbalance can be mitigated by such a choice. The paper further notes that multiple proposed losses that aim to solve imbalance come with their own problems, including computational complexity induced by hyperparameters used as exponents and detrimental performance in metrics other than region-based ones (Perera et al., 25 Aug 2025).

In that context, HyTver is designed to combine overlap sensitivity with voxel-wise penalization. This suggests a loss construction that is intended not only to improve Dice-like overlap metrics but also to preserve boundary detail and avoid the regime in which either false positives or false negatives dominate training dynamics.

2. Mathematical formulation

HyTver is defined using binary labels yi{0,1}y_i \in \{0,1\}, predicted probabilities pi=y^i(0,1)p_i = \hat y_i \in (0,1), a voxel count NN, and hyperparameters α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1] (Perera et al., 25 Aug 2025). Its first component is a Tversky index term,

TI=iyipiiyipi+αiyi(1pi)+(1α)i(1yi)pi,LTI=1TI.TI = \frac{\sum_i y_i p_i}{\sum_i y_i p_i + \alpha \sum_i y_i(1-p_i) + (1-\alpha)\sum_i (1-y_i)p_i}, \qquad L_{TI} = 1 - TI.

Its second component is a modified cross-entropy,

LmCE=1Ni=1N[βyilog(pi+ε)+(1β)(1yi)log(1pi+ε)],L_{mCE} = -\frac{1}{N}\sum_{i=1}^{N}\left[\beta y_i \log(p_i+\varepsilon) + (1-\beta)(1-y_i)\log(1-p_i+\varepsilon)\right],

where ε\varepsilon is a small constant, for example 10710^{-7}, used for numerical stability (Perera et al., 25 Aug 2025).

The complete loss is then

LHyTver=γLmCE+(1γ)LTI.L_{\mathrm{HyTver}} = \gamma L_{mCE} + (1-\gamma)L_{TI}.

The interpretation given in the paper is explicit. LTIL_{TI} handles input imbalance by rewarding overlap and handles output imbalance through the Tversky weight pi=y^i(0,1)p_i = \hat y_i \in (0,1)0. pi=y^i(0,1)p_i = \hat y_i \in (0,1)1 introduces an explicit false-positive and false-negative penalty through pi=y^i(0,1)p_i = \hat y_i \in (0,1)2. The mixture parameter pi=y^i(0,1)p_i = \hat y_i \in (0,1)3 interpolates between region-overlap and voxel-wise penalties (Perera et al., 25 Aug 2025).

Theoretical motivation is stated in terms of the false-positive/false-negative trade-off. In the Tversky term, pi=y^i(0,1)p_i = \hat y_i \in (0,1)4 gives more penalty to false negatives, while pi=y^i(0,1)p_i = \hat y_i \in (0,1)5 gives more penalty to false positives. Output imbalance is then controlled at two levels: first in pi=y^i(0,1)p_i = \hat y_i \in (0,1)6 through pi=y^i(0,1)p_i = \hat y_i \in (0,1)7, and second in pi=y^i(0,1)p_i = \hat y_i \in (0,1)8 through pi=y^i(0,1)p_i = \hat y_i \in (0,1)9 (Perera et al., 25 Aug 2025). The paper’s rationale is that the combined form ensures that neither false positives nor false negatives dominates, while cross-entropy preserves boundary detail.

3. Optimization and implementation characteristics

The implementation described for HyTver is PyTorch-style and operates on tensors of shape NN0 with NN1 and NN2 (Perera et al., 25 Aug 2025). For each sample in the batch, the method flattens voxel dimensions and computes true positives, false negatives, and false positives as sums of NN3, NN4, and NN5, respectively. The Tversky index is then evaluated per sample, followed by the modified cross-entropy, and the loss returned is the batch mean of NN6 (Perera et al., 25 Aug 2025).

Two implementation notes are emphasized. First, NN7 should be retained both in the Tversky denominator and inside the logarithms of the cross-entropy term. Second, gradient computation can rely on automatic differentiation, with gradients following the standard chain rule (Perera et al., 25 Aug 2025).

The computational profile reported for HyTver is NN8, matching the asymptotic complexity of the main comparator losses in the study (Perera et al., 25 Aug 2025). The authors’ conclusion is that the loss is simple because it avoids exponentials, efficient because it is NN9, and effective at handling both input and output imbalance. A plausible implication is that the method is intended to be deployable in volumetric 3D training settings where exponent-based losses can become costly.

4. Relation to established loss functions

The comparative framing in the paper is organized around region-based, voxel-based, and hybrid objectives (Perera et al., 25 Aug 2025). Dice loss is characterized as a region term with zero hyperparameters and α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]0 complexity, but as being insensitive to small lesions and poor at boundaries. Cross-Entropy is characterized as a voxel term with zero hyperparameters and α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]1 complexity, but as poor on class-imbalanced tasks. Tversky introduces one hyperparameter, α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]2, and controls false positives and false negatives, but remains region-only (Perera et al., 25 Aug 2025).

The study also compares against Focal loss, Combo Loss, DicePP, Unified Focal variants, Weighted CE, and hybrid combinations such as Dice+CE, Focal+Dice, and Focal+Tversky (Perera et al., 25 Aug 2025). Focal is described as focusing hard samples but having no mid-term overlap; Combo Loss combines region and voxel terms but retains the property that the Dice part weights false positives and false negatives equally; DicePP is described as involving exponentials that slow 3D training; Unified Focal is described as similar to focal; and HyTver is characterized as providing balanced false-positive/false-negative behavior with good boundaries (Perera et al., 25 Aug 2025).

Fine-tune stability is one of the principal distinctions in this comparison. In the summary table, HyTver is assigned high fine-tune stability, whereas Dice and Tversky are moderate and Cross-Entropy, Focal, DicePP, and Unified Focal are low (Perera et al., 25 Aug 2025). This framing is directly tied to the later coefficient-of-variation analysis, where the authors assess convergence reliability under transfer learning.

5. Reported empirical performance

On the reported test set, HyTver attains the best Dice coefficient and the lowest Average Surface Distance among the evaluated losses (Perera et al., 25 Aug 2025). Its reported metrics are:

The paper states that HyTver’s Dice of 0.659 is higher by 0.013 than the next best method in the comparison, and that its ASD of 6.83 mm is the lowest of all methods (Perera et al., 25 Aug 2025). It also reports that a Hausdorff distance of 36.4 mm shows on-average boundary accuracy with few outliers.

The remaining evaluated losses provide the comparative context. Dice reports DC 0.646 and ASD 11.1; Tversky reports DC 0.648 and ASD 10.2; Dice+CE reports DC 0.649 and ASD 10.6; Combo reports HD 27.2 and ASD 11.4; Cross-Entropy reports DC 0.624 and ASD 16.6; Weighted CE reports DC 0.625 and ASD 15.5; and Focal, Symm. Unified Focal, Asymm. Unified Focal, and Log-cosh each report DC values around 0.633 with ASD 13.7 (Perera et al., 25 Aug 2025). The significance assigned by the paper is that HyTver improves overlap while retaining competitive distance-based behavior rather than sacrificing one family of metrics for the other.

6. Hyperparameters, stability, limitations, and reproducibility

HyTver uses three hyperparameters: α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]3, α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]4, and α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]5 (Perera et al., 25 Aug 2025). The paper states that these were tuned on the validation set, while also stating that the exact values are not explicitly reported. As a rule of thumb for longitudinal lesion segmentation, the summary gives α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]6 for more false-negative penalty, α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]7 for balanced cross-entropy, and α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]8 for equal mixing, with a coarse grid search over α,β,γ[0,1]\alpha,\beta,\gamma \in [0,1]9 for each yielding robust performance (Perera et al., 25 Aug 2025). Because the exact tuned values are not reported, these recommendations should be understood as heuristic rather than as definitive optimal settings.

Stability analysis is reported through the coefficient of variation across cross-validation folds for Dice, Precision, and F1 (Perera et al., 25 Aug 2025). HyTver shows the lowest coefficient of variation in Dice, at 0.383, and competitive coefficient of variation in distance metrics, which the paper interprets as the most reliable convergence under transfer learning. Boxplots, not reproduced in the summary, are said to confirm the tightest inter-quartile range of Dice and Precision for HyTver (Perera et al., 25 Aug 2025).

The worst-case qualitative analysis also forms part of the interpretation. Figure 1, as described in the summary, shows that HyTver reduces false positives compared to Dice and Cross-Entropy when segmenting highly asymmetric lesions, at the cost of slight under-segmentation (Perera et al., 25 Aug 2025). This is a useful corrective to any misconception that the loss eliminates all failure modes; the paper instead presents a trade-off in which improved suppression of false positives may coincide with some under-segmentation in difficult cases.

The limitations identified by the authors are

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to HyTver.