## 2 Materials and Methods
### Textural Feature Extraction  
Texture is an important image feature, which represents the spatial arrangement of the grey levels of the pixels [33]. Extracted texture data from all spectral images will result in a redundancy dataset, which is not conducive to the subsequent analysis [34]. Therefore, a principle component analysis (PCA) was firstly carried out to select informative characteristic images that contained most of the variation among samples. In this study, only the first principle component (PC) score image (with 98.13% of variance) was used to calculate textural data. Four textural features, namely contrast, correlation, energy, and homogeneity, were extracted from ROIs using the gray level co-occurrence matrix (GLCM) analysis method. The GLCM provides a number of second-order statistics that can be used to describe the gray level relationships within a neighborhood around a certain pixel [35; 36; 37]. Generally, contrast measures local variations in the image, and higher values indicate larger partial variations [38]. Correlation is a measure of image linearity among pixels. Therefore, an image with large regions of similar intensities will have a high correlation value [36]. Energy expresses the uniformity of element intensity distribution, i.e., the repetition of pixel pairs. Finally, homogeneity is used to express the closeness of element distribution in the GLCM to its diagonal.  
There is no standard reference in the selection of distances and angles between pixels, for example, [PERSON] et al. [39] chose a distance of 1 pixel and a texture average of four angles (0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\)) in the classification of potato chips, [PERSON] et al. [38] calculated the abovementioned four features at distances from 1 to 10 pixels, which were then averaged for only one value at each angle (0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\)) for the detection of total viable count in pork, and [PERSON] et al. [37] used five distances from 1 to 5 pixels and four directions (0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\)) in the prediction of heme and non-heme iron content in pork sausages. Thus, five distances from 1 to 5 pixels and four directions (0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\)) were chosen in this research to calculate textural variables. The texture data resulting from five distances were averaged into one value in each direction (0\({}^{\circ}\), 45\({}^{\circ}\), 90\({}^{\circ}\), and 135\({}^{\circ}\)). Therefore, a total 16 textural variables (four angles of each textural feature) were obtained from the first PC score image. The textural feature values were calculated using MATLAB R2014b according to the following equations:  
\[\text{Contrast}=\sum_{n=0}^{N_{g}-1}n^{2}(\sum_{\text{i=1}}^{N_{g}}\sum_{\text {j=1}}^{N_{g}}p(\text{i,j})),~{}|\text{i-j}|=n \tag{2}\]\[\text{Homogenity}=\sum_{i=1}^{N_{g}}\sum_{j=1}^{N_{g}}\frac{p(i,j)}{1+\left(i-j \right)^{2}} \tag{3}\]  
\[\text{Energy}=\sum_{i=1}^{N_{g}}\sum_{j=1}^{N_{g}}p(i,j) \tag{4}\]  
\[\text{Correlation}=\sum_{i=1}^{N_{g}}\sum_{j=1}^{N_{g}}\frac{(ii)p(i,j)-\mu_{x }\mu_{y}}{\delta_{x}\delta_{y}} \tag{5}\]  
\[\mu_{x}=\sum_{i=1}^{N_{g}}i\sum_{j=1}^{N_{g}}p(i,j) \tag{6}\]  
\[\mu_{y}=\sum_{j=1}^{N_{g}}j\sum_{i=1}^{N_{g}}p(i,j) \tag{7}\]  
\[\delta_{x}=\sqrt{\sum_{i=1}^{N_{g}}(i-\mu_{x})^{2}\sum_{j=1}^{N_{g}}p(i,j)} \tag{8}\]  
\[\delta_{y}=\sqrt{\sum_{j=1}^{N_{g}}\left(j-\mu_{y}\right)^{2}\sum_{i=1}^{N_{g} }p(i,j)} \tag{9}\]  
where \(N_{g}\) is the number of gray levels in the quantized image, \(p(i,j)\) is the (i,j)-th entry in the normalized co-occurrence matrix (each entry in the co-occurrence matrix is divided by the total number of possible pairs), and \(\mu_{x}\), \(\mu_{y}\), \(\delta_{x}\), and \(\delta_{y}\) are the means and standard deviations of the sums of rows and columns, respectively, in the normalized co-occurrence matrix [40].