4.4. Experimental Results and Analysis
To systematically assess the effectiveness and deployability of MGDR-YOLO for X-ray weld defect detection, we conduct experiments under a unified hardware setup and training protocol, organized along three axes: accuracy, efficiency, and complexity. First, we compare MGDR-YOLO with the strong baseline YOLOv11 in terms of overall detection performance (
Table 2), and we provide a quantitative analysis of throughput, FLOPs, parameters, and peak GPU memory to characterize computational and resource costs (
Table 3). Next, we evaluate structural components in turn: the gains from backbone replacement (
Table 4); the effect of the GAFB fusion mechanism and attention design (
Table 5); the trade-offs of key hyperparameters in DFConv (
Table 6); comparisons of RSCD sharing strategies (
Table 7); and ablation studies that add or remove modules step by step to quantify marginal contributions (
Table 8). In addition, because the LP class exhibits the largest improvement in the final model, we further provide class-wise ablation results for lack-of-penetration defects to analyze the contribution of each proposed module to this challenging slender and low-contrast defect type (
Table 9). Finally, we conduct side-by-side comparisons with representative methods to verify the overall advantages of our approach under equal or lower compute budgets (
Table 10). All evaluations use single-scale testing. Precision, recall, and mAP serve as the primary metrics, and post-processing time is included in FPS for fair comparison.
The overall comparison with YOLOv11 demonstrates that MGDR-YOLO achieves stable improvements in comprehensive detection performance (
Table 2). The aggregate (All) metrics increase from 86.5/88.9/92.9 (P/R/mAP) to 92.5/89.7/95.2, i.e., +6.0/+0.8/+2.3 percentage points. By defect type, the LP class (slender and low-contrast) shows the largest gains: P/R/mAP improve from 88.2 to 98.3, confirming that MultiBackbone + DFConv + GAFB specifically strengthen responses to directional and low-contrast structures. Cr and LF also see mAP increases of 1.4 and 1.2, respectively. Overall, MGDR-YOLO raises the overall mAP while markedly improving detection quality for slender and low-contrast defects.
To further analyze the training behavior and convergence characteristics,
Figure 8 reports the evolution of precision, recall, and mAP during training, while
Figure 9 presents the corresponding training and validation loss curves. These curves provide insight into optimization stability and generalization behavior beyond the final metrics.
As shown in
Figure 8, MGDR-YOLO consistently achieves higher precision and mAP throughout training, and converges to a better operating point without introducing instability.
Figure 9 shows that MGDR-YOLO demonstrates stable convergence behavior on both the training and validation sets. It can also be observed that some validation sub-loss curves of MGDR-YOLO and YOLOv11n are close to each other. This phenomenon is reasonable because the detection loss is mainly an optimization objective composed of localization, classification, and distribution-related terms, and its final numerical value does not always change proportionally with mean average precision (mAP). Different network structures may converge to similar loss values while still producing different confidence rankings, localization quality, and precision–recall trade-offs. In particular, MGDR-YOLO improves feature representation for low-contrast and slender defects through MultiBackbone, GAFB, and DFConv, which is more clearly reflected in class-wise average precision, precision–recall curves, and false-positive suppression than in the final validation loss alone. In addition, the same training strategy, data augmentation, loss function, and regularization settings were used for both YOLOv11n and MGDR-YOLO, which may lead to similar convergence trends on some validation sub-losses.
As shown in
Figure 10, compared with YOLOv11, the precision–recall (PR) curves of MGDR-YOLO shift upward and to the right across categories, yielding larger areas and a better precision–recall trade-off. Among the categories, Lack_of_Penetration exhibits the most pronounced improvement; Crack and Lack_of_Fusion also show steady gains, while Slag_Inclusion remains roughly unchanged. In general, MGDR-YOLO maintains higher precision even in high-recall regions, which verifies its advantage on slender and low-contrast defects.
In terms of efficiency and resource usage, MGDR-YOLO also shows clear advantages (
Table 3). Compared with YOLOv11n, FPS increases from 162.5 to 226.4 (+39.4%), the number of GFLOPs drops from 6.3 to 3.1 (−50.8%), the number of parameters decreases from 2.6 M to 1.4 M (−46.2%), and peak GPU memory reduces from 5.49 G to 4.22 G (−23.1%). DFConv reduces convolutional cost through directional decoupling and depthwise separable fusion; GAFB avoids channel expansion caused by naive concatenation via gating and hierarchical attention; RSCD reduces head redundancy and improves throughput with cross-scale sharing and re-parameterization. Together these yield higher accuracy with lower compute and memory costs.
To justify the backbone choice,
Table 4 compares several options. Under the same settings, MultiBackbone reaches mAP = 93.4, Params = 1.7 M, and FPS = 217.3, outperforming alternatives in both accuracy and speed. Compared with RepHGNetV2 (mAP = 89.6), it gains +3.8 mAP. Compared with MobileNetV4 (mAP = 91.6, Params = 5.4 M, FPS = 127.6), it improves mAP by +1.8 while reducing the number of parameters by 68.5% and increasing speed by 70.3%. These results indicate that the parallel, heterogeneous MultiBackbone better matches the “detail and context” representation needs of X-ray weld imagery.
The internal fusion design critically affects performance (
Table 5). Simple concatenation (Concat + 1 × 1) reduces mAP to 91.3, which is lower than the YOLO baseline at 92.9, indicating that channel redundancy and noise leakage can hurt detection. Introducing channel gating increases mAP to 92.7 while also bringing notable parameter and latency advantages. Further combining local–global attention via LGA (
) raises mAP to 93.4, with Params = 1.7 M and FPS = 217.3. Therefore, gating is necessary, and the multi-scale local–global attention provides near-free, consistent gains, making it a key component for improving both mAP and throughput.
The construction of the convolutional operator yields quantifiable gains (
Table 6). Using the colocated standard
convolution as the baseline (mAP = 92.9, FPS = 162.5), DFConv with
, four directional branches, and DW
achieves mAP = 94.3 (+1.4) and FPS = 210.4 (+29.5%), while reducing the number of parameters to 1.6 M. When enlarging the directional kernel to
or the DW kernel to
, inference speed drops and mAP fluctuates (e.g.,
: mAP = 93.6/FPS = 182.7; DW =
: mAP = 92.4/FPS = 177.5), indicating limited marginal benefits and higher costs for larger kernels in this task. Therefore, we adopt a unified DFConv configuration of
, DW =
, and four directional branches in both the backbone and the neck.
Table 7 compares partial sharing and P3–P5 full sharing for RSCD, together with batch normalization (BN) and group normalization (GN). Both the sharing extent and the normalization choice have significant effects. Under partial sharing (Params = 1.7 M), mAP is 93.6% (BN) and 94.1% (GN), with FPS = 182.5 and 201.8, respectively. Extending to P3–P5 full sharing reduces the number of parameters to 1.4 M and improves mAP to 94.5% (BN) and 95.2% (GN), while further increasing speed to 214.1 and 226.4 FPS. This indicates that the detection head for X-ray weld defect detection contains substantial cross-scale redundancy. Unlike natural images with highly diverse object semantics, weld defects in this dataset are mainly characterized by weak contrast, blurred boundaries, elongated structures, and locally concentrated abnormal regions. These visual patterns are shared across different detection scales, making cross-scale convolutional sharing effective for learning consistent defect representations. Before the shared convolutional sequence, each scale is first processed by a scale-specific DDBlock, which aligns the input channels and adapts scale-dependent features to a unified hidden representation. Therefore, the shared layers operate on aligned features rather than directly on the original heterogeneous P3, P4, and P5 feature maps. Moreover, GN is adopted because it does not depend on batch statistics and provides stable normalization for features with different spatial resolutions. These properties allow RSCD to reduce redundant head parameters while maintaining robust multi-scale detection performance.
Overall, P3–P5 full sharing + GN is the best choice in our study, achieving the highest mAP (95.2%) and the fastest speed (226.4 FPS) with the lowest parameter count (1.4 M), thereby validating that RSCD improves head consistency, compresses parameters, and enhances throughput without changing the detection interface.
The additive effects of the modules are further verified by stepwise ablations (
Table 8). Starting from YOLOv11n (mAP = 92.9, FPS = 162.5), adding MultiBackbone and GAFB (MG) raises mAP to 93.4 and increases FPS to 217.3. Replacing convolutions with DFConv on top of MG (MGD) further improves mAP to 94.3 while maintaining high speed (FPS = 210.4). Finally, adding RSCD yields the complete MGDR-YOLO with mAP = 95.2, FPS = 226.4, and Params = 1.4 M. Each module contributes positive gains, and the overall design shows complementary synergy rather than a simple stack.
To further explain the substantial improvement in the LP class, we provide class-wise ablation results for lack of penetration defects in
Table 9. Compared with the baseline YOLOv11n, the introduction of MultiBackbone and GAFB improves the LP mAP from 88.2% to 93.5%, indicating that the parallel detail-context representation and gated fusion strategy are effective for slender and low-contrast defects. After further introducing DFConv, the LP mAP increases to 96.1%, demonstrating that directional convolution strengthens the response to line-like structures and lack-of-penetration regions. The complete MGDR-YOLO achieves the best LP performance, with 90.4% precision, 97.8% recall, and 98.3% mAP. These results show that the improvement in the LP class is not caused by a single module alone, but by the complementary effects of MultiBackbone, GAFB, DFConv, and RSCD.
As shown in
Table 10, under the same evaluation protocol, MGDR-YOLO was compared with both mainstream lightweight YOLO baselines and representative defect/weld-inspection-oriented methods. The general YOLO baselines include YOLOv5n, YOLOv7-tiny, YOLOv8n, YOLOv10n, YOLOv11n, and YOLOv12n, while the task-oriented methods include LF-YOLO, STMA-net, KD-LightNet, and LightYOLO. These comparisons provide a more comprehensive evaluation than using only generic lightweight detectors. MGDR-YOLO achieves 92.5% precision, 89.7% recall, 95.2% mAP, and 226.4 FPS, outperforming all the compared methods in both detection accuracy and inference speed. In particular, compared with LF-YOLO, MGDR-YOLO improves the mAP from 87.2% to 95.2% and increases the FPS from 132.4 to 226.4, demonstrating its advantage over a weld-defect-oriented detector. Compared with LightYOLO, MGDR-YOLO improves the mAP from 92.2% to 95.2% and increases the FPS from 183.4 to 226.4. These results further validate the effectiveness and deployment potential of MGDR-YOLO for X-ray weld defect inspection. To better illustrate the trade-offs between detection accuracy, inference speed, and model complexity reflected in
Table 10,
Figure 11 provides an intuitive bubble-chart visualization based on the mAP, FPS, and parameter count.
Figure 12 shows Grad-CAM++ visualizations and detection results on representative weld samples (from top to bottom: original image, before improvement, after improvement). For each predicted box, the gradients are back-propagated on the last convolutional features to produce a heatmap, which is then overlaid on the original X-ray image to depict attended regions. For slender defects such as cracks and lack of penetration and lack of fusion (LP and LF), the hotspots form continuous strips along the weld line and align well with the bounding boxes, indicating that DFConv’s direction-sensitive representations and GAFB’s gated fusion effectively strengthen line-like structures and their context. For slag inclusion and porosity (SI and PO), high-activation regions concentrate on the defect core and the surroundings are suppressed. When background speckle noise is strong, the high-response regions expand slightly but still maintain stable focus near the target center. Compared with YOLOv11n, MGDR-YOLO produces more compact and clearer heatmaps and significantly reduces false activations under low contrast and complex backgrounds. The high-activation regions are consistent with higher prediction confidence, which agrees with the quantitative improvements in
Table 2 and
Figure 10 (especially the gains of LP in mAP and PR curves), further validating the synergy of MultiBackbone, GAFB, and DFConv for directional detail enhancement and background suppression.
In summary, the experiments systematically demonstrate that MultiBackbone improves joint modeling of detail and context; GAFB suppresses redundancy and noise through channel gating and hierarchical attention; DFConv significantly reduces computation while enhancing directional sensitivity and preserving geometric alignment and interface compatibility; and RSCD achieves head consistency and high throughput via cross-scale sharing and re-parameterization. Consequently, in X-ray weld defect detection, MGDR-YOLO attains higher accuracy, higher real-time speed, and lower resource consumption simultaneously.