Non-Destructive Assessment of Beef Freshness Using Visible and Near-Infrared Spectroscopy with Interpretable Machine Learning
Abstract
1. Introduction
2. Materials and Methods
2.1. The Sample Collection
2.2. Measurement of Vis-NIR Spectra
2.3. Measurement of Reference Values
2.3.1. L*, a*, b* Values
2.3.2. TVB-N Values
2.4. Spectral Pre-Processing
2.5. PSOGA Feature Selection
2.6. Model Establishment
2.7. SHAP Model
2.8. Evaluation of Models
3. Results and Discussions
3.1. Experimental Data and Spectral Analysis
3.2. Spectral Pre-Processing and XGBoost Models Using the Full Set of Wavelengths
3.3. Feature Wavelengths Selection and XGBoost Models at Selected Wavelengths
3.3.1. Distribution of Feature Wavelengths by Different Methods
3.3.2. Performance Comparison of XGBoost Models at Selected Wavelengths
3.3.3. Comparison of PSOGA with Other Evolutionary Algorithms
3.4. Model Interpretation by SHAP Framework
3.5. Comparative Discussion with Recent Studies
4. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Liu, Y.; Yang, X.; Liu, Y.; Dong, P.; Liang, R.; Hopkins, D.L.; Holman, B.W.; Luo, X.; Zhu, L.; Yang, Z. Chinese consumer perception and purchasing behavior of beef–Mainly in North and East China. Meat Sci. 2025, 220, 109696. [Google Scholar] [CrossRef] [PubMed]
- Holman, B.W.; Bekhit, A.E.-D.A.; Waller, M.; Bailes, K.L.; Kerr, M.J.; Hopkins, D.L. The association between total volatile basic nitrogen (TVB-N) concentration and other biomarkers of quality and spoilage for vacuum packaged beef. Meat Sci. 2021, 179, 108551. [Google Scholar] [CrossRef]
- Menezes, G.L.; Junior, D.T.V.; Ferreira, R.E.; Oliveira, D.A.; Araujo, J.A.; Duarte, M.; Dorea, J.R. Empowering informed choices: How computer vision can assists consumers in making decisions about meat quality. Meat Sci. 2025, 219, 109675. [Google Scholar] [CrossRef]
- Wu, S.; Zhang, M.; Yu, Q.; Mujumdar, A.S.; Yang, C. Fresh food quality deterioration detection and labeling: A review of recent research and application in Supply Chain. Food Bioprocess Technol. 2024, 17, 1706–1726. [Google Scholar] [CrossRef]
- Dong, F.; Bi, Y.; Hao, J.; Liu, S.; Yi, W.; Yu, W.; Lv, Y.; Cui, J.; Li, H.; Xian, J. A new comprehensive quantitative index for the assessment of essential amino acid quality in beef using Vis-NIR hyperspectral imaging combined with LSTM. Food Chem. 2024, 440, 138040. [Google Scholar] [CrossRef] [PubMed]
- Ismail, A.; Park, S.; Kim, H.-J.; Choi, M.; Kim, H.-J.; Hong, H.; Kim, G.; Jo, C. Evaluation of biomarkers that influence the freshness of beef during storage using VIS/NIR hyperspectral imaging. LWT 2025, 216, 117302. [Google Scholar] [CrossRef]
- Zhao, X.; Ning, W.; Chen, R.; Wang, H.; Zhang, G.; Bi, J.; Hou, H. Rapid non-destructive detection of pork freshness using visible-near infrared spectroscopy based on convolutional neural network hybrid models. J. Food Compos. Anal. 2025, 140, 107199. [Google Scholar] [CrossRef]
- Zhang, W.; Kasun, L.C.; Wang, Q.J.; Zheng, Y.; Lin, Z. A review of machine learning for near-infrared spectroscopy. Sensors 2022, 22, 9764. [Google Scholar] [CrossRef]
- Subbiah, S.S.; Chinnappan, J. Opportunities and Challenges of Feature Selection Methods for High Dimensional Data: A Review. Ing. Syst. Inf. 2021, 26, 67–77. [Google Scholar] [CrossRef]
- Velasco, L.; Guerrero, H.; Hospitaler, A. A literature review and critical analysis of metaheuristics recently developed. Arch. Comput. Methods Eng. 2024, 31, 125–146. [Google Scholar] [CrossRef]
- Mohammadi, M.; Ramezani, M.; Tab, F.A.; Ahmadizar, F. Combining evolutionary and swarm algorithms in a hybrid subspace-wise search strategy for feature selection. Clust. Comput. 2025, 28, 287. [Google Scholar] [CrossRef]
- Li, M.; Sun, H.; Huang, Y.; Chen, H. Shapley value: From cooperative game to explainable artificial intelligence. Auton. Intell. Syst. 2024, 4, 2. [Google Scholar] [CrossRef]
- Zhong, L.; Guo, X.; Ding, M.; Ye, Y.; Jiang, Y.; Zhu, Q.; Li, J. SHAP values accurately explain the difference in modeling accuracy of convolution neural network between soil full-spectrum and feature-spectrum. Comput. Electron. Agric. 2024, 217, 108627. [Google Scholar] [CrossRef]
- Tao, H.; Habib, M.; Aljarah, I.; Faris, H.; Afan, H.A.; Yaseen, Z.M. An intelligent evolutionary extreme gradient boosting algorithm development for modeling scour depths under submerged weir. Inf. Sci. 2021, 570, 172–184. [Google Scholar] [CrossRef]
- GB 5009.228-2016; National Food Safety Standard: Determination of Volatile Basic Nitrogen in Food. China Standards Press: Beijing, China, 2016.
- Li, L.; Li, L.; Gou, G.; Jia, L.; Zhang, Y.; Shen, X.; Cao, R.; Wang, L. A Nondestructive Detection Method for the Muti-Quality Attributes of Oats Using Near-Infrared Spectroscopy. Foods 2024, 13, 3560. [Google Scholar] [CrossRef]
- Cai, L.; Li, J.; Zhang, H.; Zhang, Y.; Zhang, J.; Hao, H. Determination of the SSC in oranges using Vis-NIR full transmittance hyperspectral imaging and spectral visual coding: A practical solution to the scattering problem of inhomogeneous mixtures. Food Chem. 2025, 474, 143239. [Google Scholar] [CrossRef]
- Singh, A.K.; Srivastava, V.K. Improved filtering approach for identification of protein-coding regions in eukaryotes by background noise reduction using S–G filter. Netw. Model. Anal. Health Inform. Bioinform. 2021, 10, 19. [Google Scholar] [CrossRef]
- Dou, S.; Zhang, W.; Deng, Y.; Zhang, C.; Mei, Z.; Yan, J.; Li, M. Comparison of citrus leaf water content estimations based on the continuous wavelet transform and fractional derivative methods. Horticulturae 2024, 10, 177. [Google Scholar] [CrossRef]
- Sudholt, D. The benefits of population diversity in evolutionary algorithms: A survey of rigorous runtime analyses. In Theory of Evolutionary Computation: Recent Developments in Discrete Optimization; Spring: Berlin/Heidelberg, Germany, 2019; pp. 359–404. [Google Scholar]
- Hu, R.; Bao, L.; Ding, H.; Zhou, D.; Kong, Y. Analysis of the influence of population distribution characteristics on swarm intelligence optimization algorithms. Inf. Sci. 2023, 645, 119340. [Google Scholar] [CrossRef]
- Abdullah, H.N. An Improvement in LQR Controller Design based on Modified Chaotic Particle Swarm Optimization and Model Order Reduction. Int. J. Intell. Eng. Syst. 2021, 14, 157–168. [Google Scholar] [CrossRef]
- Zhang, Y.; Lu, J.; Zhao, C.; Li, Z.; Yan, J. Chaos Optimization Algorithms: A Survey. Int. J. Bifurc. Chaos 2024, 34, 2450205. [Google Scholar] [CrossRef]
- Liu, W.; Zhu, D.; Zhou, C.; Cheng, S. Evolutionary state estimate-based adaptive multi-objective particle swarm optimization. J. Membr. Comput. 2025, 1–23. [Google Scholar] [CrossRef]
- Fu, Z.; Shen, Y.; Wang, S.; Jiang, W.; Li, J.; Bin, G.; Hu, B. Asymmetric Bouc-Wen hysteresis modeling for MFC actuator via hybrid APSO-TRR identification algorithm. Sens. Actuators A Phys. 2022, 346, 113830. [Google Scholar] [CrossRef]
- Li, J.; An, Q.; Lei, H.; Deng, Q.; Wang, G.-G. Survey of lévy flight-based metaheuristics for optimization. Mathematics 2022, 10, 2785. [Google Scholar] [CrossRef]
- Lin, S.; Wang, Y.; Wei, H.; Wang, X.; Wang, Z. Hybrid Method for Oil Price Prediction Based on Feature Selection and XGBOOST-LSTM. Energies 2025, 18, 2246. [Google Scholar] [CrossRef]
- Galvão, R.K.H.; Araujo, M.C.U.; José, G.E.; Pontes, M.J.C.; Silva, E.C.; Saldanha, T.C.B. A method for calibration and validation subset partitioning. Talanta 2005, 67, 736–740. [Google Scholar] [CrossRef]
- Huang, C.; Li, S.-X.; Caraballo, C.; Masoudi, F.A.; Rumsfeld, J.S.; Spertus, J.A.; Normand, S.-L.T.; Mortazavi, B.J.; Krumholz, H.M. Performance metrics for the comparative analysis of clinical risk prediction models employing machine learning. Circ. Cardiovasc. Qual. Outcomes 2021, 14, e007526. [Google Scholar] [CrossRef] [PubMed]
- Waga, M.; Nakade, K. Light wavelengths that induce oxidation of oxymyoglobin in meat. Meat Sci. 2025, 219, 109664. [Google Scholar] [CrossRef] [PubMed]
- Peyvasteh, M.; Bykov, A.; Meglinski, I. Polarimetric and spectral imaging approach for meat quality control and characterization of biological tissues. In Advanced Photonics Methods for Biomedical Applications; CRC press: Boca Raton, FL, USA, 2023; pp. 151–216. [Google Scholar]
- Zheng, X.; Chen, L.; Li, X.; Zhang, D. Non-destructive detection of meat quality based on multiple spectral dimension reduction methods by near-infrared spectroscopy. Foods 2023, 12, 300. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Y.; Gao, X.; Hassan, S.G.; Xie, C.; Liu, T.; Liu, S.; Xu, L. Non-Destructive Assessment of Tilapia Texture using Raman–Infrared Fusion and an Attention-based LSTM Model. Food Control 2025, 179, 111539. [Google Scholar] [CrossRef]
- Jiang, X.; Cao, X.; Liu, Q.; Wang, F.; Fan, S.; Yan, L.; Wei, Y.; Chen, Y.; Yang, G.; Xu, B. Prediction of multi-task physicochemical indices based on hyperspectral imaging and analysis of the relationship between physicochemical composition and sensory quality of tea. Food Res. Int. 2025, 211, 116455. [Google Scholar] [CrossRef]
- Putra, I.G.N.S.; Sadik, K.; Soleh, A.M.; Suhaeni, C. Detection of Adulteration in Coconut Milk Using Cuckoo Search-Optimized Xgboost on High-Dimensional Ftir Spectral Data. J. Ilm. Penelit. Pembelajaran Inform. 2025, 10, 2304–2316. [Google Scholar]
- Jiao, Y.; Li, Z.; Chen, X.; Fei, S. Preprocessing methods for near-infrared spectrum calibration. J. Chemom. 2020, 34, e3306. [Google Scholar] [CrossRef]
- Kaur, G.; Sharma, A. A deep learning-based model using hybrid feature extraction approach for consumer sentiment analysis. J. Big Data 2023, 10, 5. [Google Scholar] [CrossRef]
- Liu, M.; Li, B.; Zhang, W. Research on Small Acceptance Domain Text Detection Algorithm Based on Attention Mechanism and Hybrid Feature Pyramid. Electronics 2022, 11, 3559. [Google Scholar] [CrossRef]
- Li, Y.; Yang, X. Quantitative analysis of near infrared spectroscopic data based on dual-band transformation and competitive adaptive reweighted sampling. Spectrochim. Acta Part A Mol. Biomol. Spectrosc. 2023, 285, 121924. [Google Scholar] [CrossRef]
- Ajibade, S.; Chweya, R.; Ogunbolu, M.; Fadipe, S. Utilizing logistic map to enhance the population diversity of PSO. In Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2022; p. 012016. [Google Scholar]
- Coombs, C.E.; Liddle, R.R.; González, L.A. Portable vibrational spectroscopic methods can discriminate between grass-fed and grain-fed beef. J. Near Infrared Spectrosc. 2021, 29, 321–329. [Google Scholar] [CrossRef]
- Rodriguez-Mackenzie, A.D.; Santos-Velazquez, L.; Arbelo-Lopez, H.D.; Wymore, T.; Lopez-Garriga, J. Mechanistics of pH-Dependent Sulfmyoglobin Formation: Spin Control and His64 Proton Relay. J. Chem. 2024, 2024, 4244579. [Google Scholar] [CrossRef]
- Pham, T.T.; Nguyen, T.B.; Dam, M.S.; Nguyen, L.L.P.; Baranyai, L. A review of the application of the laser-light backscattering imaging technique to agricultural products. Agriculture 2024, 14, 1782. [Google Scholar] [CrossRef]
- Yi, W.; Zhao, X.; Yun, X.; Wang, S.; Dong, T. Automated and explainable machine learning for monitoring lipid and protein oxidative damage in mutton using hyperspectral imaging. Food Res. Int. 2025, 203, 115905. [Google Scholar] [CrossRef]
- Zhao, Y.; Xu, D.; Li, S.; Tang, K.; Yu, H.; Yan, R.; Li, Z.; Wang, X.; Xin, X. Comparative analysis of feature importance algorithms for grassland aboveground biomass and nutrient prediction using hyperspectral data. Agriculture 2024, 14, 389. [Google Scholar] [CrossRef]
- Li, B.; Ou-yang, S.; Li, Y.; Lu, Y.; Liu, Y.; Ou-yang, A. Quantitative detection of beef freshness characterized by storage days based on hyperspectral imaging technology combined with physicochemical indexes. J. Food Compos. Anal. 2025, 140, 107303. [Google Scholar] [CrossRef]
- Tang, X.; Xiao, H.; Luo, T.; Wei, J.; He, R.; Duan, J.; Xiao, S.; Ding, N.; Huang, L.; Zhang, Z. Tracking nutritional and quality changes in frozen pork: A 12-month study using 7 categories of meat parameters and VIS/NIR spectroscopy. Food Chem. 2025, 481, 144003. [Google Scholar] [CrossRef] [PubMed]
- Cai, M.; Li, X.; Liang, J.; Liao, M.; Han, Y. An effective deep learning fusion method for predicting the TVB-N and TVC contents of chicken breasts using dual hyperspectral imaging systems. Food Chem. 2024, 456, 139847. [Google Scholar] [CrossRef] [PubMed]
- Yan, X.; Liu, S.; Wang, S.; Cui, J.; Wang, Y.; Lv, Y.; Li, H.; Feng, Y.; Luo, R.; Zhang, Z. Predictive Analysis of Linoleic Acid in Red Meat Employing Advanced Ensemble Models of Bayesian and CNN-Bi-LSTM Decision Layer Fusion Based Hyperspectral Imaging. Foods 2024, 13, 424. [Google Scholar] [CrossRef]
- Qi, A.; Zhao, D.; Yu, F.; Heidari, A.A.; Chen, H.; Xiao, L. Directional mutation and crossover for immature performance of whale algorithm with application to engineering optimization. J. Comput. Des. Eng. 2022, 9, 519–563. [Google Scholar] [CrossRef]







| Hyperparameter | Range |
|---|---|
| n_estimators | 100–500 |
| learning_rate | 0.01–0.3 |
| max_depth | 3–8 |
| gamma | 0 |
| reg_lambda | 0 |
| reg_alpha | 1 |
| Content | Calibration (n = 315) | Prediction (n = 105) | ||
|---|---|---|---|---|
| Mean ± SD | Range | Mean ± SD | Range | |
| TVB-N (mg/100 g) | 28.44 ± 12.52 | 6.65–66.05 | 20.37 ± 7.96 | 8.66–49.27 |
| L* | 42.02 ± 3.17 | 31.94–50.46 | 40.37 ± 3.03 | 34.93–48.74 |
| a* | 10.48 ± 2.68 | 5.90–18.69 | 11.01 ± 2.04 | 6.08–18.03 |
| b* | 11.72 ± 1.54 | 7.88–16.70 | 11.18 ± 1.29 | 8.87–15.29 |
| Content | Methods | R2c | RMSEC | R2p | RMSEP | RPD |
|---|---|---|---|---|---|---|
| TVB-N (RAW) | / | 0.7656 | 6.0641 | 0.8322 | 3.2601 | 2.4409 |
| PSOGA | 0.9854 | 1.5146 | 0.9504 | 1.7726 | 4.5108 | |
| PSO | 0.9332 | 3.2376 | 0.9137 | 2.3377 | 3.4041 | |
| GA | 0.9551 | 2.6543 | 0.9170 | 2.2931 | 3.4703 | |
| GWO | 0.9727 | 2.0702 | 0.8894 | 2.6468 | 3.0066 | |
| CARS | 0.9394 | 3.0612 | 0.8113 | 3.6882 | 2.3021 | |
| L* (SG) | / | 0.8753 | 1.1190 | 0.8301 | 1.2469 | 2.4260 |
| PSOGA | 0.9804 | 0.4435 | 0.9540 | 0.6485 | 4.6874 | |
| PSO | 0.9637 | 0.6039 | 0.8985 | 0.9637 | 3.1391 | |
| GA | 0.9750 | 0.5007 | 0.8938 | 0.9857 | 3.0690 | |
| GWO | 0.9538 | 0.6810 | 0.9086 | 0.9148 | 3.3068 | |
| CARS | 0.9030 | 1.0145 | 0.9121 | 0.8576 | 3.3736 | |
| a* (SG + 1D) | / | 0.8814 | 0.9166 | 0.8193 | 0.9130 | 2.3523 |
| PSOGA | 0.9769 | 0.4044 | 0.8939 | 0.6996 | 3.0846 | |
| PSO | 0.9677 | 0.4786 | 0.8689 | 0.7777 | 2.7617 | |
| GA | 0.9796 | 0.3798 | 0.8499 | 0.8320 | 2.5812 | |
| GWO | 0.9644 | 0.5023 | 0.8604 | 0.8023 | 2.6767 | |
| CARS | 0.9676 | 0.4769 | 0.7408 | 1.1250 | 1.9642 | |
| b* (RAW) | / | 0.7958 | 0.6960 | 0.8941 | 0.4195 | 3.0733 |
| PSOGA | 0.9580 | 0.3179 | 0.9416 | 0.2918 | 4.1582 | |
| PSO | 0.9270 | 0.4161 | 0.9193 | 0.3662 | 3.5199 | |
| GA | 0.9425 | 0.3694 | 0.9049 | 0.3976 | 3.2424 | |
| GWO | 0.9031 | 0.4795 | 0.9203 | 0.3639 | 3.5426 | |
| CARS | 0.9271 | 0.4106 | 0.8115 | 0.5735 | 2.3035 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Chen, R.; Ning, W.; Xie, X.; Bi, J.; Zhang, G.; Hou, H. Non-Destructive Assessment of Beef Freshness Using Visible and Near-Infrared Spectroscopy with Interpretable Machine Learning. Foods 2026, 15, 728. https://doi.org/10.3390/foods15040728
Chen R, Ning W, Xie X, Bi J, Zhang G, Hou H. Non-Destructive Assessment of Beef Freshness Using Visible and Near-Infrared Spectroscopy with Interpretable Machine Learning. Foods. 2026; 15(4):728. https://doi.org/10.3390/foods15040728
Chicago/Turabian StyleChen, Ruoxin, Wei Ning, Xufen Xie, Jingran Bi, Gongliang Zhang, and Hongman Hou. 2026. "Non-Destructive Assessment of Beef Freshness Using Visible and Near-Infrared Spectroscopy with Interpretable Machine Learning" Foods 15, no. 4: 728. https://doi.org/10.3390/foods15040728
APA StyleChen, R., Ning, W., Xie, X., Bi, J., Zhang, G., & Hou, H. (2026). Non-Destructive Assessment of Beef Freshness Using Visible and Near-Infrared Spectroscopy with Interpretable Machine Learning. Foods, 15(4), 728. https://doi.org/10.3390/foods15040728

