# Classification of Hyperspectral In Vivo Brain Tissue Based on Linear Unmixing
## 3 Materials and Methods
### Extended Blind End-Member and Abundance Extraction  
The methodology called extended blind end-member and abundance extraction (EBEAE), proposed in [26], allows estimating end-members and their abundances by a linear mixing model in non-negative datasets. In addition, the BLU process by EBEAE is controlled by hyperparameters that adjust the resulting similarity among end-members and the entropy of the abundances.  
In the EBEAE formulation, there are \(\hat{K}\) non-negative and normalized (sum-to-one) pixels assumed for a certain class in the HS image. The spectral information in these pixels is expressed as an \(L\)-dimensional vector \(\mathbf{y}_{k}\in\mathbb{R}^{L}\) with \(k\in\{1,\ldots,\hat{K}\}\). The set of labeled pixels is denoted as \(\mathcal{Y}~{}=~{}\{\mathbf{y}_{1},...,\mathbf{y}_{\hat{K}}\}\), and since the spatial information in the HS image is not relevant for the BLU process, the ordering in \(\mathcal{Y}\) is indistinct. Each pixel is represented by a linear mixing model of order \(N\) (\(2\leq N<L\)):  
\[\mathbf{y}_{k}=\sum_{n=1}^{N}\alpha_{k,n}\mathbf{p}_{n}+\eta_{k}=\underbrace{ \begin{bmatrix}\mathbf{p}_{1}&\cdots&\mathbf{p}_{N}\\ \mathbf{p}\in\mathbb{R}^{L\times N}\end{bmatrix}}_{\mathbf{P}\in\mathbb{R}^{L \times N}}\underbrace{\begin{bmatrix}\alpha_{k,1}\\ \vdots\\ \alpha_{k,N}\end{bmatrix}}_{\mathbf{\alpha}_{k}\in\mathbb{R}^{N}}+\eta_{k} \qquad\forall k\in\{1,\ldots,\hat{K}\}, \tag{2}\]  
where \(\mathbf{p}_{n}\in\mathbb{R}^{L}\) is the \(n\)-th end-member, \(\alpha_{k,n}\geq 0\) its abundance in the \(k\)-th pixel, and \(\eta_{k}\in\mathbb{R}^{L}\) represents a noise or uncertainty vector (\(\eta_{k}\sim\mathcal{N}(0)\)). The EBEAE synthesis problem is defined as the following constrained optimization process:  
\[\min_{\{\mathbf{\alpha}_{k}\},\mathbf{P}}J(\{\mathbf{\alpha}_{k}\},\mathbf{P}), \tag{3}\]  
where:  
\[J(\{\mathbf{\alpha}_{k}\},\mathbf{P})=\frac{1}{2\hat{K}}\sum_{k=1}^{\hat{K}} \frac{||\mathbf{y}_{k}-\mathbf{p}\mathbf{\alpha}_{k}||^{2}}{||\mathbf{y}_{k}|| ^{2}}-\frac{\mu\lambda_{min}(\mathbf{P}^{\top}\mathbf{P})}{2\hat{K}}\sum_{k=1 }^{\hat{K}}||\mathbf{\alpha}_{k}||^{2}+\frac{\rho}{2\hat{\sigma}}\sum_{n=1}^{ N-1}\sum_{j=n+1}^{N}||\mathbf{p}_{n}-\mathbf{p}_{j}||^{2}, \tag{4}\]  
\(\lambda_{min}(.)\) represents the minimum eigenvalue of the argument matrix, \(\mu\in[0,1)\) (entropy weight) and \(\rho\geq 0\) (similarity weight) are hyperparameters, and:  
\[\vartheta=\begin{cases}(N-1)+\cdots+1&N\geq 3,\\ 1&N=2,\end{cases} \tag{5}\]  
with restrictions \(\mathbf{1}_{N}^{\top}\mathbf{\alpha}_{k}=1\), \(\mathbf{1}_{L}^{\top}\mathbf{p}_{n}=1\), and \(\mathbf{\alpha}_{k}\), \(\mathbf{p}_{n}\geq 0\). Hence, the hyperparameters in EBEAE are defined as \((N,\mu,\rho)\). To solve the optimization problem, an alternated least squares approach was used [34] to overcome the non-linear dependence of end-members \(\{\mathbf{p}_{n}\}_{n=1}^{N}\) and abundances \(\{\mathbf{\alpha}_{k}\}_{k=1}^{\hat{K}}\) in (4), until a convergence condition was met or a maximum number of iterations was exceeded [26]. In this formulation, the end-members \(\{\mathbf{p}_{n}\}_{n=1}^{N}\) identify \(N\) characteristic or representative components to reproduce all the pixels in \(\mathcal{Y}\).