-
摘要:
为解决航空发动机部件表面缺陷检测精度低、检测速度慢的问题,提出一种改进的YOLOv4算法进行智能检测。在路径聚合网络(PANet)结构中融合浅层特征与深层特征,增大特征检测尺度,同时去除自下而上的路径增强结构,提高小目标检测精度和整体检测速度;根据各类缺陷数量不同的情况,优化聚焦损失中的平衡参数,增加权重因子调节各类缺陷的损失权重,将改进后的聚焦损失代替分类误差中的交叉熵损失函数,降低样本不平衡和难易样本对检测精度的影响。实验表明:相比于原始YOLOv4算法,改进后的YOLOv4算法在测试集上的平均精度均值(mAP)为90.10%,提高了2.17%;检测速度为24.82 fps,提高了1.58 fps,检测精度也高于单发多框检测(SSD)算法、EfficientDet算法、YOLOv3算法和YOLOv4-Tiny算法。
Abstract:In order to enhance the accuracy and speed of surface defect detection of aeroengine components, an improved YOLOv4 algorithm is proposed for intelligent detection. Firstly, shallow features and deep features were integrated into the path aggregation network (PANet) to improve the feature detection scale, and the bottom-up path augmentation structure was removed to increase the accuracy of small target detection and the overall detection speed. Then, according to the numbers of various defects, the balance parameter of the focal loss was optimized, and a weight factor was added to adjust the loss weight of various defects. The improved focal loss was used to replace the cross-entropy loss function in the classification error, thus reducing the impact of imbalanced samples and hard and easy samples on the detection accuracy. The experimental results show that the mean average precision (mAP) of the improved YOLOv4 on the test set is 90.10%, which is 2.17% higher than that of the traditional YOLOv4, and the detection speed is 24.82 fps, which is increased by 1.58 fps. The detection accuracy is also higher than other algorithms including single shot multibox detector (SSD), EfficientDet, YOLOv3 and YOLOv4-Tiny.
-
Key words:
- YOLOv4 /
- surface defect detection /
- aeroengine /
- small target detection /
- focal loss
-
表 1 数据集中的目标数量
Table 1. Number of targets in dataset
缺陷类型 目标数量 总和 训练集 验证集 测试集 裂纹 1 579 580 595 2 754 缺口 848 272 270 1 390 凹坑 931 313 349 1 593 划痕 1 782 628 649 3 059 表 2 不同参数组合下的检测精度对比
Table 2. Comparison of detection accuracy under different parameter combinations
α0 β0 mAP/% AP/% 裂纹 缺口 凹坑 划痕 0.20 2.50 88.02 85.04 86.91 91.73 88.38 0.20 3.00 88.24 85.94 87.74 90.66 88.60 0.20 3.50 89.01 84.90 90.62 92.18 88.32 0.25 2.50 89.09 86.40 90.92 90.07 88.95 0.25 3.00 90.10 87.09 91.21 92.65 89.45 0.25 3.50 88.49 84.55 90.09 90.27 89.06 0.30 2.50 89.00 86.62 87.66 92.29 89.41 0.30 3.00 88.62 86.86 90.65 89.30 87.68 0.30 3.50 88.34 85.98 89.53 89.91 87.94 表 3 不同模型的检测性能对比
Table 3. Comparison of detection performance of different models
网络结构 mAP/% Speed
/fpsAP/% 裂纹 缺口 凹坑 划痕 YOLOv4 87.93 23.24 86.64 92.29 86.02 86.78 YOLOv4-A 89.61 24.94 86.36 93.12 89.10 89.86 YOLOv4-B 90.10 24.82 87.09 91.21 92.65 89.45 注:fps表示帧/s。 表 4 不同模型的网络结构参数量对比
Table 4. Comparison of network structure parameters of different models
网络结构 总参数量 参数容量/MB YOLOv4 63 953 841 243.96 YOLOv4-A 48 971 468 186.81 YOLOv4-B 48 971 468 186.81 表 5 不同算法的检测性能对比
Table 5. Comparison of detection performance of different algorithms
网络结构 mAP/% Speed/fps SSD 60.07 33.07 EfficientDet-D0 49.39 13.07 EfficientDet-D1 57.71 10.52 EfficientDet-D2 63.40 9.45 YOLOv3 86.25 30.37 YOLOv4-Tiny 54.25 64.55 YOLOv4 87.93 23.24 YOLOv4-B 90.10 24.82 -
[1] 李华. 基于孔探图像分析的航空发动机故障诊断专家系统研究[D]. 南京: 南京航空航天大学, 2015.LI H. Research on aeroengine fault diagnosis expert system based on endoscopic image analysis[D]. Nanjing: Nanjing University of Aeronautics and Astronautics, 2015(in Chinese). [2] 关玉璞, 陈伟, 高德平. 航空发动机叶片外物损伤研究现状[J]. 航空学报, 2007, 28(4): 851-857. doi: 10.3321/j.issn:1000-6893.2007.04.014GUAN Y P, CHEN W, GAO D P. Present status of investigation of foreign object damage to blade in aeroengine[J]. Acta Aeronautica et Astronautica Sinica, 2007, 28(4): 851-857(in Chinese). doi: 10.3321/j.issn:1000-6893.2007.04.014 [3] 何嘉辉, 张栋善, 赵成, 等. 航空发动机叶片裂纹检测技术及应用分析[J]. 内燃机与配件, 2020(15): 151-152. doi: 10.19475/j.cnki.issn1674-957x.2020.15.065HE J H, ZHANG D S, ZHAO C, et al. Detection technology and application analysis of aero-engine blade crack[J]. Internal Combustion Engine & Parts, 2020(15): 151-152(in Chinese). doi: 10.19475/j.cnki.issn1674-957x.2020.15.065 [4] LIU W, ANGUELOV D, ERHAN D, et al. SSD: Single shot multibox detector[C]//Proceedings of European Conference on Computer Vision. Berlin: Springer, 2016: 21-37. [5] REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: Unified, real-time object detection[C]//IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2016: 779-788. [6] REDMON J, FARHADI A. YOLO9000: Better, faster, stronger[C]//IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 6517-6525. [7] REDMON J, FARHADI A. YOLOv3: An incremental improvement[C]//IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 1804-0276. [8] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: Optimal speed and accuracy of object detection[C]//IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2020: 10934. [9] REN S Q, HE K M, GIRSHICK R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149. [10] DAI J F, LI Y, HE K M, et al. R-FCN: Object detection via region-based fully convolutional networks[C]//Proceedings of the 30th International Conference on Neural Information Processing Systems. New York: ACM, 2016: 379-387. [11] HE K M, GKIOXARI G, DOLLÁR P, et al. Mask R-CNN[C]//IEEE International Conference on Computer Vision. Piscataway: IEEE Press, 2017: 2980-2988. [12] 王玺坤, 姜宏旭, 林珂玉. 基于改进型YOLO算法的遥感图像舰船检测[J]. 北京航空航天大学学报, 2020, 46(6): 1184-1191. doi: 10.13700/j.bh.1001-5965.2019.0394WANG X K, JIANG H X, LIN K Y. Remote sensing image ship detection based on modified YOLO algorithm[J]. Journal of Beijing University of Aeronautics and Astronautics, 2020, 46(6): 1184-1191(in Chinese). doi: 10.13700/j.bh.1001-5965.2019.0394 [13] 陈科山, 郝宇, 何泓波, 等. 基于R-D SSD模型航空发动机安装工位检测算法[J]. 北京航空航天大学学报, 2021, 47(4): 682-689.CHEN K S, HAO Y, HE H B, et al. Detection algorithm of aeroengine installation station based on R-D SSD model[J]. Journal of Beijing University of Aeronautics and Astronautics, 2021, 47(4): 682-689(in Chinese). [14] 旷可嘉. 深度学习及其在航空发动机缺陷检测中的应用研究[D]. 广州: 华南理工大学, 2017.KUANG K J. Research on deep learning and its application on the defects detection for aero engine[D]. Guangzhou: South China University of Technology, 2017(in Chinese). [15] 李浩. 基于图像识别的航空发动机叶片裂纹检测研究[D]. 成都: 电子科技大学, 2019.LI H. Research on the blade crack detection of aero-engine based on image recognition[D]. Chengdu: University of Electronic Science and Technology of China, 2019(in Chinese). [16] 陈为, 梁晨红. 基于改进SSD的航空发动机目标缺陷检测[J]. 控制工程, 2021, 28(12): 2329-2335. doi: 10.14107/j.cnki.kzgc.cpcc2019-063CHEN W, LIANG C H. Aeroengine target defect detection based on improved SSD[J]. Control Engineering of China, 2021, 28(12): 2329-2335(in Chinese). doi: 10.14107/j.cnki.kzgc.cpcc2019-063 [17] WANG C Y, MARK L H Y, WU Y H, et al. CSPNet: A new backbone that can enhance learning capability of CNN[C]//IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops. Piscataway: IEEE Press, 2020: 1571-1580. [18] MISRA D. Mish: A self regularized non-monotonic neural activation function[EB/OL]. (2020-08-13) [2021-06-01]. [19] MAAS A L, HANNUN A Y, NG A Y. Rectifier nonlinearities improve neural network acoustic models[C]//Proceedings of Interational Conference on Machine learning, 2013: 1-6. [20] HE K M, ZHANG X Y, REN S Q, et al. Spatial pyramid pooling in deep convolutional networks for visual recognition.[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015, 37(9): 1904-1916. doi: 10.1109/TPAMI.2015.2389824 [21] LIU S, QI L, QIN H F, et al. Path aggregation network for instance segmentation[C]//IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2018: 8759-8768. [22] LIN T Y, DOLLÁR P, GIRSHICK R, et al. Feature pyramid networks for object detection[C]//IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2017: 2117-2125. [23] YU J H, JIANG Y N, WANG Z Y, et al. UnitBox: An advanced object detection network[C]//Proceedings of the 24th ACM International Conference on Multimedia. New York: ACM, 2016: 516-520. [24] REZATOFIGHI H, TSOI N, GWAK J, et al. Generalized intersection over union: A metric and a loss for bounding box regression [C]//IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2019: 658-666. [25] ZHENG Z, WANG P, LIU W, et al. Distance-IoU loss: Faster and better learning for bounding box regression[C]//Proceedings of the AAAI Conference on Artificial Intelligence. 2020, 34(7): 12993-13000. [26] LIN T Y, GOYAL P, GIRSHICK R, et al. Focal loss for dense object detection[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(2): 318-327. [27] TAN M X, PANG R M, LE Q V. EfficientDet: Scalable and efficient object detection[C]//IEEE/CVF Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2020: 10778-10787. [28] TAN M X, LE Q V. EfficientNet: Rethinking model scaling for convolutional neural networks [EB/OL].(2020-09-11) [2021-06-01].