Abstract
Prior-Guided Spectral Gating (PGSG) incorporates domain knowledge intonear-infrared (NIR) regression through a learnable gate vector initializedfrom a spectroscopic prior. We identify two fundamental limitations of theoriginal formulation that prevent its application to high-dimensional spectra:a softmax gradient vanishing problem (at p = 281 bands, the softmax Jaco-bian diagonal is 58× smaller than sigmoid, rendering the gate untrainable),and a circular prior pitfall (priors derived from training data cause the gateto reproduce the prior without adaptation). We propose PGSGv2, which re-places softmax with independent per-band sigmoid gates and a PLS regres-sor with an end-to-end MLP, enabling backpropagation through the jointgate–regressor objective. Applied to mango dry matter content (DMC%)prediction using the Mango DMC v3 dataset (n = 1,448, p = 281 effec-tive bands, within-season protocol) with a literature-based prior, PGSGv2achieves R2 = 0.806 at n = 1,159, outperforming PLS (R2 = 0.568, +42%)and MLP (R2 = 0.699, +15%). For n ≤ 60, PGSGv2 is the only methodwith positive R2 , demonstrating the value of prior-guided initialization indata-scarce regimes. Learned gates are chemically coherent (ρ(g, s) ≥ 0.998)and highly reproducible across seeds (Jaccard ≥ 0.945). PGSGv2 providesa scalable and interpretable architecture for NIR calibration when labeledsamples are limited.