Papers
Topics
Authors
Recent
Search
2000 character limit reached

Vector-Based Loss Functions

Updated 10 July 2026
  • Vector-based loss functions are designed for vector outputs, preserving geometry, magnitude, and direction to capture intrinsic data structures.
  • They are applied in fields like turbulent flow reconstruction, probability modeling, and embedding learning to improve task-specific optimization.
  • Hybrid approaches combine vector-specific metrics with traditional losses like MSE, balancing physical realism with numerical stability.

Searching arXiv for the cited papers and closely related material on vector-based loss functions. Vector-based loss functions are loss terms designed explicitly for settings in which the basic prediction object is a vector rather than an independent collection of scalar channels. In the most concrete formulation, they arise when the data themselves are vector fields, such as 2D velocity vectors in particle image velocimetry; more broadly, they also include losses defined on probability vectors, embedding vectors, class-weight vectors, box-parameter vectors, feature maps, and other high-dimensional outputs. Across these settings, the common aim is to make the optimization objective reflect the geometry, algebra, or physical interpretation of vector-valued data more faithfully than purely component-wise objectives such as mean squared error (MSE) or standard cross-entropy (Baker et al., 6 Sep 2025, Elharrouss et al., 5 Apr 2025).

1. Conceptual Scope

A broad view of the subject treats a loss as a scalar-valued functional applied to vector outputs of deep networks—logits, probabilities, embeddings, pixels, feature maps, sequences, or vector fields. In this sense, vector-based losses are not confined to one task family: they appear in multiclass classification, metric learning, scientific machine learning, structured prediction, generative modeling, and support-vector methods (Elharrouss et al., 5 Apr 2025, Ciampiconi et al., 2023).

A narrower and more physically explicit use of the term appears in turbulent-flow reconstruction, where each pixel carries a 2D velocity vector

u(x,y)=(ux(x,y),uy(x,y)),\mathbf{u}(x,y)=\big(u_x(x,y),u_y(x,y)\big),

and standard practice treats uxu_x and uyu_y as separate scalar channels. The central criticism is that such component-wise losses do not explicitly preserve direction, magnitude, or coherent vector structures such as vortices and jets (Baker et al., 6 Sep 2025).

The literature therefore spans several distinct but related constructions.

Setting Vector object Representative formulation
Scientific vector fields 2D velocity vectors on a grid Cosine, magnitude-index, vector, and hybrid losses (Baker et al., 6 Sep 2025)
Probability modeling Logit and probability vectors on Δk\Delta^k Fenchel–Young losses from ff-divergences (Roulet et al., 30 Jan 2025)
Representation learning Embeddings and class-weight vectors on a unit hypersphere AM-Softmax, Arc-Softmax, SV-Softmax (Wang et al., 2018)
High-dimensional structured outputs Pixels, masks, feature maps, sequences Dice, Jaccard, perceptual, contrastive, diffusion, and TVrTV^r-based losses (Elharrouss et al., 5 Apr 2025, Liu et al., 2022)

This breadth suggests that “vector-based” denotes not a single formula class but a design principle: the loss should operate on the geometry or structure of the vector object itself, rather than only on isolated coordinates.

2. Mathematical and Geometric Foundations

One major foundation is divergence-based. Given a convex f:R+Rf:\mathbb{R}_+\to\mathbb{R} with f(1)=0f(1)=0, the discrete ff-divergence between positive measures p,qR+kp,q\in\mathbb{R}_+^k is

uxu_x0

Using uxu_x1 as a regularizer on the probability simplex yields the Fenchel–Young family

uxu_x2

with prediction operator

uxu_x3

For uxu_x4 and uniform uxu_x5, this recovers standard softmax and logistic or cross-entropy loss; for uxu_x6-divergences it recovers sparse entmax-type operators and associated losses (Roulet et al., 30 Jan 2025).

A second foundation is convex-geometric. In the framework of proper multiclass losses, the conditional Bayes risk is represented as the concave support function of the closed convex hull of the superprediction set, and a proper loss is characterized by the condition that its loss vector is a subgradient of that support function. This perspective links losses to convex sets, concave gauges, anti-norms, antipolars, and a calculus of loss construction via uxu_x7-sums and dual uxu_x8-sums of sets (Williamson et al., 2022). A plausible implication is that proper vector-based losses can be designed by first specifying the geometry of admissible loss vectors and only then extracting the loss as a subgradient selection.

A third foundation is metric geometry on embedding spaces. In normalized softmax formulations, features uxu_x9 and class weights uyu_y0 are uyu_y1-normalized, logits are proportional to uyu_y2, and the loss acts directly on angular relations in a unit hypersphere. Margin-based variants replace the ground-truth cosine by uyu_y3, while support-vector-guided variants modify non-ground-truth logits using class-specific geometric masks uyu_y4 defined by pairwise cosine comparisons (Wang et al., 2018). In this regime, “vector-based” means that both the predictions and the notion of hardness are explicitly functions of vector angles and inner products.

3. Vector Similarity Losses for Scientific Vector Fields

The most explicit physical instantiation of vector-based loss functions is the turbulent flow field inpainting problem studied on the Transparent Combustion Chamber III (TCC-III) optical engine. The data are 2D2C PIV snapshots on a uyu_y5 grid of velocity vectors, zero-padded to uyu_y6 for training, with field of view approximately uyu_y7 mm diameter and vector spacing uyu_y8 mm. The task is to reconstruct a central uyu_y9 gap, corresponding to 10% of visible data, from the surrounding flow field using a U-Net implemented via MONAI (Baker et al., 6 Sep 2025).

The baseline loss is component-wise MSE,

Δk\Delta^k0

where Δk\Delta^k1 is the ground-truth vector and Δk\Delta^k2 is the predicted vector. The critique is that MSE mixes magnitude and orientation indirectly and provides no explicit guidance toward preserving coherent vector structures.

To address this, the paper defines a cosine-similarity loss

Δk\Delta^k3

and a magnitude-index loss

Δk\Delta^k4

The cosine term isolates angular mismatch, whereas the magnitude-index term normalizes the vector difference by the sum of magnitudes and is bounded between 0 and 1 for non-zero vectors. These are combined as

Δk\Delta^k5

with Δk\Delta^k6, and further hybridized with MSE as

Δk\Delta^k7

with Δk\Delta^k8, both selected by grid search on normalized Δk\Delta^k9 performance (Baker et al., 6 Sep 2025).

The training setup is deliberately controlled: 5205 snapshots are available; 1041 snapshots at ff0 crank angle are held out as test data, and the remaining 4164 are used for training. All models use the same U-Net, ADAM with weight decay ff1, initial learning rate ff2, halving every 100 epochs, and 600 training epochs. No incompressibility or PDE-based constraints are imposed, so the intervention is strictly at the loss-function level (Baker et al., 6 Sep 2025).

Evaluation uses normalized ff3 error and Kullback–Leibler divergence between predicted and ground-truth velocity-magnitude distributions, each reported as median and floor, where the floor represents the worst 5% of predictions. The main quantitative pattern is sharply differentiated. Pure cosine loss performs poorly, with ff4 median ff5 and KL median ff6, and qualitatively produces small nearly uniform vectors. MSE yields the best pixel-wise accuracy, with ff7 median ff8 and floor ff9, but its KL median TVrTV^r0 is much higher than the best vector-based alternatives. The vector loss achieves the best KL median, TVrTV^r1, with TVrTV^r2 median TVrTV^r3, and the hybrid loss obtains the best compromise, with TVrTV^r4 median TVrTV^r5 and KL median TVrTV^r6 (Baker et al., 6 Sep 2025).

The physical interpretation is central. The cosine term is invariant to uniform scaling and targets orientation, which is essential for vortices, jets, shear layers, circulation, and flow topology. The magnitude-index term targets relative speed and combined vector discrepancy, which matters for differentiating high-speed intake jets from slow recirculation zones. MSE, by contrast, favors pointwise component accuracy and can smooth or shrink extreme values. The empirical conclusion is therefore not that vector-based losses dominate MSE universally, but that they preserve multi-scale flow patterns and magnitude distributions more effectively, while a hybrid objective balances physical realism and pixel-wise fidelity (Baker et al., 6 Sep 2025).

4. Embedding-Space, Margin-Based, and Support-Vector Constructions

In face recognition and related embedding problems, vector-based losses operate on normalized feature vectors and class-weight vectors. The normalized softmax baseline is

TVrTV^r7

with logits TVrTV^r8. Margin-based variants replace the ground-truth cosine by TVrTV^r9, including A-Softmax, AM-Softmax, and Arc-Softmax; support-vector-guided softmax instead defines a class-wise mask

f:R+Rf:\mathbb{R}_+\to\mathbb{R}0

and amplifies violating non-ground-truth logits through

f:R+Rf:\mathbb{R}_+\to\mathbb{R}1

This yields SV-Softmax and, with a margin-augmented ground-truth logit, SV-X-Softmax, whose explicit purpose is to combine mining-based emphasis with margin-based angular discrimination in feature-weight space (Wang et al., 2018).

In end-to-end speaker verification, an analogous family of embedding losses is studied on 512-dimensional speaker embeddings produced by a SincNet plus x-vector architecture. The compared losses are cross-entropy, congenerous cosine loss, additive angular margin loss, center loss, contrastive loss, and triplet loss. The additive angular margin formulation,

f:R+Rf:\mathbb{R}_+\to\mathbb{R}2

outperforms all other losses in the study and yields more robust embeddings for cosine scoring, with the authors emphasizing improved intra-class compactness and inter-class separation on the hypersphere (Coria et al., 2020).

A related line in binary large-margin learning reworks the penalty applied to margin deficits. The Slide loss

f:R+Rf:\mathbb{R}_+\to\mathbb{R}3

introduces a zero-penalty confidence threshold at f:R+Rf:\mathbb{R}_+\to\mathbb{R}4, a linear penalty band for intermediate-confidence points, and a full-penalty region for f:R+Rf:\mathbb{R}_+\to\mathbb{R}5. The resulting f:R+Rf:\mathbb{R}_+\to\mathbb{R}6-SVM is optimized by an ADMM scheme with a working set derived from the closed-form proximal operator of f:R+Rf:\mathbb{R}_+\to\mathbb{R}7, and the reported experiments show robustness and effectiveness on real-world datasets, including under label noise (Li et al., 2024).

Other support-vector formulations generalize this theme through asymmetry, boundedness, or insensitive regions. The bounded asymmetric elastic net loss

f:R+Rf:\mathbb{R}_+\to\mathbb{R}8

wraps an asymmetric elastic-net margin loss inside a bounded transform, leading to bounded influence, a violation tolerance upper bound, and Fisher consistency in BAEN-SVM (Du et al., 6 Mar 2026). In support vector quantile regression, the asymmetric f:R+Rf:\mathbb{R}_+\to\mathbb{R}9-insensitive pinball loss

f(1)=0f(1)=00

creates a fixed-width but asymmetrically split insensitive zone

f(1)=0f(1)=01

restoring sparsity while preserving quantile asymmetry (Anand et al., 2019). Taken together, these constructions show that vector-based loss design extends beyond Euclidean similarity: it also includes explicit shaping of margin geometry, confidence regions, and class-wise angular relationships.

5. Structural Regularization for High-Dimensional Vector Outputs

A further extension concerns losses on high-dimensional vector outputs such as masks, feature maps, sequences, and reconstructed images. Surveys of deep-learning losses treat MSE, MAE, cross-entropy, binary cross-entropy, focal loss, Dice loss, Jaccard loss, IoU-type losses, KL divergence, contrastive loss, triplet loss, perceptual loss, style loss, adversarial loss, and diffusion losses as scalar objectives defined on vector predictions and then aggregated across components, pixels, anchors, or time steps (Elharrouss et al., 5 Apr 2025, Terven et al., 2023). This perspective places vector-based losses at the center of modern deep learning rather than at its periphery.

In segmentation and detection, region-level vector losses operate on sets represented as vectors or grids. Dice loss,

f(1)=0f(1)=02

and Jaccard loss,

f(1)=0f(1)=03

are explicitly geometric: they optimize overlap rather than component-wise deviation. In embedding learning, contrastive and triplet losses directly shape the geometry of the representation space by minimizing Euclidean or cosine distance for positives and enforcing a margin for negatives (Elharrouss et al., 5 Apr 2025, Ciampiconi et al., 2023).

An analytically distinct but conceptually related family uses total variation of real order. Real-order total variation f(1)=0f(1)=04, defined through Riemann–Liouville fractional derivatives, provides isotropic and an-isotropic seminorms for f(1)=0f(1)=05, with lower semicontinuity and compactness studied both with respect to the function f(1)=0f(1)=06 and the order f(1)=0f(1)=07. The proposed learning use is a loss or regularization term of the form f(1)=0f(1)=08 or f(1)=0f(1)=09, where ff0 is produced either by a variational model or a neural network (Liu et al., 2022). This gives a continuum linking ff1-type behavior near ff2, classical TV at ff3, and higher-order smoothness for ff4. A plausible implication is that vector-based loss design can also be understood as choosing the derivative order and anisotropy with which vector-valued outputs are measured.

6. Design Principles, Evaluation, and Research Directions

Taken together, these works suggest several recurring design principles. First, the vector nature of the target should be respected at the level of the loss. In turbulent flow, this means operating on direction and magnitude rather than on ff5 and ff6 independently; in embedding learning, it means normalizing vectors and acting on angles or distances; in probability modeling, it means treating logits and target distributions through convex divergences or support-function geometry rather than only through a fixed cross-entropy template (Baker et al., 6 Sep 2025, Wang et al., 2018, Roulet et al., 30 Jan 2025).

Second, many successful constructions separate complementary aspects of the vector object and then recombine them. The flow-field vector loss separates angular alignment from magnitude discrepancy; speaker and face losses separate normalization, scale, and margin; quantile and SVM variants separate insensitive regions from asymmetric penalties; total-variation approaches separate derivative order from isotropy (Baker et al., 6 Sep 2025, Coria et al., 2020, Anand et al., 2019, Liu et al., 2022).

Third, hybridization is repeatedly used to reconcile structure preservation with numerical stability or familiar optimization behavior. The hybrid turbulent-flow loss combines vector similarity with MSE; center loss is added to softmax; detection systems combine classification, localization, and objectness terms; VAE and diffusion systems combine reconstruction and probabilistic regularization (Baker et al., 6 Sep 2025, Elharrouss et al., 5 Apr 2025, Terven et al., 2023). This suggests that vector-based losses are often most effective not as total replacements for classical objectives but as structured complements.

Fourth, evaluation must match the intended geometry. In the turbulent inpainting study, KL divergence of velocity-magnitude distributions reveals structural gains that normalized ff7 alone obscures. In metric learning and face or speaker verification, cosine scoring, retrieval performance, or verification metrics are more revealing than classification accuracy alone. In segmentation, Dice, IoU, or mIoU can be better aligned with the objective than pixel-wise cross-entropy (Baker et al., 6 Sep 2025, Coria et al., 2020, Terven et al., 2023).

Finally, the literature points toward increasingly adaptive loss design. One direction is principled generalization beyond cross-entropy through ff8-divergence-generated Fenchel–Young losses and ff9-softargmax operators; another is automated loss-function search, where multivariate Taylor polynomial parameterizations discovered by CMA-ES outperform cross-entropy on MNIST, CIFAR-10, and SVHN and appear to regularize by discouraging extreme confidence (Roulet et al., 30 Jan 2025, Gonzalez et al., 2020). Survey work correspondingly identifies adaptive, robust, interpretable, and multi-modal loss design as an open frontier (Elharrouss et al., 5 Apr 2025, Terven et al., 2023).

Vector-based loss functions therefore form a heterogeneous but coherent research area. Their unifying premise is that the loss should encode the geometry of the object being predicted—whether that object is a velocity vector, an embedding direction on a hypersphere, a probability distribution on the simplex, a box parameter vector, a mask, or a fractional-gradient field. Where that premise is consequential, the resulting objectives can preserve physical structure, improve discriminative geometry, yield bounded robustness, or better align optimization with downstream evaluation.

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 Vector-Based Loss Functions.