Study on CNN Coupled PCA-DT Model for Recognition of Metal Defect
-
摘要: 针对金属缺陷识别分类,传统机器学习需要人工提取特征,而深度学习需要大量样本的问题,本文针对中小规模缺陷数据集提出了一种基于浅层的卷积神经网络(CNN)和决策树(DT)的金属缺陷分类方法。利用卷积神经网络提取特征,通过决策树分类,实现缺陷分类。引入主成分分析(PCA)方法对特征向量降维,减小过拟合并提升算法识别分类效率。为验证本文方法的通用性,除图像缺陷数据外还引入非图像缺陷数据。实验结果表明,本文方法除了能分类图像缺陷也能分类非图像缺陷,且在识别率等3个评价指标上本文方法优于传统机器学习方法,与深度学习方法持平,但在分类消耗时间上少于深度学习。Abstract: For recognition and classificationof metal defect, traditional machine learning requires manual feature extraction while deep learning requires a large number of samples. This paper proposes a classification method of metal defectbased on the shallow convolutional neural network (CNN) and decision tree (DT) for small and medium-sized defect data sets. The feature is extracted by the convolutional neural network, and the defect is classified with the decision tree. The principal component analysis (PCA) method is introduced to reduce the dimension of feature vectors to reduce the efficiency of recognition and classification by overfitting. In order to verify the generality of this method, non-image defect data is introduced in addition to image defect data. Experimental results show that the present method can classify not only image defects but also non-image defects, and is superior to traditional machine learning methods in three evaluation indexes of recognition rate, equal to deep learning methods, but less time-consuming than deep learning in classification.
-
表 1 图像缺陷数据集NEU-DET缺陷样本分布
类型 训练样本 测试样本 标签 总计 氧化皮 270 30 0 300 斑块 270 30 1 300 开裂 270 30 2 300 点蚀 270 30 3 300 内含物 270 30 4 300 划痕 270 30 5 300 总计 1620 180 − 1800 表 2 非图像缺陷数据集ULTA-DET缺陷样本分布
深度/mm 训练样本 测试样本 标签 总计 2 72 8 0 80 5 72 8 1 80 8 72 8 2 80 总计 216 24 − 240 表 3 CNN参数
参数类型 参数 激活函数 ReLU 优化算法 Adam算法 损失函数 交叉熵 学习率 0.001(ULTA-DET数据集)
0.0001(NEU-DET数据集)批训练块 8(ULTA-DET数据集)
30(NEU-DET数据集)表 4 人工提取NEU-DET数据集的特征类型
缺陷特征 具体缺陷特征 数量 几何特征 缺陷面积、缺陷周长 2 灰度特征 灰度平均值、灰度方差、歪度、
峭度、能量、熵、最大灰度值、
最小灰度值、灰度幅值9 表 5 人工提取特征和CNN提取特征在NEU-DET上的测试结果
方法 准确率/% 精准率/% 召回率/% 分类时
间/s人工 + DT 90.66 90.7 90.54 1000.5 CNN + DT 92.22 91.9 92.24 3459.9 表 6 有无PCA-DT在NEU-DET上的测试结果
方法 准确率/% 精准率/% 召回率/% 分类时间/s CNN 92.75 90.78 90.63 41666.1 CNN-PCA-DT 94.76 93.79 94.32 3007.2 表 7 不同算法在NEU-DET上的测试结果
结果 机器学习 深度学习 本文模型 SVM 文献 [20] VGG16 ResNet34 GoogLeNet CNN + PCA + DT 准确率/% 91.12 94.22 93.25 92.15 92.78 94.76 精准率/% 89.23 94.11 94.10 91.68 92.11 93.79 召回率/% 90.32 94.49 93.67 89.77 91.32 94.56 分类时间/s 956.4 2567.4 125000.6 60325.8 96983.1 3007.2 提取特征方式 人工 人工 卷积 卷积 卷积 卷积 表 8 人工提取ULTA-DET数据集的特征类型
缺陷
特征值具体缺陷特征 数量 无量纲
参数斜度、峰度、峰值、清除指标、
形状指标、脉冲指标6 有量纲
参数方差、平均值、最大值、最小值、
幅值、标准差6 表 9 不同算法在ULTA-DET数据集上的测试结果
结果 机器学习 深度学习 (机器 + 深度)学习 DT SVM 文献[20] ResNet34 GoogLeNet VGG16 CNN CNN + DT CNN-PCA-DT 准确率/% 73.11 75.78 80.98 97.36 92.98 99.25 96.66 88.75 98.51 精准率/% 71.79 74.26 82.65 97.35 95.24 98.26 95.44 89.80 97.41 召回率/% 70.46 75.65 83.87 98.56 94.57 97.65 93.56 88.89 97.82 分类时间/s 40.3 49.3 50.6 1268.1 2978.4 3068.7 310.9 77.4 64.1 提取特征方式 人工 人工 人工 卷积 卷积 卷积 卷积 卷积 卷积 -
[1] XU K, LIU S H, AI Y H. Application of Shearlet transform to classification of surface defects for metals[J]. Image and Vision Computing, 2015, 35: 23-30 doi: 10.1016/j.imavis.2015.01.001 [2] 唐东林, 陈印, 潘峰, 等. RWESOS-VPMCD方法对超声缺陷信号的识别研究[J]. 机械科学与技术, 2021, 40(7): 1072-1078TANG D L, CHEN Y, PAN F, et al. Research on recognition of ultrasonic defect signal by RWESOS-VPMCD method[J]. Mechanical Science and Technology for Aerospace Engineering, 2021, 40(7): 1072-1078 (in Chinese) [3] ZHANG X W, DING Y Q, LV Y Y, et al. A vision inspection system for the surface defects of strongly reflected metal based on multi-class SVM[J]. Expert Systems with Applications, 2011, 38(5): 5930-5939 doi: 10.1016/j.eswa.2010.11.030 [4] XIAO M, JIANG M M, LI G Y, et al. An evolutionary classifier for steel surface defects with small sample set[J]. EURASIP Journal on Image and Video Processing, 2017, 2017(1): 48 doi: 10.1186/s13640-017-0197-y [5] CHU M X, ZHAO J, LIU X P, et al. Multi-class classification for steel surface defects based on machine learning with quantile hyper-spheres[J]. Chemometrics and Intelligent Laboratory Systems, 2017, 168: 15-27 doi: 10.1016/j.chemolab.2017.07.008 [6] 王海云, 王剑平, 罗付华. 融合多层次特征Faster R-CNN的金属板带材表面缺陷检测研究[J]. 机械科学与技术, 2021, 40(2): 262-269WANG H Y, WANG J P, LUO F H. Study on surface defect detection of metal sheet and strip using faster R-CNN with multilevel feature[J]. Mechanical Science and Technology for Aerospace Engineering, 2021, 40(2): 262-269 (in Chinese) [7] GAJA H, LIOU F. Defect classification of laser metal deposition using logistic regression and artificial neural networks for pattern recognition[J]. The International Journal of Advanced Manufacturing Technology, 2018, 94(1-4): 315-326 doi: 10.1007/s00170-017-0878-9 [8] XU W Z, LI C B, CHOUNG J, et al. Corroded pipeline failure analysis using artificial neural network scheme[J]. Advances in Engineering Software, 2017, 112: 255-266 doi: 10.1016/j.advengsoft.2017.05.006 [9] GAJA H, LIOU F. Defects monitoring of laser metal deposition using acoustic emission sensor[J]. The International Journal of Advanced Manufacturing Technology, 2017, 90(1-4): 561-574 doi: 10.1007/s00170-016-9366-x [10] MURTA R H F, DE A. VIEIRA F, SANTOS V O, et al Welding defect classification from simulated ultrasonic signals[J]. Journal of Nondestructive Evaluation, 2018, 37(3): 40 doi: 10.1007/s10921-018-0496-y [11] ZHAO Y D, HAO K R, HE H B, et al. A visual long-short-term memory based integrated CNN model for fabric defect image classification[J]. Neurocomputing, 2020, 380: 259-270 doi: 10.1016/j.neucom.2019.10.067 [12] 钟嘉俊, 贺德强, 苗剑, 等. 基于改进Faster R-CNN的地铁车辆焊缝缺陷检测[J]. 铁道科学与工程学报, 2020, 17(4): 996-1003ZHONG J J, HE D Q, MIAO J, et al. Weld defect detection of metro vehicle based on improved faster R-CNN[J]. Journal of Railway Science and Engineering, 2020, 17(4): 996-1003 (in Chinese) [13] SHI J H, LI Z Y, ZHU T T, et al. Defect detection of industry wood veneer based on NAS and multi-channel mask R-CNN[J]. Sensors, 2020, 20(16): 4398 doi: 10.3390/s20164398 [14] WU H, GAO W B, XU X R. Solder joint recognition using mask R-CNN method[J]. IEEE Transactions on Components, Packaging and Manufacturing Technology, 2020, 10(3): 525-530 doi: 10.1109/TCPMT.2019.2952393 [15] JIA A D, LI B Z, ZHANG C C. Detection of cervical cancer cells based on strong feature CNN-SVM network[J]. Neurocomputing, 2020, 411: 112-127 doi: 10.1016/j.neucom.2020.06.006 [16] WANG J H, SUN Y N, SUN S M. Recognition of muscle fatigue status based on improved wavelet threshold and CNN-SVM[J]. IEEE Access, 2020, 8: 207914-207922 doi: 10.1109/ACCESS.2020.3038422 [17] DEMIR F, TURKOGLU M, ASLAN M, et al. A new pyramidal concatenated CNN approach for environmental sound classification[J]. Applied Acoustics, 2020, 170: 107520 doi: 10.1016/j.apacoust.2020.107520 [18] SUN X K, LIU L, LI C F, et al. Classification for remote sensing data with improved CNN-SVM method[J]. IEEE Access, 2019, 7: 164507-164516 doi: 10.1109/ACCESS.2019.2952946 [19] WU Q S, GAO T, LAI Z C, et al. Hybrid SVM-CNN classification technique for human-vehicle targets in an automotive LFMCW radar[J]. Sensors, 2020, 20(12): 3504 doi: 10.3390/s20123504 [20] SONG K C, YAN Y H. A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects[J]. Applied Surface Science, 2013, 285: 858-864 doi: 10.1016/j.apsusc.2013.09.002 [21] TSAO W C, LI Y F, LE D D, et al. An insight concept to select appropriate IMFs for envelope analysis of bearing fault diagnosis[J]. Measurement, 2012, 45(6): 1489-1498 doi: 10.1016/j.measurement.2012.02.030