An open API service indexing awesome lists of open source software.

https://github.com/stabgan/awesome-loss-functions

πŸ“š 350+ loss functions across 25+ AI subdomains β€” classification, GANs, diffusion, LLM alignment, RL, contrastive learning, audio, video, time series, and more. Chronologically ordered with paper links, math formulas, and implementations.
https://github.com/stabgan/awesome-loss-functions

List: awesome-loss-functions

awesome awesome-list computer-vision contrastive-learning deep-learning diffusion-models gan generative-models knowledge-distillation llm-alignment loss-functions machine-learning nlp object-detection paper-list pytorch reinforcement-learning self-supervised-learning survey time-series

Last synced: 3 months ago
JSON representation

πŸ“š 350+ loss functions across 25+ AI subdomains β€” classification, GANs, diffusion, LLM alignment, RL, contrastive learning, audio, video, time series, and more. Chronologically ordered with paper links, math formulas, and implementations.

Awesome Lists containing this project

README

          

# Awesome Loss Functions [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)

[![License: CC0-1.0](https://img.shields.io/badge/License-CC0_1.0-lightgrey.svg)](https://creativecommons.org/publicdomain/zero/1.0/)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![Contributions](https://img.shields.io/badge/contributions-welcome-orange.svg)](https://github.com/stabgan/awesome-loss-functions/issues)

A comprehensive, chronologically ordered collection of loss functions across all subdomains of deep learning and machine learning β€” with paper links, one-line descriptions, mathematical formulations, and implementation references.

**350+ loss functions. 25+ categories. Every subdomain of AI.**

> If this resource helps your research or engineering work, please consider giving it a ⭐

---

## What's New

- πŸ”Š **Audio, Music & Speech Generation** β€” WaveNet to Stable Audio, 19 losses
- 🎬 **Video Generation & Understanding** β€” VGAN to VideoPoet, 20 losses
- ⏳ **Time Series Forecasting** β€” Pinball Loss to TimesFM, 23 losses
- 🧠 **Continual & Lifelong Learning** β€” EWC to EASE, 18 methods
- βš–οΈ **Calibration, Fairness & Bias Mitigation** β€” Brier Score to Group DRO, 18 losses
- πŸ›‘οΈ **Adversarial Robustness & OOD Detection** β€” FGSM-AT to CIDER, 22 losses
- πŸ” **Anomaly Detection & Multi-Modal Learning** β€” Deep SVDD to ImageBind, 17 losses
- πŸ–ΌοΈ **Image-to-Image Translation** β€” Total Variation to DoveNet, 16 losses
- πŸ“ **Semi-Supervised Learning** β€” Pseudo-Label to SoftMatch, 12 losses
- 🎯 **Optical Flow, Video & Pose** β€” Horn-Schunck to SEA-RAFT, 33 losses

---

## Contents

**Core Categories (inline)**

- [Loss Selection Guide](#-loss-selection-guide)
- [Key Mathematical Formulations](#-key-mathematical-formulations)
- [Classification](#classification)
- [Regression](#regression)
- [Segmentation](#segmentation)
- [Object Detection (Bounding Box)](#object-detection-bounding-box)
- [Generative Models β€” GANs](#generative-models--gans)
- [Generative Models β€” VAEs](#generative-models--vaes)
- [Generative Models β€” Diffusion & Flow](#generative-models--diffusion--flow)
- [Reconstruction & Perceptual](#reconstruction--perceptual)
- [Image Super-Resolution & Restoration](#image-super-resolution--restoration)
- [Contrastive & Self-Supervised Learning](#contrastive--self-supervised-learning)
- [Metric Learning & Face Recognition](#metric-learning--face-recognition)
- [NLP & Language Modeling](#nlp--language-modeling)
- [LLM Alignment (RLHF / DPO)](#llm-alignment-rlhf--dpo)
- [Sequence-to-Sequence & Speech](#sequence-to-sequence--speech)
- [Reinforcement Learning](#reinforcement-learning)
- [Knowledge Distillation](#knowledge-distillation)
- [Regularization](#regularization)
- [3D Vision & Point Clouds](#3d-vision--point-clouds)
- [Depth Estimation](#depth-estimation)
- [Medical Imaging](#medical-imaging)
- [Graph Neural Networks](#graph-neural-networks)
- [Recommendation Systems](#recommendation-systems)
- [Multi-Task Learning](#multi-task-learning)
- [Uncertainty Estimation](#uncertainty-estimation)
- [Domain Adaptation](#domain-adaptation)

**Extended Categories (separate files)**

- [Audio, Music & Speech Generation](sections/audio-music-speech.md) β€” 19 losses
- [Video Generation & Understanding](sections/video-generation-understanding.md) β€” 20 losses
- [Time Series Forecasting](sections/time-series-forecasting.md) β€” 23 losses
- [Continual & Lifelong Learning](sections/continual-lifelong-learning.md) β€” 18 methods
- [Calibration, Fairness & Bias Mitigation](sections/calibration-fairness.md) β€” 18 losses
- [Adversarial Robustness & OOD Detection](sections/adversarial-robustness-ood.md) β€” 22 losses
- [Anomaly Detection & Multi-Modal Learning](sections/anomaly-detection-and-multimodal.md) β€” 17 losses
- [Image-to-Image Translation & Style Transfer](sections/image-to-image-translation.md) β€” 16 losses
- [Semi-Supervised Learning & Self-Training](sections/semi-supervised-learning.md) β€” 12 losses
- [Optical Flow, Video Prediction & Pose Estimation](sections/temporal-motion.md) β€” 33 losses

**Resources**

- [Survey Papers](#survey-papers)
- [Key Implementation Libraries](#key-implementation-libraries)

---

## 🧭 Loss Selection Guide

Not sure which loss to use? Here's a quick decision framework:

| Task | Default Choice | Class Imbalance | Noisy Labels | Need Calibration |
|------|---------------|-----------------|--------------|------------------|
| Binary Classification | BCE | Focal Loss | SCE / GCE | Focal + Temp. Scaling |
| Multi-class Classification | Cross-Entropy | Class-Balanced CE | Label Smoothing | Label Smoothing |
| Semantic Segmentation | CE + Dice | Focal Tversky | β€” | β€” |
| Object Detection (box) | Smooth L1 + Focal | Focal Loss | β€” | β€” |
| Object Detection (IoU) | CIoU / GIoU | β€” | β€” | β€” |
| Image Generation (GAN) | Hinge / Non-Saturating | β€” | β€” | β€” |
| Image Generation (Diffusion) | DDPM (Ξ΅-prediction) | β€” | β€” | β€” |
| Super-Resolution | L1 + Perceptual + GAN | β€” | β€” | β€” |
| Self-Supervised (vision) | InfoNCE / DINO | β€” | β€” | β€” |
| Face Recognition | ArcFace / AdaFace | Sub-center ArcFace | ElasticFace | β€” |
| Language Modeling | Cross-Entropy (NTP) | β€” | β€” | β€” |
| LLM Alignment | DPO / SimPO | β€” | β€” | β€” |
| Speech Recognition | CTC / RNN-T | β€” | β€” | β€” |
| RL (value-based) | DQN / Double DQN | β€” | β€” | β€” |
| RL (policy-based) | PPO | β€” | β€” | β€” |
| Regression | MSE / Huber | β€” | Huber | NLL w/ variance |
| Metric Learning | Triplet / Proxy Anchor | β€” | β€” | β€” |
| Medical Segmentation | Dice + Boundary | Tversky / Focal Tversky | β€” | β€” |
| 3D Reconstruction | Chamfer + Normal | β€” | β€” | β€” |
| Depth Estimation | Scale-Invariant | β€” | β€” | β€” |
| Time Series | MSE / Quantile | β€” | Huber | CRPS |
| Continual Learning | EWC / DER++ | β€” | β€” | β€” |
| Fairness | Group DRO | β€” | β€” | β€” |

---

## πŸ“ Key Mathematical Formulations

**Cross-Entropy Loss**

$$
\mathcal{L}_{CE} = -\sum_{c=1}^{C} y_c \log(\hat{y}_c)
$$

**Binary Cross-Entropy**

$$
\mathcal{L}_{BCE} = -[y \log(\hat{y}) + (1-y) \log(1-\hat{y})]
$$

**Focal Loss**

$$
\mathcal{L}_{FL} = -\alpha_t (1 - p_t)^\gamma \log(p_t)
$$

**Dice Loss**

$$
\mathcal{L}_{Dice} = 1 - \frac{2 \sum_i p_i g_i}{\sum_i p_i + \sum_i g_i}
$$

**Triplet Loss**

$$
\mathcal{L}_{Triplet} = \max(0, \|f_a - f_p\|_2 - \|f_a - f_n\|_2 + \alpha)
$$

**InfoNCE / Contrastive Loss**

$$
\mathcal{L}_{InfoNCE} = -\log \frac{\exp(\text{sim}(z_i, z_j) / \tau)}{\sum_{k=1}^{2N} \mathbb{1}_{[k \neq i]} \exp(\text{sim}(z_i, z_k) / \tau)}
$$

**KL Divergence**

$$
D_{KL}(P \| Q) = \sum_x P(x) \log \frac{P(x)}{Q(x)}
$$

**DDPM Loss (simplified)**

$$
\mathcal{L}_{DDPM} = \mathbb{E}_{t, x_0, \epsilon} \left[ \| \epsilon - \epsilon_\theta(x_t, t) \|^2 \right]
$$

**DPO Loss**

$$
\mathcal{L}_{DPO} = -\log \sigma \left( \beta \log \frac{\pi_\theta(y_w|x)}{\pi_{ref}(y_w|x)} - \beta \log \frac{\pi_\theta(y_l|x)}{\pi_{ref}(y_l|x)} \right)
$$

**IoU Loss**

$$
\mathcal{L}_{IoU} = 1 - \frac{|B_p \cap B_{gt}|}{|B_p \cup B_{gt}|}
$$

**ArcFace Loss**

$$
\mathcal{L}_{ArcFace} = -\log \frac{e^{s \cos(\theta_{y_i} + m)}}{e^{s \cos(\theta_{y_i} + m)} + \sum_{j \neq y_i} e^{s \cos \theta_j}}
$$

**Wasserstein Distance (WGAN)**

$$
\mathcal{L}_{WGAN} = \mathbb{E}_{x \sim p_{data}}[D(x)] - \mathbb{E}_{z \sim p_z}[D(G(z))]
$$

---

## Classification

**0/1 Loss** (1950) β€” The theoretical misclassification indicator; 1 if prediction β‰  label, 0 otherwise. Non-differentiable, foundational to learning theory.
πŸ“„ *Statistical Decision Functions* β€” Wald, A.

**Cross-Entropy Loss / Log Loss / Negative Log-Likelihood** (1948) β€” Measures divergence between predicted probability distribution and true labels; the default loss for multi-class classification.
πŸ“„ [A Mathematical Theory of Communication](https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf) β€” Shannon, C.E.
πŸ’» [`torch.nn.CrossEntropyLoss`](https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html)

**Binary Cross-Entropy** (1958) β€” Cross-entropy specialized for two-class or multi-label problems; operates on each output independently.
πŸ“„ Derived from logistic regression β€” Cox, D.R. (1958)
πŸ’» [`torch.nn.BCEWithLogitsLoss`](https://pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html)

**Hinge Loss / SVM Loss** (1995) β€” Maximizes the margin between classes; the core loss behind Support Vector Machines.
πŸ“„ [Support-Vector Networks](https://link.springer.com/article/10.1007/BF00994018) β€” Cortes, C. & Vapnik, V.
πŸ’» [`torch.nn.MultiMarginLoss`](https://pytorch.org/docs/stable/generated/torch.nn.MultiMarginLoss.html)

**Knowledge Distillation Loss / Soft Cross-Entropy** (2015) β€” Trains a student network to mimic a teacher by matching softened output distributions.
πŸ“„ [Distilling the Knowledge in a Neural Network](https://arxiv.org/abs/1503.02531) β€” Hinton, G., Vinyals, O. & Dean, J.
πŸ’» [`torch.nn.KLDivLoss`](https://pytorch.org/docs/stable/generated/torch.nn.KLDivLoss.html)

**Large-Margin Softmax Loss (L-Softmax)** (2016) β€” Introduces angular margin constraints into softmax for intra-class compactness and inter-class separability.
πŸ“„ [Large-Margin Softmax Loss for Convolutional Neural Networks](https://arxiv.org/abs/1612.02295) β€” Liu, W., Wen, Y., Yu, Z. & Yang, M.
πŸ’» [wy1iu/LargeMargin_Softmax_Loss](https://github.com/wy1iu/LargeMargin_Softmax_Loss)

**Center Loss** (2016) β€” Penalizes distance of features from learned class centers, improving discriminative feature learning.
πŸ“„ [A Discriminative Feature Learning Approach for Deep Face Recognition](https://kpzhang93.github.io/papers/eccv2016.pdf) β€” Wen, Y., Zhang, K., Li, Z. & Qiao, Y.
πŸ’» [KaiyangZhou/pytorch-center-loss](https://github.com/KaiyangZhou/pytorch-center-loss)

**Label Smoothing** (2016) β€” Replaces hard one-hot targets with soft targets, preventing overconfident predictions and improving generalization.
πŸ“„ [Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567) β€” Szegedy, C. et al.
πŸ’» [`torch.nn.CrossEntropyLoss(label_smoothing=...)`](https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html)

**Sparsemax Loss** (2016) β€” Sparse alternative to softmax that assigns exactly zero probability to irrelevant classes.
πŸ“„ [From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification](https://arxiv.org/abs/1602.02068) β€” Martins, A.F.T. & Astudillo, R.F.
πŸ’» [deep-spin/entmax](https://github.com/deep-spin/entmax)

**Focal Loss** (2017) β€” Down-weights well-classified examples to focus training on hard negatives; designed for extreme class imbalance.
πŸ“„ [Focal Loss for Dense Object Detection](https://arxiv.org/abs/1708.02002) β€” Lin, T.-Y., Goyal, P., Girshick, R., He, K. & DollΓ‘r, P.
πŸ’» [AdeelH/pytorch-multi-class-focal-loss](https://github.com/AdeelH/pytorch-multi-class-focal-loss)

**Generalized Cross-Entropy (GCE)** (2018) β€” Noise-robust loss interpolating between MAE and cross-entropy via a tunable parameter q.
πŸ“„ [Generalized Cross Entropy Loss for Training Deep Neural Networks with Noisy Labels](https://arxiv.org/abs/1805.07836) β€” Zhang, Z. & Sabuncu, M.R.
πŸ’» [AlanChou/Truncated-Loss](https://github.com/AlanChou/Truncated-Loss)

**Complement Objective Training (COT)** (2019) β€” Augments cross-entropy with a complement objective that neutralizes non-target class probabilities.
πŸ“„ [Complement Objective Training](https://arxiv.org/abs/1903.01182) β€” Chen, H.-Y. et al.
πŸ’» [henry8527/COT](https://github.com/henry8527/COT)

**Class-Balanced Loss** (2019) β€” Re-weights loss by the effective number of samples per class for long-tailed distributions.
πŸ“„ [Class-Balanced Loss Based on Effective Number of Samples](https://arxiv.org/abs/1901.05555) β€” Cui, Y. et al.
πŸ’» [vandit15/Class-balanced-loss-pytorch](https://github.com/vandit15/Class-balanced-loss-pytorch)

**Symmetric Cross-Entropy (SCE)** (2019) β€” Combines standard CE with reverse CE for robustness to label noise.
πŸ“„ [Symmetric Cross Entropy for Robust Learning with Noisy Labels](https://arxiv.org/abs/1908.06112) β€” Wang, Y. et al.

**Bi-Tempered Logistic Loss** (2019) β€” Two temperature parameters bound the loss (handling mislabeled data) and produce heavy-tailed softmax (handling outliers).
πŸ“„ [Robust Bi-Tempered Logistic Loss Based on Bregman Divergences](https://arxiv.org/abs/1906.03361) β€” Amid, E. et al.
πŸ’» [google/bi-tempered-loss](https://github.com/google/bi-tempered-loss)

**Taylor Cross-Entropy Loss** (2020) β€” Taylor series expansion of CE creating a noise-robust loss.
πŸ“„ [Can Cross Entropy Loss Be Robust to Label Noise?](https://www.ijcai.org/proceedings/2020/305) β€” Feng, L. et al.

**Asymmetric Loss (ASL)** (2021) β€” Different focusing levels for positive and negative samples in multi-label classification.
πŸ“„ [Asymmetric Loss For Multi-Label Classification](https://arxiv.org/abs/2009.14119) β€” Ben-Baruch, E. et al.
πŸ’» [Alibaba-MIIL/ASL](https://github.com/Alibaba-MIIL/ASL)

**Poly Loss** (2022) β€” Views loss functions as polynomial expansions and adjusts leading coefficients; generalizes CE and focal loss.
πŸ“„ [PolyLoss: A Polynomial Expansion Perspective of Classification Loss Functions](https://arxiv.org/abs/2204.12511) β€” Leng, Z. et al.
πŸ’» [abhuse/polyloss-pytorch](https://github.com/abhuse/polyloss-pytorch)

## Regression

**Mean Absolute Error (MAE) / L1 Loss** (~1757) β€” Penalizes absolute differences; robust to outliers but non-smooth gradient at zero.
πŸ“„ Attributed to Boscovich, R.J. (1757)
πŸ’» [`torch.nn.L1Loss`](https://pytorch.org/docs/stable/generated/torch.nn.L1Loss.html)

**Mean Squared Error (MSE) / L2 Loss** (~1805) β€” Penalizes squared differences; sensitive to outliers. The method of least squares.
πŸ“„ Legendre, A.-M. (1805); Gauss, C.F. (1809)
πŸ’» [`torch.nn.MSELoss`](https://pytorch.org/docs/stable/generated/torch.nn.MSELoss.html)

**Huber Loss** (1964) β€” MSE for small errors, MAE for large errors. Robust to outliers with smooth gradients near zero.
πŸ“„ [Robust Estimation of a Location Parameter](https://projecteuclid.org/journals/annals-of-mathematical-statistics/volume-35/issue-1/Robust-Estimation-of-a-Location-Parameter/10.1214/aoms/1177703732.full) β€” Huber, P.J.
πŸ’» [`torch.nn.HuberLoss`](https://pytorch.org/docs/stable/generated/torch.nn.HuberLoss.html)

**Tukey's Biweight Loss** (1974) β€” Redescending M-estimator that completely rejects gross outliers beyond a threshold.
πŸ“„ [The Fitting of Power Series, Meaning Polynomials, Illustrated on Band-Spectroscopic Data](https://www.tandfonline.com/doi/abs/10.1080/00401706.1974.10489171) β€” Beaton, A.E. & Tukey, J.W.

**Quantile Loss / Pinball Loss** (1978) β€” Asymmetrically penalizes over/under-predictions for quantile regression and uncertainty estimation.
πŸ“„ [Regression Quantiles](https://people.eecs.berkeley.edu/~jordan/sail/readings/koenker-bassett.pdf) β€” Koenker, R. & Bassett, G.

**Smooth L1 Loss** (2015) β€” L2 for small errors, L1 for large errors (Huber with Ξ΄=1); standard for bounding box regression.
πŸ“„ [Fast R-CNN](https://arxiv.org/abs/1504.08083) β€” Girshick, R.
πŸ’» [`torch.nn.SmoothL1Loss`](https://pytorch.org/docs/stable/generated/torch.nn.SmoothL1Loss.html)

**Wing Loss** (2018) β€” Amplifies small-to-medium range errors for facial landmark localization.
πŸ“„ [Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks](https://arxiv.org/abs/1711.06753) β€” Feng, Z.-H. et al.

**Balanced L1 Loss** (2019) β€” Rebalances inlier vs. outlier loss contributions in object detection regression.
πŸ“„ [Libra R-CNN: Towards Balanced Learning for Object Detection](https://arxiv.org/abs/1904.02701) β€” Pang, J. et al.
πŸ’» [OceanPang/Libra_R-CNN](https://github.com/OceanPang/Libra_R-CNN)

**Adaptive Wing Loss** (2019) β€” Adapts curvature based on ground truth heatmap values for face alignment.
πŸ“„ [Adaptive Wing Loss for Robust Face Alignment via Heatmap Regression](https://arxiv.org/abs/1904.07399) β€” Wang, X. et al.
πŸ’» [protossw512/AdaptiveWingLoss](https://github.com/protossw512/AdaptiveWingLoss)

**Log-Cosh Loss** (2022) β€” Approximates Huber loss using log(cosh(x)); twice differentiable everywhere.
πŸ“„ [Statistical Properties of the Log-Cosh Loss Function Used in Machine Learning](https://arxiv.org/abs/2208.04564) β€” Chen, K. et al.

## Segmentation

**Sensitivity-Specificity Loss** (2015) β€” Weighted combination of sensitivity and specificity for extreme class imbalance in lesion segmentation.
πŸ“„ [Deep Convolutional Encoder Networks for Multiple Sclerosis Lesion Segmentation](https://doi.org/10.1007/978-3-319-24574-4_1) β€” Brosch et al.

**Dice Loss** (2016) β€” Directly optimizes the Dice coefficient (F1 score); robust to class imbalance.
πŸ“„ [V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation](https://arxiv.org/abs/1606.04797) β€” Milletari, F. et al.
πŸ’» [JunMa11/SegLossOdyssey](https://github.com/JunMa11/SegLossOdyssey)

**Generalized Dice Loss (GDL)** (2017) β€” Per-class volume weighting for multi-class segmentation with highly imbalanced labels.
πŸ“„ [Generalised Dice Overlap as a Deep Learning Loss Function for Highly Unbalanced Segmentations](https://arxiv.org/abs/1707.03237) β€” Sudre, C.H. et al.

**Tversky Loss** (2017) β€” Tunable Ξ±/Ξ² parameters controlling the FP/FN trade-off; useful for small lesion segmentation.
πŸ“„ [Tversky Loss Function for Image Segmentation Using 3D Fully Convolutional Deep Networks](https://arxiv.org/abs/1706.05721) β€” Salehi, S.S.M. et al.

**LovΓ‘sz-Softmax Loss** (2018) β€” Tractable convex surrogate for directly optimizing the Jaccard index (IoU).
πŸ“„ [The LovΓ‘sz-Softmax Loss: A Tractable Surrogate for the Optimization of the Intersection-Over-Union Measure](https://arxiv.org/abs/1705.08790) β€” Berman, M. et al.
πŸ’» [bermanmaxim/LovaszSoftmax](https://github.com/bermanmaxim/LovaszSoftmax)

**Exponential Logarithmic Loss** (2018) β€” Combines exponentially weighted focal-style Dice and CE for very small structures.
πŸ“„ [3D Segmentation with Exponential Logarithmic Loss for Highly Unbalanced Object Sizes](https://arxiv.org/abs/1809.00076) β€” Wong et al.

**Asymmetric Similarity Loss** (2018) β€” Asymmetric FΞ²-score-based similarity to balance precision and recall.
πŸ“„ [Asymmetric Loss Functions and Deep Densely Connected Networks for Highly Imbalanced Medical Image Segmentation](https://arxiv.org/abs/1803.11078) β€” Hashemi et al.

**Focal Tversky Loss** (2019) β€” Focal-style exponent on Tversky loss to focus on hard, misclassified regions.
πŸ“„ [A Novel Focal Tversky Loss Function with Improved Attention U-Net for Lesion Segmentation](https://arxiv.org/abs/1810.07842) β€” Abraham, N. & Khan, N.M.

**Boundary Loss** (2019) β€” Distance metric on contour space rather than region overlap; effective for highly unbalanced tasks.
πŸ“„ [Boundary Loss for Highly Unbalanced Segmentation](https://arxiv.org/abs/1812.07032) β€” Kervadec, H. et al.
πŸ’» [LIVIAETS/boundary-loss](https://github.com/LIVIAETS/boundary-loss)

**Hausdorff Distance Loss** (2019) β€” Directly optimizes the Hausdorff distance between predicted and ground-truth boundaries.
πŸ“„ [Reducing the Hausdorff Distance in Medical Image Segmentation with Convolutional Neural Networks](https://arxiv.org/abs/1904.10030) β€” Karimi, D. & Salcudean, S.E.

**Combo Loss** (2019) β€” Weighted combination of modified CE and Dice loss for input and output class imbalance.
πŸ“„ [Combo Loss: Handling Input and Output Imbalance in Multi-Organ Segmentation](https://arxiv.org/abs/1805.02798) β€” Taghanaki et al.

**Region Mutual Information (RMI) Loss** (2019) β€” Maximizes mutual information between predicted and ground-truth label regions.
πŸ“„ [Region Mutual Information Loss for Semantic Segmentation](https://arxiv.org/abs/1910.12037) β€” Zhao et al.
πŸ’» [ZJULearning/RMI](https://github.com/ZJULearning/RMI)

**Topological Loss** (2019) β€” Uses persistent homology to enforce correct topological structure in segmentation.
πŸ“„ [Topology-Preserving Deep Image Segmentation](https://arxiv.org/abs/1906.05404) β€” Hu et al.
πŸ’» [HuXiaoling/TopoLoss](https://github.com/HuXiaoling/TopoLoss)

**Log-Cosh Dice Loss** (2020) β€” Log-cosh smoothing on Dice loss for smoother gradients and stable training.
πŸ“„ [A Survey of Loss Functions for Semantic Segmentation](https://arxiv.org/abs/2006.14822) β€” Jadon, S.

**clDice** (2021) β€” Topology-preserving loss for tubular structures; computes Dice on skeletonized centerlines.
πŸ“„ [clDice β€” A Novel Topology-Preserving Loss Function for Tubular Structure Segmentation](https://arxiv.org/abs/2003.07311) β€” Shit et al.
πŸ’» [jocpae/clDice](https://github.com/jocpae/clDice)

**Unified Focal Loss** (2022) β€” Hierarchical framework generalizing Dice-based and CE-based losses with focal modulation.
πŸ“„ [Unified Focal Loss: Generalising Dice and Cross Entropy-Based Losses to Handle Class Imbalanced Medical Image Segmentation](https://arxiv.org/abs/2102.04525) β€” Yeung et al.
πŸ’» [mlyg/unified-focal-loss](https://github.com/mlyg/unified-focal-loss)

## Object Detection (Bounding Box)

**Smooth L1 Loss** (2015) β€” Piecewise L2/L1 loss; standard for bounding box regression.
πŸ“„ [Fast R-CNN](https://arxiv.org/abs/1504.08083) β€” Girshick, R.

**IoU Loss** (2016) β€” Directly regresses Intersection-over-Union between predicted and ground-truth boxes.
πŸ“„ [UnitBox: An Advanced Object Detection Network](https://arxiv.org/abs/1608.01471) β€” Yu et al.

**Focal Loss** (2017) β€” Modulating factor (1βˆ’pβ‚œ)^Ξ³ down-weights easy negatives in dense detection.
πŸ“„ [Focal Loss for Dense Object Detection](https://arxiv.org/abs/1708.02002) β€” Lin, T.-Y. et al.
πŸ’» [facebookresearch/detectron2](https://github.com/facebookresearch/detectron2)

**Bounded IoU Loss** (2018) β€” Upper-bounds IoU change per coordinate for stable high-IoU refinement.
πŸ“„ [Improving Object Localization with Fitness NMS and Bounded IoU Loss](https://arxiv.org/abs/1711.00164) β€” Tychsen-Smith & Petersson

**GIoU Loss** (2019) β€” Extends IoU with a penalty based on the smallest enclosing box; enables gradient flow for non-overlapping boxes.
πŸ“„ [Generalized Intersection over Union](https://arxiv.org/abs/1902.09630) β€” Rezatofighi et al.

**DIoU Loss** (2020) β€” Adds normalized center-point distance penalty to IoU for faster convergence.
πŸ“„ [Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression](https://arxiv.org/abs/1911.08287) β€” Zheng et al.
πŸ’» [Zzh-tju/DIoU](https://github.com/Zzh-tju/DIoU)

**CIoU Loss** (2020) β€” Extends DIoU with aspect ratio consistency penalty for complete geometric alignment.
πŸ“„ [Distance-IoU Loss](https://arxiv.org/abs/1911.08287) β€” Zheng et al.

**Alpha-IoU Loss** (2021) β€” Power parameter Ξ± amplifies loss and gradient for high-quality anchors.
πŸ“„ [Alpha-IoU: A Family of Power Intersection over Union Losses](https://arxiv.org/abs/2110.13675) β€” He et al.
πŸ’» [Jacobi93/Alpha-IoU](https://github.com/Jacobi93/Alpha-IoU)

**EIoU Loss** (2022) β€” Decomposes CIoU penalty into separate width/height terms.
πŸ“„ [Focal and Efficient IOU Loss for Accurate Bounding Box Regression](https://arxiv.org/abs/2101.08158) β€” Zhang et al.

**SIoU Loss** (2022) β€” Angle-aware penalty considering vector direction between predicted and target boxes.
πŸ“„ [SIoU Loss: More Powerful Learning for Bounding Box Regression](https://arxiv.org/abs/2205.12740) β€” Gevorgyan

**WIoU Loss** (2023) β€” Dynamic non-monotonic focusing mechanism based on outlier degree.
πŸ“„ [Wise-IoU: Bounding Box Regression Loss with Dynamic Focusing Mechanism](https://arxiv.org/abs/2301.10051) β€” Tong et al.
πŸ’» [Instinct323/Wise-IoU](https://github.com/Instinct323/Wise-IoU)

**MPDIoU Loss** (2023) β€” Bounding box similarity via minimum point distances between corners.
πŸ“„ [MPDIoU: A Loss for Efficient and Accurate Bounding Box Regression](https://arxiv.org/abs/2307.07662) β€” Ma & Xu

**Inner-IoU Loss** (2023) β€” IoU through auxiliary inner bounding boxes with a scaling factor.
πŸ“„ [Inner-IoU: More Effective Intersection over Union Loss with Auxiliary Bounding Box](https://arxiv.org/abs/2311.02877) β€” Zhang et al.

## Generative Models β€” GANs

**Minimax / Original GAN Loss** (2014) β€” Discriminator maximizes, generator minimizes binary cross-entropy in a two-player minimax game.
πŸ“„ [Generative Adversarial Nets](https://arxiv.org/abs/1406.2661) β€” Goodfellow et al.

**Non-Saturating GAN Loss** (2014) β€” Generator maximizes log(D(G(z))) instead of minimizing log(1βˆ’D(G(z))), providing stronger early gradients.
πŸ“„ [Generative Adversarial Nets](https://arxiv.org/abs/1406.2661) β€” Goodfellow et al.

**Feature Matching Loss** (2016) β€” Generator matches expected feature statistics at an intermediate discriminator layer.
πŸ“„ [Improved Techniques for Training GANs](https://arxiv.org/abs/1606.03498) β€” Salimans et al.

**Least Squares GAN Loss (LSGAN)** (2017) β€” L2 objective minimizing Pearson χ² divergence for more stable training.
πŸ“„ [Least Squares Generative Adversarial Networks](https://arxiv.org/abs/1611.04076) β€” Mao et al.

**Wasserstein Loss (WGAN)** (2017) β€” Earth Mover's distance providing meaningful gradients even for non-overlapping distributions.
πŸ“„ [Wasserstein GAN](https://arxiv.org/abs/1701.07875) β€” Arjovsky, M. et al.
πŸ’» [martinarjovsky/WassersteinGAN](https://github.com/martinarjovsky/WassersteinGAN)

**WGAN-GP** (2017) β€” Gradient penalty replacing weight clipping for better Lipschitz constraint enforcement.
πŸ“„ [Improved Training of Wasserstein GANs](https://arxiv.org/abs/1704.00028) β€” Gulrajani et al.

**Hinge Loss GAN** (2017) β€” Max-margin formulation with bounded gradients; used in BigGAN, SAGAN.
πŸ“„ [Geometric GAN](https://arxiv.org/abs/1705.02894) β€” Lim & Ye
πŸ“„ [Spectral Normalization for GANs](https://arxiv.org/abs/1802.05957) β€” Miyato et al.

**Spectral Normalization** (2018) β€” Constrains spectral norm of weight matrices to stabilize discriminator training.
πŸ“„ [Spectral Normalization for Generative Adversarial Networks](https://arxiv.org/abs/1802.05957) β€” Miyato et al.

**R1 Regularization** (2018) β€” Zero-centered gradient penalty on real data for local convergence guarantees.
πŸ“„ [Which Training Methods for GANs do actually Converge?](https://arxiv.org/abs/1801.04406) β€” Mescheder et al.
πŸ’» [NVlabs/stylegan2-ada-pytorch](https://github.com/NVlabs/stylegan2-ada-pytorch)

**Relativistic GAN Loss (RaGAN)** (2018) β€” Discriminator estimates probability that real data is more realistic than fake.
πŸ“„ [The Relativistic Discriminator](https://arxiv.org/abs/1807.00734) β€” Jolicoeur-Martineau, A.

**Mode Seeking Loss** (2019) β€” Maximizes image/latent distance ratio to encourage diverse mode exploration.
πŸ“„ [Mode Seeking Generative Adversarial Networks for Diverse Image Synthesis](https://arxiv.org/abs/1903.05628) β€” Mao et al.

**Path Length Regularization** (2020) β€” Consistent Jacobian norm across latent space for smooth interpolations.
πŸ“„ [Analyzing and Improving the Image Quality of StyleGAN](https://arxiv.org/abs/1912.04958) β€” Karras et al.
πŸ’» [NVlabs/stylegan2-ada-pytorch](https://github.com/NVlabs/stylegan2-ada-pytorch)

**LeCam Regularization** (2021) β€” LeCam divergence-based stabilization under limited data.
πŸ“„ [Regularizing Generative Adversarial Networks under Limited Data](https://arxiv.org/abs/2104.03310) β€” Tseng et al.
πŸ’» [google/lecam-gan](https://github.com/google/lecam-gan)

**Projected GAN Loss** (2021) β€” Multi-scale discrimination in projected feature space from pretrained networks.
πŸ“„ [Projected GANs Converge Faster](https://arxiv.org/abs/2111.01007) β€” Sauer et al.

## Generative Models β€” VAEs

**ELBO / VAE Loss** (2013) β€” Reconstruction loss + KL divergence regularizer pushing posterior toward prior.
πŸ“„ [Auto-Encoding Variational Bayes](https://arxiv.org/abs/1312.6114) β€” Kingma, D.P. & Welling, M.
πŸ’» [AntixK/PyTorch-VAE](https://github.com/AntixK/PyTorch-VAE)

**Ξ²-VAE Loss** (2017) β€” Upweights KL divergence (Ξ² > 1) for more disentangled latent representations.
πŸ“„ [Ξ²-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework](https://openreview.net/forum?id=Sy2fzU9gl) β€” Higgins et al.

**VQ-VAE Loss** (2017) β€” Reconstruction + vector quantization commitment loss + codebook loss for discrete latents.
πŸ“„ [Neural Discrete Representation Learning](https://arxiv.org/abs/1711.00937) β€” van den Oord et al.

**WAE Loss** (2018) β€” Penalized Wasserstein distance using MMD or adversarial regularization on latent space.
πŸ“„ [Wasserstein Auto-Encoders](https://arxiv.org/abs/1711.01558) β€” Tolstikhin et al.

## Generative Models β€” Diffusion & Flow

**Denoising Score Matching** (2011) β€” Training a denoising autoencoder equals matching the score function of noise-perturbed data.
πŸ“„ [A Connection Between Score Matching and Denoising Autoencoders](https://doi.org/10.1162/NECO_a_00142) β€” Vincent, P.

**Score Matching with Langevin Dynamics (NCSN)** (2019) β€” Noise-conditional score network across multiple noise scales with annealed Langevin sampling.
πŸ“„ [Generative Modeling by Estimating Gradients of the Data Distribution](https://arxiv.org/abs/1907.05600) β€” Song, Y. & Ermon, S.

**DDPM Loss** (2020) β€” Simplified variational bound: predict the noise added at each diffusion step via weighted MSE.
πŸ“„ [Denoising Diffusion Probabilistic Models](https://arxiv.org/abs/2006.11239) β€” Ho, J. et al.

**Variational Diffusion Loss** (2021) β€” Continuous-time variational lower bound with learnable noise schedule.
πŸ“„ [Variational Diffusion Models](https://arxiv.org/abs/2107.00630) β€” Kingma et al.

**v-prediction Loss** (2022) β€” Predicts velocity v = Ξ±Β·Ξ΅ βˆ’ σ·x for improved numerical stability and progressive distillation.
πŸ“„ [Progressive Distillation for Fast Sampling of Diffusion Models](https://arxiv.org/abs/2202.00512) β€” Salimans, T. & Ho, J.

**Rectified Flow Loss** (2022) β€” Learns straight-line ODE trajectories between noise and data distributions.
πŸ“„ [Flow Straight and Fast: Learning to Generate and Transfer Data with Rectified Flow](https://arxiv.org/abs/2209.03003) β€” Liu et al.

**Flow Matching Loss** (2023) β€” Simulation-free training for continuous normalizing flows; regresses vector fields of conditional probability paths.
πŸ“„ [Flow Matching for Generative Modeling](https://arxiv.org/abs/2210.02747) β€” Lipman et al.
πŸ’» [facebookresearch/flow_matching](https://github.com/facebookresearch/flow_matching)

**Consistency Loss** (2023) β€” Self-consistency along the probability flow ODE for high-quality one-step generation.
πŸ“„ [Consistency Models](https://arxiv.org/abs/2303.01469) β€” Song et al.
πŸ’» [OpenAI/consistency_models](https://github.com/openai/consistency_models)

## Reconstruction & Perceptual

**SSIM Loss** (2004) β€” Structural similarity using luminance, contrast, and structure comparisons; used as 1βˆ’SSIM.
πŸ“„ [Image Quality Assessment: From Error Visibility to Structural Similarity](https://ieeexplore.ieee.org/document/1284395) β€” Wang et al.
πŸ’» [VainF/pytorch-msssim](https://github.com/VainF/pytorch-msssim)

**Style Loss (Gram Matrix)** (2015) β€” Matches Gram matrices of CNN feature maps for texture/style transfer.
πŸ“„ [A Neural Algorithm of Artistic Style](https://arxiv.org/abs/1508.06576) β€” Gatys et al.

**Perceptual Loss / VGG Loss** (2016) β€” L2 distance between deep feature representations of generated and target images.
πŸ“„ [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](https://arxiv.org/abs/1603.08155) β€” Johnson et al.

**LPIPS** (2018) β€” Learned perceptual metric using calibrated deep features; correlates better with human perception than SSIM/PSNR.
πŸ“„ [The Unreasonable Effectiveness of Deep Features as a Perceptual Metric](https://arxiv.org/abs/1801.03924) β€” Zhang et al.
πŸ’» [richzhang/PerceptualSimilarity](https://github.com/richzhang/PerceptualSimilarity)

## Image Super-Resolution & Restoration

**Charbonnier Loss** (1994) β€” Differentiable approximation to L1 (√(xΒ²+Ρ²)); robust to outliers, smooth at zero.
πŸ“„ [Two Deterministic Half-Quadratic Regularization Algorithms for Computed Imaging](https://ieeexplore.ieee.org/document/413553) β€” Charbonnier et al.

**MS-SSIM Loss** (2003) β€” Multi-scale SSIM evaluating structural similarity across multiple resolutions.
πŸ“„ [Multi-Scale Structural Similarity for Image Quality Assessment](https://ieeexplore.ieee.org/document/1292216) β€” Wang et al.

**SRGAN Loss** (2017) β€” Adversarial loss + VGG perceptual content loss for photo-realistic 4Γ— super-resolution.
πŸ“„ [Photo-Realistic Single Image Super-Resolution Using a GAN](https://arxiv.org/abs/1609.04802) β€” Ledig et al.

**Contextual Loss** (2018) β€” Feature-level context matching without spatial alignment; enables training with non-aligned data.
πŸ“„ [The Contextual Loss for Image Transformation with Non-Aligned Data](https://arxiv.org/abs/1803.02077) β€” Mechrez et al.

**ESRGAN Loss** (2018) β€” Relativistic average discriminator + pre-activation VGG perceptual loss for enhanced texture recovery.
πŸ“„ [ESRGAN: Enhanced Super-Resolution Generative Adversarial Networks](https://arxiv.org/abs/1809.00219) β€” Wang et al.
πŸ’» [xinntao/ESRGAN](https://github.com/xinntao/ESRGAN)

**Focal Frequency Loss** (2021) β€” Adaptively focuses on hard-to-synthesize frequencies in the Fourier domain.
πŸ“„ [Focal Frequency Loss for Image Reconstruction and Synthesis](https://arxiv.org/abs/2012.12821) β€” Jiang et al.
πŸ’» [EndlessSora/focal-frequency-loss](https://github.com/EndlessSora/focal-frequency-loss)

## Contrastive & Self-Supervised Learning

**Contrastive Loss** (2005) β€” Pairwise loss pulling similar pairs together and pushing dissimilar pairs apart by a margin.
πŸ“„ [Learning a Similarity Metric Discriminatively, with Application to Face Verification](https://www.researchgate.net/publication/4156225) β€” Chopra, Hadsell, LeCun

**N-pair Loss** (2016) β€” Generalizes triplet loss by simultaneously pushing away negatives from Nβˆ’1 classes.
πŸ“„ [Improved Deep Metric Learning with Multi-class N-pair Loss Objective](https://papers.nips.cc/paper/6200) β€” Sohn, K.

**InfoNCE / CPC Loss** (2018) β€” Noise-contrastive estimation maximizing mutual information between latent representations.
πŸ“„ [Representation Learning with Contrastive Predictive Coding](https://arxiv.org/abs/1807.03748) β€” van den Oord et al.
πŸ’» [RElbers/info-nce-pytorch](https://github.com/RElbers/info-nce-pytorch)

**MoCo Loss** (2020) β€” InfoNCE with momentum-updated encoder and dynamic dictionary queue.
πŸ“„ [Momentum Contrast for Unsupervised Visual Representation Learning](https://arxiv.org/abs/1911.05722) β€” He et al.
πŸ’» [facebookresearch/moco](https://github.com/facebookresearch/moco)

**NT-Xent / SimCLR Loss** (2020) β€” Normalized temperature-scaled cross-entropy over cosine similarities of augmented pairs.
πŸ“„ [A Simple Framework for Contrastive Learning of Visual Representations](https://arxiv.org/abs/2002.05709) β€” Chen et al.

**BYOL Loss** (2020) β€” MSE between L2-normalized predictions and targets; learns without negative pairs via momentum teacher.
πŸ“„ [Bootstrap Your Own Latent](https://arxiv.org/abs/2006.07733) β€” Grill et al.

**SwAV Loss** (2020) β€” Swapped prediction contrasting cluster assignments from different augmented views.
πŸ“„ [Unsupervised Learning of Visual Features by Contrasting Cluster Assignments](https://arxiv.org/abs/2006.09882) β€” Caron et al.
πŸ’» [facebookresearch/swav](https://github.com/facebookresearch/swav)

**Supervised Contrastive Loss (SupCon)** (2020) β€” Extends self-supervised contrastive loss with label information to pull same-class embeddings together.
πŸ“„ [Supervised Contrastive Learning](https://arxiv.org/abs/2004.11362) β€” Khosla et al.
πŸ’» [HobbitLong/SupContrast](https://github.com/HobbitLong/SupContrast)

**Barlow Twins Loss** (2021) β€” Cross-correlation matrix close to identity; reduces redundancy between embedding dimensions.
πŸ“„ [Barlow Twins: Self-Supervised Learning via Redundancy Reduction](https://arxiv.org/abs/2103.03230) β€” Zbontar et al.
πŸ’» [facebookresearch/barlowtwins](https://github.com/facebookresearch/barlowtwins)

**DINO Loss** (2021) β€” Self-distillation via cross-entropy between sharpened softmax outputs of student and momentum-teacher.
πŸ“„ [Emerging Properties in Self-Supervised Vision Transformers](https://arxiv.org/abs/2104.14294) β€” Caron et al.
πŸ’» [facebookresearch/dino](https://github.com/facebookresearch/dino)

**SimSiam Loss** (2021) β€” Negative cosine similarity with stop-gradient; no negatives, momentum, or large batches needed.
πŸ“„ [Exploring Simple Siamese Representation Learning](https://arxiv.org/abs/2011.10566) β€” Chen & He

**CLIP Loss** (2021) β€” Symmetric cross-entropy over image-text cosine similarities aligning visual and language representations.
πŸ“„ [Learning Transferable Visual Models From Natural Language Supervision](https://arxiv.org/abs/2103.00020) β€” Radford et al.
πŸ’» [mlfoundations/open_clip](https://github.com/mlfoundations/open_clip)

**VICReg Loss** (2022) β€” Variance + invariance + covariance regularization preventing collapse without negatives.
πŸ“„ [VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning](https://arxiv.org/abs/2105.04906) β€” Bardes et al.
πŸ’» [facebookresearch/vicreg](https://github.com/facebookresearch/vicreg)

**Decoupled Contrastive Loss** (2022) β€” Removes positive term from InfoNCE denominator, eliminating negative-positive coupling.
πŸ“„ [Decoupled Contrastive Learning](https://arxiv.org/abs/2110.06848) β€” Yeh et al.

**DINOv2 Loss** (2023) β€” DINO self-distillation + iBOT masked image modeling + Sinkhorn centering at scale.
πŸ“„ [DINOv2: Learning Robust Visual Features without Supervision](https://arxiv.org/abs/2304.07193) β€” Oquab et al.
πŸ’» [facebookresearch/dinov2](https://github.com/facebookresearch/dinov2)

**SigLIP Loss** (2023) β€” Pairwise sigmoid loss replacing softmax for efficient batch-parallel language-image pre-training.
πŸ“„ [Sigmoid Loss for Language Image Pre-Training](https://arxiv.org/abs/2303.15343) β€” Zhai et al.

## Metric Learning & Face Recognition

**Triplet Loss** (2015) β€” Minimizes anchor-positive distance while maximizing anchor-negative distance by a margin.
πŸ“„ [FaceNet: A Unified Embedding for Face Recognition and Clustering](https://arxiv.org/abs/1503.03832) β€” Schroff et al.
πŸ’» [KevinMusgrave/pytorch-metric-learning](https://github.com/KevinMusgrave/pytorch-metric-learning)

**Lifted Structured Loss** (2016) β€” Mines all positive and negative pairs in a batch simultaneously.
πŸ“„ [Deep Metric Learning via Lifted Structured Feature Embedding](https://arxiv.org/abs/1511.06452) β€” Oh Song et al.

**SphereFace / A-Softmax** (2017) β€” Multiplicative angular margin on a hypersphere for discriminative face features.
πŸ“„ [SphereFace: Deep Hypersphere Embedding for Face Recognition](https://arxiv.org/abs/1704.08063) β€” Liu et al.

**Proxy-NCA Loss** (2017) β€” Data-to-proxy comparisons with one learnable proxy per class; dramatically faster convergence.
πŸ“„ [No Fuss Distance Metric Learning Using Proxies](https://arxiv.org/abs/1703.07464) β€” Movshovitz-Attias et al.

**CosFace / LMCL** (2018) β€” Cosine margin penalty on target logit in normalized softmax.
πŸ“„ [CosFace: Large Margin Cosine Loss for Deep Face Recognition](https://arxiv.org/abs/1801.09414) β€” Wang et al.
πŸ’» [deepinsight/insightface](https://github.com/deepinsight/insightface)

**ArcFace** (2019) β€” Additive angular margin with clear geodesic distance interpretation.
πŸ“„ [ArcFace: Additive Angular Margin Loss for Deep Face Recognition](https://arxiv.org/abs/1801.07698) β€” Deng et al.
πŸ’» [deepinsight/insightface](https://github.com/deepinsight/insightface)

**Multi-Similarity Loss** (2019) β€” Mines and weights pairs using self-similarity, relative similarity, and negative similarity.
πŸ“„ [Multi-Similarity Loss with General Pair Weighting for Deep Metric Learning](https://arxiv.org/abs/1904.06627) β€” Wang et al.

**SoftTriple Loss** (2019) β€” Multiple centers per class bridging proxy-based and triplet-based losses.
πŸ“„ [SoftTriple Loss: Deep Metric Learning Without Triplet Sampling](https://arxiv.org/abs/1909.05235) β€” Qian et al.

**Circle Loss** (2020) β€” Unified pair similarity optimization with self-paced weighting.
πŸ“„ [Circle Loss: A Unified Perspective of Pair Similarity Optimization](https://arxiv.org/abs/2002.10857) β€” Sun et al.

**Proxy Anchor Loss** (2020) β€” Proxies as anchors associated with all batch data; fast convergence.
πŸ“„ [Proxy Anchor Loss for Deep Metric Learning](https://arxiv.org/abs/2003.13911) β€” Kim et al.
πŸ’» [tjddus9597/Proxy-Anchor-CVPR2020](https://github.com/tjddus9597/Proxy-Anchor-CVPR2020)

**Sub-center ArcFace** (2020) β€” Multiple sub-centers per class for noisy label handling.
πŸ“„ [Sub-center ArcFace: Boosting Face Recognition by Large-Scale Noisy Web Faces](https://arxiv.org/abs/1801.07698) β€” Deng et al.

**AdaFace** (2022) β€” Adaptive margin emphasizing hard or easy samples based on image quality.
πŸ“„ [AdaFace: Quality Adaptive Margin for Face Recognition](https://arxiv.org/abs/2204.00964) β€” Kim et al.
πŸ’» [mk-minchul/AdaFace](https://github.com/mk-minchul/AdaFace)

**ElasticFace** (2022) β€” Random margin values from a normal distribution each iteration for flexible separability.
πŸ“„ [ElasticFace: Elastic Margin Loss for Deep Face Recognition](https://arxiv.org/abs/2109.09416) β€” Boutros et al.
πŸ’» [fdbtrs/ElasticFace](https://github.com/fdbtrs/ElasticFace)

## NLP & Language Modeling

**Cross-Entropy / Next Token Prediction** β€” Standard autoregressive LM loss; foundation of GPT and all causal LMs.
πŸ“„ [Language Models are Unsupervised Multitask Learners](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf) β€” Radford et al. (GPT-2, 2019)

**Masked Language Model (MLM) Loss** (2019) β€” Masks 15% of tokens and predicts from bidirectional context. Introduced pre-train/fine-tune for NLU.
πŸ“„ [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/abs/1810.04805) β€” Devlin et al.

**Replaced Token Detection (RTD)** (2020) β€” Discriminator classifies every token as original or replaced; loss defined over all tokens for better sample efficiency.
πŸ“„ [ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators](https://arxiv.org/abs/2003.10555) β€” Clark et al.

**Sentence Order Prediction (SOP)** (2020) β€” Predicts whether two consecutive segments are in correct or swapped order.
πŸ“„ [ALBERT: A Lite BERT for Self-supervised Learning](https://arxiv.org/abs/1909.11942) β€” Lan et al.

**Span Corruption Loss** (2020) β€” Masks contiguous spans; encoder-decoder reconstructs only missing spans. All NLP tasks as text-to-text.
πŸ“„ [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://arxiv.org/abs/1910.10683) β€” Raffel et al.

**Mixture of Denoisers (MoD)** (2022) β€” Unifies causal LM, prefix LM, and span corruption into a single pre-training objective.
πŸ“„ [UL2: Unifying Language Learning Paradigms](https://arxiv.org/abs/2205.05131) β€” Tay et al.

## LLM Alignment (RLHF / DPO)

**PPO Loss / RLHF** (2017/2022) β€” Clipped surrogate objective for aligning LLMs with human preferences via a learned reward model.
πŸ“„ [Proximal Policy Optimization Algorithms](https://arxiv.org/abs/1707.06347) β€” Schulman et al.
πŸ“„ [Training language models to follow instructions with human feedback](https://arxiv.org/abs/2203.02155) β€” Ouyang et al.
πŸ’» [huggingface/trl](https://github.com/huggingface/trl)

**Reward Model Loss / Bradley-Terry** (2022) β€” Cross-entropy on pairwise human preferences for training scalar reward models.
πŸ“„ [Training language models to follow instructions with human feedback](https://arxiv.org/abs/2203.02155) β€” Ouyang et al.

**SLiC-HF Loss** (2023) β€” Contrastive ranking loss calibrating sequence likelihoods to human preferences.
πŸ“„ [SLiC-HF: Sequence Likelihood Calibration with Human Feedback](https://arxiv.org/abs/2305.10425) β€” Zhao et al.

**DPO Loss** (2023) β€” Closed-form policy optimization directly from preference pairs; no separate reward model or RL loop.
πŸ“„ [Direct Preference Optimization: Your Language Model is Secretly a Reward Model](https://arxiv.org/abs/2305.18290) β€” Rafailov et al.
πŸ’» [huggingface/trl β€” DPOTrainer](https://github.com/huggingface/trl)

**IPO Loss** (2023) β€” Squared loss on preference margins avoiding overfitting to Bradley-Terry assumption.
πŸ“„ [A General Theoretical Paradigm to Understand Learning from Human Preferences](https://arxiv.org/abs/2310.12036) β€” Azar et al.

**CPO Loss** (2024) β€” Contrastive preference loss without reference model for machine translation.
πŸ“„ [Contrastive Preference Optimization](https://arxiv.org/abs/2401.08417) β€” Xu et al.

**KTO Loss** (2024) β€” Kahneman-Tversky prospect theory applied to alignment; works from binary (good/bad) feedback.
πŸ“„ [KTO: Model Alignment as Prospect Theoretic Optimization](https://arxiv.org/abs/2402.01306) β€” Ethayarajh et al.
πŸ’» [huggingface/trl β€” KTOTrainer](https://github.com/huggingface/trl)

**GRPO Loss** (2024) β€” Group Relative Policy Optimization; estimates advantages from sampled output groups, eliminating the critic model.
πŸ“„ [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://arxiv.org/abs/2402.03300) β€” Shao et al.

**ORPO Loss** (2024) β€” Odds-ratio penalty added to SFT loss; combines instruction tuning and preference alignment in one stage.
πŸ“„ [ORPO: Monolithic Preference Optimization without Reference Model](https://arxiv.org/abs/2403.07691) β€” Hong et al.
πŸ’» [huggingface/trl β€” ORPOTrainer](https://github.com/huggingface/trl)

**SimPO Loss** (2024) β€” Reference-free preference optimization using length-normalized average log probability as implicit reward.
πŸ“„ [SimPO: Simple Preference Optimization with a Reference-Free Reward](https://arxiv.org/abs/2405.14734) β€” Meng et al.
πŸ’» [princeton-nlp/SimPO](https://github.com/princeton-nlp/SimPO)

**SPPO Loss** (2024) β€” Self-play preference optimization framing alignment as a two-player constant-sum game.
πŸ“„ [Self-Play Preference Optimization for Language Model Alignment](https://arxiv.org/abs/2405.00675) β€” Wu et al.

## Sequence-to-Sequence & Speech

**CTC Loss** (2006) β€” Marginalizes over all valid alignments between input and output sequences; foundational for ASR.
πŸ“„ [Connectionist Temporal Classification](https://www.cs.toronto.edu/~graves/icml_2006.pdf) β€” Graves et al.
πŸ’» [`torch.nn.CTCLoss`](https://pytorch.org/docs/stable/generated/torch.nn.CTCLoss.html)

**RNN-T Loss** (2012) β€” Extends CTC with a prediction network conditioning on previous outputs for streaming transduction.
πŸ“„ [Sequence Transduction with Recurrent Neural Networks](https://arxiv.org/abs/1211.3711) β€” Graves, A.
πŸ’» [`torchaudio.transforms.RNNTLoss`](https://pytorch.org/audio/stable/generated/torchaudio.transforms.RNNTLoss.html)

**Scheduled Sampling Loss** (2015) β€” Gradually replaces ground-truth tokens with model predictions during training to mitigate exposure bias.
πŸ“„ [Scheduled Sampling for Sequence Prediction with Recurrent Neural Networks](https://arxiv.org/abs/1506.03099) β€” Bengio et al.

**Sequence-Level Training / MIXER** (2016) β€” Directly optimizes BLEU/ROUGE using REINFORCE.
πŸ“„ [Sequence Level Training with Recurrent Neural Networks](https://arxiv.org/abs/1511.06732) β€” Ranzato et al.

**Minimum Risk Training** (2016) β€” Minimizes expected task-level loss (e.g., 1βˆ’BLEU) via sampling.
πŸ“„ [Minimum Risk Training for Neural Machine Translation](https://arxiv.org/abs/1512.02433) β€” Shen et al.

**Mel-Spectrogram Reconstruction Loss** (2017) β€” L1/L2 between predicted and target mel-spectrograms; primary TTS training objective.
πŸ“„ [Tacotron: Towards End-to-End Speech Synthesis](https://arxiv.org/abs/1703.10135) β€” Wang et al.

**Multi-Resolution STFT Loss** (2020) β€” Spectral convergence + log-magnitude STFT at multiple FFT sizes for neural vocoder training.
πŸ“„ [Parallel WaveGAN](https://arxiv.org/abs/1910.11480) β€” Yamamoto et al.
πŸ’» [csteinmetz1/auraloss](https://github.com/csteinmetz1/auraloss)

## Reinforcement Learning

**TD Loss / Temporal Difference** (1988) β€” Bootstrapped value estimation updating predictions toward reward + discounted next-state value.
πŸ“„ [Learning to Predict by the Methods of Temporal Differences](https://link.springer.com/article/10.1007/BF00115009) β€” Sutton, R.S.

**Q-Learning Loss** (1989) β€” Off-policy TD control bootstrapping with max Q-value over next actions.
πŸ“„ [Learning from Delayed Rewards](https://www.cs.rhul.ac.uk/~chrisw/new_thesis.pdf) β€” Watkins, C.J.C.H.

**REINFORCE / Policy Gradient** (1992) β€” Monte Carlo policy gradient weighted by returns.
πŸ“„ [Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning](https://link.springer.com/article/10.1007/BF00992696) β€” Williams, R.J.

**DQN Loss** (2015) β€” Q-learning with deep networks, experience replay, and target networks.
πŸ“„ [Human-level Control through Deep Reinforcement Learning](https://web.stanford.edu/class/psych209/Readings/MnihEtAlHassibis15NatureControlDeepRL.pdf) β€” Mnih et al.
πŸ’» [DLR-RM/stable-baselines3](https://github.com/DLR-RM/stable-baselines3)

**Double DQN Loss** (2015) β€” Decouples action selection from evaluation to reduce overestimation bias.
πŸ“„ [Deep Reinforcement Learning with Double Q-learning](https://arxiv.org/abs/1509.06461) β€” van Hasselt et al.

**DDPG Loss** (2015) β€” Deterministic policy gradients for continuous control with experience replay.
πŸ“„ [Continuous Control with Deep Reinforcement Learning](https://arxiv.org/abs/1509.02971) β€” Lillicrap et al.

**GAE** (2015) β€” Exponentially-weighted multi-step TD errors for tunable bias-variance tradeoff.
πŸ“„ [High-Dimensional Continuous Control Using Generalized Advantage Estimation](https://arxiv.org/abs/1506.02438) β€” Schulman et al.

**A3C / A2C Loss** (2016) β€” Actor-critic with policy gradient + value function baseline + entropy bonus.
πŸ“„ [Asynchronous Methods for Deep Reinforcement Learning](https://arxiv.org/abs/1602.01783) β€” Mnih et al.

**Distributional RL / C51 Loss** (2017) β€” Models full return distribution using categorical projection over fixed atoms.
πŸ“„ [A Distributional Perspective on Reinforcement Learning](https://arxiv.org/abs/1707.06887) β€” Bellemare et al.

**PPO Clipped Surrogate Loss** (2017) β€” Clips probability ratio to prevent destructively large policy updates.
πŸ“„ [Proximal Policy Optimization Algorithms](https://arxiv.org/abs/1707.06347) β€” Schulman et al.
πŸ’» [DLR-RM/stable-baselines3](https://github.com/DLR-RM/stable-baselines3)

**HER Loss** (2017) β€” Relabels failed trajectories with achieved goals for sample-efficient sparse-reward learning.
πŸ“„ [Hindsight Experience Replay](https://arxiv.org/abs/1707.01495) β€” Andrychowicz et al.

**QR-DQN Loss** (2018) β€” Quantile regression approximating the return distribution with learnable quantile locations.
πŸ“„ [Distributional Reinforcement Learning with Quantile Regression](https://arxiv.org/abs/1710.10044) β€” Dabney et al.

**SAC Loss** (2018) β€” Maximum entropy actor-critic balancing exploration and exploitation automatically.
πŸ“„ [Soft Actor-Critic](https://arxiv.org/abs/1801.01290) β€” Haarnoja et al.

**TD3 Loss** (2018) β€” Clipped double-Q learning + delayed policy updates + target policy smoothing.
πŸ“„ [Addressing Function Approximation Error in Actor-Critic Methods](https://arxiv.org/abs/1802.09477) β€” Fujimoto et al.

**V-trace Loss** (2018) β€” Importance-weighted off-policy correction for scalable distributed RL (IMPALA).
πŸ“„ [IMPALA: Scalable Distributed Deep-RL](https://arxiv.org/abs/1802.01561) β€” Espeholt et al.

**Decision Transformer Loss** (2021) β€” RL as sequence modeling; autoregressive transformer conditioned on returns, trained with supervised loss.
πŸ“„ [Decision Transformer: Reinforcement Learning via Sequence Modeling](https://arxiv.org/abs/2106.01345) β€” Chen et al.
πŸ’» [kzl/decision-transformer](https://github.com/kzl/decision-transformer)

## Knowledge Distillation

**Knowledge Distillation / KD Loss** (2015) β€” Student matches softened output distribution of teacher via KL divergence at elevated temperature.
πŸ“„ [Distilling the Knowledge in a Neural Network](https://arxiv.org/abs/1503.02531) β€” Hinton, Vinyals, Dean

**FitNets / Hint Loss** (2015) β€” Student mimics intermediate feature representations of teacher.
πŸ“„ [FitNets: Hints for Thin Deep Nets](https://arxiv.org/abs/1412.6550) β€” Romero et al.

**Attention Transfer Loss** (2017) β€” Forces student to mimic spatial attention maps of teacher's intermediate layers.
πŸ“„ [Paying More Attention to Attention](https://arxiv.org/abs/1612.03928) β€” Zagoruyko & Komodakis
πŸ’» [szagoruyko/attention-transfer](https://github.com/szagoruyko/attention-transfer)

**Born-Again Networks** (2018) β€” Self-distillation where identical-architecture student outperforms teacher.
πŸ“„ [Born Again Neural Networks](https://arxiv.org/abs/1805.04770) β€” Furlanello et al.

**PKT / Probabilistic KD** (2018) β€” Matches probability distributions in feature space rather than raw representations.
πŸ“„ [Learning Deep Representations with Probabilistic Knowledge Transfer](https://arxiv.org/abs/1803.10837) β€” Passalis & Tefas

**Relational KD / RKD** (2019) β€” Transfers mutual relations (distances and angles) between examples.
πŸ“„ [Relational Knowledge Distillation](https://arxiv.org/abs/1904.05068) β€” Park et al.

**Self-Distillation Loss** (2019) β€” Deeper layers supervise shallower classifiers within the same network.
πŸ“„ [Be Your Own Teacher](https://arxiv.org/abs/1905.08094) β€” Zhang et al.

**CRD / Contrastive Representation Distillation** (2020) β€” Maximizes mutual information between teacher and student via contrastive objective.
πŸ“„ [Contrastive Representation Distillation](https://arxiv.org/abs/1910.10699) β€” Tian et al.
πŸ’» [HobbitLong/RepDistiller](https://github.com/HobbitLong/RepDistiller)

**ReviewKD** (2021) β€” Student's lower-level features guided by teacher's higher-level features through attention-based fusion.
πŸ“„ [Distilling Knowledge via Knowledge Review](https://arxiv.org/abs/2104.09044) β€” Chen et al.
πŸ’» [dvlab-research/ReviewKD](https://github.com/dvlab-research/ReviewKD)

**DKD / Decoupled KD** (2022) β€” Decouples KD into target-class and non-target-class components for independent weighting.
πŸ“„ [Decoupled Knowledge Distillation](https://arxiv.org/abs/2203.08679) β€” Zhao et al.
πŸ’» [megvii-research/mdistiller](https://github.com/megvii-research/mdistiller)

**DIST Loss** (2022) β€” Preserves inter-class relations and intra-class ranking rather than exact probability matching.
πŸ“„ [Knowledge Distillation from A Stronger Teacher](https://arxiv.org/abs/2205.10536) β€” Huang et al.
πŸ’» [hunto/DIST_KD](https://github.com/hunto/DIST_KD)

## Regularization

**KL Divergence** (1951) β€” Measures information lost when approximating one distribution with another.
πŸ“„ [On Information and Sufficiency](https://doi.org/10.1214/aoms/1177729694) β€” Kullback & Leibler

**L2 Regularization / Weight Decay** (1970) β€” Penalizes sum of squared weights to prevent overfitting.
πŸ“„ [Ridge Regression](https://doi.org/10.1080/00401706.1970.10488634) β€” Hoerl & Kennard

**L1 Regularization / Lasso** (1996) β€” Penalizes sum of absolute weights, inducing sparsity.
πŸ“„ [Regression Shrinkage and Selection via the Lasso](https://doi.org/10.1111/j.2517-6161.1996.tb02080.x) β€” Tibshirani, R.

**Elastic Net** (2005) β€” Combines L1 and L2 for sparsity + grouping of correlated features.
πŸ“„ [Regularization and Variable Selection via the Elastic Net](https://doi.org/10.1111/j.1467-9868.2005.00503.x) β€” Zou & Hastie

**Dropout** (2014) β€” Randomly zeroes activations; implicit ensemble of exponentially many sub-networks.
πŸ“„ [Dropout: A Simple Way to Prevent Neural Networks from Overfitting](https://jmlr.org/papers/v15/srivastava14a.html) β€” Srivastava et al.

**Confidence Penalty** (2017) β€” Penalizes low-entropy (overconfident) output distributions.
πŸ“„ [Regularizing Neural Networks by Penalizing Confident Output Distributions](https://arxiv.org/abs/1701.06548) β€” Pereyra et al.

**Mixup Loss** (2018) β€” Trains on convex combinations of example pairs and their labels.
πŸ“„ [mixup: Beyond Empirical Risk Minimization](https://arxiv.org/abs/1710.09412) β€” Zhang et al.
πŸ’» [facebookresearch/mixup-cifar10](https://github.com/facebookresearch/mixup-cifar10)

**Manifold Mixup** (2019) β€” Extends Mixup to hidden representations at random intermediate layers.
πŸ“„ [Manifold Mixup: Better Representations by Interpolating Hidden States](https://arxiv.org/abs/1806.05236) β€” Verma et al.

**CutMix Loss** (2019) β€” Cuts and pastes rectangular patches between images while mixing labels proportionally.
πŸ“„ [CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features](https://arxiv.org/abs/1905.04899) β€” Yun et al.

## 3D Vision & Point Clouds

**Chamfer Distance** (2017) β€” Average nearest-neighbor distance between two point sets; fast and widely used.
πŸ“„ [A Point Set Generation Network for 3D Object Reconstruction from a Single Image](https://arxiv.org/abs/1612.00603) β€” Fan et al.
πŸ’» [facebookresearch/pytorch3d](https://github.com/facebookresearch/pytorch3d)

**Earth Mover's Distance (EMD)** (2017) β€” Optimal transport distance with bijective matching; higher quality but more expensive than CD.
πŸ“„ [A Point Set Generation Network for 3D Object Reconstruction from a Single Image](https://arxiv.org/abs/1612.00603) β€” Fan et al.

**Normal Consistency Loss** (2018) β€” Penalizes inconsistency of surface normals between adjacent mesh faces.
πŸ“„ [Pixel2Mesh: Generating 3D Mesh Models from Single RGB Images](https://arxiv.org/abs/1804.01654) β€” Wang et al.

**Mesh Laplacian Smoothing Loss** (2018) β€” Penalizes vertex deviation from neighbor centroid to prevent self-intersections.
πŸ“„ [Pixel2Mesh](https://arxiv.org/abs/1804.01654) β€” Wang et al.
πŸ’» [facebookresearch/pytorch3d](https://github.com/facebookresearch/pytorch3d)

**SDF Loss (DeepSDF)** (2019) β€” Regresses signed distance values; zero level-set defines the 3D surface.
πŸ“„ [DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation](https://arxiv.org/abs/1901.05103) β€” Park et al.
πŸ’» [facebookresearch/DeepSDF](https://github.com/facebookresearch/DeepSDF)

**Occupancy Loss** (2019) β€” Binary CE on predicted occupancy probabilities for 3D reconstruction.
πŸ“„ [Occupancy Networks: Learning 3D Reconstruction in Function Space](https://arxiv.org/abs/1812.03828) β€” Mescheder et al.

**NeRF Photometric Loss** (2020) β€” MSE between rendered and observed pixel colors via differentiable volume rendering.
πŸ“„ [NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis](https://arxiv.org/abs/2003.08934) β€” Mildenhall et al.

**3D Gaussian Splatting Loss** (2023) β€” L1 + D-SSIM for optimizing anisotropic 3D Gaussians for real-time radiance field rendering.
πŸ“„ [3D Gaussian Splatting for Real-Time Radiance Field Rendering](https://arxiv.org/abs/2308.04079) β€” Kerbl et al.
πŸ’» [graphdeco-inria/gaussian-splatting](https://github.com/graphdeco-inria/gaussian-splatting)

## Depth Estimation

**Scale-Invariant Loss** (2014) β€” Log-space depth error minus mean shift; invariant to global scale ambiguity.
πŸ“„ [Depth Map Prediction from a Single Image using a Multi-Scale Deep Network](https://arxiv.org/abs/1406.2283) β€” Eigen et al.

**Berhu Loss (Reverse Huber)** (2016) β€” L1 for small residuals, L2 for large; robust depth regression.
πŸ“„ [Deeper Depth Prediction with Fully Convolutional Residual Networks](https://arxiv.org/abs/1606.00373) β€” Laina et al.

**Photometric Consistency Loss** (2017) β€” Self-supervised SSIM + L1 with left-right disparity consistency for monocular depth.
πŸ“„ [Unsupervised Monocular Depth Estimation with Left-Right Consistency](https://arxiv.org/abs/1609.03677) β€” Godard et al.
πŸ’» [nianticlabs/monodepth2](https://github.com/nianticlabs/monodepth2)

**Edge-Aware Smoothness Loss** (2017) β€” Locally smooth depth except at image edges, weighted by image gradients.
πŸ“„ [Unsupervised Monocular Depth Estimation with Left-Right Consistency](https://arxiv.org/abs/1609.03677) β€” Godard et al.

## Medical Imaging

**Deep Supervision Loss** (2015) β€” Auxiliary losses at intermediate layers providing direct gradient paths.
πŸ“„ [Deeply-Supervised Nets](https://arxiv.org/abs/1409.5185) β€” Lee et al.

**Dice Loss** (2016) β€” Directly optimizes Dice coefficient for volumetric medical image segmentation.
πŸ“„ [V-Net](https://arxiv.org/abs/1606.04797) β€” Milletari et al.

**Generalized Dice Loss** (2017) β€” Per-class volume weighting for highly imbalanced multi-class segmentation.
πŸ“„ [Generalised Dice Overlap as a Deep Learning Loss Function](https://arxiv.org/abs/1707.03237) β€” Sudre et al.

**Tversky Loss** (2017) β€” Tunable FP/FN trade-off for small lesion segmentation.
πŸ“„ [Tversky Loss Function for Image Segmentation](https://arxiv.org/abs/1706.05721) β€” Salehi et al.

**Attention-Gated Loss** (2018) β€” Learned attention gates suppress irrelevant regions in skip connections.
πŸ“„ [Attention U-Net: Learning Where to Look for the Pancreas](https://arxiv.org/abs/1804.03999) β€” Oktay et al.

**Boundary / Surface Loss** (2019) β€” Distance metric on contour space for highly unbalanced medical segmentation.
πŸ“„ [Boundary Loss for Highly Unbalanced Segmentation](https://arxiv.org/abs/1812.07032) β€” Kervadec et al.
πŸ’» [LIVIAETS/boundary-loss](https://github.com/LIVIAETS/boundary-loss)

**Distance Map Penalized CE** (2019) β€” Weights CE by distance transform maps to focus on boundary regions.
πŸ“„ [Distance Map Loss Penalty Term for Semantic Segmentation](https://arxiv.org/abs/1908.03679) β€” Caliva et al.

## Graph Neural Networks

**Variational Graph Auto-Encoder (VGAE) Loss** (2016) β€” Reconstruction BCE on adjacency matrix + KL divergence for unsupervised graph learning.
πŸ“„ [Variational Graph Auto-Encoders](https://arxiv.org/abs/1611.07308) β€” Kipf & Welling

**Node Classification Loss** (2017) β€” Standard cross-entropy per-node in semi-supervised graph settings.
πŸ“„ [Semi-Supervised Classification with Graph Convolutional Networks](https://arxiv.org/abs/1609.02907) β€” Kipf & Welling
πŸ’» [pyg-team/pytorch_geometric](https://github.com/pyg-team/pytorch_geometric)

**Deep Graph Infomax (DGI) Loss** (2019) β€” Maximizes mutual information between local node and global graph representations.
πŸ“„ [Deep Graph Infomax](https://arxiv.org/abs/1809.10341) β€” VeličkoviΔ‡ et al.
πŸ’» [PetarV-/DGI](https://github.com/PetarV-/DGI)

**Graph Matching Loss** (2019) β€” Attention-based cross-graph matching with margin-based pairwise loss.
πŸ“„ [Graph Matching Networks for Learning the Similarity of Graph Structured Objects](https://arxiv.org/abs/1904.12787) β€” Li et al.

**InfoGraph Loss** (2020) β€” Maximizes mutual information between graph-level and substructure-level representations.
πŸ“„ [InfoGraph: Unsupervised and Semi-supervised Graph-Level Representation Learning](https://arxiv.org/abs/1908.01000) β€” Sun et al.
πŸ’» [sunfanyunn/InfoGraph](https://github.com/sunfanyunn/InfoGraph)

**GraphCL Loss** (2020) β€” NT-Xent contrastive loss on augmented graph views for self-supervised graph learning.
πŸ“„ [Graph Contrastive Learning with Augmentations](https://arxiv.org/abs/2010.13902) β€” You et al.
πŸ’» [Shen-Lab/GraphCL](https://github.com/Shen-Lab/GraphCL)

**BGRL Loss** (2022) β€” Negative-sample-free self-supervised loss bootstrapping graph representations (inspired by BYOL).
πŸ“„ [Large-Scale Representation Learning on Graphs via Bootstrapping](https://arxiv.org/abs/2102.06514) β€” Thakoor et al.
πŸ’» [nerdslab/bgrl](https://github.com/nerdslab/bgrl)

## Recommendation Systems

**ListNet Loss** (2007) β€” Listwise learning-to-rank using top-one probability distributions.
πŸ“„ [Learning to Rank: From Pairwise Approach to Listwise Approach](https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-2007-40.pdf) β€” Cao et al.

**ListMLE Loss** (2008) β€” Listwise loss based on likelihood of ground-truth permutation under Plackett-Luce model.
πŸ“„ [Listwise Approach to Learning to Rank: Theory and Algorithm](https://dl.acm.org/doi/10.1145/1390156.1390306) β€” Xia et al.

**BPR Loss** (2009) β€” Pairwise loss maximizing posterior probability that user prefers observed over unobserved items.
πŸ“„ [BPR: Bayesian Personalized Ranking from Implicit Feedback](https://arxiv.org/abs/1205.2618) β€” Rendle et al.
πŸ’» [guoyang9/BPR-pytorch](https://github.com/guoyang9/BPR-pytorch)

**Sampled Softmax Loss** (2015) β€” Approximates full softmax over large item vocabulary by sampling negatives.
πŸ“„ [On Using Very Large Target Vocabulary for Neural Machine Translation](https://arxiv.org/abs/1412.2007) β€” Jean et al.

**DirectAU Loss** (2022) β€” Directly optimizes alignment and uniformity on the hypersphere for collaborative filtering.
πŸ“„ [Towards Representation Alignment and Uniformity in Collaborative Filtering](https://arxiv.org/abs/2206.12811) β€” Wang et al.
πŸ’» [THUwangcy/DirectAU](https://github.com/THUwangcy/DirectAU)

## Multi-Task Learning

**Uncertainty Weighting / Homoscedastic Uncertainty** (2018) β€” Learns task weights by modeling task-dependent uncertainty; noisy tasks auto-downweighted.
πŸ“„ [Multi-Task Learning Using Uncertainty to Weigh Losses](https://arxiv.org/abs/1705.07115) β€” Kendall et al.
πŸ’» [median-research-group/LibMTL](https://github.com/median-research-group/LibMTL)

**GradNorm** (2018) β€” Dynamically normalizes gradient magnitudes across tasks to balance training rates.
πŸ“„ [GradNorm: Gradient Normalization for Adaptive Loss Balancing](https://arxiv.org/abs/1711.02257) β€” Chen et al.

**MGDA** (2018) β€” Multi-objective optimization finding Pareto-optimal descent direction via Frank-Wolfe on task gradients.
πŸ“„ [Multi-Task Learning as Multi-Objective Optimization](https://arxiv.org/abs/1810.04650) β€” Sener & Koltun

**PCGrad** (2020) β€” Projects conflicting task gradients onto normal planes to reduce destructive interference.
πŸ“„ [Gradient Surgery for Multi-Task Learning](https://arxiv.org/abs/2001.06782) β€” Yu et al.

**CAGrad** (2021) β€” Minimizes average loss while maximizing worst-case local improvement across tasks.
πŸ“„ [Conflict-Averse Gradient Descent for Multi-task Learning](https://arxiv.org/abs/2110.14048) β€” Liu et al.

**Nash-MTL** (2022) β€” Nash bargaining game where tasks negotiate a joint update direction.
πŸ“„ [Multi-Task Learning as a Bargaining Game](https://arxiv.org/abs/2202.01017) β€” Navon et al.
πŸ’» [AvivNavon/nash-mtl](https://github.com/AvivNavon/nash-mtl)

## Uncertainty Estimation

**NLL with Learned Variance** (1994) β€” Network predicts mean and variance; NLL naturally trades off accuracy and calibration.
πŸ“„ [Estimating the Mean and Variance of the Target Probability Distribution](https://ieeexplore.ieee.org/document/374138) β€” Nix & Weigend

**MC Dropout** (2016) β€” Dropout at test time as approximate Bayesian inference for uncertainty estimation.
πŸ“„ [Dropout as a Bayesian Approximation](https://arxiv.org/abs/1506.02142) β€” Gal & Ghahramani

**Deep Ensembles Loss** (2017) β€” Ensemble of networks with proper scoring rules + adversarial training for diversity.
πŸ“„ [Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles](https://arxiv.org/abs/1612.01474) β€” Lakshminarayanan et al.

**Evidential Deep Learning Loss** (2018) β€” Dirichlet prior over class probabilities; Bayes risk + KL divergence regularizer.
πŸ“„ [Evidential Deep Learning to Quantify Classification Uncertainty](https://arxiv.org/abs/1806.01768) β€” Sensoy et al.

## Domain Adaptation

**Maximum Mean Discrepancy (MMD)** (2012) β€” Distribution distance in RKHS; aligns source and target features without adversarial training.
πŸ“„ [A Kernel Two-Sample Test](https://www.jmlr.org/papers/v13/gretton12a/gretton12a.pdf) β€” Gretton et al.
πŸ’» [ZongxianLee/MMD_Loss.Pytorch](https://github.com/ZongxianLee/MMD_Loss.Pytorch)

**Domain Adversarial Loss / DANN** (2016) β€” Gradient reversal layer training domain classifier adversarially for domain-invariant features.
πŸ“„ [Domain-Adversarial Training of Neural Networks](https://arxiv.org/abs/1505.07818) β€” Ganin et al.
πŸ’» [fungtion/DANN](https://github.com/fungtion/DANN)

**Deep CORAL Loss** (2016) β€” Aligns second-order statistics (covariance) of source and target deep features.
πŸ“„ [Deep CORAL: Correlation Alignment for Deep Domain Adaptation](https://arxiv.org/abs/1607.01719) β€” Sun & Saenko

**Wasserstein Distance for DA** (2018) β€” Earth Mover's Distance as domain discrepancy measure with gradient penalty.
πŸ“„ [Wasserstein Distance Guided Representation Learning for Domain Adaptation](https://arxiv.org/abs/1707.01217) β€” Shen et al.

**Contrastive Domain Discrepancy (CDD)** (2019) β€” Class-aware alignment maximizing inter-class and minimizing intra-class discrepancy across domains.
πŸ“„ [Contrastive Adaptation Network for Unsupervised Domain Adaptation](https://arxiv.org/abs/1901.00976) β€” Kang et al.

---

## Survey Papers

- πŸ“„ [A Comprehensive Survey of Loss Functions and Metrics in Deep Learning](https://arxiv.org/abs/2307.02694) β€” Terven et al. (2025)
- πŸ“„ [A Survey of Loss Functions for Semantic Segmentation](https://arxiv.org/abs/2006.14822) β€” Jadon (2020)
- πŸ“„ [Loss Functions in the Era of Semantic Segmentation: A Survey and Outlook](https://arxiv.org/abs/2312.05391) β€” Azad et al. (2023)

## Key Implementation Libraries

| Library | Focus | Link |
|---------|-------|------|
| PyTorch (built-in) | CE, BCE, MSE, Huber, CTC, KLDiv, etc. | [pytorch.org](https://pytorch.org/docs/stable/nn.html#loss-functions) |
| pytorch-metric-learning | Triplet, Contrastive, ArcFace, ProxyNCA, etc. | [GitHub](https://github.com/KevinMusgrave/pytorch-metric-learning) |
| SegLossOdyssey | Dice, Tversky, Boundary, Hausdorff, etc. | [GitHub](https://github.com/JunMa11/SegLossOdyssey) |
| Hugging Face TRL | DPO, PPO, KTO, ORPO, SimPO, etc. | [GitHub](https://github.com/huggingface/trl) |
| Stable-Baselines3 | DQN, PPO, SAC, TD3, A2C, etc. | [GitHub](https://github.com/DLR-RM/stable-baselines3) |
| lightly | SimCLR, BYOL, MoCo, DINO, Barlow Twins, etc. | [GitHub](https://github.com/lightly-ai/lightly) |
| insightface | ArcFace, CosFace, Sub-center ArcFace | [GitHub](https://github.com/deepinsight/insightface) |
| open_clip | CLIP, SigLIP contrastive losses | [GitHub](https://github.com/mlfoundations/open_clip) |
| PyTorch3D | Chamfer, mesh losses, point cloud losses | [GitHub](https://github.com/facebookresearch/pytorch3d) |
| PyTorch Geometric | GNN losses, link prediction, node classification | [GitHub](https://github.com/pyg-team/pytorch_geometric) |
| LibMTL | Uncertainty weighting, GradNorm, PCGrad, Nash-MTL | [GitHub](https://github.com/median-research-group/LibMTL) |
| auraloss | Multi-Resolution STFT, mel losses | [GitHub](https://github.com/csteinmetz1/auraloss) |
| BasicSR | Perceptual, SSIM, Charbonnier, GAN losses for SR | [GitHub](https://github.com/XPixelGroup/BasicSR) |
| kornia | Focal, Dice, SSIM, and more | [GitHub](https://github.com/kornia/kornia) |
| anomalib | Anomaly detection losses and methods | [GitHub](https://github.com/open-edge-platform/anomalib) |
| Avalanche | Continual learning (EWC, SI, LwF, etc.) | [GitHub](https://github.com/ContinualAI/avalanche) |
| GluonTS | Time series forecasting losses | [GitHub](https://github.com/awslabs/gluonts) |
| audiocraft | Audio generation (EnCodec, MusicGen) | [GitHub](https://github.com/facebookresearch/audiocraft) |
| AIF360 | Fairness and bias mitigation | [GitHub](https://github.com/Trusted-AI/AIF360) |

---

## Star History

If you find this useful, please star the repo β€” it helps others discover it.

[![Star History Chart](https://api.star-history.com/svg?repos=stabgan/awesome-loss-functions&type=Date)](https://star-history.com/#stabgan/awesome-loss-functions&Date)