食品科学 ›› 2025, Vol. 46 ›› Issue (19): 1-9.doi: 10.7506/spkx1002-6630-20250303-013

• 食源性危害物防控技术专栏 •    

基于Transformer架构的原奶中黄曲霉毒素的定性预测

王龙,宋晓东,丁浩晗,董冠军,崔晓晖,黄骅迪,张程,乌日娜   

  1. (1.江南大学人工智能与计算机学院,江苏 无锡 214122;2.国家市场监督管理总局重点实验室(乳品质量数智监控技术),内蒙古 呼和浩特 011517;3.江南大学未来食品科学中心,江苏 无锡 214122;4.武汉大学国家网络安全学院,湖北 武汉 430072;5.江南大学环境与生态学院,江苏 无锡 214122)
  • 发布日期:2025-09-16
  • 基金资助:
    “十四五”国家重点研发计划重点专项(2024YFE0199500;2022YFF1101100)

Qualitative Prediction of Aflatoxin in Raw Milk Based on Transformer Architecture

WANG Long, SONG Xiaodong, DING Haohan, DONG Guanjun, CUI Xiaohui, HUANG Huadi, ZHANG Cheng, WU Rina   

  1. (1. School of Artificial Intelligence and Computer Science, Jiangnan University, Wuxi 214122, China;2. State Key Laboratory of Dairy Quality Digital Intelligence Monitoring Technology, State Administration for Market Regulation, Hohhot 011517, China; 3. Science Center for Future Foods, Jiangnan University, Wuxi 214122, China; 4. School of Cyber Science and Engineering, Wuhan University, Wuhan 430072, China; 5. School of Environment & Ecology, Jiangnan University, Wuxi 214122, China)
  • Published:2025-09-16

摘要: 基于机器学习与深度学习技术,采集我国2022—2024年间不同区域和季节的原奶成分数据,探索一种利用易测得数据定性预测黄曲霉毒素M1的方法,降低乳品工厂的批量检测成本。研究基于筛选得到的16 类特征数据集,采用线性回归、随机森林、支持向量机等多种机器学习方法以及基于Transformer架构的方法进行预测实验,并通过对比实验分析这些模型在阴性样本和阳性样本上的预测性能及方差稳定性。实验证明,基于Transformer架构方法的预测方法综合性能最佳。同时,研究还通过消融实验探究了Transformer架构下位置编码与注意力机制对模型性能的影响。总的来说,本研究通过深度学习方法实现了黄曲霉毒素M1的高效定性预测,相对于传统方法而言,该方法既可以满足高通量的需求,又通过减少多余检测环节的方式显著降低了检测成本,为乳制品安全检测提供了数智化转型的解决方案和模型优化的理论依据。

关键词: 食品安全;机器学习;深度学习;黄曲霉毒素;定性预测

Abstract: In this study, using machine learning and deep learning techniques, we collected raw milk composition data from different regions and seasons in China during the period of 2022–2024 and proposed a method for qualitative prediction of aflatoxin M1 (AFM1) based on easy-to-measure data, aiming to reduce the cost of batch testing in dairy factories. Based on the 16 selected classes of feature datasets, we conducted prediction experiments using various machine learning methods such as linear regression (LR), random forest (RF), support vector machine (SVM) and a method based on Transformer architecture, and analyzed the prediction performance and variance stability of these models on negative samples and positive samples through comparative experiments. The experimental results confirmed that the prediction method based on Transformer architecture had the best overall performance. Meanwhile, we also explored the effect of location coding and attention mechanism on model performance under Transformer architecture through ablation experiments. Overall, the new method based on deep learning enabled efficient qualitative prediction of AFM1, which can meet the demand for high throughput and significantly reduce the detection cost by eliminating redundant detection steps when compared with the traditional method, providing a solution of digital transformation and a theoretical basis for model optimization for dairy product safety detection.

Key words: food safety; machine learning; deep learning; aflatoxin; qualitative prediction

中图分类号: