周子文,范志仪,彭少杰.基于粒子群优化集成学习算法堆叠模型预测蔬菜中倍硫磷的抽检结果[J].食品安全质量检测学报,2025,16(5):187-196
基于粒子群优化集成学习算法堆叠模型预测蔬菜中倍硫磷的抽检结果
Stacked generalization model prediction of fenthion spot-check results in vegetables based on particle swarm optimization ensemble learning algorithm
投稿时间:2024-10-08  修订日期:2025-02-16
DOI:
中文关键词:  蔬菜  倍硫磷  粒子群算法  堆叠模型  机器学习  食品安全
英文关键词:vegetables  fenthion  particle swarm algorithm  stacked generalization model  machine learning  food safety
基金项目:2024年上海市市场监督管理局科技项目(2024-50)
作者单位
周子文 1.上海市市场监督管理局信息应用研究中心 
范志仪 1.上海市市场监督管理局信息应用研究中心 
彭少杰 1.上海市市场监督管理局信息应用研究中心 
AuthorInstitution
ZHOU Zi-Wen 1.Information Application Research Center of Shanghai Municipal Administration for Market Regulation 
FAN Zhi-Yi 1.Information Application Research Center of Shanghai Municipal Administration for Market Regulation 
PENG Shao-Jie 1.Information Application Research Center of Shanghai Municipal Administration for Market Regulation 
摘要点击次数: 22
全文下载次数: 17
中文摘要:
      目的 建立基于粒子群(particle swarm optimization, PSO)算法优化堆叠模型(stacked generalization, Stacking)的蔬菜安全风险预测模型, 对上海市市售蔬菜中倍硫磷的抽检结果进行预测。方法 基于2021—2023年上海市市售蔬菜中倍硫磷的抽检数据, 选取任务类型、抽样地区、抽样环节、抽样场所、抽样月份、检测机构、蔬菜品种作为特征变量, 以蔬菜中倍硫磷的抽检结果是否合格为目标变量; 采用十折交叉验证筛选优良机器学习模型、重采样方法, 经PSO算法优化模型参数后构建PSO-Stacking预测模型。结果 3889件蔬菜中检出倍硫磷阳性样品55件, 不合格率为1.4%。其中, 豆类蔬菜不合格率最高(2.3%), 其次为茄果类(0.2%)。筛选得到基模型, 包括随机森林(random forest, RF)、类别特征梯度提升树(categorical boosting, CatBoost)、梯度提升(gradient boosting, GB)、极端梯度提升(extreme gradient boosting, XGBoost)和轻量级梯度提升机(light gradient boosting machine, LGBM), 最佳重采样方法为自适应合成抽样(adaptive synthetic sampling, ADASYN)技术。PSO-Stacking模型在测试集上的精确率(0.91)、召回率(0.83)、F1值(0.87)和曲线下面积(area under the curve, AUC)值(0.91)均为最高。结论 PSO-Stacking模型在不均衡食品安全抽检数据中表现优异, 能准确预测蔬菜中倍硫磷不合格样本, 为蔬菜监督抽检及风险预警提供技术支撑。
英文摘要:
      Objective To establish a vegetable safety risk prediction model based on the particle swarm optimization (PSO) algorithm and the stacked generalization (Stacking) model, and to predict the sampling results of fenthion in vegetables sold in Shanghai. Methods Based on the sampling data of fenthion in vegetables sold in Shanghai from 2021 to 2023, task type, sampling area, sampling link, sampling place, sampling month, testing institution, and vegetable variety were selected as feature variables. The target variable was whether the sampling results for fenthion in vegetables were qualified. The PSO-Stacking prediction model was constructed using ten-fold cross-validation to select effective machine learning models and resampling methods and optimized the model parameters using the PSO algorithm. Results Fenthion-positive samples were found in 55 out of 3889 vegetable samples, with an overall failure rate of 1.4%. Bean vegetables had the highest rate at 2.3%, followed by eggplant and fruiting vegetables at 0.2%. The base models were obtained through screening, including Random Forest (RF), categorical boosting (CatBoost), gradient boosting (GB), extreme gradient Boosting (XGBoost), and light gradient boosting machine (LGBM). The best resampling technique was adaptive synthetic sampling (ADASYN). The PSO-Stacking model achieved the highest precision (0.91), recall (0.83), F1 score (0.87), and area under the curve (AUC) value (0.91) on the test set. Conclusion The PSO-Stacking model effectively addresses imbalanced food safety sampling data, accurately predicts the unqualified fenthion samples in vegetables, and provides technical support for vegetable supervision, sampling and risk warning.
查看全文  查看/发表评论  下载PDF阅读器