Convolutional Neural Network-Based Models for Near-Infrared Prediction of Nutritional Quality in Multi-Product Animal Feeds
Open Access
Abstract
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.Keywords
Funding Information
- China Agricultural University
This publication has 33 references indexed in Scilit:
- Deep learning and machine learning methods based on the NIRS dataset for rapid determination of the nutrients content and quality of oat hayComputers and Electronics in Agriculture, 2025
- Estimation of crude protein content in natural pasture grass using unmanned aerial vehicle hyperspectral dataComputers and Electronics in Agriculture, 2024
- Near-infrared spectroscopy for analysing livestock diet quality: A systematic reviewHeliyon, 2024
- Diverse local calibration approaches for chemometric predictive analysis of large near-infrared spectroscopy (NIRS) multi-product datasetsChemometrics and Intelligent Laboratory Systems, 2024
- Integrating portable NIR spectrometry with deep learning for accurate Estimation of crude protein in corn feedSpectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, 2024
- Principles and applications of convolutional neural network for spectral analysis in food quality evaluation: A reviewJournal of Food Composition and Analysis, 2024
- Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based LocalizationInternational Journal of Computer Vision, 2019
- Evaluation Technologies for Food Quality2019
- Protein content prediction in single wheat kernels using hyperspectral imagingFood Chemistry, 2018
- How to evaluate models: Observed vs. predicted or predicted vs. observed?Ecological Modelling, 2008