A method and system for segmenting a crack image

By extracting encoder features through a three-layer progressive stacked residual unit and DropBlock regularization module layer, combined with DenseCRF optimization, the robustness and efficient deployment issues of crack recognition technology in complex backgrounds are solved, achieving high-precision and low-complexity crack image segmentation.

CN120876872BActive Publication Date: 2026-02-10XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511400055.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-28
Publication Date
2026-02-10
Estimated Expiration
2045-09-28

AI Technical Summary

Technical Problem

Existing crack detection technologies face a trade-off between high accuracy, low complexity, strong robustness, and high-efficiency deployment. They perform poorly, especially in complex backgrounds and resource-constrained environments, and lack robust processing methods for noise and complex texture backgrounds.

Method used

Feature extraction is performed using an encoder composed of three progressively stacked residual units. The crack probability distribution map is optimized by combining DropBlock regularization module layers and Dense Conditional Random Field (DenseCRF). The robustness and segmentation accuracy of the model are improved by introducing Gaussian noise enhancement and a symmetric unified focus loss function.

Benefits of technology

It improves the robustness and generalization ability of the model, reduces feature redundancy, enhances anti-interference ability, and improves the fineness and accuracy of crack segmentation, making it suitable for edge computing platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120876872B_ABST
    Figure CN120876872B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of image processing, and particularly relates to a crack image segmentation method and system. The robustness of a model to noise is improved by introducing Gaussian noise into image data for enhancement processing. An encoder composed of three layers of progressive stacked residual units is used to extract crack features, and a DropBlock regularization module layer is used to reduce feature redundancy and enhance feature diversity. The image space resolution of the crack features is restored by a decoder symmetrical to the encoder, and the fine structure of the crack boundary is restored. Finally, a dense conditional random field is used to optimize the crack probability distribution map, and the final crack segmentation map is output. The application effectively alleviates the foreground-background class imbalance problem, reduces false positives and false negatives, improves the segmentation performance of the model, and is particularly suitable for deployment on edge devices such as unmanned aerial vehicles and mobile phones, providing a high-precision, low-complexity and strong-robustness crack identification scheme for infrastructure health monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to a crack image segmentation method and system. Background Technology

[0002] Crack detection technology is currently widely used in structural health monitoring of infrastructure such as roads, bridges, and tunnels, and has significant safety assurance value. With the aging of urban infrastructure and the increasing demand for automated inspection, this technology has gradually attracted high attention from academia and industry. Currently, crack detection technologies mainly fall into two categories: traditional image processing methods and deep learning-based intelligent segmentation methods.

[0003] In existing technologies, traditional image processing methods, represented by edge detection and grayscale thresholding, rely on changes in image grayscale to extract crack features. While simple to implement and computationally inexpensive, these methods often perform poorly in complex backgrounds and low-contrast images, and are highly sensitive to noise interference, failing to meet the demands for high-precision automatic crack identification. Therefore, deep learning-based crack segmentation methods have rapidly developed in recent years. Models such as U-Net, CrackUNet, and Vision Transformer (ViT) have been widely applied in pixel-level crack detection. These methods achieve automatic feature extraction and classification through end-to-end training, can adapt to various crack morphologies and material backgrounds, and have achieved good accuracy on some publicly available datasets. However, existing models still suffer from the following major problems: 1. Most models have complex structures and a large number of parameters, requiring high-performance GPUs (Graphics Processing Units) for computing resources, making them difficult to deploy on edge devices such as drones and mobile phones; 2. When faced with the "class imbalance" problem commonly found in real-world crack images (crack pixels are far fewer than background pixels), the model segmentation performance fluctuates significantly, with obvious false positives and false negatives; 3. Training with small batches of samples is unstable, heavily reliant on batch normalization, leading to a decline in model generalization ability; 4. Some models suffer from redundant enhancements and computationally intensive attention mechanisms during feature learning, resulting in slow training convergence and a tendency to overfit; 5. There is a lack of robust methods for handling noise and complex textured backgrounds. Therefore, there is currently a lack of a crack image segmentation scheme that can balance high accuracy, low complexity, strong training stability, and deployment flexibility, especially in edge computing platforms in practical engineering scenarios, where the need for a high-performance crack recognition system is particularly urgent. Summary of the Invention

[0004] This invention provides a crack image segmentation method and system to solve the significant balance problem between high accuracy, low complexity, strong robustness and high-efficiency deployment in existing crack recognition technologies, especially the poor performance in complex backgrounds, class imbalance and resource-constrained environments.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A crack image segmentation method includes the following steps:

[0007] The original crack surface image data is acquired, and Gaussian noise is introduced into the original crack surface for enhancement processing to obtain the enhanced image data.

[0008] An encoder consisting of three progressively stacked residual units is used to extract features from the enhanced image data to obtain crack features;

[0009] The crack features are decoded by a decoder symmetrical to the encoder to restore the image spatial resolution of the crack features and restore the fine structure of the crack boundary; the decoded crack features are then subjected to a double convolution to output a crack probability distribution map.

[0010] The crack probability distribution map is optimized using a dense conditional random field to output the final crack segmentation map.

[0011] The enhancement process of introducing Gaussian noise into the original crack surface image data specifically involves introducing Gaussian noise with a standard deviation of 0.1 into the original crack surface image data to simulate lighting changes, imaging blur, and sensor interference in the actual scene, thereby enhancing the original crack surface image data.

[0012] The encoder employs a three-layer stacked residual unit to extract features from the enhanced image data. Each residual unit layer sequentially includes a weighted normalized convolutional layer, a group normalization layer, a ReLU activation function layer, a DropBlock regularization module layer, and a MaxPooling pooling layer. The enhanced image data passes through the weighted normalized convolutional layer, group normalization layer, and ReLU activation function layer sequentially to generate a first intermediate feature map, which serves as the input feature map for the DropBlock regularization module layer. The DropBlock regularization module layer uses a square mask region of size 7 for feature occlusion, followed by downsampling by the MaxPooling pooling layer. After the three-layer stacked residual unit performs feature occlusion by the DropBlock regularization module layer and the MaxPooling pooling layer, the feature extraction of the enhanced image data is completed, yielding crack features.

[0013] The DopBlock regularization module uses a square mask region with a block size of 7 for feature occlusion. Specifically, the DropBlock regularization module calculates the probability of the center of the dropped block for the given block size and retention probability. Then, it generates a Bernoulli mask based on the calculated probability of the center of the dropped block. A Bernoulli mask value of 1 indicates the center of the potential descent region. Max pooling is used to expand the Bernoulli mask, and the expanded mask is inverted to obtain the final occlusion mask. Feature occlusion is then performed based on the final occlusion mask.

[0014] The probability of the center of the fallen block The formula is as follows:

[0015]

[0016] In the formula, To preserve probability, The block size of the square mask area. The height of the input feature map, The width of the input feature map is used; then the probability of the center of the fallen block is calculated. Generate a Bernoulli mask, the formula for which the Bernoulli mask is calculated is as follows:

[0017]

[0018] In the formula, Bernoulli mask Each element in All follow a Bernoulli distribution Bernoulli mask Extend the mask. as follows:

[0019]

[0020] In the formula, This indicates that the Bernoulli mask The center of the falling block expands to blocky 1, Indicates the step size. This indicates that the padding method is the same size padding, which will expand the mask. The final occlusion mask is obtained by inverting the image. The final occlusion mask The calculation formula is as follows:

[0021]

[0022] At this point, the final masking layer is applied. In the diagram, a value of 1 indicates that the feature is activated and is preserved, while a value of 0 indicates that the feature needs to be suppressed, i.e., the occluded area.

[0023] To avoid abnormal amplitude of the input feature map due to occlusion operations, a final occlusion mask is used. The activation locations of the preserved features with a median value of 1 are scaled. This scaling ensures that the overall energy of the input feature map remains consistent with that before occlusion, using a scaling factor. The calculation formula is as follows:

[0024]

[0025] In the formula, The number of channels in the input feature map. For final masking At an altitude of Width is and the number of channels is The element value at the position is determined by the final occlusion mask. And the scaling factor, to obtain the output tensor Output tensor The calculation formula is:

[0026]

[0027] in To output the tensor at a height of Width is and the number of channels is The element value at position, The input feature map without occlusion processing is at a height of Width is and the number of channels is The original feature values ​​of the location, output tensor This refers to the crack features extracted by the encoder.

[0028] The method involves decoding the crack features using a decoder symmetrical to the encoder, refining the crack features extracted by the encoder, restoring the image spatial resolution of the crack features, and restoring the fine structure of the crack boundary. Specifically, the decoder consists of a structure symmetrical to the encoder, comprising three sets of upsampling units: upsampling block 1, upsampling block 2, and upsampling block 3. Each set of upsampling units consists of a transposed convolutional layer, a GN layer, and a ReLU activation function layer to restore the fine structure of the crack boundary layer by layer. Upsampling processing allows the model to reconstruct the segmentation mask with high pixel-level accuracy. The reconstruction process starts from upsampling block 1, which uses the transposed convolutional layer of the upsampling unit to upsample the crack features output by the encoder. Upsampling block 2 continues to use the transposed convolutional layer in upsampling block 1 for sampling. Upsampling block 3 further upsamples the crack features output by upsampling block 2 to the resolution of the original crack surface image data, thus completing the restoration of the image spatial resolution of the crack features.

[0029] The decoded crack features are subjected to a double convolution to output a crack probability distribution map. Specifically, the decoded crack features are multi-channel features, which are processed sequentially by two WS layers. The first WS layer uses 32 filters and a 3×3 kernel. After convolution, the first WS layer is connected to a GN layer and a ReLU activation function layer to further optimize the detailed representation of the crack features and refine the features for subsequent probability output. The second WS layer uses a 3×3 kernel to compress the multi-channel features output by the first WS layer into single-channel features, and applies a sigmoid activation function to generate a probability output, forming the crack probability distribution map.

[0030] Using a symmetric unified focus loss function ( Figure 1 The Symmetric Unified Focal Loss (SUF) method minimizes the DenseCRF energy function to obtain the optimal label assignment for each pixel in the crack probability distribution map, thereby incorporating the spatial correlation between adjacent pixels in the crack probability distribution map into the segmentation process and obtaining the final crack segmentation set. The DenseCRF energy function is as follows:

[0031]

[0032] in This indicates the label assignment for each pixel. The unary potential of the DenseCRF energy function is defined as the negative logarithm of the predicted softmax probability. The potential for the DenseCRF energy function is a two-dimensional potential. For the first A label of 1 pixel, For the first A label of 1 pixel.

[0033] A crack image segmentation system includes an image enhancement module, a feature extraction module, a feature optimization module, and a crack segmentation module;

[0034] The image enhancement module is used to acquire the original crack surface image data, introduce Gaussian noise into the original crack surface image data for enhancement processing, and obtain the enhanced image data.

[0035] The feature extraction module is used to extract features from the enhanced image data using an encoder composed of three progressively stacked residual units to obtain crack features;

[0036] The feature optimization module is used to decode the crack features through a decoder symmetrical to the encoder, restore the image spatial resolution of the crack features, and restore the fine structure of the crack boundary; and to perform double convolution on the decoded crack features to output a crack probability distribution map.

[0037] The crack segmentation module uses a dense conditional random field to optimize the crack probability distribution map and outputs the final crack segmentation map.

[0038] Compared with the prior art, the present invention has the following beneficial effects:

[0039] In this invention, Gaussian noise is introduced for enhancement, which improves the robustness of the model, making it focus more on the global features of the cracks rather than detailed noise. This also increases data diversity, improves generalization ability, and allows the model to learn texture invariance more stably under different lighting conditions. A three-layer progressive residual unit encoder, combined with a DropBlock regularization module layer, solves the gradient vanishing problem in deep networks, improving feature extraction capabilities. The DropBlock regularization module layer reduces feature redundancy through block occlusion and feature scaling, enhancing feature robustness and diversity, making the model less reliant on local features and improving anti-interference capabilities. The decoder restores resolution layer by layer, preserving crack boundary details; double convolution further optimizes feature representation, improving the precision of crack segmentation and avoiding the over-dilution problem in traditional segmentation methods, making crack edge definitions clearer. A symmetric unified focus loss function adjusts gradient weights to alleviate class imbalance; the DenseCRF energy function utilizes spatial context information to optimize segmentation results, improving segmentation accuracy and computational efficiency, making the optimization process both efficient and accurate. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of a network architecture for a crack image segmentation system according to an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram of the crack image segmentation result in an embodiment of the present invention. Detailed Implementation

[0042] To further understand the content of this invention, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the embodiments are merely illustrative and not limiting of the invention.

[0043] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0044] This embodiment proposes a crack image segmentation method, specifically a crack image segmentation method based on the CrackSeg-GWD model. The crack image segmentation method includes the following steps:

[0045] The original crack surface image data is acquired, and Gaussian noise is introduced into the original crack surface image data for enhancement processing to obtain the enhanced image data.

[0046] An encoder consisting of three progressively stacked residual units is used to extract features from the enhanced image data to obtain crack features;

[0047] The crack features are decoded by a decoder symmetrical to the encoder to restore the image spatial resolution of the crack features and restore the fine structure of the crack boundary; the decoded crack features are then subjected to a double convolution to output a crack probability distribution map.

[0048] The crack probability distribution map is optimized using a dense conditional random field to output the final crack segmentation map.

[0049] This invention proposes a CrackSeg-GWD model, a compact, inference-efficient deep convolutional neural network suitable for edge computing platforms, specifically designed for high-precision pixel-level segmentation of surface cracks in various infrastructure materials such as concrete, steel, and asphalt. The encoder of the proposed CrackSeg-GWD model consists of three progressively deeper residual blocks, as shown below. Figure 1As shown, each residual block is designed to reduce the dimensionality of the sampling space while increasing the number of feature channels. This hierarchical structure allows the CrackSeg-GWD model to capture more detailed and complex crack features. In the first residual block, the input features are first processed by a Weight Standardization (WS) layer containing 32 filters and a 3×3 kernel; then, Group Normalization (GN) is performed, containing 32 group normalization steps, followed by a ReLU activation function layer. This processing sequence is repeated to further enhance the feature representation. A key element of the first residual block is the skip connection, which uses a WS layer containing 32 filters and a 1×1 kernel. This skip connection connects the block's input and output, facilitating gradient flow and allowing the model to learn identity mappings, thereby mitigating the vanishing gradient problem common in deep convolutional neural networks. The outputs of the two main convolutional paths are combined with the results of the skip connection by adding layers. Based on the CrackSeg-GWD model described above, this embodiment proposes a crack image segmentation system, and provides a detailed explanation of the steps of the crack image segmentation method described above. The specific implementation method is as follows:

[0050] The crack image segmentation system consists of an image input module, a preprocessing and enhancement module, an encoder module, a decoder module, an output layer, a loss function module, and a dense conditional random field post-processing module. First, the original crack surface image data is acquired and input into the image input module. The image input module supports a standard RGB three-channel input format, and the image size is flexibly adjustable. The preprocessing and enhancement module adds Gaussian noise with a standard deviation of 0.1 to the original structural surface image data to simulate lighting variations, imaging blur, and sensor interference in real-world scenes, thereby enhancing the image data. This noise, as a form of data augmentation, enhances the model's robustness to real-world defects and sensor noise, common obstacles in crack segmentation.

[0051] Next, the encoder module uses an encoder composed of three progressively stacked residual units to extract features from the enhanced image data, obtaining crack features. The encoder is the core structure for feature extraction, consisting of three progressively stacked residual units. Each residual unit layer includes: a weighted normalized convolutional layer, a group normalization layer, a ReLU activation function layer, a DropBlock regularization module layer, and a MaxPooling pooling layer. The DropBlock regularization module layer uses a square mask region with a block size of 7 for feature occlusion, effectively suppressing local overfitting and enhancing the model's ability to recognize edge details and crack textures. In the first residual unit layer, the input features are first processed by the WS layer, then grouped and normalized by the GN layer, nonlinearity is introduced by the ReLU activation function layer, random feature occlusion is performed by the DropBlock regularization module layer, and finally, downsampling is performed by the MaxPooling pooling layer to reduce spatial dimensionality. The second residual unit follows the structure and process of the first residual unit, but with increased capacity and a WS layer with more filters. It also processes through a GN layer, ReLU activation function layer, DropBlock regularization module layer, and MaxPooling pooling layer to further extract detailed features and downsample them. The third residual unit, as the deepest layer, continues the above hierarchical process, using WS layers, GN layers, ReLU activation layers, DropBlock regularization module layers, and MaxPooling pooling layers with appropriate parameter settings to extract high-level features before passing them to the decoder.

[0052] The enhanced image data is sequentially processed through weighted normalized convolution, group normalization, and ReLU activation to generate the first intermediate feature map, which serves as the input feature map for the DropBlock regularization module layer. The DropBlock regularization module layer uses 7×7 mask blocks (square mask regions of size 7) for feature occlusion. By removing consecutive square regions from the input feature map, it suppresses the model's over-reliance on local features, reduces overfitting, and enhances the model's ability to recognize edge details and crack textures. The DropBlock regularization module layer introduces a structured regularization method. Unlike traditional dropout, which randomly eliminates individual activation values, the DropBlock regularization module layer removes fixed-size square regions from the input feature map during training. This strategy encourages the network to rely more on spatial distribution information rather than overemphasizing local patterns, thereby improving generalization. Specifically:

[0053] Let the height, width, and number of channels of the input feature map be H, W, and C, respectively. The DropBlock regularization module layer, with respect to block size... and retention probability The probability of choosing the center of the falling block By calculating the probability of the center of the falling block The frequency of randomly selecting the center of an occluded block on the input feature map is controlled. The probability of the center of the fallen block... The formula is as follows:

[0054]

[0055] In the formula, To preserve probability, The block size of the square mask area. The height of the input feature map, The width of the input feature map. The probability of the center of the fallen block. The expected drop rate will be adjusted based on the size of the block to ensure that the overall proportion of suppressed activation remains consistent with the desired retention probability. Then, the probability of the dropped block center is calculated. Generate a Bernoulli mask, the formula for which the Bernoulli mask is calculated is as follows:

[0056]

[0057] In the formula, Bernoulli mask Each element in All follow a Bernoulli distribution Bernoulli mask In a Bernoulli mask, each element can only be 0 or 1, used to indicate whether a position on the input feature map is the center of the falling block. Bernoulli mask When the value is 1, it indicates the center of the potential descent region.

[0058] Furthermore, in order to create a complete square block occlusion region around the center of these potential descent regions, max pooling is used on the Bernoulli mask. Perform an extended mask to reduce the pooled kernel size. block size Step length And the filling method is The Bernoulli mask Extended mask as follows:

[0059]

[0060] In the formula, This indicates that the Bernoulli mask The center of the falling block expands to blocky 1, Indicates the step size. This indicates that the padding method is the same size padding, which will expand the mask. The final occlusion mask is obtained by inverting the image. The final occlusion mask The calculation formula is as follows:

[0061]

[0062] At this point, the final masking layer is applied. In the code, a value of 1 indicates that the feature is activated and preserved, while a value of 0 indicates that it needs to be suppressed, i.e., the occluded region. To avoid the occlusion operation causing abnormal amplitude of the overall input feature map, a mask is applied to the final occlusion. The activation locations of the preserved features with a median value of 1 are scaled. This scaling ensures that the overall energy of the input feature map after occlusion remains consistent with that before occlusion. Scaling factor The calculation formula is as follows:

[0063]

[0064] In the formula, For final masking At an altitude of Width is and the number of channels is The element values ​​at the location are then used to finally activate the original image data. With final occlusion mask and scaling factor Multiply to obtain the output tensor Output tensor The calculation formula is:

[0065]

[0066] in To output the tensor at a height of Width is and the number of channels is The element value at position, The input feature map without occlusion processing is at a height of Width is and the number of channels is The original feature values ​​of the location, output tensor This is the crack feature extracted by the encoder. The output tensor... By suppressing over-reliance on local features through structured occlusion and maintaining the stability of feature distribution through scaling, the model's ability to learn spatially distributed features is enhanced. Through this structured regularization, the DropBlock regularization module layer forces the convolutional neural network to learn more spatial distributions and rely less on any single feature representation region, making it particularly effective for tasks involving spatial redundancy or noise.

[0067] In each residual unit, after the aforementioned feature occlusion and scaling are performed in the DropBlock regularization module layer, downsampling is performed through the MaxPooling pooling layer to reduce the spatial dimension of the feature map in order to extract the features of the residual unit in that layer. After the three progressively stacked residual units sequentially complete the aforementioned DropBlock regularization module layer feature occlusion and MaxPooling pooling layer operations, the feature extraction of the enhanced image data is completed, and crack features are obtained.

[0068] Furthermore, the decoder module decodes the crack features using a decoder symmetrical to the encoder, refining the crack features extracted by the encoder, restoring the image spatial resolution of the crack features, and recovering the fine structure of the crack boundaries. The decoder consists of a structure symmetrical to the encoder, comprising three sets of upsampling units: upsampling block 1, upsampling block 2, and upsampling block 3. Each upsampling unit consists of a transposed convolutional layer and a GN layer (e.g., ...). Figure 1 In the middle, GN (Group Normalization layer, abbreviated as GN) and ReLU activation function layer ( Figure 1Composed of a multi-layered ReLU (Reconstruction-Responsive) layer, this system can reconstruct the fine structure of crack boundaries layer by layer. Upsampling allows the model to reconstruct the segmentation mask with high pixel-level accuracy, ensuring precise depiction of crack boundaries. The reconstruction process begins with upsampling block 1. The core parameters of the transposed convolutional layer (C2T) in upsampling block 1 are set as follows: 128 convolutional filters, 2×2 convolutional kernels, and a stride of 2. Upsampling block 1 uses the C2T layer to upsample the features of the deepest encoder stage, increasing the spatial resolution of the input feature map by a factor of 2. After upsampling in upsampling block 1, group normalization is performed on the output feature map to reduce the impact of feature distribution differences on subsequent calculations. The number of groups for group normalization is 128. Finally, the group-normalized feature map is input into the ReLU activation function layer. By introducing nonlinear mapping, the model's ability to express complex features is enhanced, ultimately yielding the output features of upsampling block 1, which are used in subsequent reconstruction processes. Upsampling block 2 continues to use the C2T layer from upsampling block 1, further upsampling the output features of upsampling block 1. The C2T layer parameters in upsampling block 2 are configured as follows: 64 convolutional filters, 2×2 convolutional kernels, and a stride of 2. This further amplifies the spatial resolution of the output features of upsampling block 1 by a factor of 2. After upsampling, group normalization is performed on the amplified output features using a GN layer, with the number of groups set to 64. Combined with the 64-filter configuration of the preceding transposed convolutional layer, this grouping method achieves independent normalization for each channel, effectively stabilizing the feature distribution. The feature map processed by the GN layer is then subjected to a ReLU activation function to introduce nonlinearity, enhancing the feature expressive power. The output result is then fed into the next processing module. Upsampling block 3 further upsamples the feature map to a resolution consistent with the original input image. The final upsampling is completed using the C2T layer in upsampling block 3. The C2T layer parameters in upsampling block 3 are configured as follows: 32 convolutional filters, 2×2 convolutional kernels, and a stride of 2. This enlarges the spatial resolution of the feature map to the original input size. After upsampling, group normalization is performed using the GN layer, with the number of groups set to 32. Since the output of the preceding transposed convolutional layer is a 32-channel feature map, this configuration also achieves independent normalization for each channel, ensuring the stability of the feature distribution. The feature map processed by the GN layer undergoes non-linear mapping using the ReLU activation function, ultimately completing the full recovery of the crack features in the image spatial resolution, providing a feature representation that matches the original input size for subsequent processing or output.

[0069] The loss function module performs a double convolution on the decoded crack features, and the crack features are then passed through two WS (Weight Standardization) layers. Figure 1The first WS layer uses 32 filters and a 3×3 kernel. After convolution, it is connected to a GN layer and an RL activation function layer to further optimize the detailed representation of crack features and refine the features for subsequent probability output. The second WS layer uses a 3×3 kernel to compress the refined multi-channel features into single-channel features and applies the sigmoid activation function ( Figure 1 The Sigmoid activation function (S) generates a probability output, forming a crack probability distribution map to achieve soft segmentation. The output range of the Sigmoid activation function is [0, 1]. Its core function is to map the numerical value of a single-channel feature to the probability that each pixel belongs to the crack category. The closer the output value of the Sigmoid activation function is to 1, the higher the probability that the pixel is a crack; the closer the output value is to 0, the higher the probability that the corresponding pixel in the feature image is background. Finally, the single-channel feature map processed by the Sigmoid activation function becomes the crack probability distribution map, thus achieving the soft segmentation probability output of the crack region.

[0070] In this invention, to address the common foreground-background class imbalance problem in soft-segmented crack images, a symmetric unified focus loss function (Dense Conditional Random Fields, or DenseCRF) is introduced into the CrackSeg-GWD model. This enhances the spatial coherence between pixels while maintaining intensity consistency, effectively improving the detail quality of the segmented image and enhancing the accuracy and reliability of crack detection results. By minimizing the DenseCRF energy function, the optimal label assignment for each pixel in the crack probability distribution map is obtained, thus incorporating the spatial correlation between adjacent pixels in the crack probability distribution map into the segmentation process, resulting in the final crack segmentation set. The DenseCRF energy function is as follows:

[0071]

[0072] in This indicates the label assignment for each pixel. For the first A label of 1 pixel, For the first A label of 1 pixel, The univariate potential representing the energy function of the DenseCRF is denoted by , while The univariate potential is the energy function of DenseCRF, used to encourage label smoothness and consistency between adjacent pixels. The univariate potential is defined as the negative logarithm of the predicted softmax probability:

[0073]

[0074] In the formula, In the crack probability distribution map output by the decoder, pixels Belongs to the label The predicted probability, reflecting the model's confidence in the assigned labels, ensures that the refined segmentation remains close to the initial model prediction. The binary potential... Represented as a linear combination of Gaussian kernels, it adopts the classic Potts model design. Its core principle is to encourage adjacent pixel labels to be consistent, and only apply a penalty to pixel pairs with different labels, defined as:

[0075]

[0076] In the formula, Indicates tag compatibility functions, The number of Gaussian kernels, For the index of the Gaussian kernel, Indicates the first A Gaussian kernel function, with Weighted. In the context of the Potts model, if ,but ,otherwise = 0, to ensure that only neighboring pixels with different labels contribute to the energy penalty. The Gaussian kernel function... The calculation formula is as follows:

[0077]

[0078] In the formula, Representing pixels and pixels eigenvectors, and For weight parameters, and Pixels and pixels Spatial coordinates in the image, Pixels and pixels Color intensity, , and These are all hyperparameters used to control the sensitivity of the Gaussian kernel to spatial distance and intensity differences. The Gaussian kernel function... In the above, the appearance kernel represented by the first term considers both spatial and intensity information, i.e. In the formula, The weighting coefficients for the appearance kernel. and Pixels and pixels spatial coordinates, The spatial standard deviation of the appearance kernel. The standard deviation of the strength of the appearance core, and Pixels and pixels The intensity value. It encourages nearby pixels with similar intensities to share the same label, thereby improving the depiction of crack boundaries and distinguishing cracks from complex backgrounds. The smoothing kernel, represented by the second term, relies only on spatial proximity and promotes uniform labeling of adjacent pixels, i.e. ,in, The weighting coefficients of the smoothing kernel. The spatial standard deviation of the smoothing kernel is used. This reduces isolated regions and noise in the segmentation map, resulting in a cleaner and more continuous crack representation. Based on the aforementioned Gaussian kernel function, further optimization is achieved by minimizing the DenseCRF energy function. This process is used to obtain the optimal label assignment for each pixel, thereby incorporating the spatial correlation between adjacent pixels into the segmentation process and obtaining the final crack segmentation set. :

[0079]

[0080] in, Let represent the independent variable that minimizes the objective function. This represents minimizing the Gibbs energy function. The most probable segmentation result is generated based on the predicted probability and spatial context, as shown in the example below. Figure 2 As shown, Figure 2 The final crack segmentation results show that after the original crack surface image is finely segmented by the present invention, the continuity and boundary accuracy of the crack are significantly improved.

[0081] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be appropriately combined to form other embodiments that can be understood by those skilled in the art. The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.

Claims

1. A crack image segmentation method, characterized in that, Includes the following steps: The original crack surface image data is acquired, and Gaussian noise with a standard deviation of 0.1 is introduced into the original crack surface image data to simulate the lighting changes, imaging blur and sensor interference in the actual scene, and then the enhancement processing is performed to obtain the enhanced image data. An encoder consisting of three progressively stacked residual units is used to extract features from the enhanced image data to obtain crack features; each residual unit includes a weighted normalized convolutional layer, a group normalization layer, a ReLU activation function layer, a DropBlock regularization module layer, and a MaxPooling pooling layer in sequence. The DropBlock regularization module layer uses a square mask region with a block size of 7; The decoder consists of a structure symmetrical to the encoder, comprising three sets of upsampling units: upsampling block 1, upsampling block 2, and upsampling block 3. Each upsampling unit consists of a transposed convolutional layer, a GN layer, and a ReLU activation function layer to progressively restore the fine structure of the crack boundary. The decoder decodes the crack features, restoring the image spatial resolution of the crack features and reconstructing the fine structure of the crack boundary. The decoded crack features are then subjected to a double convolution to output a crack probability distribution map. A symmetric unified focus loss function is introduced to enhance the spatial coherence between pixels in the crack probability distribution map and maintain intensity consistency. The decoded crack features are subjected to a double convolution to output a crack probability distribution map. Specifically, the decoded crack features are multi-channel features, which are processed sequentially by two WS layers. The first WS layer uses 32 filters and a 3×3 kernel. After convolution, the first WS layer is followed by a GN layer and a ReLU activation function layer to further optimize the detailed representation of the crack features and refine the features for subsequent probability output. The second WS layer uses a 3×3 kernel to compress the multi-channel features output by the first WS layer into single-channel features, and applies a sigmoid activation function to generate a probability output, forming the crack probability distribution map. The crack probability distribution map is optimized using a dense conditional random field to output the final crack segmentation map.

2. The crack image segmentation method according to claim 1, characterized in that, The encoder, composed of three progressively stacked residual units, extracts features from the enhanced image data. The enhanced image data sequentially passes through a weighted normalization convolutional layer, a group normalization layer, and a ReLU activation function layer to generate a first intermediate feature map, which serves as the input feature map for the DropBlock regularization module layer. The DropBlock regularization module layer uses a square mask region with a block size of 7 to occlude the input feature map. A MaxPooling pooling layer then performs downsampling. After the three progressively stacked residual units sequentially perform feature occlusion operations from the DropBlock regularization module layer and the MaxPooling pooling layer, the feature extraction from the enhanced image data is completed, yielding crack features.

3. The crack image segmentation method according to claim 2, characterized in that, The DopBlock regularization module layer uses a square mask region with a block size of 7 for feature occlusion. The DropBlock regularization module layer calculates the probability of the center of the dropped block for the block size and the retention probability. Then, it generates a Bernoulli mask based on the calculated probability of the center of the dropped block. When the Bernoulli mask value is 1, it represents the center of the potential descent region. Max pooling is used to expand the Bernoulli mask, and the expanded mask is inverted to obtain the final occlusion mask. Feature occlusion is performed based on the final occlusion mask.

4. The crack image segmentation method according to claim 3, characterized in that, The probability of the center of the fallen block The calculation formula is as follows: In the formula, To preserve probability, The block size of the square mask area. The height of the input feature map, The width of the input feature map; Then, based on the calculated probability of the center of the fallen block... Generate a Bernoulli mask, the formula for which the Bernoulli mask is calculated is as follows: In the formula, Bernoulli mask Each element in All follow a Bernoulli distribution Bernoulli mask Extend the mask to obtain the extended mask. The calculation formula is as follows: In the formula, This indicates that the Bernoulli mask The center of the falling block expands to blocky 1, Indicates the step size. This indicates that the padding method is the same size padding, which will expand the mask. The inversion process is performed to obtain the final occlusion mask. The final occlusion mask The calculation formula is as follows: At this point, the final masking layer is applied. In the diagram, a value of 1 indicates that the feature is activated and is preserved, while a value of 0 indicates that the feature needs to be suppressed, i.e., the occluded area.

5. The crack image segmentation method according to claim 4, characterized in that, To avoid abnormal amplitude of the input feature map due to occlusion operations, a final occlusion mask is used. The activation locations of the preserved features with a median value of 1 are scaled. This scaling ensures that the overall energy of the input feature map remains consistent with that before occlusion, using a scaling factor. The calculation formula is as follows: In the formula, The number of channels in the input feature map. For final masking At an altitude of Width is and the number of channels is The element value at the position is determined by the final occlusion mask. And the scaling factor, to obtain the output tensor Output tensor The calculation formula is: in To output the tensor at a height of Width is and the number of channels is The element value at position, The input feature map without occlusion processing is at a height of Width is and the number of channels is The original feature values ​​of the location, output tensor This refers to the crack features extracted by the encoder.

6. The crack image segmentation method according to claim 1, characterized in that, The process involves decoding the crack features using a decoder symmetrical to the encoder, refining the crack features extracted by the encoder, restoring the image spatial resolution of the crack features, and restoring the fine structure of the crack boundaries. Specifically, upsampling allows the model to reconstruct the segmentation mask with high pixel-level precision. The reconstruction process starts from upsampling block 1, which uses the transposed convolutional layer of the upsampling unit to upsample the crack features output by the encoder. Upsampling block 2 continues to use the transposed convolutional layer in upsampling block 1 for sampling. Upsampling block 3 further upsamples the crack features output by upsampling block 2 to the resolution of the original crack surface image data, thus completing the restoration of the image spatial resolution of the crack features.

7. The crack image segmentation method according to claim 1, characterized in that, By minimizing the DenseCRF energy function, the optimal label assignment for each pixel in the crack probability distribution map is obtained, thus incorporating the spatial correlation between adjacent pixels in the crack probability distribution map into the segmentation process, resulting in the final crack segmentation map. The DenseCRF energy function is as follows: in This indicates the label assignment for each pixel. The unary potential of the DenseCRF energy function is defined as the negative logarithm of the predicted softmax probability. The potential for the DenseCRF energy function is a two-dimensional potential. For the first A label of 1 pixel, For the first A label of 1 pixel.

8. A crack image segmentation system, characterized in that, It includes an image enhancement module, a feature extraction module, a feature optimization module, and a crack segmentation module; The image enhancement module is used to acquire the original crack surface image data, introduce Gaussian noise with a standard deviation of 0.1 into the original crack surface image data, simulate the lighting changes, imaging blur and sensor interference in the actual scene, and perform enhancement processing. The feature extraction module is used to extract features from the enhanced image data using an encoder composed of three progressively stacked residual units to obtain crack features; each residual unit includes a weighted normalized convolutional layer, a group normalization layer, a ReLU activation function layer, a DropBlock regularization module layer, and a MaxPooling pooling layer in sequence. The DropBlock regularization module layer uses a square mask region with a block size of 7; The feature optimization module's decoder consists of a structure symmetrical to the encoder, comprising three upsampling units: upsampling block 1, upsampling block 2, and upsampling block 3. Each upsampling unit consists of a transposed convolutional layer, a GN layer, and a ReLU activation function layer to progressively restore the fine structure of the crack boundaries. The decoder, symmetrical to the encoder, decodes the crack features, restoring the image spatial resolution of the crack features and reconstructing the fine structure of the crack boundaries. The decoded crack features are then subjected to a double convolution to output a crack probability distribution map. A symmetrical unified focus loss function is introduced to enhance the spatial coherence between pixels in the crack probability distribution map while maintaining intensity. Consistency; The decoded crack features are subjected to two-layer convolution to output a crack probability distribution map; Specifically, the decoded crack features are multi-channel features, which are processed sequentially by two WS layers. The first WS layer uses 32 filters and a 3×3 kernel. After convolution, the first WS layer is connected to a GN layer and a ReLU activation function layer to further optimize the detailed expression of the crack features and refine the features for subsequent probability output; The second WS layer uses a 3×3 kernel to compress the multi-channel features output by the first WS layer into single-channel features, and applies a sigmoid activation function to generate a probability output, forming a crack probability distribution map; The crack segmentation module uses a dense conditional random field to optimize the crack probability distribution map and outputs the final crack segmentation map.

Citation Information

Patent Citations

  • Method and device for identifying ground surface cracks in mining area and computer program product

    CN119151889A

  • Building contour extraction and regularization method and device based on satellite image, equipment and medium

    CN120526320A