Abstract
[Objective] To achieve rapid, non-destructive, and high-precision monitoring of pork freshness, addressing the low efficiency, high destructiveness, and insufficient prediction accuracy of single models in conventional monitoring. [Methods] A pork freshness monitoring model was proposed based on near-infrared spectroscopy (NIRS) combined with random forest (RF) improved by the fruit fly optimization algorithm (FOA). With the total volatile basic nitrogen (TVB-N) content as the freshness indicator, near-infrared spectral data of pork samples at different storage stages are collected (scanning range: 1 000~1 800 nm). Spectral noise and baseline drift are eliminated via a preprocessing method combining multiplicative scatter correction (MSC) and first-derivative transformation. Then, FOA is employed to optimize key hyperparameters (number of decision trees, minimum leaf node sample size, and maximum number of features) of RF to construct the FOA-RF model. [Results] Among all the prediction models evaluated, the FOA-RF model demonstrates the highest accuracy for predicting pork TVB-N content. The preprocessing method combining MSC and first-derivative transformation effectively enhances the quality of the spectral data. The FOA-RF model achieves a root mean square error of prediction (RMSEP) of only 1.582 mg/ 100 g, a correlation coefficient of prediction (Rp) of 0.978, a coefficient of determination of prediction (R2p) as high as 0.956, and a residual prediction deviation of prediction (RPDp) of 4.723, significantly outperforming the other comparative models. The overall predictive performance of partial least squares regression (PLSR), the un-optimized RF model, and the grid search-optimized random forest (GS-RF) model is inferior to that of the FOA-RF model. [Conclusion] The method proposed in this study provides an efficient and accurate new approach for non-destructive monitoring of pork freshness, meeting the demand for rapid testing in the meat industry.
Publication Date
1-13-2026
First Page
51
Last Page
58
DOI
10.13652/j.spjx.1003.5788.2025.60137
Recommended Citation
Li, ZHANG; Zhihui, LI; and Mingxing, MA
(2026)
"Pork freshness monitoring based on near-infrared spectroscopy and random forest improved by fruit fly optimization algorithm,"
Food and Machinery: Vol. 41:
Iss.
12, Article 7.
DOI: 10.13652/j.spjx.1003.5788.2025.60137
Available at:
https://www.ifoodmm.cn/journal/vol41/iss12/7
References
[1] 左晓佳,再努热・吐尔孙.肉品新鲜度评价及保鲜技术研究进展 [J].肉类研究,2023,37(12):69-75.ZUO X J,TUERXUN Z.Research progress on evaluation of meat freshness and preservation technologies [J].Meat Research,2023,37(12):69-75.
[2] WILLIAMS P C,NORRIS K H.Near-infrared technology in the agricultural and food industries [M].2nd ed.Boca Raton:CRC Press,2002.
[3] 刘瑜明,王巧华,陈远哲,等.猪肉理化指标的近红外光谱无损检测 [J].光谱学与光谱分析,2024,44(5):1 346-1 353.LIU Y M,WANG Q H,CHEN Y Z,et al.Non-destructive detection of physicochemical indicators in pork using near-infrared spectroscopy [J].Spectroscopy and Spectral Analysis,2024,44(5):1 346-1 353.
[4] 周宇坤,陈孝敬,谢忠好,等.一种近红外光谱数据预处理组合优化策略 [J].光谱学与光谱分析,2025,45(1):52-58.ZHOU Y K,CHEN X J,XIE Z H,et al.A combined optimization strategy for preprocessing near-infrared spectral data[J].Spectroscopy and Spectral Analysis,2025,45(1):52-58.
[5] GUO M Q,LIN H,WANG K Q,et al.Data fusion of near-infrared and Raman spectroscopy:an innovative tool for non-destructive prediction of the TVB-N content of salmon samples[J].Food Research International,2024,189:114-135.
[6] LENG T,LI F,CHEN Y X,et al.Fast quantification of total volatile basic nitrogen (TVB-N ) content in beef and pork by near-infrared spectroscopy:comparison of SVR and PLS model[J].Meat Science,2021,180:108-129.
[7] 王冬,栾云霞,王欣然,等.近红外光谱无损分析肉类品质的研究进展 [J].肉类研究,2024,38(5):61-70.WANG D,LUAN Y X,WANG X R,et al.Research progress in non-destructive analysis of meat quality using near-infrared spectroscopy [J].Meat Research,2024,38(5):61-70.
[8] 田文强,王巧华,徐步云,等.基于近红外光谱的腌制期咸鸭蛋理化指标无损检测 [J].食品科学,2023,44(2):319-326.TIAN W Q,WANG Q H,XU B Y,et al.Non-destructivedetection of physicochemical indicators of salted duck eggs during salting using near-infrared spectroscopy [J].Food Science,2023,44(2):319-326.
[9] 方瑶,谢天铧,郭渭,等.基于近红外光谱的金鲳鱼新鲜度快速检测技术 [J].江苏农业学报,2021,37(1):213-218.FANG Y,XIE T H,GUO W,et al.Rapid detection technique for freshness of golden pompano based on near-infrared spectroscopy [J].Jiangsu Journal of Agricultural Sciences,2021,37(1):213-218.
[10] 张雷蕾,李永玉,彭彦昆,等.基于高光谱成像技术的猪肉新鲜度评价 [J].农业工程学报,2012,28(7):254-259.ZHANG L L,LI Y Y,PENG Y K,et al.Determination of pork freshness attributes by hyperspectral imaging technique [J].Transactions of the Chinese Society of Agricultural Engineering,2012,28(7):254-259.
[11] RONG L,WANG Y R.A fresh-cut papaya freshness prediction model based on partial least squares regression and support vector machine regression [J].Heliyon,2024,10(9):11-24.
[12] 任智磊,赵霄霄,冯景,等.基于近红外光谱结合网格搜索—随 机 森 林 — 自 适 应 提 升 算 法 无 损 检 测 牛 肉 新 鲜 度 [J].肉 类研究,2025,39(11):1-8.REN Z L,ZHAO X X,FENG J,et al.Non-destructive detection of beef freshness based on near-infrared spectroscopy combined with grid search-random forest-adaboost algorithm [J].Meat Research,2025,39(11):1-8.
[13] CAI J,CHEN Q F,WAN X H,et al.Determination of total volatile basic nitrogen (TVB-N ) content and Warner –Bratzler shear force (WBSF ) in pork using Fourier transform near infrared (FT-NIR ) spectroscopy [J].Food Chemistry,2011,126(3):1 354-1 360.
[14] QU F F,REN D,HE Y,et al.Predicting pork freshness using multi-index statistical information fusion method based on near infrared spectroscopy [J].Meat Science,2018,146:59-67.
[15] PROBST P,WRIGHT M N,BOULESTEIX A L.Hyperparameters and tuning strategies for random forest [J].Wiley Interdisciplinary Reviews:Data Mining and Knowledge Discovery,2019,9(3):1 301-1 318.
[16] PAN W T.A new fruit fly optimization algorithm:taking the financial distress model as an example [J].Knowledge-Based Systems,2012,26:69-74.
[17] LAN C F,SONG B W,ZHANG L,et al.State prediction of hydroturbine based on WOA-RF-adaboost [J].Energy Reports,2022,8:13 129-13 137.
[18] 孙 康 慧,肖 安,夏 侯 杰.基 于 LightGBM 机 器 学 习 算 法 的 江西气温短期预报模型研究 [J].高原气象,2024,43(6):1 520-1 535.SUN K H,XIAO A,XIA H J.Study on short-term temperature forecast model in Jiangxi province based on LightGBM machine learning algorithm [J].Plateau Meteorology,2024,43(6):1 520-1 535.
[19] 刘艳群,肖付刚,陈彩虹.基于随机森林回归模型的小麦粉灰分含量快速测定 [J].食品与机械,2024,40(9):79-83.LIU Y Q,XIAO F G,CHEN C H.Study on rapid determination of ash content in wheat flour based on random forest regression model [J].Food & Machinery,2024,40(9):79-83.
[20] 张清清.基于 FOA-RF 模型下煤与瓦斯突出智能预警系统研究[J].陕西煤炭,2024,43(7):152-155.ZHANG Q Q.Research on intelligent early warning system for coal and gas outburst based on foa-rf model [J].Shaanxi Coal,2024,43(7):152-155.
[21] SHENG W,BAO Y.Fruit fly optimization algorithm based fractional order fuzzy-PID controller for electronic throttle[C]// Nonlinear Dynamics,2013,73(1/2):611-619.
[22] PUJAR P,LAVANYA M.Power factor improvement in IEEE-33 radial distribution systems using fruit fly algorithm compared with bat algorithm by optimizing the DG size [C]// 2024 3rd International Conference on Automation,Computing and Renewable Systems (ICACRS ).Pudukkottai,India:[s.n.],2024:349-353.
