## 2 Materials and Methods
### Feature Extraction of Spore Images
#### [PERSON] et al. [22] studied various statistical features in the GLCM and obtained four critical features through experiments--namely the contrast, asm (Angular Second Moment), entropy, and correlation features. The GLCM should be normalized before calculation. The calculation equations are shown in Equations (6)-(10):  
\[P_{\varphi,d}(i,j)=\frac{G_{GLCM}(i,j)}{\sum\limits_{i=0}^{N-1}\sum\limits_{j= 0}^{N-1}G_{GLCM}(i,j)} \tag{6}\]  
\[\textit{Contrast}=\sum\limits_{i=0}^{N-1}\sum\limits_{j=0}^{N-1}\left|i-j\right| ^{2}P_{\varphi,d}(i,j) \tag{7}\]  
\[\textit{Asm}=\sum\limits_{i=0}^{N-1}\sum\limits_{j=0}^{N-1}P_{\varphi,d}^{2}( i,j) \tag{8}\]  
\[\textit{Entropy}=-\sum\limits_{i=0}^{N-1}\sum\limits_{j=0}^{N-1}P_{\varphi,d} (i,j)\log_{2}P_{\varphi,d}(i,j) \tag{9}\]  
\[\textit{Correlation}=\frac{\sum\limits_{i=0}^{N-1}\sum\limits_{j=0}^{N-1} \left[(i,j)P_{\varphi,d}(i,j)-\mu_{x}\mu_{y}\right]}{\sigma_{x}\sigma_{y}} \tag{10}\]  
In the equation:  
\[\mu_{x}=\sum\limits_{i=0}^{N-1}i\sum\limits_{j=0}^{N-1}P_{\varphi,d}(i,j) \tag{11}\]  
\[\mu_{y}=\sum\limits_{j=0}^{N-1}j\sum\limits_{i=0}^{N-1}P_{\varphi,d}(i,j) \tag{12}\]  
\[\sigma_{x}^{2}=\sum\limits_{i=0}^{N-1}(i-\mu_{x})^{2}\sum\limits_{j=0}^{N-1}P_ {\varphi,d}(i,j) \tag{13}\]  
\[\sigma_{y}^{2}=\sum\limits_{j=0}^{N-1}\left(i-\mu_{y}\right)^{2}\sum\limits_{i =0}^{N-1}P_{\varphi,d}(i,j) \tag{14}\]  
In the experiment, the preprocessed images were converted into 16 gray levels and then four key features of GLCM in 4 directions (\(0^{\circ}\), \(45^{\circ}\), \(90^{\circ}\), and \(135^{\circ}\)) were calculated to obtain a total of 16 feature values.  
LBP  
The LBP texture feature description method has the advantages of having simple principles, a small calculation amount, grayscale invariance, and rotation invariance [23]. It uses the difference between the gray value of the center pixel and the adjacent pixel to generate the LBP code. The basic symbols related to LBP were defined as follows: \(g_{c}\) represents the gray value of the center point of the local area, \(g_{p}\) (\(p\) = 0, 1,..., 7) corresponds to the points distributed equally around the center point, and (\(x_{c}\), \(y_{c}\)) represents the center point coordinate. The LBP local area texture calculation equation centered on (\(x_{c}\), \(y_{c}\)) is shown in Equations (15) and (16):  
\[s\Big{(}g_{p}-g_{c}\Big{)}=\left\{\begin{array}{ll}1&g_{p}-g_{c}\geq 0\\ 0&g_{p}-g_{c}<0\end{array}\right. \tag{15}\]  
\[LBP(x_{c},y_{c})=\sum_{p=0}^{7}s\Big{(}g_{p}-g_{c}\Big{)}2^{p} \tag{16}\]  
An LBP operator with 8 points in the neighborhood will generate \(2^{8}\) kinds of LBP values. The number of sampling points in the neighborhood determines the dimension of texture features. To solve the problem of having too many binary modes and to improve the statistics, [PERSON] et al. [24] proposed the \"equivalent mode\" to reduce the dimensions of the mode types of LBP operators. The adjacent element changes from 0 to 1 or 1 to 0 were regarded as transitions. Transition values that do not exceed two during the calculation process are called LBP equivalent modes, of which there are a total of 58 different type, otherwise they are called mixed modes. In this study, this method was used to change the binary mode from the original 256 dimensions to 59 dimensions.