## 2 Materials and Methods
### Anomaly Detection Algorithm Based on Cooperative Representation  
Similar to the anomaly detection based on sparse representation, the background was reconstructed through the background dictionary for the anomaly detection algorithm based on cooperative representation. Then, the error was determined between the reconstruction and the original image. The anomaly detection method based on cooperative representation considers that the local background in the hyperspectral image has certain similarities. Thus, the background can be approximately replaced by the surrounding background components. By introducing the double-window structure (Figure 4), the pixels between the two windows are formed into the background dictionary to reconstruct the central image. The size of the inner window is \(W_{\text{in}}\) and the size of the outer window is \(W_{\text{out}}\). The number of pixels between  
Figure 1: Beach_Plane experimental dataset. Pseudo-color image (**a**). Graph of true anomaly objects (**b**). Figure 3: Road_Vehicle experimental dataset. Pseudo-color image (**a**). Graph of true anomaly objects (**b**). Figure 2: Saliens_Synthetic experimental dataset. Pseudo-color image (**a**). Graph of true anomaly objects (**b**). the inner and outer windows is \(\text{num\_b}=W_{\text{out}}\times W_{\text{out}}-W_{\text{in}}\times W_{\text{in}}\). It is assumed that the pixels between the inner and outer windows belong to the background pixels, which construct the background dictionary \(\mathbf{A}^{b}\). The corresponding weight coefficient of the dictionary is \(x\), and the central pixel based on the dictionary \(\mathbf{A}^{b}\) can be expressed as \(\mathbf{A}^{b}x\). The reconstruction error can be defined as Equation (1). \[\mathbf{E}(\mathbf{y})=\left\|\mathbf{y}-\mathbf{A}^{b}\mathbf{x}\right\|_{2} \tag{1}\]  
where \(E(y)\) is the error between the central pixel and the approximate value based on the dictionary representation. When the error is less than the threshold value, it is regarded that the central point to be measured is the background. Otherwise, it is the abnormal object. For the cooperation-based anomaly detection method, the key problem to be solved is to find the optimal weight coefficient \(x\), which can minimize the error \(E(y)\) under the constraint of the \(\left\|\mathbf{x}\right\|_{2}\) minimum. The mathematical description is Equation (2):  
\[\underset{\mathbf{x}}{\text{argmin}}\,\left\|\mathbf{y}-\mathbf{A}^{b}\mathbf{x}\right\|_ {2}^{2}+\lambda\left\|\mathbf{x}\right\|_{2}^{2} \tag{2}\]  
where \(\lambda\) is the Lagrange multiplier. Furthermore, the equation can be expressed in Equation (3). \[\underset{\mathbf{x}}{\text{argmin}}\,\left[\mathbf{x}^{T}\bigg{(}\left(\mathbf{A}^{ b}\right)^{T}\mathbf{A}^{b}+\lambda\mathbf{I}\bigg{)}\mathbf{x}-2\mathbf{x}^{T}\left( \mathbf{A}^{b}\right)^{T}\mathbf{y}\right] \tag{3}\]  
Take the derivative of the weight coefficient \(x\) and make the derivative 0. Then, \(x\) can be expressed in Equation (4). \[\mathbf{x}=\bigg{(}\left(\mathbf{A}^{b}\right)^{T}\mathbf{A}^{b}+\lambda\mathbf{I} \bigg{)}\left(\mathbf{A}^{b}\right)^{T}\mathbf{y} \tag{4}\]  
where I expresses the identity matrix. When reconstructing the central pixel, it is considered that the weight coefficients can be different for various atoms of the background dictionary, to approach the central point value to be measured as close as possible. When the atoms in the dictionary are close to the point to be measured, a large weight coefficient is hoped. Otherwise, a small coefficient should be given. Thus, the dictionary is expressed in Equation (5). \[\Gamma_{y}= \begin{bmatrix}\left\|\mathbf{y}-\mathbf{a}_{1}\right\|_{2}&&0\\ &\ddots&\\ 0&&\left\|\mathbf{y}-\mathbf{a}_{num\_b}\right\|_{2}\end{bmatrix}  \tag{5}\]  
where \(\text{a}_{1}\), \(\text{a}_{2}\),..., \(\text{a}_{num\_b}\) are the column vectors of the dictionary \(\mathbf{A}^{b}\), \(\left\|\mathbf{y}-\mathbf{a}_{i}\right\|_{2}\) is the Euclidean distance between the point to be measured and the dictionary atom.