首页|基于混合注意力机制的管道漏磁缺陷分类实验

基于混合注意力机制的管道漏磁缺陷分类实验

扫码查看
该文将管道漏磁缺陷分类任务设计成应用型教学实验。该实验使用迁移学习的方法,调用预训练模型ResNet50,并插入主流的注意力机制(SE、CA、ECA、CBAM)进行对比分析。同时,利用Grad-CAM++可解释算法对模型内部的识别逻辑进行可视化,以便帮助学生更好地理解模型。实验结果显示,插入注意力机制的最优模型准确率达99。7%,能够有效识别管道中的正常情况和分类缺陷情况。该实验依托高性能计算机硬件和最新的Pytorch 2。0软件包搭建了深度学习平台,有助于培养学生的创新意识和科研能力,也是对多学科交叉融合人才培养模式的探索和实践。
Experimental classification of pipeline magnetic leakage defects based on mixed attention mechanism
[Objective]As a country's vital strategic resources,oil and gas play a decisive role in national economic levels and international strategic positions.Pipelines are the most commonly used method for transporting these resources,but they are vulnerable to various defects and damages during transportation,including construction aging,natural wear and tear,internal corrosion,and external impacts.These factors often result in frequent leakage accidents.Therefore,the regular use of magnetic flux leakage detection technology to inspect and evaluate existing oil and gas pipelines is an effective means to ensure their integrity and reliability.However,traditional manual interpretation methods suffer from issues such as missed detections and false alarms.Therefore,the intelligent development of leak magnetic signal identification can be facilitated using deep learning techniques.[Methods]The magnetic leakage image samples in this experiment were collected from an actual long-distance oil and gas pipeline.First,the magnetic leakage images in a dataset were augmented,including rotation,cropping,scaling,mirroring,and other image transformations,to generate six types of magnetic leakage core signal images:flange,metal loss,normal,spiral weld,tee joint,and ring weld.The preprocessed magnetic leakage image samples were then divided into a training set,a validation set,and a test set in certain proportions.This experiment was based on the PyTorch 2.0 deep learning framework and utilized a transfer learning strategy to invoke the pretrained model ResNet50.Meanwhile,keeping the pretrained weights unchanged,different attention mechanism modules(SE,CA,CBAM,and ECA)were added after each stage of the backbone network,and the insertion position and quantity of attention mechanisms were varied to conduct multiple comparative experiments.Finally,a comprehensive evaluation of the model's performance was conducted using multiple evaluation metrics.In addition,to further understand the internal recognition logic of the model,the Grad-CAM++interpretable algorithm was used to generate feature maps.By comparing the feature maps generated by the ResNet50 model and the ECA model at different stages,the recognition differences between them were analyzed,and preliminary localization of the magnetic leakage defects was achieved.[Results]Experimental results showed the following:1)Inserting a single-layer attention mechanism in Stages 1-3 of the backbone network partially improves the model's accuracy,but the improvement was not significant.2)Inserting multiple-layer attention mechanisms in Stages 1-3 of the backbone network greatly improves the model's recognition performance,with an average improvement of 3.15%.Among them,the ECA model performed the best,with an accuracy of 99.7%for its optimal model,and it had a lower complexity and loss value(0.017).3)The feature maps of the ECA attention model were more focused on precise features compared with the ResNet50 model rather than on abstract features.This feature representation was also more consistent with human recognition characteristics.[Conclusions]In summary,the introduction of a multilayer attention mechanism effectively improves the recognition performance of the model and accurately identifies six types of magnetic leakage signal images in the pipeline.Furthermore,by using the Grad-CAM++interpretability algorithm,the internal recognition logic of the model can be visualized,thereby achieving the initial localization of magnetic leakage defects.

experimental designdeep learningneural networkattention mechanismmagnetic leakage defect

张璐莹、卞雨辰、周立娇、蒋鹏、刘英

展开 >

东北石油大学石油工程学院,黑龙江大庆 163318

中国石油天然气管道工程有限公司,河北廊坊 065000

东北石油大学机械科学与工程学院,黑龙江大庆 163318

实验设计 深度学习 神经网络 注意力机制 漏磁缺陷检测

黑龙江省普通本科高等学校青年创新人才培养项目黑龙江省高等教育教学改革工程项目

UNPYSCT-2020146SJGY20210143

2024

实验技术与管理
清华大学

实验技术与管理

CSTPCD北大核心
影响因子:1.651
ISSN:1002-4956
年,卷(期):2024.41(1)
  • 19