---
title: Defect Detection Interpretability Analysis
url: https://www.emergentmind.com/topics/defect-detection-interpretability-analysis-ddia
type: topic
---

# Defect Detection Interpretability Analysis

Defect Detection Interpretability Analysis (DDIA) is a framework for post-classification explanation, expert validation, and iterative refinement in automated X-ray weld defect detection. Introduced together with Adapt-WeldNet for maritime welding inspection, DDIA is designed to close the “interpretability gap” that arises when neural classifiers detect weld defects without providing domain experts with transparent, actionable reasons for their decisions. In the reported formulation, DDIA operates immediately downstream of a fixed Adapt-WeldNet classifier, applies Grad-CAM and LIME to each weld image, presents both explanations in a structured interface, records assessments from certified ASNT NDE Level II professionals, and feeds those assessments back into model refinement through data filtering or augmentation, threshold adjustment, and potential retraining [2508.00381].

## 1. Position of DDIA in the weld-inspection pipeline

DDIA is defined as a downstream interpretability framework rather than as a standalone detector. Its stated objective is “to close the ‘interpretability gap’ in automated X-ray weld defect detection by providing domain experts (ASNT NDE Level II) with transparent, actionable explanations of model decisions.” Its scope begins after the candidate classifier and its hyperparameters have been fixed. At that point, DDIA performs four steps on each weld image: it applies two complementary XAI methods, presents the resulting explanations in a structured interface, collects expert assessments on detection correctness, explanation clarity, and confidence, and returns that feedback to model refinement [2508.00381].

This placement is significant because the framework does not treat interpretability as an informal visualization stage. Instead, it formalizes a post-hoc but operationally connected layer between model output and deployment. The paper’s abstract situates this design in safety-critical inspection, noting that traditional non-destructive testing methods often fail to detect subtle or internal defects and that existing neural network-based approaches frequently rely on arbitrarily selected pretrained architectures and lack interpretability. Within that setting, DDIA functions as a transparency and governance mechanism for weld-defect decisions in offshore and marine environments [2508.00381].

A recurrent misconception in defect-inspection research is to equate interpretability with the mere presence of a saliency map. DDIA explicitly adopts a broader interpretation: explanation generation is necessary but insufficient without domain-specific evaluation, confidence scoring, and a feedback loop into model redevelopment. This characterization follows directly from the framework’s workflow and HITL integration [2508.00381].

## 2. Core explanatory methods and mathematical formulation

DDIA employs two complementary XAI techniques: Grad-CAM and LIME. The framework uses Grad-CAM to generate a heatmap overlay on the original X-ray and LIME to generate a boundary-focused superpixel map showing locally important regions. The paper describes Grad-CAM as class-specific and LIME as local and model-agnostic, so the two methods are intended to provide distinct but intersecting views of the evidence used by the classifier [2508.00381].

For Grad-CAM, the importance map for class $c$ is computed as

$$
L^c = \mathrm{ReLU}\left(\sum_k \alpha_k^c \cdot A^k\right),
$$

with channel weight

$$
\alpha_k^c = \frac{1}{Z}\sum_i\sum_j \frac{\partial y^c}{\partial A^k_{ij}},
$$

where $Z$ is the number of spatial locations in $A^k$, and $\mathrm{ReLU}(\cdot)$ zeroes out negative influences. In this formulation, the explanation is anchored in the gradient of the class score $y^c$ with respect to the feature map activations. The resulting map is then visualized as a heatmap over the X-ray image [2508.00381].

For LIME, the explainer samples perturbed versions $Z$ around a target image $x$, for example by masking out super-pixels, and fits a simple surrogate model $g \in G$ by minimizing

$$
\mathrm{Explanation}(x) = \arg\min_{g \in G} L(f,g,\pi_x) + \Omega(g),
$$

where

$$
L(f,g,\pi_x) = \sum_{z \in Z} \pi_x(z)[f(z)-g(z)]^2,
$$

and

$$
\pi_x(z) = \exp(-D(x,z)^2/\sigma^2).
$$

Here, $\Omega(g)$ is a complexity penalty such as the number of nonzero coefficients. In DDIA, this produces a superpixel-based explanation that emphasizes locally important image regions [2508.00381].

The visualization layer is also specified. After the Adapt-WeldNet classifier produces per-image predictions, DDIA generates a Grad-CAM heatmap overlay and a LIME superpixel map. A web-based GUI displays the raw X-ray, the Grad-CAM overlay, and the LIME visualization side by side, with standardized fields below the visualizations for expert input. This interface is central to the framework because it converts post-hoc explanations into a reviewable artifact for certified inspectors rather than leaving them as developer-only diagnostics [2508.00381].

## 3. Domain-specific evaluation and the human-in-the-loop mechanism

DDIA’s evaluation protocol is centered on certified ASNT NDE Level II professionals. The framework defines a domain-specific annotation schema covering film quality, whether the defect is detected, how visible it is, how it should be classified, and how much confidence the expert assigns to each explainer’s map. The reported fields are categorical and numerical, enabling both qualitative inspection and quantitative aggregation [2508.00381].

| Evaluation field | Allowed responses |
|---|---|
| Film Quality Assessment | clear, underexposed, overexposed, or noisy |
| Defect Detection (per explainer) | “Detected? Yes/No” |
| Defect Visibility Rating | clearly visible / partially visible / not visible |
| Defect Type Classification | crack, lack of penetration (LP), or porosity |
| Confidence Score | 1 = poor to 5 = excellent |

The paper states that experts annotate a curated test set of 200 X-ray films balanced across quality categories. All responses are logged. When more than 30% of experts flag poor visibility or misdetection under a given condition, that condition is flagged for one or more remediation steps: dataset augmentation, threshold adjustment, or model re-training focusing on failure cases. The paper gives examples such as simulating more underexposed samples and raising the detection-score cutoff [2508.00381].

The HITL procedure is iterative. In each development cycle, new explanations are re-evaluated by experts until acceptability thresholds are met, with the paper giving the example targets of more than 80% “Detected=Yes” and average confidence at least 4 for all quality types. This means that interpretability is not treated as a one-time audit. It is operationalized as a repeated review-and-correction process that links failure modes in explanations to concrete interventions in the training pipeline [2508.00381].

This design also clarifies what DDIA counts as explanation quality. It is not only whether a saliency map is visually plausible, but whether trained inspectors regard the defect as detectable, sufficiently visible, correctly typed, and confidently localized. That evaluative framing is specific to industrial radiographic inspection and distinguishes DDIA from generic saliency benchmarking [2508.00381].

## 4. Trustworthy AI alignment, auditability, and quantitative interpretability

DDIA is explicitly aligned with three Trustworthy AI principles: reliability, fairness, and accountability. Reliability is addressed through quantitative “recall-based interpretability” metrics that measure whether explainers consistently highlight true defect pixels. Fairness is addressed by stratifying expert evaluations by defect type and film quality in order to detect systematic bias, such as underperformance on porosity in noisy films. Accountability is addressed by recording each decision—model choice, hyperparameter setting, expert feedback, and threshold change—in an audit log, with regular reviews by a multidisciplinary committee to verify adherence to maritime-safety standards [2508.00381].

The central quantitative measure reported for DDIA is the recall-based interpretability metric for Grad-CAM. For image $i$, with Grad-CAM heatmap $L_i^c$ and ground-truth mask $G_i$, recall is defined as

$$
\mathrm{Recall}_i = \frac{\sum (L_i^c \cdot G_i)}{\sum G_i}.
$$

Average recall over $N = 1{,}031$ annotated images is then

$$
\mathrm{Average\ Recall} = \frac{1}{N}\sum_{i=1}^N \mathrm{Recall}_i = 0.7722.
$$

This metric is important because it shifts part of interpretability evaluation from subjective heatmap inspection to overlap with annotated defect pixels. The framework therefore combines three layers of evidence: pixel-level recall, expert categorical judgments, and logged governance actions [2508.00381].

A second misconception addressed implicitly by DDIA is that explanation quality and decision reliability are identical. The framework does not make that equivalence. Instead, it uses recall-based localization, stratified expert review, and auditability as complementary controls. This distinction matters in safety-critical inspection because an explanation can be visually coherent while still being inadequate under poor film quality or for particular defect classes [2508.00381].

## 5. Reported empirical outcomes

The empirical results reported for DDIA cover film quality distribution, explainer localization performance, confidence ratings, and the downstream impact of DDIA-informed retraining. In the expert-reviewed sample summarized in Fig. 9 of the paper, the film quality distribution was 37.3% clear, 26.3% underexposed, 21.7% overexposed, and 14.7% noisy. These proportions matter because the framework’s HITL loop is explicitly conditioned on film quality and uses quality-stratified analysis for both fairness and remediation [2508.00381].

| Outcome | Grad-CAM | LIME |
|---|---:|---:|
| Defects correctly localized | 94% | 85% |
| Confidence score (Mean ± SD) | 4.2 ± 0.6 | 3.5 ± 0.8 |

The paper also reports an improvement in the underlying classifier after two DDIA-informed retraining cycles targeting underexposed and noisy film augmentations. Overall classifier accuracy rose from 95.1% to 96.7%, and Grad-CAM recall improved from 0.72 to 0.78. No statistical test was reported, but the paper states that these gains exceeded the pre-specified improvement target of 1.0% accuracy and 0.05 recall [2508.00381].

These results support a narrow but important claim: DDIA is presented not only as an interpretability framework but also as a refinement mechanism capable of improving model performance through explanation-guided error analysis. The evidence provided is descriptive rather than inferential, since no statistical test is reported. Even so, the framework’s logic is explicit: explanation failure modes observed by experts under particular radiographic conditions trigger targeted augmentation, threshold recalibration, or retraining, and the revised system is then re-evaluated against acceptability thresholds [2508.00381].

## 6. Relation to broader defect-interpretability research

DDIA belongs to a broader research trajectory in which defect detection systems are increasingly evaluated not only by predictive accuracy but also by the transparency, localization fidelity, and operational usefulness of their explanations. Several adjacent lines of work sharpen the conceptual boundaries of DDIA and suggest where it sits within the field.

One neighboring direction uses post-hoc explanations as a reliability wrapper for binary defect detection. A 2026 study proposes a reliability score based on the difference in IoU between class-specific Grad-CAM heatmaps and class-agnostic FullGrad heatmaps, with optional adversarial enhancement; on industrial benchmarks, the method can achieve 100% false-negative recall with adversarial enhancement, albeit with a trade-off for true negatives [2604.19206]. This is distinct from DDIA’s expert-centered workflow, but it reinforces the same general design shift from end-to-end output acceptance toward a data-model-explanation-output pipeline.

A second direction integrates interpretability into training rather than placing it only after training. In data-efficient surface defect detection, a knowledge-guided loss uses FullGrad or LayerCAM saliency maps from a primary model as pseudo-mask priors for a multi-task network, and the segmentation branch is discarded at inference time so that there is zero extra cost at test time [2605.17780]. In software defect prediction, predictor and interpreter are trained jointly through output fidelity, feature fidelity, and an interpretation penalty, yielding improvements in both interpretability metrics and predictive performance [2502.16429]. These works suggest a complementary alternative to DDIA: explanation can serve either as a post-hoc auditing layer or as an explicit training signal.

A third direction broadens interpretability beyond heatmaps. SteelDefectX introduces a vision-language dataset with 7,778 images across 25 defect categories and coarse-to-fine textual descriptions; on 500 manually-annotated masks, fine-grained text yields an alignment score of 0.12 versus 0.05 for classname-only prompts, indicating sharper focus on true defect regions [2603.21824]. EIAD combines natural-language defect descriptions with mask grounding through a decoupled multi-modal localization module, producing text-plus-mask explanations rather than only saliency overlays [2503.14162]. In industrial vision more generally, a photovoltaic defect-detection review explicitly identifies interpretability as a design criterion for trusted deployment [2409.16069], while self-pretrained ViTs for microelectronics have been shown qualitatively to focus on defect-relevant features such as cracks in solder material [2504.10021]. Morphological reasoning systems such as AI-Reasoner take a different route again, extracting 38 Defect Characteristics and using decision trees to explain the successes and failures of a mask-based detector [2307.11643].

Taken together, these related works make clear that DDIA is one specific instantiation of a larger interpretability agenda in defect inspection. Its distinguishing properties are the coupling of Grad-CAM and LIME with a web-based expert review interface, the formal HITL feedback loop, and the explicit alignment with reliability, fairness, and accountability in maritime welding inspection [2508.00381]. A plausible implication is that future DDIA variants may combine several of the field’s emerging patterns at once: saliency-based auditing, training-time interpretability regularization, textual or concept-level explanations, and explicit reliability wrappers for deployment.

Source: https://www.emergentmind.com/topics/defect-detection-interpretability-analysis-ddia