## 3 Technology Background
### Fun
An iterative process follows in which fixed-size artificial hyperspectral subimages are made up from the pool of resulting partial endmembers, and the FUN algorithm is used again to achieve dimensional reduction, up to the point where only one fixed-size artificial subimage remains, and the actual endmembers are obtained. In summary, the main idea of the proposed approach is to iteratively extract endmembers from the endmembers in the partial subimages until all the actual ones have been found. The pseudocode of the reduction-based FUN algorithm for endmember extraction can be seen in Algorithm 3. Notice that, when the same endmembers are extracted in two consecutive rounds (i.e., there is no dimensional reduction), the algorithm forces the generation of artificial subimage blocks with double the size while keeping the maximum number of endmembers that have to be extracted per block. This failsafe mechanism, which is meant to solve situations where the same endmembers are present in two or more data-independent subimages, ensures no deadlocks occur during the reduction process. Note also that, in any other situation and in order to avoid information loss, the maximum number of endmembers that can be extracted from each subimage block during the reduction process equals the number of pixels in that subimage. To better understand this, consider a scenario where all endmembers are present in one of the initial subimages: the algorithm needs to allow all these pixels to reach the final reduction round. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Endmember Extraction** & **Abundance Computation** \\ \hline
**Execution Time (ms)** & 1723.31 & 552.44 \\
**Execution Fraction (\%)** & 75.4 & 24.6 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: FUN-based hyperspectral image unmixing: application profiling (Zynq-700 ARM Cortex-A9 core @ 666.67 MHz). ```
1:Inputs:\(M=[m_{1}\ \ldots\ m_{\textit{pixels}}]\)\(\triangleright\) Input hyperspectral image \(P_{\max}\)\(\triangleright\) Maximum number of endmembers to extract \(\alpha\)\(\triangleright\) Stop factor \(\textit{pixels}_{\text{block}}\)\(\triangleright\) Number of pixels per parallel block Outputs:\(E=[e_{1}\ \ldots\ e_{P}]\)\(\triangleright\) Endmembers \(P\)\(\triangleright\) Number of endmembers
2:\(P\gets 0\)\([X_{1}\...\ X_{N}]\leftarrow\textsc{split}(M,\ \textit{pixels}_{\text{block}})\)\(\triangleright\) Divide input image in subimages
3:while\(N>1\)do\(\triangleright\) Repeat until there is only one subimage block remaining
4:\(E\leftarrow[]\)
5:for\(i\gets 1\)to\(N\)do
6:\(E_{\text{aux}}\leftarrow\textsc{endmembers}(X_{i},\ \textit{pixels}_{\text{block}},\ \alpha)\)\(\triangleright\) Extract endmembers from subimage
7:\(E\leftarrow[E\ E_{\text{aux}}]\)\(\triangleright\) Generate artificial image
8:endfor
9:\(P_{\text{aux}}\leftarrow\textsc{size}(E)\)
10:if\(P_{\text{aux}}=P\)then\(\triangleright\) Avoid deadlock (no dimensional reduction)
11:\([X_{1}\ \ldots\ X_{N}]\leftarrow\textsc{split}(E,\ 2\cdot\textit{pixels}_{\text{block}})\)\(\triangleright\) Divide artificial image in subimages
12:else
13:\([X_{1}\ \ldots\ X_{N}]\leftarrow\textsc{split}(E,\ \textit{pixels}_{\text{block}})\)\(\triangleright\) Divide artificial image in subimages
14:endif
15:\(P\leftarrow P_{\text{aux}}\)
16:endwhile
17:\(E\leftarrow\textsc{endmembers}(E,\ P_{\max},\ \alpha)\)\(\triangleright\) Extract actual endmembers
18:\(P\leftarrow\textsc{size}(E)\)\(\triangleright\) Get number of actual endmembers
```

**Algorithm 3** Reduction-based FUN algorithm: endmember extraction

The accuracy of the proposed algorithm has been evaluated in two scenarios: on the one hand, using synthetic hyperspectral images (256 bands, 128 lines, 128 samples) with different noise levels, number of endmembers, and abundance distributions (see Table 2); on the other hand, using well-known real hyperspectral datasets [44] (see Table 3).