Optimization of NIRS-based models for predicting quality and gas production traits of fresh alfalfa silage via machine learning.
Journal:
Spectrochimica acta. Part A, Molecular and biomolecular spectroscopy
Published Date:
Dec 13, 2025
Abstract
Near-infrared spectroscopy (NIRS) prediction models offer an expeditious method for assessing the nutritional value of feedstuffs, however, developing high-performance models using undried and unground samples remains challenging. This study aimed to explore strategies to improve NIRS models for predicting silage quality and gas production of fresh alfalfa using machine learning approaches. A total of 348 spectral samples were collected for modeling 15 parameters of alfalfa silage. The modeling performance of Partial Least Squares Regression (PLSR), Principal Component Regression (PCR), Ridge Regression (RR), and Linear Support Vector Regression (L-SVR) were first evaluated based on a ten-fold cross-validation. Then, three spectral preprocessing methods-Savitzky-Golay smoothing combined with Standard Normal Variate (SG+SNV), SG with Multiplicative Scatter Correction (SG+MSC), and SNV with detrending (SNV+D) were employed to facilitate the modeling process. Besides, Least Absolute Shrinkage and Selection Operator (LASSO) and Binary Particle Swarm Optimization (BPSO) techniques were applied for selecting feature wavelengths to further optimize model performance. The results indicated that PLSR and RR exhibited relatively superior modeling performance while both spectral preprocessing and feature wavelength selection procedures effectively enhanced the optimal parameters. Acceptable modeling results were achieved for dry matter (DM), water-soluble carbohydrates (WSC), lactic acid (LA), pH, acetic acid (AA), neutral detergent fiber (NDF), and relative feed value (RFV) with corresponding R2CV of 0.986, 0.943, 0.958, 0.958, 0.897, 0.793, and 0.777, respectively. The models for 24-h gas and 48-h CH4 production performed relatively well among the gas traits, with R2CV of 0.534 and 0.506, respectively. Overall, the PLSR-SG+SNV-BPSO modeling strategy demonstrated the best performance, and thus may be considered a preferred approach for future research on developing NIRS models for fresh forage samples.
Authors
Keywords
No keywords available for this article.