A Boundary-Guided Feature Modulation Network for Weld Radiographic Defect Segmentation
Abstract
1. Introduction
- The relatively underexplored task of pixel-level weld radiographic defect segmentation is investigated, with emphasis on its importance for precise defect-region delineation and weld-quality assessment.
- A boundary-guided feature modulation framework is developed, in which multi-scale feature fusion and BGDA with SDR are integrated to achieve boundary-guided residual refinement during training and boundary-free refinement during inference.
- A false-positive suppression loss is designed so that erroneous foreground responses in stable non-boundary background regions are penalized, improving the Dice–Precision trade-off in weld radiographic defect segmentation.
2. Related Work
2.1. Weld Defect Detection
2.2. Weld Defect Classification
2.3. Weld Defect Segmentation
3. Methodology
3.1. Boundary Band Construction and Modeling
3.2. Boundary-Guided Dual Attention
3.2.1. Training Mode of SDR: Boundary-Guided Refinement
3.2.2. Inference Mode of SDR: Boundary-Free Refinement
3.3. Boundary-Guided Optimization Strategy
3.3.1. Boundary-Weighted Segmentation Loss
3.3.2. False-Positive Suppression in Non-Boundary Background Regions
3.4. Overall Framework
4. Results and Discussion
4.1. Experimental Setup
4.1.1. Dataset
4.1.2. Implementation Details
4.1.3. Evaluation Metrics
4.1.4. Statistical Testing Protocol
4.2. Comparison with Representative Segmentation Methods
4.3. Per-Category Performance Analysis
4.4. Ablation Study
4.5. Hyperparameter Sensitivity Analysis
4.6. Comparison with Boundary-Aware and False-Positive Suppression Strategies
4.7. Statistical Validation of Main Improvements
4.8. Boundary Error Analysis
4.9. Computational Cost and Inference Speed
4.10. Qualitative Results
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
| BGDA | Boundary-Guided Dual Attention |
| SDR | Stage-Dependent Refinement |
| SD3px | Surface Dice at a 3-pixel tolerance |
| BCE | Binary Cross-Entropy |
| FPL | False-Positive Suppression Loss |
| MSF | Multi-Scale Feature Fusion |
| NDT | Non-Destructive Testing |
References
- Wang, X.; Zscherpel, U.; Tripicchio, P.; D’Avella, S.; Zhang, B.; Wu, J.; Liang, Z.; Zhou, S.; Yu, X. A Comprehensive Review of Welding Defect Recognition from X-ray Images. J. Manuf. Process. 2025, 140, 161–180. [Google Scholar] [CrossRef] [Scilit]
- Zhao, X.; Wu, J.; Zhang, B.; Wen, H.; Wang, X.; Li, Y.; Yu, X. SWRD: A Dataset of Radiographic Image of Seam Weld for Defect Detection. J. Nondestruct. Eval. 2024, 44, 50. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Xu, H.; Yan, Z.; Ji, B.; Huang, P.; Cheng, J.; Wu, X. Defect Detection in Welding Radiographic Images Based on Semantic Segmentation Methods. Measurement 2022, 188, 110569. [Google Scholar] [CrossRef] [Scilit]
- Elhendawy, G.A.; El-Taybany, Y. Machine Vision-Assisted Welding Defect Detection System with Convolutional Neural Networks. Int. J. Precis. Eng. Manuf. 2025, 26, 3185–3194. [Google Scholar] [CrossRef] [Scilit]
- Wang, X.; He, F.; Huang, X. A New Method for Deep Learning Detection of Defects in X-ray Images of Pressure Vessel Welds. Sci. Rep. 2024, 14, 6312. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wang, Q.; Mei, J.; Jiang, W.; Zhu, H. SHDM-NET: Heat Map Detail Guidance with Image Matting for Industrial Weld Semantic Segmentation Network. Eng. Appl. Artif. Intell. 2023, 126, 106946. [Google Scholar] [CrossRef] [Scilit]
- Zhang, B.; Wang, X.; Cui, J.; Wu, J.; Wang, X.; Li, Y.; Li, J.; Tan, Y.; Chen, X.; Wu, W.; et al. Welding Defects Classification by Weakly Supervised Semantic Segmentation. NDT E Int. 2023, 138, 102899. [Google Scholar] [CrossRef] [Scilit]
- Yan, Z.; Ji, B.; Xu, H.; Fang, J. Interactive Defect Segmentation in Welding Radiographic Images Based on Artificial Features Fusion. NDT E Int. 2025, 151, 103305. [Google Scholar] [CrossRef] [Scilit]
- Hu, M.; Hu, X.; Zhao, J.; Zhan, H. Weld Seam ROI Detection and Segmentation Method Based on Active–Passive Vision Fusion. Sensors 2025, 25, 7530. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Medical Image Computing and Computer-Assisted Intervention–MICCAI 2015; Lecture Notes in Computer Science; Navab, N., Hornegger, J., Wells, W., Frangi, A., Eds.; Springer: Cham, Switzerland, 2015; Volume 9351. [Google Scholar] [CrossRef] [Scilit]
- Chen, L.C.; Zhu, Y.; Papandreou, G.; Schroff, F.; Adam, H. Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation. In Computer Vision–ECCV 2018. ECCV 2018; Lecture Notes in Computer Science; Ferrari, V., Hebert, M., Sminchisescu, C., Weiss, Y., Eds.; Springer: Cham, Switzerland, 2018; Volume 11211. [Google Scholar] [CrossRef] [Scilit]
- Wang, X.; Zhang, B.; Cui, J.; Wu, J.; Li, Y.; Li, J.; Tan, Y.; Chen, X.; Wu, W.; Yu, X. Image Analysis of the Automatic Welding Defects Detection Based on Deep Learning. J. Nondestruct. Eval. 2023, 42, 82. [Google Scholar] [CrossRef] [Scilit]
- Urrea, C.; Vélez, M. Advances in Deep Learning for Semantic Segmentation of Low-Contrast Images: A Systematic Review of Methods, Challenges, and Future Directions. Sensors 2025, 25, 2043. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Radi, D.; Abo-Elsoud, M.E.A.; Khalifa, F. Accurate Segmentation of Weld Defects with Horizontal Shapes. NDT E Int. 2022, 126, 102599. [Google Scholar] [CrossRef] [Scilit]
- Zhou, Z.; Siddiquee, M.M.R.; Tajbakhsh, N.; Liang, J. UNet++: Redesigning Skip Connections to Exploit Multiscale Features in Image Segmentation. IEEE Trans. Med. Imaging 2019, 39, 1856–1867. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Oktay, O.; Schlemper, J.; Folgoc, L.L.; Lee, M.; Heinrich, M.; Misawa, K.; Mori, K.; McDonagh, S.; Hammerla, N.Y.; Kainz, B.; et al. Attention U-Net: Learning Where to Look for the Pancreas. arXiv 2018, arXiv:1804.03999. [Google Scholar] [CrossRef] [Scilit]
- Huang, H.; Lin, L.; Tong, R.; Hu, H.; Zhang, Q.; Iwamoto, Y.; Han, X.; Chen, Y.W.; Wu, J. UNet 3+: A Full-Scale Connected UNet for Medical Image Segmentation. In ICASSP 2020—2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP); IEEE: Piscataway, NJ, USA, 2020. [Google Scholar]
- Cao, H.; Wang, Y.; Chen, J.; Jiang, D.; Zhang, X.; Tian, Q.; Wang, M. Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation. In Computer Vision–ECCV 2022 Workshops. ECCV 2022; Lecture Notes in Computer Science; Karlinsky, L., Michaeli, T., Nishino, K., Eds.; Springer: Cham, Switzerland, 2022; Volume 13803. [Google Scholar] [CrossRef] [Scilit]
- Xie, E.; Wang, W.; Yu, Z.; Anandkumar, A.; Alvarez, J.M.; Luo, P. SegFormer: Simple and Efficient Design for Semantic Segmentation with Transformers. arXiv 2021, arXiv:2105.15203. [Google Scholar] [CrossRef] [Scilit]
- Ranftl, R.; Bochkovskiy, A.; Koltun, V. Vision Transformers for Dense Prediction. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV); IEEE: Piscataway, NJ, USA, 2021. [Google Scholar]
- Takikawa, T.; Acuna, D.; Jampani, V.; Fidler, S. Gated-SCNN: Gated Shape CNNs for Semantic Segmentation. arXiv 2019, arXiv:1907.05740. [Google Scholar] [CrossRef] [Scilit]
- Marmanis, D.; Schindler, K.; Wegner, J.D.; Galliani, S.; Datcu, M.; Stilla, U. Classification With an Edge: Improving Semantic Image Segmentation with Boundary Detection. ISPRS J. Photogramm. Remote Sens. 2018, 135, 158–172. [Google Scholar] [CrossRef] [Scilit]
- Ishikawa, H.; Aoki, Y. Boosting Semantic Segmentation with Semantic Boundaries. arXiv 2023, arXiv:2304.09427. [Google Scholar] [CrossRef] [Scilit]
- Fu, J.; Liu, J.; Tian, H.; Li, Y.; Bao, Y.; Fang, Z.; Lu, H. Dual Attention Network for Scene Segmentation. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: Piscataway, NJ, USA, 2019. [Google Scholar]
- Wang, C.; Zhang, Y.; Cui, M.; Ren, P.; Yang, Y.; Xie, X.; Hua, X.S.; Bao, H.; Xu, W. Active Boundary Loss for Semantic Segmentation. Proc. AAAI Conf. Artif. Intell. 2022, 36, 2397–2405. [Google Scholar] [CrossRef] [Scilit]
- Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal Loss for Dense Object Detection. arXiv 2018, arXiv:1708.02002. [Google Scholar] [CrossRef] [Scilit]






| Defect Class | Count | Ratio |
|---|---|---|
| Crack | 1653 | 16.4% |
| Undercut | 1552 | 15.4% |
| Porosity | 1472 | 14.6% |
| Slag inclusion | 1461 | 14.5% |
| Lack of fusion | 1441 | 14.3% |
| Incomplete penetration | 1290 | 12.8% |
| Concavity | 1210 | 12.0% |
| Total | 10,079 | 100.0% |
| Family | Method | Dice ↑ | Precision ↑ | Recall ↑ | SD3px ↑ |
|---|---|---|---|---|---|
| CNN-based baselines | U-Net [10] | 0.746 ± 0.004 | 0.701 ± 0.006 | 0.789 ± 0.005 | 0.211 ± 0.014 |
| UNet++ [15] | 0.762 ± 0.003 | 0.718 ± 0.005 | 0.804 ± 0.004 | 0.235 ± 0.009 | |
| Attention U-Net [16] | 0.772 ± 0.004 | 0.728 ± 0.006 | 0.816 ± 0.005 | 0.251 ± 0.007 | |
| UNet3+ [17] | 0.783 ± 0.003 | 0.742 ± 0.005 | 0.826 ± 0.004 | 0.270 ± 0.016 | |
| DeepLabV3+ | 0.788 ± 0.003 | 0.756 ± 0.004 | 0.823 ± 0.004 | 0.289 ± 0.006 | |
| Transformer-based baselines | Swin-UNet [18] | 0.786 ± 0.004 | 0.751 ± 0.006 | 0.825 ± 0.005 | 0.284 ± 0.007 |
| SegFormer [19] | 0.784 ± 0.004 | 0.742 ± 0.005 | 0.829 ± 0.004 | 0.278 ± 0.008 | |
| DPT [20] | 0.789 ± 0.005 | 0.739 ± 0.006 | 0.836 ± 0.005 | 0.269 ± 0.011 | |
| Proposed | Proposed Method | 0.810 ± 0.003 † | 0.809 ± 0.004 † | 0.812 ± 0.004 | 0.394 ± 0.008 † |
| Defect Type | Ratio (%) | Dice ↑ | Precision ↑ | Recall ↑ | SD3px ↑ |
|---|---|---|---|---|---|
| Crack | 16.4 | 0.787 ± 0.010 | 0.768 ± 0.011 | 0.807 ± 0.010 | 0.340 ± 0.021 |
| Undercut | 15.4 | 0.823 ± 0.005 | 0.825 ± 0.006 | 0.822 ± 0.006 | 0.409 ± 0.010 |
| Porosity | 14.6 | 0.826 ± 0.004 | 0.840 ± 0.006 | 0.813 ± 0.005 | 0.423 ± 0.009 |
| Slag inclusion | 14.5 | 0.811 ± 0.005 | 0.818 ± 0.007 | 0.805 ± 0.006 | 0.407 ± 0.010 |
| Lack of fusion | 14.3 | 0.809 ± 0.006 | 0.804 ± 0.007 | 0.815 ± 0.006 | 0.389 ± 0.011 |
| Incomplete penetration | 12.8 | 0.814 ± 0.005 | 0.807 ± 0.006 | 0.822 ± 0.006 | 0.413 ± 0.016 |
| Concavity | 12.0 | 0.801 ± 0.006 | 0.804 ± 0.007 | 0.799 ± 0.007 | 0.383 ± 0.012 |
| MSF | BGDA | FPL | Dice ↑ | Precision ↑ | Recall ↑ | SD3px ↑ |
|---|---|---|---|---|---|---|
| × | × | × | 0.788 ± 0.003 | 0.756 ± 0.004 | 0.823 ± 0.004 | 0.289 ± 0.006 |
| ✓ | × | × | 0.787 ± 0.004 | 0.745 ± 0.006 | 0.834 ± 0.005 | 0.314 ± 0.017 |
| ✓ | ✓ | × | 0.798 ± 0.003 | 0.776 ± 0.005 | 0.819 ± 0.004 | 0.365 ± 0.011 |
| ✓ | × | ✓ | 0.795 ± 0.004 | 0.787 ± 0.005 | 0.802 ± 0.005 | 0.350 ± 0.008 |
| ✓ | ✓ | ✓ | 0.810 ± 0.003 † | 0.809 ± 0.004 † | 0.812 ± 0.004 | 0.394 ± 0.008 † |
| Setting | r | Dice ↑ | Precision ↑ | Recall ↑ | SD3px ↑ | ||||
|---|---|---|---|---|---|---|---|---|---|
| Default | 3 | 2.0 | 0.10 | 0.3 | 1.0 | ||||
| Weaker boundary guidance | 2 | 1.5 | 0.10 | 0.2 | 1.0 | ||||
| Stronger boundary guidance | 4 | 2.5 | 0.10 | 0.5 | 1.0 | ||||
| Weaker FP suppression | 3 | 2.0 | 0.20 | 0.3 | 0.5 | ||||
| Stronger FP suppression | 3 | 2.0 | 0.05 | 0.3 | 1.5 |
| Strategy Family | Boundary or Suppression Role | Inference-Time Boundary Dependence | Relation to the Proposed Method |
|---|---|---|---|
| Auxiliary boundary branch [21]/edge head [22] | Uses an auxiliary edge or shape branch with boundary supervision | Boundary labels are not required, but an extra branch may remain in the model | The proposed method uses boundary bands only for training regularization, not as an auxiliary prediction task. |
| Boundary prediction head [23] | Explicitly predicts a boundary map to assist mask segmentation | A boundary representation may be generated internally during inference | The proposed method does not predict or use a boundary map at inference. |
| Generic attention mechanism [24] | Reweights channel or spatial features without explicit boundary supervision | No boundary-related input or prediction is required | Generic attention may also enhance seams, noise, or artifacts; BGDA is constrained by training-time boundary priors. |
| Boundary-oriented loss [25] | Optimizes contour distance or boundary alignment during training | No boundary-related input is required during inference | Boundary losses mainly refine contours, whereas FPL uses boundary bands to define where background suppression is safe. |
| Global false-positive suppression [26] | Applies image-wide or class-wide penalties to reduce background confusion | No boundary-related input is required during inference | Global suppression may weaken subtle defects; FPL restricts suppression to stable non-boundary background regions. |
| Proposed method | Uses boundary-band regularization for BGDA and region-aware FPL | Requires only the input radiograph during inference | Boundary guidance is training-time only, and false-positive suppression is spatially selective. |
| Loss Objective | Dice ↑ | Precision ↑ | Recall ↑ | SD3px ↑ |
|---|---|---|---|---|
| Std. BCE + Std. Dice | 0.792 ± 0.004 | 0.764 ± 0.006 | 0.824 ± 0.005 | 0.323 ± 0.008 |
| Focal [26] + Std. Dice | 0.796 ± 0.003 | 0.782 ± 0.005 | 0.811 ± 0.004 | 0.338 ± 0.008 |
| Active Boundary Loss [25] + Std. Dice | 0.800 ± 0.003 | 0.783 ± 0.006 | 0.819 ± 0.005 | 0.374 ± 0.013 |
| BW-BCE + BW-Dice | 0.798 ± 0.003 | 0.776 ± 0.005 | 0.819 ± 0.004 | 0.365 ± 0.011 |
| BW-BCE + BW-Dice + FPL | 0.810 ± 0.003 † | 0.809 ± 0.004 † | 0.812 ± 0.004 | 0.394 ± 0.008 † |
| Comparison | Metric | Mean Difference | 95% CI | Adjusted p-Value |
|---|---|---|---|---|
| Proposed Method vs. DPT | Dice | +0.021 | [+0.015, +0.027] | 0.006 |
| Proposed Method vs. DeepLabV3+ | Precision | +0.053 | [+0.045, +0.061] | <0.001 |
| Proposed Method vs. DeepLabV3+ | SD3px | +0.105 | [+0.089, +0.121] | <0.001 |
| Full model vs. MSF+BGDA | Dice | +0.012 | [+0.008, +0.016] | 0.011 |
| Full model vs. MSF+BGDA | Precision | +0.033 | [+0.026, +0.040] | 0.002 |
| Full model vs. MSF+BGDA | SD3px | +0.029 | [+0.019, +0.039] | 0.007 |
| Method | Params (M) | FLOPs (G) | Latency (ms) | FPS |
|---|---|---|---|---|
| DeepLabV3+ | 45.670 | 112.825 | 105.4 | |
| Proposed Method | 46.878 | 153.660 | 87.8 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Yang, X.; Yang, F.; Wu, J.; Rong, R.; Hu, W.; Shen, Y.; Hu, J. A Boundary-Guided Feature Modulation Network for Weld Radiographic Defect Segmentation. Appl. Sci. 2026, 16, 6579. https://doi.org/10.3390/app16136579
Yang X, Yang F, Wu J, Rong R, Hu W, Shen Y, Hu J. A Boundary-Guided Feature Modulation Network for Weld Radiographic Defect Segmentation. Applied Sciences. 2026; 16(13):6579. https://doi.org/10.3390/app16136579
Chicago/Turabian StyleYang, Xuanyu, Fan Yang, Junjie Wu, Rong Rong, Wang Hu, Yuncheng Shen, and Junjie Hu. 2026. "A Boundary-Guided Feature Modulation Network for Weld Radiographic Defect Segmentation" Applied Sciences 16, no. 13: 6579. https://doi.org/10.3390/app16136579
APA StyleYang, X., Yang, F., Wu, J., Rong, R., Hu, W., Shen, Y., & Hu, J. (2026). A Boundary-Guided Feature Modulation Network for Weld Radiographic Defect Segmentation. Applied Sciences, 16(13), 6579. https://doi.org/10.3390/app16136579

