- Jaccard Similarity
Efficient computation of Jaccard similarity between labels$\mathbf{y}_i$ and$\mathbf{y}_j$ :
- Weighting
The weighting function applies the Jaccard similarity raised to a power$\beta$ :
- Positive Mask
- Negative Mask
- Similarity Logits:
- Log probabilities are computed as:
The positive contribution to the loss is:
The negative contribution to the loss is:
The total loss for the batch:
Where:
-
$\alpha$ : Weight for positive pairs. -
$\mathcal{R}$ : Regularization term, defined as:
- Positive Mask:
- Weights are computed as:
- The similarity between contrastive features is computed as:
- Probability:
The MultiSupConLoss is defined as: