## 2 Materials and Methods
### Spectral Data Extraction and Pre-Processing  
After image acquisition and calibration, a square region with a side length of 170 pixels located at the image center area without specular reflection was selected as a region of interest (ROI). Both spectral and textural features were obtained from ROI. To acquire spectrum of a sample, spectral data of all pixels within ROI were obtained and averaged to generate only one mean spectrum. By repeating the same procedure with all samples, a spectral matrix of 115 samples \(\times\) 473 wavelengths was generated. The processes of ROI selection and spectral data acquisition were carried out using the software ENVI 5.1 (ITT Visual Information Solutions, Boulder, CO, USA).  
In this study, a Savitzky-Golay (S-G) smoothing filter (second-order polynomial and 25-point convolution interval) and a first derivative were firstly adopted to deal with baseline offsets of the spectra [28]. Other pre-processing methods, namely the SG smoothing filter, the standard normal variate (SNV), the multiplicative scatter correction (MSC), the first and second derivative, and the combination of S-G smoothing and second derivative, were tested, separately. However, raw spectra and spectra treated by these pre-processing techniques did not improve the accuracy of model compared to the spectra treated by S-G smoothing followed by the first derivative. PCA was then used on the pre-treated spectra to carry out explanatory analysis about spectral variation between samples with high WHC or low WHC. Specifically, in order to determine outliers, confidence ellipses with confidence level of 95% were calculated on the score plot of the first two PCs carrying most of the variance changes. According to previous studies [29; 30], data projected outside confidence ellipses could be defined as potential outliers. Therefore, in this research, spectra located outside the confidence ellipses of both high-WHC and low-WHC groups were defined as outlier data and removed before classification model development.  
Moreover, the high spectral resolution inevitably leads to a large amount of data and variable redundancy and makes the analysis of a spectral matrix time-consuming. To overcome these problems, many techniques are available, such as optimal wavelengths selection, which is a commonly used procedure to reduce the dimension of hyperspectral data and to develop a simplified model. The successive projections algorithm (SPA) is one of the most commonly used wavelength selection algorithms. In order to solve collinearity problems, SPA selects subsets of wavelengths whose information content is minimally redundant by employing a simple projection operation in a vector space [31]. Therefore, SPA was applied to select optimal wavelengths for differentiation between high-WHC and low-WHC samples in this study. The algorithm was implemented using the toolbox in MATLAB R2014b (The Math Works, Inc., Natick, MA, USA). In addition, a graphical user interface for SPA, whose detailed description was presented in [32], can be obtained at [[https://www-ele-ita-br.vpn.cau.edu.cn/~kawakami/spa/](https://www-ele-ita-br.vpn.cau.edu.cn/~kawakami/spa/)]([https://www-ele-ita-br.vpn.cau.edu.cn/~kawakami/spa/](https://www-ele-ita-br.vpn.cau.edu.cn/~kawakami/spa/)).