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.






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
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)
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)
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)
Redmon J., Farhadi A.: YOLO9000: better, faster, stronger. In: Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 7263–7271(2017)
Redmon J., Farhadi A.: YOLOv3: an incremental improvement. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 89–95(2018)
Bochkovskiy A., Wang C. Y., Liao H. Y. M.: Yolov4: Optimal speed and accuracy of object detection. https://arxiv.org/abs/2004.10934(2020)
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)
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)
Du, X., Song, L., Lv, Y., Qiu, S.: A lightweight military target detection algorithm based on improved YOLOv5. Electronics 11(20), 3263 (2022)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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
Zhang, K., Shen, H.: Multi-stage feature enhancement pyramid network for detecting objects in optical remote sensing images. Remote Sens. 14(3), 579 (2022)
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)
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)
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)
Sun, J.: Colorization of gray scale images based on convolution block attention and Pix2pix network. J. Phys. Conf. Ser. 2646(1), 012032 (2023)
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)
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)
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)
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)
Li, C., Zhou, A., Yao, A.: Omni-dimensional dynamic convolution. arxiv: 2209.07947(2022)
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)
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
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
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.
About this article
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
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11760-025-03882-6