## 2 Materials and Methods
### Data Analysis
#### 2.4.3 Selection Methods of Characteristic Wavelengths  
Hyperspectral data have the characteristics of multiple bands, large data volume, and large redundancy. These characteristics will impact the model's robustness, accuracy, and computational speed during subsequent modeling. Hence, it is crucial to extract the characteristic wavelengths with proper methods in the subsequent modeling analysis. In this study, random frog algorithm (RFA), uninformative variables elimination (UVE), and competitive adaptive reweighted sampling (CARS) were utilized to extract characteristic wavelengths.  
RFA is a characteristic wavelength selection algorithm based on the idea of reversible jump Markov chain Monte Carlo (RJMCMC) model dimension conversion technology and model population analysis (MPA) [21]. The specific steps are as follows: (1) constructing an initial variable set V which contains M random variables; (2) constructing a candidate variable subset V\({}_{1}\) which contains M\({}_{1}\) random variables according to the initial variable set; (3) identifying the set of acceptable candidate variables V\({}_{1}\) based on the probability of the root mean square error of cross-validation (RMSECV) such that V\({}_{1}\) = V, and iterating it N times; (4) calculating the selection probability of each variable, and the greater the selection probability is, the more important the variable is to the model.  
The purpose of UVE is to decrease the number of latent variables in the final model. It is a sort of algorithm based on the analysis of least partial square regression coefficients. The purpose is to  
Figure 2: Main steps of extracting spectral data, characteristic wavelength, and establishing discrimination model.  
get the least prediction error of the result by eliminating the variables of interference information and noise information [22], so characteristic wavelengths can be extracted. The steps are as follows: (1) performing PLS regression of the calibration set spectral matrix \(X(m\times n)\) and sample label matrix \(Y(m\times 1)\); (2) artificially generating normal distribution noise matrix \(R(m\times n)\) and further combining it with \(X\) to form a matrix \(XR(m\times 2n)\); (3) performing PLS regression on the matrix \(XR\) and \(Y\), the factor number of the model is selected by leave-one-out cross validation (LOOCV), thus acquiring a regression coefficient vector \(r\) each time and \(m\) PLS regression coefficients in total to form a matrix \(B(m\times 2n)\); (4) calculating the standard deviation \(S(r)\) and mean(r) of the matrix \(B(m\times 2n)\) by column, and then calculating the stable value \(Ci=mean(ri)/S(ri)\), \(I=1,2,\ldots,n\); (5) taking the maximum absolute value of \(C\) in the interval [n+1,2n] and removing the variables of \(Ci<Cmax\) that correspond to the matrix \(X\) in the interval [1,n].  
CARS is an effective method of data dimensionality reduction. First, Monte Carlo (MC) sampling is used to forcefully remove a part of the wavelength points. Then, select the wavelength points with large absolute values of regression coefficients by adaptive reweighted sampling (ARS) technique and delete the wavelength points with small weighting coefficients. Meanwhile, by utilizing cross-validation, the subset with the minimum RMSECV value is selected, so the smallest variable subset is the best subset [23]. The optimal combination of variables can be found out effectively, and the variable with a larger absolute regression coefficient can be selected in multiple Monte Carlo operations to achieve the purpose of variable dimensionality reduction.