Abstract:
Objective Internal defects in girth welds of oil pipelines pose significant risks to pipeline safety and integrity management. Although X-ray films provide clear and traceable defect records, on-site re-inspections still rely heavily on manual interpretation, which suffers from low efficiency, subjectivity, and inconsistent results. Additionally, weld defects in X-ray images often exhibit weak contrast, small scale, and varied morphology, compounded by structural interferences such as weld bead texture, thickness variations, and uneven exposure. These factors frequently cause missed detections, false positives, and location errors, hindering the stability and repeatability required for large-scale inspections. To address these challenges, this study proposes an edge-aware multi-scale adaptive detection model EMA-DETR to enhance the accuracy and consistency of automatic defect identification in girth weld X-ray films.
Methods EMA-DETR was developed upon RT-DETR by introducing three key enhancements. First, an edge-guided residual structure, EG-ResNet18, was integrated into the backbone network, embedding shallow edge priors into the feature extraction process to enhance the representation of contours and fine-grained textures for tiny defects. Second, a multi-scale adaptive fusion path (MAFP) was designed to align and fuse shallow details with deep semantics via dual-path interaction, enhancing the discriminative robustness of cross-scale features. Additionally, a scale-aware gradient focal loss (SGFL) was proposed to strengthen the gradient contribution of small targets and difficult examples via difficulty modulation and center-distance constraints, alleviating training bias caused by scale and class imbalance.
Results On the public dataset SPWDD, EMA-DETR achieved an mAP@0.50 of 95.98%, reflecting an increase of approximately 1.91%. On the self-built oil pipeline weld dataset, it reached an mAP@0.50 of 94.05%, with a similar increase of about 1.90%. Ablation studies confirmed that EG-ResNet18, MAFP, and SGFL consistently enhanced performance by improving edge representation, multi-scale fusion, and loss regulation, respectively. Their combined effect significantly boosted faint defect detection and location consistency.
Conclusion EMA-DETR enhances defect detection accuracy and consistency in complex weld backgrounds through the integrated design of edge prior guidance, multi-scale adaptive fusion, and scale-aware gradient focusing. It reduces manual interpretation workload and subjective variability, offering a practical solution for automatic defect listing, digital archiving, and pipeline integrity management.