Near-infrared spectroscopy (NIRS) is widely used for rapid and non-destructive evaluation of feed nutritional quality, but robust calibration remains challenging for heterogeneous multi-product feed datasets. This study evaluated convolutional neural network (CNN)-based models for predicting crude protein (CP) and acid detergent fiber (ADF) using a previously published NIR database containing forage and grain-based feeds. A one-dimensional CNN and two hybrid models, CNN combined with partial least squares regression (CNN+PLS) and XGBoost (CNN+XGBoost), were developed and compared with conventional PLSR calibration models based on either the pooled multi-product dataset or product-specific subsets. Model performance was assessed using an independent internal hold-out test set generated within the same database. For CP prediction, CNN-based models achieved strong performance on the hold-out test set, with testing R2 values of 0.98 and RMSEP values of 0.60–0.62, showing a clear reduction in prediction error compared with the global PLSR model. For ADF, CNN and CNN+PLS provided only modest improvements over global PLSR, whereas CNN+XGBoost showed weaker generalization for ADF. Product-wise results further indicated that ADF prediction was more strongly affected by feed matrix and product category than CP prediction. Grad-CAM examples suggested that CNN activation patterns were broadly consistent with known protein- and fiber-related absorption regions, although this interpretation should be regarded as illustrative evidence of spectral coherence rather than direct chemical causality. Overall, CNN-based models, particularly CNN+PLS, showed promise for improving NIRS prediction of CP in heterogeneous feed datasets, while their advantage for ADF was limited. Further validation using independent external datasets and multi-instrument conditions is required before routine implementation.
Yang et al. (Sat,) studied this question.