Online Moisture Detection in Stored Grain Using Near-Infrared Spectroscopy
Lan Wu, Longwu LiangMobile near-infrared (NIR) detection of wheat moisture is susceptible to random noise, scattering effects, baseline variations, and local spectral misalignment under dynamic acquisition conditions. In this study, a mobile online NIR detection platform was developed to collect wheat spectra over 660–1080 nm. A total of 169 modeling samples were divided into a calibration set (118 samples) and a prediction set (51 samples), while 50 samples from a different source were used for external validation. Savitzky–Golay (SG) smoothing was used to suppress random noise, extended multiplicative scatter correction (EMSC) was applied to correct scattering effects and baseline variations, and correlation optimized warping (COW) was employed for wavelength alignment. CARS–VIP was subsequently used to select informative wavelength variables, and an RF model was developed for moisture prediction. Among the evaluated strategies, SG–EMSC–COW–CARS–VIP–RF achieved the best overall performance and outperformed the corresponding full-spectrum RF model. The optimal model retained 17 wavelength variables, accounting for 6.8% of the original 250 variables. It achieved an R2p of 0.9923, an RMSEp of 0.3678, and an MAEp of 0.2323 on the prediction set. For the external validation set, the corresponding R2, RMSE, and MAE values were 0.9803, 0.4428, and 0.3682, respectively. The proposed method effectively mitigated spectral interference and enhanced prediction stability, providing a technical basis for the online determination of moisture content in stored grain.