Crack segmentation method and system based on dynamic receptive field and multi-scale semantic aggregation

By combining the dynamic snake-shaped Mamba module and the multi-scale semantic aggregation module, the problem of insufficient accuracy of crack segmentation in complex backgrounds is solved, high-precision detection of small cracks and background noise suppression are achieved, and the overall performance of crack segmentation is improved.

CN120707861APending Publication Date: 2025-09-26SOUTHWEST JIAOTONG UNIV
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202510888968.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing crack segmentation technologies have difficulty effectively distinguishing real cracks from background noise in complex backgrounds. Especially in low-contrast or cluttered backgrounds, traditional methods have difficulty accurately identifying small and irregular cracks, resulting in insufficient detection accuracy.

Method used

The dynamic snake-shaped Mamba module (DSM) is combined with the multi-scale semantic aggregation module (MSA) to dynamically adjust the convolution kernel shape to adapt to the geometric changes of cracks, capture local details and global structural features, and establish the interactive relationship between local details and global semantics through the multi-scale semantic aggregation module. The parallel supervised attention mechanism is used to suppress background noise interference.

Benefits of technology

High-precision detection of tiny cracks is achieved in complex environments, which significantly improves the accuracy and robustness of crack segmentation and reduces the occurrence of mis-segmentation and missed segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707861A_ABST
    Figure CN120707861A_ABST
Patent Text Reader

Abstract

The invention discloses a crack segmentation method and system based on a dynamic receptive field and multi-scale semantic aggregation, and relates to the technical field of computer vision. The method comprises the following steps: inputting a crack image, and simultaneously capturing local details and global structural features of a crack through a dynamic snakelike Mama module: dynamically adjusting the shape of a convolution kernel to adapt to the geometric change of the crack, inputting the obtained features into a spatial pyramid pooling layer to extract multi-scale context information, and outputting feature representation fused with a long-range dependency relationship; based on the feature representation fused with the long-range dependency relationship, an interaction relationship between local details and global semantics is established through a multi-scale semantic aggregation module, background noise interference is suppressed through a parallel supervision attention mechanism, and a pixel-level crack segmentation result is generated through a lightweight segmentation head. According to the method, fine cracks can be segmented more accurately in a complex background environment, and meanwhile, the conditions of wrong segmentation and missing segmentation are effectively relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a crack segmentation method and system based on dynamic receptive field and multi-scale semantic aggregation. Background Art

[0002] With the rapid development of automated data collection technology, intelligent devices such as quadruped robots and drones are gradually replacing traditional manual photography and becoming essential tools for the maintenance and operation of infrastructure such as roads and tunnels. In this context, crack segmentation technology, a key component of infrastructure health monitoring, is becoming increasingly important. This technology aims to accurately identify cracked areas on building surfaces, providing a reliable basis for subsequent damage assessment and maintenance decisions.

[0003] However, in practical applications, complex environmental factors such as stains, signs of aging, and traces of artificial decoration or repair on building surfaces pose significant challenges to crack segmentation. These interfering factors not only closely resemble real cracks in visual characteristics but also significantly increase the difficulty of segmenting small and irregular cracks. Traditional methods often struggle to effectively distinguish real cracks from background noise, especially in low-contrast or cluttered backgrounds, resulting in detection accuracy that fails to meet practical engineering requirements.

[0004] In recent years, the rapid development of computer vision technology has provided a variety of solutions for the crack segmentation task. Common methods such as Mask R-CNN achieve pixel-level crack localization through a feature pyramid architecture. U-Net, with its symmetric encoder-decoder structure and skip connections, excels at multi-scale feature fusion. The DeepLab series significantly improves the segmentation accuracy of irregular crack boundaries through dilated convolution and spatial pyramid pooling.

[0005] To address the unique geometric complexity and background interference of cracks, a series of specialized architectures have emerged: DeepCrack improves edge localization accuracy through multi-level feature aggregation, CrackSegU adopts a multi-stage fusion strategy to reduce detection blind spots, and VM-UNet++ leverages Mamba's selective scanning mechanism to better capture local features. After the Transformer and Mamba architectures were extended from natural language processing to vision tasks, Vision Transformer achieved breakthroughs through global context modeling, while Vision Mamba introduced state-space modeling to the vision domain. Recent research such as SwinTransformer and SegFormer demonstrates the advantages of multi-scale feature representation in crack segmentation, while specialized frameworks such as CrackMamba significantly improve recognition accuracy through innovative module designs.

[0006] However, most existing methods focus on global structure representation and are still insufficient in handling local geometric changes. Summary of the Invention

[0007] To address the above problems, the present invention proposes a crack segmentation method and system based on dynamic receptive field and multi-scale semantic aggregation. The dynamic snake-shaped Mamba module is used to establish long-range pixel associations while maintaining local geometric details. Combined with the multi-scale semantic aggregation module, parallel supervised multi-layer feature fusion is realized, achieving a double breakthrough in the accuracy and robustness of tiny crack detection in complex environments.

[0008] The technical solution adopted in the present invention is as follows: A crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation, including: The dynamic snake-shaped Mamba module takes a crack image as input and simultaneously captures both local details and global structural features of the crack. The convolution kernel shape is dynamically adjusted to adapt to geometric changes in the crack. The resulting features are then fed into a spatial pyramid pooling layer to extract multi-scale contextual information, and the output is a feature representation that integrates long-range dependencies. Based on the feature representation of fused long-range dependencies, the interactive relationship between local details and global semantics is established through a multi-scale semantic aggregation module, background noise interference is suppressed through a parallel supervised attention mechanism, and pixel-level crack segmentation results are generated through a lightweight segmentation head.

[0009] Furthermore, the dynamic snake-shaped Mamba module includes: A global feature extraction submodule, configured to extract global features of the crack image; a detail feature extraction submodule, configured to extract detail features of the crack image; The dynamic modeling submodule is configured to combine the detailed features of the cracks with the global features to model the spatial topology information and learn the fine-grained detailed information and long-range dependencies of the cracks.

[0010] Furthermore, in the global feature extraction submodule, the global features of the crack image are extracted, including: capturing the multi-scale global structural features of the crack based on the spatial pyramid pooling layer, and extracting feature information with different receptive fields through the hollow convolution kernels with different expansion rates.

[0011] Furthermore, in the detail feature extraction submodule, the detail features of the crack image are extracted, including: adaptively capturing the local geometric changes and directional changes of the crack through a deformable convolution unit; by dynamically adjusting the shape of the convolution kernel, the deformable convolution unit can capture local features along the crack trajectory, thereby enhancing the ability to characterize the crack details.

[0012] Furthermore, the method of adaptively capturing local geometric changes and directional changes of the crack by the deformable convolution unit includes: the deformable convolution unit applies adaptive filters in the X and Y directions to generate local geometric features to adapt to the changing direction and shape of the crack.

[0013] Furthermore, in the dynamic modeling submodule, the detailed features of the cracks are combined with the global features to model spatial topological information, and the fine-grained detailed information and long-range dependencies of the cracks are learned, including: modeling the long-range dependencies between features through a Mamba mixer, and the Mamba mixer captures the long-range spatial dependencies at the pixel level through unidirectional linear scanning.

[0014] Furthermore, the long-range dependency relationship between features modeled by the Mamba mixer includes: fusing the detailed features of the crack with the global features, converting the fused features into a one-dimensional sequence through a windowing operation, and using a one-dimensional standard convolution for feature extraction; performing a unidirectional scan through a state space model scanning branch to capture long-range dependencies, while providing additional feature comparison information through a comparison branch; the two branches are mapped back to the original dimension through the SiLU activation function, channel splicing operation and linear mapping to obtain the final output features.

[0015] Furthermore, the multi-scale semantic aggregation module includes a feature fusion sub-module with a spatial and channel dual attention mechanism. The feature fusion sub-module is configured to perform a collaborative representation of local crack geometric features and global topological structures in combination with a multi-layer fusion strategy, including: refining the aggregated deep features and shallow features with detail compensation respectively, and then performing secondary fusion to obtain the final multi-scale aggregation features.

[0016] Furthermore, the parallel supervised attention mechanism is used to suppress background noise interference, including: applying independent supervision to high-level semantic features and low-level detail features after multi-scale fusion, and expanding foreground supervision by introducing additional background supervision signals; the overall loss function includes binary cross entropy loss, Dice loss, weighted cross entropy loss and boundary-aware loss.

[0017] A crack segmentation system based on dynamic receptive field and multi-scale semantic aggregation, including: The dynamic snake-shaped Mamba module is configured to simultaneously capture local details and global structural features of cracks in crack images. It dynamically adjusts the shape of the convolution kernel to adapt to geometric changes in the cracks, inputs the obtained features into the spatial pyramid pooling layer to extract multi-scale contextual information, and outputs a feature representation that integrates long-range dependencies. The multi-scale semantic aggregation module is configured to establish an interactive relationship between local details and global semantics based on the fusion of long-range dependency feature representations, suppress background noise interference through a parallel supervised attention mechanism, and generate pixel-level crack segmentation results through a lightweight segmentation head.

[0018] The beneficial effects of the present invention are: 1. To address the difficulty in segmenting fine cracks, this paper proposes a dynamic serpentine Mamba (DSM) module. Through a multi-scale void space pyramid and dynamic serpentine convolution technology, it achieves collaborative modeling of the global structural characteristics and local geometric details of the cracks, and uses a linear scanning mechanism to establish long-range spatial correlations to complete the complete structural reconstruction of fine cracks.

[0019] 2. To address the complex background problem, this paper proposes a multi-scale semantic aggregation (MSA) module, which adopts a parallel strategy of supervision and attention fusion to model the interactive relationship between local crack details and global scene semantics, effectively suppressing background noise interference and improving feature discrimination capabilities in complex scenes. 3. By introducing a hybrid loss function, the present invention alleviates the situation where non-target content such as background texture and dirt is mistakenly judged as cracks, effectively improving the accuracy of crack segmentation.

[0020] In summary, the present invention can segment small cracks more accurately in a complex background environment, while effectively alleviating the problems of mis-segmentation and missed segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a schematic diagram of a crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to embodiment 3 of the present invention.

[0022] Figure 2 This is a schematic diagram of the dynamic snake-shaped Mamba module of Example 3 of the present invention.

[0023] Figure 3 This is a schematic diagram of the multi-scale semantic aggregation module of Example 3 of the present invention. DETAILED DESCRIPTION

[0024] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, the specific embodiments of the present invention are now described. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. That is, the embodiments described are only part of the embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.

[0025] Example 1 This embodiment provides a crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation, including: The dynamic snake-shaped Mamba module takes a crack image as input and simultaneously captures both local details and global structural features of the crack. The convolution kernel shape is dynamically adjusted to adapt to geometric changes in the crack. The resulting features are then fed into a spatial pyramid pooling layer to extract multi-scale contextual information, and the output is a feature representation that integrates long-range dependencies. Based on the feature representation of fused long-range dependencies, the interactive relationship between local details and global semantics is established through a multi-scale semantic aggregation module, background noise interference is suppressed through a parallel supervised attention mechanism, and pixel-level crack segmentation results are generated through a lightweight segmentation head.

[0026] It should be noted that existing technologies primarily rely on convolutional neural networks or Transformers for crack segmentation. However, due to the elongated, branching distribution of cracks, traditional methods struggle to effectively model their long-range spatial dependencies and are prone to missegmentation in the presence of complex background interference. To address the issues of irregular crack morphology and background noise, this embodiment proposes the Multi-Scale Detail-Aware Mamba framework (MD-Mamba). This innovatively combines dynamic structure modeling with multi-scale semantic reasoning. Through a bidirectional feature fusion mechanism, it enhances the model's perception of the crack's global topology and local details, significantly improving segmentation accuracy in complex scenarios.

[0027] Because traditional convolution operations are limited by a fixed receptive field, they struggle to adapt to the geometric deformation characteristics of cracks. To address the problem of easily lost local crack details, this embodiment designs a dynamic snake-shaped Mamba module (DSM). By introducing a linear scanning mechanism guided by deformable convolutions, this module dynamically adjusts the receptive field along the crack trajectory. Combined with a spatial pyramid pooling layer, it enhances adaptability to irregular crack shapes, enabling collaborative modeling from pixel-level local details to long-range spatial correlations, completing the complete structural reconstruction of tiny cracks.

[0028] Furthermore, existing technologies often use single-scale feature processing to suppress background noise, resulting in over-filtering of small crack features. To address the issue of complex background interference, this embodiment proposes a multi-scale semantic aggregation module (MSA) and a hierarchical attention fusion strategy. This uses a parallel supervision mechanism to explicitly model the interaction between local crack details and global semantics. It then uses context-guided weight allocation to achieve multi-scale feature complementarity, effectively reducing the impact of background interference on segmentation results.

[0029] Preferably, the dynamic snake Mamba module includes: A global feature extraction submodule, configured to extract global features of the crack image; a detail feature extraction submodule, configured to extract detail features of the crack image; The dynamic modeling submodule is configured to combine the detailed features of the cracks with the global features to model the spatial topology information and learn the fine-grained detailed information and long-range dependencies of the cracks.

[0030] Preferably, in the global feature extraction submodule, the global features of the crack image are extracted, including: capturing the multi-scale global structural features of the crack based on the spatial pyramid pooling layer, and extracting feature information with different receptive fields through the hollow convolution kernels with different expansion rates.

[0031] Preferably, in the detail feature extraction submodule, the detail features of the crack image are extracted, including: adaptively capturing the local geometric changes and directional changes of the crack through a deformable convolution unit; by dynamically adjusting the shape of the convolution kernel, the deformable convolution unit can capture local features along the crack trajectory, thereby enhancing the ability to characterize the crack details.

[0032] Preferably, the local geometric changes and direction changes of the crack are adaptively captured by the deformable convolution unit, including: the deformable convolution unit applies adaptive filters in the X and Y directions to generate local geometric features to adapt to the changing direction and shape of the crack.

[0033] Preferably, in the dynamic modeling submodule, the detailed features of the cracks are combined with the global features to model the spatial topological information, and the fine-grained detailed information and long-range dependencies of the cracks are learned, including: modeling the long-range dependencies between features through the Mamba mixer, and the Mamba mixer captures the long-range spatial dependencies at the pixel level through unidirectional linear scanning.

[0034] Preferably, the long-range dependency between features is modeled by the Mamba mixer, including: fusing the detail features and global features of the crack, converting the fused features into a one-dimensional sequence through a windowing operation, and using a one-dimensional standard convolution for feature extraction; performing a unidirectional scan through a state space model scanning branch to capture long-range dependencies, and providing additional feature comparison information through a comparison branch; the two branches are mapped back to the original dimension through a SiLU activation function, a channel splicing operation, and a linear mapping to obtain the final output features.

[0035] Preferably, the multi-scale semantic aggregation module includes a feature fusion submodule with a spatial and channel dual attention mechanism. The feature fusion submodule is configured to perform a collaborative representation of local crack geometric features and global topological structures in combination with a multi-layer fusion strategy, including: refining the aggregated deep features and the shallow features with detail compensation respectively, and then performing secondary fusion to obtain the final multi-scale aggregated features.

[0036] Preferably, background noise interference is suppressed through a parallel supervised attention mechanism, including: applying independent supervision to high-level semantic features and low-level detail features after multi-scale fusion, and expanding foreground supervision by introducing additional background supervision signals; the overall loss function includes binary cross entropy loss, Dice loss, weighted cross entropy loss and boundary perception loss.

[0037] In summary, the crack segmentation method of this embodiment has the following characteristics: 1. Crack segmentation based on dynamic receptive field and multi-scale semantic aggregation. To address key issues faced by crack detection in industrial scenarios, such as complex background interference and missed detection of fine cracks, this method uses the DSM module to extract multi-scale crack features and model their geometric structure. Combined with the MSA module, it performs multi-level feature fusion and optimization, and employs a hybrid loss function for end-to-end training. This network architecture adaptively captures local geometric features of cracks through dynamic snake-like convolution in the feature extraction stage. In the feature fusion stage, it utilizes an attention mechanism to enhance effective feature representation. Finally, multi-level supervision is used in the output stage to improve model robustness.

[0038] 2. The Dynamic Snake Mamba Module (DSM) is used to collaboratively model the global structure and local geometric features of cracks. Because cracks in complex scenes are often obscured by pseudo-crack features such as surface patterns and repair marks, traditional methods struggle to accurately distinguish real cracks from background noise. This method extracts global structural features using a multi-scale atrous spatial pyramid (ASPP), combines it with dynamic snake convolution (DSConv) to capture local geometric changes along the crack trajectory, and uses Mamba linear scanning to establish long-range spatial dependencies. This effectively addresses the problem of incomplete crack feature extraction in complex backgrounds.

[0039] 3. A multi-scale semantic aggregation module (MSA) based on multi-level supervision achieves feature optimization and noise suppression. To address the background noise interference problem in crack images in industrial scenarios, this method uses a dual-path feature processing architecture to hierarchically fuse deep features enhanced by DSM with shallow features compensated for detail. A multi-level supervision mechanism is constructed by combining boundary-aware loss, Dice loss, weighted cross-entropy loss, and binary cross-entropy loss. This significantly improves the model's ability to identify fine cracks and its anti-interference performance.

[0040] Example 2 This embodiment is based on embodiment 1: This example provides a crack segmentation method based on dynamic receptive fields and multi-scale semantic aggregation. Given a crack image, a multi-scale feature fusion network is used for feature extraction and segmentation. This method is implemented primarily through two core modules: the Dynamic Snake Mamba module (DSM) and the Multi-scale Semantic Aggregation module (MSA). Supervised training is performed using a hybrid loss function.

[0041] Preferably, the crack segmentation method of this embodiment includes the following steps: During the feature extraction phase, the Dynamic Snake Mamba Module (DSM) is used to simultaneously capture local details and global structural features of the cracks. Furthermore, the Dynamic Snake Convolution (DSConv) unit dynamically adjusts the convolution kernel shape to adapt to the geometric changes of the cracks. This feature is then fed into the Spatial Pyramid Pooling (ASPP) layer to extract multi-scale contextual information and output a feature representation that incorporates long-range dependencies.

[0042] A multi-scale semantic aggregation module (MSA) is used to establish the interactive relationship between local details and global semantics. A parallel supervised attention mechanism suppresses background noise interference and enhances the ability to retain small crack features. Finally, a lightweight segmentation head is used to generate pixel-level segmentation results, improving segmentation accuracy while maintaining the integrity of crack morphology.

[0043] Specifically, the dynamic snake-shaped Mamba module, multi-scale semantic aggregation module, and hybrid loss function of this embodiment are described as follows.

[0044] 1. Dynamic Snake Mamba Module (DSM) Considering that cracks are irregular in distribution and appearance, their physical formation mechanism gives them spatial continuity, and even fragmented crack segments often show directional correlation with adjacent areas along the propagation path.

[0045] To address this issue, this embodiment designs a dynamic snake-like Mamba module (DSM). By jointly modeling long-range and short-range dependencies, it simultaneously captures the global structural characteristics and local geometric details of the crack. The DSM module consists of three core components: a global feature extraction submodule (GFA), a detailed feature extraction submodule (DFA), and a dynamic modeling submodule (DMM). Through the collaborative work of these components, the DSM module effectively models both global and local crack characteristics.

[0046] 1. Global Feature Extraction Submodule (GFA) To extract global features from crack images, a global feature extraction submodule (GFA) was designed. Specifically, FGA employs a spatial pyramid pooling layer (ASPP) to capture the multi-scale global structural features of cracks. Using dilated convolution kernels with different dilation rates, it extracts feature information with different receptive fields, thereby enhancing the model's ability to represent diverse crack morphologies.

[0047] Specifically, the Spatial Pyramid Pooling (ASPP) layer can use dilated convolution operations with dilation rates of [1, 6, 12, 18] to ensure that global features are extracted while retaining fine-grained details. Convolution kernels with a dilation rate of 1 are particularly useful for capturing subtle structural features.

[0048] The spatial pyramid pooling layer (ASPP) is used to pool the input features. Perform operations to generate multi-scale global features , which is expressed as follows:

[0049] Where, Represents a multi-scale dilated convolution operation, which operates in parallel with convolution kernels of different dilation rates, and finally fuses multi-scale features to enhance the representation ability of global features.

[0050] 2. Detail Feature Extraction Submodule (DFA) To detect the detailed features of cracks, a detail feature extraction submodule, DFA, was designed. Specifically, DFA employs a dynamic snake convolution (DSConv) unit to adaptively capture local geometric and directional changes in cracks. By dynamically adjusting the shape of the convolution kernel, the DSConv unit accurately captures local features along the crack trajectory, thereby enhancing the model's ability to characterize crack details.

[0051] Preferably, the dynamic snake convolution (DSConv) unit applies adaptive filters in both the X and Y directions. and , generate local geometric features and , its operation is expressed as:

[0052] Where, The DSConv module represents a dynamic snake-shaped convolution operation, which dynamically adjusts the convolution kernel shape to adapt to the changing direction and shape of the crack, thereby enhancing the ability to capture local features. Through the DSConv module, the model can more accurately capture the geometric details of the crack and improve the accuracy of crack detection.

[0053] 3. Dynamic Modeling Module (DMM) To learn the fine-grained details and long-range dependencies of cracks, it is necessary to combine crack details with global features to model spatial topology information. This is why a dynamic modeling submodule (DMM) was designed. Inspired by the efficiency of Mamba in modeling video and image sequences, the DMM module incorporates a Mamba mixer to further model long-range dependencies between features. The Mamba mixer effectively captures long-range spatial dependencies at the pixel level through unidirectional linear scanning, improving the model's understanding of crack propagation paths.

[0054] Specifically, the DMM module inputs the fused feature F′ into the Mamba mixer. First, the feature is converted into a 1D sequence F through a windowing operation. 1D ∈RHW×C, then use one-dimensional standard convolution for feature extraction, perform unidirectional scanning through the SSM branch to capture long-range dependencies, and provide additional feature contrast information through the contrast branch. Finally, the two branches are mapped back to the original dimension through the SiLU activation function, channel splicing operation and linear mapping to obtain the final DMM output feature . Its operation is expressed as:

[0055]

[0056]

[0057] in, Represents a windowing operation, which is used to divide the feature map into blocks to adapt to long sequence modeling; is a standard one-dimensional convolution for feature extraction; σ is the SiLU activation function for introducing nonlinearity; SSM is the state space model scanning branch for capturing long-range dependencies; Cat is the channel splicing operation for fusing multi-branch features; It is a linear mapping used to adjust the dimension of the output features.

[0058] Through the above operations of the Mamba mixer, the DMM module can effectively model the long-range dependencies between global and local features and improve the performance of crack detection.

[0059] 2. Multi-scale Semantic Aggregation Module (MSA) Existing methods for multi-scale feature fusion of cracks usually simply fuse the crack geometric texture features learned from different receptive fields to obtain the overall crack information, while ignoring the important impact of local structural changes such as width gradient and curvature discontinuity on crack propagation and its potential correlation with surrounding areas.

[0060] To address this limitation, this embodiment proposes a multi-scale semantic aggregation module (MSA), which uses the dynamic snake-like Mamba (DSM) module to learn local detail features at different scales and combines it with a multi-layer fusion strategy to achieve collaborative representation of local crack geometric features and global topological structure.

[0061] Specifically, the deep features F3 and F4 output by the backbone network deep layer Stage 3 and Stage 4 are first enhanced through the DSM module to obtain the topological feature representation of F 3 DSM and F 4 DSM , which is spliced ​​to form aggregated deep features At the same time, the basic texture features F1 and F2 extracted by the shallow Stage 1 and Stage 2 of the backbone network are additively fused to obtain F' low , and then process the embedded features with DSM containing rich local geometric details Splicing, generating shallow features with detail compensation .

[0062] This method uses a feature fusion submodule (FFM) with a dual attention mechanism of space and channel to perform feature fusion. and Perform feature refinement and then perform secondary fusion to obtain the final multi-scale aggregation features This hierarchical fusion strategy effectively enhances the model's ability to characterize complex crack patterns while maintaining the consistency of crack feature scales.

[0063] The module operation satisfies the following formula:

[0064]

[0065]

[0066] Where, Indicates the DSM processing process, It is the feature fusion module operation, and Cat represents the splicing operation.

[0067] 3. Hybrid Loss Function In complex scene images, while learning the topology and spatial relationships of cracks effectively maintains focus on the overall crack structure and reduces background noise, surface patterns or artifacts (such as graffiti or repair marks) may still resemble crack appearances. These spurious background features can significantly reduce the model's discriminative ability. To alleviate this issue, enhanced supervision is applied to the refined features to achieve denoising.

[0068] Based on this, this embodiment proposes a multi-level supervision mechanism, which performs high-level semantic features after multi-scale fusion. and low-level detail features To systematically suppress the interference of complex background, this method adopts a hybrid loss function supervision strategy to impose independent supervision. To maintain the integrity of crack features while considering the influence of background regions, foreground supervision is extended by introducing additional background supervision signals.

[0069] Specifically, binary cross entropy loss (BCE Loss) is added to the boundary combination loss, and the overall loss function is defined as:

[0070] in, is the overall loss function, refers to the weighted cross entropy loss, represents the Dice loss, is the binary cross entropy loss, is the boundary-aware loss.

[0071] Then the MSA module and Features and second-stage fusion features Applying global supervision, the corresponding loss function is defined as:

[0072] Where, and Respectively represent the purification supervision applied to low-level detail features and high-level semantic features, As a constraint on the final segmentation mask, the ground truth is the mask containing the crack and background regions.

[0073] The overall supervision process L aggregates supervision at each level through weighted summation:

[0074] The hyperparameters α, β, and γ can be set to 0.2, 0.2, and 0.6, respectively, to balance the contribution of each loss term. This supervision mechanism effectively reduces background noise interference and improves the accuracy and robustness of fine crack segmentation in complex environments.

[0075] Example 3 This embodiment is based on embodiment 1: like Figure 1As shown, this embodiment provides a crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation. The method includes: first, taking a complex scene image as input, and extracting multi-scale features through a backbone network. Shallow features (Stages 1 and 2) contain basic texture information, while deep features (Stages 3 and 4) contain high-level semantic information. Subsequently, the embedded original image and deep features are fed into a dynamic snake-shaped Mamba module (DSM). Global structural features are extracted through dilated spatial pyramid pooling (with dilation rates of 1 / 6 / 12 / 18). Dynamic snake-shaped convolution is used to capture local geometric details along the crack trajectory, and Mamba linear scanning is used to establish long-range spatial correlations. Simultaneously, shallow features are additively fused with the embedded features processed by the DSM to form detail-compensated shallow features. These two types of features are hierarchically fused by a multi-scale semantic aggregation module (MSA). A dual-attention mechanism (spatial and channel-wise) is used to refine the features before secondary fusion, resulting in the output of multi-scale aggregated features. Finally, a multi-level supervision mechanism (integrating WCE / Dice / boundary / BCE losses) is used to optimize the model, achieving accurate segmentation of fine cracks in complex scenarios. The details are as follows.

[0076] 1. Dynamic Snake Mamba Module (DSM) The detailed structure of the DSM module is as follows Figure 2 As shown, it includes two key components: global feature extraction and local feature capture.

[0077] In the global feature extraction part, given the input feature F input , a four-branch dilated spatial pyramid structure is used for processing: first, a 3×3 dilated convolution with a dilation rate of 1 is used to retain fine-grained details, and parallel dilated convolutions with dilation rates of 6, 12, and 18 are used to capture multi-scale structural features, and the context information is obtained through the global average pooling branch. The features of each branch are concatenated (Concat) and fused through a 1×1 convolution to finally output the global feature F A .

[0078] In the local feature extraction part, feature capture is achieved based on dynamic snake convolution: deformable convolution kernels are deployed along the X and Y directions respectively, the sampling position is dynamically adjusted according to the crack direction, the convolution kernel deformation parameters are generated through the coordinate offset prediction network, and the group convolution strategy is used to reduce the computational complexity, and finally the local feature map containing geometric features such as width gradient and curvature change is output. This module uses the Mamba mechanism to extract global features. F A Linear scanning and feature fusion are performed with local features to establish pixel-level long-range dependencies and achieve complete modeling of crack morphology.

[0079] 2. Multi-scale Semantic Aggregation Module (MSA) The detailed structure of the MSA module is as follows Figure 3 As shown in Figure 2, it mainly includes two core parts: feature fusion and supervision mechanism.

[0080] In terms of feature fusion, the module adopts a hierarchical fusion strategy, first preliminarily fusing the multi-scale features processed by DSM, and then achieving deep aggregation of features through secondary refinement.

[0081] In terms of supervision mechanism, a loss function combining Dice, WCE, Boundary, and BCE losses is adopted. Through this fusion and supervision approach, the entire module effectively suppresses the interference of background noise while maintaining feature richness, significantly improving the model's crack segmentation performance in complex scenarios.

[0082] 3. Experimental Setup 1. Dataset selection This example uses the CrackSeg9k and SteelCrack datasets, where: The CrackSeg9k dataset integrates 10 smaller datasets, including Masonry, CFD, DeepCrack, GAPs38, Stone331, Volker, Ceramic, CrackTree200, Crack500, and Rissbilder, totaling over 9,000 high-resolution images. This dataset primarily contains images of cracks captured in real-world scenes, with high-precision annotations. Covering a variety of scenes, including walls, concrete, pavement, and ceramics, the dataset includes images with complex background noise and fine cracks, making it ideal for research on crack segmentation in real-world scenarios.

[0083] The SteelCrack dataset includes images from the First International Structural Health Monitoring Project Competition. The majority of the images were captured by construction site workers and annotated specifically for steel structure projects. As a result, the dataset contains images of varying quality, complex backgrounds from various construction environments, and handwritten annotations from inspectors, reflecting the challenges and requirements of crack segmentation in real-world applications.

[0084] 2. Evaluation Metrics This experiment uses mean intersection over union (mIoU), mean Dice coefficient (mDice), and mean recall (mRecall) as the primary evaluation metrics. On the SteelCrack dataset, the resolution was maintained at 512×512, and mIoU and mDice were calculated only for the crack targets. On the CrackSeg9K dataset, the resolution was 448×448, and mIoU and mRecall were calculated for both the crack and background regions.

[0085] 3. Implementation details All models were trained in the same environment, using the ADAM optimizer with an initial learning rate of 1×10 -4 , using the cosine annealing dynamic learning rate strategy, the minimum learning rate is set to 1×10 -5 Each method was trained for 100 epochs with a batch size of 20. The best experimental results of each model were selected for comparison. The experimental platform was an Ubuntu 20.04.6 system equipped with a single NVIDIA RTX A6000 GPU.

[0086] IV. Experimental Verification 1. Reduce the application cost of crack segmentation Traditional fracture segmentation methods typically rely on a large number of manually annotated samples and hand-crafted features to adapt to different rock types or complex backgrounds. This not only increases the cost of data preparation, model debugging, and deployment, but also makes segmentation results susceptible to changes in the scene. This method (MD-Mamba) combines global fracture features with local detail variations, reducing reliance on manual intervention. This method offers stronger generalization capabilities, is applicable to various complex environments, and effectively reduces the application cost of fracture segmentation.

[0087] 2. Improved the accuracy of crack segmentation Currently, the most widely used general segmentation model in crack segmentation tasks is SegFormer. This model has certain segmentation capabilities on different datasets, but its segmentation accuracy is still insufficient when dealing with complex backgrounds and small cracks. Based on this, this method proposes MD-Mamba. By introducing a dynamic module that can integrate global features with local detail changes, it effectively improves the model's ability to extract global and local crack features, enabling higher accuracy in the segmentation stage. On the public datasets CrackSeg9K and SettlCrack, this method improves the mIoU indicator by approximately 2.51% and 2.92% respectively compared to SegFormer, significantly improving the overall accuracy of crack segmentation, especially in the detection tasks of complex backgrounds and small cracks.

[0088] 3. Enhanced model adaptability and efficiency Traditional CNN-based methods struggle to balance global and local information when extracting features. While Transformer-based models excel at modeling global features, they often introduce a large number of parameters, significantly increasing computational overhead. This method, based on the Mamba architecture, introduces dynamic modules to effectively control the number of parameters and computational complexity while ensuring efficient global feature modeling. Compared to pure CNN or Transformer models, MD-Mamba achieves higher recognition accuracy and robustness when handling complex backgrounds and small cracks, while also improving the model's inference efficiency in practical applications.

[0089] Example 4 This embodiment is based on embodiment 1: This embodiment provides a crack segmentation system based on dynamic receptive field and multi-scale semantic aggregation, including: The dynamic snake-shaped Mamba module is configured to simultaneously capture local details and global structural features of cracks in crack images. It dynamically adjusts the shape of the convolution kernel to adapt to geometric changes in the cracks, inputs the obtained features into the spatial pyramid pooling layer to extract multi-scale contextual information, and outputs a feature representation that integrates long-range dependencies. The multi-scale semantic aggregation module is configured to establish an interactive relationship between local details and global semantics based on the fusion of long-range dependency feature representations, suppress background noise interference through a parallel supervised attention mechanism, and generate pixel-level crack segmentation results through a lightweight segmentation head.

[0090] Example 5 This embodiment is based on embodiment 1: This embodiment provides a computer device including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation of Example 1. The computer program may be in source code form, object code form, an executable file, or some intermediate form.

[0091] Example 6 This embodiment is based on embodiment 1: This embodiment provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation of Example 1. The computer program may be in source code form, object code form, executable file, or some intermediate form. The storage medium includes: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the storage medium does not include electric carrier signal and telecommunication signal.

[0092] It should be noted that, for the sake of simplicity, the aforementioned method embodiments are described as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

Claims

1. A crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation, characterized by: include: The dynamic snake-shaped Mamba module takes a crack image as input and simultaneously captures both local details and global structural features of the crack. The convolution kernel shape is dynamically adjusted to adapt to geometric changes in the crack. The resulting features are then fed into a spatial pyramid pooling layer to extract multi-scale contextual information, and the output is a feature representation that integrates long-range dependencies. Based on the feature representation of fused long-range dependencies, the interactive relationship between local details and global semantics is established through a multi-scale semantic aggregation module, background noise interference is suppressed through a parallel supervised attention mechanism, and pixel-level crack segmentation results are generated through a lightweight segmentation head.

2. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 1 is characterized in that: The Dynamic Snake Mamba module includes: A global feature extraction submodule, configured to extract global features of the crack image; a detail feature extraction submodule, configured to extract detail features of the crack image; The dynamic modeling submodule is configured to combine the detailed features of the cracks with the global features to model the spatial topology information and learn the fine-grained detailed information and long-range dependencies of the cracks.

3. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 2 is characterized in that: In the global feature extraction submodule, global features of the crack image are extracted, including: capturing multi-scale global structural features of the crack based on a spatial pyramid pooling layer, and extracting feature information with different receptive fields through hollow convolution kernels with different expansion rates.

4. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 2 is characterized in that: In the detail feature extraction submodule, the detail features of the crack image are extracted, including: adaptively capturing the local geometric changes and directional changes of the crack through a deformable convolution unit; by dynamically adjusting the shape of the convolution kernel, the deformable convolution unit can capture local features along the crack trajectory, thereby enhancing the ability to characterize crack details.

5. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 3 is characterized in that: The method of adaptively capturing local geometric changes and directional changes of the crack by the deformable convolution unit includes: the deformable convolution unit applies adaptive filters in the X and Y directions to generate local geometric features to adapt to the changing direction and shape of the crack.

6. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 2 is characterized in that: In the dynamic modeling submodule, the detailed features of the cracks are combined with the global features to model spatial topological information, and the fine-grained detailed information and long-range dependencies of the cracks are learned, including: modeling the long-range dependencies between features through a Mamba mixer, and the Mamba mixer captures the long-range spatial dependencies at the pixel level through unidirectional linear scanning.

7. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 6 is characterized in that: The method of modeling long-range dependencies between features using the Mamba mixer includes: fusing the detailed features of the crack with the global features, converting the fused features into a one-dimensional sequence through a windowing operation, and extracting features using a one-dimensional standard convolution; performing a unidirectional scan through a state-space model scanning branch to capture long-range dependencies, and providing additional feature comparison information through a comparison branch; and mapping the two branches back to the original dimension through a SiLU activation function, a channel splicing operation, and a linear mapping to obtain the final output features.

8. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 1 is characterized in that: The multi-scale semantic aggregation module includes a feature fusion submodule with a spatial and channel dual attention mechanism. The feature fusion submodule is configured to perform a collaborative representation of local crack geometric features and global topological structures in combination with a multi-layer fusion strategy, including: refining the aggregated deep features and shallow features with detail compensation respectively, and then performing secondary fusion to obtain the final multi-scale aggregated features.

9. The crack segmentation method based on dynamic receptive field and multi-scale semantic aggregation according to claim 1 is characterized in that: The parallel supervised attention mechanism is used to suppress background noise interference, including: applying independent supervision to high-level semantic features and low-level detail features after multi-scale fusion, and expanding foreground supervision by introducing additional background supervision signals; the overall loss function includes binary cross entropy loss, Dice loss, weighted cross entropy loss and boundary-aware loss.

10. A crack segmentation system based on dynamic receptive field and multi-scale semantic aggregation, characterized by: include: The dynamic snake-shaped Mamba module is configured to simultaneously capture local details and global structural features of cracks in crack images. It dynamically adjusts the shape of the convolution kernel to adapt to geometric changes in the cracks, inputs the obtained features into the spatial pyramid pooling layer to extract multi-scale contextual information, and outputs a feature representation that integrates long-range dependencies. The multi-scale semantic aggregation module is configured to establish an interactive relationship between local details and global semantics based on the fusion of long-range dependency feature representations, suppress background noise interference through a parallel supervised attention mechanism, and generate pixel-level crack segmentation results through a lightweight segmentation head.

Citation Information

Cited By

  • Mining area surface crack extraction method based on multi-scale global fusion

    CN121582836A

  • A mine surface crack extraction method based on multi-scale global fusion

    CN121582836B

  • Helicopter rotor crack fault identification method and device based on video semantic segmentation

    CN121616921A

  • Space environment sensing method, device and equipment suitable for multi-agent system

    CN121617096A

  • Crack image segmentation method based on double-pooling fusion

    CN121708027A