Impact of Activation Functions on the Detection of Defects in Cast Steel Parts Using YOLOv8
Abstract
1. Introduction
2. Methodology
2.1. Dataset
2.2. YOLOv8 Model
2.3. Activation Functions
3. Results and Discussion
3.1. Model Validation and Testing
3.2. Mean and Variance of Feature Layers
3.3. Key Regions in Radiographic Images
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Bharambe, C.; Jaybhaye, M.D.; Dalmiya, A.; Daund, C.; Shinde, D. Analyzing casting defects in high-pressure die casting industrial case study. Mater. Today Proc. 2023, 72, 1079–1083. [Google Scholar] [CrossRef]
- Luo, A.A.; Sachdev, A.K.; Apelian, D. Alloy development and process innovations for light metals casting. J. Mater. Process. Technol. 2022, 306, 117606. [Google Scholar] [CrossRef]
- Chelladurai, C.; Mohan, N.S.; Hariharashayee, D.; Manikandan, S.; Sivaperumal, P. Analyzing the casting defects in small scale casting industry. Mater. Today Proc. 2021, 37, 386–394. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. SSD: Single Shot MultiBox Detector. In Proceedings of the Computer Vision—ECCV 2016, Amsterdam, The Netherlands, 11–14 October 2016; pp. 21–37. [Google Scholar]
- Wang, X.; Yu, X. Understanding the effect of transfer learning on the automatic welding defect detection. NDT E Int. 2023, 134, 102784. [Google Scholar] [CrossRef]
- Davis, G.; Balasubramaniam, K.; Palanisamy, S.; Nagarajah, R.; Rajagopal, P. Additively manufactured integrated slit mask for laser ultrasonic guided wave inspection. Int. J. Adv. Manuf. Technol. 2020, 110, 1203–1217. [Google Scholar] [CrossRef]
- Huang, P.; Long, J.; Jia, J.; Liu, K.; Yu, X.; Xu, L.; Xie, Y. Measurement of conductivity and diameter of metallic rods using eddy current testing. Measurement 2023, 221, 113496. [Google Scholar] [CrossRef]
- Wang, P.; Jing, P. Deep learning-based methods for detecting defects in cast iron parts and surfaces. IET Image Process. 2024, 18, 47–58. [Google Scholar] [CrossRef]
- Xu, W.; Liu, G.; Wang, M. A deep neural network-based intelligent detection model for manufacturing defects of automobile parts. J. Circuit Syst. Comp. 2023, 32, 2350236. [Google Scholar] [CrossRef]
- Li, L.; Gao, M.; Tian, X.; Wang, C.; Yu, J. Surface defect detection method of aluminium alloy castings based on data enhancement and CRT-DETR. IET Image Process. 2024, 18, 4275–4286. [Google Scholar] [CrossRef]
- Jiang, L.; Wang, Y.; Tang, Z.; Miao, Y.; Chen, S. Casting defect detection in X-ray images using convolutional neural networks and attention-guided data augmentation. Measurement 2021, 170, 108736. [Google Scholar] [CrossRef]
- Du, W.; Shen, H.; Fu, J.; Zhang, G.; He, Q. Approaches for improvement of the X-ray image defect detection of automobile casting aluminum parts based on deep learning. NDT E Int. 2019, 107, 102144. [Google Scholar]
- Tang, Z.; Tian, E.; Wang, Y.; Wang, L.; Yang, T. Nondestructive defect detection in castings by using spatial attention bilinear convolutional neural network. IEEE Trans. Ind. Inform. 2020, 17, 82–89. [Google Scholar] [CrossRef]
- Shao, Q.; Liu, J.; Hu, D. FFDR-Net: Feature Fusion Deeper RetinaNet for PCB Defect Detection. In Proceedings of the 2023 IEEE 3rd International Conference on Electronic Technology, Communication and Information (ICETCI), Changchun, China, 26–28 May 2023; pp. 770–774. [Google Scholar]
- Wang, Y.; Hu, C.; Chen, K.; Yin, Z. Self-attention guided model for defect detection of aluminium alloy casting on X-ray image. Comput. Electr. Eng. 2020, 88, 106821. [Google Scholar] [CrossRef]
- Prasad, L.V.; Dokku, D.B.; Talasila, S.L.; Tumuluru, P. Hyper Parameter Optimization for Transfer Learning of ShuffleNetV2 with Edge Computing for Casting Defect Detection. J. Sci. Ind. Res. India 2023, 82, 171–177. [Google Scholar]
- Ioffe, S.; Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 June 2015; pp. 448–456. [Google Scholar]
- Cabanilla, K.I.M.; Mohammad, R.Z.; Lope, J.E.C. Neural networks with ReLU powers need less depth. Neural Netw. 2024, 172, 106073. [Google Scholar] [CrossRef] [PubMed]
- Vasanthakumari, R.K.; Nair, R.V.; Krishnappa, V.G. Improved learning by using a modified activation function of a Convolutional Neural Network in multi-spectral image classification. Mach. Learn. Appl. 2023, 14, 100502. [Google Scholar] [CrossRef]
- Wu, K.; Sun, S.; Sun, Y.; Wang, C.; Wei, Y. RBS-YOLO: A Lightweight YOLOv5-Based Surface Defect Detection Model for Castings. IET Image Process. 2025, 19, e70018. [Google Scholar] [CrossRef]
- Yi, W.; Ma, S.; Li, R. Insulator and defect detection model based on improved YOLO-S. IEEE Access 2023, 11, 93215–93226. [Google Scholar] [CrossRef]
- Hu, A.; Wu, L.; Huang, J.; Fan, D.; Xu, Z. Recognition of weld defects from X-ray images based on improved convolutional neural network. Multimed. Tools Appl. 2022, 81, 15085–15102. [Google Scholar] [CrossRef]
- Adem, K. Impact of activation functions and number of layers on detection of exudates using circular Hough transform and convolutional neural networks. Expert. Syst. Appl. 2022, 203, 117583. [Google Scholar] [CrossRef]
- Ayan, M.; VS, K. A novel Parametric Flatten-p Mish activation function based deep CNN model for brain tumor classification. Comput. Biol. Med. 2022, 150, 106183. [Google Scholar]
- Jocher, G.; Chaurasia, A.; Qiu, J. Ultralytics YOLO (Version 8.0.0) [Computer Software]. 2023. Available online: https://github.com/ultralytics/ultralytics (accessed on 11 February 2024).
- Nair, V.; Hinton, G.E. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), Haifa, Israel, 21–24 June 2010; pp. 807–814. [Google Scholar]
- Shao, L.; Wu, H.; Li, C.; Li, J. A vehicle recognition model based on improved YOLOv5. Electronics 2023, 12, 1323. [Google Scholar] [CrossRef]
- Kim, B.; Natarajan, Y.; Munisamy, S.D.; Rajendran, A.; Sri Preethaa, K.R.; Lee, D.E.; Wadhwa, G. Deep learning activation layer-based wall quality recognition using Conv2D ResNet exponential transfer learning model. Mathematics 2022, 10, 4602. [Google Scholar] [CrossRef]
- Tu, J.B.; Zeng, J.L.; Tang, Y.X.; Wu, C.X.; Liu, X.Y. Detection and Classification of Surface Defects on Solar Cell Panels Based on Deep Learning. Laser Optoelectron. Prog. 2025, 62, 0237013. [Google Scholar]
- Yuen, B.; Hoang, M.T.; Dong, X.; Lu, T. Universal activation function for machine learning. Sci. Rep. 2021, 11, 18757. [Google Scholar] [CrossRef]
Activation Function | AP/% | mAP@0.5/% | mAP@0.5:0.95/% | ||
---|---|---|---|---|---|
Pore | Inclusion | Looseness | |||
Rectified Linear Unit (ReLU) | 89.5 | 84.5 | 91.9 | 88.6 | 58.0 |
Exponential Linear Units (ELU) | 89.1 | 83.6 | 89.0 | 87.2 | 56.4 |
Softplus | 89.0 | 84.0 | 87.1 | 86.7 | 56.2 |
Sigmoid Linear Unit (SiLU) | 90.9 | 85.9 | 92.8 | 89.9 | 60.4 |
Mish | 90.9 | 86.0 | 93.3 | 90.1 | 60.6 |
Activation Function | 95% CI | |||
---|---|---|---|---|
Pore AP | Inclusion AP | Looseness AP | mAP@0.5 | |
ReLU | (0.861, 0.924) | (0.806, 0.878) | (0.892, 0.966) | (0.869, 0.907) |
ELU | (0.861, 0.922) | (0.802, 0.868) | (0.846, 0.962) | (0.855, 0.906) |
Softplus | (0.864, 0.918) | (0.798, 0.871) | (0.787, 0.962) | (0.845, 0.905) |
SiLU | (0.887, 0.941) | (0.819, 0.891) | (0.894, 0.964) | (0.880, 0.920) |
Mish | (0.874, 0.935) | (0.815, 0.890) | (0.906, 0.961) | (0.877, 0.919) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Chen, Y.; He, Y.; Chu, Y. Impact of Activation Functions on the Detection of Defects in Cast Steel Parts Using YOLOv8. Materials 2025, 18, 2834. https://doi.org/10.3390/ma18122834
Chen Y, He Y, Chu Y. Impact of Activation Functions on the Detection of Defects in Cast Steel Parts Using YOLOv8. Materials. 2025; 18(12):2834. https://doi.org/10.3390/ma18122834
Chicago/Turabian StyleChen, Yunxia, Yangkai He, and Yukun Chu. 2025. "Impact of Activation Functions on the Detection of Defects in Cast Steel Parts Using YOLOv8" Materials 18, no. 12: 2834. https://doi.org/10.3390/ma18122834
APA StyleChen, Y., He, Y., & Chu, Y. (2025). Impact of Activation Functions on the Detection of Defects in Cast Steel Parts Using YOLOv8. Materials, 18(12), 2834. https://doi.org/10.3390/ma18122834