Detection and Information Restoration of Highly Soiled QR Code

WANG Yongchao, CAO Peng

Packaging Engineering ›› 2026, Vol. 47 ›› Issue (5) : 119-129.

PDF(7970 KB)
PDF(7970 KB)
Packaging Engineering ›› 2026, Vol. 47 ›› Issue (5) : 119-129. DOI: 10.19554/j.cnki.1001-3563.2026.05.014
Automatic and Intelligent Technology

Detection and Information Restoration of Highly Soiled QR Code

  • WANG Yongchao, CAO Peng*
Author information +
History +

Abstract

The work aims to propose a highly soiled QR code image detection and information restoration technology to solve the problem that QR codes are severely damaged and difficult to read due to multiple factors, even human factors. Firstly, a cross-scale connection and attention mechanism was introduced to optimize the YOLO11n network, enabling rapid and accurate location of highly soiled QR codes in complex backgrounds. Secondly, a structure-constrained diffusion model was presented to restore the information of the positioned image. Different from the traditional methods, the model presented in this paper took the structural information such as the positioning symbol, correction symbol and encoding grid of the QR code as the prior constraints in the restoration process, making the restored image structurally correct and standardized, and effectively improving the probability of being readable and decoded. The experimental results showed that the detection accuracy (mAP@0.5-0.95) of the optimized YOLO11n model presented in this paper on the self-built highly soiled QR code dataset and the public MSQ dataset reached 75.3% and 77.1%, respectively. Besides, when the structure-constrained diffusion model dealt with QR codes with a soiled area exceeding 40%, its decoding success rate reached 54%. The model proposed in this paper can effectively solve the restoration problem of highly soiled QR codes and the problem of correct reading.

Key words

QR Code / YOLO11n / diffusion model / attention mechanism / image restoration

Cite this article

Download Citations
WANG Yongchao, CAO Peng. Detection and Information Restoration of Highly Soiled QR Code[J]. Packaging Engineering. 2026, 47(5): 119-129 https://doi.org/10.19554/j.cnki.1001-3563.2026.05.014

References

[1] 燕雨薇, 余粟. 二维码技术及其应用综述[J]. 智能计算机与应用, 2019, 9(5): 194-197.
YAN Y W, YU S.A Review on Two-Dimensional Code Technology and Its Application[J]. Intelligent Computer and Applications, 2019, 9(5): 194-197.
[2] WANG S.Substation Personnel Safety Detection Network Based on YOLOv4[C]// 2021 IEEE 2nd International Conference on Big Data, Artificial Intelligence and Internet of Things Engineering (ICBAIE). Nanchang, China. IEEE, 2021: 877-881.
[3] 李建刚, 黄诗浩, 郑启强, 等. 批量高速二维码视觉检测识别系统[J]. 应用光学, 2021, 42(2): 276-282.
LI J G, HUANG S H, ZHENG Q Q, et al.Identification System for Batch of Two-Dimensional Code with High Speed Based on Machine Vision[J]. Journal of Applied Optics, 2021, 42(2): 276-282.
[4] 杨建华, 方园园, 赵轩. 基于改进维纳滤波算法的运动模糊二维码图像复原方法[J]. 激光杂志, 2024, 45(2): 91-94.
YANG J H, FANG Y Y, ZHAO X.Image Restoration Method of Motion Blur Two-Dimensional Code Based on Improved Wiener Filter Algorithm[J]. Laser Journal, 2024, 45(2): 91-94.
[5] 郭建民, 冯立杰. 复杂背景下的QR二维码解码研究[J]. 信息系统工程, 2015(11): 137-138.
GUO J M, FENG L J.Research on QR Code Decoding under Complex Background[J]. China CIO News, 2015(11): 137-138.
[6] 张传栋, 吴倩, 孙飒爽, 等. 基于机器视觉的复杂背景QR二维码有效分割方法研究[J]. 制造业自动化, 2016, 38(11): 21-24.
ZHANG C D, WU Q, SUN S S, et al.Segmentation of QR Code with Complex Background Based on Machine Vision[J]. Manufacturing Automation, 2016, 38(11): 21-24.
[7] VAN GENNIP Y, ATHAVALE P, GILLES J, et al.A Regularization Approach to Blind Deblurring and Denoising of QR Barcodes[J]. IEEE Transactions on Image Processing, 2015, 24(9): 2864-2873.
[8] 刘云, 邹复民, 蔡祈钦, 等. 改进YOLOv8n-Pose的形变QR码校正与识别[J]. 计算机系统应用, 2024, 33(12): 141-152.
LIU Y, ZOU F M, CAI Q Q, et al.Deformed QR Code Correction and Recognition Based on Improved YOLOv8n-Pose[J]. Computer Systems & Applications, 2024, 33(12): 141-152.
[9] JI Y P, ZHANG D, HE Y L, et al.Improved YOLO11 Algorithm for Insulator Defect Detection in Power Distribution Lines[J]. Electronics, 2025, 14(6): 1201.
[10] WANG B Z, XU J B, ZHANG J K, et al.Motion Deblur of QR Code Based on Generative Adversative Network[C]//Proceedings of the 2019 2nd International Conference on Algorithms, Computing and Artificial Intelligence. Sanya China. ACM, 2019: 166-170.
[11] ZHENG J H, ZHAO R L, LIN Z J, et al.EHFP-GAN: Edge-Enhanced Hierarchical Feature Pyramid Network for Damaged QR Code Reconstruction[J]. Mathematics, 2023, 11(20): 166-170.
[12] 赵水平. 二维码结构编码及生成技术探讨与实现[J]. 电脑知识与技术, 2017, 13(8): 259-261.
ZHAO S P.The Implementation and Discussion of 2-D Barcodes Generation Method[J]. Computer Knowledge and Technology, 2017, 13(8): 259-261.
[13] ZHANG L M, RAO A Y, AGRAWALA M.Adding Conditional Control to Text-to-Image Diffusion Models[C]// 2023 IEEE/CVF International Conference on Computer Vision (ICCV). Paris, France. IEEE, 2024: 3813-3824.
[14] DOHERTY J, GARDINER B, KERR E, et al.BiFPN-YOLO: One-Stage Object Detection Integrating Bi-Directional Feature Pyramid Networks[J]. Pattern Recognition, 2025, 160: 111209.
[15] WU Y R, ZHANG L L, LI H, et al.Feature Fusion Pyramid Network for End-to-End Scene Text Detection[J]. ACM Transactions on Asian and Low-Resource Language Information Processing, 2024, 23(11): 1-16.
[16] VASWANI A, SHAZEER N, PARMAR N, et al.Attention Is All You Need[C]// Advances in Neural Information Processing Systems (NeurIPS). 2017: 5998-6008.
[17] LI Y H, CHEN Y T, WANG N Y, et al.Scale-Aware Trident Networks for Object Detection[C]// 2019 IEEE/CVF International Conference on Computer Vision (ICCV). Seoul, Korea. IEEE, 2019: 6053-6062.
[18] ZHANG X, ZHOU X, LIN M, et al.ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 2018: 6848-6856. DOI: 10.1109/CVPR.2018.00716.
[19] XU Y W, PAGNUCCO M, SONG Y.An Edge Guided Coarse-to-Fine Generative Network for Image Outpainting[J]. Neurocomputing, 2023, 541: 126254.
[20] ZHAO X B, LI X.Vaccine-YOLOv10: Real-Time QR Code Detection Model for Complex Light Condition[J]. Journal of Real-Time Image Processing, 2025, 22(2): 81.
[21] LIU G L, REDA F A, SHIH K J, et al.Image Inpainting for Irregular Holes Using Partial Convolutions[C]// Computer Vision-ECCV 2018. Cham: Springer, 2018: 89-105.
[22] WANG A, CHEN H, LIU L H, et al. YOLOv10: Real-Time End-to-End Object Detection[EB/OL].2024: arXiv: 2405.14458. https://arxiv.org/abs/2405.14458
[23] TIAN Y J, YE Q X, DOERMANN D. YOLOv12: Attention-Centric Real-Time Object Detectors[EB/OL].2025: arXiv: 2502.12524. https://arxiv.org/abs/2502.12524
[24] DONG Q L, CAO C J, FU Y W.Incremental Transformer Structure Enhanced Image Inpainting with Masking Positional Encoding[C]// 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). New Orleans, LA, USA. IEEE, 2022: 11348-11358.
[25] LI Z, ZHANG Y N, DU Y F, et al.STNet: Structure and Texture-Guided Network for Image Inpainting[J]. Pattern Recognition, 2024, 156: 110786.
PDF(7970 KB)

Accesses

Citation

Detail

Sections
Recommended

/