Skip to main content
Log in

Detection of small defects on packaging prints under sample-few conditions

  • Original Paper
  • Published:
Signal, Image and Video Processing Aims and scope Submit manuscript

Abstract

The objective of this paper is to address the challenges associated with acquiring defect samples and detecting small defects in print defect detection. We propose a methodology for generating defect samples using the pix2pix-HDNet network, which first generates coarse defects in designated areas of defect-free samples and then adjusts their brightness for visual consistency with the background, resulting in realistic defect samples. Additionally, we improve YOLOv7 and propose a print defect detection algorithm called DF-YOLOv7, which comprises two innovative modules: the Detail Extraction Module (DEM) and the Feature Enhancement Module with Omni-dimensional Dynamic Convolution (FEM-ODConv). DEM enhances the network’s ability to capture detailed information and refine the edge information of defects, while FEM-ODConv improves the extraction of contextual and semantic information, enhancing the weak features of small defects and effectively suppressing background interference. We collected three common print defects, namely ink blot, black point, and missing print, and expanded the defect samples using pix2pix-HDNet. Training DF-YOLOv7 with the expanded dataset achieved an accuracy of 92.1%, surpassing several benchmark models and state-of-the-art methods. Our results demonstrate that the proposed pix2pix-HDNet effectively generates realistic defect samples, facilitating the training of a defect detection network, and that DF-YOLOv7 provides more accurate detection of small print defects.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Data availability

Some or all data, models, or code generated or used during the study are available from the corresponding author by request.

References

  1. Ren, S.Q., He, K.M., Girshick, R., Sun, J.: Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 39(6), 1137–1149 (2017)

    Article  MATH  Google Scholar 

  2. Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C. Y., Berg, A. C.: SSD: Single shot multibox detector. In: Computer Vision–ECCV 2016, pp. 21-37(2016)

  3. Redmon, J., Divvala, S., Girshick, R., Farhadi, A.: You only look once: Unified, real-time object detection. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 779–788(2016)

  4. Redmon J., Farhadi A.: YOLO9000: better, faster, stronger. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7263–7271(2017)

  5. Redmon J., Farhadi A.: YOLOv3: an incremental improvement. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 89–95(2018)

  6. Bochkovskiy A., Wang C. Y., Liao H. Y. M.: Yolov4: Optimal speed and accuracy of object detection. https://arxiv.org/abs/2004.10934(2020)

  7. Wang C. Y., Bochkovskiy A., Liao H. Y. M.: YOLOv7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7464–7475(2023)

  8. Lai, H., Chen, L., Liu, W., Yan, Z., Ye, S.: STC-YOLO: small object detection network for traffic signs in complex environments. Sensors. 23(11), 5307 (2023)

    Article  MATH  Google Scholar 

  9. Du, X., Song, L., Lv, Y., Qiu, S.: A lightweight military target detection algorithm based on improved YOLOv5. Electronics 11(20), 3263 (2022)

    Article  MATH  Google Scholar 

  10. Li, J., Li, S., Li, X., Miao, S., Dong, C., Gao, C., Cui, J.: Primary bone tumor detection and classification in full-field bone radiographs via YOLO deep learning model. Eur. Radiol. 33(6), 4237–4248 (2023)

    Article  MATH  Google Scholar 

  11. Li, Y., Xu, S., Zhu, Z., Wang, P., Li, K., He, Q., Zheng, Q.: EFC-YOLO: an efficient surface-defect-detection algorithm for steel strips. Sensors. 23(17), 7619 (2023)

    Article  Google Scholar 

  12. Niu, S., Li, B., Wang, X., Lin, H.: Defect image sample generation with GAN for improving defect recognition. IEEE Trans. Autom. Sci. Eng. 17(3), 1611–1622 (2022)

    MATH  Google Scholar 

  13. Zhang, G., Cui, K., Hung, T. Y., Lu, S.: Defect-GAN: High-fidelity defect synthesis for automated defect inspection. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pp. 2524–2534(2021)

  14. Zhang, H., Pan, D., Liu, J., Jiang, Z.: A novel MAS-GAN-based data synthesis method for object surface defect detection. Neurocomputing 499, 106–114 (2022)

    Article  MATH  Google Scholar 

  15. Wang, R., Hoppe, S., Monari, E., Huber, M. F.: Defect transfer gan: Diverse defect synthesis for data augmentation. https://arxiv.org/abs/2302.08366(2023)

  16. Lou, H., Zheng, Y., Liao, K., Lei, H., Li, J.: Defect object detection for printed matter based on siamese-YOLOv4. J. Comput. Appl. 41(11), 3206–3212 (2021)

    MATH  Google Scholar 

  17. Chen, W., Zheng, Y., Liao, K., et al.: Small target detection algorithm for printing defects detection based on context structure perception and multi-scale feature fusion. SIViP 18(1), 657–667 (2024)

    Article  MATH  Google Scholar 

  18. Wang, C., Wang, H., Pan, P.: Local contrast and global contextual information make infrared small object salient again. https://arxiv.org/abs/2301.12093(2023)

  19. Cheng, G., Lang, C., Maoxiong, Wu., Xie, X., Yao, X., Han, J.: Feature enhancement network for object detection in optical remote sensing images. J. Remote Sens. (2021). https://doi.org/10.34133/2021/9805389

    Article  MATH  Google Scholar 

  20. Zhang, K., Shen, H.: Multi-stage feature enhancement pyramid network for detecting objects in optical remote sensing images. Remote Sens. 14(3), 579 (2022)

    Article  MATH  Google Scholar 

  21. Shi, T., Gong, J., Hu, J., Zhi, X., Zhang, W., Zhang, Y., Bao, G.: Feature-enhanced CenterNet for small object detection in remote sensing images. Remote Sensing. 14(21), 5488 (2022)

    Article  MATH  Google Scholar 

  22. Isola, P., Zhu, J. Y., Zhou, T., Efros, A. A.: Image-to-image translation with conditional adversarial networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1125–1134(2017)

  23. Li, S., Lin, J., Yang, X., Ma, J., Chen, Y.: BPFD-Net: enhanced dehazing model based on Pix2pix framework for single image. Mach. Vis. Appl. 32, 1–13 (2021)

    Article  MATH  Google Scholar 

  24. Sun, J.: Colorization of gray scale images based on convolution block attention and Pix2pix network. J. Phys. Conf. Ser. 2646(1), 012032 (2023)

    Article  Google Scholar 

  25. Ma, Y., Hua Y., Zuo Z.: Infrared Image Generation By Pix2pix Based on Multi-receptive Field Feature Fusion. In: 2021 International Conference on Control, Automation and Information Sciences (ICCAIS), pp. 1029–1036(2021)

  26. Chen, H., Gu, Z., Li, Y., Lan, J., Meng, C., Wang, W., Li, H.: Hierarchical dynamic image harmonization. In: Proceedings of the 31st ACM International Conference on Multimedia, pp. 1422–1430(2023)

  27. Chen, Z., He, Z., Lu, Z.M.: DEA-Net: single image dehazing based on detail-enhanced convolution and content-guided attention. IEEE Trans. Image Process. 33, 1002–1015 (2024)

    Article  MATH  Google Scholar 

  28. Yang, K., Hu, T., Dai, K., Chen, G., Cao, Y., Dong, W., Yan, Q.: CRNet: A Detail-Preserving Network for Unified Image Restoration and Enhancement Task. arxiv: 2404.14132(2024)

  29. Li, C., Zhou, A., Yao, A.: Omni-dimensional dynamic convolution. arxiv: 2209.07947(2022)

  30. Zhang, Y., Ye, M., Zhu, G., Liu, Y., Guo, P., Yan, J.: FFCA-YOLO for small object detection in remote sensing images. IEEE Trans. Geosci. Remote Sens. 62, 1–15 (2024)

    Article  MATH  Google Scholar 

Download references

Funding

This work was supported by the NSFC via Project 62076200, Natural Science Foundation of Shaanxi Province No.2021JM-340, Science Technology Project of Weinan 2021ZDYF-GYCX-150.

Author information

Authors and Affiliations

Authors

Contributions

Liu. obtained the experimental data and wrote the main manuscript text, Zheng. and Liao. guided the experimental model improvement and experimental data sorting, and Yang. prepared Figs. 1, 2, 3, 4 and 5. All authors reviewed the manuscript. Sun. and Zhong. supervised the writing of the thesis.

Corresponding authors

Correspondence to Haiwen Liu or Yuanlin Zheng.

Ethics declarations

Competing interests

The authors declare no competing interests.

Ethical approval

Not applicable.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Liu, H., Zheng, Y., Liao, K. et al. Detection of small defects on packaging prints under sample-few conditions. SIViP 19, 323 (2025). https://doi.org/10.1007/s11760-025-03882-6

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11760-025-03882-6

Keywords