Skip to Content
ElectronicsElectronics
  • Article
  • Open Access

25 March 2026

29 Pages

Lightweight CNN–Mamba Hybrid Network for Multi-Scale Concrete Crack Segmentation Using Vision Sensors

,
,
,
,
and
1
Hefei Institute for Public Safety Research, Tsinghua University, Hefei 230601, China
2
Global Safety Tanzer Technology Co., Ltd., Hefei 230601, China
3
Anhui Provincial Key Laboratory of Building Earthquake Disaster Mitigation and Green Operations, Anhui Institute of Building Research & Design, Hefei 230088, China
*
Author to whom correspondence should be addressed.

Abstract

Surface cracking is a key visible indicator of deterioration in concrete infrastructure and is routinely captured by vision sensors during field inspections. To translate inspection imagery into actionable maintenance information, crack delineation must be accurate at the pixel level and robust to challenging conditions where cracks are slender, discontinuous, low-contrast, and easily confused with joints, stains, texture patterns, and illumination artifacts. This study proposes a lightweight CNN–Mamba hybrid segmentation framework built upon Vm-unet for reliable crack mapping under heterogeneous inspection scenarios and resource-constrained deployment. The framework couples boundary-sensitive convolutional features with long-range state-space representations via a spatially modulated convolution design, refines skip-connection features using reciprocal co-modulation attention to suppress background interference, and enhances cross-scale interactions through a decoder interaction fusion scheme to preserve fine-crack continuity and sharp boundaries. Experiments on a multi-source composite dataset and public benchmarks show consistent improvements over representative CNN-, Transformer-, and Mamba-based baselines. The proposed method achieves 80.11% mIoU and 82.05% Dice on the composite dataset, while maintaining an efficient accuracy–cost trade-off (36.049 GFLOPs, 25.991 M parameters). The resulting crack masks provide a dependable basis for inspection-driven quantitative assessment and maintenance decision support.

1. Introduction

The service life and safety of modern infrastructure increasingly depend on timely and objective information about material condition and deterioration progression. Surface cracking is one of the most prevalent and visible symptoms in pavements, bridge decks, tunnel linings, and building envelopes. For cement-based materials, cracks indicate mechanical distress and also accelerate durability loss by providing preferential pathways for moisture and aggressive agents. This process promotes reinforcement corrosion, freeze–thaw damage, leaching, and progressive functional degradation. Consequently, automated and reliable crack assessment has become an enabling capability for inspection-driven maintenance planning and asset management [1]. A substantial body of research on crack detection and segmentation has focused on practical deployments in infrastructure inspection. In particular, in structural health monitoring scenarios such as dams and bridges, pixel-level crack segmentation results are often further used for quantitative assessment of geometric measures, e.g., crack width. Wu et al. proposed a lightweight network for pixel-level identification of dam cracks and performed crack-width measurement based on the segmentation results, demonstrating the practical value of and demand for crack segmentation in real-world engineering applications [2].
In many infrastructure systems, inspection practices are shifting toward high-frequency visual surveys using mobile devices, vehicle-mounted cameras, and unmanned aerial platforms. These vision sensors generate large volumes of imagery, yet actionable maintenance decisions require more than binary crack presence. Maintenance prioritization and intervention design often rely on quantitative descriptors such as crack extent, connectivity, and boundary evolution. This requirement makes pixel-level semantic segmentation a natural output form because it directly supports crack geometry extraction and subsequent condition indicators. Field crack segmentation remains challenging because cracks are often slender, discontinuous, and low-contrast. They are also frequently confused with joints, stains, surface textures, shadows, and non-uniform illumination [3,4]. Practical deployment further imposes constraints on computational resources and inference latency, particularly for on-device processing or near-real-time inspection workflows.
Earlier methods based on digital image processing, including edge operators, contrast enhancement, and thresholding, are sensitive to parameter settings and image quality. These methods tend to generalize poorly across different materials, lighting conditions, and crack morphologies [5,6]. Deep learning has improved crack segmentation by enabling end-to-end feature learning with convolutional neural networks and encoder–decoder architectures. Representative designs include U-Net variants [7], SegNet [8], and DeepCrack [9]. Despite their strong local feature extraction capability, purely convolutional models predominantly rely on neighborhood aggregation. When long-range context is required to distinguish true cracks from crack-like textures, such models may struggle to maintain continuity for spatially extended, curved, or fragmented cracks.
To enhance global modeling, Transformer-based architectures have been introduced into image segmentation. Self-attention enables explicit long-range interactions, and models such as Swin Transformer [10] and Transunet [11] have achieved strong results on standard benchmarks. However, the computational and memory costs of attention typically increase quadratically with image resolution, which hinders deployment in practical engineering scenarios where images are high-resolution and resources are limited. More recently, efficient vision Transformers and hybrid mobile architectures, such as Mobilevit [12] and Edgenext [13], have been explored to improve the accuracy-efficiency trade-off under resource-constrained settings. These models suggest that lightweight global modeling can make mobile and edge deployment more practical, and related studies have also begun to introduce Mobilevit-style modules into lightweight crack segmentation networks. However, these efficient architectures are primarily designed as general-purpose lightweight backbones rather than crack-oriented segmentation frameworks, and their advantages may diminish when fine-grained boundary preservation and multi-scale continuity are required. In addition, attention-driven representations may still be insufficient for preserving fine boundary details that are critical for thin crack delineation.
State-space sequence modeling has recently emerged as an efficient alternative for learning long-range dependencies. Mamba provides linear-time sequence modeling and has been adapted to vision tasks [14]. Vm-unet integrates Mamba-style global modeling with a U-Net-like multi-scale decoding framework, offering a promising direction for crack segmentation [15]. Nevertheless, infrastructure imagery introduces heterogeneous textures, scale variation, and complex background patterns that expose several practical gaps. First, encoder representations must capture fine boundary cues and long-range structural context while maintaining computational efficiency. Second, skip connections should emphasize crack-relevant responses and suppress repetitive background patterns, otherwise false alarms and spatial misalignment can be amplified during decoding. Third, decoder fusion must preserve semantic consistency across scales while restoring thin boundaries that are easily blurred by upsampling.
We summarize the most common and directly observable failure modes in heterogeneous field crack segmentation into three categories, and accordingly formulate minimal design requirements. (i) Continuity failure: Under shadow occlusion, dry–wet variations, and low-contrast conditions, cracks are often thin, weak, and discontinuous, leading to fragmentation and missed detections. This indicates that the encoder should simultaneously provide boundary-sensitive local representations and long-range dependency modeling to preserve the connectivity of slender crack traces. (ii) Interference amplification: Stone textures, wall joints, and stained regions often exhibit appearances similar to cracks. In U-shaped architectures, unfiltered skip connections may directly propagate background-dominant activations, which can be further amplified during decoding, resulting in false positives and inter-stage misalignment. (iii) Insufficient boundary recovery: Multi-scale upsampling and feature fusion may over-smooth thin crack boundaries or introduce localization shifts, thereby impairing subsequent geometric quantification. Based on these failure modes, we impose the following design requirements: jointly modeling local boundaries and global structures without a significant increase in computational cost to reduce crack fragmentation/missed detections; selectively modulating skip-connection information to suppress background interference and alleviate alignment errors; and strengthening cross-scale consistency during decoding to stabilize boundary restoration.
Under deployment-oriented efficiency constraints, we adopt Vm-unet as the backbone, as its state-space modeling offers long-range dependency modeling with linear complexity. However, a purely state-space pathway is less sensitive to fine-grained boundaries and local morphological variations. Therefore, we employ a dual-path CNN–Mamba representation and introduce lightweight, failure-driven enhancements at three key locations—encoder, skip connections, and decoder. Specifically, the MSMC module targets continuity issues by coupling local boundary cues with long-range context at the pixel level; the RCA module addresses complex interference by explicitly suppressing background-dominant responses at the skip connections and improving inter-stage alignment; and the CIF module alleviates insufficient boundary recovery by enabling cross-scale interactive fusion to mitigate semantic conflicts and improve thin-boundary restoration.
The main contributions of this study are summarized as follows.
(1)
A maintenance-oriented crack segmentation framework is developed by integrating convolutional local feature learning with Mamba-based long-range dependency modeling, producing robust pixel-level crack maps that can serve as inputs for quantitative condition assessment and inspection-driven maintenance prioritization.
(2)
A Mamba Spatially Modulated Convolution module is introduced to jointly model fine crack details and long-range context through spatially modulated fusion, improving continuity preservation and boundary delineation that are essential for crack geometry quantification in cement-based surfaces.
(3)
A Reciprocal Co-modulation Attention module is proposed to enhance selective skip-connection transmission via spatial suppression and alignment refinement, reducing false positives caused by joints, stains, and repetitive textures, thereby lowering the manual verification burden in practical inspection workflows.
(4)
A Cross-Interaction Fusion module is designed to strengthen cross-scale semantic consistency and boundary recovery during decoding. Comprehensive experiments under a unified protocol on a multi-source composite dataset and public benchmarks demonstrate improved accuracy, robustness, and computational efficiency for deployment-constrained inspection scenarios.
The remainder of this paper is organized as follows. Section 2 reviews related work and technical background. Section 3 describes the proposed network architecture, design rationale of each module, experimental settings and evaluation metrics. Section 4 presents the comparative results, ablation studies and qualitative visualizations. Section 5 presents a discussion of the experimental results. Section 6 concludes the paper and outlines future work.

3. Methods

3.1. Overview of the Proposed Architecture

Vm-unet is a U-shaped segmentation framework that introduces Mamba-style state-space modeling into image segmentation by using the Visual State Space module to capture long-range dependencies and global context with linear computational complexity. While this pure state-space encoding strategy has shown strong performance in medical imaging, it can be less effective for infrastructure crack imagery, where targets are extremely thin, boundaries are weak, and surface textures vary substantially across inspection scenes. In such cases, relying on a single state-space pathway may lead to insufficient sensitivity to fine-grained boundary cues and local morphological variations, which are critical for accurate crack delineation.
To address this limitation, this study develops an efficient crack segmentation network that integrates convolutional feature learning with Mamba-based long-range modeling on top of Vm-unet. As illustrated in Figure 1, the proposed framework follows a standard encoder–decoder architecture with skip connections, but it introduces three coordinated design upgrades that target crack-specific challenges under heterogeneous visual inspection conditions. First, the encoder and decoder adopt a dual-path representation strategy that combines a convolutional pathway for local, boundary-sensitive cues with a state-space pathway for global contextual reasoning. Second, skip connections are explicitly regulated to transmit crack-relevant information while suppressing repetitive background patterns that frequently cause false positives. Third, decoder-side feature fusion is strengthened to maintain semantic consistency across scales and to recover thin crack boundaries that are often blurred during upsampling.
Figure 1. Overall network architecture. (a) downsampling stage; (b) upsampling stage.
At the representation learning stage, the proposed Mamba Spatially Modulated Convolution module is used as the basic building block in both the encoder and decoder, replacing the original Visual State Space modules. Within this module, the convolutional branch focuses on local structures such as edges, textures, and subtle intensity transitions, whereas the Mamba branch captures long-range dependencies that help discriminate true cracks from crack-like textures across large spatial extents. A spatial modulation mechanism then performs adaptive, pixel-level fusion between the two feature streams, allowing the network to preserve boundary detail while maintaining global structural coherence.
To improve information transfer between the encoder and decoder, a Reciprocal Co-modulation Attention module is inserted along skip-connection pathways. This module enables bidirectional interaction between globally smoothed representations and locally detailed features, and it applies learnable spatial suppression to reduce redundancy and background interference. By explicitly regulating what is transmitted through skip connections, the module mitigates common issues in U-shaped architectures, including feature misalignment and the propagation of irrelevant textures, thereby supporting more accurate reconstruction of crack geometry.
In the decoder, a Cross Interaction Fusion module is further introduced to enhance multiscale semantic recovery. Since cracks often present at multiple widths and may be partially occluded or discontinuous, effective decoding requires consistent alignment between high-level semantics and low-level spatial details. The proposed fusion design establishes cross-scale interactions to coordinate features at different resolutions, reducing semantic conflicts during decoding and improving the sharpness and localization of crack boundaries.
Overall, the proposed architecture retains the efficiency advantages of Mamba-based long-range modeling while substantially improving sensitivity to fine-grained crack structures through complementary convolutional learning and targeted cross-stage and cross-scale feature interactions. This design is intended to provide reliable pixel-level crack masks under complex backgrounds and to remain suitable for deployment in resource-constrained inspection workflows.

3.2. Mamba Spatially Modulated Convolution Block

Under heterogeneous inspection scenarios, cracks often exhibit thin, weak, and discontinuous appearances, particularly under shadow occlusion, low-contrast conditions, and dry–wet variations. These factors frequently lead to fragmented crack traces, missed detections, and boundary discontinuities. When relying solely on local convolutional features, the model lacks sufficient capability to capture long-range connectivity, making it difficult to preserve global crack trajectory consistency in complex backgrounds. Vm-unet introduces state-space modeling with advantages in long-range dependency learning; however, a purely state-space pathway is typically less sensitive to fine-grained boundaries and local morphological variations. In contrast, CNNs provide boundary-sensitive local representations but lack global structural constraints. Therefore, a lightweight mechanism is required to tightly couple boundary-aware local cues with long-range contextual information at the encoding stage, thereby improving both continuity and robustness for slender cracks. To jointly capture fine crack details and long-range contextual dependencies, we design the Mamba Spatially Modulated Convolution block (MSMC) as a basic building unit in the encoder and decoder. MSMC explicitly emphasizes boundary-related responses through spatially modulated convolution and interactively fuses them with Mamba’s long-range state-space features at the pixel/spatial level. As a result, the learned representations simultaneously enhance local boundary discrimination and long-range connectivity modeling, reducing fragmentation and missed detections for thin cracks while maintaining low additional computational overhead.
As shown in Figure 2, MSMC contains two parallel pathways. A convolutional pathway focuses on boundary-sensitive local representation, while a Mamba pathway models long-range dependencies using a state-space formulation. The outputs of the two pathways are then integrated through a pixel-adaptive fusion mechanism, which dynamically balances local detail preservation and global context awareness for crack segmentation.
Figure 2. Architecture of the Mamba Spatially Modulated Convolution (MSMC) Block. (a) Weighted Convolution Module; (b) Mamba Module; (c) Adaptive Attention Fusion Module.

3.2.1. Local Boundary-Sensitive Modeling with Weighted Convolution

Standard convolution aggregates neighboring pixels using shared kernel weights, which may smooth weak and slender crack cues when the local contrast is low. To enhance the sensitivity to narrow fissures and boundary transitions, the convolutional pathway adopts weighted convolution [28]. Given an input feature map F ∈ R H × W × C , a convolution kernel W ∈ R K × K × C , and a spatial weight matrix Φ ∈ R K × K , the weighted convolution is defined as:
F ∗ W Φ i , j = ∑ a = 1 K ∑ b = 1 K Φ a , b W a , b F i + a , j + b
The spatial weight matrix Φ is generated from a learnable centro-symmetric one-dimensional vector and constructed via a rank-one outer product. During training, Φ modulates the kernel W through element-wise multiplication, thereby enabling position-sensitive aggregation within the receptive field. When Φ becomes an all-ones matrix, this operator degenerates into standard convolution. This design strengthens boundary responses and improves the representation of subtle crack textures, which are easily suppressed by conventional local averaging.
It should be emphasized that the centro-symmetric constraint adopted in this study is applied only to the parameterization of the spatial weight matrix Φ. The purpose is to achieve a learnable re-calibration of the contributions of different positions in the local neighborhood with minimal additional parameters, thereby enhancing boundary and fine-crack responses. This symmetry is not imposed on the convolution kernel W, which remains fully learnable. Although Φ has a centro-symmetric weighting structure in space, the resulting effective kernel W Φ is not required to be centro-symmetric; it can produce directionally salient and asymmetric filtering responses through the learned parameters, thus adapting to asymmetric crack morphologies commonly observed under shear or torsional loading, such as diagonal and curved crack patterns. Meanwhile, the parallel Mamba branch in MSMC performs multi-directional long-range dependency modeling, providing additional capability to characterize crack orientation and directional consistency, and thus complementing the local branch.

3.2.2. Long-Range Dependency Modeling with a State-Space Pathway

Cracks often extend across large spatial regions with irregular geometry, and purely local operators are insufficient to describe their long-range continuity and contextual consistency. The Mamba pathway therefore introduces a state-space model to capture long-range dependencies with linear computational complexity. The state-space recurrence is expressed as:
h t = A h t − 1 + B x t
y t = C h t
where x t denotes the input, y t denotes the output, and h t is the latent state. The matrices are A and B, and there are learnable parameters. Since images are two-dimensional, the continuous formulation must be discretized and applied to a serialized representation. Discretization is performed using the matrix exponential, yielding:
A ¯ = e x p ∆ A
B ¯ = ∆ A − 1 e x p ∆ A − I · ∆ B
h n = A ¯ h n − 1 + B ¯ x n
y n = C h n
where x n is the sequential input obtained by mapping the feature map using a predefined scanning rule. To preserve structural information from different orientations, the feature map is scanned along multiple directions. The discretized state-space operator is applied to each direction, and the outputs are reshaped back into a two-dimensional feature representation. A lightweight fusion layer then aggregates directional responses. With a four-direction cross-scanning strategy, the Mamba pathway provides global modeling capability for curved, fragmented, and low-contrast cracks, thereby supporting continuity preservation under heterogeneous background interference. The four-directional scanning in this work is mainly used to serialize two-dimensional feature maps so that state-space recurrence can be applied. This does not imply that the model can only handle cracks aligned with the horizontal/vertical axes. We map the same feature map into sequences using four traversal orders: left-to-right, right-to-left, top-to-bottom, and bottom-to-top. As a result, the same spatial location corresponds to different contextual neighborhoods and dependency paths across the four sequences. For branching or intersecting cracks, the representation around junction regions is influenced by state information propagated along multiple scanning paths and is subsequently aggregated by the directional fusion layer, thereby enabling a comprehensive characterization of complex topologies. Meanwhile, the parallel convolutional branch in MSMC is more sensitive to local geometry and boundary details, which complements the long-range dependency modeling of the Mamba branch. Finally, pixel-wise adaptive fusion jointly improves the separability and connectivity of complex crack morphologies.
A linear time-invariant state-space system can be equivalently represented by a convolution between the input sequence and the system impulse response. This property enables an efficient parallel implementation in which the structured convolution kernel is:
K ¯ = C B ¯   C A ¯ B ¯ ⋯   C A ¯ k − 1 B ¯
y = K ¯ ∗ x
where K ¯ denotes the structured convolution kernel, and k is the length of the input sequence x. This formulation retains long-range dependency modeling while ensuring that both time and memory costs scale linearly with the input length, which is beneficial for deployment on resource-constrained inspection platforms.

3.2.3. Pixel-Adaptive Fusion of Local and Global Representations

Because the convolutional pathway and the Mamba pathway emphasize complementary aspects of crack appearance, an effective fusion mechanism is required to integrate local boundary cues and global contextual dependencies. MSMC adopts a pixel-adaptive attention gate to dynamically control the contribution of each pathway. Let F C N N and F m a m b a denote the outputs of the convolutional and Mamba pathways, and let F ′ = c o n c a t [ F C N N , F m a m b a ] . The fusion weight α is generated by combining global average pooling and global max pooling to summarize contextual and salient responses, followed by a lightweight gating network:
α = S i g m o i d W 2 ∗ δ W 1 ∗ c o n c a t A v g P o o l F ′ , M a x P o o l ( F ′ )
where δ denotes the ReLU activation and W 1 and W 2 are learnable convolution kernels. The fused feature is then computed as:
F M S M C = α ⨀ F C N N + 1 − α ⨀ F m a m b a + F
where ⨀ denotes element-wise multiplication and F is the block input used for residual learning. This pixel-adaptive fusion strengthens crack boundary localization in regions dominated by fine textures, while enhancing structural completeness in areas where long-range context is required to suppress crack-like background patterns.

3.3. Reciprocal Co-Modulation Attention Block

False positives in crack detection commonly originate from background structures that visually resemble cracks, such as stone textures, wall joints, stain streaks, and pseudo-edges induced by illumination reflections. In U-shaped architectures, skip connections directly transmit high-resolution background textures to the decoder; without selective suppression, background-dominant activations can be amplified during decoding, increasing false detections and impairing inter-stage feature alignment. Conventional skip fusion typically adopts concatenation or element-wise addition, lacking mutual constraints between the encoder and decoder, and thus struggles to achieve effective background suppression and semantic alignment under complex interference. To address this issue, we aim to introduce a lightweight bidirectional modulation mechanism at the skip connections, such that decoder-side semantics can guide the transmission of encoder-side details, while encoder-side boundary cues can in turn constrain decoder-side coarse semantics, thereby improving robustness against background interference.
To explicitly regulate the information transmitted across stages, this study adopts the idea of interactive attention modeling [29] and proposes a Reciprocal Co-modulation Attention block, abbreviated as RCA. The RCA block is placed on each encoder–decoder skip pathway and performs two operations simultaneously. It strengthens crack-related responses through bidirectional modulation between complementary feature cues, and it suppresses background interference through a learnable spatial selection mask. The overall structure is shown in Figure 3.
Figure 3. Architecture of the Reciprocal Co-modulation Attention (RCA) Block.
Let the input feature map be F ∈ R H × W × C . Two spatial response maps are first extracted to represent complementary characteristics. Global average pooling emphasizes globally smooth and low-frequency responses, while global max pooling highlights locally salient and texture-sensitive responses. To reduce computational cost and to promote local coherence before cross-branch interaction, both pooled maps are projected and downsampled by a convolution operator:
F a = W d o w n ∗ A v g P o o l F
F m = W d o w n ∗ M a x P o o l F
Here, W d o w n denotes the convolution kernel used for downsampling.
The two cues are complementary for crack delineation. The globally smoothed representation provides stable context under illumination changes, while the texture-sensitive representation preserves fine crack traces and boundary contrast. RCA therefore applies reciprocal modulation so that each branch is adaptively weighted by information from the other branch. A lightweight convolutional transform produces gating weights, followed by a Sigmoid function, and the resulting weights modulate the target feature map element-wise:
F a ′ = S i g m o i d W ∗ F m ⨀ F a
F m ′ = S i g m o i d W ∗ F a ⨀ F m
In the above, W denotes convolution kernels, and ⨀ denotes element-wise multiplication. The modulated features are then upsampled to the original spatial resolution using transposed convolution, fused by summation, and converted into a spatial selection mask M through a convolution and a Sigmoid activation:
M = S i g m o i d W ∗ W T ∗ F a ′ + W T ∗ F m ′
Here, W T denotes the transposed convolution kernel for upsampling. The final output of RCA is obtained by applying the spatial mask to the original feature map, which selectively retains crack-relevant regions and suppresses background responses:
F R C A = M · F
Through reciprocal co-modulation and spatial masking, RCA improves the quality of skip features delivered to the decoder. This design reduces redundant background propagation, mitigates spatial mismatch across stages, and provides more reliable detail cues for reconstructing thin, discontinuous cracks in complex inspection scenes.

3.4. Cross-Interaction Fusion Block

During the decoding and restoration stage of crack segmentation, thin crack boundaries are prone to being over-smoothed in multi-scale upsampling and fusion, or to suffering localization shifts due to semantic inconsistency across scales, resulting in blurred boundaries, discontinuities, and local adhesion/missed detections. Such boundary instability not only degrades quantitative metrics but also undermines the reliability of subsequent geometric crack quantification. A decoder that relies solely on progressive upsampling and simple fusion is often unable to simultaneously ensure high-level semantic consistency and low-level detail precision; this issue becomes more pronounced in heterogeneous scenes, where scale variations and background interference exacerbate cross-scale semantic conflicts. Hence, a lightweight fusion strategy that explicitly models cross-scale interactions in the decoder is required to stabilize boundary restoration and improve overall structural coherence.
To mitigate this issue, and inspired by the feature-fusion paradigm in multi-source semantic segmentation [30], we propose a Cross-Interaction Fusion block, abbreviated as CIF. The CIF block explicitly performs bidirectional interactions between the upsampled decoder feature and the corresponding skip feature, so that semantic cues can guide detail reconstruction and fine textures can refine boundary localization. The overall structure is shown in Figure 4.
Figure 4. Architecture of the Cross Interaction Fusion (CIF) Block.
Let the upsampled decoder feature and skip feature be denoted by F u p ∈ R H × W × C and F s k i p ∈ R H × W × C , respectively. To enable attention-based interaction, both feature maps are reshaped into sequences F s k i p ∈ R H × W × C and F s k i p ′ ∈ R N × C , where N equals H times W . Each sequence is linearly projected to obtain query, key, and value embeddings:
Q u p = W u p _ q ∗ F u p ′
K u p = W u p _ k ∗ F u p ′
V u p = W u p _ v ∗ F u p ′
Q s k i p = W s k i p _ q ∗ F s k i p ′
K s k i p = W s k i p _ k ∗ F s k i p ′
V s k i p = W s k i p _ v ∗ F s k i p ′
where W u p _ q , W u p _ k , W u p _ v , W s k i p _ q , W s k i p _ k , and W s k i p _ v are learnable projection matrices. CIF then applies a multi-head cross-attention mechanism to exchange information in two directions. The first direction uses decoder semantics to attend to skip details, and the second direction uses skip details to attend to decoder semantics:
F u p / s k i p ′ = S o f t m a x Q u p K s k i p d ∗ V s k i p
F s k i p / u p ′ = S o f t m a x Q s k i p K u p d ∗ V u p
where d denotes the channel dimension of each attention head. The resulting sequences are reshaped back to spatial feature maps, yielding F u p / s k i p and F s k i p / u p . Residual connections are then applied to preserve the original representations while injecting the cross-attended information, which stabilizes optimization and prevents over-smoothing. Finally, the two enhanced maps are concatenated and passed through a convolutional bottleneck to suppress redundancy and generate a compact fused representation for subsequent decoding:
F f u s e = C o n c a t F u p / s k i p + F u p , F s k i p / u p + F s k i p
Through this bidirectional interaction design, CIF reduces semantic conflicts between decoder features and skip features, strengthens cross-scale consistency, and improves the recovery of thin crack boundaries during upsampling. This is particularly beneficial for field imagery where cracks are discontinuous and exhibit ambiguous edges under heterogeneous surface textures and illumination conditions.

3.5. Data Processing

To evaluate the effectiveness and generalization of the proposed network under heterogeneous inspection conditions, we constructed a multi-source crack segmentation dataset that integrates public benchmarks and in-house data. The final dataset contains 9600 image–mask pairs with pixel-level annotations, and it is used for training, validation, and testing. The public component covers widely used crack segmentation benchmarks, including CFD [3], Crack500, Cracktree200, DeepCrack [9], GAPS384 [31], Rissbilder, SDNET2018 [32], and Volker [33]. In addition, we supplemented with images collected by our research group in real-world inspections. Compared with public datasets, the distinctiveness of the in-house data mainly lies in the fact that they are more closely aligned with the imaging conditions and interference factors encountered in real inspection workflows. These samples were collected from real inspection scenarios and cover different substrates, including asphalt pavements, concrete slabs, stone surfaces, and building walls, while also involving complex background factors such as day–night acquisition, shadow occlusion, specular reflection, wet/dry surface variations, and stain contamination. Such factors significantly increase the confusion between crack patterns and non-crack textures, making thin cracks, low-contrast cracks, and discontinuous cracks more difficult to segment accurately. Therefore, although the in-house data are limited in quantity, they introduce realistic inspection disturbances and domain discrepancies that are difficult to be sufficiently covered by public datasets, thereby making the resulting dataset more suitable for evaluating the robustness, generalization ability, and practical applicability of the model under real engineering deployment conditions. Given that our in-house inspection images are relatively concentrated in scene categories and limited in scale, constructing a training/testing set solely based on the in-house data would easily introduce distribution bias and would not support a statistically meaningful evaluation of generalization. To improve data diversity and better reflect cross-material, cross-illumination, and cross-contamination conditions in real inspections, we incorporated the in-house data as a supplement to the real inspection domain and jointly constructed a multi-source composite dataset together with multiple public crack segmentation datasets. The purpose of constructing this multi-source composite dataset is not merely to enlarge the sample size, but more importantly to enhance the dataset’s representational capacity for complex field conditions by introducing real inspection-domain samples, so that model evaluation is better aligned with the practical requirements of infrastructure maintenance scenarios. This diversity results in substantial variation in crack scale, morphology, background complexity, and illumination, thereby providing a challenging and application-oriented testbed for crack segmentation.
To improve annotation consistency and ensure a unified task definition across sources, we did not directly use the original public datasets in their released forms. Instead, all samples were cleaned, reorganized, and standardized according to a consistent pixel-level labeling specification. Before training, images were resized to 512 × 512 to balance input-scale consistency with the preservation of fine cracks, and the corresponding masks underwent identical geometric transformations to maintain label alignment. For ultra-high-resolution images, an overlapping sliding-window strategy was used to generate training patches, with a window size of 512 × 512 and a stride of 256. This strategy increases the coverage of thin and elongated cracks and helps preserve boundary continuity. Samples with severe noise, missing annotations, or highly ambiguous crack–background boundaries were manually reviewed and removed. For self-collected images, crack masks were annotated following the same unified labeling protocol.
Since the public benchmarks were collected and labeled under different conventions, we unified the task definition to a consistent binary crack-vs-background segmentation protocol before training and evaluation. All masks from different sources were converted to the same encoding (crack = 1, background = 0), and mask resizing used nearest-neighbor interpolation to avoid generating mixed-label pixels. We further conducted a two-stage quality check to mitigate label noise: (i) automatic screening for missing/empty masks and extreme foreground ratios; and (ii) manual inspection of outliers and cases with ambiguous crack–background boundaries, which were excluded from the final set. Self-collected images were annotated following the same unified guideline, and the dataset was split in a source-stratified manner at the original-image level to avoid leakage across splits.
To reduce bias caused by duplicated or near-duplicated samples, deduplication was performed prior to dataset splitting. Perceptual hashing and feature-similarity matching were applied to identify highly similar images, and only one instance was retained when duplicates were found. Near-duplicate cases were further screened through a two-stage procedure that combined automated matching with manual verification.
Data augmentation followed a weak-to-moderate strategy to improve robustness while avoiding excessive deformation that could obscure thin cracks. The augmentation pipeline included random horizontal and vertical flipping, random rotation, scale jittering, random cropping with padding, color jittering, Gaussian noise with mild blurring, and random erasing. All augmentations were applied with strict alignment between images and masks.
For reproducibility and fair comparison, the dataset was split into training, validation, and test sets using an 8:1:1 ratio. Samples from each source were stratified to maintain consistent source-domain distributions across the three subsets. To prevent implicit leakage introduced by sliding-window cropping, we first partitioned the dataset at the original-image level, and then performed sliding-window cropping and augmentation only within each subset. This ensures that patches derived from the same original image never appear in different splits. Table 1 summarizes the composition and partition statistics of the multi-source composite crack segmentation dataset. The statistics are reported in terms of the preprocessed image–mask pairs used for training, validation, and testing. For sliding-window samples generated from ultra-high-resolution original images, deduplication and dataset partitioning were first performed at the original-image level, after which sliding-window cropping was conducted only within each subset, thereby ensuring that samples derived from the same original image would not appear across different subsets.
Table 1. Composition and Partition Statistics of the Multi-Source Composite Crack Segmentation Dataset.
The composite dataset used in this study was constructed by uniformly cleaning, re-annotating, and standardizing multiple third-party public benchmark datasets together with in-house images collected during real-world inspections. Given that third-party public datasets often impose redistribution restrictions and that in-house inspection data are subject to collaboration agreements as well as privacy and confidentiality requirements, readers with academic research needs may contact the corresponding author and specify the intended use, we will provide necessary supplementary information under compliance constraints. For ease of verification, we also report full comparative results on the public benchmarks Crack500 and DeepCrack, and we describe in detail the unified data preprocessing, split strategy, training/inference settings, and evaluation metrics, so that readers can reproduce the experimental pipeline and the main comparative trends on the publicly available data.

3.6. Experimental Settings

3.6.1. Evaluation Metrics

We evaluated crack segmentation performance using four commonly adopted metrics for semantic segmentation: mean Intersection over Union, mean Dice coefficient, Precision, and Recall. Intersection over Union measures the overlap between predicted crack regions and ground-truth masks and reflects the agreement between prediction and annotation. The Dice coefficient quantifies the similarity between prediction and ground truth and is sensitive to thin foreground structures. Precision and Recall characterize the correctness and completeness of crack-region predictions, respectively. The metrics are defined as follows:
I o U = T P T P + F P + F N
m I o U = 1 2 I o U c r a c k + I o U b g
D i c e = 2 T P 2 T P + F P + F N
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
Here, TP, TN, FP and FN denote the numbers of true-positive, true-negative, false-positive, and false-negative pixels, respectively. Together, these metrics provide a complementary assessment of pixel-level delineation quality and the overall reliability of crack foreground prediction across images.
In addition, to verify that the observed performance gains are not caused by accidental fluctuations in a few individual samples, this study further conducted a sample-level statistical significance analysis. Specifically, the mIoU and Dice of each test sample were computed on the test set, and a two-sided paired Wilcoxon signed-rank test was performed to examine the differences between the proposed method and the key baselines. Sample-level dispersion and p-values were analyzed to reflect the stability of the performance improvements at the test-sample level.

3.6.2. Implementation Details and Training Settings

All models were implemented in PyTorch 2.1.1 with CUDA 11.8 and cuDNN 8.9.5, using Python 3.10 on Windows 11. Experiments were conducted on a single workstation equipped with an Intel Core i5-13600KF CPU, 32 GB RAM, and an NVIDIA GeForce RTX 4070 Ti GPU. The NVIDIA driver version was 560.94. This hardware and software configuration was kept identical for all compared methods to ensure a fair and reproducible evaluation.
The network is trained on the preprocessed image–mask pairs described in Section 3.5, with a unified input size of 512 × 512. This setting is mainly adopted because: (i) it satisfies GPU memory constraints while maintaining a sufficiently large batch size to stabilize training; (ii) using a unified input resolution facilitates fair comparisons across datasets and methods; and (iii) cracks are thin and elongated structures, and patch-based training with random cropping can substantially increase the number of effective samples and strengthen local boundary learning. It should be emphasized that the proposed network does not rely on a fixed input size during inference and can predict on images of arbitrary resolutions. For ultra-high-resolution images commonly encountered in real-world inspections, we adopt an adaptive processing pipeline: large images are processed via sliding-window/tile-based inference using a window size of 512 × 512 with 50% overlap to alleviate tile-boundary artifacts. The probability maps in overlapping regions are fused by weighted averaging to obtain the full-image prediction. This strategy preserves high-resolution details while making the computational and memory costs approximately scale linearly with the number of pixels, which is suitable for engineering-grade high-resolution inputs. Data augmentation follows the weak-to-moderate strategy described in Section 3.5 and is applied online during training, while strictly preserving the alignment between each image and its corresponding mask.
Optimization was performed using the Adam optimizer with an initial learning rate of 1 × 10−4. A step-based learning-rate decay strategy was adopted, and all models were trained for 100 epochs. To avoid confounding factors in comparative evaluation, no pretrained weights were used for any method, and all parameters were optimized end-to-end without freezing layers. The mini-batch size was set to 2 to fit GPU memory at the chosen input resolution, and the same batch size was used for all methods under the unified protocol.
To mitigate the severe foreground–background imbalance inherent in crack segmentation, the training objective used a composite loss that combines Dice loss and Focal loss. Dice loss encourages overlap between the predicted crack mask and the ground truth, while Focal loss down-weights easy background pixels and emphasizes hard examples such as weak, fragmented, or low-contrast cracks.
L = λ L D i c e + 1 − λ L F o c a l
L D i c e = 1 − 2 T P + ϵ 2 T P + F P + F N + ϵ
L F o c a l = − α t 1 − p t γ log p t
where ϵ is a smoothing term, γ is used to down-weight the gradient contributions of easy samples and emphasize hard pixels, and α t compensates for class imbalance. According to the ablation results reported in the original Focal Loss paper, the setting γ = 2.0 and α t = 0.25 achieves the best performance and shows a certain degree of robustness to the choice of γ/ α t [34]; therefore, we adopt this configuration in this work. For the combination weight, prior studies indicate that an equally weighted Hybrid Focal–Dice loss is an effective configuration [35]; thus, we use the equal-weight setting λ = 0.5. To ensure fairness and reproducibility in cross-dataset comparisons, we keep the same loss formulation and hyperparameter settings across all datasets, and report mIoU/Dice as well as Precision/Recall in the results to comprehensively reflect the performance trends under different failure modes.
To support reproducibility and ensure fair comparison, the random seed for data shuffling and model training was fixed to 11 and consistently used across all experiments. All comparative baselines were reproduced using publicly available implementations and were trained and evaluated from scratch under the same preprocessing pipeline, training budget, and evaluation protocol as our method. The manuscript reports the key implementation details, including input size, sliding-window strategy, data augmentation, optimizer and learning rate, number of training epochs, loss functions, random seed, and the hardware/software environment. Note that minor metric variations may occur due to nondeterministic factors in GPU parallel computation; however, such variations do not affect the relative comparisons and the main conclusions.

4. Results

4.1. Comparative Evaluation with State-of-the-Art Methods

To assess the effectiveness and engineering relevance of the proposed crack segmentation framework, we compared it with representative semantic segmentation methods. To cover representative technical routes in current crack semantic segmentation while balancing the feasibility and fairness of unified reproduced experiments, this study selected Transformer-based Transunet [11] and Swin-unet [36], CNN-based ConvNeXtUNet [37], and state-space-modeling-based Mamba-unet [25] and Vm-unet [15] as the main comparison baselines. The objective of this study is to conduct a fair comparison of representative technical routes under a unified data-processing pipeline, training budget, and evaluation protocol. All baseline models were reproduced from publicly available implementations and were trained and evaluated under the same data processing pipeline and training protocol used for the proposed method. To ensure a fair comparison, no pretrained weights were used for any model. All parameters were optimized end to end from scratch. The input resolution was fixed at 512 × 512 for all methods, and the same augmentation suite and training budget were applied.
To reduce evaluation bias caused by annotation conventions and resolution differences across public sources, the public datasets were reorganized using the same preprocessing strategy as the composite dataset. All datasets were split into training, validation, and test sets with an 8:1:1 ratio, following a source-stratified protocol to maintain consistent domain distributions across splits.
Table 2 summarizes the quantitative results on the composite dataset. The proposed method achieves 80.11% mIoU and 82.05% Dice, while maintaining consistently high Precision and Recall. Compared with the strongest baseline on this dataset, the proposed model provides stable gains in both overlap-based metrics, indicating improved segmentation consistency under heterogeneous, multi-source data distributions. The improvements are most evident in challenging field conditions that involve texture clutter, shadows, specular highlights, and subtle low-contrast cracks. In these scenarios, the hybrid representation that combines CNN-based local detail modeling with Mamba state-space global modeling yields stronger cross-scale expressiveness and reduces noise-induced false positives. To further verify that the performance improvement on the composite dataset was not driven by only a small number of easy samples, a sample-level statistical significance analysis was conducted, and the results are shown in Table 3. On the test samples of the composite dataset, the sample-level standard deviations of mIoU for the proposed method, Transunet, and Vm-unet were 12.73%, 11.27%, and 12.75%, respectively, while the standard deviations of Dice were 22.32%, 24.05%, and 22.75%, respectively. This indicates that, on a multi-source and heterogeneous test set such as the composite dataset, where the difficulty varies substantially across samples, the segmentation difficulty indeed fluctuates considerably from sample to sample. The two-sided paired Wilcoxon signed-rank test showed that the sample-level p-values of the proposed method versus Transunet on both mIoU and Dice were far below 0.05, indicating that the improvement of the proposed method over Transunet is statistically significant; similarly, the improvement over Vm-unet is also statistically significant. Combined with the overall results in Table 2, these findings demonstrate that the performance advantage of the proposed method on the composite dataset is reflected not only in the aggregate statistics, but also in its stability at the test-sample level.
Table 2. Comparative results on the composite dataset.
Table 3. Sample-level dispersion and statistical significance analysis on the composite dataset.
Moreover, we report results on two independent public benchmarks (Crack500 and DeepCrack) under the same protocol, which helps reduce the risk that performance gains are specific to a particular annotation style of the composite dataset. The results are reported in Table 4 and Table 5. On Crack500, the proposed method achieves 77.76% mIoU and 77.96% Dice, with Precision of 75.78% and Recall of 80.70%. The proposed model ranks first or ties for the best among the compared methods, suggesting that enhanced multi-scale local detail modeling and long-range dependency learning better preserve the continuity of slender crack traces and reduce mis-segmentation caused by background textures. On DeepCrack, the proposed method achieves 80.87% mIoU and 87.29% Dice, with Precision of 88.45% and Recall of 85.79%. The higher mIoU and Dice, together with the strong Recall, indicate improved coverage of crack regions and a reduced risk of missed detections in complex backgrounds. Overall, the results across the composite dataset and public benchmarks demonstrate that the proposed framework improves accuracy and robustness under inspection-oriented conditions.
Table 4. Comparative results on the Crack500 dataset.
Table 5. Comparative results on the DeepCrack dataset.

4.2. Ablation Study

We performed an ablation study to quantify the contribution of each proposed module. Vm-unet served as the baseline, and three enhancements were progressively introduced. The Mamba Spatially Modulated Convolution block is denoted as A, the Reciprocal Co-modulation Attention block is denoted as B, and the Cross Interaction Fusion block is denoted as C. This yields eight configurations that enable a systematic assessment of individual and combined effects. All configurations followed the same experimental protocol as in Section 4.1, including identical data splits, training strategies, and evaluation criteria. Performance was assessed using mIoU, Dice, Precision, and Recall on the composite dataset, Crack500, and DeepCrack.
Table 6 reports the ablation results on the composite dataset. The baseline Vm-unet achieves 76.48% mIoU and 79.71% Dice, with 77.37% Precision and 80.98% Recall. Adding any single module improves performance. Introducing A increases mIoU to 78.31% and Recall to 82.64%, showing that coupling boundary-sensitive local representations with long-range dependency modeling reduces missed detections and improves crack separability in complex backgrounds. Introducing B raises mIoU to 77.74% and yields stable gains in both Precision and Recall, indicating that selective regulation of skip-connection transmission helps suppress redundant background responses and stabilizes cross-stage feature transfer. Introducing C increases Dice to 80.37% and Precision to 78.07%, while mIoU reaches 77.02%, suggesting that decoder-side cross-scale interaction primarily improves boundary fidelity and mask completeness. The results also indicate that stronger global–local coupling remains important for maximizing overlap-based accuracy.
Table 6. Ablation results on the composite dataset.
Combining two modules yields stronger complementarity. The A + C configuration achieves 79.62% mIoU and 82.01% Dice with Recall of 83.52%, showing that encoder-side representation enhancement and decoder-side cross-scale alignment jointly improve connectivity preservation and boundary recovery for slender cracks. The B + C configuration attains the highest Recall among two-module variants, reaching 83.69%, highlighting the role of selective skip modulation in reducing omissions when multi-scale fusion is strengthened. The full model A + B + C achieves the best overall performance, reaching 80.11% mIoU and 82.05% Dice, with Precision of 80.44% and Recall of 83.84%. This confirms the synergistic effect across modules and a balanced trade-off between false-positive suppression and missed-detection reduction.
Table 7 summarizes results on Crack500. The baseline achieves 74.72% mIoU and 74.77% Dice, with 72.64% Precision and 77.80% Recall. Module A provides the largest single-module improvement on this dataset, raising Dice to 76.09% and Recall to 78.75%, which supports its role in continuity preservation for thin crack traces. Modules B and C provide consistent gains with smaller magnitudes. Two-module combinations further improve performance. The A + C configuration reaches 77.23% mIoU and 77.35% Dice, and the A + B configuration reaches 77.19% mIoU and 77.27% Dice. The full model delivers the best results, achieving 77.76% mIoU and 77.96% Dice, and improving Precision and Recall to 75.78% and 80.70%. These results indicate that even when mIoU approaches saturation, the three-module design improves stability and reduces missed detections, which benefits inspection-oriented crack inventory updating.
Table 7. Ablation results on the Crack500 dataset.
Table 8 reports results on DeepCrack, where module-level effects are more pronounced. The baseline achieves 77.33% mIoU and 84.42% Dice, with 86.21% Precision and 82.52% Recall. Adding A increases mIoU to 79.44% and Dice to 86.30%, showing that joint local–global modeling is particularly effective when backgrounds are complex and crack boundaries are subtle. Module C improves Precision to 87.14% and Recall to 83.35%, consistent with its role in boundary restoration and completeness. Module B provides smaller but stable gains. Two-module combinations demonstrate strong complementarity. The A + B configuration achieves 79.55% mIoU and 87.10% Dice with Precision of 88.38% and Recall of 85.31%. The full model achieves the best performance across all metrics, reaching 80.87% mIoU and 87.29% Dice, with Precision of 88.45% and Recall of 85.79%. Overall, these results validate that local–global representation coupling, selective cross-stage modulation, and multi-scale interactive fusion jointly mitigate discontinuities, missed detections, and boundary ambiguity under challenging inspection conditions.
Table 8. Ablation results on the DeepCrack dataset.

4.3. Qualitative Results

Figure 5 compares representative segmentation results produced by the proposed method and the baseline models. The visual comparisons are consistent with the quantitative findings reported in Table 2. The proposed method more reliably preserves the continuity of slender crack traces, reconstructs more complete crack boundaries, and suppresses false positives induced by background textures and illumination artifacts. In scenarios that include shadows, stains, or crack-like joints, baseline methods tend to generate fragmented masks or introduce spurious responses in textured regions. The proposed model produces more coherent crack structures and clearer boundaries, indicating that the hybrid CNN–Mamba representation, together with selective skip regulation and cross-scale decoding interaction, improves robustness to common field interference factors.
Figure 5. Qualitative visual comparison of segmentation results on representative samples.
To further provide an intuitive analysis of the contribution of each module under complex heterogeneous conditions, we conduct a qualitative comparison of the visualization results obtained from different ablation configurations, as shown in Figure 6. Five representative challenging samples are selected to cover typical field factors, including texture interference on stone surfaces, background variations on building walls, as well as shadow occlusion, dry–wet differences, and irregular rock-wall textures. It can be observed that the baseline VMUNet is more prone to two types of failures in these scenarios: (i) discontinuities and missed detections for thin or low-contrast cracks, and (ii) false positives caused by misclassifying textures or stained regions as cracks. After introducing module A (MSMC), the continuity of thin cracks and boundary regions is improved, leading to more complete crack morphologies. With module B (RCA), the suppression of background interference becomes more pronounced, and false detections induced by wall stains and stone textures are markedly reduced. After incorporating module C (CIF), multi-scale semantic information and fine-grained details are fused more sufficiently, which helps enhance boundary stability and overall structural coherence of the segmented cracks. By integrating all three modules, the proposed method exhibits superior boundary continuity and stronger robustness against interference across the five challenging samples, maintaining more stable crack responses under shadows/specular reflections and contaminated backgrounds. These observations, together with the quantitative results, validate the complementarity of the proposed modules and the overall robustness of the framework.
Figure 6. Qualitative comparison of crack segmentation under different ablation configurations in complex heterogeneous scenes.
To verify that fixed-stride sliding-window inference does not introduce noticeable stitching artifacts under high-resolution inputs, we tested a high-resolution example and visualized the results in Figure 7. The original resolution of this example is 1422 × 1068. During inference, we adopt a sliding-window/tile-based strategy with a window size of 512 × 512 and a stride of 256, and fuse the probability maps in overlapping regions to obtain the full-image prediction. As can be observed, cracks, as thin and elongated structures, span a large area and cross multiple tiles, while the predicted mask maintains good connectivity and boundary consistency across the entire image, without periodic streaks, discontinuities, or seams caused by tile boundaries. Meanwhile, for non-crack distractors in the image, such as tree branches and lane markings, the model does not produce notable false positives, indicating that the proposed sliding-window fusion strategy is stable and practical in high-resolution scenarios.
Figure 7. Qualitative results of sliding-window full-image inference on high-resolution inputs.

4.4. Efficiency and Deployment-Oriented Results

In addition to segmentation accuracy, inspection-oriented deployment requires a favorable balance between computational cost and predictive performance. Table 9 compares the computational complexity of different methods under an input size of 512 × 512. To avoid discrepancies in complexity statistics caused by different implementation versions, all Params and FLOPs in Table 9 were re-profiled from the actually reproduced model instances in this study rather than directly copied from the original literature. For Transunet, the parameter scale may vary with the encoder configuration, decoder settings, number of classes, and implementation details. The specific Transunet configuration adopted in this study is R50-ViT-B_16. The proposed method requires 36.049 GFLOPs and 25.991 million parameters. Using Transunet [11] as an example of a relatively large model, the proposed approach reduces FLOPs and parameter count by approximately 86.1% and 72.1%, while retaining competitive accuracy on both the composite dataset and public benchmarks. These results indicate that the proposed CNN–Mamba hybrid design provides a more practical accuracy–efficiency trade-off for resource-constrained inspection workflows. In addition to GFLOPs and parameter sizes, we further report the inference throughput (FPS) under the same hardware/software environment described in Section 3.6.2, using an input size of 448 × 448, to enable a direct efficiency comparison among different methods. As shown in Table 9, the proposed method runs at 55.95 FPS (17.87 ms/image), which is faster than Transunet (28.35 FPS, 35.27 ms/image) and Vm-unet (28.38 FPS, 35.24 ms/image) under the same setting.
Table 9. Comparison of model computational complexity and inference speed.
Table 10 further reports the complexity of ablation configurations. Module A substantially reduces computational cost while improving representation capacity. VMUNet + A reaches 22.154 GFLOPs and 11.172 million parameters, and a similar low overhead is maintained for A + B. In contrast, introducing module C alone increases the computational burden, which suggests that stronger decoder-side interaction is most cost-effective when upstream features already provide sufficient discrimination. The A + C configuration achieves competitive accuracy with 36.048 GFLOPs and 25.990 million parameters, and the full model A + B + C maintains essentially the same complexity, reaching 36.049 GFLOPs and 25.991 million parameters. The baseline Vm-unet runs at 28.38 FPS (35.24 ms/image). Introducing the MSMC module (A) significantly improves throughput to 58.84 FPS, while adding the CIF module (C) increases computational burden and slightly reduces throughput (26.58 FPS). The full model (A + B + C) achieves 55.95 FPS, indicating that the proposed design improves deployment-oriented efficiency while maintaining accuracy gains. Compared with the baseline, the full configuration reduces FLOPs and parameters, while providing improved robustness and a more stable precision–recall trade-off across datasets. These findings support the practicality of the proposed architecture for deployment-constrained crack inspection scenarios.
Table 10. Computational complexity and inference speed comparison of the ablation variants.

5. Discussion

The results demonstrate that the proposed CNN–Mamba hybrid framework improves pixel-level crack segmentation under heterogeneous inspection conditions while maintaining an efficiency profile that is compatible with practical deployment. On the multi-source composite dataset, the proposed method achieves 80.11% mIoU and 82.05% Dice, together with balanced Precision and Recall. This balance is important for maintenance-oriented inspection workflows, because missed detections can underestimate deterioration severity and delay intervention, whereas excessive false positives increase manual verification effort and reduce the efficiency of defect database updates. The consistent improvements observed on both the composite dataset and public benchmarks indicate that the proposed design generalizes beyond a single texture distribution, which is essential for infrastructure assets characterized by diverse materials, aging patterns, and image acquisition conditions.
The ablation results provide a component-level interpretation of how the proposed modules address common failure modes in engineering imagery. The encoder-side CNN–Mamba coupling strengthens the representation of slender and discontinuous crack traces, which is reflected by the improved Recall when the MSMC module is introduced. This behavior is particularly relevant for early-stage deterioration, where cracks may be faint and partially occluded, and preserving weak crack evidence is necessary for reliable condition assessment. The reciprocal co-modulation attention mechanism enhances skip-connection transmission by suppressing background-dominant responses and refining cross-stage alignment, thereby reducing false positives induced by joints, stains, repetitive textures, and illumination artifacts. The decoder interaction fusion further improves cross-scale semantic consistency and boundary restoration, which benefits cases with strong scale variation and ambiguous boundaries. When integrated, these mechanisms become complementary rather than redundant, because continuity preservation, interference suppression, and boundary recovery must be achieved simultaneously to generate crack masks that are suitable for downstream quantitative evaluation.
From the perspective of integrating vision-based sensing into inspection workflows, computational controllability is as critical as segmentation accuracy. The proposed model requires 36.049 GFLOPs and 25.991 million parameters, offering a favorable accuracy–efficiency trade-off compared with heavier attention-based alternatives. This efficiency supports suitable for GPU/NPU-assisted edge platforms, vehicle-mounted systems, and unmanned inspection platforms where inference latency and hardware limitations often determine the feasibility of on-site processing. Moreover, the stable performance across heterogeneous data sources suggests that the framework can better accommodate realistic variability in surface appearance, lighting, and contamination, which is a prerequisite for scalable adoption in routine inspections.
Several limitations point to directions for future work. First, the segmentation masks should be coupled with metrology procedures that convert pixel-level outputs into crack geometry descriptors such as length, connectivity, and width proxies, and these measurements should be validated against field observations. Second, decision reliability could be improved by incorporating temporal consistency across inspection sequences and by quantifying prediction uncertainty, especially when crack evidence is weak or surfaces are highly contaminated. Third, extending the framework to multi-defect assessment that includes spalling, exposed aggregate, and efflorescence would improve its applicability to comprehensive condition evaluation and maintenance planning in practical asset management.
In addition, regarding geometric quantification after crack segmentation, the binary crack masks produced by our method provide a direct foundation for subsequent engineering metrology. Crack length can be estimated by skeletonizing the mask and summing the skeleton pixels, and can then be converted into physical units when camera calibration or a scale reference is available. Crack width can also be derived from the mask by combining distance transform-based estimation or normal cross-sectional measurements, where local width distributions are sampled along the skeleton to yield quantitative indicators for damage assessment. It should be emphasized that crack depth cannot be reliably obtained solely from 2D segmentation results on monocular RGB images, because depth information is inherently constrained by 3D geometry and imaging scale and therefore requires additional sensing or multi-view support, such as stereo vision, structured-light/ToF depth cameras, laser scanning, or 3D measurement pipelines based on multi-view reconstruction. Nevertheless, the high-quality crack segmentation provided in this work can substantially facilitate depth-related inspection pipelines by serving as a stable region of interest (ROI) and a geometric prior, which constrains the search space for cracks in 3D reconstruction or depth-sensing data, reduces background interference and mismatching risks, and improves the stability and repeatability of subsequent depth estimation and geometric measurements. Therefore, integrating the proposed segmentation framework with practical 3D perception modalities to enable multi-dimensional quantitative evaluation of crack length/width/depth constitutes a meaningful direction for future research.

6. Conclusions

Crack segmentation for civil infrastructure remains challenging in practical inspections because cracks are often slender and discontinuous, exhibit strong scale variation, and are easily confused with background textures and illumination artifacts. This study presented a lightweight CNN–Mamba hybrid semantic segmentation network for vision-based crack mapping in heterogeneous field conditions. The main contributions of this work can be summarized as follows:
(1) We propose a crack semantic segmentation framework for infrastructure maintenance scenarios, integrating the local boundary representation of CNNs with the long-range dependency modeling capability of Mamba to produce more robust pixel-level crack maps under complex backgrounds and heterogeneous inspection conditions.
(2) We design a Mamba spatially modulated convolution module, which fuses parallel CNN and Mamba branches via spatial modulation, thereby enhancing boundary sensitivity for thin cracks and improving global-context discrimination.
(3) We propose a reciprocal co-modulation attention module to enhance selective skip-connection transmission via spatial suppression and alignment refinement, reducing false positives caused by joints, stains, and repetitive textures, thereby lowering the manual verification burden in practical inspection workflows.
(4) We design a cross-interaction fusion module to strengthen cross-scale semantic consistency and boundary recovery during decoding.
Experiments on a multi-source composite dataset and two public benchmarks validate the effectiveness and generalization of the proposed method. The model achieves 80.11% mIoU and 82.05% Dice on the composite dataset and delivers consistently strong performance on Crack500 and DeepCrack, indicating improved robustness to complex backgrounds and subtle crack patterns. The ablation study confirms that the three modules contribute complementary gains, and the complexity analysis shows a favorable accuracy–efficiency profile with 36.049 GFLOPs and 25.991 million parameters at an input resolution of 512 × 512, supporting deployment under resource-constrained inspection scenarios.
Future work will focus on strengthening inspection relevance by linking segmentation outputs to quantitative crack descriptors and by conducting deployment-oriented evaluations that include latency and throughput under realistic sensing conditions.

Author Contributions

Conceptualization, Y.H.; methodology, Y.H. and J.G.; validation, J.W.; formal analysis, C.Y.; investigation, Y.C.; resources, L.C.; data curation, Y.H.; writing—original draft preparation, J.G.; writing—review and editing, Y.H.; visualization, J.W.; supervision, L.C.; project administration, Y.H.; funding acquisition, L.C. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by Open Research Fund of Anhui Provincial Key Laboratory of Building Earthquake Disaster Mitigation and Green Operations, Anhui Institute of Building Research & Design, Grant NO. 2024-JKYL-001.

Data Availability Statement

The data that support the findings of this study are available from the corresponding author upon reasonable request.

Conflicts of Interest

Author Jinfu Guan is employed by the company Global Safety Tanzer Technology Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Cha, Y.J.; Choi, W.; Büyüköztürk, O. Deep learning-based crack damage detection using convolutional neural networks. Comput.-Aided Civ. Infrastruct. Eng. 2017, 32, 361–378. [Google Scholar] [CrossRef] [Scilit]
  2. Wu, Z.; Tang, Y.; Hong, B.; Liang, B.; Liu, Y. Enhanced precision in Dam Crack width measurement: Leveraging advanced lightweight network identification for pixel-level accuracy. Int. J. Intell. Syst. 2023, 2023, 9940881. [Google Scholar] [CrossRef] [Scilit]
  3. Shi, Y.; Cui, L.; Qi, Z.; Meng, F.; Chen, Z. Automatic road crack detection using random structured forests. IEEE Trans. Intell. Transp. Syst. 2016, 17, 3434–3445. [Google Scholar] [CrossRef] [Scilit]
  4. Zou, Q.; Cao, Y.; Li, Q.; Mao, Q.; Wang, S. CrackTree: Automatic crack detection from pavement images. Pattern Recognit. Lett. 2012, 33, 227–238. [Google Scholar] [CrossRef] [Scilit]
  5. Yamaguchi, T.; Hashimoto, S. Fast crack detection method for large-size concrete surface images using percolation-based image processing. Mach. Vis. Appl. 2010, 21, 797–809. [Google Scholar] [CrossRef] [Scilit]
  6. Oliveira, H.; Correia, P.L. Automatic road crack detection and characterization. IEEE Trans. Intell. Transp. Syst. 2012, 14, 155–168. [Google Scholar] [CrossRef] [Scilit]
  7. Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer International Publishing: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
  8. Badrinarayanan, V.; Kendall, A.; Cipolla, R. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE Trans. Pattern Anal. Mach. Intell. 2017, 39, 2481–2495. [Google Scholar] [CrossRef] [Scilit]
  9. Liu, Y.; Yao, J.; Lu, X.; Xie, R.; Li, L. DeepCrack: A deep hierarchical feature learning architecture for crack segmentation. Neurocomputing 2019, 338, 139–153. [Google Scholar] [CrossRef] [Scilit]
  10. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada, 10–17 October 2021; pp. 10012–10022. [Google Scholar]
  11. Chen, J.; Lu, Y.; Yu, Q.; Luo, X.; Adeli, E.; Wang, Y.; Lu, L.; Yuille, A.L.; Zhou, Y. Transunet: Transformers make strong encoders for medical image segmentation. arXiv 2021, arXiv:2102.04306. [Google Scholar] [CrossRef] [Scilit]
  12. Mehta, S.; Rastegari, M. Mobilevit: Light-weight, general-purpose, and mobile-friendly vision transformer. arXiv 2021, arXiv:2110.02178. [Google Scholar]
  13. Maaz, M.; Shaker, A.; Cholakkal, H.; Khan, S.; Zamir, S.W.; Anwer, R.M.; Shahbaz Khan, F. Edgenext: Efficiently amalgamated cnn-transformer architecture for mobile vision applications. In Proceedings of the European Conference on Computer Vision; Springer Nature: Cham, Switzerland, 2022; pp. 3–20. [Google Scholar]
  14. Gu, A.; Dao, T. Mamba: Linear-time sequence modeling with selective state spaces. In Proceedings of the First Conference on Language Modeling (COLM), Philadelphia, PA, USA, 7–9 October 2024; Available online: https://openreview.net/ (accessed on 14 January 2026).
  15. Ruan, J.; Li, J.; Xiang, S. Vm-unet: Vision mamba unet for medical image segmentation. ACM Trans. Multimed. Comput. Commun. Appl. 2025. [Google Scholar] [CrossRef] [Scilit]
  16. Zhou, Z.; Siddiquee, M.M.R.; Tajbakhsh, N.; Liang, J. Unet++: Redesigning skip connections to exploit multiscale features in image segmentation. IEEE Trans. Med. Imaging 2019, 39, 1856–1867. [Google Scholar] [CrossRef] [Scilit]
  17. Jha, D.; Riegler, M.A.; Johansen, D.; Halvorsen, P.; Johansen, H.D. Doubleu-net: A deep convolutional neural network for medical image segmentation. In Proceedings of the 2020 IEEE 33rd International Symposium on Computer-Based Medical Systems (CBMS), Rochester, MN, USA, 28–30 July 2020; IEEE: New York, NY, USA, 2020. [Google Scholar]
  18. Zunair, H.; Ben Hamza, A. Sharp U-Net: Depthwise convolutional network for biomedical image segmentation. Comput. Biol. Med. 2021, 136, 104699. [Google Scholar] [CrossRef] [Scilit]
  19. Zhang, Z.; Liu, Q.; Wang, Y. Road extraction by deep residual u-net. IEEE Geosci. Remote Sens. Lett. 2018, 15, 749–753. [Google Scholar] [CrossRef] [Scilit]
  20. Maruthi, M.; Lee, D.E. Enhancement of concrete crack detection using U-Net. In Proceedings of the International Conference on Construction Engineering and Project Management; Korea Institute of Construction Engineering and Management: Seoul, Republic of Korea, 2024. [Google Scholar]
  21. Liu, Z.; Cao, Y.; Wang, Y.; Wang, W. Computer vision-based concrete crack detection using U-net fully convolutional networks. Autom. Constr. 2019, 104, 129–139. [Google Scholar] [CrossRef] [Scilit]
  22. Lin, F.; Yang, J.; Shu, J.; Scherer, R.J. Crack semantic segmentation using the U-Net with full attention strategy. arXiv 2021, arXiv:2104.14586. [Google Scholar] [CrossRef] [Scilit]
  23. Zhang, Z.; He, Y.; Hu, D.; Jin, Q.; Zhou, M.; Liu, Z.; Chen, H.; Wang, H.; Xiang, X. Algorithm for pixel-level concrete pavement crack segmentation based on an improved U-Net model. Sci. Rep. 2025, 15, 6553. [Google Scholar] [CrossRef] [Scilit]
  24. Zhu, L.; Liao, B.; Zhang, Q.; Wang, X.; Liu, W.; Wang, X. Vision mamba: Efficient visual representation learning with bidirectional state space model. arXiv 2024, arXiv:2401.09417. [Google Scholar] [CrossRef] [Scilit]
  25. Wang, Z.; Zheng, J.Q.; Zhang, Y.; Cui, G.; Li, L. Mamba-unet: Unet-like pure visual mamba for medical image segmentation. arXiv 2024, arXiv:2402.05079. [Google Scholar]
  26. Zhu, E.; Chen, Z.; Wang, D.; Shi, H.; Liu, X.; Wang, L. Unetmamba: An efficient unet-like mamba for semantic segmentation of high-resolution remote sensing images. IEEE Geosci. Remote Sens. Lett. 2024, 22, 6001205. [Google Scholar] [CrossRef] [Scilit]
  27. Liu, J.; Yang, H.; Zhou, H.-Y.; Xi, Y.; Yu, L.; Li, C.; Liang, Y.; Shi, G.; Yu, Y.; Zhang, S.; et al. Swin-umamba: Mamba-based unet with imagenet-based pretraining. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention; Springer Nature: Cham, Switzerland, 2024. [Google Scholar]
  28. Cammarasana, S.; Patanè, G. Optimal Weighted Convolution for Classification and Denosing. arXiv 2025, arXiv:2505.24558. [Google Scholar] [CrossRef] [Scilit]
  29. Ma, W.; Chen, C.; Ma, M.; Zhang, H.; Zhu, H.; Jiao, L. An adaptive dual-supervised cross-deep dependency network for pixel-wise classification. IEEE Trans. Geosci. Remote Sens. 2025, 63, 4402713. [Google Scholar] [CrossRef] [Scilit]
  30. Zhao, J.; Zhang, M.; Zhou, Z.; Wang, Z.; Lang, F.; Shi, H.; Zheng, N. CFFormer: A Cross-Fusion Transformer Framework for the Semantic Segmentation of Multi-Source Remote Sensing Images. IEEE Trans. Geosci. Remote Sens. 2024, 63, 4401117. [Google Scholar] [CrossRef] [Scilit]
  31. Stricker, R.; Aganian, D.; Sesselmann, M.; Seichter, D.; Engelhardt, M.; Spielhofer, R.; Hahn, M.; Hautz, A.; Debes, K.; Gross, H.-M. Road surface segmentation-pixel-perfect distress and object detection for road assessment. In Proceedings of the 2021 IEEE 17th International Conference on Automation Science and Engineering (CASE); IEEE: New York, NY, USA, 2021; pp. 1789–1796. [Google Scholar]
  32. Dorafshan, S.; Thomas, R.J.; Maguire, M. SDNET2018: An annotated image dataset for non-contact concrete crack detection using deep convolutional neural networks. Data Brief 2018, 21, 1664–1668. [Google Scholar] [CrossRef] [Scilit]
  33. Kulkarni, S.; Singh, S.; Balakrishnan, D.; Sharma, S.; Devunuri, S.; Korlapati, S.C.R. CrackSeg9k: A collection and benchmark for crack segmentation datasets and frameworks. In Proceedings of the European Conference on Computer Vision; Springer Nature: Cham, Switzerland, 2022; pp. 179–195. [Google Scholar]
  34. Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
  35. Al-Shamayleh, A.S.; Qatawneh, M.; Elsalamony, H.A. Advanced Retinal Lesion Segmentation via U-Net with Hybrid Focal–Dice Loss and Automated Ground Truth Generation. Algorithms 2025, 18, 790. [Google Scholar] [CrossRef] [Scilit]
  36. Cao, H.; Wang, Y.; Chen, J.; Jiang, D.; Zhang, X.; Tian, Q.; Wang, M. Swin-unet: Unet-like pure transformer for medical image segmentation. In Proceedings of the European Conference on Computer Vision; Springer Nature: Cham, Switzerland, 2022; pp. 205–218. [Google Scholar]
  37. Zhang, H.; Cai, Z. ConvNextUNet: A small-region attentioned model for cardiac MRI segmentation. Comput. Biol. Med. 2024, 177, 108592. [Google Scholar] [CrossRef] [Scilit] [PubMed]
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.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.