## 3 Materials and Methods
### Feature Selection
#### 3.2.2 HOS Features  
The second set of features, HOS, contains textural features based on the gray-level co-occurrence matrix (GLCM) obtained from a 2D gray image [39]. The GLCM helps extract relevant textural features from an image by tracking the spatial distribution of pixels inside the region of interest (ROI) of the gray image. It is prevalent in medical image analysis and pattern recognition [40]. Consider a retinal 2D gray image, \(\widetilde{I}\), with \(L\) gray levels and of size \(H\times W\) pixels. We could characterize the textural information in terms of the frequent occurrence of the intensity of a reference pixel value, \(i\), to its adjacent neighbor pixel value, \(j\), with a predefined distance \(d\) and orientation \(\theta\). To quantify this image, the concept behind Haralick feature extraction [39] is to map it from the range \([\alpha,\beta]\), as a bit depth, into the range \([1,N_{g}]\), which holds the solicited number \(N_{g}\) of the gray level. The map quantization function, \(\psi\), is defined as  
\[\psi:[\alpha,\beta]^{H\times W}\longrightarrow[1,N_{g}]^{H\times W}. \tag{5}\]  
Then,the quantized image, \(I\), is given by  
\[I=\psi(\widetilde{I}). \tag{6}\]The non-normalized GLCM matrix is denoted by \(\mathbf{P}\), and its elements are obtained from the quantized image, \(\mathbf{I}\), through counting the number of times every pair of adjacent gray-level pixels occurs as a neighbor in the image \(\mathbf{I}\), or in an arbitrary area thereof. The neighborhood relation between pixels in terms of displacement between any two adjacent pixels can be defined by a displacement vector, \(\mathbf{\
u}=(d_{x},d_{y})\), in the \(x\) and \(y\) directions, with \(d_{x},d_{y}\in\mathbb{Z}\) representing the displacement in the \(x\) and \(y\) directions in terms of pixels with distance \(d\). In the present work, \(d=1\). Each entry, \(p(i,j)\), in \(\mathbf{P}\) is given by  
\[p(i,j)=\sum_{h=1}^{H}\sum_{w=1}^{W}\left\{ \begin{array}{ll}1,&\text{if }i=\mathbf{I}(h,w)\;\;\text{and}\;\;j=\mathbf{I}(h+d_{x},w+d_{y})\\ 0,&\text{otherwise}\end{array} \right.,\]  
The entry \(p(i,j)\) tallies how many times gray values of the two nearby pixels occur in \(\mathbf{I}\), with \(i,j\in[1,N_{S}]\). According to the pioneering work of [PERSON], eight displacement vectors can be used on 2D fundus retinal images to establish the direction within two adjacent pixels, as shown in Figure 4.  
The eight displacement vectors described above are used in this work to conduct all possible relationships for the adjacent pixels in the eight directions in \(\mathbf{I}\). Therefore, in this work, there are eight GLCMs for each \(\mathbf{I}\). Once \(\mathbf{P}\) is constructed based on a particular direction vector, then it is normalized, yielding the normalized GLCM:  
\[\mathbf{\bar{P}}= \begin{pmatrix}\bar{p}(1,1)&\bar{p}(1,2)&\cdots&\bar{p}(1,N_{ S})\\ \bar{p}(2,1)&\bar{p}(2,2)&\cdots&\bar{p}(2,N_{S})\\ \vdots&\vdots&\ddots&\vdots\\ \bar{p}(N_{g},1)&\bar{p}(N_{g},2)&\cdots&\bar{p}(N_{g},N_{g})\end{pmatrix} ,\]  
where  
\[\bar{p}(i,j)=\frac{p(i,j)}{\sum_{i=1}^{N}\sum_{j=1}^{N}p(i,j)}\]  
is the probability mass function for the gray level of adjacent pixels in \(\mathbf{I}\). So, the normalized matrix, \(\mathbf{\bar{P}}\), contains information about the retinal image pixels that have similar gray-level values, which is used later to compute the textural features for each of the eight displacement vectors per gray image. The 14 textural features of an image are obtained from the \(\mathbf{\bar{P}}\) matrix, noting that \(N_{g}\) is the number of gray levels in the quantized image [41]. 1. The angular second moment (ASM), \(f_{1}\), feature is a measure of the consistency of textural information in an image. A consistent image is characterized by very few dominant gray level transitions between its pixels, and its related \(\mathbf{\bar{P}}\) matrix contains fewer entries of large magnitude. The more homogeneity in the image, the larger the value of ASM, with the range of this value being \([0,1]\).