Chen Yunxia, He Yangkai, Chu Yukun
School of Intelligent Manufacturing and Control Engineering, Shanghai Polytechnic University, Pudong District, Shanghai 201209, China.
School of Materials Science and Engineering, Shanghai Jiao Tong University, Minhang District, Shanghai 200240, China.
Materials (Basel). 2025 Jun 16;18(12):2834. doi: 10.3390/ma18122834.
In this paper, to address the issue of the unknown influence of activation functions on casting defect detection using convolutional neural networks (CNNs), we designed five sets of experiments to investigate how different activation functions affect the performance of casting defect detection. Specifically, the study employs five activation functions-Rectified Linear Unit (), Exponential Linear Units (), , Sigmoid Linear Unit (), and -each with distinct characteristics, based on the YOLOv8 algorithm. The results indicate that the activation function yields the best performance in casting defect detection, achieving an mAP@0.5 value of 90.1%. In contrast, the activation function performs the worst, with an mAP@0.5 value of only 86.7%. The analysis of the feature maps shows that the activation function enables the output of negative values, thereby enhancing the model's ability to differentiate features and improving its overall expressive power, which enhances the model's ability to identify various types of casting defects. Finally, gradient class activation maps (Grad-CAM) are used to visualize the important pixel regions in the casting digital radiography (DR) images processed by the neural network. The results demonstrate that the activation function improves the model's focus on grayscale-changing regions in the image, thereby enhancing detection accuracy.
在本文中,为了解决激活函数对使用卷积神经网络(CNN)进行铸件缺陷检测的未知影响问题,我们设计了五组实验来研究不同的激活函数如何影响铸件缺陷检测的性能。具体而言,该研究基于YOLOv8算法采用了五种激活函数——整流线性单元(ReLU)、指数线性单元(ELU)、、Sigmoid线性单元(SiLU)和,每种函数都具有不同的特性。结果表明, 激活函数在铸件缺陷检测中表现最佳,mAP@0.5值达到90.1%。相比之下, 激活函数表现最差,mAP@0.5值仅为86.7%。对特征图的分析表明, 激活函数能够输出负值,从而增强模型区分特征的能力并提高其整体表达能力,进而增强模型识别各种类型铸件缺陷的能力。最后,使用梯度类激活映射(Grad-CAM)来可视化神经网络处理的铸件数字射线照相(DR)图像中的重要像素区域。结果表明, 激活函数提高了模型对图像中灰度变化区域的关注,从而提高了检测精度。