•  
  •  
 

Corresponding Author(s)

申高(1986—),男,安阳职业技术学院讲师,硕士。E-mail:mbngfs@sina.com

Abstract

[Objective] To propose an intelligent detection method that balances detection accuracy and speed for the problems of low manual detection efficiency, high missed and false detection rates, and insufficient recognition ability of traditional machine vision algorithms for complex texture packaging and small defects in packaging defect detection at current food production lines. [Methods] Using Swin Transformer as the core feature extraction module, this study utilizes its modeling ability for global image information and multi-scale feature fusion advantages to accurately capture defect features, such as small wrinkles and printing offsets on the packaging surface. Simultaneously, the YOLOv 12 fast detection framework is introduced, which optimizes the neck network and loss function to achieve fast localization and classification of defect areas, forming an integrated detection process of high-precision feature extraction and fast object detection. [Results] The average detection accuracy of this method for common defect types is higher than 96.50%, improving by over 10.00% compared to the method before optimization. Single image detection takes less than 10 ms, meeting the real-time detection requirement of 30 frames per second for the production line.Additionally, this method still maintains stable performance in tests for different foods, demonstrating significantly better robustness than the comparative method. [Conclusion] By integrating the advantages of Swin Transformer feature extraction with the fast detection capability of YOLOv 12, this study solves the core problem of balancing accuracy and |speed in food packaging defect detection.

Publication Date

1-13-2026

First Page

236

Last Page

244

DOI

10.13652/j.spjx.1003.5788.2025.60135

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):274-281.
[3] 蔡 家 一,刘 世 伟,单 龙 祥,等.基 于 机 器 视 觉 与 YOLOv 5的 裂纹 蛋 分 拣 机 器 人 设 计 与 试 验 [J].智 能 化 农 业 装 备 学 报 (中 英文),2025,6(1):41-50.CAI J Y,LIU S W,DAN L X,et al.Design and experiment of cracked egg sorting robot based on machine vision and YOLOv 5 [J].Journal of Intelligent Agricultural Mechanization,2025,6(1):41-50.
[4] 夏军勇,王康宇,周宏娣.基于改进 Faster R-CNN 的食品包装缺陷检测 [J].食品与机械,2023,39(11):131-136,151.XIA J Y,WANG K Y,ZHOU H D.Food packaging defect detection by improved network model of Faster R-CNN [J].Food & Machinery,2023,39(11):131-136,151.
[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] 施 利 春,边 可 可,王 松 伟,等.基 于 改 进 U-Net 和IWOA-LSSVM 的番茄综合品质检测方法研究 [J].食品与机械,2025,41(8):109-117.SHI L C,BIAN K K,WANG W S,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.
[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] 徐杰,刘畅.基于改进 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.
[9] 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.
[10] 王静蕾,赵英杰,李峰,等.基于改进 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.
[11] 向 硕,曾 水 玲,贺 刚 健,等.基 于 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.
[12] 古莹奎,叶彪彪,郭明健,等.基于改进 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.
[13] 付赫,王桂英.饮料包装缺陷检测的轻量化算法研究 [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.
[14] 韩 宇,齐 康 康,郑 纪 业,等.基 于 改 进 YOLOv 11的 轻 量 化 肉牛面部识别方法 [J].智慧农业 (中英文 ),2025,7(3):173-184.HAN Y,QI K K,ZHENG J Y,et al.Lightweight cattle facial recognition method based on improved YOLOv 11[J].Smart Agriculture,2025,7(3):173-184.
[15] 刘达,朱兆优,叶海鹏,等.基于改进 YOLOv 5的酒瓶缺陷检测方法研究 [J].机电工程技术,2024,53(3):211-215.LIU D,ZHU Z Y,YE H P,et al.Research on defect detection method for wine bottles based on improved YOLOv 5[J].Mechanical & Electrical Engineering Technology,2024,53(3):211-215.
[16] 陈卫东,刘超,王莹,等.基于机器视觉的食品瓶罐包装缺陷检测研究进展 [J].粮油食品科技,2024,32(4):185-191.CHEN W D,LIU C,WANG Y,et al.Research progress on inspecting food bottle and can packaging shortcomings based on machine vision [J].Science and Technology of Cereals,Oils and Foods,2024,32(4):185-191.
[17] 吴昊然,陈晓星,高傲.基于深度卷积神经网络的食品包装缺 陷 检 测 算 法 研 究 [J].智 能 计 算 机 与 应 用,2023,13(3):10-15.WU H R,CHEN X X,GAO A.Research on food packaging defect detection algorithm based on deep convolutional neural network [J].Intelligent Computer and Applications,2023,13(3):10-15.
[18] 张润梅,贾振楠,李佳祥,等.基于多感受野特征增强的改进EfficientDet 遥感目标检测算法 [J].电光与控制,2024,31(7):53-60,96.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-60,96.
[19] 刘 雪,沈 长 盈,吕 学 泽,等.基 于 改 进 MobileNetV 3-Large 的鸡 蛋 新 鲜 度 识 别 模 型 [J].农 业 工 程 学 报,2022,38(17):196-204.LIU X,SHEN C Y,LYU X Z,et al.Recognizing egg freshness using an improved MobileNetV 3-Large [J].Transactions of the Chinese Society of Agricultural Engineering,2022,38(17):196-204.
[20] 文韬,代兴勇,李浪,等.基于机器视觉与光谱融合的柑橘品质无损检测分级系统设计与试验 [J].江苏大学学报 (自然科学版 ),2024,45(1):38-45.WEN T,DAI X Y,LI L,et al.Design and experiment of non-destructive testing and grading system for citrus quality based on machine vision and spectral fusion [J].Journal of Jiangsu University (Natural Science Edition ),2024,45(1):38-45.

Share

COinS
 
 

To view the content in your browser, please download Adobe Reader or, alternately,
you may Download the file to your hard drive.

NOTE: The latest versions of Adobe Reader do not support viewing PDF files within Firefox on Mac OS and if you are using a modern (Intel) Mac, there is no official plugin for viewing PDF files within the browser window.