Abstract
[Objective] To address problems in X-ray-based foreign object detection in packaged foods, including low accuracy caused by the high proportion of low-frequency features in images and small grayscale differences between foreign objects and the background, as well as the loss of micro foreign object features, an improved intelligent detection scheme is proposed to overcome the inability of traditional detection methods to meet the real-time and reliability requirements of automated production lines. [Methods] Based on the intelligent detection system for foreign objects in packaged foods, this study proposes an intelligent detection method for foreign objects in packaged foods integrating an improved YOLOv 13 model and X-ray. The core feature extraction module, DC-A2C2F, is redesigned to precisely focus on regions with sharp gray-level variations along foreign object boundaries, thus enhancing the discriminability between foreign object features and the background. A multi-order feature aggregation module (MFAM) is introduced into the backbone network to mitigate the dilution of micro foreign object features and retain critical detail information. A dual-path fusion pyramid network (DFPN) is designed to optimize the neck structure, achieving balanced matching between semantic and detailed information to accommodate the detection requirements of foreign objects of different sizes. [Results] The proposed method achieves a mean average precision of over 98.50% for multiple types of foreign objects, including metal, glass, and plastic. Compared with the YOLOv 13 model, the proposed method reduces the missed detection rate from 2.2% to 0.4% while maintaining an inference speed of over 50 frames per second. [Conclusion] The improved YOLOv 13 model accurately adapts to the feature characteristics of X-ray images. The proposed detection method combines high detection accuracy, a low missed detection rate, and real-time performance, fully meeting the real-time detection requirements of automated production lines.
Publication Date
4-3-2026
First Page
74
Last Page
81
DOI
10.13652/j.spjx.1003.5788.2025.60180
Recommended Citation
Dechao, GUO; Zizhi, LIU; Hao, ZHANG; and Qiang, ZHAO
(2026)
"Intelligent detection method for foreign objects in packaged foods based on improved YOLOv 13 and X-ray,"
Food and Machinery: Vol. 42:
Iss.
2, Article 9.
DOI: 10.13652/j.spjx.1003.5788.2025.60180
Available at:
https://www.ifoodmm.cn/journal/vol42/iss2/9
References
[1] 赵敏,范英,高思伟,等.结合 Swin-Transformer 的改进 YOLOv 5s包装盒缺陷检测算法 [J].制造业自动化,2024,46(12):34-40.ZHAO M,FAN Y,GAO S W,et al.Improved YOLOv 5s packaging defect detection algorithm combined with Swin-Transformer [J].Manufacturing Automation,2024,46(12):34-40.
[2] CHEN C,WU B,ZHANG H Y.An image recognition technology based on deformable and CBAM convolution Resnet 50[J].IAENG International Journal of Computer Science,2023,50(1):8.
[3] HOSSEINI A,HOOSHANFAR K,OMRANI P,et al.Brand visibility in packaging:a deep learning approach for logo detection,saliency-map prediction,and logo placement analysis[J].Discover Applied Sciences,2025,7(6):537.
[4] DHAL S B,KAR D.Leveraging artificial intelligence and advanced food processing techniques for enhanced food safety,quality,and security:a comprehensive review [J].Discover Applied Sciences,2025,7(1):75.
[5] HUANG J,REN L F,ZHOU X K,et al.An improved neural network based on SENet for sleep stage classification [J].IEEE Journal of Biomedical and Health Informatics,2022,26(10):4 948-4 956.
[6] 周 运 磊,董 效 杰,刘 三 军,等.基 于 改 进 YOLOv 11n的 轻 量 级电力设备过热故障红外图像检测算法 [J].湖北民族大学学报(自然科学版),2025,43(1):114-118,140.ZHOU Y L,DONG X J,LIU S J,et al.The lightweight power equipment overheating fault infrared images detection algorithm based on the improved YOLOv 11n[J].Journal of Hubei Minzu University (Natural Sciences Edition),2025,43(1):114-118,140.
[7] LIU Y,ZHANG C S,DONG X J.A survey of real-time surface defect inspection methods based on deep learning [J].Artificial Intelligence Review,2023,56(10):12 131-12 170.
[8] 李培刚,毕峰华,陈盼,等.主食菜肴非金属异物检测研究现状及展望 [J].农业工程,2025,15(5):120-125.LI P G,BI F H,CHEN P,et al.Research progress and prospect of non-metallic foreign body detection in staple foods and dishes[J].Agricultural Engineering,2025,15(5):120-125.
[9] 姚建峰,赵亚彬,王鹏涛,等.X射线食品异物图像标注方法与智能检测算法 [J/OL ].信阳师范大学学报 (自然科学版).(2025-12-19) [2026-01-01].https://link.cnki.net/urlid/ 41.1476.N.20251219.0957.002.YAO J F,ZHAO Y B,WANG P T,et al.Foreign object annotation method and intelligent detection algorithm for X-ray food images [J/OL ].Journal of Xinyang Normal University (Natural Science Edition).(2025-12-19) [2026-01-01].https://link.cnki.net/urlid/ 41.1476.N.20251219.0957.002.
[10] 唐浩奇,杨君,陈荣昌.基于深度学习的面食异物检测方法[J].CT理论与应用研究 (中英文),2025,34(4):560-570.TANG H Q,YANG J,CHEN R C.A method for detecting foreign objects in pastries based on deep learning [J].CT Theory and Applications,2025,34(4):560-570.
[11] 邓阿琴,胡平霞.基于改进卷积神经网络的食品异物自动识别方法 [J].食品与机械,2022,38(7):133-137.DENG A Q,HU P X.An automatic recognition method for food foreign matter based on improved convolutional neural network [J].Food & Machinery,2022,38(7):133-137.
[12] 徐 杰,刘 畅.基 于 改 进 ELM 和 计 算 机 视 觉 的 核 桃 缺 陷 检 测[J].食品与机械,2024,40(5):122-127.XU J,LIU C.Walnut defect detection based on improved ELM and computer vision [J].Food & Machinery,2024,40(5):122-127.
[13] CHEN X Q,YANG C Z,MO J,et al.CSPNeXt:a new efficient token hybrid backbone [J].Engineering Applications of Artificial Intelligence,2024,132:107886.
[14] 王静蕾,赵英杰,李峰,等.基于改进 YOLOv 10 的盒装食品生产线包装缺陷检测方法 [J].食品与机械,2025,41(4):236-241.WANG J L,ZHAO Y J,LI F,et al.Packaging defect detection method for boxed food production line based on improved YOLOv 10[J].Food & Machinery,2025,41(4):236-241.
[15] 向 硕,曾 水 玲,贺 刚 健,等.基 于 YOLOv 8n改 进 的 轻 量 化 酒品包装缺陷检测算法 [J].包装与食品机械,2025,43(4):1-12.XIANG S,ZENG S L,HE G J,et al.Improved lightweight algorithm for liquor packaging defect detection based on YOLOv 8n[J].Packaging and Food Machinery,2025,43(4):1-12.
[16] 古莹奎,叶彪彪,郭明健,等.基于改进 RT-DETR 的饼干包装外观缺陷快速检测 [J].食品与机械,2025,41(2):234-241.GU Y K,YE B B,GUO M J,et al.Rapid detection method of biscuit packaging appearance defects based on improved RT-DETR [J].Food & Machinery,2025,41(2):234-241.
[17] 付赫,王桂英.饮料包装缺陷检测的轻量化算法研究 [J].包装与食品机械,2025,43(1):32-39.FU H,WANG G Y.Research on lightweight algorithms for beverage packaging defect detection [J].Packaging and Food Machinery,2025,43(1):32-39.
[18] 胡博,熊华德,刘尧,等.基于改进 YOLOv 8的脱水蔬菜异物检 测 方 法 [J].东 北 大 学 学 报 (自 然 科 学 版),2025,46(11):19-29,65.HU B,XIONG H D,LIU Y,et al.Foreign object detection method for dehydrated vegetables based on YOLOv 8[J].Journal of Northeastern University (Natural Science),2025,46(11):19-29,65.
[19] ZHANG R M,JIA Z N,LI J X,et al.An improved EfficientDet remote sensing target detection algorithm based on multi-sensory field feature enhancement [J].Electronics Optics & Control,2024,31(7):53.
[20] 施 利 春,边 可 可,王 松 伟,等.基 于 改 进 U-Net 和IWOA-LSSVM 的 番 茄 综 合 品 质 检 测 方 法 研 究 [J].食 品 与 机 械,2025,41(8):109-117.SHI L C,BIAN K K,WANG S W,et al.Research on tomato comprehensive quality detection method based on improved U-Net and IWOA-LSSVM [J].Food & Machinery,2025,41(8):109-117.
