serrsBayes: Bayesian Modelling of Raman Spectroscopy

Matthew T. Moores, Jake Carson, Mark GirolamiOpenalex Unknown 2018 · OpenAlex

TL;DR

The serrsBayes R package provides a powerful Bayesian framework for decomposing complex Raman spectroscopy signals into their constituent parts: peaks, baselines, and noise. By employing Sequential Monte Carlo (SMC) algorithms, it offers a robust way to quantify molecular concentrations and quantify uncertainty in Surface-Enhanced Resonance Raman Spectroscopy (SERRS) data.

What Problem Does This Paper Address?

Raman spectroscopy is a vital tool for identifying molecules based on their unique "vibrational fingerprints." However, the raw data produced—especially in Surface-Enhanced Resonance Raman Spectroscopy (SERRS)—is notoriously messy.

Researchers face three primary hurdles:

  1. Overlapping Peaks: Molecular signals appear as a sequence of peaks that often crowd together, making it hard to distinguish individual signatures.
  2. Fluorescence Background: A smoothly varying "baseline" caused by background fluorescence often dwarfs the actual Raman signal.
  3. Collinearity: Multivariate observations in SERRS are highly correlated, which can cause traditional regression models to fail or become unstable.

The serrsBayes package addresses these issues by treating spectral analysis as a statistical signal processing problem, providing a principled way to separate the "signal" (peaks) from the "noise" and "background" (baseline).

Methods

The core of the package is a Generalized Additive Mixed Model (GAMM). This model decomposes the observed spectrum ($Y$) into three distinct mathematical components:

  • The Peaks: Modeled as an additive mixture of radial basis functions. Users can choose between Lorentzian, Gaussian, or pseudo-Voigt kernels depending on the physical properties of their samples.
  • The Baseline: Modeled using penalized cubic B-splines. This allows the model to capture the slow-moving "humps" of fluorescence without accidentally fitting the sharp Raman peaks.
  • The Noise: Modeled as zero-mean additive white noise with constant variance.

To estimate the parameters of this complex model, the authors use Sequential Monte Carlo (SMC), also known as particle filtering. Instead of finding a single "best fit," SMC represents the posterior distribution as a population of weighted "particles." This approach is particularly good at handling the non-linearities and multi-modal distributions often found in spectroscopy. The package is optimized for performance using Rcpp and RcppEigen, and supports parallel processing via OpenMP.

Datasets

The package includes several datasets for benchmarking and demonstration:

  • lsTamra: A SERRS spectrum of tetramethylrhodamine labeled DNA (T20), consisting of 2,401 wavenumbers.
  • methanol: A standard Raman spectrum of methanol ($CH_3OH$) with 331 wavenumbers.
  • result / result2: Pre-computed posterior distributions (1,000 SMC particles) for the above datasets, featuring up to 32 identified peaks.

Key Insights and Ideas

  • Reduced-Rank Representation: The authors recognize that SERRS data is highly collinear. By using a reduced-rank approach, the model remains computationally efficient even when dealing with thousands of wavenumbers.
  • Model Evidence for Selection: The package calculates the marginal likelihood (model evidence). This allows researchers to objectively determine which peak shape (e.g., Gaussian vs. Lorentzian) better describes their specific physical system.
  • Bayesian Functional Regression: The model explicitly links peak intensity ($A_p$) to molecular concentration ($c_i$) through the relationship $A_p = c_i \beta_p$. This allows for direct quantification of unknown samples with built-in uncertainty estimates.
  • Baseline Cancellation: A clever "marginalization identity" is used in the Metropolis-Hastings steps to ensure the baseline cancels out during certain updates, improving the stability of the peak-fitting process.

Key Results

  • Uncertainty Quantification: Unlike frequentist "curve fitting," serrsBayes provides Highest Posterior Density (HPD) intervals. This gives researchers a statistically rigorous way to define the Limit of Detection (LOD) for a specific molecule.
  • Automated Decomposition: The package successfully separates overlapping peaks from complex backgrounds, as demonstrated in the provided examples where it fits 32 peaks to the lsTamra dataset.
  • Efficiency: While Bayesian methods are often slow, the package's implementation allows for 100 SMC iterations with 10,000 particles in approximately one minute on standard hardware.

Limitations and Future Work

  • Prior Sensitivity: As with any Bayesian method, the results can be sensitive to the choice of hyperparameters (priors). Users need a reasonable starting guess for peak locations and widths.
  • Computational Scaling: While optimized, very high-resolution spectra with hundreds of peaks may still challenge the SMC approach, potentially requiring even more aggressive dimensionality reduction.
  • Peak Symmetry: The current model assumes symmetric peak shapes (Lorentzian/Gaussian). Future iterations might benefit from asymmetric profiles to better model certain experimental distortions.

Summary updated

Abstract

Sequential Monte Carlo (SMC) algorithms for fitting a generalised additive mixed model (GAMM) to surface-enhanced resonance Raman spectroscopy (SERRS), using the method of Moores et al. (2016) &lt;<a href="https://doi.org/10.48550/arXiv.1604.07299" target="_top">doi:10.48550/arXiv.1604.07299</a>&gt;. Multivariate observations of SERRS are highly collinear and lend themselves to a reduced-rank representation. The GAMM separates the SERRS signal into three components: a sequence of Lorentzian, Gaussian, or pseudo-Voigt peaks; a smoothly-varying baseline; and additive white noise. The parameters of each component of the model are estimated iteratively using SMC. The posterior distributions of the parameters given the observed spectra are represented as a population of weighted particles.
BibTeX
@inproceedings{moores2018serrsbayes,
  author = {Matthew T. Moores and Jake Carson and Mark Girolami},
  title = {{serrsBayes: Bayesian Modelling of Raman Spectroscopy}},
  booktitle = {Openalex Unknown},
  year = {2018},
  doi = {10.32614/cran.package.serrsbayes},
}

Loading related content...

Figure