Lightweight moisture content detection of peas based on hyperspectral imaging and baseline compensation mechanism
-
-
Abstract
Real-time monitoring of moisture content during pea drying is required for the high quality of finished products and extending shelf life. However, conventional detection, such as oven drying, cannot fully meet the online industrial monitoring in modern agriculture, due to the destructive, time-consuming, and severe lag. Compared with conventional single-point near-infrared spectroscopy, hyperspectral imaging can be expected to reduce background noise under irregular shrinkage during pea drying. In this study, high-precision, non-destructive, and lightweight detection was proposed for pea moisture content using visible and near-infrared (Vis-NIR) hyperspectral imaging. Furthermore, 360 pea samples (variety "Zhongwan No. 6") were prepared and subjected to hot air drying treatment at 60 °C. Sample data was collected at nine time intervals to cover the full range from a fresh high-moisture to a dried low-moisture state. A dataset was then constructed with a representative moisture gradient. Hyperspectral images of all samples were acquired in the spectral range of 372.66 to 1 039.65 nm. A threshold segmentation (reflectance threshold of 0.15 to 1.0 at 857.53 nm) was applied to extract the region of interest (ROI), thereby avoiding human subjective errors. Raw spectral data were then preprocessed after image acquisition using standard normal variate (SNV) to eliminate optical path differences. The dataset was partitioned into a calibration set and a prediction set at a ratio of 3:1 using the Kennard-Stone algorithm. Furthermore, four algorithms of feature wavelength screening were compared, including least absolute shrinkage and selection operator (LASSO), bootstrapping soft shrinkage (BOSS), particle swarm optimization (PSO), and competitive adaptive reweighted sampling (CARS). Prediction models were constructed to select these features using partial least squares regression (PLSR), least squares support vector machine (LSSVM), categorical boosting (CatBoost), and lightweight one-dimensional convolutional neural networks (1D-CNN). Spectral response analysis revealed that the drying process induced a significant downward baseline drift over the entire band. According to the Kubelka-Munk theory, the physical shrinkage and surface roughness of peas were attributed to dramatically enhancing the diffuse scattering. Experimental results indicated that the CARS algorithm exhibited the optimal performance of feature dimensionality reduction. A subset of ten characteristic wavelengths accounted for only 5.7% of the full spectrum. An ablation study on feature wavelengths revealed that the CARS retained the high-correlation water absorption bands (e.g., around 970 nm) and low-correlation baseline reference points (e.g., 504.14 and 1 035.63 nm). Once the low-correlation baseline reference points were artificially removed in the ablation study, the prediction coefficient of determination of the model dropped drastically to 0.715 5. These variables were effectively compensated for the physical baseline drift during drying shrinkage, according to an implicit mathematical difference. Among them, the CARS-LSSVM non-linear model achieved the best overall performance, thereby yielding an of 0.964 8 and a root mean square error of prediction (RMSEP) of 0.047 7. The high accuracy was superior to the PSO-LSSVM model, which retained 77 features. Furthermore, the CARS-LSSVM model demonstrated a remarkable performance in computational efficiency; Its running time was recorded at 0.042 s on the same hardware platform, which was hundreds of times higher than the deep learning model (1D-CNN). In conclusion, the strategy was used to effectively extract pure chemical information via decoupling the physical-chemical coupling effects during drying. The CARS algorithm was employed to mine a minimalist feature subset with the LSSVM model. A robust solution was achieved to detect pea moisture content. This finding can also provide solid data support and theoretical guidance for the low-cost, low-power, and handheld multi-spectral intelligent sensors.
-
-