Source-linked AI summary

Leakage-Safe Machine Learning for Hydrogen Embrittlement Detection in 316L Stainless Steel: A Region-Held-Out Evaluation of Texture and Deep Features in SEM Micrographs

Muhammad Awais, Muhammad Yaseen, Abdul Shakoor, Niaz Ahmed Niaz, Huria Zia, Muhammad Zain Shakoor

arXiv:2609.28567v1cs.LGcond-mat.mtrl-sci

TL;DR

Image-level splits can leak information when images share a specimen region, complicating evaluation of machine-learning detection of hydrogen embrittlement from SEM micrographs. This study evaluates AR-versus-H2 classification in 316L with region-held-out cross-validation and group-level permutation testing. LBP+SVM performed best, with reported statistical significance.

  • Problem

    Image-level splits can leak information between training and test sets when multiple SEM images come from the same specimen region.

    Source: §1 · p. 2
  • Method

    The study evaluates AR-versus-H2 SEM classification in 316L using region-held-out testing and group-level permutation testing.

    Source: §1 · p. 2, §3.4 · p. 9, §4 · p. 13
  • Results

    LBP+SVM achieved balanced accuracy of 0.79, H2 recall of 0.69, and H2 precision of 0.82, outperforming a CNN and self-supervised global embeddings; permutation testing yielded p = 0.008.

    Source: §4 · p. 10
  • Takeaways & Limitations

    For this 316L classification task, region-held-out evaluation combined with group-level permutation testing provides statistical validation of the result.

    Source: §4 · pp. 10, 13

    Pilot data for X65, 100Cr6, and 304 are not yet large enough for region-held-out evaluation, and combining LBP with other features remains to be tested.

    Source: §4 · p. 13

Abstract

from arXiv · show

Scanning electron microscopy (SEM) is routinely used to characterize the microstructural changes caused by hydrogen embrittlement (HE) in structural steels. Machine learning can automate this characterization, but models are often evaluated using image-level splits. When several images come from the same specimen region, such splits leak information between the training and test sets. Here, we propose a region-held-out protocol for classifying as-received (AR) and hydrogen-charged (H2) SEM micrographs of 316L stainless steel, based on Leave-One-Region-Out (LORO) cross-validation over 14 spatial regions (8 AR, 6 H2; 31 images). We compared six feature-classifier combinations built on local binary patterns (LBP), grey-level co-occurrence matrices (GLCM), self-supervised convolutional embeddings pretrained on 143 unlabeled SEM images, and a convolutional neural network (CNN). The simplest texture approach, LBP with a support vector machine (LBP+SVM), performed best, achieving a balanced accuracy of 0.79, H2 recall of 0.69, and H2 precision of 0.82, outperforming every deep-learning and combined-feature model. A group-level permutation test (500 permutations sampled from the 3,003 possible region-to-label assignments) yielded p = 0.008, indicating that the result cannot be explained by a chance alignment of the region structure. Grad-CAM maps from a CNN trained on the full dataset tended to concentrate on localized surface and grain-boundary features, where hydrogen-induced morphological changes are known to occur. Under a leakage-safe, statistically validated protocol, texture descriptors recover a hydrogen-charging signature from SEM micrographs even with few samples, and the same protocol can be extended to larger HE detection studies in other alloy systems.

1 Introduction

SEM captures visual signs of hydrogen damage, but manual analysis is slow and machine-learning models must generalize across spatially varying microstructures rather than memorize regions. This study addresses that gap with region-held-out evaluation of hydrogen-embrittlement detection in 316L.

1 Introduction

  • SEM captures visual signs of hydrogen damage, while manual microstructural analysis is slow and open to human bias.Automated computer vision and machine learning are presented as ways to scale analysis.Source: §1 · p. 2
  • Region-held-out evaluation tests whether models generalize to unseen microstructural domains instead of benefiting from spatial leakage or region-specific features.Image-level splits can mix images from the same region across training and test sets, while region separation tests on a zone the model has not seen.Source: §1 · p. 2
  • Neural-network adoption in metallography is limited by scarce annotated datasets, information-dense micrographs, and hard-to-interpret decisions.The introduction also notes that models trained on natural images or specialized medical tasks can yield inaccurate boundary delineation and ambiguous labels in 316L microstructures.Source: §1 · pp. 2–3
  • The study builds a pipeline for region-held-out SEM-based hydrogen-embrittlement detection in 316L and examines model performance and architecture on distinct domains.The broader motivation is validation on previously unseen material regions.Source: §1 · p. 2
  • Spatial correlations and hidden stratification can let models use artifacts or local imaging features instead of underlying damage, producing overly optimistic metrics on unseen regions.The introduction identifies background artifacts, specimen-preparation textures, and local imaging features as possible shortcuts.Source: §1 · p. 2

2 Methodology

The methodology uses SEM images from 316L and other alloys to compare texture descriptors, learned features, and a CNN for AR-versus-H2 classification. It evaluates predictions with region-level holdouts and uses group-level permutation testing to assess significance.

2 Methodology

  • The primary task uses 31 316L images from 14 regions, with region identity as the leakage-prevention unit for data splits.The subset comprises 8 AR and 6 H2 regions.Source: §2 · p. 3
  • The compared inputs include LBP and GLCM texture descriptors, self-supervised global embeddings, and a CNN trained on raw images.LBP and GLCM were used individually and in combined-feature classifiers; the autoencoder was pretrained on unlabeled images.Source: §2 · p. 4
  • Fourteen-fold Leave-One-Region-Out cross-validation withholds each region in turn, pools predictions, and evaluates balanced accuracy, F1, precision, and recall.The evaluation emphasizes H2, the minority class, because missed H2 cases matter most for safety.Source: §2 · p. 4
  • A group-level permutation test reruns the LORO pipeline under permuted region-to-label assignments to form a null distribution of balanced accuracy.The test uses 500 draws from the 3,003 possible assignments.Source: §2 · p. 4
  • Grad-CAM is applied to a CNN trained on the full 316L image set to locate image regions that distinguish AR from H2 surface morphologies.This interpretability analysis is not run with a held-out split.Source: §2 · p. 4

3 Results and Discussion

The results assess model performance and evidence for a hydrogen-charging signature in 316L SEM micrographs under region-held-out evaluation, including permutation testing and qualitative feature analyses. They also address limitations in practical reliability and interpretability.

3.1 Overview of LORO classification performance

  • For 316L AR vs. H2 in 14-fold LORO cross-validation, LBP+SVM performed best: balanced accuracy 0.79 ± 0.36, F1 0.75, and H2 precision 0.82, exceeding CNN balanced accuracy 0.67 ± 0.45.Source: §3.1 · p. 5, Table 1 · p. 5

3.2 Pooled confusion matrix and H2 recall

  • LBP+SVM correctly classified 16 of 18 AR images (specificity = 0.89) and 9 of 13 H2 images (recall = 0.69), missing 4 H2 images and flagging 2 AR images.The authors note that the four false negatives mean the model currently misses roughly one in three H2-exposed regions, limiting its use as a stand-alone screening tool.Source: §3.2 · pp. 5–6, Table 2 · p. 6, Figure 1 · p. 6

3.3 Fold-level variance and the cost of region-held-out evaluation

  • Across folds, LBP+SVM’s aggregate-results standard deviation was ±0.36; in a two-image fold, one misclassified image could shift the fold’s score by 0.5 or more.The variance reflects the difficulty of generalizing to an entirely new specimen region and provides a more realistic estimate of practical performance.Source: §3.3 · pp. 6–7

3.4 Statistical significance via permutation testing

  • LBP+SVM’s observed balanced accuracy of 0.7906 exceeded the null in a group-level permutation test (3 of 500 permutations reached or exceeded it; p = 0.008).The test permuted region-to-label assignments and reran the full LORO pipeline; the authors concluded the result was not due to a chance arrangement of region labels.Source: §3.4 · p. 9
  • LBP+GLCM+SVM was not significant under the same permutation procedure (observed BA = 0.62, p = 0.174), supporting the authors’ concern that added GLCM features contributed noise.The paper describes the comparison as differing only in the added GLCM features and notes that the test could distinguish the two representations.Source: §3.4 · p. 9
  • Observed balanced accuracy was 0.79, with permutation-test p = 0.008, supporting a statistically significant hydrogen-charging signature under the Leave-One-Region-Out protocol.The null distribution was generated from 500 permutations of region-to-label assignments.Source: Figure 4 · p. 9, §3.4 · p. 9

3.5 Grad-CAM interpretability and physical plausibility

  • Grad-CAM activations varied across the six sampled images but tended to localize on grain-boundary networks and surface relief rather than global image properties.The maps were generated for three AR and three H2 images using a SmallCNN trained on all 316L images.Source: §3.5 · p. 10
  • H2 activation hotspots often coincided with visually different surface texture, qualitatively matching descriptions of hydrogen-induced changes in grain-boundary cohesion and surface texture.This spatial agreement suggests physically plausible features rather than imaging artifacts or background, but is qualitative evidence.Source: §3.5 · p. 10
  • The LBP histogram comparison links the best classical model, LBP+SVM, directly to an inspectable image representation, addressing a common black-box criticism.The comparison provides a direct view of texture-descriptor values used by the classifier.Source: §3.5 · p. 10
  • The interpretability analysis is qualitative and based on only six images; it supports, but does not replace, the quantitative LORO and permutation-test results.It should be read as converging evidence rather than evidence in its own right.Source: §3.5 · p. 10

4 Conclusion

Under 14-fold Leave-One-Region-Out evaluation, LBP+SVM led the tested classifiers and its result was statistically significant in a group-level permutation test. The conclusion also reports qualitative Grad-CAM findings and identifies the small dataset as a boundary for further work.

4 Conclusion

  • 0.79 balanced accuracy, 0.69 H2 recall, and 0.82 H2 precision were achieved by LBP+SVM, which outperformed the tested CNN, self-supervised embeddings, and GLCM-based models.The six feature-classifier combinations were evaluated with 14-fold Leave-One-Region-Out cross-validation.Source: §4 · p. 10
  • p = 0.008 in the group-level permutation test indicated that LBP+SVM performance was not due to a chance arrangement of the 14 specimen regions.The test sampled 500 permutations from 3,003 possible region-to-label arrangements.Source: §4 · p. 10
  • Grad-CAM activations concentrated on localized surface and grain-boundary features, but no single activation pattern was consistent across sampled images.The CNN was trained on the full dataset without a held-out split, so this interpretability result is qualitative rather than held-out validation.Source: Figure 5 · p. 11, §4 · p. 13
  • The authors conclude that simple, low-parameter texture descriptors can outperform deep and self-supervised representations in small-sample SEM classification tasks.They also present region-held-out evaluation with group-level permutation testing as a leakage-safe validation framework.Source: §4 · p. 13
  • The 31-image study is a starting point; adding regions and specimens is proposed to reduce fold-level variance and increase confidence in the metrics.The protocol could also be extended to other alloy systems, for which pilot data are not yet large enough for region-held-out evaluation.Source: §4 · p. 13

Author Contribution Statement

MA led the methodological and experimental work, while the other authors contributed supervision, resources, manuscript review, and figures and tables.

  • MA developed the methodological framework and handled implementation, experimental design, model training and evaluation, performance analysis, and the original draft.Source: Author Contribution Statement · p. 13
  • AS supervised the research, while AS and NAN contributed to manuscript review and editing; NAN also provided computational resources.Source: Author Contribution Statement · p. 13
  • MY and HZ prepared and edited figures and tables, MZS contributed proofreading and language correction, and all authors approved the final manuscript.Source: Author Contribution Statement · p. 13

Data Availability Statement

The SEM micrographs are available from the corresponding author on reasonable request, and the specimen-region metadata convention is documented.

Code Availability Statement

The authors provide code for the analysis workflow under an open license and identify the release and computing setup used for the reported experiments.

Declaration of Competing Interest

The authors report no known competing financial interests or personal relationships that could have influenced the work.

Loading 2609.28567v1…