Performance Enhancement of 2D CNN-Based Visual Inspection Using Data Augmentation for Defect Classification in Metal Casting Products

Authors

  • Imaduddien Ariefa Politeknik Negeri Semarang
  • Hutomo Jiwo Satrio Politeknik Negeri Semarang
  • Della Kumalaningrum Politeknik Negeri Semarang
  • Rieky Handoko Politeknik Negeri Semarang
  • Anton Harseno Politeknik Negeri Semarang
  • Fariz Wisda Nugraha Politeknik Negeri Semarang

DOI:

https://doi.org/10.32497/jrm.v20i3.7170

Keywords:

AlexNet, data augmentation, defect classification, deep learning, visual inspection

Abstract

Deep learning-based automated visual inspection has become increasingly important for reducing the subjectivity and mistakes that come with manual inspection.  However, when the image dataset is small, Convolutional Neural Networks (CNN) often do not perform optimally because the model overfits and fails to generalize effectivelyl.  This study investigates the effect of data augmentation on enhancing the performance of an AlexNet-based CNN model for classifying defect and non-defect casting images.  There were 13266 grayscale images in total, and they were divided into two groups: defect and non-defect.  To increase data variability, several augmentation techniques were used, such as rotation, flipping, zooming, and brightness adjustment.  We evaluated two different training scenarios: training a model without adding anything and training a model with adding something.  We used accuracy, precision, recall, F1-score, validation loss, and confusion matrix analysis to evaluate model perfomance.  The findings demonstrate that data augmentation significantly improves model performance.  The validation loss decreased from 0.019747 to 0.014853, and the accuracy, precision, recall, and F1-score all showed slight improvements.  The enhanced model also achieved higher true positive and true negative values, signifying improved recognition proficiency.  Tests on previously unseen samples yielded 100% correct predictions, indicating enhanced generalization.  To sum up, data augmentation is an effective strategy for mitigating small datset limitations and improving the reliability of CNN-based visual inspection systems in industrial environments.

References

[1] N. Hütten, M. Alves Gomes, F. Hölken, K. Andricevic, R. Meyes, and T. Meisen, “Deep Learning for Automated Visual Inspection in Manufacturing and Maintenance: A Survey of Open- Access Papers,” Applied System Innovation, vol. 7, no. 1, p. 11, Jan. 2024, doi: 10.3390/asi7010011.

[2] L. Leyendecker, S. Agarwal, T. Werner, M. Motz, and R. H. Schmitt, “A Study on Data Augmentation Techniques for Visual Defect Detection in Manufacturing,” 2023, pp. 73–94. doi: 10.1007/978-3-662-66769-9_6.

[3] S. Jain, G. Seth, A. Paruthi, U. Soni, and G. Kumar, “Synthetic data augmentation for surface defect detection and classification using deep learning,” J Intell Manuf, vol. 33, no. 4, pp. 1007–1020, Apr. 2022, doi: 10.1007/s10845-020-01710-x.

[4] Y. Ma, J. Yin, F. Huang, and Q. Li, “Surface defect inspection of industrial products with object detection deep networks: a systematic review,” Artif Intell Rev, vol. 57, no. 12, p. 333, Oct. 2024, doi: 10.1007/s10462-024-10956-3.

[5] I. Farady, C.-Y. Lin, and M.-C. Chang, “PreAugNet: improve data augmentation for industrial defect classification with small-scale training data,” J Intell Manuf, vol. 35, no. 3, pp. 1233–1246, Mar. 2024, doi: 10.1007/s10845-023-02109-0.

[6] V. Sampath, I. Maurtua, J. J. Aguilar Martín, A. Iriondo, I. Lluvia, and G. Aizpurua, “Intraclass Image Augmentation for Defect Detection Using Generative Adversarial Neural Networks,” Sensors, vol. 23, no. 4, p. 1861, Feb. 2023, doi: 10.3390/s23041861.

[7] C. Thakur, S. Kr. Mishra, S. S. S. Jose, P. K. Singh, and R. K. Upadhyay, “Deep learning for object recognition and defect analysis in additive manufacturing,” Discov Mater, vol. 5, no. 1, p. 206, Oct. 2025, doi: 10.1007/s43939-025-00408-2.

[8] Y. Ma, J. Yin, F. Huang, and Q. Li, “Surface defect inspection of industrial products with object detection deep networks: a systematic review,” Artif Intell Rev, vol. 57, no. 12, p. 333, Oct. 2024, doi: 10.1007/s10462-024-10956-3.

[9] E. Cumbajin et al., “A Systematic Review on Deep Learning with CNNs Applied to Surface Defect Detection,” J Imaging, vol. 9, no. 10, p. 193, Sep. 2023, doi: 10.3390/jimaging9100193.

[10] P. Ding and L. Yang, “Glass Defect Detection with Improved Data Augmentation under Total Reflection Lighting,” Applied Sciences, vol. 14, no. 13, p. 5658, Jun. 2024, doi: 10.3390/app14135658.

[11] A. K. P. Anil and U. K. Singh, “An Optimal Solution to the Overfitting and Underfitting Problem of Healthcare Machine Learning Models,” Journal of Systems Engineering and Information Technology (JOSEIT), vol. 2, no. 2, pp. 77–84, Oct. 2023, doi: 10.29207/joseit.v2i2.5460.

[12] N.-H. Choi, J. W. Sohn, and J.-S. Oh, “Defect Detection Model Using CNN and Image Augmentation for Seat Foaming Process,” Mathematics, vol. 11, no. 24, p. 4894, Dec. 2023, doi: 10.3390/math11244894.

[13] “Deep Data Augmentation for Defect Detection Enhancement: A Diffusion Model Based Approach,” Advances in Computer, Signals and Systems, vol. 8, no. 1, 2024, doi: 10.23977/acss.2024.080114.

[14] Â. Semitela, M. Pereira, A. Completo, N. Lau, and J. P. Santos, “Improving Industrial Quality Control: A Transfer Learning Approach to Surface Defect Detection,” Sensors, vol. 25, no. 2, p. 527, Jan. 2025, doi: 10.3390/s25020527.

[15] A. Saberironaghi, J. Ren, and M. El-Gindy, “Defect Detection Methods for Industrial Products Using Deep Learning Techniques: A Review,” Algorithms, vol. 16, no. 2, p. 95, Feb. 2023, doi: 10.3390/a16020095.

[16] Z. Zhao and T. Wu, “Casting Defect Detection and Classification of Convolutional Neural Network Based on Recursive Attention Model,” Sci Program, vol. 2022, pp. 1–11, Oct. 2022, doi: 10.1155/2022/4385565.

[17] A. W. Salehi et al., “A Study of CNN and Transfer Learning in Medical Imaging: Advantages, Challenges, Future Scope,” Sustainability, vol. 15, no. 7, p. 5930, Mar. 2023, doi: 10.3390/su15075930.

[18] W. Gao, Z. Huang, and H. Hu, “Lightweight Neural Network Optimization for Rubber Ring Defect Detection,” Applied Sciences, vol. 14, no. 24, p. 11953, Dec. 2024, doi: 10.3390/app142411953.

[19] V. Khemlapure, A. Patil, N. Chavan, and N. Mali, “Product Defect Detection Using Deep Learning,” International Journal of Intelligent Systems and Applications, vol. 16, no. 4, pp. 39–54, Aug. 2024, doi: 10.5815/ijisa.2024.04.03.

[20] Z. Shi, M. Sang, Y. Huang, L. Xing, and T. Liu, “Defect Detection of MEMS Based on Data Augmentation, WGAN-DIV-DC, and a YOLOv5 Model,” Sensors, vol. 22, no. 23, p. 9400, Dec. 2022, doi: 10.3390/s22239400.

[21] Z. Sun, “Study of Data Enhancement Techniques for Steel Surface Defect Detection,” Applied and Computational Engineering, vol. 154, no. 1, pp. 128–136, May 2025, doi: 10.54254/2755-2721/2025.TJ23131.

[22] D. Caballero-Ramirez, Y. Baez-Lopez, J. Limon-Romero, G. Tortorella, and D. Tlapa, “An Assessment of Human Inspection and Deep Learning for Defect Identification in Floral Wreaths,” Horticulturae, vol. 9, no. 11, p. 1213, Nov. 2023, doi: 10.3390/horticulturae9111213.

[23] C. E. Dallinger, “An integrated theory of prejudice reduction through service learning: college students’ interactions with immigrant children,” Iowa State University, Digital Repository, Ames, 2015. doi: 10.31274/etd-180810-3885.

[24] D. Niermann, T. Doernbach, C. Petzoldt, M. Isken, and M. Freitag, “Software framework concept with visual programming and digital twin for intuitive process creation with multiple robotic systems,” Robot Comput Integr Manuf, vol. 82, p. 102536, Aug. 2023, doi: 10.1016/j.rcim.2023.102536.

[25] J. Layec, F. Ansart, S. Duluard, V. Turq, M. Aufray, and M.-P. Labeau, “Development of new surface treatments for the adhesive bonding of aluminum surfaces,” Int J Adhes Adhes, vol. 117, p. 103006, Sep. 2022, doi: 10.1016/j.ijadhadh.2021.103006.

[26] D. M. Womack, N. N. Vuckovic, L. M. Steege, D. H. Eldredge, M. R. Hribar, and P. N. Gorman, “Subtle cues: Qualitative elicitation of signs of capacity strain in the hospital workplace,” Appl Ergon, vol. 81, p. 102893, Nov. 2019, doi: 10.1016/j.apergo.2019.102893.

Downloads

Published

2025-12-30

How to Cite

Imaduddien Ariefa, Hutomo Jiwo Satrio, Della Kumalaningrum, Rieky Handoko, Anton Harseno, & Fariz Wisda Nugraha. (2025). Performance Enhancement of 2D CNN-Based Visual Inspection Using Data Augmentation for Defect Classification in Metal Casting Products. Jurnal Rekayasa Mesin, 20(3), 379–392. https://doi.org/10.32497/jrm.v20i3.7170