# Comparison of Machine Learning Methods in Stochastic Skin Optical Model Inversion
## 2 Materials and Methods  
### Data  
#### 2.1.1 Stochastic Model  
The training data for the machine learning methods was produced by a stochastic model for light propagation in the skin (SM). The SM was adapted from the stochastic model for leaf optical properties [6] by using skin specific parameters [18]. SM is the Markov chain based model for light propagation. The light propagation can be expressed as a network of transitions and states (Figure 1), in which there is a physically meaningful probability of transfer from one state to another. The probabilities are based on the chromophore concentrations and absorption and scattering properties of the skin. SM is used in the same way and with the same parameters as in [5]. In this research, the first two main skin layers, epidermis and dermis, were considered. Light through dermis was considered absorbed. From the first state, illumination, the light either goes into the skin (\(P=0.98\)) or is reflected (\(P=0.02\)). In the epidermis and dermis layers, the transition probabilities are based on [PERSON]'s law and calculated as follows [6]:  
\[P_{\text{absorption}}(\lambda) = \begin{cases}1\quad\text{if the current state is absorbed,}\\ \frac{a(\lambda)}{a(\lambda)+s(\lambda)}\cdot(1-e^{-(a(\lambda)+s(\lambda)) \cdot L})\quad\text{otherwise,}\end{cases}  \tag{1}\] \[P_{\text{scattering}}(\lambda) = \begin{cases}0\quad\text{if the current state is absorbed,}\\ \frac{s(\lambda)}{a(\lambda)+s(\lambda)}\cdot(1-e^{-(a(\lambda)+s(\lambda)) \cdot L})\quad\text{otherwise,}\end{cases} \] (2) \[P_{\text{up/down}}(\lambda) = \begin{cases}1-P_{\text{absorption}}-P_{\text{scattering}}\quad \text{if the current state is up or down,}\\ \frac{1-P_{\text{absorption}}-P_{\text{scattering}}}{2}\quad\text{if state is scattered,}\\ 0\quad\text{if state is absorbed.}\end{cases}  \tag{3}\]  
In the previous equations, \(\lambda\) is the wavelength in nanometers, \(a(\lambda)\) is the absorption coefficient [18], and \(s(\lambda)\) is the reduced scattering coefficient [18] and L is the length of the light path, which is assumed to be the same as the thickness of the layer [18]. Figure 1: Network of states and transitions of light propagation in the Stochastic Model. \[a(\lambda) =\sum_{n}a_{i}(\lambda)c_{i}\text{, and} \tag{4}\] \[s(\lambda) =s(500\,\text{nm})\cdot f_{\text{Ray}}\left(\frac{\lambda}{500\, \text{nm}}\right)^{-4}+(1-f_{\text{Ray}})\left(\frac{\lambda}{500\,\text{nm}} \right)^{-b_{\text{Mie}}} \tag{5}\]  
In Equations (4) and (5), \(a_{i}\) are the skin chromophore absorption coefficients and \(c_{i}\) their concentrations, \(s(500\,\text{nm})\) the reduced scattering coefficient at \(500\,\text{nm}\), \(f_{Ray}\) fraction of the Rayleigh scattering and \(b_{Mie}\) the Mie scattering power. The chromophores used in the study are melanin, deoxygenated and oxygenated hemoglobin and water. Their absorption coefficients are from [18], and the concentrations are in fractions of the volume they take. The deoxygenated and oxygenated hemoglobin volume fractions are calculated from blood oxygen fraction (S) and hemoglobin volume fraction (\(c_{\text{HGb}}\)) as follows [18]:  
\[c_{\text{HGb, deoxy}} =c_{\text{HGb}}(1-S) \tag{6}\] \[c_{\text{HGb, oxy}} =c_{\text{HGb}}S \tag{7}\]  
The input parameters used in SM are described in Table 1. Example spectra produced by the stochastic model are in Figure 2.  
For machine learning algorithm training, the hyperspectral data simulated with SM are normalized. The prediction target parameters, melanosome, and hemoglobin volume fractions,