Papers
Topics
Authors
Recent
Search
2000 character limit reached

ViPeR: Loss for Spectral Peak Localization

Updated 11 July 2026
  • ViPeR is a custom, distance-aware loss function for spectral peak localization that supervises a neighborhood around true peaks to mitigate class imbalance.
  • It employs a three-term structure—False Positive, Vertical, and Lower Penalties—that refines gradient signals based on the distance from ground-truth peak centers.
  • Empirical tests within the OASIS pipeline show that ViPeR enhances training efficiency and accuracy under strict detection criteria across diverse spectroscopic modalities.

ViPeR, short for Vicinity Peak Response, is the custom loss function introduced in OASIS for spectral peak identification/localization. Within that framework, it is the operative training objective for the peak location detection network, whose task is to predict which discrete spectral positions correspond to true peak centers. ViPeR was introduced to improve training efficiency and accuracy for spectral peak identification “especially with limited datasets, class imbalance and sharp loss environments,” and its defining feature is that predictions near a true peak are treated differently from predictions far from any peak. A plausible interpretation is that ViPeR is a distance-aware localization loss over discrete spectral bins rather than a purely point-wise binary classification loss (Young et al., 15 Sep 2025).

1. Definition and design rationale

ViPeR was proposed in response to three difficulties that OASIS identifies in conventional peak localization for spectroscopy. First, peak identification is often framed as a point-wise binary classification problem using cross-entropy (CE), but non-peak spectral bins vastly outnumber peak bins, so optimization is dominated by negatives. Second, the paper argues that CE often converges toward sharp minima, which can impair generalization and robustness. Third, peak localization is intrinsically spatial: a predicted peak a few bins away from the correct center is often nearly correct in practical spectroscopy, yet ordinary binary CE does not encode that notion of neighborhood or vicinity (Young et al., 15 Sep 2025).

The loss therefore formalizes a different supervision principle. Instead of rewarding only exact-bin agreement, it supervises a neighborhood around each ground-truth peak. Responses near a peak are encouraged, responses at the exact center are strengthened, and responses far from peaks are penalized increasingly with distance. The paper describes a key advantage of ViPeR as its ability to provide smooth gradient signals near spectral peaks, enabling a network to “first learn general peak patterns and then refine localization accuracy during training.” This suggests a coarse-to-fine localization dynamic, although the paper frames that as an interpretation of the loss behavior rather than as a separately defined curriculum mechanism.

A common misconception is to treat ViPeR as a post-processing rule. In OASIS it is not. The loss itself is used to train the peak location network. Post-training thresholding and non-maximum suppression are separate operational steps and are not variants of ViPeR.

2. Mathematical structure

The OASIS paper gives the ViPeR objective as a three-term decomposition:

V=Fp+Pv+PLV = F_p + P_v + P_L

Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]

Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}

PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v

Here, VV is the total ViPeR loss; FpF_p is the False Positive Penalty; PvP_v is the Vertical Penalty; and PLP_L is the Lower Penalty. The index ii denotes a spectral datapoint or bin, nn is the number of datapoints in the spectrum, Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]0 is the model prediction at bin Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]1, and Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]2 is the ground-truth label, with Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]3 only at true peak centers and Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]4 otherwise. The quantity Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]5 is the distance from bin Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]6 to the nearest ground-truth peak center, while Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]7 is the vicinity threshold defining the spatial neighborhood around a true peak. The coefficients Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]8, Fp=α[inYp(i){(d(i)v)2if d(i)>v 0if d(i)v]F_p = \alpha \left[\sum_i^n Y_p(i)\cdot \begin{cases} (d(i)-v)^2 & \text{if } d(i)>v\ 0 & \text{if } d(i)\le v \end{cases} \right]9, and Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}0 weight the three loss components (Young et al., 15 Sep 2025).

The three terms play distinct roles. Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}1 penalizes predicted responses outside any peak vicinity. Its contribution is zero inside the vicinity and increases with both prediction magnitude and squared excess distance once Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}2. Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}3 is the point-wise term that pushes responses toward Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}4 at true peak centers and toward Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}5 elsewhere. Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}6 applies only within the vicinity of a true peak and encourages predictions close to Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}7 in that neighborhood, modulated by the factor Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}8.

The paper makes an important implementation statement about Pv=βin{(Yp(i)1)2if YT(i)=1 (Yp(i)0)2if YT(i)=0P_v = \beta \sum_i^n \begin{cases} (Y_p(i)-1)^2 & \text{if } Y_T(i)=1\ (Y_p(i)-0)^2 & \text{if } Y_T(i)=0 \end{cases}9: it is a dynamic vicinity threshold and is annealed during training. The exact annealing schedule is not reported. Likewise, the loss weights PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v0, PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v1, and PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v2 are said to be tunable, but their chosen numeric values are not given.

The mathematical form also clarifies a subtle point. Because the weighting in PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v3 is maximal at PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v4 and decreases toward zero as PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v5, the loss most strongly reinforces predictions near the actual center while still treating nearby bins as meaningful structure rather than as uniformly wrong negatives. A plausible interpretation is that this is the central mechanism by which ViPeR converts brittle exact-center supervision into graded locality-aware supervision.

3. Operational mechanism in spectral localization

Operationally, ViPeR treats “vicinity” as a window of spectral bins around each true peak center. For each spectral bin PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v6, one computes PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v7, the distance to the nearest true peak. If PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v8, that bin lies in a valid peak neighborhood; if PL=γi=1n(Yp(i)1)2(1d(i)v)2if d(i)vP_L = \gamma \sum_{i=1}^{n} (Y_p(i)-1)^2 \cdot \left(1-\frac{d(i)}{v}\right)^2 \quad \text{if } d(i)\le v9, it lies outside all such neighborhoods. The loss is therefore defined on a discrete spectral index representation, not on continuous coordinates or sub-bin regression (Young et al., 15 Sep 2025).

This distinction matters because it changes how near-miss predictions are handled. Under ordinary point-wise CE, a peak predicted at VV0 instead of VV1 is simply a false negative at one location and a false positive at another. ViPeR instead allows nearby bins to fall under the within-vicinity penalty term VV2, so slightly shifted responses are treated as partially correct during training. The paper explicitly links this to a smoother loss landscape and smoother gradients near spectral peaks.

The network output associated with ViPeR is a 1D confidence or response map over the spectrum, with one value per datapoint and values between VV3 and VV4. During inference, these outputs are thresholded and then filtered with non-maximum suppression. At the settings chosen for subsequent studies, predicted peak locations are thresholded at 0.5, and within a sliding window of 6 data indices, only the highest-confidence prediction above threshold is retained. The paper notes that these post-processing settings were chosen in part to preserve the ability to identify both isolated and convoluted peaks; it also notes that an excessively large NMS window could fail to resolve convoluted peaks.

ViPeR is intended to help particularly with slight misalignment between predicted and true peak positions. The paper does not present an isolated mechanistic analysis for weak peaks or noisy peaks specifically attributable to ViPeR alone, although the surrounding OASIS pipeline includes denoising, baseline correction, and noise augmentation. Any claim that ViPeR specifically improves weak-peak detection would therefore be an inference rather than a direct experimental result.

4. Role inside OASIS

OASIS is organized as a four-stage pipeline: denoising, baseline correction, peak location detection, and retrieval of peak intensity and FWHM. ViPeR is used only in the third stage, the Peak Location Network. The output of that stage is then supplied to the fourth model, which predicts peak intensity and FWHM. The paper states that each subsequent model uses the output of the preceding stage, so accurate localization functions as the anchor for downstream parameter retrieval (Young et al., 15 Sep 2025).

The peak location model is described as a hybrid U-Net with three input channels: the raw spectrum, its first derivative, and its second derivative. Each input stream is processed through an independent U-Net pathway, and the outputs are concatenated. For the final peak location model, the reported hyperparameters are activation GELU, kernel sizes

VV5

and filter counts

VV6

The paper further states that skip connections are omitted around VV7 kernels.

Training uses synthetic spectra built from Voigt-profile peaks, synthetic baseline drift, Gaussian noise, small beta-distribution noise, and spectral tweaking augmentation. Each synthetic spectrum contains 555 datapoints and 1 to 11 Voigt peaks. Peak overlap is deliberately varied, with 50% of spectra generated using a maximum separation of 2 datapoints and 50% using a maximum separation of 12 datapoints. For the peak detector specifically, Gaussian noise standard deviations are VV8, and only the smaller beta-noise set, 0.001 to 0.004, is used; the larger beta-noise set is excluded.

ViPeR requires more than ordinary binary labels. The target generation process uses both the binary center labels VV9 and the nearest-peak distance map FpF_p0. In practical terms, label construction therefore requires a nearest-neighbor distance computation from every spectral bin to the closest ground-truth peak center. This extra supervision structure is essential to the loss, not an optional auxiliary annotation.

5. Empirical performance and operating regime

The principal ablation isolating ViPeR compares two peak-location U-Net models: one trained with ViPeR and one trained with CE + MSE. Peak-identification accuracy is defined as “the ratio of correctly predicted peak locations to the total number of ground truth peaks,” with the authors noting that false positives were rare, so the metric primarily reflects the balance of true positives and false negatives (Young et al., 15 Sep 2025).

Evaluation setting ViPeR CE + MSE
Threshold 0.3, NMS 18 0.986 0.972
Threshold 0.5, NMS 6 0.932 0.889
Threshold 0.8, NMS 6 0.917 0.831

Across all tested criteria, the ViPeR-trained model outperformed the conventional baseline. The separation is modest under loose criteria and larger under stricter criteria, particularly at threshold 0.8 with NMS window 6, where the reported values are 0.917 for ViPeR and 0.831 for CE + MSE. The preferred operating point used for subsequent studies is threshold 0.5 with NMS window 6, where the corresponding accuracies are 0.932 and 0.889.

The resulting OASIS pipeline was experimentally validated on Raman, fluorescence, and UV-Vis spectroscopy. ViPeR was not re-benchmarked separately by modality, but it is part of the full system validated on those three techniques. The abstract further states that innovative task-specific loss functions “such as the vicinity peak response (ViPeR) for peak localization” enabled the creation of compact yet highly accurate models. OASIS as a whole is described as compact and efficient, with the largest model containing 438,422 trainable parameters. However, the paper does not provide a ViPeR-only computational benchmark such as training-time reduction or FLOP savings, so any efficiency claim specific to ViPeR remains indirect.

The paper provides the exact decomposition FpF_p1, the meanings of FpF_p2, FpF_p3, FpF_p4, and FpF_p5, the statement that FpF_p6 is annealed during training, and an empirical comparison against CE + MSE. It does not provide the numeric values of FpF_p7, FpF_p8, and FpF_p9; the exact annealing schedule for PvP_v0; explicit pseudocode; a formal analysis of loss geometry for heavily overlapping peaks; or any continuous-position or sub-bin interpretation of the output (Young et al., 15 Sep 2025).

Several practical limitations follow directly from that scope. ViPeR depends on discrete-bin labels and on nearest-peak distance computation. Performance for very closely spaced peaks continues to depend on downstream non-maximum suppression, not only on the loss itself. The exact tuning of PvP_v1, PvP_v2, PvP_v3, and PvP_v4 is likely important, but those settings are left unspecified. These are best regarded as implementation omissions rather than as negative empirical findings.

There is also a terminological issue. ViPeR in OASIS should not be confused with VIPER spectroscopy, where the acronym denotes Vibrationally Promoted Electronic Resonance, an IR/VIS method based on vibrational pre-excitation and vibronic structure rather than a machine-learning loss for spectral localization (Cosel et al., 2017). Nor should it be confused with the use of “peak response” as a biological endpoint in pertussis booster modeling, where peak refers to the magnitude of an immune response rather than to spectral or response-map localization (Sitani, 13 May 2026).

A more relevant conceptual comparison comes from response-map shaping in visual tracking. SPSTracker treats tracking failure as a sub-peak response-map problem and uses Peak Response Pooling and Boundary Response Truncation to aggregate multiple nearby maxima into a single dominant peak and suppress peripheral responses. That work is closely related in spirit to the idea that neighborhood peak structure matters, but it does so through deterministic response transformation under a Gaussian target prior rather than through an explicit vicinity-aware loss like ViPeR (Hu et al., 2019). This suggests that ViPeR occupies a specific design point: it is not merely a peak-suppression heuristic, but a supervised loss that encodes locality directly in the training objective.

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 Vicinity Peak Response (ViPeR).