# Systematic Review of Anomaly Detection in Hyperspectral Remote Sensing Applications
## 5 Unstructured Background Models
### Reed-Xiaoli (RX) Algorithm  
The RX algorithm [34] can be considered as the reference in hyperspectral image processing for anomaly detection in remote sensing applications, and it has become the standard with which new anomaly detectors are compared [45; 46; 47; 48; 49]. The algorithm idea stemmed from the test developed for the detection of radar targets [50], as well as most of the detection theory in remote sensing that arose from the processing of radar data. RX is an adaptive constant false alarm rate (CFAR) hyperspectral anomaly detection algorithm developed from the GLRT [34]. CFAR algorithms exhibit the property that the probability of false alarm does not depend on any unknown parameter, and it is a highly desirable property in the design of anomaly detectors. It should be noticed that in (11) the covariance matrices for background and target class are assumed to be the same. This condition needs to be fulfilled in order to make the RX detector optimum in a Neyman-Pearson sense (5), i.e., to hold the CFAR property [38]. To date, many implementations of the RX algorithm have been proposed: global, local, and quasi-local. Although RX in its original form is a local algorithm, we will describe its global variant first as it is the simplest one. The local and quasi-local RX models will follow afterward. Hyperspectral pixels are considered as random spectral vectors that are IID. These pixels are then used for estimation of unknown parameters of the multivariate normal distribution: \(\underline{\mu}\) and \(\underline{\Gamma}\). Consider a hyperspectral cube with a total of \(N\) pixels, namely \(N\) random spectral vectors with \(K\) elements (\(K\) being the number of spectral bands). The global RX detector can be defined as [34]:  
\[D_{RX}(\underline{x}|\mathcal{B})=D_{RX}(\underline{x}|\underline{B})=\Big{(} \underline{x}-\underline{\hat{\mu}}\Big{)}^{T}\cdot\underline{\underline{ \Gamma}}^{-1}\cdot\Big{(}\underline{x}-\underline{\hat{\mu}}\Big{)} \begin{array} []{l}>\\ <\\ H_{0}\end{array} \lambda, \tag{12}\]where \(\mathcal{B}\) represents the theoretical background model, while MLEs \(\underline{\hat{\mu}}\) and \(\underline{\underline{\hat{\mathsf{f}}}}\) are determined as:  
\[\underline{\hat{\mu}}=\frac{1}{N}\sum_{i=1}^{N}\underline{x}_{i} \tag{13}\]  
Theoretical foundations for the local (and native) RX detector were set by [PERSON] and [PERSON] [51]. They suggested that an optical digital image can be modeled as a nonstationary multivariate Gaussian random process with a highly space-varying spatially nonstationary mean vector and spatially stationary or much less space-varying covariance matrix. The local RX detector uses the same mathematical methodology as the global RX, though it calculates the MLE of unknown parameters (13) using the selected pixels found in the PUT's spatial neighborhood (Figure 6). The local neighborhood is usually defined using one or more sliding windows (annulus). There are various strategies in selecting the number of windows and their sizes. If only one window is used, it presents an outer window used to estimate all unknown parameters. The most accepted strategy includes the use of three distinct windows: guard window and windows for estimation of \(\underline{\underline{\hat{\mathsf{f}}}}\) and \(\underline{\underline{\hat{\mathsf{f}}}}\) with their respective sizes (expressed in widths) \(w_{g}\), \(w_{\underline{\hat{\mu}}}\) and \(w_{\underline{\hat{\mathsf{f}}}}\) (Figure 6). The guard window is the smallest window, and it defines the area from which samples are not taken, as there is a possibility that it contains pixels that could be anomalies or pixels that are spectral mixtures with anomalies. Inclusion of these pixels in the calculation of \(\underline{\hat{\mu}}\) and \(\underline{\underline{\hat{\mathsf{f}}}}\) would lead to lower anomaly detection statistic scores and finally decrease the probability of detection. Therefore, its size should be set to accommodate for expected target sizes.