## Materials and Methods
### Data Pre-processing  
The spectra of all the samples combined with cultivar names were imported and organized as a dataset file. MATLAB (MathWorks, Natick, MA, USA) with the PLS Toolbox v.8.2.1 function (Eigenvector Research Inc., Wenatchee, WA, USA) was utilized for handling the dataset and calibrating the discriminant models. A robust model performance relies on high-quality data. Outliers in the calibration data set may result in low accuracy models [32]. Therefore, outlier detection is necessary before calibrating discriminant models. Principal component analysis (PCA) was applied to detect outliers of the spectra by examining the Q Residuals and Hotelling's T\({}^{2}\). The Q Residuals calculated from the PCA model were the measure of the difference between an original spectrum and its PCA projection. The Hotelling's T\({}^{2}\) value was another parameter indicating how far a spectrum was away from the projection center (PCA scores are zeros) in the principal components' (PCs) space. A spectrum with a high Q Residual or a high Hotelling's T\({}^{2}\) could be treated as an outlier sample with a reasonable possibility [33]. In this study, spectral vectors of each cultivar were subjected to the PCA process for outlier detection. The statistics Q Residual and Hotelling's T\({}^{2}\) were calculated while using the first  
Figure 1: Schematic of using an FT-NIR spectrometer to acquire the NIR spectrum of a single sweet corn seed in a diffuse reflectance mode (left), and the basic biological structure of a sweet corn seed (right). three PCs model. Samples were marked as outliers when their Q Residual or Hotelling's T\({}^{2}\) value exceeded the confidence interval at a 99% confidence level. After removing the outliers and regularizing the spectra, the remaining samples in each cultivar were divided into two parts. One-third of them were selected at equal intervals as an independent testing set, and the remaining two-thirds were used as the training set for calibrating models. Appropriate pre-processing methods may improve model accuracy by removing systemic noise and normalizing the data. The smoothing method was commonly used to reduce high-frequency noise. All the full-range spectral data were pre-processed with the Savitzky-Golay filter, using a 21-point-window and third-order polynomial [21]. Scattering theory states that scattering should have an additive and/or a multiplicative effect on reflection spectra caused by optical path-length variations and particle size uniformity, and these features generally had a negative impact on the calibration model development. The scattering profile in a spectrum can be deduced from the ideal standard spectrum. Multiplicative scatters correction (MSC) was developed to reduce the effect of scattered light on reflection NIR spectra [34]. This study used the mean spectrum of the training set as the standard spectrum when processing MSC. The MSC method determined the scattering by regressing each spectrum onto the mean spectrum, and the scatter-corrected spectrum was then calculated inversely based on the regression coefficients from the original spectrum. The spectral matrix of the full-range wavelengths was pre-processed with MSC prior to performing the discriminant analyses. Moreover, the first derivative of the Savitzky-Golay pre-processing was also applied to inspect the difference between the spectra of the two cultivars, since it could remove the predominant background variation from the spectral data. The spectra angle which is calculated from two spectral vectors is commonly used to measure the similarities between spectrums. It can also be used as a classification technique that assigns categories to samples based on their spectral angle between the sample spectrum and reference spectrum.