Log-Gaussian Gamma Processes for Training Bayesian Neural Networks in Raman and CARS Spectroscopies

We propose an approach utilizing gamma-distributed random variables, coupled with log-Gaussian modeling, to generate synthetic datasets suitable for training neural networks. This addresses the challenge of limited real observations in various applications. We apply this methodology to both Raman and coherent anti-Stokes Raman scattering (CARS) spectra, using experimental spectra to estimate gamma process parameters. Parameter estimation is performed using Markov chain Monte Carlo methods, yielding a full Bayesian posterior distribution for the model which can be sampled for synthetic data generation. Additionally, we model the additive and multiplicative background functions for Raman and CARS with Gaussian processes. We train two Bayesian neural networks to estimate parameters of the gamma process which can then be used to estimate the underlying Raman spectrum and simultaneously provide uncertainty through the estimation of parameters of a probability distribution. We apply the trained Bayesian neural networks to experimental Raman spectra of phthalocyanine blue, aniline black, naphthol red, and red 264 pigments and also to experimental CARS spectra of adenosine phosphate, fructose, glucose, and sucrose. The results agree with deterministic point estimates for the underlying Raman and CARS spectral signatures.


Introduction
Raman and coherent anti-Stokes Raman scattering (CARS) spectroscopies are vital tools used in chemistry, physics, and biomedical research [1][2][3] .The insights they offer into molecular vibrations, structural dynamics, and chemical compositions are invaluable.However, working with their data presents challenges.Measurement artifacts including noise, and, especially, background signals in Raman and CARS spectra often obscure crucial molecular information.Traditional methods for data correction are typically manual and may fall short in capturing the full complexity of the data.For instance, standard approaches used for removing the background signals include asymmetric least squares polynomial fitting, wavelet-based methods, optimization with Tikhonov regularization, and Kramers-Kronig relations [4][5][6][7][8][9][10][11][12] .While appealing, these methods suffer from practical drawbacks such as the need for manual tuning of the model or regularization parameters.The need for automated, robust, and statistically sound solutions to enhance our spectroscopic analyses is evident.
Bayesian inference treats the parameters of a given model as random variables.These models consist of a likelihood function that is combined with prior distributions for the parameters to produce posterior estimates.The likelihood function is analogous to a utility function in an optimization context.It quantifies how well the model fits the observed data.The aforementioned prior distributions for the model parameters represent the information known beforehand, including any constraints dictated by the physical nature of the parameters, such as non-negativity.In spectroscopic analysis, the model parameters can be, for example, amplitudes, locations, and widths of Gaussian, Lorentzian, or Voigt line shape functions.The combination of the likelihood and the priors results in a posterior distribution over the model parameters.The posterior is a probabilistic representation of the uncertainty in the parameter estimates.Bayesian approaches have been considered for estimating spectrum parameters, where the authors used sequential Monte Carlo algorithms to numerically sample from the posterior distribution 36,37 .While the uncertainty quantification provided by Bayesian modeling and Markov chain Monte Carlo (MCMC) methods is compelling, the approach is known to be computationally expensive, see for example 38 .This becomes a major issue particularly with hyperspectral data sets.A hyperspectral data set, or an image, consists of pixels where each pixel contains a spectrum.This can quickly result in millions of individual spectra, experimental or synthetic, which are to be analyzed.
Bayesian neural networks are a synthesis of the aforementioned two ideas.Bayesian neural networks model the weights and biases of standard neural networks as random variables, which can be assigned prior distributions.When combined with a likelihood according to Bayes' theorem, the resulting utility function corresponds to the posterior for the neural network parameters.Advantages of this Bayesian neural network approach in comparison to non-Bayesian neural networks include robustness in terms of overfitting, providing uncertainty estimates instead of only point estimation, sequential learning, and better generalization 39 .In particular, uncertainty quantification has seen widespread research covering many application areas and topics, for example 40 .
One of the challenges of Bayesian neural networks is that they typically contain an enormous number of parameters.For instance, our network comprises over 11 million parameters, far beyond what is commonly considered high-dimensional for MCMC 41,42 .Some neural networks, such as large language models (LLMs), can have billions of parameters 43 .Thus, it can be challenging to establish convergence of such a large number of parameters in a statistically rigorous manner.To combat this, partially-Bayesian neural networks have been used as a practical tool to provide uncertainty estimation with neural networks.In addition to empirical validation through practice, studies have provided compelling analytical and numerical evidence that partially-Bayesian neural networks are indeed capable of providing posterior estimates on par or even superior performance to fully-Bayesian neural networks 44 .The above points lead us to construct our neural network for this study as a partially-Bayesian neural network.
Neural networks typically require large volumes of training data.This has been noted to be a problem also in spectroscopic applications as it is difficult to acquire large sets of independent data sets 28 .Therefore, many studies mentioned above use synthetic data to train the neural networks.The synthetic data is usually generated using random linear combinations of Lorentzian line shapes, where the amplitudes, locations, and widths are sampled from predefined probability distributions, see for example 25,29,45 .The background data is generated similarly.The backgrounds are modeled explicitly using a parametric functional form, such as a polynomial or a sigmoidal function, and the parameters of the model are again sampled from a predefined probability distribution 25,32,46 .An extension to this is to use experimental Raman spectra on top of the randomly generated spectra 34 .
Stochastic processes can be used to draw samples of random functions.A typical example of a stochastic process is the widelyused Gaussian process (GP).Properties of the drawn samples such as differentiability are governed through kernel functions, which are used to model dependencies between data points.For readers unfamiliar with GPs, we recommend the book by Rasmussen and Williams 47 .Instead of using explicit, parametric functions to model the spectroscopic features, we propose using stochastic processes as a more flexible tool for the purpose.In this study, we use GPs as a generative model for the additive and multiplicative backgrounds of Raman and CARS spectra, see Fig. 1.For the purpose of generating synthetic Raman spectral signatures, we propose a specific type of doubly-stochastic Lévy process which we call a log-Gaussian gamma process.Our construction of the log-Gaussian gamma process is inspired by log-Gaussian Cox process which the authors have previously used as a model for spectra 48 .While it makes sense to model spectra as a Cox process where the relaxation from higher energy levels happens at a constant Fig. 1 Structure of our generative spectrum model using GPs and log-Gaussian gamma processes.On top, an experimental CARS spectrum of adenosine phosphate in blue and an example multiplicative background in red.We model the backgrounds as a GP.At the bottom, an example underlying Raman spectral signature in blue.We assume the Raman peaks to be distributed according to our proposed log-Gaussian gamma process model.The stochastic processes are parameterized according to µ e , θ θ θ e , α, and β (ν).We further model β (ν) using GPs which are parameterized according to µ β and θ θ θ β .We construct statistical samples with MCMC for the model parameters which allow us to generate synthetic spectra for training our Bayesian neural network.rate and results in counts of photons, the data is often available in scaled floating-point numbers which prevents direct application of the log-Gaussian Cox process model.Gamma-distributed variables have direct connections to Poisson-distributed variables, which constitute the Cox process, making the extension to a log-Gaussian gamma process intuitive as a model for Raman spectroscopy.The log-Gaussian gamma process can be used to generate arbitrary amounts of synthetic spectra once parameters of the stochastic process have been estimated.We perform the estimation using MCMC methods which allow us to construct a Bayesian posterior distribution for the model parameters, thereby including uncertainty of the parameter estimates in our data generation.This also applies to our GP-based background model.We present a high-level diagram of our stochastic process method for data generation in Fig. 1.Fig. 2 shows an example of the aim of this paper, a Raman spectral signature extracted from a CARS spectrum using a Bayesian neural network.We provide a pseudo-code description of our approach in Algorithm 1.
The key contributions of this paper are the following.We propose using log-Gaussian gamma processes for modeling Raman spectral signatures and GPs to model additive or multiplicative background signals.The aforementioned doubly-stochastic processes are sampled randomly, enabling us to generate an arbitrary number of synthetic spectra that are statistically similar to experimental spectra.Finally, we present a partially-Bayesian neural Bayesian neural network Fig. 2 On top, an experimental CARS spectrum of adenosine phosphate in blue.With a trained Bayesian neural network, we can extract the underlying Raman spectral signature from the data along with an uncertainty estimate for the spectrum.At the bottom, the corresponding Bayesian neural network median Raman spectrum estimate and 90% confidence interval of the estimate for the adenosine phosphate data.
network for analyzing Raman and CARS spectral measurements, which we train using the sampled synthetic spectra.Once trained, we use these neural networks to estimate the spectral signatures for experimental Raman spectroscopy measurements of phthalocyanine blue, naphthol red, aniline black, and red 264 pigments and for experimental CARS spectra of adenosine phosphate, fructose, glucose, and sucrose in addition to synthetic test spectra.

Algorithm 1 Log-Gaussian gamma process data generation for training Bayesian neural networks
Step 1: Fit a log-Gaussian gamma process to Raman spectrum data.
Step 2: Fit a GP to background data.
Step 3: Draw a large number of realizations from the fitted log-Gaussian gamma process.
Step 4: Draw a large number of realizations from the fitted GP.
Step 5: Use a forward model to combine the realizations to form a data set of synthetic spectra.
Step 6. Train a Bayesian neural network using the data set of synthetic spectra.
The rest of the paper is structured as follows.We detail the steps used to generate the synthetic training data in three stages in the following three sections.We first present the log-Gaussian gamma process as a model for Raman spectral signatures and explain how to draw realizations of this doubly-stochastic process.This is followed by a description of our GP-based additive and multiplicative background models.We finalize the explanation of our synthetic data generation method with definitions of the forward models used to simulate synthetic training data for Raman and CARS measurements with additive and multiplicative backgrounds, respectively.Next, we present our partially-Bayesian neural network architecture, which we train against the synthetic data sets that we have generated.We document computational details and prior distributions in the next section, followed by a presentation of our results for both artificial and real experimental data.Finally, we conclude with a discussion of the significance and other potential applications for our method.

Log-Gaussian gamma process spectrum model
We model a Raman spectral signature as a collection of conditionally-independent, gamma-distributed random variables where r k denotes a Raman measurement at wavenumber location ν k with α and β (ν k ) being the shape and scale parameters of the gamma distribution, respectively.The scale β (ν k ) is thought to model the spectral line shapes and other artefacts, while the shape α models the noise level present in the spectrum.The above construction is motivated by log-Gaussian Cox processes 49 but without the restriction of modeling of only integer-valued data and with an additional parameter in the stochastic process allowing for more flexible modeling of uncertainty.Poissondistributed random variables, which constitute the Cox process, have a single parameter to control both the mean and variance of the distribution.Very often in real data, this assumption is found to be too restrictive, leading to a model that is either under-or over-dispersed 50 .In contrast, the gamma distribution has two parameters which together allow for a range of different variances for a given mean.
We extend Eq. ( 1) by modeling the log-scale as a GP, resulting in a hierarchical model where ν ν ν := (ν 1 , . . ., ν K ) ⊺ is a vector of the wavenumber locations with µ β ∈ R and Σ β (ν ν ν, ν ν ν, θ θ θ β ) ∈ R K×K being a constant mean and a covariance matrix parameterized according to hyperparameters θ θ θ β .This doubly-stochastic model introduces dependence between values r i and r j at different wavenumbers ν i and ν j .For the covariance function of the log-scale GP, we use the squared exponential kernel where Σ e (ν ν ν, ν ν ν, θ θ θ β ) i j denotes the i jth element of the covariance β denotes the noise variance, and δ . The GP construction yields an analytical form for the log-scale log β (ν ν ν) which we will detail below as we construct the posterior distribution according to Bayes' theorem.This log-GP parameterization is identical to the log-intensity model for Poisson variables that features in log-Gaussian Cox processes.For more details on the log-Gaussian Cox process, see 49 and for example 51 .
The posterior distribution involves the likelihood function L (r r r | α, β (ν ν ν)), a log-GP prior for the scale π 0 (β (ν ν ν) | µ β , θ θ θ β ), and a joint prior distribution π 0 (α, µ β , θ θ θ β ) for rest of the model param-eters.Given a measured Raman spectrum r r r := (r(ν 1 ), . . ., r(ν K )) ⊺ , we can formulate the likelihood as a product of conditionallyindependent, gamma-distributed random variables where β k := β (ν k ), and Γ(α) is the gamma function.The hierarchical prior for β (ν ν ν) can be evaluated as where Σ β (ν ν ν, ν ν ν; θ θ θ β ) denotes the determinant of the covariance matrix.With the above and a joint prior π 0 (α, µ β , θ θ θ β ), we can construct the posterior distribution for the model parameters conditioned on the measured spectrum data r r r as In the posterior in Eq.( 6), the dimension of The scale is a vector of the same dimension as the data, MCMC methdos are known to struggle estimating high-dimensional parameters.At a minimum, the highdimensional parameters incur a computational cost for inference with MCMC.To amend these issues and to simplify the inference, we perform dimension reduction for the scale β (ν ν ν).To achieve this, we observe that our data r r r should be a reasonable estimate for the expectation of the gamma process in Eq.( 1), r r r ≈ E[Gamma(α, β (ν ν ν))] = αβ (ν ν ν).This implies that the shape of the data r r r is close to the shape of the scale function, β (ν ν ν).Thus, we approximate the scale β (ν ν ν) as a convolution between a Gaussian kernel and the data where * denotes convolution, c β is a scaling constant, and G(ν ν ν; σ G ) is Gaussian smoothing kernel with width σ G .By this, we reduce the inference of the scale β (ν ν ν) ∈ R K×1 + to inference of two parameters, c β and σ G .With this smoothing approximation, we formulate an approximate posterior for Eq. ( 6) as where is the prior distribution augmented with (c β , σ G ) ⊺ .We detail the prior distribution π 0 (α, c β , σ G , µ β , θ θ θ β ) in the section on computational details and prior distributions.We perform inference of the posterior in Eq. ( 8) by sampling all the model parameters simultaneously using the DRAM algorithm 52 .ple realizations for the synthetic spectra to generate an arbitrary amount of synthetic data in the following way.First, we sample the GP parameters ( µ β , θ θ θ β ) ⊺ from the MCMC chain.Next, we
We normalize the realizations r(ν ν ν) such that max { r(ν ν ν)} = 1 and introduce an additional parameter to control amplitudes of the realizations.With an amplitude parameter A, we sample a normalized shape r N (ν ν ν | ψ ψ ψ) of the spectrum and multiply this by a sampled amplitude A. This procedure results in the following statistical model where ψ ψ ψ := (α, c β , σ G , µ β , θ θ θ β ) ⊺ is a shorthand for the gamma process parameters and π 0 (A) is a prior distribution for the amplitude A. Example realizations from the above statistical model are shown in Fig. 3.In the following section, we detail how we model additive and multiplicative backgrounds for Raman and CARS spectra using GPs.

Additive and multiplicative background models
We propose GPs as a flexible way to randomly draw additive and multiplicative background functions for Raman and CARS spec- trum modeling.This is in contrast to more standard polynomial models such as the ones used in 32 .

Raman and CARS spectrum models
In the preceding two sections we formulated mathematical procedures to sample synthetic spectrum and background realizations which are statistically similar to measurement data.Below, we combine these two approaches for generating arbitrary amounts of statistically realistic spectral data which are ultimately used for training our Bayesian neural networks.We present two forward models which are used to generate data for Raman measurements with an additive background and CARS measurements with a multiplicative background.
Fig. 6 Example realizations for the CARS spectrum model defined in Eq. (20).The realizations correspond to the log-Gaussian gamma process realizations in Fig. 3.
where the CARS spectrum S(ν ν ν | B NR , ψ ψ ψ) can be given as and B NR ∼ π 0 (B NR ) is a non-resonant background inherent to the CARS phenomenon distributed according to a prior distribution π 0 (B NR ) and H denotes the Hilbert transform.The model for the CARS spectrum has been previously used for example in 9,37 .We show example realizations for the Raman model in Fig. 5 and the CARS model in Fig. 6.We use the two models defined in Eqs. ( 19) and ( 20) to generate two synthetic data sets which are used to train two separate Bayesian neural networks.In the following section, we discuss the Bayesian neural network architecture.

Bayesian neural network architecture
Our neural network architecture used in the experiments is based on the SpecNet architecture 29 .The SpecNet architecture is composed of convolutional layers encoding the input, the measurement spectrum.The encoded information is then decoded using fully-connected hidden layers, resulting in estimates for the underlying true Raman spectrum.We present our changes to the SpecNet architecture below.
To achieve a partially Bayesian neural network 44 , we use a Bayesian layer for the first convolutional layer.Additionally, we augment the architecture with a probabilistic output layer.This transforms the neural network estimate into estimates of a stochastic process instead of directly estimating the Raman spectrum.We use a gamma distribution as our output layer, following our formulation of Raman spectra as a log-Gaussian gamma processes.We also found that L 1 or L 2 regularization was not necessary for the deterministic parts of the network and therefore only employ Dropout 53 regularization with the last dense layer of the network.This in agreement with the documented robustness of Bayesian neural networks with respect to overfitting 39 .The above results in the following partial posterior probability distribution, or cost function, used for training the neural network where R ∈ R I×J is a data matrix of I synthetic spectra of length J generated using either the Raman or CARS forward models in Eqs. ( 19) and ( 20) and L (R | Ψ D , Ψ S ) denotes the likelihood of the neural network estimate and π 0 (Ψ S ) is the prior distribution for the stochastic parameters of the network.As our outputs are modeled as gamma-distributed random variables, the likelihood where R i, j denotes the jth data point of the jth spectrum, α NN, j and β NN, j are neural network outputs for the gamma distribution parameters.For the prior distribution π 0 (Ψ S ), we use an independent normal distribution N (0, 1) for all the weights and biases of the first layer, π 0 (Ψ S ) ∝ ∏ P p=1 N (Ψ S,p ; 0, 1) where P is the total number of parameters in the first layer and N (Ψ S,p ; 0, 1) denotes the evaluation of the probability density at the parameter value Ψ S,p .This particular type of Bayesian neural network is also known as a deep kernel 54 or a manifold Gaussian processes 55 .We illustrate the neural network architecture in Fig. 7.
In the log-Gaussian gamma process section, we estimate parameters of a doubly-stochastic process via MCMC.The Bayesian neural network architecture proposed here can be seen as an estimate of a triply-stochastic process where the neural network outputs are two stochastic process realizations α NN (ν ν ν) and β NN (ν ν ν), an extension to the analytical log-Gaussian gamma process in Section 2 where the log-Gaussian parameterization of the scale process β NN (ν ν ν) is used for mathematical convenience due to the closed form of the probability density in Eq. ( 5).
The uncertainty quantification of the Bayesian neural network is achieved in two stages, the Bayesian convolutional layer and gamma distributed output layer.Numerical samples are generated for the parameters of the Bayesian convolutional layer during the training process.These numerical samples are propagated through the deterministic layers of the network and ultimately into the output layer.The output layer, modelled as a gamma process, outputs a gamma distribution for each prediction point which ultimately controls the uncertainty of the spectrum estimate.Gamma(αNN(ν), βNN(ν)) layer Fig. 7 A Bayesian neural network architecture for correcting spectral measurements.The first convolutional layer is modeled as a stochastic layer.A new representation of the measurement spectrum is produced via the convolutional layers and then decoded with the fullyconnected hidden layers.The output layer is modeled as a gamma process Gamma(α NN (ν), β NN (ν)), parameters of which are the outputs of the fully-connected hidden layers.

Computational details and prior distributions
We use 4 experimental Raman spectra and 4 CARS spectra to generate the synthetic training data sets.We use a wavelet-based approach 11 to obtain point estimates for the underlying Raman spectra in all 8 cases.Additionally, the method provides point estimates for the additive and multiplicative background signal which we use to estimate the parameters of the background GP model defined in Eq. (18).We show the obtained Raman data point estimates for the Raman spectra and additive backgrounds in Fig. 8 and CARS point estimates for the Raman spectra and multiplicative backgrounds in Fig. 9.The four cases of measurement data are used to train their respective Bayesian neural network architectures.It should be noted that for cases with significantly different Raman spectral signatures, such as where the spectra consists of either significantly sharper or wider line shapes, the training should be done using experimental data which contain such features.We run the DRAM algorithm with 5 proposal steps and with a length of 100 000 samples for both the log-Gaussian gamma process parameters and the GP parameters.We use a burn-in of 50 000 samples.The prior distributions for the log-Gaussian gamma process likelihood and the GP background likelihood are documented in Table 1.We use TensorFlow and TensorFlow Probability together with Keras to implement the neural network architecture [56][57][58] .We use the Adam optimizer for estimating the network parameters Ψ D and Ψ S .
The aforementioned MCMC sampling runs were done on an AMD Ryzen 3950X processor.Wall times for the MCMC sampling ranged from a couple of minutes to approximately one hour, depending on the number of data points in the spectra.The MCMC samplers can be run embarrassingly parallel for each measurement spectrum.Training the Bayesian neural network took approximately two hours on an NVIDIA 1070 graphics card for sets of 500 000 spectra.Given the small computational cost of the MCMC sampling and training the neural network, which are of-  fline costs, the main computational limitation comes from loading data during inference.

Results
We apply the two Bayesian neural networks to 4 synthetic Raman spectra and 4 synthetic CARS spectra generated using Eqs.(19)  and (20), respectively.The synthetic spectra were not part of the training data sets.The synthetic data and the results for Raman spectra with an additive background are shown in Fig. 10 and results for experimental Raman spectra of phthalocyanine blue, naphthol red, aniline black, and red 264 pigments are presented in Fig. 11.The experimental details of the CARS samples have been described in detail elsewhere, see for example 37 .The Raman spectra are from an online database of Raman spectra of pigments used in modern and contemporary art (The standard Pigments Checker v.5) 59 .
Results for synthetic CARS spectra are shown in Fig. 12 and results for experimental CARS spectra of adenosine phosphate, Table 1 Prior distributions for the log-Gaussian gamma and GP parameters.

Parameter
Distribution Parameter Distribution U (0.90, 1.10) π 0 (e stop ) U (0.90, 1.10) fructose, glucose, and sucrose are presented in Fig. 13.The spectra themselves were not part of the training data set.The results show the median estimate of the Raman spectrum obtained from the trained Bayesian neural network along with the 90% confidence intervals of the Raman spectrum estimate.We overlay the Raman spectrum estimate with a scaled versions of the point estimates in Fig. 9.The point estimates are scaled such that the minima and maxima of the point estimate are equal to the minima and maxima of the median estimate of the Raman spectrum.
The results coincide with the overall shape of the point estimates, supporting the validity of the data generation approach and the Bayesian neural network design.
As additional validation for the synthetic spectrum generation approach, we compare the cost function values, see Eq. ( 6), of the fully synthetic training spectra to the cost function values obtained for partially experimental spectra.We generate the partially experimental spectra by taking the point estimates of the experimental CARS spectra in Figure 9 and generating sets of CARS spectra with the forward model defined in Eq. ( 20) combined with the GP realizations.The results are in agreement which implies that our log-Gaussian gamma process is capable of generating valid Raman spectra for training neural networks.This approach is similar to approaches used for approximate Bayesian computation, see for example 60,61 .The resulting log cost function distribution of the synthetic spectra and the partially experimental spectra are provided in the Electronic Supplementary Information.

Conclusions
We propose a novel approach utilizing log-Gaussian gamma processes and Gaussian processes to generate synthetic spectra and additive or multiplicative backgrounds that are statistically similar to experimental measurements, even when using a limited number of experimental spectra.The parameters of these stochastic processes are learned through Markov chain Monte Carlo methods, enabling the generation of extensive training data for neural networks by sampling from Bayesian posterior distributions of the parameters.
This data generation method is applied to train two Bayesian neural networks, specifically designed for correcting spectral measurements.One network is tailored for Raman spectra with additive backgrounds, while the other is optimized for coherent anti-Stokes Raman scattering (CARS) spectra with multiplicative backgrounds.Bayesian neural networks expand upon prior re-    search involving neural networks for spectral corrections, offering not only point estimates but also the critical capability of uncertainty quantification.
Our approach is validated using synthetic test data generated from the stochastic processes and experimental Raman spectra of phthalocyanine blue, aniline black, naphthol red, and red 264 pigments, along with experimental CARS spectra of adenosine phosphate, fructose, glucose, and sucrose.The results demonstrate excellent agreement with deterministically obtained point estimates of the Raman spectra, while simultaneously providing valuable uncertainty estimates for the Raman spectrum estimates.
As a future avenue of research, our log-Gaussian gamma process formulation could be extended to a mixture of log-Gaussian gamma processes, similarly to mixtures of Gaussian processes [62][63][64] .Such an extension would allow modelling of nonstationarity and heteroscedasticity, meaning different signal or noise behaviour at different parts of measurement spectrum.A more straight-forward modification, if necessary, would be to include an additional noise term consisting of, for example, Gaussian white noise process to the log-Gaussian gamma process formulation.
In addition, log-Gaussian gamma processes might be used to model other inherently positive measurements such as reflectance, absorbance, fluorescence, or transmittance spectra [65][66][67] and other non-spectroscopic data sets like pollutant or protein concentrations or masses of stellar objects, for which Gaussian processes have been used [68][69][70] Modifications to the log-Gaussian gamma process and the Bayesian neural network should be minimal due to the uninformative priors and general purpose structure of them.The generation of synthetic data sets for other types of problems requires an appropriate forward model.If the forward model has non-local behaviour, it might warrant architectural changes to the Bayesian neural network such as augmenting the first layer with a dense layer for modelling the non-local dependencies in the data.
A comparison study similar to 35 would be an interesting avenue of future research.However, a direct comparison between non-Bayesian and Bayesian neural networks is not straight-forward due to the missing uncertainty quantification of the non-Bayesian neural network estimates.One could possibly use the Dropout regularization as an approximate Bayesian approach 71 .This could be combined with simulation-based calibration 72 to provide a appropriate one-to-one comparison between the non-Bayesian and Bayesian neural networks.

Fig. 3
Fig.3Example realizations drawn from the log-Gaussian gamma process model defined in Eq.(10).On the left, realizations for the scale process β (ν ν ν), drawn from a log-Gaussian process.On the right, corresponding realizations from the gamma process.All realizations are normalized and multiplied by a sampled amplitude.
r n a l N a me , [ y e a r ] , [ v o l .] ,

Fig. 4
Fig. 4 Example realizations drawn from the background model defined in Eq. (18) for a multiplicative background.The starting and end points are sampled from a prior distribution and the GP predictive mean and covariance are used to sample the background shape.

Fig. 5
Fig.5Example realizations for the Raman spectrum model defined in Eq.(19).The realizations correspond to the log-Gaussian gamma process realizations in Fig.3.
r n a l N a me , [ y e a r ] , [ v o l .] ,

Fig. 8
Fig. 8 On the left, experimental Raman spectra of phthalocyanine blue, naphthol red, aniline black, and red 264 pigments in blue and point estimates for their respective additive backgrounds B(ν ν ν).On the right, point estimates for the underlying Raman spectra corresponding to the Raman measurements on their left.The 4 cases are used to estimate the LGGP and GP parameters defined in the posterior distributions in Eqs.(10) and (18).

Fig. 9
Fig. 9 On the left, experimental CARS spectra of adenosine phosphate, fructose, glucose, and sucrose in blue and point estimates for their respective multiplicative backgrounds ε m (ν ν ν).On the right, point estimates for the underlying Raman spectra corresponding to the CARS measurements on their left.The 4 cases are used to estimate the LGGP and GP parameters defined in the posterior distributions in Eqs.(10) and (18).

Fig. 10
Fig.10On the left, synthetic Raman test spectra generated using Eq.(19).On the right, corresponding Raman spectrum estimates with the median estimate shown in solid blue and the 90% confidence interval in shaded blue.The solid black line shows the ground truth spectrum.

Fig. 11
Fig. 11 On the left, experimental Raman spectra of phthalocyanine blue, aniline black, naphthol red, and red 264 pigments.On the right, corresponding Raman spectrum estimates with the median estimate shown in solid blue and the 90% confidence interval in shaded blue.The solid black line shows the ground truth spectrum.

Fig. 12
Fig.12On the left, synthetic CARS test spectra generated using Eq.(20).On the right, corresponding Raman spectrum estimates with the median estimate shown in solid blue and the 90% confidence interval in shaded blue.The solid black line shows the ground truth spectrum.

Fig. 13
Fig. 13 On the left, experimental CARS spectra of adenosine phosphate, fructose, glucose, and sucrose.On the right, corresponding Raman spectrum estimates with the median estimate shown in solid blue and the 90% confidence interval in shaded blue.The solid black line shows the ground truth spectrum.