Concrete looks deceptively simple from the outside, but inside a single block of the world’s most-used building material lies a hidden landscape of air-filled voids, cement paste and coarse aggregate grains that determines whether a bridge deck lasts fifty years or fails in twenty. X-ray computed tomography can reveal that landscape in exquisite detail, yet turning raw CT slices into reliable maps of pores, paste and stone has long been a stubborn computational problem. Now a study published in Results in Engineering reports a deceptively simple fix: instead of asking one deep neural network to label all three phases at once, split the job in two. The result is a dramatic rescue of the very phase that matters most for durability — the tiny, hard-to-find voids — and a sobering demonstration of how easily headline accuracy numbers can hide complete failure.
The core difficulty is class imbalance. In ordinary concrete CT images, voids — the pores and microcracks that govern how water, chlorides and gases migrate through a structure — occupy only about 3.2 percent of the pixels. Cement paste fills roughly 64.4 percent and aggregate the remaining 32.4 percent. When a three-class network is trained on such skewed data, the optimizer can satisfy itself by simply predicting the dominant classes everywhere. The study’s own controlled experiment makes this vivid: a single-stage Vision Transformer–U-Net hybrid, trained on exactly the same data split, preprocessing and loss functions as the proposed method, collapsed onto the majority aggregate class. It achieved just 31.81 percent overall accuracy and a mean Intersection over Union of 10.61 percent, with F1-scores of essentially zero for both void and paste. In other words, the model learned to call nearly everything aggregate and nothing else.
The proposed alternative decomposes the problem along the physical hierarchy of the material itself. Stage 1 is a binary task: separate void from non-void, exploiting the fact that air and cracks attenuate X-rays weakly and appear dark. Stage 2 then classifies the remaining pixels as paste or aggregate, with void pixels masked out of the loss entirely through an ignore index so they cannot contaminate the second stage’s learning. At inference, the two predictions are merged: anything Stage 1 calls void becomes void, and everything else receives the Stage 2 verdict. Each stage therefore faces a milder imbalance than the original three-class problem, and void no longer competes with paste–aggregate boundaries for the network’s attention during optimization.
Both stages share the same backbone: a Vision Transformer encoder (ViT-B/16, pretrained on ImageNet) paired with a convolutional U-Net-style decoder. The choice is deliberate. Self-attention lets the encoder aggregate long-range context across a 224-by-224-pixel patch, useful when distinguishing fine pores from large aggregate grains, while the upsampling decoder reconstructs dense, full-resolution masks. Because the Vision Transformer produces a flat sequence of patch tokens rather than multi-scale feature maps, the decoder omits encoder skip connections and instead applies four bilinear upsampling blocks that rebuild the image from a 14-by-14 feature grid. Each stage carries roughly 86.6 million trainable parameters, all fine-tuned end-to-end on concrete patches with no concrete-specific pretraining.
Training was equally careful about imbalance. Each stage optimizes a weighted blend of cross-entropy, focal, Dice and IoU losses, with coefficients of 0.5, 0.25, 0.15 and 0.10 respectively. Stage 1 up-weights void pixels fifteenfold; Stage 2 mildly favors aggregate. The optimizer is AdamW with a learning rate of 5×10⁻⁵ under cosine annealing, early stopping on validation loss, and mixed-precision training in PyTorch. Crucially, the single-stage baseline received the same recipe, including void-upweighted losses — showing that reweighting alone, a common remedy in the literature, could not restore minority-class performance under this extreme skew. The gains come from task structure, not hyperparameter tuning.
The results on 151 held-out test patches are striking. The two-stage pipeline reached 94.58 percent overall accuracy, 87.50 percent mean IoU and 93.31 percent mean Dice, with class-wise F1-scores of 0.92 for void, 0.96 for paste and 0.92 for aggregate. Void recall hit 96.4 percent — the number that matters most, since missed pores translate directly into underestimated porosity and unreliable durability predictions. Bootstrap resampling over the test patches showed tiny standard deviations, with overall accuracy at 94.90 percent plus or minus 0.07 percent, indicating the performance is stable rather than a lucky draw. An ablation confirmed that removing either stage causes substantial degradation: Stage 2 alone cannot find voids at all, and Stage 1 alone cannot separate aggregate from paste.
The study also stress-tested the framework beyond its algorithmic training labels. On a second corpus of 82 images with human-prepared masks, held out twelve at a time for testing, the two-stage model outperformed a traditional enhanced-mask baseline on both 8-bit inputs and percentile-normalized 16-bit inputs, with the two encodings performing nearly identically on overall metrics. A full-slice demonstration on an unseen CT image predicted phase fractions of 3.64 percent void, 59.38 percent paste and 36.98 percent aggregate — closely tracking the training distribution and suggesting the pipeline can plausibly map whole specimens when preprocessing matches training assumptions. The authors are careful, however, to frame this as transfer plausibility rather than certified generalization.
The error analysis is refreshingly honest about where the method still struggles. The largest residual confusion lies at paste–aggregate interfaces, where similar X-ray attenuation and partial-volume mixing produced more than 365,000 swapped pixels in the test confusion matrix. Thin voids and microcracks are sometimes absorbed into paste, and beam-hardening streaks near dense aggregate can trigger false void calls. Because the merge rule forces every Stage 1 void prediction to remain void, errors cascade: the 3.6 percent of void pixels missed by Stage 1 can never be recovered, and false voids bypass Stage 2’s judgment entirely. For engineering use, the authors note, bulk porosity and aggregate grading from well-resolved regions are far more trustworthy than interface statistics or sub-resolution pore counts without local audit.
The limitations define a clear research agenda. All primary data come from a single specimen, one scan and one mix design, with patch-level rather than slice-level splitting, so neighboring windows from the same CT slice can straddle train and test folds. The reference labels themselves are algorithm-generated pseudo-labels, verified against manual annotation on only a 57-patch subset (88.64 percent pixel agreement), and the manual-label external check rests on just twelve test images. Inference is strictly two-dimensional, with no inter-slice consistency, and the two forward passes roughly double the computational cost of a one-pass model — 27.9 versus 14.6 milliseconds per patch on an RTX 2060, acceptable for offline analysis but not real-time deployment.
Even within those bounds, the study delivers a lesson that resonates far beyond concrete. When one class is vanishingly rare, the fix may not be a cleverer loss or a bigger model but a restructuring of the task itself — teaching the network to find the rare thing first, and only then sort the rest. As infrastructure agencies worldwide push toward digital twins of aging bridges, tunnels and nuclear containment structures, the microscopic pores inside concrete are where durability is decided. A two-stage trick that finally makes those pores visible to machines could quietly become one of the more consequential pieces of AI in civil engineering.
Subject of Research: Two-stage deep learning segmentation of void, paste and aggregate phases in concrete X-ray CT images under severe class imbalance
Article Title: Two-stage deep learning for segmenting in concrete X-ray CT images
Article References: Wang, Y. (2026). Two-stage deep learning for segmenting in concrete X-ray CT images. Results in Engineering, 32, Article 113430. https://doi.org/10.1016/j.rineng.2026.113430
Image Credits: AI Generated
DOI: Not provided
Keywords: concrete, X-ray computed tomography, deep learning, image segmentation, Vision Transformer, U-Net, class imbalance, porosity, cement paste, aggregate, civil engineering, digital twin

