## Materials and Methods
### PLS-DA Method and Classification Metrics  
The interference and overlapping of the spectra information may be solved by using PLS regression, which finds a linear regression model by projecting the predicted variables and the observable variables to a new space. It will try to find the multidimensional direction in the \(\mathbf{X}\) space that explains the maximum variance direction in the \(Y\) space. If the dependent variable does not assume continuous values as in quantitative analysis but discrete ones (for example, 0 for the negative class or 1 for positive class), then it gives rise to the PLS-DA method.  
In the case of single-response \(\mathbf{y}\) and \(p\) predictors, a PLS regression model with \(n\) latent variables (LVs) can be expressed as follows:  
\[\mathbf{X}\ =\ \mathbf{T}\mathbf{P}^{\mathrm{T}}+\mathbf{E} \tag{4}\]  
\[\mathbf{y}\ =\ \mathbf{T}\mathbf{b}\ +\mathbf{f} \tag{5}\]  
where \(\mathbf{b}\) explains the relationship between \(\mathbf{y}\) and \(\mathbf{T},\mathbf{f}\) stands for random errors of \(\mathbf{y}\), and a weight matrix \(\mathbf{W}\left(\mathbf{y}\times\mathbf{n}\right)\) is obtained to make the Euclidean norm of \(\mathbf{f}\) as small as possible. The variable importancein projection (VIP) scores estimate the importance of each variable in a PLS model, and for the jth variable, it can be calculated as:  
\[\textbf{{VIP}}_{j}=\sqrt{\frac{p\sum_{k=1}^{n}b_{k}^{2}k^{\intercal}_{k}t_{k}{( \boldsymbol{w}_{jk}/\left\|\boldsymbol{w}_{k}\right\|)}^{2}}{\sum_{k=1}^{n}b_{k }^{2}t_{k}^{\intercal}t_{k}}} \tag{6}\]  
and because the average of the squared VIP scores equals one, the thumb rule of \"greater than one\" is generally used as a criterion for variable selection [32].  
The confusion matrix is often used to evaluate the performance of binary classification models. For example, if the MS4 class (with a y value of 1) was identified as positive, the corresponding MS5 class (with y values of 0) were identified as negative. The true positive (TP) is the number of MS4 samples correctly classified as MS4, and the true negative (TN) is the number of MS5 samples correctly assigned as MS5. The false negative (FN) is the number of MS4 samples incorrectly classified as MS5, and the false positive (FP) is the number of MS5 samples incorrectly assigned as MS4. TP and TN lie within the main diagonal of the confusion matrix. The classification accuracy rate (Acc) is calculated as:  
\[\text{Acc}=\frac{\text{TP}+\text{TN}}{\text{TP}+\text{TN}+\text{FP}+\text{ FN}}. \tag{7}\]  
[PERSON]'s kappa is an alternative measure that can be used to determine the accuracy rate for multiclass problems. This measure compensates for random hits and possesses the advantages of being both useful and simple for measuring classifier's observations with respect to the degree of agreement of multiclass classification problems. It is more convenient to calculate [PERSON]'s kappa in terms that are based on counts rather than probabilities [33]. For an m-class problem,  
\[\text{Kappa}=\frac{N\sum_{i=1}^{m}C_{ii}-\sum_{i=1}^{m}C_{i}\,C_{i}}{N^{2}- \sum_{i=1}^{m}C_{i}\,C_{i}} \tag{8}\]  
where \(N\) is the number of test samples, \(C_{ii}\) is the number of TPs for each class in the main diagonal, \(C_{i}\) is the sum of counts in the \(i\)th column, and \(C_{i}\) is the sum of counts in the \(i\)th row.  
The calculated value of [PERSON]'s kappa ranges from \(-1\) (total disagreement) through 0 (random classification) to 1 (complete agreement). The closer the kappa value is to 1, the better the performance of the hierarchical classification scheme.