Concrete crack segmentation and robust quantization method based on lightweight dual-stream network

By employing a lightweight dual-stream network and interquartile range filtering anti-distortion calibration method, the problems of computational resources and environmental interference in concrete crack detection are solved, achieving efficient and accurate crack segmentation and quantification.

CN122391633APending Publication Date: 2026-07-14SOUTH CHINA UNIV OF TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2026-04-03
Publication Date
2026-07-14

Smart Images

  • Figure CN122391633A_ABST
    Figure CN122391633A_ABST
Patent Text Reader

Abstract

The application discloses a concrete crack segmentation and robust quantification method based on a lightweight double-flow network, comprising the following steps: S1, obtaining a concrete crack image to be detected, constructing a double evaluation index to remove low-quality images, and generating a standardized crack dataset; S2, constructing a lightweight double-flow feature extraction and segmentation network based on an encoder-decoder architecture; S3, constructing a composite loss function comprising a main flow loss, an edge flow loss and a fusion flow loss, and using the crack dataset to perform end-to-end optimization training on the network to obtain an optimal segmentation network; S4, inputting the image to be detected into the trained segmentation network to obtain a crack segmentation mask, and combining an anti-distortion calibration method based on quartile distance statistics filtering to calculate a robust physical transformation coefficient of a reference object, and then calculating the real physical parameters of the crack. The application solves the problems of high model calculation complexity, low fine crack edge segmentation precision and physical quantification parameters susceptible to reference object distortion interference in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of civil engineering structural health monitoring technology, specifically relating to a method for concrete crack segmentation and robust quantification based on a lightweight dual-flow network. Background Technology

[0002] Concrete cracks are an early sign of structural deterioration in infrastructure such as bridges and tunnels. Traditional crack detection relies mainly on manual visual inspection, which is inefficient and highly subjective. In recent years, deep learning technology has made significant progress in crack detection. However, existing technologies face two major technical bottlenecks in practical engineering deployment:

[0003] First, there is a conflict between computing resources and real-time performance. Traditional encoder-decoder models (such as the standard UNet++) have a huge number of parameters, with floating-point operations (FLOPs) often exceeding 100G, making it difficult to run on devices with limited computing power, such as drones or handheld terminals.

[0004] Second, feature loss and edge blurring; cracks are characterized by their narrow shape and low contrast. After multiple downsampling, a large amount of high-frequency edge information is lost, resulting in broken or rough edges in the segmentation results, which seriously affects the accuracy of subsequent crack width measurement. In addition, in actual detection, reference objects often suffer geometric distortion due to uneven pasting, leading to large errors in physical parameter conversion. Summary of the Invention

[0005] The main objective of this invention is to overcome the shortcomings and deficiencies of the prior art and to propose a method for concrete crack segmentation and robust quantification based on a lightweight dual-flow network.

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

[0007] A method for concrete crack segmentation and robust quantification based on lightweight two-flow networks includes the following steps:

[0008] S1. Multidimensional feature data cleaning and dataset construction: Obtain images of concrete cracks to be detected, construct dual evaluation indicators to remove low-quality images, and generate a standardized crack dataset.

[0009] S2. Construct a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture. The network includes a composite scaling encoder for feature extraction, a hybrid receptive field bottleneck module for enhancing global context, a lightweight decoder based on depthwise separable convolution, and a two-stream decoupled output head for predicting the crack body and edge respectively.

[0010] S3. Network Training and Optimization: Construct a composite loss function that includes main flow loss, edge flow loss and fusion flow loss, and use the crack dataset to perform end-to-end optimization training on the network to obtain the optimal segmentation network;

[0011] S4. Crack segmentation and robust parameter quantization for distortion resistance: The image to be tested is input into the trained segmentation network to obtain the crack segmentation mask. The robust physical transformation coefficients of the reference object are calculated by combining the distortion resistance calibration method based on interquartile range statistical filtering, and then the true physical parameters of the crack are calculated.

[0012] The present invention also includes a concrete crack segmentation and robust quantization system based on a lightweight dual-stream network. The system adopts the concrete crack segmentation and robust quantization method based on a lightweight dual-stream network provided by the present invention. The system includes a data cleaning module, a network construction module, a network training module, and a crack segmentation and parameter calculation module.

[0013] The data cleaning module is used to acquire images of concrete cracks to be detected, construct dual evaluation indicators to remove low-quality images, and generate a standardized crack dataset.

[0014] The network building module is used to build a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture;

[0015] The network training module is used to construct a composite loss function that includes the main flow loss, edge flow loss, and fusion flow loss, and to perform end-to-end optimization training on the network using the crack dataset.

[0016] The crack segmentation and parameter calculation module is used to obtain the crack segmentation mask of the input image under test using a trained segmentation network, and calculate the robust physical transformation coefficient of the reference object by combining the anti-distortion calibration method based on interquartile range statistical filtering, and then calculate the true physical parameters of the crack.

[0017] The present invention also includes a computer-readable storage medium storing a program that, when executed by a processor, implements the concrete crack segmentation and robust quantization method based on a lightweight dual-stream network provided by the present invention.

[0018] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0019] 1. This invention addresses the problems of high computational load, low edge segmentation accuracy, and susceptibility of quantization parameters to environmental and medium distortion in existing crack detection methods. It proposes a lightweight, high-precision solution. First, data is cleaned using a dual filtering mechanism based on Laplacian gradient and frequency domain energy. Then, a deep neural network is constructed, comprising an efficient encoder, a hybrid receptive field bottleneck module, a lightweight decoder, and a dual-stream decoupled output head. During the training phase, a composite loss function is used to constrain the crack body and edges. Finally, a distortion-resistant calibration algorithm based on interquartile range statistical filtering is used to achieve robust quantization of physical parameters.

[0020] 2. This invention reconstructs the architecture by introducing the theoretical formula of depthwise separable convolution, achieving extreme lightweight and high efficiency. The model's FLOPs are significantly reduced compared to the standard UNet++, the single-round running time is significantly shortened, and the inference efficiency is significantly improved. Moreover, the hybrid receptive field module effectively combines the local feature extraction capability of CNN with the global modeling capability of Transformer to achieve high-precision segmentation performance.

[0021] 3. The anti-distortion calibration method based on interquartile range (IQR) statistical filtering proposed in this invention effectively eliminates the measurement error caused by the curling of the reference object and realizes sub-millimeter level crack width measurement. Attached Figure Description

[0022] Figure 1 This is a flowchart of the method of the present invention.

[0023] Figure 2 This is a schematic diagram of multidimensional feature data cleaning in this invention.

[0024] Figure 3 This is a schematic diagram of the overall architecture of the lightweight dual-stream feature extraction and segmentation network in this invention.

[0025] Figure 4 This is a schematic diagram of the hybrid receptive field bottleneck module in this invention.

[0026] Figure 5 This is a schematic diagram of the lightweight decoder in this invention.

[0027] Figure 6 This is a schematic diagram of the dual-flow decoupling output head in this invention.

[0028] Figure 7 This is a flowchart of the anti-distortion parameter quantization based on statistical filtering in the embodiment.

[0029] Figure 8 This is a schematic diagram of the system in the embodiment. Detailed Implementation

[0030] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0031] Examples; such as Figure 1 As shown, the concrete crack segmentation and robust quantification method based on lightweight dual-flow network includes the following steps:

[0032] S1. Multidimensional feature data cleaning and dataset construction: Obtain images of concrete cracks to be detected, construct dual evaluation indicators to remove low-quality images, and generate a standardized crack dataset.

[0033] When acquiring images at engineering sites, image quality is often degraded due to equipment vibration or insufficient lighting. To ensure model performance from the outset, this embodiment designs a dual evaluation index screening mechanism in both the spatial and frequency domains for data cleaning, such as... Figure 2 As shown.

[0034] The spatial gradient filtering method involves using the Laplacian operator to calculate the second-order gradient variance of the image to remove motion-blurred images. The formula is as follows:

[0035] ;

[0036] in, For the input image, In response to Laplace, The mean of the response;

[0037] The frequency domain energy screening involves analyzing the image texture richness using Fast Fourier Transform (FFT), setting the low-frequency region at the center of the spectrum to zero, and calculating the logarithmic mean of the remaining high-frequency region. The formula is as follows:

[0038] ;

[0039] in, For the spectrum of the image, This is the set of high-frequency regions after removing the central low-frequency region. A minimal constant introduced to prevent the independent variable of the logarithmic function from being zero;

[0040] Then set the threshold. and Remove and Images;

[0041] After removing low-quality images, the remaining high-quality concrete crack images are obtained, covering a variety of scenes. All images are uniformly cropped and manually annotated at the pixel level, with cracks being 1 and background being 0. Finally, they are randomly divided into training and validation sets according to the proportion.

[0042] In this embodiment, after data cleaning, 5042 high-quality concrete crack images were selected from the original collected data, covering various scenes such as bridges, tunnels, and road surfaces. All images were uniformly cropped to 512×512 pixels and manually labeled at the pixel level (cracks = 1, background = 0). Finally, they were randomly divided into a training set (4034 images) and a validation set (1008 images) at an 8:2 ratio, providing a high-quality data foundation for subsequent network model training.

[0043] S2. Construct a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture. The network includes a composite scaling encoder for feature extraction, a hybrid receptive field bottleneck module for enhancing global context, a lightweight decoder based on depthwise separable convolution, and a two-stream decoupled output head for predicting the crack body and edges separately.

[0044] In this embodiment, to address the issues of parameter redundancy, slow inference speed, and easy breakage of fine edges in traditional segmentation models (such as standard UNet++), this embodiment constructs an EfficientUNet++ Dual-Stream network, such as... Figure 3 The diagram shown is a schematic of the constructed lightweight two-stream feature extraction and segmentation network.

[0045] The EfficientNet Backbone uses EfficientNet-b4, pre-trained on ImageNet, as its backbone network, replacing traditional VGG or ResNet. EfficientNet achieves an optimal balance between depth, width, and resolution through a compound scaling strategy, enabling the extraction of robust multi-scale semantic features. The compound scaling encoder consists of multiple moving inverted bottleneck convolutional modules (MBConv) stacked together. It primarily includes 1×1 pointwise convolutions for channel upscaling, 3×3 or 5×5 depthwise separable convolutions for spatial feature extraction, a Squeeze-and-Excitation (SE) attention mechanism for channel weight recalibration, and finally, 1×1 pointwise convolutions for dimensionality reduction. Swish activation functions are used between layers.

[0046] The hybrid receptive field bottleneck module is located at the end of the encoder, at the connection point between the encoder and the decoder, such as... Figure 4 As shown, this module contains parallel multi-scale dilated convolution branches and a global self-attention branch;

[0047] The multi-scale dilated convolution branch (ASPP) consists of five parallel sub-branches: a 1×1 standard convolution branch, three 3×3 dilated convolution branches with dilation rates of 2, 4, and 6, and a branch that introduces global average pooling followed by a 1×1 convolution and bilinear upsampling. The outputs of the five branches are concatenated along the channel dimension and then fused by a 1×1 convolution. This is combined with a batch normalization (BN) layer, ReLU activation, and a dropout layer with a dropout rate of 0.5 to expand the receptive field and capture multi-scale local context without reducing resolution.

[0048] The global self-attention branch establishes long-distance pixel dependencies through a lightweight self-attention mechanism. Introducing the Transformer mechanism, it first adjusts the number of channels using a 1×1 convolution to generate a query, key, and value matrix, and then calculates the global pixel similarity matrix using the following formula:

[0049] ;

[0050] in, For input features, , , These are query, key, and value matrices, respectively. The scaling factor is the self-attention output multiplied by the learnable residual scaling factor. Post-input features The residuals are summed, followed by 1×1 convolution and BN and ReLU activation;

[0051] Finally, the outputs of the multi-scale dilated convolution branch and the global self-attention branch are concatenated along the channel dimension and then fused together via a 1×1 convolution with a BN layer and a ReLU activation function for the final output.

[0052] Lightweight decoder (Separable Decoder, such as) Figure 5 As shown, in order to adapt to the computing power limitations of embedded devices, the computationally intensive standard convolutional blocks (VGG Blocks) in the original UNet++ are replaced with depth-separable convolutional blocks (Separable VGG Blocks).

[0053] The lightweight decoder receives skip connection features from the same layer encoder and features from the lower layer decoder after bilinear upsampling with a scaling factor of 2. The two are concatenated along the channel dimension and then input into this module.

[0054] Each depthwise separable convolutional block contains two consecutive feature extraction and normalization processes: each operation decomposes traditional convolution into two steps: channel-wise convolution and pointwise convolution, specifically:

[0055] First, each input channel is processed individually using a 3×3 channel-wise convolution with the number of groups equal to the number of input channels (only spatial features are extracted, without bias). Then, a 1×1 pointwise convolution is performed to fuse cross-channel information. After each separable convolution, a batch normalization layer (BatchNorm2d) and a ReLU activation function are sequentially connected.

[0056] The lightweight decoder uses depthwise separable convolution operations instead of standard convolution operations, and the reduction in computational cost satisfies the following relationship: Let the number of input channels be... The number of output channels is The kernel size is The feature map size is The computational cost of depth-separable convolution is... Computational complexity compared to standard convolution ratio for:

[0057] .

[0058] Dual-Stream Head; to further improve the fineness of edge segmentation, such as... Figure 6 As shown, this embodiment designs a dual-stream decoupling structure at the decoder end, decoupling the network decoding end features into a main stream and an edge stream:

[0059] Body Stream: Focuses on predicting the internal backbone region of the crack;

[0060] Edge Stream: Focuses on predicting the fine contour boundaries of cracks.

[0061] Finally, the decoder output features are fed into parallel segmentation body convolutional layers and segmentation edge convolutional layers:

[0062] The main stream branch extracts main features through a 1×1 two-dimensional convolutional layer (Conv2d) with the number of output channels equal to the number of main categories, and then generates main prediction output through bilinear upsampling with a scaling factor of 2; the edge stream branch similarly extracts edge features through a 1×1 two-dimensional convolutional layer with the number of output channels equal to the number of edge categories, and then generates edge prediction output through bilinear upsampling by 2x.

[0063] Finally, the two prediction tensors are fused element-wise and mapped to the [0,1] interval using the Sigmoid activation function to obtain the final binarized crack mask.

[0064] Table 1 below shows the results of the system ablation experiment, which can intuitively demonstrate the impact of improvements to each module on model performance.

[0065] Table 1 Comparison of ablation experiments on model performance at different improvement stages of the present invention

[0066]

[0067] As shown in Table 1, compared to the standard UNet++ (FLOPs as high as 139.61 G, IoU only 75.57%), the introduction of the EfficientNet encoder significantly reduced the model's FLOPs to 43.19 G, while the validation set IoU significantly improved to 83.35%. After adding the hybrid receptive field bottleneck module, the model maintained a low computational cost (42.53 G), the validation set IoU stabilized at 83.07%, and the Dice coefficient reached 90.67%, effectively suppressing background noise and enhancing crack connectivity. Applying the lightweight decoder resulted in a qualitative change in the model's computational complexity, with FLOPs plummeting to 16.96 G, only about 11.7% of the original UNet++. Although the single-round runtime slightly increased to 110 s due to the increased number of layers, the accuracy remained unaffected (IoU 83.59%). Compared to DeepLabv3+, which has extremely low FLOPs (2.78 G) but insufficient accuracy (IoU 81.40%), this solution maintains state-of-the-art performance with very low computational power. Compared to the single-stream complete model (IoU 83.64%), the introduction of the dual-stream mechanism slightly adjusts the FLOPs to 16.30 G, but achieves peak performance, with a validation set IoU of 85.15%, a Dice coefficient of 91.19%, and a recall of 91.55%. This demonstrates that separately constraining edge and main features can significantly improve the consistency of segmentation.

[0068] S3. Network Training and Optimization; Construct a composite loss function that includes main flow loss, edge flow loss, and fusion flow loss. Use the crack dataset to perform end-to-end optimization training on the network to obtain the optimal segmentation network. In this embodiment, the composite loss function is specifically expressed as follows:

[0069] ;

[0070] in, , and These are the weighting coefficients; To mitigate the main flow loss, a combination of binary cross-entropy and Dice coefficients is employed to ensure the accuracy of the overall segmentation. For edge flow loss, Focal Loss is adopted, which focuses on solving the sample imbalance problem caused by the extremely small proportion of edge pixels in the image; To compensate for the fusion flow loss, Lovasz-HingeLoss is adopted to directly optimize the IoU evaluation metric and maximize segmentation accuracy.

[0071] This embodiment is based on the PyTorch deep learning framework and is implemented on a detection workstation equipped with an Intel Core i5-126KF CPU, an NVIDIA GeForce RTX 4060Ti GPU, and 32GB of RAM. The operating system is Windows 11 22H2, CUDA version 12.6, and PyTorch 2.7.1 framework. An end-to-end training strategy is adopted, using the AdamW optimizer to train the network model. The initial learning rate is set to 1e-4, and a cosine annealing strategy is used to dynamically decay the learning rate to 1e-5 to avoid getting trapped in local optima. The input image size is 512×512, the batch size is set to 8, and the training lasts for 200 epochs. A composite loss function is used for training. Multi-objective collaborative optimization of the network.

[0072] S4. Crack segmentation and anti-distortion robust parameter quantization: Input the image to be tested into the trained segmentation network to obtain the crack segmentation mask, and combine it with the anti-distortion calibration method based on interquartile range statistical filtering to calculate the robust physical transformation coefficient of the reference object, and then calculate the true physical parameters of the crack.

[0073] In this embodiment, the image to be measured is input into a trained segmentation network, which outputs a high-precision binary crack mask, followed by physical parameter calculation. Addressing the problem that engineering field reference objects (such as paper checkerboard calibration cards) often suffer from geometric distortion due to moisture, curling edges, or uneven pasting, leading to measurement errors, this embodiment designs a robust calibration method based on interquartile range (IQR) statistical filtering, such as... Figure 7 As shown, it includes:

[0074] (1) Subpixel corner extraction: First, the original image containing the reference object is grayscaled to detect the rough corners of the checkerboard; then, subpixel-level optimization is performed to obtain a precise set of corner coordinates.

[0075] (2) Full neighborhood distance sampling; traverse all adjacent corner pairs within the chessboard (including horizontal and vertical adjacency). Calculate the distance between each pair of adjacent corners. Euclidean distance between The actual physical side lengths of the chessboard are known. (For example, 20mm), then the scaling factor for this local area is This yields a sample set of scaling factors for the entire image. .

[0076] (3) IQR statistical filtering removes anomalies; curling or tilting can cause distortion in the pixel size of local cells, thus producing anomalies. Therefore, robust statistical methods are introduced:

[0077] Compute set First quartile (25th percentile) and third quartile (75th percentile); Calculate the interquartile range Define the valid data range as Remove all outlier coefficients falling outside this interval to obtain the cleaned sample set. For sets Calculate the mean to obtain the globally robust calibration coefficients. .

[0078] (4) Quantization of crack physical parameters; based on the binary mask of the crack obtained from segmentation. and calibration coefficients Calculate physical properties:

[0079] Actual length : For the mask Perform skeletonization to obtain a skeleton with a width of one pixel. Count the total number of skeleton pixels ,but ;

[0080] Actual width : For the mask Perform a distance transformation to obtain a distance map. (Each pixel value in the image represents the distance from that point to the nearest background point); Extract the skeleton. The corresponding location is shown in the distance map. The set of numbers in Calculate the mean (or maximum value) of the set. Since the distance transformation value is the radius, the physical width... ;

[0081] Actual area Statistical mask Total number of pixels in the middle crack ,but .

[0082] In this embodiment, the effectiveness of the method is finally verified by experiments. The experimental results show that, in actual test scenarios containing edge curling interference, compared with the traditional mean calibration method (error of about 8-12%), the anti-distortion algorithm of this embodiment successfully eliminates the abnormal scaling factor caused by edge curling, reducing the measurement error of crack width to within 5%, thus ensuring the reliability of detection in non-ideal engineering environments. The complete comparison results of crack parameter quantification are shown in Table 2 below.

[0083] Table 2 Comparison of Crack Parameter Quantification Experiments of the Invention

[0084]

[0085] In summary, the method of this invention effectively solves the two major problems of high computational load and low quantization accuracy in existing technologies. By introducing the EfficientNet encoder and the hybrid receptive field bottleneck module, the model achieves a high-precision segmentation with an IoU of 85.15% with an ultra-low computational requirement of only 16.30 G FLOPs, significantly outperforming traditional heavy networks such as UNet++. Furthermore, the distortion-resistant calibration algorithm based on IQR statistical filtering in this invention can automatically eliminate abnormal scaling coefficients caused by curled or tilted reference objects, achieving robust quantization of crack parameters at the sub-millimeter level in complex engineering environments.

[0086] The method of this invention features a sophisticated data closed-loop and network inference process in its overall architecture: First, in the data preprocessing stage, a dual screening mechanism of spatial Laplacian gradient and frequency domain FFT energy is introduced to remove low-quality data such as blurry or overexposed data from the source; Second, in the network construction stage, an improved encoder-decoder architecture is adopted. The encoder uses EfficientNet to efficiently extract multi-scale features and embeds a hybrid receptive field bottleneck module to balance local details and global long-range dependencies. The decoder innovatively uses depthwise separable convolution to reconstruct features and recover paths, significantly reducing the computational load. At the end, a dual-stream decoupling head is designed to constrain the generation of the crack body and edges respectively; Finally, in the quantization stage, an anti-distortion calibration method based on IQR statistical filtering is proposed to effectively solve the measurement errors caused by the curling of reference objects or the tilt of the camera in the engineering field.

[0087] Based on the same idea as the concrete crack segmentation and robust quantification method based on lightweight dual-flow networks in the above embodiments, this invention also provides a concrete crack segmentation and robust quantification system based on lightweight dual-flow networks. This system can be used to execute the aforementioned concrete crack segmentation and robust quantification method based on lightweight dual-flow networks. For ease of explanation, the structural schematic diagram of the embodiment of the concrete crack segmentation and robust quantification system based on lightweight dual-flow networks only shows the parts related to the embodiments of this invention. Those skilled in the art will understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0088] like Figure 8 As shown, a concrete crack segmentation and robust quantification system 100 based on a lightweight dual-stream network is provided. The system includes a data cleaning module 101, a network construction module 102, a network training module 103, and a crack segmentation and parameter calculation module 104.

[0089] The data cleaning module is used to acquire images of concrete cracks to be detected, construct dual evaluation indicators to remove low-quality images, and generate a standardized crack dataset.

[0090] The network building module is used to build a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture;

[0091] The network training module is used to construct a composite loss function that includes the main flow loss, edge flow loss, and fusion flow loss, and to perform end-to-end optimization training on the network using the crack dataset.

[0092] The crack segmentation and parameter calculation module uses a trained segmentation network to obtain the crack segmentation mask of the input image to be tested, and combines it with an anti-distortion calibration method based on interquartile range statistical filtering to calculate the robust physical transformation coefficients of the reference object, and then calculates the true physical parameters of the crack.

[0093] It should be noted that the concrete crack segmentation and robust quantification system based on lightweight dual-flow network corresponds one-to-one with the concrete crack segmentation and robust quantification method based on lightweight dual-flow network. The technical features and beneficial effects described in the embodiments of the concrete crack segmentation and robust quantification method based on lightweight dual-flow network described above are applicable to the embodiments of the concrete crack segmentation and robust quantification system based on lightweight dual-flow network. For details, please refer to the description in the embodiments of the method of this invention, which will not be repeated here.

[0094] Furthermore, in the above implementation of the concrete crack segmentation and robust quantification system based on lightweight dual-flow network, the logical division of each program module is only an example. In actual applications, the above functions can be assigned to different program modules as needed, for example, for the sake of corresponding hardware configuration requirements or software implementation convenience. That is, the internal structure of the concrete crack segmentation and robust quantification system based on lightweight dual-flow network is divided into different program modules to complete all or part of the functions described above.

[0095] In another embodiment, a computer-readable storage medium is provided storing a program that, when executed by a processor, implements the concrete crack segmentation and robust quantization method based on a lightweight dual-stream network of the present invention, specifically:

[0096] Acquire images of concrete cracks to be detected, construct a dual evaluation index to remove low-quality images, and generate a standardized crack dataset;

[0097] A deep neural network based on an encoder-decoder architecture is constructed. The network includes a composite scaling encoder for feature extraction, a hybrid receptive field bottleneck module for enhancing global context, a lightweight decoder based on depthwise separable convolution, and a two-stream decoupled output head for predicting the crack body and edge separately.

[0098] A composite loss function comprising main flow loss, edge flow loss, and fusion flow loss is constructed, and the network is optimized end-to-end using the crack dataset to obtain the optimal segmentation network;

[0099] The image to be tested is input into the trained segmentation network to obtain the crack segmentation mask. The robust physical transformation coefficients of the reference object are calculated by combining the anti-distortion calibration method based on interquartile range statistical filtering, and then the true physical parameters of the crack are calculated.

[0100] The computer-readable storage medium may be transient or non-transient. Exemplary examples include, but are not limited to, various media capable of storing computer program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0101] For example, the processor may be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.

[0102] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0103] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for concrete crack segmentation and robust quantification based on lightweight dual-flow networks, characterized in that, Includes the following steps: S1. Multidimensional feature data cleaning and dataset construction; Acquire images of concrete cracks to be detected, construct a dual evaluation index to remove low-quality images, and generate a standardized crack dataset; S2. Construct a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture. The network includes a composite scaling encoder for feature extraction, a hybrid receptive field bottleneck module for enhancing global context, a lightweight decoder based on depthwise separable convolution, and a two-stream decoupled output head for predicting the crack body and edge respectively. S3. Network Training and Optimization: Construct a composite loss function that includes main flow loss, edge flow loss and fusion flow loss, and use the crack dataset to perform end-to-end optimization training on the network to obtain the optimal segmentation network; S4. Crack segmentation and robust parameter quantization for distortion resistance: The image to be tested is input into the trained segmentation network to obtain the crack segmentation mask. The robust physical transformation coefficients of the reference object are calculated by combining the distortion resistance calibration method based on interquartile range statistical filtering, and then the true physical parameters of the crack are calculated.

2. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S1, a dual evaluation index is constructed to remove low-quality images, specifically as follows: The second-order gradient variance of an image is calculated using the Laplacian operator to remove motion-blurred images. The formula is as follows: ; in, For the input image, In response to Laplace, The mean of the response; To analyze image texture richness using Fast Fourier Transform, the low-frequency region at the center of the spectrogram is set to zero, and the logarithmic mean of the remaining high-frequency region is calculated using the following formula: ; in, For the spectrum of the image, This is the set of high-frequency regions after removing the central low-frequency region. A constant introduced to prevent the independent variable of the logarithmic function from being zero; Set threshold and Remove and Images; In step S1, generating the standardized crack dataset specifically involves: After removing low-quality images, the remaining high-quality concrete crack images are obtained, covering a variety of scenes. All images are uniformly cropped and manually annotated at the pixel level, with cracks being 1 and background being 0. Finally, they are randomly divided into training and validation sets according to the proportion.

3. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S2, the composite scaling encoder uses EfficientNet-b4 pre-trained on ImageNet as the backbone network. The composite scaling encoder is composed of multiple moving inverted bottleneck convolutional modules stacked together, including 1×1 pointwise convolution for channel dimensionality upscaling, 3×3 or 5×5 depthwise separable convolution to extract spatial features, combined with the Squeeze-and-Excitation attention mechanism for channel weight recalibration, and finally output through 1×1 pointwise convolution for dimensionality reduction. The Swish activation function is used between layers. The hybrid receptive field bottleneck module is located at the end of the encoder, at the connection between the encoder and the decoder. This module contains parallel multi-scale dilated convolution branches and global self-attention branches. The multi-scale dilated convolution branch contains five parallel sub-branches: a 1×1 standard convolution branch, three 3×3 dilated convolution branches with dilation rates of 2, 4, and 6, and a branch that introduces global average pooling followed by a 1×1 convolution and performs bilinear upsampling. The outputs of the five branches are concatenated along the channel dimension and then fused by a 1×1 convolution. This is combined with a batch normalization layer, ReLU activation, and a Dropout layer with a dropout rate of 0.5 to expand the receptive field and capture multi-scale local context without reducing resolution. The global self-attention branch establishes long-distance pixel dependencies through a lightweight self-attention mechanism. Introducing the Transformer mechanism, it first adjusts the number of channels using a 1×1 convolution to generate a query, key, and value matrix, and then calculates the global pixel similarity matrix using the following formula: ; in, For input features, , , These are query, key, and value matrices, respectively. The scaling factor is the self-attention output multiplied by the learnable residual scaling factor. Post-input features The residuals are summed, followed by 1×1 convolution and BN and ReLU activation; Finally, the outputs of the multi-scale dilated convolution branch and the global self-attention branch are concatenated along the channel dimension and then fused together via a 1×1 convolution with a BN layer and a ReLU activation function for the final output.

4. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S2, the lightweight decoder replaces the computationally intensive standard convolutional blocks in the original UNet++ with depthwise separable convolutional blocks. The lightweight decoder receives skip connection features from the same layer encoder and features from the lower layer decoder after bilinear upsampling with a scaling factor of 2. The two are concatenated along the channel dimension and then input into this module. Each depthwise separable convolutional block contains two consecutive feature extraction and normalization processes: each operation decomposes the traditional convolution into two steps: channel-wise convolution and pointwise convolution, specifically: First, each input channel is processed individually using a 3×3 channel-wise convolution with the number of groups equal to the number of input channels. Then, a 1×1 pointwise convolution is performed to fuse cross-channel information. After each separable convolution, a batch normalization layer and a ReLU activation function are sequentially connected. The lightweight decoder uses depthwise separable convolution operations instead of standard convolution operations, and the reduction in computational cost satisfies the following relationship: Let the number of input channels be... The number of output channels is The kernel size is The feature map size is The computational cost of depth-separable convolution is... Computational complexity compared to standard convolution ratio for: 。 5. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S2, the dual-stream decoupling output head decouples the features at the network decoding end into the main stream and the edge stream; Finally, the decoder output features are fed into parallel segmentation body convolutional layers and segmentation edge convolutional layers: The main stream branch extracts main features through a 1×1 two-dimensional convolutional layer with the number of output channels equal to the main category, and then generates the main prediction output through bilinear upsampling with a scaling factor of 2. The edge flow branch also extracts edge features through a 1×1 two-dimensional convolutional layer with the number of output channels equal to the edge category, and then generates edge prediction output through 2x bilinear upsampling; Finally, the two prediction tensors are added and fused element by element, and then mapped to the [0,1] interval through the Sigmoid activation function to obtain the final binarized crack mask.

6. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S3, the composite loss function is specifically expressed as follows: ; in, For the main flow loss, a combination of binary cross-entropy and Dice loss is adopted; Focal Loss is used for edge flow loss to address sample imbalance; To optimize the IoU metric, Lovasz-Hinge Loss is used to compensate for the fusion stream loss. , and These are the weighting coefficients.

7. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S3, an end-to-end training strategy is adopted, and the network model is trained using the AdamW optimizer. The initial learning rate is set to 1e-4, and the learning rate is dynamically decayed to 1e-5 using a cosine annealing strategy to avoid getting trapped in local optima.

8. The concrete crack segmentation and robust quantification method based on a lightweight dual-flow network according to claim 1, characterized in that, In step S4, the robust physical transformation coefficients of the reference object are calculated using the anti-distortion calibration method based on interquartile range statistical filtering, specifically as follows: First, the original image containing the reference object is converted to grayscale to detect coarse corner points; then, sub-pixel level optimization is performed to obtain a precise set of corner point coordinates. Extract the set of Euclidean distances for all pairs of adjacent corner points of the reference object. For each pair of adjacent corner points Euclidean distance ; Compute set The corresponding physical scaling factor set ,in , The actual physical side length of the reference lattice; Compute set First quartile and the third and fourth quartiles Calculate the interquartile range Define the valid data range After removing outliers outside the interval, the mean of the remaining samples is calculated as the final robustness calibration coefficient. ; In step S4, the actual physical parameters of the crack are calculated, specifically as follows: Based on the crack binary mask obtained from segmentation and calibration coefficients Calculate physical properties; Actual length : For the mask Perform skeletonization to obtain a skeleton with a width of one pixel. Count the total number of skeleton pixels ,but ; Actual width : For the mask Perform a distance transformation to obtain a distance map. In the image, each pixel value represents the distance from that point to the nearest background point; skeleton extraction. The corresponding location is on the distance map. The set of numbers in Calculate the mean or maximum value of the set, and the physical width. ; Actual area Statistical mask Total number of pixels in the middle crack ,but .

9. A concrete crack segmentation and robust quantification system based on a lightweight dual-flow network, characterized in that, The system adopts the concrete crack segmentation and robust quantization method based on lightweight dual-stream network as described in any one of claims 1-8. The system includes a data cleaning module, a network construction module, a network training module, and a crack segmentation and parameter calculation module. The data cleaning module is used to acquire images of concrete cracks to be detected, construct dual evaluation indicators to remove low-quality images, and generate a standardized crack dataset. The network building module is used to build a lightweight two-stream feature extraction and segmentation network based on an encoder-decoder architecture; The network training module is used to construct a composite loss function that includes the main flow loss, edge flow loss, and fusion flow loss, and to perform end-to-end optimization training on the network using the crack dataset. The crack segmentation and parameter calculation module is used to obtain the crack segmentation mask of the input image under test using a trained segmentation network, and calculate the robust physical transformation coefficient of the reference object by combining the anti-distortion calibration method based on interquartile range statistical filtering, and then calculate the true physical parameters of the crack.

10. A computer-readable storage medium storing a program, characterized in that, When the program is executed by the processor, it implements the concrete crack segmentation and robust quantization method based on a lightweight dual-flow network as described in any one of claims 1-8.