Abstract
The welded bead bending test (WBBT) serves as a pivotal procedure for evaluating the crack-arrest capacity of structural steels used for construction of safety-critical infrastructure according to ZTV-ING Part 4 or Deutsche Bahn Standard 918 002-02. Previous research has established that light optical microscopy images (LOMs) of specimens that do not pass the WBBT are frequently characterised by a high prevalence of Widmanstätten ferrite within the base material. While convolutional neural networks (CNNs) have successfully classified WBBT outcomes based on LOMs, the implemented approaches did not enable simultaneous pixel-wise delineation required for accurate quantification of Widmanstätten ferrite. However, the tonal similarity between Widmanstätten ferrite and polygonal ferrite renders conventional intensity-based thresholding ineffective for differentiation, necessitating a morphology-based segmentation approach. The present study proposes an automated semantic segmentation framework for the precise delineation of three microstructural phases present within the WBBT LOMs: polygonal ferrite, pearlite, and Widmanstätten ferrite. Utilising a dataset of 20 LOMs and corresponding manually annotated masks, five UNet encoder backbones were evaluated: ResNet-152, Xception, SE-ResNet-50, DenseNet-169, and EfficientNet-B5. To identify the optimal configuration for this microstructural segmentation task, each architecture was assessed using three distinct weight initialisation strategies: (A) ImageNet, (B) MicroNet, and (C) a combined approach. For Widmanstätten ferrite segmentation at patch level, DenseNet-169 pretrained on ImageNet achieves the best performance (Dice: 50.75% ± 3.38%, IoU: 38.45% ± 3.01%). Following inference-based aggregation, Xception pretrained on ImageNet yields improved results (Dice: 68.74% ± 1.12%, IoU: 52.52% ± 1.28%), with an MAE of 4.55% ± 0.80%.
1. Introduction
The maintenance of structural integrity in infrastructure is considered a fundamental technical responsibility that necessitates the meticulous qualification of construction materials. In Germany, structural steels utilised in safety-critical applications, such as those constructed in accordance with ZTV-ING Part 4 [1] or Deutsche Bahn Standard 918 002-02 [2], are obligated to demonstrate adequate crack-arrest capacity. This requirement is typically assessed by the welded bead bending test (WBBT), as outlined in Stahl–Eisen–Prüfblatt (SEP) 1390 [3]. The WBBT determines a material’s resistance to crack propagation as it transitions from the weld-affected regions into the base material. The test uses a three-point bending setup to examine steel plates with a central weld seam. During welding, the high thermal input induces significant microstructural changes within the heat-affected zone (HAZ), typically resulting in local hardening. Depending on the bending angle and the crack propagation behaviour, results are categorised as passed ( without fracture, though cracks have propagated from the HAZ into the base material), not passed (fracture at ), and invalid (no macroscopically visible cracks originating from the HAZ propagate into the base material).
Earlier studies have successfully employed machine learning (ML)-based classification to predict the outcome of the WBBT in terms of its two primary categories: passed and not passed [4,5,6]. In the course of these studies, it was observed that a significant proportion of samples classified as not passed exhibited a high prevalence of ferrite in a Widmanstätten morphology (Widmanstätten ferrite, WF) within their microstructure, whereas passed WBBT samples were predominantly characterised by polygonal ferrite (F). This observation was further confirmed in [6] through saliency-based analyses, which demonstrated that the employed convolutional neural networks (CNNs) predominantly focus on ferritic regions for the discrimination between both classes. The formation of WF is indicative of a distinctive phase transformation, combining a displacive lattice change with long-range carbon partitioning from the advancing plate tip into the surrounding austenite [7]. This transformation is predominantly favoured by coarse grain size of the prior austenite and elevated cooling rates within a specific thermal regime [8]. Although nucleation occurs through a diffusionless shear mechanism, subsequent growth proceeds along glissile semi-coherent interfaces on crystallographically preferred planes, while carbon redistributes into the surrounding matrix. From a mechanical perspective, the presence of WF is generally regarded as detrimental to structural integrity. The transformation is associated with significant invariant-plane strain, which introduces elastic strain energy into the surrounding matrix. Although WF plates frequently form self-accommodating plate pairs that partially mitigate these stresses, the resulting coarse acicular morphology lacks the high-angle grain boundaries required to effectively impede crack propagation. Consequently, these aligned needle-like structures may provide preferential low-energy cleavage paths, thereby promoting brittle fracture behaviour under tensile loading conditions [7]. These observations suggest that not passing of WBBT samples can be related to unfavourable thermal regimes that occur during production and promote the formation of cleavage-facilitating WF [4,5].
The contrast observed in metallographic micrographs originates from the selective action of etching, which essentially constitutes a controlled corrosion process that generates orientation-dependent surface topography [9]. Smooth surfaces reflect more light and appear bright, whereas roughened areas scatter light and appear darker. Because WF and F possess nearly identical chemical compositions, they react in a comparable manner to the etchant and therefore exhibit similar greyscale intensities in light optical micrographs (LOMs). This tonal similarity renders conventional threshold-based analysis of these microstructural constituents ineffective, necessitating reliance on morphological features for differentiation. In particular, WF can be characterised by its high aspect ratio acicular plates and the frequent occurrence of self-accommodating plate pairs (Figure 1b), which differ greatly with the equiaxed morphology of polygonal ferrite (Figure 1a).
Figure 1.
Comparison of ferrite morphologies in etched microsections: (a) polygonal ferrite appearing as equiaxed bright grains adjacent to dark pearlitic regions; (b) Widmanstätten ferrite characterised by distinct acicular or needle-like structures penetrating the surrounding pearlite. Note that both ferrite phases exhibit nearly identical tonal values, requiring a distinction based solely on morphological features.
The integration of deep learning (DL) has fundamentally altered the methodology for automated microstructure analysis, enabling the identification of complex microstructural constituents such as lath bainite, martensite, cementite particles, and Widmanstätten cementite in steel microstructures [10,11,12,13]. CNNs facilitate the hierarchical extraction of complex spatial features and have therefore become a powerful tool for analysing metallographic images. In contrast to image-level classification approaches, semantic segmentation provides dense pixel-wise predictions that preserve spatial relationships within the microstructure. This capability is particularly advantageous in metallography, where the precise localisation and morphology of microstructural constituents are essential for quantitative analysis. Encoder–decoder architectures such as the UNet [14] have proven particularly effective for such tasks. The architecture combines a contracting encoder path that extracts hierarchical features of an image with an expanding decoder path that restores spatial resolution while incorporating skip connections to preserve fine structural details. This design enables the accurate delineation of microstructural features even when only limited annotated datasets are available. A crucial factor influencing the performance of CNN-based models is the selection of weight initialisation through pretraining. In many transfer-learning scenarios, networks are initialised using weights derived from large natural-image datasets such as ImageNet, which has been shown to stabilise training and improve generalisation performance [15,16,17,18]. However, the substantial differences between natural images and metallographic micrographs in terms of texture, scale, and morphological characteristics suggest that domain-specific pretraining may provide additional advantages. In this context, the MicroNet dataset represents a particularly relevant resource, comprising more than 110,000 microscopy images from a wide range of engineering materials. Networks pretrained on this dataset are specifically optimised to recognise the characteristic textural patterns present in metallographic images. Previous investigations by Stuckner et al. [13] have indicated that such domain-specific pretraining can substantially enhance segmentation performance.
The present work builds upon these findings by investigating the pixel-wise semantic segmentation of LOMs from WBBT samples containing three microstructural phases: polygonal ferrite, pearlite (P), and Widmanstätten ferrite. To determine the most suitable configuration for this task, the performance of five UNet encoder backbones (ResNet-152, Xception, SE-ResNet-50, DenseNet-169, and EfficientNet-B5) was systematically evaluated using three distinct pretraining strategies: (A) ImageNet, (B) MicroNet, and (C) a combined approach. This multi-strategy approach enables a comprehensive comparative evaluation of established CNN architectures and pretraining strategies for microstructural segmentation based on morphological features.
2. Materials and Methods
2.1. Microscopy Dataset, Image Acquisition, and Image Preprocessing
The present study is based on a high-resolution microscopy dataset (4104 px × 2174 px) comprising 800 LOMs of S355J2 WBBT samples, the generation of which was previously described in [6]. From this dataset, 20 LOMs originating from 11 WBBT samples were selected for the segmentation approach (in-distribution dataset), with a maximum of four LOMs included per sample. One additional LOM was designated for out-of-distribution (OOD) evaluation to assess cross-domain generalisation. This LOM originates from an independent WBBT sample provided by a different steel manufacturer, from which no other images were included in either the training or validation sets. As detailed in Table 1, the dataset curation process aimed to capture a diverse range of WF morphologies while ensuring sufficient image quality for reliable annotation. LOMs were manually selected based on clear visual delineation of the microstructural features, a high areal fraction of WF within the field of view, and homogeneous and sufficiently pronounced etching to ensure clear phase contrast. This curated dataset was intended to support reliable annotation and consistent model development. At the same time, the included LOMs may represent comparatively favourable cases for annotation and segmentation and therefore might not fully reflect the variability and annotation complexity present in the complete microscopy dataset. Consequently, the reported segmentation performance should be interpreted in the context of this curation strategy. The datasets exhibit an inherent class imbalance. While ferrite constitutes the predominant phase (in-distribution: ≈60%; OOD: ≈72% mean phase fraction), pearlite (in-distribution: ≈34%; OOD: ≈26%) and Widmanstätten ferrite (in-distribution: ≈7%; OOD: ≈2%) occupy substantially smaller phase fractions.
Table 1.
Mean phase fractions and their corresponding standard deviations (std. dev.) across the selected LOMs, separated into the in-distribution dataset (20 LOMs) and the OOD image (1 LOM). A significant class imbalance is evident across both, with F as the predominant constituent and WF being notably underrepresented.
Metallographic preparation was concluded with polishing under utilisation of an 0.25 μm abrasive, followed by etching with a 3% nitric acid solution for 10 s to 15 s. Images were acquired using an Olympus BX60 light optical microscope (Olympus Corporation, Tokyo, Japan) equipped with a 20×/0.45 objective, resulting in a spatial resolution of approximately 172 nm per pixel on the material surface. Prior to integration into the CNN training, the LOMs were subjected to min-max normalisation to the 16-bit range [0, 65535], followed by scaling to [0, 1]. The single-channel images were replicated across three channels to form pseudo-RGB inputs. Subsequently, normalisation via the ImageNet channel-wise mean and standard deviation was applied. Manual annotation was performed by a single expert annotator to ensure labelling consistency, generating high-resolution (4104 px × 2174 px) label-masks (Figure 2b) for the original LOMs of identical resolution (Figure 2a) by assigning pixel areas to the three predominant phases: polygonal ferrite (grey), pearlite (pink), and Widmanstätten ferrite (green). As the distinction between F and WF is not always clearly evident, only regions that could be identified with high confidence as WF were assigned accordingly, while all other regions were conservatively labelled as F.
Figure 2.
Manual annotation of the LOMs: (a) LOM (≈708 μm × 375 μm) as within the dataset; (b) annotated label-mask representing pearlite (pink), ferrite (grey), and Widmanstätten ferrite (green). The LOM and corresponding label-mask are shown as transferred to the models; hence, no scales are included.
2.2. Evaluated UNet Backbones
To provide an overview of the employed segmentation framework, the general UNet-based architecture used in this study is illustrated schematically in Figure 3. In this work, five UNet variants, varying in encoder depth and architectural complexity, were implemented to evaluate segmentation performance. Each configuration employs a different CNN backbone in the encoder path, enabling a systematic investigation of the influence of feature extraction capability on the delineation of the three microstructural phases (F, P, and WF). An overview of the structural characteristics of these encoders, including their number of layers, parameter count, and primary building blocks, is provided in Table 2.
Figure 3.
Schematic illustration of a UNet-based CNN architecture for semantic segmentation of microstructural LOMs (input). The resulting segmentation mask (output) highlights polygonal ferrite (grey), pearlite (pink), and Widmanstätten ferrite (green).
Table 2.
Structural complexity of the encoder architectures: Comparison of depth (number of layers), approximate learnable parameter count, and the primary building block.
2.2.1. Residual Network 152-Layer (ResNet-152)
ResNet-152, originally proposed by He et al. [19], is structured as a deep residual network consisting of 152 layers, organised into four distinct stages of residual blocks. Each block employs a bottleneck design with three convolutional layers: two convolutions to manage dimensionality and one convolution for spatial feature extraction. The fundamental architectural element is the identity shortcut connection, which performs an element-wise addition of the input to the output of the residual function. This bypass mechanism allows the gradient to flow through the network via the shortcut connections, effectively preventing the degradation of Accuracy in very deep architectures.
2.2.2. Xception
Xception, introduced by Chollet [20], is based on a rigorous interpretation of the Inception module, comprising a total of 126 layers. The architecture replaces standard Inception modules with depthwise separable convolutions across 36 convolutional stages, structured into an entry, middle, and exit flow. Within these stages, the operation is decoupled into a depthwise convolution, applying a single filter per input channel, followed by a pointwise convolution. These stages are interconnected by residual skip connections, establishing a linear stack that processes spatial and cross-channel correlations independently.
2.2.3. Squeeze-and-Excitation Residual Network 50-Layer (SE-ResNet-50)
SE-ResNet-50 incorporates a 50-layer residual backbone augmented with squeeze-and-excitation (SE) modules as described by Hu et al. [21]. Positioned at the termination of each residual block, the SE-block adds a computational branch consisting of a global average pooling layer and a two-layer bottleneck multi-layer perceptron (MLP). The mechanism performs a squeeze operation to aggregate global spatial information and an excitation operation using a sigmoid activation to produce per-channel weights, which adaptively recalibrate the feature maps via element-wise multiplication.
2.2.4. DenseNet-169
The DenseNet-169 architecture, proposed by Huang et al. [22], is organised into four dense blocks containing a total of 169 layers. Within each dense block, every layer is connected to every other layer in a feed-forward fashion, such that the lth layer receives the feature maps of all preceding layers as input. Unlike residual networks, these inputs are concatenated, which facilitates maximum feature reuse and ensures continuous information flow throughout the block. Transition layers between these blocks, consisting of convolutions and average pooling, are utilised to reduce spatial dimensions and channel counts.
2.2.5. EfficientNet-B5
EfficientNet-B5, developed by Tan and Le [23], is the deepest architecture in this study, consisting of 489 layers constructed on the basis of mobile inverted bottleneck convolutions (MBConv blocks). The architecture is defined by a compound scaling method that balances depth, width, and resolution. The MBConv blocks use inverted residuals with linear bottlenecks and depthwise separable convolutions, augmented by integrated squeeze-and-excitation modules. This depth allows for a significantly higher feature resolution compared to smaller variants, while maintaining computational efficiency.
All evaluated CNN encoders were assessed in the comprehensive benchmark study by Stuckner et al. [13], who examined performance variations based on pretraining on the ImageNet and MicroNet datasets. In their comparison, these specific backbones demonstrated exceptional segmentation efficacy, justifying their selection for the current investigation.
2.3. Performance Metrics
The performance metrics for pixel-wise classification were calculated using the standard indicators for binary classification: True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN), all of which were derived from the validation of each respective model. Balanced Accuracy (Equation (1)) was employed to account for the inherent class imbalance arising from the unequal proportions of the microstructural phases within the LOMs. This metric facilitates a normalised assessment of the classification performance, ensuring that the results are not disproportionately biased towards the dominant phase. The Dice (Equation (2)) serves as a primary overlap-based metric for evaluating semantic segmentation performance. It quantifies the similarity between predicted segmentation masks and ground truth label masks as a harmonic measure of spatial overlap and is particularly suited to scenarios involving class imbalance. By jointly considering FP and FN predictions, the Dice provides a balanced assessment of segmentation quality. In addition, the Intersection over Union (IoU, Equation (3)) is employed as a complementary and more conservative metric for segmentation reliability. While closely related to Dice, IoU explicitly measures the ratio between the intersection and the union of predicted and reference regions, thereby enabling a more rigorous evaluation of spatial agreement. This makes IoU particularly sensitive to over-segmentation effects, as it penalises FP detections more strongly in relation to the total predicted area. All previously described metrics yield values between 0 and 1, or equivalent percentages, where higher values indicate superior model performance. The mean absolute error (MAE, Equation (4)) was employed to quantify the deviation in phase fractions for F, P, and WF, which were derived from the semantic segmentation masks. In contrast to purely regression-based CNNs, which estimate global phase fractions without spatial attribution, this approach preserves the spatial localisation of each phase and thus enhances interpretability. Calculated as the absolute differences between predicted () and manually annotated (y) masks (ground-truth), the MAE represents the absolute phase fraction error. Lower values therefore indicate superior predictive performance and closer alignment with the manual annotations. Each metric was calculated independently for every microstructural phase (F, P, and WF) using a one-vs.-rest scheme to ensure a detailed assessment of the pixel-wise classification performance across all constituents. The metrics were computed for both patch-level model outputs and predictions on full-scale LOMs following inference, thus encompassing both training-aligned evaluation and application-relevant behaviour. Since all values were derived exclusively during the validation phase, they reflect performance on unseen data. To enable quantitative comparison of performance differences between models, a paired Wilcoxon signed-rank test [24] was performed across cross-validation folds to assess statistical significance. This non-parametric test examines whether the paired differences between two models are symmetrically distributed around zero and does not rely on the assumption of normality.
2.4. Computational Setup
The training of the CNN backbones was conducted in three variants employing distinct pretraining strategies, as outlined in Table 3. For variant A, the models were initialised with ImageNet weights. Variant B employs the MicroNet weights made publicly available by Stuckner et al. [13,25], while variant C uses a combined approach (ImageNet + MicroNet initialisation), also released by the same authors.
Table 3.
Pretraining strategies applied to each CNN architecture.
The training regime employed stratified group k-fold cross-validation (CV, k = 5), with stratification based on the WF class distribution and grouping performed at the WBBT sample level to prevent data leakage between folds. This ensured that all LOMs from a given sample were assigned either to the training or validation set while approximately preserving the WF class distribution across folds, resulting in 16 LOMs (and corresponding masks) for training and 4 for validation per fold. Each fold was trained for 50 epochs. Given that CNNs typically require square input images and considering the graphics processing unit (GPU) memory constraints associated with high-resolution micrographs, a patch-wise processing approach was implemented. The patch size of 512 px × 512 px (88.3 μm × 88.3 μm) was selected to ensure that the elongated morphology and high aspect ratio of WF needles are adequately captured, whilst preserving sufficient surrounding microstructural context. The implementation of larger patch sizes was unfeasible due to GPU memory constraints during training. To mitigate information loss at the patch boundaries, a sliding window strategy with a 128 px overlap was employed, ensuring both feature continuity and efficient GPU memory utilisation while simultaneously expanding the dataset through the generation of shifted sub-images. This partitioning process and the implemented patch overlap are visualised in Figure 4.
Figure 4.
Sliding window: patch size 512 px × 512 px (88.3 μm × 88.3 μm); overlap in between the patches is 128 px (22.1 μm). The LOM (≈708 μm × 375 μm) is shown as transferred to the models; hence, no scale is included.
To increase orientation invariance and improve robustness against imaging variability, online data augmentation was applied to the training set in each CV fold, including geometric transformations such as horizontal and vertical flips and rotations up to 90°. In addition, photometric and noise-based augmentations were applied, including global brightness (±20%) and contrast (±20%) adjustments, Gaussian blur (kernel size 3–7 px) and median blur (kernel size up to 5 px), additive Gaussian noise (std. dev. 0 to 10%), local contrast enhancement using CLAHE (clip limit 3.0, tile size 8 px × 8 px), and sharpening ( = 0.1–0.3, lightness factor 0.9–1.1). All augmentation parameters were chosen conservatively to reflect realistic imaging variability in LOMs, such as minor illumination fluctuations, surface reflection changes, and acquisition-related noise observed in the dataset. This was verified by visual inspection of augmented patch samples during model development to ensure that no artificial microstructural features were introduced and that the characteristic morphology of WF was not altered. Validation data remained unaugmented to assess model performance on original LOMs. Each fold contained 1056 training patches, with a distinct random augmentation applied per patch at each epoch, yielding 52,800 effective training presentations over 50 epochs. All models were trained with a batch size of 2 and a learning rate of , with gradients accumulated over four steps to simulate a larger effective batch size, as it was limited by GPU memory constraints. To enhance computational efficiency and minimise memory overhead, mixed precision training with automatic loss scaling was implemented. In addition, gradient checkpointing was applied in the encoder to reduce GPU memory consumption during backpropagation by recomputing intermediate activations on demand rather than storing them. The AdamW optimiser [26] was employed for training, featuring a weight decay of to regulate parameter updates. A combined loss function was adopted to address both pixel-wise classification Accuracy and the pronounced class imbalance inherent in the in-distribution dataset (F ≈ 60%, P ≈ 34%, WF ≈ 7%), combining weighted categorical cross-entropy with a Dice loss term. The cross-entropy component ensures stable pixel-wise optimisation, while the Dice term improves agreement between predicted segmentation masks and ground-truth label-masks by optimising region overlap rather than raw pixel counts, which is particularly beneficial for the minority class WF. Class weighting was applied exclusively to the cross-entropy term to further compensate for the class imbalance. The class weights were computed individually for each CV fold based on the pixel-wise class distribution of the corresponding training split using inverse frequency weighting (Equation (5)). Here, N denotes the total number of training pixels, C the number of classes, and the number of pixels belonging to class c. The resulting weights were subsequently normalised such that their sum equals the number of classes. As a result, no fixed class weights were used across folds.
The Dice loss was derived from the Dice score (Equation (2)), computed independently for each class and batch sample using predicted softmax probabilities and one-hot encoded ground-truth labels. It is defined as the mean deviation from perfect overlap, averaged over all classes (C) and batch samples (B):
where denotes the Dice score for class c in batch sample b. The total loss function was defined as
where denotes the weighted categorical cross-entropy loss. The weighting factor was set to , resulting in equal contributions from both loss terms. For inference, patches were extracted using a sliding window approach with a stride of 384 px. To ensure full coverage of the LOM, reflect padding was applied at the image boundaries, yielding 264 inference tiles per validation fold. Overlapping predictions were aggregated by pixel-wise averaging of logits, followed by a final argmax to obtain the segmentation mask. No additional probability thresholding was applied during inference. For OOD evaluation, each of the five fold-specific models from stratified group k-fold CV yielded an individual prediction by reconstructing full-resolution logits from patch-wise inference followed by a final argmax operation. To consolidate these predictions into an ensemble result, the logits of all five models were averaged pixel-wise across folds, with a subsequent argmax applied to the mean logit map (majority voting). The training on high-resolution microscopy images was facilitated by distributed data parallel (DDP), allowing for concurrent computation on a multi-GPU cluster equipped with NVIDIA V100-SXM2-16GB, NVIDIA V100-SXM2-32GB, and NVIDIA A100-SXM4-80GB GPUs. As the higher-memory GPUs were not continuously available, model training was designed to operate within the memory constraints of the 16 GB GPUs. All experiments were implemented in Python 3.12.3 with PyTorch [27] (2.7.1), supported by NumPy (2.4.1), pandas (2.3.3), scikit-learn (1.8.0), tifffile (2026.1.14), torchvision (0.22.1), pretrained-microscopy-models (0.1.0) [25], and segmentation_models_pytorch (0.2.1) [28].
3. Results and Discussion
3.1. Phase-Specific Segmentation Performance
The segmentation efficacy of each model variant is evaluated via the comparative analysis of Balanced Accuracy, Dice, IoU, and MAE. These metrics are distinguished for the specific phases (F, P, and WF) that are present within the microstructural images under consideration. The evaluation is performed both on the direct model output at patch level (Section 3.1.1) and on full-scale LOMs following inference (Section 3.1.2). Table A1 summarises the results illustrated in Figure 5 and Figure 6.
3.1.1. Patch-Level Performance
Figure 5 indicates that across all architectures, F and P are consistently classified with reliable performance at the patch level, exhibiting high Balanced Accuracy, Dice, and IoU, alongside low MAE in most cases, particularly in relation to the increased phase fractions within the LOMs. F is recognised with remarkable stability across most models and pretraining strategies. The best results are achieved by EfficientNet-B5 pretrained under variant A (“EfficientNetB5-A”), which attains superior Balanced Accuracy (94.13% ± 1.24%), Dice (93.57% ± 2.27%), and IoU (89.40% ± 2.75%), combined with the 2nd lowest MAE (3.28% ± 0.76%). All variants of Xception and variants A and B of SE-ResNet-50 attain comparable levels of Balanced Accuracy (93.73–93.85% and 93.75–93.88%), signifying minimal sensitivity to the selected pretraining strategy. DenseNet-169-C is the only model exhibiting slightly diminished performance for this metric (91.02% ± 2.29%) combined with the highest overall MAE (5.86% ± 2.06%), which indicates a reduction in robustness under MicroNet-involving pretraining in comparison to pure ImageNet initialisation. The classification of P has been found to demonstrate even greater levels of stability and reliability. The highest Balanced Accuracy is observed for SE-ResNet-50-A (96.59% ± 0.49%), while DenseNet-169-A provides the most precise segmentation (Dice = 95.23% ± 0.60%, IoU = 91.15% ± 1.10%). Inter-variant differences remain moderate, implying that pearlitic morphology is captured consistently regardless of the model initialisation. This is likely attributable to the pronounced contrast between the dark pearlite and the two bright ferritic microstructural constituents. The high level of segmentation efficacy observed for F and P does not extend to WF, which is characterised not only by comparatively modest phase fraction within the LOMs but also by tonal similarity to F and locally ambiguous morphologies, rendering it the most challenging microstructural constituent for segmentation. In this context, the conservative annotation of WF may particularly affect boundary cases and thus influence overlap-based metrics (i.e., Dice and IoU). Whilst the weighted Balanced Accuracies achieve competitive levels, most notably with ResNet-152-A (84.04% ± 1.93%), the Dice and IoU values remain substantially lower than for F and P (maximum 50.75% ± 3.38% and 38.45% ± 3.01% for DenseNet-169-A). This pronounced disparity between classification Accuracy and spatial overlap underscores the inherent difficulty in delineating WF and in its differentiation from F. The inferior performance of deep architectures with a high degree of feature reuse under MicroNet-involving pretraining suggests a consistent trend, although it is not statistically significant under a paired Wilcoxon signed-rank test: ResNet-152 (A → B: Dice = 49.37% → 46.35%, W = 3, p = 0.3125; MAE = 4.30% → 5.09%, W = 3, p = 0.3125), DenseNet-169 (A → C: Dice = 50.75% → 40.81%, W = 0, p = 0.0625; MAE = 3.90% → 6.55%, W = 1, p = 0.125), and EfficientNet-B5 (A → B: Dice = 50.07% → 45.84%, W = 0, p = 0.0625; MAE = 3.54% → 5.11%, W = 0, p = 0.0625) all demonstrate decreased performance for WF segmentation. In contrast, the shallower architectures Xception and SE-ResNet-50 maintain consistently robust and balanced segmentation across all variants, showing minimal sensitivity to the pretraining strategy. For segmentation of WF at patch level, ImageNet pretraining generally provides the most robust performance across architectures, particularly with respect to Dice and IoU, reinforcing its role as a strong baseline initialisation. Among all configurations, DenseNet-169-A achieves the best overall performance for WF. However, Xception-A yields nearly comparable results (Dice = 50.47% ± 2.13%; IoU = 38.28% ± 1.91%), which is supported by paired Wilcoxon signed-rank tests showing no statistically significant differences in Dice (W = 5, p = 0.625) and IoU (W = 5, p = 0.625), while indicating a non-significant tendency towards lower MAE for Xception-A (3.26% ± 0.59% vs. 3.90% ± 1.02%; W = 0, p = 0.0625). Due to the small number of CV folds (), the paired Wilcoxon signed-rank test used in this study is resolution-limited, with a minimum achievable two-sided p-value of 0.0625. Consequently, statistical significance at is not attainable within this experimental setting. Accordingly, statistical comparisons are primarily interpreted in terms of effect direction and magnitude rather than formal hypothesis testing.
Figure 5.
Evaluation of segmentation performance via 5-fold CV on LOM patches. Bars represent mean values, while whiskers indicate standard deviations across folds for (a) Balanced Accuracy, (b) Dice, (c) IoU, and (d) MAE. P achieves the best overall segmentation performance, characterised by high Balanced Accuracy, Dice, and IoU, alongside low MAE and low standard deviations across models. Segmentation performance for F is slightly lower but remains consistently strong. WF constitutes the most challenging phase for the models, as reflected by moderate Balanced Accuracy, Dice, and IoU, as well as increased MAE values.
3.1.2. LOM-Level Performance
At LOM level, inference-based aggregation leads to an enhancement of segmentation performance, particularly for F and WF, while P remains largely stable across all architectures (Figure 6). For F, this results in a slight improvement, raising its performance to a level comparable to P. Building on this, the best-performing configuration for F is Xception-A, which achieves a Balanced Accuracy of 94.90% ± 0.39%, a Dice of 95.67% ± 0.80%, and an IoU of 91.74% ± 1.42%. In comparison, P remains consistently stable, with DenseNet-169-A reaching a Balanced Accuracy of 96.38% ± 0.59%, a Dice of 95.46% ± 0.55%, and an IoU of 91.33% ± 1.00%, indicating that inference has a limited impact on this already well-separated microstructural class. A more pronounced effect of inference is observed for WF, where aggregation substantially improves segmentation quality compared to patch-level predictions. DenseNet-169-A achieves a Balanced Accuracy of 89.36% ± 1.61%, while Xception-A reaches a Dice of 68.74% ± 1.12% and an IoU of 52.52% ± 1.28%, representing a gain in spatial overlap and class consistency. This improvement suggests that LOM-level inference effectively mitigates local ambiguities arising from the strong visual similarity between WF and F at patch level. In particular, the overlap introduced during sliding-window inference increases the contextual information available to each prediction while reducing the influence of isolated patch-level artefacts and local texture ambiguity. However, a contrary trend emerges with respect to MAE. Despite the improvements in Balanced Accuracy, Dice, and IoU, MAE increases after inference across all phases. The best post-inference MAE values for F and WF are achieved by Xception-A (F: 4.95% ± 0.33%; WF: 4.55% ± 0.80%), while DenseNet-169-A yields the best performance for P (3.06% ± 0.60%). This divergence indicates that while inference improves overlap-based and class-balanced measures, it introduces a slightly higher pixel-wise deviation in the predicted phase distributions. This effect can partly be attributed to a tendency towards WF over-segmentation at phase boundaries due to locally ambiguous ferritic WF-like textures. The aggregation mechanism at LOM level further contributes to this behaviour by improving spatial consistency through averaging of overlapping predictions. While this benefits overlap-based metrics such as Dice and IoU, it may also amplify boundary uncertainty and dilute fine-grained pixel-level corrections, leading to increased absolute error. Importantly, the resulting overestimation of phase fractions primarily affects MAE through increased predicted phase fractions. In the context of WF detection, this error mode is less critical than under-segmentation, which corresponds to overlooked WF needles and consequently underestimated WF phase fractions. Furthermore, class imbalance effects become more pronounced at LOM level, as small systematic shifts in phase proportions are penalised more strongly by MAE than by overlap-based metrics. The influence of pretraining strategy persists at LOM level despite inference-based aggregation, with ImageNet initialisation remaining advantageous across architectures and metrics. This indicates that the relative performance differences between architectures remain stable across inference scales without being fundamentally altered by spatial fusion. This consistent trend favouring ImageNet initialisation contrasts with prior work by Stuckner et al. [13], who reported substantial benefits of MicroNet pretraining under low-data conditions. As MicroNet predominantly consists of scanning electron microscopy (SEM) and transmission electron microscopy (TEM) images of nickel-based superalloys and environmental barrier coatings (EBCs), the transition to etched LOMs of steel microstructures, including Widmanstätten ferrite, constitutes a substantial domain gap. Potentially, MicroNet contains only limited representations of steel-specific morphologies such as WF, which may further constrain feature transfer across imaging domains. At the same time, SEM/TEM images and etched LOMs differ fundamentally in their contrasting mechanisms, resulting in distinct texture statistics and intensity distributions. These differences likely further reduce the transferability of MicroNet-learned feature representations to the current setting. In addition, dataset scale may contribute to the observed behaviour, as MicroNet comprises approximately 110,000 images compared to 1.28 M images in ImageNet. Despite its close relation to microstructural imaging, the smaller dataset size may limit the robustness and diversity of learned low-level feature representations, whereas large-scale pretraining on ImageNet may provide more generalisable features that also transfer effectively to metallographic imagery. Beyond the observed pretraining effects, these findings suggest that inference improves structural coherence and class separability at the cost of slightly reduced pixel-wise quantitative agreement, highlighting a trade-off between spatial consistency and exact numerical correspondence. While F and P are classified with a high degree of reliability by all networks, WF remains distinctly more challenging, with segmentation metrics revealing the clearest architectural differences. Consequently, the subsequent analysis is primarily focused on the segmentation capability of the models with respect to the WF phase.
Figure 6.
Evaluation of segmentation performance via 5-fold CV on full-scale LOMs following inference. Bars represent mean values, while whiskers indicate standard deviations across folds for (a) Balanced Accuracy, (b) Dice, (c) IoU, and (d) MAE. With the exception of MAE, inference improves segmentation performance for F and WF across models. For F, performance levels close to those of P are achieved, which shows no substantial changes due to inference. WF remains the most challenging phase for segmentation.
3.2. Learning Dynamics for Critical Feature Detection: Widmanstätten Ferrite
As illustrated in Figure 7, the learning dynamics of the three variants (A/B/C) for the evaluated architectures are analysed with regard to their ability to detect WF at patch level. Therefore, the loss is depicted as a function of the 50 training epochs, where the solid line represents the mean value of the 5-fold CV, whilst shaded regions indicate the inter-fold standard deviation. The subsequent metrics are based on the same methodology: Balanced Accuracy, Dice, IoU, and MAE. All models exhibit varied responses depending on the pretraining strategy. For Xception, the loss curve is characterised by a distinct convergence behaviour, reaching a lower loss level than all other models (Figure 7f), while the remaining architectures exhibit nearly identical loss trajectories across pretraining strategies characterised by an initial convergence from the 6th epoch onwards (Figure 7a,k,p,u). Conversely, the deep networks DenseNet-169 and EfficientNet-B5 display substantial variations and inconsistencies across folds in the performance metrics, depending on the pretraining strategy employed, whereas the shallower CNN architectures Xception and SE-ResNet-50 show more consistent learning behaviour, with minimal disparities demonstrated amongst the strategies (Figure 7g–j,l–o). In contrast, the integration of MicroNet pretraining into DenseNet-169 has a detrimental effect on all metrics, with variant A achieving systematic superiority over B and C (Figure 7q–t).
Figure 7.
Progress of loss, Balanced Accuracy, Dice, IoU, and MAE for patch-level segmentation of WF over 50 epochs and 5-fold CV. Lines indicate mean values and shaded areas illustrate standard deviations in between folds. (a–e) ResNet-152; (f–j) Xception; (k–o) SE-ResNet-50; (p–t) DenseNet-169; (u–y) EfficientNet-B5.
For EfficientNet-B5, variant C attains enhanced outcomes in comparison to the pure MicroNet variant (B), yet it exhibits marginal inferiority to the native ImageNet pretraining (A) with respect to Balanced Accuracy, Dice, IoU, and MAE (Figure 7v–y). Although the loss converged from approximately the 6th epoch onwards, the observed trajectories suggest that overlap-based metrics (Dice, IoU) could potentially benefit from additional training epochs beyond the 50-epoch regime for ResNet-152, SE-ResNet-50, DenseNet-169, and to a lesser extent, EfficientNet-B5 (Figure 7c,d,m,n,r,s,w,x). This effect is not observed for Xception, where despite a non-converged loss at epoch 50, performance remains largely stable, and Balanced Accuracy even shows a declining trend from approximately the 15th epoch onwards (Figure 7g–i). The extant empirical evidence suggests that the observed differences in performance between pretraining strategies are fundamentally linked to the specific structural paradigms of the CNN architectures. It can be assumed that the pronounced volatility demonstrated by DenseNet-169 and EfficientNet-B5, as well as the moderate sensitivity of ResNet-152, may stem from their depth and high degree of feature reuse. In the case of ResNet-152, the deeper residual layers might be specifically optimised for the feature hierarchies established during pure ImageNet initialisation (A), whereas alternative strategies may lack the capacity of providing sufficiently improved optimisation stability for such a deep architecture. In a similar manner, the adverse effect of MicroNet pretraining on DenseNet-169 could be ascribed to a cumulative “noise propagation” effect, as each layer is densely connected to all subsequent layers, resulting in the amplification of any suboptimal initial weights throughout the network’s processing path. For EfficientNet-B5, it is supposed that the combination of ImageNet and MicroNet pretraining under variant C provides complementary feature representations. However, this integration marginally disrupts the optimally tuned MBConv and SE-block hierarchies acquired from pure ImageNet pretraining, yielding performance that exceeds that of MicroNet alone but remains inferior to the ImageNet strategy. In contrast, the more consistent behaviour exhibited by Xception and SE-ResNet-50 signifies a higher level of architectural resilience. The pronounced stability of Xception may be attributed to its use of depthwise separable convolutions, which decouple spatial and channel-wise feature extraction. This architectural separation reduces inter-layer dependency and limits the propagation of suboptimal feature representations introduced by non-native pretraining strategies, thereby enhancing robustness across different initialisation regimes. Conversely, the stability of SE-ResNet-50 can be attributed to its internal SE blocks, which introduce a channel-wise recalibration mechanism. Rather than decoupling feature extraction as in Xception, these modules adaptively reweight feature channels based on their relative importance. This enables the network to dynamically emphasise task-relevant representations while suppressing less informative responses, thereby improving resilience to variations induced by different pretraining strategies.
As illustrated in Figure 8, the visual evolution of segmentation results is shown for Xception-A as a representative example, covering both patch-level and LOM-level predictions. The comparison between early segmentations at epoch 1 (Figure 8a–d) and the final output at epoch 50 (Figure 8e–h) demonstrates a substantial improvement over the course of training. At epoch 1, WF is already correctly identified and broadly localised at both patch and LOM level. However, numerous surrounding regions and morphologically similar grains are erroneously classified as WF, indicating limited discriminative capability at this early stage despite correct global phase identification. In contrast, epoch 50 exhibits a more refined representation of the needle-like WF morphology, with reduced FP segmentations in neighbouring regions and a clearer separation from microstructural constituents with visual similarities. This indicates that the model progressively learns to better discriminate fine-grained morphological features, leading to improved structural consistency across both patch- and LOM-level predictions.
Figure 8.
Epoch-wise improvement of segmentation performance for WF using Xception-A. Epoch 1: (a) patch overlay, (b) patch segmentation mask, (c) LOM overlay, and (d) LOM segmentation mask; epoch 50: (e) patch overlay, (f) patch segmentation mask, (g) LOM overlay, and (h) LOM segmentation mask. Patch overlays and segmentation masks are 512 px × 512 px (≈88.3 μm × 88.3 μm); LOM overlays and segmentation masks are 4104 px × 2174 px (≈708 μm × 375 μm) and are illustrated as model outputs; hence, no scales are included.
3.3. Inter-Class Misclassification and Segmentation Reliability
To provide further insight into specific patterns of misclassification, the confusion matrices (CMs) of all model variants are illustrated at both patch (Figure 9) and LOM level (Figure 10). This analysis enables the investigation of the influence of the pretraining strategy on misclassification behaviour.
3.3.1. Patch-Level Confusion Matrices
The evaluation of the normalised CMs on patch-level consistently indicates that WF is most frequently misclassified as F, constituting the principal source of error across architectures and most likely arising from the shared tonal characteristics of these two phases. Xception demonstrated a notable sensitivity to this ambiguity, exhibiting elevated misclassification rates across all variants, with values ranging from 27.5% in variant A to 29.8% in variant B (Figure 9b,g,l). While ResNet-152, Xception, and SE-ResNet-50 display increased misclassification rates for WF under MicroNet-involving pretraining, DenseNet-169-B (Figure 9d,i) and EfficientNet-B5-C (Figure 9e,o) show slightly improved TP-rates compared to their ImageNet-pretrained variants (DenseNet-169: A → B: 70.8% → 71.3%; EfficientNet-B5: A → C: 66.9% → 71.6%). ResNet-152-A demonstrates the highest degree of discriminative robustness, achieving a peak TP-rate of 73.3% for the WF class (Figure 9a).
Figure 9.
Patch-level normalised CMs for ResNet-152, Xception, SE-ResNet-50, DenseNet-169, and EfficientNet-B5. Panels (a–e) display variant A; (f–j) variant B; (k–o) variant C. The principal source of error is WF being confused with F due to shared tonal characteristics.
3.3.2. LOM-Level Confusion Matrices
As outlined in Section 3.1.2, the performance for F, as indicated in this context by the TP-rate, improves through inference-based aggregation, reaching a reliability comparable to P. For instance, Xception-A increases from 93.1% at patch level (Figure 9b) to 95.4% at LOM level (Figure 10b). A similar improvement is observed for WF across all architectures, indicating a general gain in class consistency induced by LOM-level aggregation. In contrast, P exhibits no notable changes compared to the patch-level results. Even after inference, WF remains the most challenging phase, consistently exhibiting the highest misclassification rates, which are primarily driven by confusion with F. With respect to pretraining strategies, model-dependent effects become apparent. DenseNet-169 shows a decline in WF classification performance from variant A to C, with the WF TP-rate decreasing from 81.7% to 77.3%, suggesting increased sensitivity to MicroNet-involving pretraining (Figure 10d,i,n). In contrast, Figure 10e,j,o indicates that EfficientNet-B5 benefits from MicroNet-involving pretraining for WF recognition, with TP-rates increasing from 79.5% (A) to 82.2% (B) and 82.5% (C), while F-class performance slightly decreases (A: 94.3% → B: 91.6% → C: 91.9%). EfficientNet-B5-C achieves the highest WF TP-rate, whereas Xception-C exhibits the lowest performance for this class (74.3%, Figure 10l,o).
Figure 10.
LOM-level normalised CMs for ResNet-152, Xception, SE-ResNet-50, DenseNet-169, and EfficientNet-B5. Panels (a–e) display variant A; (f–j) variant B; (k–o) variant C. Inference improves the TP-rate for F to near P-level performance, while P remains largely unaffected. WF also shows enhanced performance after inference, yet remains the principal source of misclassification, predominantly due to confusion with F.
3.4. Qualitative Analysis of Systematic Segmentation Errors
The qualitative segmentation analysis in Figure 11, based on predictions from Xception-A after the 50th epoch, provides further insight into systematic segmentation errors of the proposed framework, particularly with respect to the interaction between microstructural morphology, local etching contrast, and the constraints of patch-wise inference. The presented examples demonstrate that residual errors are not only driven by class ambiguity but also by structural continuity and scale-dependent limitations of the prediction process. In Figure 11a,d, insufficient etching contrast within the pearlitic region leads to incomplete or spatially inconsistent segmentation of WF, where this phase is detected but not accurately delineated in the overlay. This indicates that low local contrast can impair boundary refinement even when the presence of the phase is correctly inferred. Figure 11b,e further highlight a morphology-driven limitation, where a WF needle extending beyond a pearlitic region induces uncertainty regarding its continuation, as the characteristic needle-like morphology becomes less pronounced outside the locally well-defined WF area, resulting in partially fragmented predictions. A patch size-related effect is observed in Figure 11c,f,g, where fine WF needles are accurately segmented, correctly capturing their characteristic morphology. However, for an elongated WF needle, the limited patch size prevents the preservation of long-range spatial continuity, resulting in interrupted segmentations of the structure (Figure 11f, ellipse I). This occurs despite the use of overlapping patches during inference. Although the models reliably detect the presence and local shape of WF, inference restricts the reconstruction of continuous structures across larger spatial extents given the patch size used in this study. Conversely to the aforementioned fragmentation effects, a tendency towards WF over-segmentation is observed at phase boundaries, where ferritic regions with similar local morphology are occasionally assigned to WF due to locally ambiguous features (Figure 11c,f, ellipses II and III). Since large needles and the associated fragmented segmentations are less frequent than over-segmentation effects, an overestimation of the predicted WF area fraction is identified, which primarily affects pixel-wise error measures such as MAE rather than overlap-based metrics. Importantly, these qualitative observations also contextualise the reported quantitative performance for WF segmentation. Despite correct identification of WF morphology, individual needles are often small and occupy only a reduced number of pixels. Consequently, segmentation errors such as incomplete continuation of needles into neighbouring regions (Figure 11b,e) or fragmented segmentation of large elongated structures (Figure 11c,f,g) have a disproportionate impact on overlap-based metrics such as Dice and IoU and consequently also influence the MAE. This effect arises from the limited spatial extent of individual, small WF needles, where correct predictions contribute only marginally to overall metric values compared to larger structures spanning multiple patches. As a result, comparatively lower performance is reported for WF, even though the models reliably capture its characteristic morphology at a visual level. These cases demonstrate that remaining segmentation errors are strongly linked to the interplay between microstructural complexity and the finite spatial context of patch-based inference, rather than a fundamental inability to recognise the WF phase.
Figure 11.
Segmentation error analysis for Xception-A after 50th epoch: (a) patch with insufficient etching contrast in P → (d) WF is detected, but boundaries are not properly segmented in the overlay; (b) patch showing a WF needle extending beyond P, where the morphology outside the pearlitic region is no longer clearly WF-like → (e) fragmented segmentation of the needle beyond the pearlitic region due to model uncertainty; (g) full LOM and corresponding patch (c) with a long WF needle → (f) ellipse I: WF structure is correctly identified, but the limited patch size prevents the model from capturing the full spatial extent of the elongated morphology, resulting in an incomplete reconstruction of the needle; ellipses II and III: slight WF over-segmentation at phase boundaries, caused by local textural similarity between ferritic regions and WF-like patterns. LOM is 4104 px × 2174 px (≈708 μm × 375 μm); patches and overlays are 512 px × 512 px (≈88.3 μm × 88.3 μm) and are illustrated as model inputs and outputs; hence, no scales are included. Red ellipses highlight the described regions of interest.
3.5. Out-of-Distribution Generalisation Analysis
To assess the generalisation capability of Xception, which was previously identified as best-performing model at LOM level, an OOD test was performed using an LOM (Figure 12a) derived from an unseen WBBT sample. As illustrated in Figure 12c,d, the OOD predictions of Xception-B, obtained via majority-voting, show good overall agreement with the ground-truth annotations (Figure 12b). The segmentation successfully captures the main microstructural constituents and reproduces the overall morphology of the labelled regions. Nevertheless, typical segmentation errors previously discussed in Section 3.4 remain visible, particularly slight over-segmentation of WF regions and incomplete segmentation of elongated needle-like structures caused by the limited patch size.
Figure 12.
Visual results of the out-of-distribution test for Xception-B based on majority voting across the five models obtained from the CV folds: (a) ground-truth LOM; (b) ground-truth label mask; (c) model prediction overlay; and (d) model prediction segmentation mask, showing good overall agreement between ground truth and prediction despite typical errors such as slight WF over-segmentation and incomplete segmentation of elongated needles due to insufficient patch size, as previously discussed in Section 3.4. LOM, masks, and overlay are 4104 px × 2174 px (≈708 μm × 375 μm) and are illustrated as model inputs and outputs; hence, no scales are included.
The quantitative OOD results are illustrated in Figure 13 and summarised in Table A2. At patch level, the best overall performance was achieved by the MicroNet-pretrained variants (B and C). Compared to the corresponding scores obtained during the 5-fold CV, WF segmentation performance decreased in terms of Dice and IoU. The best WF patch-level metrics were obtained by Xception-B, reaching a Dice of 43.82% ± 2.19% and an IoU of 32.67% ± 2.05%. In contrast, the MAE for WF improved, with variant B achieving the lowest error of 1.56% ± 0.47%, although this apparent reduction should be interpreted with caution since the WF phase fraction in the OOD LOM is only 2.13%, compared to a mean of 6.51% across the in-distribution LOMs. Following inference, LOM-level metrics indicate substantial enhancements for the WF-related values, whereas the metrics for F and P changed only marginally and were mostly not significantly improved. For WF, the highest Balanced Accuracy was achieved by variant A with 92.22% ± 0.98%. However, the MicroNet-pretrained variant B yielded the best overlap-based metrics, reaching a Dice of 67.64% ± 3.78%, compared to variants A (65.56% ± 3.26%) and C (65.34% ± 2.29%), indicating a consistent but non-significant advantage according to paired Wilcoxon signed-rank tests (B vs. A: W = 5, p = 0.625; B vs. C: W = 3, p = 0.3125). A similar trend was observed for IoU, where variant B achieved 51.23% ± 4.28%, compared to 48.85% ± 3.56% for A and 48.56% ± 2.48% for C, again without statistically significant differences (B vs. A: W = 5, p = 0.625; B vs. C: W = 3, p = 0.3125). Likewise, the lowest MAE for WF was obtained by variant B with 1.17% ± 0.42%, followed by C (1.28% ± 0.22%) and A (1.36% ± 0.38%). Majority voting across the five individual fold models resulted in a further marked improvement of the WF metrics, with the best overall values continuing to be dominated by the MicroNet-pretrained models. The Balanced Accuracy for WF approached the level observed for F and P, reaching 93.02% for Xception-A. Moreover, variant B achieved the highest Dice for WF (73.60%) and the best IoU (58.23%), outperforming variants A (Dice = 71.65%; IoU = 55.82%) and C (Dice = 70.56%; IoU = 54.52%). The absolute errors (AE) for WF segmentation were also lower for the MicroNet-pretrained models, with values of 0.77% for B and 0.89% for C, compared to 0.93% for A. Although the stratified group k-fold CV indicated a tendency towards improved segmentation performance for the ImageNet-pretrained models, the OOD evaluation supports the findings of Stuckner et al. [13], demonstrating that MicroNet-pretraining facilitates more effective generalisation on OOD images. However, the effect observed in the present study is less pronounced than that reported by Stuckner et al., which may be attributed to differences in material systems (steel vs. nickel-based superalloys and EBCs) and imaging modalities (LOM vs. SEM/TEM).
Figure 13.
Quantitative results of the out-of-distribution test for the best-performing Xception comparing variants A, B, and C using five models, each obtained from one of the five CV folds, as individual predictors: (a) patch-level metrics and (b) LOM-level metrics following inference. Bars indicate mean values, with whiskers representing the standard deviation. For the LOM-level metrics, circles additionally denote the results obtained via majority voting across the five individual models, indicating clear improvements in MAE for F and in Dice, IoU, and MAE for WF.
3.6. Limitations and Outlook
Despite the promising capabilities for the detection and quantification of Widmanstätten ferrite in LOMs demonstrated by the proposed semantic segmentation approach, several methodological limitations restrict the broader applicability of the presented models. Firstly, the investigation was exclusively conducted on the structural steel grade S355J2. This deliberate restriction was chosen to minimise material-dependent influences and to ensure that the observed segmentation behaviour was primarily related to the targeted microstructural constituents rather than variations between different steel classes. Steels with chemical compositions or heat treatment conditions not covered by the present study may exhibit significantly different microstructural appearances following preparation and etching. Therefore, it cannot be assumed that the trained models are transferable to other steel grades without additional training data and validation studies. Future work should encompass a broader range of steel grades and processing conditions in order to evaluate the robustness of the proposed segmentation framework in different metallurgical circumstances. Another limiting factor is the comparatively small size of the dataset, which comprised only 20 LOMs originating from 11 WBBT samples (in-distribution). The overall diversity of the dataset remains constrained due to restricted variability in grain morphology, grain size, WF distribution, and phase fraction. This may affect the ability of the trained models to generalise to unseen microstructural conditions encountered in practical applications. Nevertheless, Stuckner et al. [13] demonstrated that semantic segmentation can maintain effective performance even with minimal training data, including one-shot scenarios based on a single training image. This suggests that in metallographic semantic segmentation, small datasets are not unusual due to inherent data sparsity, although performance remains strongly dependent on the specific dataset and task. In addition, all micrographs were acquired using a constant magnification setting. While this ensured a uniform spatial representation throughout the dataset, it limited the range of detectable features. Significantly finer or coarser grain structures, alongside the associated smaller or larger WF needle dimensions, may not be adequately resolved given the chosen imaging configuration. Furthermore, the chosen patch size, constrained by GPU memory limitations during training, reduced the contextual information available to the model as input and resulted in systematic missegmentations, particularly for long WF needles spanning multiple patches. Future investigations should therefore incorporate various magnification levels and larger patch sizes to enable the detection of a broader spectrum of microstructural features. Additionally, all LOM acquisitions were performed within a single laboratory environment using only one microscope system. Although this ensured highly consistent imaging conditions, it simultaneously reduced variability in acquisition-related parameters such as illumination, focus, etching intensity, and image noise. The trained models may therefore implicitly have adapted to laboratory- or device-specific imaging properties, potentially limiting their robustness when applied to data generated under different experimental conditions. Accordingly, future studies should extend the dataset toward multi-laboratory and multi-device scenarios to assess cross-domain generalisation. Another limitation pertains to the annotation process, as the semantic segmentation label masks were generated exclusively by a single expert. While this ensured procedural consistency during annotation, it introduces annotator-specific bias in the identification and delineation of WF, which is not unambiguously separable from surrounding ferritic regions in all cases. Since the performance of semantic segmentation strongly depends on the quality and subjectivity of the reference annotations, this imposes an inherent constraint on the interpretability of quantitative metrics. In particular, borderline regions that may be morphologically consistent with WF but were not labelled as such can lead to an underestimation of model performance. As a result, part of the observed prediction error may reflect annotation uncertainty rather than true model deficiencies. Future research should therefore incorporate annotations from multiple experts and systematically evaluate inter-annotator variability to establish more robust and representative ground truth data. The OOD evaluation is further limited by its reliance on a single LOM with differing WBBT sample origin, which was not represented in the in-distribution dataset. Consequently, the statistical validity and generalisability of the OOD results are inherently restricted, and the observed trends should therefore be interpreted as indicative rather than conclusive. While the results demonstrate that the trained model generalises well to an unseen WBBT sample and LOM, quantitative conclusions require further validation in future studies using a more extensive set of OOD WBBT samples and images. The present study should be regarded as a proof-of-concept demonstrating the feasibility of CNN-based semantic segmentation of WF in LOMs rather than a fully generalisable approach. Improving robustness and transferability will require broader data coverage, including variations in steel grade, magnification, acquisition conditions, laboratory settings, and annotation sources, alongside systematic multi-laboratory validation and the use of different patch sizes during training and inference.
4. Conclusions
This study proposes a framework for the pixel-wise semantic segmentation of light optical microscopy images, designed to significantly advance the microstructural characterisation of structural steels subjected to the welded bead bending test. The analysis covers three distinct phases in S355J2 micrographs: polygonal ferrite, pearlite, and Widmanstätten ferrite. A comprehensive dataset from [6] was utilised, from which 20 LOMs have been meticulously manually annotated to facilitate the rigorous evaluation of various deep learning architectures. Specifically, five UNet-based encoder backbones, ResNet-152, Xception, SE-ResNet-50, DenseNet-169, and EfficientNet-B5, were systematically trained for 50 epochs on the basis of 5-fold cross-validation. To ascertain the impact of domain-specific characteristics on model efficacy, these architectures were initialised following three distinct pretraining methodologies: (A) ImageNet initialisation, (B) MicroNet initialisation, and (C) a combined pretraining approach. The performance of these configurations was assessed on the basis of pixel-wise evaluation metrics, specifically Balanced Accuracy, Dice, IoU, and MAE, with particular emphasis on the models’ capacity to resolve the high-aspect-ratio morphology of WF needles against the tonally similar ferritic matrix. To provide further insight on the performance of the models, normalised confusion matrices were used to systematically investigate misclassifications. By employing state-of-the-art deep learning architectures, this study demonstrates reliable and precise segmentation across multiple microstructural phases, addressing the particularly challenging delineation of Widmanstätten ferrite, a central microstructural constituent closely associated with brittle fracture and WBBT failure, and highlighting the performance differences of CNN architectures and pretraining strategies. Collectively, these findings establish a quantitative and reproducible framework for the advanced microstructural characterisation of steels primarily composed of the analysed phases, indicating the potential for broad applicability beyond the present study. This is of particular relevance to structural steels, where systematic phase identification, localisation, and quantification facilitates understanding of the relationships between microstructure and material properties, such as the impact of Widmanstätten ferrite on crack-arrest capacity, as embodied by the welded bead bending test.
- Distinct morphological features, tonal differences, and substantial area fractions within the analysed LOMs enable all CNNs to achieve good to excellent patch-level predictive performance for F and P, with P being classified most reliably and F exhibiting slightly lower but still consistently high performance, alongside minimal inter-variant variability for both phases.
- At patch level, the precise semantic segmentation of WF remains a significant challenge owing to its modest area fraction and close tonal similarity to the dominant ferritic matrix, resulting in comparatively reduced Dice and IoU (maximum 50.75% ± 3.38% and 38.45% ± 3.01% for DenseNet-169-A) and elevated MAE (minimum 3.26% ± 0.59% for Xception-A).
- Inference-based aggregation improves F segmentation to near P-level performance, while P remains consistently near optimal. WF shows clear improvements but continues to represent the most challenging phase. In contrast to Balanced Accuracy, Dice, and IoU, the MAE increases after inference, indicating that improvements in segmentation and classification performance do not translate to reduced absolute error.
- All architectures exhibit rapid convergence, with mean loss stabilising by epoch 6 and minimal inter-fold variation, indicating efficient and stable optimisation independent of architectural depth or pretraining strategy. The learning curves suggest that despite this early loss stabilisation, additional training epochs may further improve performance, particularly for overlap-based metrics. Xception constitutes an exception, as it does not reach full convergence within 50 epochs and continues to exhibit a slight decreasing loss trend without suggesting further performance improvements through additional epochs.
- Deep networks with extensive feature reuse (ResNet-152, DenseNet-169, EfficientNet-B5) exhibit high sensitivity to pretraining, resulting in pronounced fluctuations in WF segmentation metrics, whereas shallower architectures (Xception, SE-ResNet-50) maintain consistently balanced learning behaviour.
- ImageNet initialisation achieves the highest performance for WF segmentation across all models at both patch-level and LOM-level metrics. MicroNet-involving pretraining may lead to minor, architecture-dependent reductions in misclassification rates.
- Misclassification analysis indicates that WF is predominantly confused with F. At patch-level, this effect is most pronounced in Xception (27.5–29.8%), while ResNet-152-A achieves the highest WF TP-rate (73.3%). At LOM level, the same trend persists, with reduced confusion in Xception (21.3–21.6%) and the highest WF TP-rate observed for EfficientNet-B5-C (82.5%).
- Systematic segmentation errors in WF arise from limited local contrast in P, ambiguous morphology of the WF phase, and patch size constraints, leading to a reduction in overlap-based metrics despite correct local phase recognition.
- Frequent over-segmentation of WF due to misclassification of needle-like F grains leads to a slight overestimation of WF phase fractions and an increase in MAE. Under-segmentation is considered more critical in this context, as missed WF structures result in underestimated phase fractions. The proposed method is primarily intended for qualitative localisation rather than precise quantification of WF, while still providing robust LOM-level phase fraction estimates that are suitable for practical quality assessment in WBBT-related applications.
- At LOM level, Xception-A achieves the best overall WF segmentation performance in terms of overlap-based metrics and error. While it shows nearly the lowest Balanced Accuracy (86.18% ± 1.74%), this model demonstrates the highest Dice (68.74% ± 1.12%) and IoU (52.52% ± 1.28%), as well as the lowest MAE (4.55% ± 0.80%), indicating superior segmentation quality for WF.
- OOD testing of the best-performing Xception indicated robust segmentation performance across all microstructural phases, confirming that the model generalises well to unseen data. MicroNet pretraining tends to generalise better than ImageNet pretraining on the evaluated OOD LOM. Majority voting across the five fold-specific models improved WF segmentation at LOM-level, achieving a Dice of 73.60%, an IoU of 58.23%, and an AE of 0.77% for Xception-B.
Author Contributions
Conceptualisation, F.B., K.H. and T.H.; methodology, F.B.; software, F.B.; validation, F.B. and T.H.; formal analysis, F.B., K.H. and T.H.; investigation, F.B.; resources, K.H. and T.H.; data curation, F.B.; writing—original draft preparation, F.B.; writing—review and editing, K.H. and T.H.; visualisation, F.B.; supervision, K.H. and T.H.; project administration, K.H.; funding acquisition, K.H. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the European Social Fund (ESF) under grant number 100691067. It constitutes a component of the “ESF-MINT Fachkräfteprogramm ESF Plus 2021 bis 2027” (ESF STEM Skilled Workers Programme ESF Plus 2021-2027) and is a collaborative initiative between Mittweida University of Applied Sciences and CEWUS GmbH. Further information on the underlying research project of this study is available online [29]: https://www.inw.hs-mittweida.de/webs/wfq/smart-materials/forschung-smart/abvml/, accessed on 24 June 2026. The APC was supported by the Open Access Publication Fund of Mittweida University of Applied Sciences.
Data Availability Statement
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy and legal restrictions related to ongoing research activities.
Acknowledgments
The authors would like to thank the Saxon Institute for Computational Intelligence and Machine Learning (SICIM) and Otto-von-Guericke-University (OVGU) for providing access to the GPU cluster. We express our gratitude to CEWUS, and in particular to Peter Kaiser and Matthias Hockauf, for compiling the steel samples used for image generation. We also extend our sincere thanks to Andreas Eysert for the fruitful discussions on microstructural characterisation that have greatly enriched this work.
Conflicts of Interest
The authors declare no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| AE | Absolute Error |
| BA | Balanced Accuracy |
| CEWUS | Chemnitzer Werkstoff- und Oberflächentechnik GmbH |
| CM | Confusion Matrix |
| CNN | Convolutional Neural Network |
| CV | Cross-validation |
| DDP | Distributed Data Parallel |
| DL | Deep Learning |
| EBC | Environmental barrier coating |
| ESF | European Social Fund |
| F | Ferrite |
| FN | False Negative |
| FP | False Positive |
| GPU | Graphics Processing Unit |
| HAZ | Heat-Affected Zone |
| IoU | Intersection over Union |
| LOM | Light Optical Microscopy |
| MAE | Mean Absolute Error |
| MBConv block | Mobile Inverted Bottleneck Convolution |
| ML | Machine Learning |
| MLP | Multi-Layer Perceptron |
| no. | Number |
| OOD | Out-of-distribution |
| P | Pearlite |
| px | Pixels |
| ResNet-152 | Residual Network 152-layer |
| SEM | Scanning Electron Microscopy |
| SE | Squeeze-and-Excitation |
| SEP | Stahl–Eisen–Prüfblatt |
| SICIM | Saxon Institute for Computational Intelligence and Machine Learning |
| std. dev. | Standard deviation |
| TN | True Negative |
| TP | True Positive |
| TEM | Transmission Electron Microscopy |
| vs. | Versus |
| WBBT | Welded Bead Bending Test |
| WF | Widmanstätten ferrite |
Appendix A. Performance Metrics
Appendix A.1. Stratified Group K-Fold Cross-Validation
Table A1.
Segmentation performance of the investigated CNN architectures for the three pretraining variants (Var.). Reported are mean values ± standard deviation over five folds for Balanced Accuracy (BA), Dice, IoU, and MAE. The best values for each metric and microstructural phase are highlighted in bold font.
Appendix A.2. Out-of-Distribution Test
Table A2.
Segmentation performance of Xception for the three pretraining variants (Var.) in the out-of-distribution test. Reported values represent the mean ± standard deviation across five models, each obtained from one of the five CV folds and used as individual predictors, for Balanced Accuracy (BA), Dice, IoU, and MAE. The best results for each metric and microstructural phase are highlighted in bold font. For the LOM-level metrics, results obtained via majority voting are additionally reported.
References
- Zusätzliche Technische Vertragsbedingungen und Richtlinien für Ingenieurbauten ZTV-ING; Technical Report; Bundesministerium für Digitales und Verkehr (BMDV): Berlin, Germany, 2023.
- DBS 918 002-02; Technische Lieferbedingungen: Warmgewalzte Erzeugnisse aus Baustählen für den Eisenbahnbrückenbau. Technical Report; Deutsche Bahn AG: Berlin, Germany, 2006.
- SEP 1390; Aufschweißbiegeversuch. Technical Report; Verein Deutscher Eisenhüttenleute (VDEh): Düsseldorf, Germany, 1996.
- Backofen, F.; Hähnel, U.; Hahn, F.; Hockauf, M.; Kaiser, P.; Hockauf, K. Prediction of the Outcome of a Welded Bead Bending Test (WBBT) using Machine Learning (ML). In Proceedings of the 43. Vortrags- und Diskussionstagung Werkstoffprüfung 2025; Zimmermann, M., Ed.; Deutsche Gesellschaft für Materialkunde e.V. (DGM): Sankt Augustin, Germany, 2025; pp. 86–91. [Google Scholar]
- Backofen, F.; Hähnel, U.; Hahn, F.; Hockauf, K. Comparative Analysis of Various Supervised Machine Learning Models for the Prediction of the Outcome of the Welded Bead Bending Test. Metals 2026, 16, 418. [Google Scholar] [CrossRef] [Scilit]
- Backofen, F.; Hockauf, M.; Hockauf, K.; Halle, T. CNN-Based Classification of Structural Steel Microstructures for the Prediction of the Outcome of the Welded Bead Bending Test. Metals 2026, 16, 625. [Google Scholar] [CrossRef] [Scilit]
- Bhadeshia, H.K.D.H. Diffusional formation of ferrite in iron and its alloys. Prog. Mater. Sci. 1985, 29, 321–386. [Google Scholar] [CrossRef] [Scilit]
- Rose, A.; Hougardy, H.P.; Klein, A. Der Einfluß der Unterkühlung auf die Kristallisationsformen von Voreutektoidisch Ausgeschiedenen Phasen und von Eutektoidischen Phasengemengen; Springer Fachmedien Wiesbaden GmbH: Wiesbaden, Germany, 1964. [Google Scholar] [CrossRef] [Scilit]
- Perez, N. Materials Science: Theory and Engineering; Springer Nature: Berlin/Heidelberg, Germany, 2024; pp. 1–917. [Google Scholar] [CrossRef] [Scilit]
- DeCost, B.L.; Lei, B.; Francis, T.; Holm, E.A. High throughput quantitative metallography for complex microstructures using deep learning: A case study in ultrahigh carbon steel. Microsc. Microanal. 2019, 25, 21–29. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Azimi, S.M.; Britz, D.; Engstler, M.; Fritz, M.; Mücklich, F. Advanced steel microstructural classification by deep learning methods. Sci. Rep. 2018, 8, 2128. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Durmaz, A.R.; Müller, M.; Lei, B.; Thomas, A.; Britz, D.; Holm, E.A.; Eberl, C.; Mücklich, F.; Gumbsch, P. A deep learning approach for complex microstructure inference. Nat. Commun. 2021, 12, 6272. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Stuckner, J.; Harder, B.; Smith, T.M. Microstructure Segmentation with Deep Learning Encoders Pre-Trained on a Large Microscopy Dataset. npj Comput. Mater. 2022, 8, 200. [Google Scholar] [CrossRef] [Scilit]
- Ronneberger, O.; Fischer, P.; Brox, T. U-Net: Convolutional Networks for Biomedical Image Segmentation. In Proceedings of the Medical Image Computing and Computer-Assisted Intervention—MICCAI 2015; Navab, N., Hornegger, J., Wells, W.M., Frangi, A.F., Eds.; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar] [CrossRef] [Scilit]
- ImageNet. Available online: https://www.image-net.org (accessed on 24 June 2026).
- Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Fei-Fei, L. ImageNet: A Large-Scale Hierarchical Image Database. In Proceedings of the 2009 IEEE Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2009; pp. 248–255. [Google Scholar] [CrossRef] [Scilit]
- He, K.; Girshick, R.; Dollár, P. Rethinking ImageNet Pre-training. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV); IEEE: New York, NY, USA, 2019; pp. 4918–4927. [Google Scholar] [CrossRef] [Scilit]
- Kornblith, S.; Shlens, J.; Le, Q.V. Do Better ImageNet Models Transfer Better? In Proceedings of the 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2019; pp. 2661–2671. [Google Scholar] [CrossRef] [Scilit]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep Residual Learning for Image Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2016; pp. 770–778. [Google Scholar] [CrossRef] [Scilit]
- Chollet, F. Xception: Deep Learning with Depthwise Separable Convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2017; pp. 1800–1807. [Google Scholar] [CrossRef] [Scilit]
- Hu, J.; Shen, L.; Albanie, S.; Sun, G.; Wu, E. Squeeze-and-Excitation Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 42, 2011–2023. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Huang, G.; Liu, Z.; van der Maaten, L.; Weinberger, K.Q. Densely Connected Convolutional Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR); IEEE: New York, NY, USA, 2017; pp. 2261–2269. [Google Scholar] [CrossRef] [Scilit]
- Tan, M.; Le, Q.V. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. arXiv 2019, arXiv:1905.11946. [Google Scholar] [CrossRef] [Scilit]
- Wilcoxon, F. Individual comparisons by ranking methods. Biom. Bull. 1945, 1, 80–83. [Google Scholar] [CrossRef] [Scilit]
- GitHub Repository: NASA Pretrained Microscopy Models. Available online: https://github.com/nasa/pretrained-microscopy-models (accessed on 24 June 2026).
- Loshchilov, I.; Hutter, F. Decoupled Weight Decay Regularization. arXiv 2019, arXiv:1711.05101. [Google Scholar] [CrossRef] [Scilit]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Proceedings of the Advances in Neural Information Processing Systems; Curran Associates Inc.: Red Hook, NY, USA, 2019. [Google Scholar]
- GitHub Repository: Segmentation Models PyTorch. Available online: https://github.com/qubvel/segmentation_models.pytorch (accessed on 24 June 2026).
- ABVML Project—Smart Materials Research. Available online: https://www.inw.hs-mittweida.de/webs/wfq/smart-materials/forschung-smart/abvml/ (accessed on 24 June 2026).
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.












