# Spatial Perception Correntropy Matrix for Hyperspectral Image Classification
## 2 Spatial Perception Correntropy Matrix
### Spatial Perception of Window  
In this paper, we propose a spatial perception method to select the neighbouring pixels for correntropy matrix construction. Let \(\mathbf{A}\in\mathbb{R}^{W\times H\times N}\) be an HSI, where \(W\), \(H\), and \(N\) are the width, height, and spectral bands, respectively. The pixel \(\mathbf{p}_{x,y}\) of \(\mathbf{A}\) can be defined as a spectral vector \(\mathbf{p}_{x,y}\in\mathbb{R}^{N}\). Figure 1 shows the definition of a window, where \((x,y)\) is the position of the pixel to be processed, and \((X,Y)\) is used to represent the centre of the side window. The region shown in Figure 2 can be defined as \(\mathbf{W}_{t}\in\mathbb{R}^{L\times L\times N}\)(with \(t=1,2,\ldots,9\)). The range is from \(X-r\) to \(X+r\) in the horizontal direction and from \(Y-r\) to \(Y+r\) in the vertical direction, so that all the pixels in the selected rectangular shape form a side window. \(r\) is the window radius, which is determined by the window width \(L\), that is, \(L=2r+1\). The choice of hyperparameters will be discussed in Section 4.2. Figure 1: Process of the SPCM method. Each pixel of HSI generates nine windows, and then the optimal one is selected. The red point is the pixel to be processed, and is collectively referred to as the target pixel in the following text. A correntropy matrix is constructed from all pixels in this optimal window. The input to the SPCM method is a single pixel and the output is a correntropy matrix. Different windows are obtained by calculating the positions of the two coordinates, namely, changing \((X,Y)\). In this paper, a total of three hyperparameters are contained, which are represented by italics: \(L\) is the width of window; \(S\) is the first s pixel vectors involved in comparison when selecting the neighbouring pixels, and \(K\) is the first \(k\) pixels involved in the construction of correntropy matrix. In this paper, we chose nine different windows by changing the value of \((X,Y)\). Figure 3 shows nine different windows obtained by changing the value of \((X,Y)\). The window is set to square with a fixed length \(2r+1\). Thus, nine windows of a pixel being processed are taken as a candidate. Next, the average cosine distance between the pixel being processed and the adjacent pixels within each window can be obtained. Then the window with maximum cosine distance is selected as the optimal window. Finally, the first \(k\) most similar pixels of the selected window are used for the construction of the correntropy matrix. Figure 3: Let \(W_{t}(t=1,2,\ldots,9)\) be one of the windows, and the figure shows a total of nine windows. Different black centre pixels \((X,Y)\) are calculated based on the red target pixels, and then the window is determined by the centre pixels. The range of the window is horizontal reverse \(X-r\) to \(X+r\), vertical direction \(Y-r\) to \(Y+r\). (**a**) The target pixel is in the center of the window; (**b**) The target pixels are in the lower middle and upper middle of the window; (**c**) The target pixels are in the right middle and left middle of the window; (**d**) The target pixels are in the lower right corner, lower left corner, upper right corner, and upper left corner of the window respectively. Figure 2: Window definition for a single pixel. Specify \((x,y)\) as the coordinates of the target pixel (red point), and \((X,Y)\) as the centre coordinates of the side window. First, the coordinates of the centre pixel are calculated from the coordinates of the target pixels. The illustrated example is \((X,Y)=(x+r,y+r)\). The calculation formula of the centre position \((X,Y)\) coordinates of different side windows is different. Then, the shape of the side window is delineated by the central pixel, the horizontal range is from \(X-r\) to \(X+r\), and the vertical direction is from \(Y-r\) to \(Y+r\). This results in a rectangular side window. Let us define that the pixel in the window is \(\textbf{p}_{1}\) and the surrounding pixel is \(\textbf{p}_{i}\), \(i=2,3,\ldots,L^{2}\).