Cleaned optical spectra can mislead machine learning models
Standard numerical benchmarks reward cosmetic similarity in molecular curves while obscuring physical distortions that degrade diagnostic algorithms, according to tests across multiple analytical tasks.

Optical spectra serve as detailed molecular curves used to identify bacteria, quantify sugar mixtures, and catalog minerals.1 To make these measurements usable, researchers routinely run raw spectral data through algorithmic preprocessing and enhancement techniques designed to clean up distortions.1 In standard laboratory practice, these enhancement methods are evaluated by comparing the treated spectra against a pristine reference.1 The prevailing assumption has been that a spectrum that scores higher on mathematical quality benchmarks will naturally yield superior results in practical classification and measurement tasks.1 Yet an enhanced curve that appears closer to a reference does not guarantee that an automated algorithm will make an accurate real-world identification.1
Interpreting spectral comparisons requires concrete evidence that numerical quality measures actually reflect downstream performance.1 When automated tools classify a pathogen or identify a mineral, subtle distortions can disrupt algorithmic predictions in ways that general mathematical scores fail to register.1 If an evaluation metric rewards cosmetic similarity while overlooking errors that cause downstream models to fail, researchers risk selecting enhancement tools that degrade actual analytical accuracy.
In Raman spectroscopy, laser light scatters off a sample to generate peaks representing chemical bonds. A classifier identifies compounds by scanning for specific peaks at defined coordinates. When background noise obscures the signal, filtering tools attempt to clean the curve. An algorithm may eliminate broad noise, producing a visually clean curve, yet displacing or clipping a narrow diagnostic peak causes the classifier to fail.
In a preprint posted on the arXiv server on September 25, 2026, researcher Xiuyi Qin introduced a controlled-perturbation framework to test how closely spectral quality metrics align with practical task performance.1
Why do standard quality benchmarks fail downstream models?
Standard quality benchmarks fail downstream models because general curve comparisons evaluate full spectral shapes rather than the specific features that machine-learning algorithms rely on to make decisions. A classifier learns to associate specific peaks with particular compounds. If an experimental artifact produces a global wavenumber shift or warps the measurement axis, the overall shape of the spectrum remains recognizable to a general similarity metric. To an algorithm calibrated on fixed coordinates, that slight horizontal movement displaces critical peaks, causing misclassification. Conversely, a broad baseline distortion creates large numerical error across the entire curve while preserving relative peak heights. A metric measuring only aggregate discrepancy penalizes baseline distortion heavily even when downstream classification remains unaffected.
Xiuyi explained that the disconnect arises from error orientation. Speaking to Primary, Xiuyi said, "I think the core blind spot is this: standard metrics measure how big a change is, but a model cares about which direction the change points in." In mean squared error, every wavenumber receives equal weight. A trained classifier isolates the narrow subspace containing the peak combinations that separate classes. Xiuyi noted that "MSE is blind to direction, and model failure is all about direction." Two distortions can produce identical mean squared error with completely different outcomes: a baseline drift may fall outside the discriminative subspace, while a tiny peak shift flips an identification.
Standard metrics also exhibit coordinate blindness and spatial averaging. Point-by-point comparisons mean small horizontal shifts register as near-zero numerical change, despite pushing peaks out of expected bins, while summing errors across hundreds of channels dilutes localized flaws. Yet Xiuyi emphasized that standard benchmarks still carry predictive value. In comments to Primary, Xiuyi said, "Our research doesn't show that standard measures like MSE fail to track accuracy." For a 10-shot bacterial classifier trained on clean spectra, mean squared error achieved an ordering concordance of about 0.78, compared with 0.5 for chance. Xiuyi added that "what the paper shows is that how well a measure tracks accuracy depends on the analysis behind it: the task, the model, and especially how the model was calibrated."
How does the evaluation framework test spectral measures?
The evaluation framework tests spectral measures by introducing controlled perturbations into spectral data and tracking paired changes in quality scores and task outcomes.1 Qin evaluated spectral behavior using five distinct perturbation types: baseline distortion, independent noise, shifts across the global wavenumber axis, correlated noise, and nonlinear warping of the measurement axis.1 These systematic perturbations generated simultaneous adjustments in a given spectral measure, designated as metric harm, alongside changes in downstream analytical success, designated as task harm.1 The framework evaluated performance across three publicly accessible datasets addressing tasks in bacterial classification, the quantification of sugar mixtures, and mineral identification.1

Across these tasks, the framework assessed thirteen different spectral quality outputs.1 The evaluated metrics comprised mean squared error, root mean squared error, mean absolute error, and normalized mean squared error, along with spectral angle, Pearson correlation, and Wasserstein distance.1 The analysis also included a structure-to-noise ratio, peak precision, recall, F1 score, artifact ratio, and missing ratio.1 Downstream analytical outcomes were supplied by principal component analysis with logistic regression for bacterial classification, partial least squares regression for sugar-mixture quantification, and cosine library matching for mineral queries.1
Xiuyi selected the five perturbation types to cover typical Raman distortions without experimental bloat. In response to questions from Primary, Xiuyi said, "The short answer is that I wanted a small set of perturbations that cover the main ways a Raman spectrum typically goes wrong, without the set exploding." Baseline shifts provide smooth intensity changes, noise models high-frequency roughness, and wavenumber shifts and warping introduce coordinate misalignments. Artifacts such as phase error were excluded because "phase error is mostly an issue for Fourier-transform instruments (FT-Raman, FT-IR, NMR), where imperfect phase correction distorts the band shapes" rather than dispersive Raman setups.
The framework paired these perturbations with classical chemometric models to ensure that performance differences reflected metric behavior rather than algorithmic complexity. In response to questions from Primary, Xiuyi said, "First, the thing I'm testing is the metric, not the model. I wanted simple, transparent models so that any difference in the results comes from the metrics and not from the model doing something complicated." Deep networks also introduce stochastic training variation and overfit on compact datasets, such as the five to 20 bacterial training spectra per class and 240 sugar wells tested here.
An alignment gap quantifies how much the mathematical connection between metric harm and task harm varies across different perturbation types.1 Meanwhile, ordering concordance measures how often a spectral quality metric correctly ranks two experimental conditions by their downstream task harm.1
What do the paired comparisons reveal about existing metrics?
The paired comparisons reveal task-specific strengths and limitations across the thirteen measures, showing that a metric that ranks conditions accurately does not always maintain a consistent relationship with task harm.1 Qin found notable cases where a higher ordering concordance did not accompany a smaller alignment gap, demonstrating that relative ranking capability and relationship stability capture distinct qualities.1 To examine how model training influences these outcomes, classifiers and calibration algorithms were trained on unperturbed spectra or separately adjusted to each perturbed condition, before researchers evaluated them on identical perturbed test spectra.1 For mineral identification, query spectra were compared against an unchanged reference library or one subjected to corresponding perturbations.1 To test whether these conclusions stemmed from experimental setup, Qin removed perturbations to the axis and compared the resulting curves across a shared physical grid.1
This divergence appeared clearly during tests of Wasserstein distance. In response to questions from Primary, Xiuyi described it as "a metric that measures how much 'stuff' you'd have to shovel along the spectrum to turn one spectrum into another, a bit like moving piles of sand around." For a bacterial classifier trained on clean spectra, Wasserstein distance predicted harm better than mean squared error, but that advantage vanished once the model was retrained on distorted curves. Xiuyi said, "Same metric, same test spectra, but a different way of training the model, and the ranking flipped." Xiuyi noted that retraining shifted the model's sensitive directions: smooth baseline shifts became less damaging while fine noise became more damaging, generating approximately two-thirds of the alignment gap in mean squared error.
Where do these benchmark findings reach their limits?
The evaluation framework reaches its operational boundary in exploratory settings that lack labeled samples and downstream tasks. These findings characterize the mathematical behavior of specific algorithms under simulated perturbations rather than an exhaustive catalog of physical instruments. Artificial perturbations provide reproducible benchmarks, but physical spectrometers encounter complex combinations of optical noise and sample variations that may behave differently. In addition, the paper is a preprint that has been posted publicly on arXiv but has not yet undergone peer review. Statistical stability requires sufficient independent sample groups, because resampling too few classes widens error margins, and the framework treats spectra as independent observations, which does not hold in Raman imaging where adjacent pixels correlate.
Xiuyi cautioned that while the testing workflow can be applied widely, specific metric rankings should not be generalized without testing. In response to questions from Primary, Xiuyi said, "The procedure travels well. The specific conclusions, like 'Wasserstein distance works well for this bacterial classifier,' don't, and they shouldn't be reused without rerunning the test." The most persuasive next test will replace synthetic perturbations with outputs from real preprocessing pipelines, such as baseline correction and learned denoisers, to check whether standard metrics rank commercial tools accurately. Expanding tests to convolutional neural networks will also clarify how deep architectures interact with spectral metrics. By formalizing this approach into a reproducible workflow, the study establishes a systematic procedure to assess established metrics and test future candidates against downstream operational performance.1
The record
67 sentences trace to 1 source and 1 contributor.
- 1 A Task-Based Framework for Evaluating Raman Spectral Quality Measures Preprint · may not have been peer reviewed See the source
- 2 Contribution — Xiuyi Qin 46 statements added to this article
Other consulted pages1 page
Article history
-
Published 2 Nov 2026, 13:37Assembled by the Primary desk from 1 source · 1 contributor · 67 cited sentences
-
Xiuyi Qin
- Go to the sentence: The prevailing assumption has been that a spectrum that scores higher on mathematical quality benchmarks will naturally yield superior results in practical classification and measurement tasks.
- Go to the sentence: When automated tools classify a pathogen or identify a mineral, subtle distortions can disrupt algorithmic predictions in ways that general mathematical scores fail to register.
- Go to the sentence: If an evaluation metric rewards cosmetic similarity while overlooking errors that cause downstream models to fail, researchers risk selecting enhancement tools that degrade actual analytical accuracy.
- Go to the sentence: In Raman spectroscopy, laser light scatters off a sample to generate peaks representing chemical bonds.
- Go to the sentence: A classifier identifies compounds by scanning for specific peaks at defined coordinates.
- Go to the sentence: When background noise obscures the signal, filtering tools attempt to clean the curve.
- Go to the sentence: An algorithm may eliminate broad noise, producing a visually clean curve, yet displacing or clipping a narrow diagnostic peak causes the classifier to fail.
- Go to the sentence: Standard quality benchmarks fail downstream models because general curve comparisons evaluate full spectral shapes rather than the specific features that machine-learning algorithms rely on to make decisions.
- Go to the sentence: A classifier learns to associate specific peaks with particular compounds.
- Go to the sentence: If an experimental artifact produces a global wavenumber shift or warps the measurement axis, the overall shape of the spectrum remains recognizable to a general similarity metric.
- Go to the sentence: To an algorithm calibrated on fixed coordinates, that slight horizontal movement displaces critical peaks, causing misclassification.
- Go to the sentence: Conversely, a broad baseline distortion creates large numerical error across the entire curve while preserving relative peak heights.
- Go to the sentence: A metric measuring only aggregate discrepancy penalizes baseline distortion heavily even when downstream classification remains unaffected.
- Go to the sentence: Xiuyi explained that the disconnect arises from error orientation.
- Go to the sentence: Speaking to Primary, Xiuyi said, "I think the core blind spot is this: standard metrics measure how big a change is, but a model cares about which direction the change points in."
- Go to the sentence: In mean squared error, every wavenumber receives equal weight.
- Go to the sentence: A trained classifier isolates the narrow subspace containing the peak combinations that separate classes.
- Go to the sentence: Xiuyi noted that "MSE is blind to direction, and model failure is all about direction."
- Go to the sentence: Two distortions can produce identical mean squared error with completely different outcomes: a baseline drift may fall outside the discriminative subspace, while a tiny peak shift flips an identification.
- Go to the sentence: Point-by-point comparisons mean small horizontal shifts register as near-zero numerical change, despite pushing peaks out of expected bins, while summing errors across hundreds of channels dilutes localized flaws.
- Go to the sentence: Yet Xiuyi emphasized that standard benchmarks still carry predictive value.
- Go to the sentence: In comments to Primary, Xiuyi said, "Our research doesn't show that standard measures like MSE fail to track accuracy."
- Go to the sentence: For a 10-shot bacterial classifier trained on clean spectra, mean squared error achieved an ordering concordance of about 0.78, compared with 0.5 for chance.
- Go to the sentence: Xiuyi added that "what the paper shows is that how well a measure tracks accuracy depends on the analysis behind it: the task, the model, and especially how the model was calibrated."
- Go to the sentence: Qin evaluated spectral behavior using five distinct perturbation types: baseline distortion, independent noise, shifts across the global wavenumber axis, correlated noise, and nonlinear warping of the measurement axis.
- Go to the sentence: Downstream analytical outcomes were supplied by principal component analysis with logistic regression for bacterial classification, partial least squares regression for sugar-mixture quantification, and cosine library matching for mineral queries.
- Go to the sentence: Xiuyi selected the five perturbation types to cover typical Raman distortions without experimental bloat.
- Go to the sentence: In response to questions from Primary, Xiuyi said, "The short answer is that I wanted a small set of perturbations that cover the main ways a Raman spectrum typically goes wrong, without the set exploding."
- Go to the sentence: Baseline shifts provide smooth intensity changes, noise models high-frequency roughness, and wavenumber shifts and warping introduce coordinate misalignments.
- Go to the sentence: Artifacts such as phase error were excluded because "phase error is mostly an issue for Fourier-transform instruments (FT-Raman, FT-IR, NMR), where imperfect phase correction distorts the band shapes" rather than dispersive Raman setups.
- Go to the sentence: The framework paired these perturbations with classical chemometric models to ensure that performance differences reflected metric behavior rather than algorithmic complexity.
- Go to the sentence: In response to questions from Primary, Xiuyi said, "First, the thing I'm testing is the metric, not the model. I wanted simple, transparent models so that any difference in the results comes from the metrics and not from the model doing something complicated."
- Go to the sentence: Deep networks also introduce stochastic training variation and overfit on compact datasets, such as the five to 20 bacterial training spectra per class and 240 sugar wells tested here.
- Go to the sentence: This divergence appeared clearly during tests of Wasserstein distance.
- Go to the sentence: In response to questions from Primary, Xiuyi described it as "a metric that measures how much 'stuff' you'd have to shovel along the spectrum to turn one spectrum into another, a bit like moving piles of sand around."
- Go to the sentence: For a bacterial classifier trained on clean spectra, Wasserstein distance predicted harm better than mean squared error, but that advantage vanished once the model was retrained on distorted curves.
- Go to the sentence: Xiuyi said, "Same metric, same test spectra, but a different way of training the model, and the ranking flipped."
- Go to the sentence: Xiuyi noted that retraining shifted the model's sensitive directions: smooth baseline shifts became less damaging while fine noise became more damaging, generating approximately two-thirds of the alignment gap in mean squared error.
- Go to the sentence: The evaluation framework reaches its operational boundary in exploratory settings that lack labeled samples and downstream tasks.
- Go to the sentence: These findings characterize the mathematical behavior of specific algorithms under simulated perturbations rather than an exhaustive catalog of physical instruments.
- Go to the sentence: Artificial perturbations provide reproducible benchmarks, but physical spectrometers encounter complex combinations of optical noise and sample variations that may behave differently.
- Go to the sentence: Xiuyi cautioned that while the testing workflow can be applied widely, specific metric rankings should not be generalized without testing.
- Go to the sentence: In response to questions from Primary, Xiuyi said, "The procedure travels well. The specific conclusions, like 'Wasserstein distance works well for this bacterial classifier,' don't, and they shouldn't be reused without rerunning the test."
- Go to the sentence: The most persuasive next test will replace synthetic perturbations with outputs from real preprocessing pipelines, such as baseline correction and learned denoisers, to check whether standard metrics rank commercial tools accurately.
- Go to the sentence: Expanding tests to convolutional neural networks will also clarify how deep architectures interact with spectral metrics.
- Go to the sentence: By formalizing this approach into a reproducible workflow, the study establishes a systematic procedure to assess established metrics and test future candidates against downstream operational performance.
