The Infinite-Dimensional Nature of Spectroscopy and Why Models Succeed, Fail, and Mislead
Organizations: Department of Computer Science Lucerne University of Applied Sciences and Arts Risch-Rotkreuz, 6343 Switzerland · Institute of Applied Mathematics and Physics ZHAW Zurich University of Applied Sciences Winterthur, 8400 Switzerland
Abstract
Machine learning (ML) models have achieved strikingly high accuracies in spectroscopic classification tasks, often without a clear proof that those models used chemically meaningful features. Existing studies have linked these results to data preprocessing choices, noise sensitivity, and model complexity, but no unifying explanation is available so far. In this work, we show that these phenomena arise naturally from the intrinsic high dimensionality of spectral data. Using a theoretical analysis grounded in the Feldman-Hajek theorem and the concentration of measure, we show that even infinitesimal distributional differences, caused by noise, normalisation, or instrumental artefacts, may become perfectly separable in high-dimensional spaces. Through a series of specific experiments on synthetic and real fluorescence spectra, we illustrate how models can achieve near-perfect accuracy even when chemical distinctions are absent, and why feature-importance maps may highlight spectrally irrelevant regions. We provide a rigorous theoretical framework, confirm the effect experimentally, and conclude with practical recommendations for building and interpreting ML models in spectroscopy.
Figures & tables
| ID | Experiment | Experiment Details |
|---|---|---|
| N1 | Gaussian noise: sweep (QDA) | Classify white noise from two multivariate Gaussians with equal means ( ) and different isotropic and Toeplitz (with parameter ) covariances; we varied the variance gap from 0 to 2 while keeping fixed. We have tested . We have measured classification accuracy. |
| N2 | Gaussian noise: Bayes “oracle” boundary | Classify white noise from two multivariate Gaussians with equal means ( ) and different isotropic covariances; we varied the variance gap from 0 to 2 while keeping fixed. We have tested . We classify white noise by using the ideal threshold on . |
| N3 | Gaussian noise: accuracy vs. dimension | Classify white noise from two multivariate Gaussians with equal means ( ) and different isotropic covariances; we varied the variance gap in while keeping fixed. We tested . We calculate the accuracy of QDA for various values of . |
| N4 | Skew–normal noise: 2D parameter sweeps | Classify two classes of white noise from multivariate skew–normal Azzalini and Valle (1996) . For this experiment, we used the parameters , , , . We then varied from 0 to 2, from 0 to 0.15, and from 0 to 8. |
| S1 | Synthetic spectra: truly identical classes | Classify two classes of spectra each composed of one Lorentzian (both centres chosen according to a normal distribution ) and an FWHM . We generated spectra for each class. We choose . These two sets of spectra are not distinguishable, as there are no differences in the data distributions. |
| S2 | Synthetic spectra: FWHM difference | Classify two classes of spectra each composed of one Lorentzian (both centres chosen accordingly to a normal distribution ) and two different FWHM and . We generated spectra for each class. We choose We study accuracy of classification for various value of . |
| ID | Experiment | Key finding | Reference to Results |
|---|---|---|---|
| N1 | Gaussian noise: sweep (QDA) | Accuracy climbs monotonically with and with dimension ; it reaches almost 1 already with modest gaps for high enough. In high white noise is easily and perfectly classifiable. We have tested and from 0 to 2 for an homogoenous covariance and for a Toeplitz one with . | Fig. 4 ; Methods in Section 3.1 ; Results in Section 4.1 |
| N2 | Gaussian noise: Bayes “oracle” boundary | White noise from the two distributions is almost perfectly classifiable in high enough ; accuracy goes to 1 quickly as grows. We have tested and we have varied from 0 to 1.0. | Fig. 5 ; Methods in Section 3.1 ; Results in Section 4.1 |
| N3 | Gaussian noise: accuracy vs. dimension | Even small becomes highly separable as increases (dimensionality amplifies tiny distributional gaps). We have tested from 0 to 5000 (but visualisaed only until 100, to make the more steeper growing curves more visible) and tested . | Fig. 6 ; Methods in Section 3.1 ; Results in Section 4.1 |
| N4 | Skew–normal noise: 2D parameter sweeps | Tiny shifts in mean, variance or skewness give near-perfect accuracy for most models; random forest saturates the fastest. | Fig. 7 ; Methods in Section 3.2 ; Results in Section 4.2 ; Results in Section 4.3 |
| S1 | Synthetic spectra: truly identical classes | No classifier exceeds chance level accuracy (0.5) confirming that without distributional differences, classification is impossible. | Tab. 3 ; examples in Fig. 2 |
| S2 | Synthetic spectra: width difference | Validation accuracy rises as expected with ; linear and ensemble models approach for large similarity in the spectra. | Fig. 8 ; Results in Section 4.3 |
| Model | Accuracy (mean SD) |
|---|---|
| Logistic Regression | |
| K-Neighbors Classifier | |
| Decision Tree Classifier | |
| Random Forest Classifier |
Classification
Classification maps observations to discrete labels, including familiar, unknown, hierarchical, or multiple categories.
See all 408 papers