---
title: 'HyTver: Hybrid Loss for MS Lesion Segmentation'
url: https://www.emergentmind.com/topics/hytver
type: topic
---

# HyTver: Hybrid Loss for MS Lesion Segmentation

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 [2508.17639]. It was introduced in "HyTver: A Novel Loss Function for Longitudinal Multiple Sclerosis Lesion Segmentation" [2508.17639], 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 [2508.17639].

## 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 [2508.17639]. 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 [2508.17639].

The paper positions HyTver against a common practice in which models use either Dice loss, Cross-Entropy loss, or their combination without much consideration [2508.17639]. 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 [2508.17639].

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 $y_i \in \{0,1\}$, predicted probabilities $p_i = \hat y_i \in (0,1)$, a voxel count $N$, and hyperparameters $\alpha,\beta,\gamma \in [0,1]$ [2508.17639]. Its first component is a Tversky index term,

$$
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,

$$
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 $10^{-7}$, used for numerical stability [2508.17639].

The complete loss is then

$$
L_{\mathrm{HyTver}} = \gamma L_{mCE} + (1-\gamma)L_{TI}.
$$

The interpretation given in the paper is explicit. $L_{TI}$ handles input imbalance by rewarding overlap and handles output imbalance through the Tversky weight $\alpha$. $L_{mCE}$ introduces an explicit false-positive and false-negative penalty through $\beta$. The mixture parameter $\gamma$ interpolates between region-overlap and voxel-wise penalties [2508.17639].

Theoretical motivation is stated in terms of the false-positive/false-negative trade-off. In the Tversky term, $\alpha > 0.5$ gives more penalty to false negatives, while $\alpha < 0.5$ gives more penalty to false positives. Output imbalance is then controlled at two levels: first in $TI$ through $\alpha$, and second in $L_{mCE}$ through $\beta$ [2508.17639]. 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 $[B,1,D,H,W]$ with $p \in (0,1)$ and $y \in \{0,1\}$ [2508.17639]. For each sample in the batch, the method flattens voxel dimensions and computes true positives, false negatives, and false positives as sums of $y \cdot p$, $y \cdot (1-p)$, and $(1-y)\cdot p$, respectively. The Tversky index is then evaluated per sample, followed by the modified cross-entropy, and the loss returned is the batch mean of $\gamma L_{mCE} + (1-\gamma)L_{TI}$ [2508.17639].

Two implementation notes are emphasized. First, $\varepsilon$ 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 [2508.17639].

The computational profile reported for HyTver is $O(N)$, matching the asymptotic complexity of the main comparator losses in the study [2508.17639]. The authors’ conclusion is that the loss is simple because it avoids exponentials, efficient because it is $O(N)$, 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 [2508.17639]. Dice loss is characterized as a region term with zero hyperparameters and $O(N)$ complexity, but as being insensitive to small lesions and poor at boundaries. Cross-Entropy is characterized as a voxel term with zero hyperparameters and $O(N)$ complexity, but as poor on class-imbalanced tasks. Tversky introduces one hyperparameter, $\alpha$, and controls false positives and false negatives, but remains region-only [2508.17639].

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 [2508.17639]. 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 [2508.17639].

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 [2508.17639]. 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 [2508.17639]. Its reported metrics are:

- DC: 0.659  
- JC: 0.524  
- HD: 36.4  
- ASD: 6.83  
- PR: 0.724  
- F1: 0.747  [2508.17639]

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 [2508.17639]. 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 [2508.17639]. 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: $\alpha$, $\beta$, and $\gamma$ [2508.17639]. 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 $\alpha \approx 0.7$ for more false-negative penalty, $\beta \approx 0.5$ for balanced cross-entropy, and $\gamma \approx 0.5$ for equal mixing, with a coarse grid search over $\{0.3,0.5,0.7\}$ for each yielding robust performance [2508.17639]. 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 [2508.17639]. 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 [2508.17639].

The worst-case qualitative analysis also forms part of the interpretation. Figure 9, 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 [2508.17639]. 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

Source: https://www.emergentmind.com/topics/hytver