Skip to main content

A Novel Combined GAN for Defects Generation Using Masking Mechanisms

  • Conference paper
  • First Online:
Pattern Recognition and Computer Vision (PRCV 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 15034))

Included in the following conference series:

  • 141 Accesses

Abstract

Defective images generated by generative adversarial networks (GANs) often exhibit insufficiently constructed defects. The discriminator’s dominance leads the generator to prioritize generating color blocks favored by the discriminator, disregarding the original information. In this paper, we propose a combined GAN that retains feature information, which comprises a defect generating GAN and a mask generating GAN. The two trained GANs are synergistically combined to generate defective images. Additionally, the structuration loss introduced in this paper guides and constrains the GAN model, aiming to preserve texture trends, grayscale distribution, and narrow defect regions. Experimental results show that our model produces high-quality images, with texture information closer to the original sample, and without the additional discriminators. This approach is evaluated against the latest detection model, demonstrating 4% improvement in effectiveness over the standard enhancement method.

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

Access this chapter

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

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Abdal, R., Qin, Y., Wonka, P.: Image2stylegan: How to embed images into the stylegan latent space? In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4432–4441 (2019)

    Google Scholar 

  2. Akçay, S., Atapour-Abarghouei, A., Breckon, T.P.: Skip-Ganomaly: Skip connected and adversarially trained encoder-decoder anomaly detection. In: 2019 International Joint Conference on Neural Networks (IJCNN), pp. 1–8 (2019)

    Google Scholar 

  3. Bergmann, P., Fauser, M., Sattlegger, D., Steger, C.: Mvtec ad–a comprehensive real-world dataset for unsupervised anomaly detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9592–9600 (2019)

    Google Scholar 

  4. Carrara, F., Amato, G., Brombin, L., Falchi, F., Gennaro, C.: Combining gans and autoencoders for efficient anomaly detection. In: 2020 25th International Conference on Pattern Recognition (ICPR), pp. 3939–3946. IEEE (2021)

    Google Scholar 

  5. Chen, X., Duan, Y., Houthooft, R., Schulman, J., Sutskever, I., Abbeel, P.: Infogan: Interpretable representation learning by information maximizing generative adversarial nets. Adv. Neural Inform. Process. Syst. (2016)

    Google Scholar 

  6. Choi, Y., Uh, Y., Yoo, J., Ha, J.W.: Stargan v2: Diverse image synthesis for multiple domains. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8188–8197 (2020)

    Google Scholar 

  7. DeVries, T., Taylor, G.W.: Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552 (2017)

  8. Fayyaz, R.A., Maqbool, M., Hanif, M.: Textile design generation using Gans. In: 2020 IEEE Canadian Conference on Electrical and Computer Engineering (CCECE), pp. 1–5 (2020)

    Google Scholar 

  9. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. Adv. Neural Inform. Process. Syst. (2014)

    Google Scholar 

  10. Haralick, R.M., Shanmugam, K., Dinstein, I.H.: Textural features for image classification. IEEE Trans. Syst. Man Cybern. 6, 610–621 (1973)

    Article  Google Scholar 

  11. He, H., Yuan, M., Liu, X.: Research on surface defect detection method of metal workpiece based on machine learning. In: 2021 6th International Conference on Intelligent Computing and Signal Processing (ICSP), pp. 881–884 (2021)

    Google Scholar 

  12. He, X., Wandt, B., Rhodin, H.: Ganseg: Learning to segment by unsupervised hierarchical image generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1225–1235 (2022)

    Google Scholar 

  13. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local Nash equilibrium. Adv. Neural Inform. Process. Syst. (2017)

    Google Scholar 

  14. Huang, Q., Ma, D., Zhang, Y., Xu, G.: Research on image synthesis of fabric replacement in suit customization. In: 2022 IEEE International Conference on Imaging Systems and Techniques (IST), pp. 1–6 (2022)

    Google Scholar 

  15. Huang, Y., Qiu, C., Yuan, K.: Surface defect saliency of magnetic tile. Visual Comput. 85–96 (2020)

    Google Scholar 

  16. 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)

    Google Scholar 

  17. Karras, T., Aittala, M., Hellsten, J., Laine, S., Lehtinen, J., Aila, T.: Training generative adversarial networks with limited data. Adv. Neural Inform. Process. Syst. 12104–12114 (2020)

    Google Scholar 

  18. Karras, T., Aittala, M., Laine, S., Härkönen, E., Hellsten, J., Lehtinen, J., Aila, T.: Alias-free generative adversarial networks. Adv. Neural Inform. Process. Syst. 852–863 (2021)

    Google Scholar 

  19. Li, C.L., Sohn, K., Yoon, J., Pfister, T.: Cutpaste: self-supervised learning for anomaly detection and localization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9664–9674 (2021)

    Google Scholar 

  20. Liang, Y., Zhang, J., Zhao, S., Wu, R., Liu, Y., Pan, S.: Omni-frequency channel-selection representations for unsupervised anomaly detection. IEEE Trans. Image Process. 4327–4340 (2023)

    Google Scholar 

  21. Liu, J., Wang, C., Su, H., Du, B., Tao, D.: Multistage Gan for fabric defect detection. IEEE Trans. Image Process. 3388–3400 (2019)

    Google Scholar 

  22. Ma, Y., Lei, W., Pang, Z., Zheng, Z., Tan, X.: Rebar clutter suppression and road defects localization in GPR b-scan images based on Supprebar-Gan and EC-yolov7 networks. IEEE Trans. Geosci. Remote Sens. (2024)

    Google Scholar 

  23. Mirza, M., Osindero, S.: Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784 (2014)

  24. Mushiake, D., Otomo, K., Nakatani, C., Ukita, N.: Shape preservation in image style transfer for gaze estimation. In: 2023 18th International Conference on Machine Vision and Applications (MVA), pp. 1–5 (2023)

    Google Scholar 

  25. Niu, S., Li, B., Wang, X., Lin, H.: Defect image sample generation with Gan for improving defect recognition. IEEE Trans. Autom. Sci. Eng. 1611–1622 (2020)

    Google Scholar 

  26. Niu, S., Li, B., Wang, X., Peng, Y.: Region-and strength-controllable Gan for defect generation and segmentation in industrial images. IEEE Trans. Indus. Informatics 4531–4541 (2021)

    Google Scholar 

  27. Qu, Y., Chen, Y., Huang, J., Xie, Y.: Enhanced pix2pix dehazing network. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8160–8168 (2019)

    Google Scholar 

  28. Shaw, P., Uszkoreit, J., Vaswani, A.: Self-attention with relative position representations. arXiv preprint arXiv:1803.02155 (2018)

  29. Shi, Y., Cui, L., Qi, Z., Meng, F., Chen, Z.: Automatic road crack detection using random structured forests. IEEE Trans. Intell. Transp. Syst. 3434–3445 (2016)

    Google Scholar 

  30. Sun, L., Xia, C., Yin, W., Liang, T., Philip, S.Y., He, L.: Mixup-transformer: Dynamic data augmentation for nlp tasks. In: 28th International Conference on Computational Linguistics, COLING 2020, pp. 3436–3440 (2020)

    Google Scholar 

  31. Tabernik, D., Šela, S., Skvarč, J., Skočaj, D.: Segmentation-based deep-learning approach for surface-defect detection. J. Intell. Manuf. 759–776 (2020)

    Google Scholar 

  32. Tran, N.T., Tran, V.H., Nguyen, N.B., Nguyen, T.K., Cheung, N.M.: On data augmentation for Gan training. IEEE Trans. Image Process. 1882–1897 (2021)

    Google Scholar 

  33. Voita, E., Talbot, D., Moiseev, F., Sennrich, R., Titov, I.: Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418 (2019)

  34. Wang, R., Hoppe, S., Monari, E., Huber, M.F.: Defect transfer gan: Diverse defect synthesis for data augmentation. arXiv preprint arXiv:2302.08366 (2023)

  35. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Process. 600–612 (2004)

    Google Scholar 

  36. Woo, S., Park, J., Lee, J.Y., Kweon, I.S.: Cbam: convolutional block attention module. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 3–19 (2018)

    Google Scholar 

  37. Xie, J., Ouyang, H., Piao, J., Lei, C., Chen, Q.: High-fidelity 3d gan inversion by pseudo-multi-view optimization. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 321–331 (2023)

    Google Scholar 

  38. Zhang, B., Gu, S., Zhang, B., Bao, J., Chen, D., Wen, F., Wang, Y., Guo, B.: Styleswin: Transformer-based Gan for high-resolution image generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11304–11314 (2022)

    Google Scholar 

  39. 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)

    Google Scholar 

  40. Zhang, Y., Zou, H., Wang, J., Lei, Z., Zhou, M.: Lightweight neural network-based real-time pcb defect detection system. In: 2023 CAA Symposium on Fault Detection, Supervision and Safety for Technical Processes (SAFEPROCESS), pp. 1–6 (2023)

    Google Scholar 

  41. Zhao, S., Liu, Z., Lin, J., Zhu, J.Y., Han, S.: Differentiable augmentation for data-efficient Gan training. Adv. Neural Inform. Process. Syst. 7559–7570 (2020)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bo Li .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bai, Z., Li, B., Ma, X., Cheng, L. (2025). A Novel Combined GAN for Defects Generation Using Masking Mechanisms. In: Lin, Z., et al. Pattern Recognition and Computer Vision. PRCV 2024. Lecture Notes in Computer Science, vol 15034. Springer, Singapore. https://doi.org/10.1007/978-981-97-8505-6_7

Download citation

  • DOI: https://doi.org/10.1007/978-981-97-8505-6_7

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-97-8504-9

  • Online ISBN: 978-981-97-8505-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics