## 2 Theoretical Background  
According to the linear mixture model definition, each pixel vector in the original map can be modeled using the following expression:  
\[X(i,j)=\sum_{z=1}^{P}\Phi_{z}(i,j)\cdot E_{z}+n(i,j) \tag{1}\]  
where \(X(i,j)\) represent the pixel vector at discrete coordinates \((i,j)\), \(E_{z}\) denotes the spectral signatures of the endmembers, \(\Phi_{z}(i,j)\) is a scalar value indicating the fractional abundance of the endmember \(z\) in the pixel vector, and \(n(i,j)\) is a noise vector. When dealing with linear mixing models, it is possible to define two physical constraints, i.e., the sum-to-one constraint:  
\[\sum_{z=1}^{P}\Phi_{z}(i,j)=1 \tag{2}\]  
and the non-negativity constraint:  
\[\Phi_{z}(i,j)\geq 0 \tag{3}\]  
To find the optimal solution of the fully constrained linear spectral mixture problem, the following requirements are to be satisfied:  
* Identification of the correct number of the endmembers
* Determination of a set of endmembers and their corresponding abundances fractions at each pixel. Effective solutions have been proposed so far to deal with the first requirement [15]. However, the second requirement can be addressed in two steps: endmember extraction and abundance estimation. In the last decades, several algorithms have been developed for the extraction of spectral endmembers, such as the pixel purity index (PPI) [16], N-FINDR, and vertex component analysis (VCA) [17; 18]. Once identified the endmembers, the abundance estimation consists of solving a constrained optimization problem, minimizing the residual between the observed spectral vectors and the linear space spanned by the inferred spectral signatures, under the constraints of non-negativity and/or the sum to one. In general, linear mixing dominates macroscopic interactions, when the incident light interacts with only one material before reaching the sensor. In the case of Raman spectroscopy, the light is scattered by multiple materials and the interactions consist of photons emitted by molecules of one material that are absorbed by molecules of another material, which may in turn emits more photons. Assuming then a nonlinear mixture model, in Raman spectroscopy maps, each pixel vector can be modeled as  
\[X(i,j)=f(E_{z},\Phi_{z}(i,j))+n(i,j) \tag{4}\]  
where f is an unknown nonlinear function that defines the interaction between \(E_{z}\) and \(\Phi_{z}(i,j)\). Deriving a physically based approach to nonlinear unmixing is an extremely complex task that requires identifying parameters describing all the possible interactions between light and materials that are very hard or impossible to obtain. To avoid complex physical models, neural networks are generally considered, thanks to their ability to approximate complex functions and the high potential in decomposing nonlinear mixed pixels [12]. Following a classical supervised approach, to train an effective neural network, it is important to know how many endmembers are present in the data and their spectral signature to design an optimal unmixing function f. However, in many practical cases, it is not possible to know in advance this information, thus the unmixing function may result incomplete. Whether linear or nonlinear, the general framework of spectral unmixing can be summarized in dimensionality reduction, endmember identification, and abundance estimation, as depicted in Figure 1.  
The dimensionality reduction is an optional processing step and its application depends on the dimension of the original data. However, in the case of Raman images, characterized by thousands of highly correlated bands, the use of a dimensionality reduction approach can be beneficial, improving computation time, complexity, and performances of the whole unmixing process [19]. Many dimensionality approaches have been proposed in the literature, from feature selection to feature extraction. A comparative analysis of the effectiveness of different methods can be found in reference [20].