Lightweight concrete laminated slab crack detection method

By using a lightweight multi-scale context feature fusion model based on YOLOv8, the problem of low detection efficiency and accuracy in complex environments in the prior art is solved, and efficient and accurate crack detection and automatic quantization are achieved.

CN119850700AActive Publication Date: 2025-04-18CHINA UNIV OF MINING & TECH

Patent Information

Application Number
CN202411920538.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-18
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

The existing crack detection technology has problems of low detection efficiency and low accuracy in environments with narrow spaces, insufficient light or complex backgrounds.

Method used

Using a lightweight multi-scale context feature fusion model based on YOLOv8, crack features of different scales in the image are extracted and fused, and crack detection and segmentation are performed through the crack feature extraction module, feature fusion module and detection module.

Benefits of technology

It realizes crack detection that maintains high detection accuracy under complex backgrounds and different lighting conditions, reduces the calculation complexity and parameter quantity, is suitable for resource-constrained equipment, meets the needs of rapid on-site inspection, and can automatically quantify the length and width of cracks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850700A_ABST
    Figure CN119850700A_ABST
Patent Text Reader

Abstract

The invention relates to a lightweight concrete laminated slab crack detection method, belongs to the technical field of crack detection, and solves the problems of low detection efficiency and low detection precision in narrow space, insufficient light or complex background environment in the existing crack detection technology. The method comprises the following steps: acquiring a surface image of a to-be-detected concrete laminated slab; performing crack detection on the image through the trained crack detection model to obtain a crack detection result; the crack detection model comprises a crack feature extraction module, a crack feature fusion module and a crack detection module; the crack feature extraction module is used for extracting different scale features of the image; the crack feature fusion module is used for fusing the features of different scales to obtain a fusion enhanced feature map, a multi-scale fusion feature map and a context guide fusion feature map; the crack detection module outputs a feature map based on the crack feature fusion module to obtain a crack detection frame and a crack segmentation mask; and obtaining the width and length of the crack based on the crack segmentation mask.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of crack detection, and in particular to a method for detecting cracks in a lightweight concrete composite slab. Background Art

[0002] Concrete composite slabs are important components of prefabricated buildings. They are composed of prefabricated slabs and cast-in-place concrete layers through interface treatment. They are characterized by high construction efficiency, strong bearing capacity and high resource utilization, and are widely used in industrial plants, bridge projects and residential buildings. Due to the influence of stress concentration, environmental humidity fluctuations, temperature changes and improper construction operations during the stacking and construction of composite slabs, cracks are prone to occur in the bottom plate. If these cracks are not detected and repaired in time, they may extend to the interface layer, resulting in the degradation of the overall structural performance and even causing serious safety hazards.

[0003] Currently, the methods for concrete crack detection are mainly divided into manual detection and machine vision detection. Manual detection relies on experienced personnel to use visual inspection or measuring tools to check cracks. It is easy to operate and has low cost. However, this method has low detection efficiency, especially in narrow spaces or low-light environments. The detection accuracy is difficult to guarantee, and it is easy to cause false detection or missed detection due to human factors, which cannot meet the needs of modern engineering for efficient and accurate crack detection. The machine vision detection method that relies on gray value differences or edge information works well under conditions of simple backgrounds and uniform light, but has poor noise resistance and limited crack segmentation accuracy in complex backgrounds. Summary of the invention

[0004] In view of the above analysis, an embodiment of the present invention aims to provide a lightweight concrete composite slab crack detection method to solve the problems of low detection efficiency of existing crack detection technologies and low detection accuracy in narrow spaces, insufficient light or complex background environments.

[0005] The purpose of the present invention is mainly achieved through the following technical solutions:

[0006] The present invention provides a method for detecting cracks in a lightweight concrete composite slab, comprising the following steps:

[0007] Acquire a surface image of the concrete composite slab to be inspected and perform preprocessing to obtain a processed image;

[0008] The processed image is subjected to crack detection through a trained crack detection model to obtain crack detection results in the image; wherein the crack detection model is a lightweight multi-scale context feature fusion model based on YOLOv8, including a crack feature extraction module, a crack feature fusion module and a crack detection module; the crack feature extraction module is used to extract features of different scales of the image; the crack feature fusion module is used to fuse features of different scales to obtain a fusion enhancement feature map, a multi-scale fusion feature map and a context-guided fusion feature map; the crack detection module obtains a crack detection frame and a crack segmentation mask based on the fusion enhancement feature map, the multi-scale fusion feature map and the context-guided fusion feature map;

[0009] Based on the crack segmentation mask, the width and length of the crack of the concrete composite slab are obtained.

[0010] Furthermore, in the crack detection module, the fused enhanced feature map, the multi-scale fused feature map, and the context-guided fused feature map are respectively passed through the detection layer to obtain the fused enhanced detection feature map, the multi-scale fused detection feature map, and the context-guided fused detection feature map, and then the fused enhanced detection feature map, the multi-scale fused detection feature map, and the context-guided fused detection feature map are respectively dimensionally reshaped and then tensor spliced ​​to obtain a target detection frame;

[0011] The fused enhanced feature map, the multi-scale fused feature map and the context-guided fused feature map are respectively passed through the feature fusion convolution layer to obtain the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map, and then the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map are respectively dimensionally reshaped and then tensor spliced ​​to obtain mask coefficients;

[0012] The context-guided fusion feature map is convolved and up-sampled through a mask prototype layer to obtain a mask prototype;

[0013] The mask coefficients and the mask prototype are matrix-multiplied to obtain the crack segmentation mask;

[0014] The target detection frame is subjected to non-maximum suppression processing to obtain the crack detection frame.

[0015] Further, the detection layer includes a standard convolution and group normalization layer, two detail enhancement convolution and group normalization layers and a convolution layer, which is used to convert the input feature map into a feature map containing target detection related information;

[0016] The feature fusion convolution layer includes a standard convolution and group normalization layer, a detail enhancement convolution and group normalization layer and a convolution layer, which is used to convert the input feature map into a feature map containing mask related information;

[0017] The mask prototype layer includes a convolution layer, an upsampling layer and two convolution layers of different scales, which are used to obtain a mask prototype.

[0018] Furthermore, the crack feature extraction module includes a first convolution module, four convolution feature fusion modules, a spatial pyramid pooling module and an attention mechanism module; wherein,

[0019] The processed image is passed through the first convolution module to obtain a feature map F1;

[0020] The feature map F1 is downsampled in turn through four convolution feature fusion modules to obtain feature maps F2, F3, F4 and F5 respectively;

[0021] The feature map F5 is subjected to multi-scale pooling and feature fusion through the spatial pyramid pooling module;

[0022] The output feature map of the spatial pyramid pooling layer is passed through the attention mechanism module to generate an attention weight map, and the importance of each area in the output feature map of the spatial pyramid pooling layer is adjusted to obtain the crack extraction feature map output by the crack feature extraction module.

[0023] Furthermore, the convolution feature fusion module includes a convolution module and a multi-scale feature fusion module; wherein,

[0024] The convolution module includes a convolution layer, a batch normalization layer and an activation function, and is used to extract features from the input feature map;

[0025] The multi-scale feature fusion module includes a plurality of local multi-scale feature fusion modules and an output module connected in sequence, and the output feature maps of each local multi-scale feature fusion module are spliced ​​in the output module.

[0026] Furthermore, the local multi-scale feature fusion module includes a first convolution layer, a first segmentation layer, a second convolution layer, a second segmentation layer, a third convolution layer, a feature concatenation layer, a fourth convolution layer and an output layer; wherein,

[0027] The input feature map of the local multi-scale feature fusion module is subjected to channel segmentation in the first segmentation layer after feature extraction by the first convolution layer, and the output feature map of the first convolution layer is evenly divided to obtain a first sub-feature map of the first output feature map and a second sub-feature map of the first output feature map;

[0028] The first sub-feature map of the first output feature map is subjected to channel segmentation in the second segmentation layer after features are extracted by the second convolution layer, and the output feature map of the second convolution layer is evenly divided to obtain the first sub-feature map of the second output feature map and the second sub-feature map of the second output feature map; wherein the second convolution layer is a grouped convolution, and the number of channels is the number of channels of the first convolution layer divided by 2 and rounded down;

[0029] The first sub-feature map of the second output feature map is subjected to feature extraction by the third convolution layer to obtain a third output feature map; wherein the third convolution layer is a grouped convolution, and the number of channels is the number of channels of the first convolution layer divided by 4 and rounded down;

[0030] Splicing the second sub-feature map of the first output feature map, the second sub-feature map of the second output feature map, and the third output feature map in the channel dimension at the feature splicing layer to obtain a spliced ​​feature map;

[0031] The concatenated feature map passes through the fourth convolutional layer to reduce the number of channels, and the number of channels of the obtained feature map is the same as the input feature map of the local multi-scale feature fusion module;

[0032] The output feature map of the fourth convolutional layer and the input feature map of the local multi-scale feature fusion module are added at the output layer to obtain the output feature map of the local multi-scale feature fusion module.

[0033] Furthermore, the crack feature fusion module includes two multi-dimensional feature fusion modules and two multi-dimensional enhanced feature fusion modules connected in sequence; wherein,

[0034] The multi-dimensional feature fusion module includes an upsampling layer, a context feature fusion module and a multi-scale feature fusion module;

[0035] The multi-dimensional enhanced feature fusion module includes a convolution module, a context feature fusion module and a multi-scale feature fusion module.

[0036] Furthermore, in the first multidimensional feature fusion module, the crack extraction feature map passes through the upsampling layer and is then fused with the feature map F4 in the context feature fusion module, and the obtained features are locally fused with multiscale features through the multiscale feature fusion module to obtain a fused feature map;

[0037] In the second multidimensional feature fusion module, after the fused feature map passes through the upsampling layer, it is fused with the feature map F3 in the context feature fusion module, and the obtained features are fused locally through the multiscale feature fusion module to obtain a fused enhanced feature map;

[0038] In the first multi-dimensional enhanced feature fusion module, the fused enhanced feature map passes through the convolution module, and then is fused with the fused feature map in the context feature fusion module. The obtained features are fused locally through the multi-scale feature fusion module to obtain a multi-scale fused feature map.

[0039] In the second multi-dimensional enhanced feature fusion module, the multi-scale fusion feature map passes through the convolution module and is then fused with the crack extraction feature map in the context feature fusion module. The obtained features are subjected to local multi-scale feature fusion through the multi-scale feature fusion module to obtain a context-guided fusion feature map.

[0040] Furthermore, the context feature fusion module includes a channel attention module, a spatial attention module and a feature splicing module; wherein,

[0041] A channel attention module is used to concatenate the first input feature map and the second input feature map in the channel dimension, process the concatenated feature map using the SE attention mechanism, and then split the processed feature map into a first weight feature map and a second weight feature map having the same number of channels as the first input feature map and the second input feature map;

[0042] The spatial attention module is used to perform weighted fusion of the first weight feature map and the second weight feature map with the first input feature map and the second input feature map respectively;

[0043] The feature splicing module is used to splice the channel dimensions of the two weighted fused feature maps obtained by the spatial attention module to obtain the output feature map of the context feature fusion module.

[0044] Furthermore, based on the crack segmentation mask of the image, the width of the crack of the concrete composite slab is obtained, including:

[0045] Based on the crack segmentation mask, connected domains are marked to obtain the coordinates of each connected domain;

[0046] For each point in each connected domain, a binary search algorithm is used to determine the maximum radius of the circle centered at each point intersecting with the crack boundary;

[0047] After subtracting 1 from the maximum radius, the radius value is gradually increased with a preset floating point precision until the inscribed circle is tangent to the boundary, thereby obtaining the maximum width of the crack;

[0048] Based on the crack segmentation mask of the image, the length of the crack of the concrete composite slab is obtained, including:

[0049] Based on the crack segmentation mask, using a skeleton extraction algorithm to extract the skeleton structure of the crack;

[0050] By means of a convolution operation, the endpoints of the skeleton structure of the crack are identified, and the gradients of each skeleton endpoint in the x and y directions are calculated using a Sobel operator to determine the preferred direction of growth of each skeleton endpoint;

[0051] Based on the priority growth direction of each skeleton endpoint, the regional growing algorithm is used to repair the broken crack skeleton to obtain the complete crack skeleton;

[0052] The complete skeleton pixel points of the crack are traversed to obtain the total length of the crack.

[0053] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0054] 1. The crack detection model used in the present invention can extract crack features of different scales from the input image, and can maintain high detection accuracy even in complex backgrounds or under different lighting conditions. The lightweight design reduces the computational complexity and the number of parameters, so that the model can run efficiently on resource-constrained devices. This lightweight design ensures the real-time performance of the model and can meet the needs of rapid on-site detection.

[0055] 2. The present invention can not only detect the existence and location of cracks, but also automatically quantify the length and width of cracks through crack segmentation masks, providing reliable data support for engineering decision-making.

[0056] 3. In the scheme of the present invention, through the collaborative work of the crack feature extraction module and the crack feature fusion module, the model can extract and fuse crack features of different scales in the image, including low-level edge and texture information and high-level semantic information. This multi-scale feature fusion helps the model to more accurately identify and locate cracks, and maintain a high detection accuracy even in complex backgrounds or cracks of different sizes.

[0057] 4. The context feature fusion module of the solution of the present invention utilizes the attention mechanism to enhance the context perception ability of crack features. The model can better understand the environment and background of the cracks, thereby effectively suppressing the interference of background noise during the detection process, highlighting the characteristics of the crack area, and further improving the accuracy of detection.

[0058] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0060] Figure 1 It is a schematic flow chart of a method for detecting cracks in a lightweight concrete composite slab according to an embodiment of the present invention;

[0061] Figure 2 A schematic diagram of the structure of a crack detection model in an embodiment of the present invention;

[0062] Figure 3 Schematic diagram of the structure of a local multi-scale feature fusion module of the multi-scale feature fusion module in an embodiment of the present invention;

[0063] Figure 4 Schematic diagram of the structure of the context feature fusion module in an embodiment of the present invention;

[0064] Figure 5 Schematic diagram of the structure of a crack detection module in an embodiment of the present invention. DETAILED DESCRIPTION

[0065] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0066] A specific embodiment of the present invention discloses a method for detecting cracks in a lightweight concrete composite slab. Figure 1 As shown, the steps S1 to S3 are included:

[0067] Step S1, obtaining a surface image of a concrete composite slab to be inspected and performing preprocessing to obtain a processed image.

[0068] Specifically, an image acquisition device installed on the slide rail is used to capture the surface of the concrete composite slab to be inspected. The image acquisition device uses an ultra-wide-angle camera with a 135° viewing angle and 12 million pixels for image acquisition. The camera with high resolution and wide viewing angle can capture a larger visible area, which helps to obtain more comprehensive crack information. A stepper motor is used to drive the image acquisition device on the slide rail to move slowly and steadily to capture clear images.

[0069] The surface image is preprocessed, including adjusting the image size of the collected surface image using OpenCV. In this embodiment, the image size is 640×640; and then a filtering algorithm is used to reduce the noise in the image, improve the image quality, and make the crack features clearer.

[0070] Step S2, performing crack detection on the processed image through a trained crack detection model to obtain a crack detection result in the image; wherein the crack detection model is a lightweight multi-scale context feature fusion model based on YOLOv8, including a crack feature extraction module, a crack feature fusion module and a crack detection module; the crack feature extraction module is used to extract different scale features of the image; the crack feature fusion module is used to fuse features of different scales to obtain a fusion enhanced feature map, a multi-scale fusion feature map and a context-guided fusion feature map; the crack detection module obtains a crack detection frame and a crack segmentation mask based on the fusion enhanced feature map, the multi-scale fusion feature map and the context-guided fusion feature map.

[0071] Specifically, Figure 2 As shown, the crack detection model of this embodiment is a model based on the YOLOv8 architecture. It captures the details and overall information of cracks of different sizes and shapes in the image through multi-scale feature extraction, and fuses these features of different scales to combine local details and global context information, and finally realizes accurate positioning and pixel-level segmentation of cracks. It has a lightweight design, is suitable for real-time detection, and can effectively reduce the probability of false detection and missed detection.

[0072] Furthermore, the crack feature extraction module includes a first convolution module, four convolution feature fusion modules, a spatial pyramid pooling module and an attention mechanism module; wherein,

[0073] In the crack feature extraction module, the processed image is passed through the first convolution module to obtain a feature map F1.

[0074] Specifically, the first convolution module includes a convolution layer, a batch normalization layer and an activation function, which are connected in sequence and have 3 convolution kernels, a step size of 2, and 64 channels, and are used to reduce the spatial resolution and extract low-level edge and texture information.

[0075] The feature map F1 is downsampled in turn through four convolutional feature fusion modules to obtain feature maps F2, F3, F4 and F5 respectively.

[0076] Furthermore, the convolutional feature fusion module includes a convolution module and a multi-scale feature fusion module.

[0077] Specifically, in each convolutional feature fusion module, features at the current scale are extracted and fused with previous features. In this way, as the modules go deeper layer by layer, the model can extract features from details to the whole layer by layer, and gradually fuse feature information at different scales to form a multi-level, multi-scale feature representation. This layer-by-layer feature extraction and fusion helps the model capture crack information at different levels in the image and improve the accuracy and robustness of crack detection.

[0078] Furthermore, the convolution module includes a convolution layer, a batch normalization layer and an activation function, which is used to extract features from the input feature map and perform downsampling at the same time.

[0079] Specifically, the number of channels of the convolutional layers of the four convolutional feature fusion modules increases exponentially, so that the number of channels of the extracted feature maps increases exponentially to extract more features. In this embodiment, the convolution kernel of the convolutional layer in the first convolutional feature fusion module is 3, the step size is 2, and the number of channels is 128; the convolution kernel of the convolutional layer in the second convolutional feature fusion module is 3, the step size is 2, and the number of channels is 256; the convolution kernel of the convolutional layer in the third convolutional feature fusion module is 3, the step size is 2, and the number of channels is 512; the convolution kernel of the convolutional layer in the fourth convolutional feature fusion module is 3, the step size is 2, and the number of channels is 1024.

[0080] It should be noted that the number of channels of the convolutional layer determines how many different features the convolutional layer can learn. Increasing the number of channels of the convolutional layer can enhance the network's feature learning and expression capabilities.

[0081] Furthermore, the multi-scale feature fusion module includes a plurality of local multi-scale feature fusion modules and an output module connected in sequence, and the output feature maps of each of the local multi-scale feature fusion modules are spliced ​​in the output module.

[0082] Specifically, the multi-scale feature fusion module combines the idea of ​​multi-scale feature fusion and can effectively extract different scale features of cracks and enhance the expression ability of crack areas by introducing local multi-scale features.

[0083] It should be noted that the number of local multi-scale feature fusion modules in the multi-scale feature fusion module is usually set to a relatively small value, because the larger the number, the greater the amount of calculation used for the entire model. Exemplarily, in this embodiment, the number of local multi-scale feature fusion modules can be set to 3.

[0084] Furthermore, the local multi-scale feature fusion module includes a first convolution layer, a first segmentation layer, a second convolution layer, a second segmentation layer, a third convolution layer, a feature splicing layer, a fourth convolution layer and an output layer.

[0085] Specifically, Figure 3 As shown, the local multi-scale feature fusion module can extract feature information of different scales and levels from the input feature map through continuous convolution operations and segmentation operations, so that the model can capture the detailed features and overall features of the cracks at the same time, thereby improving the recognition ability when facing cracks of different sizes and shapes.

[0086] Furthermore, the input feature map of the local multi-scale feature fusion module is subjected to channel segmentation in the first segmentation layer after feature extraction by the first convolution layer, and the output feature map of the first convolution layer is evenly divided to obtain a first sub-feature map of the first output feature map and a second sub-feature map of the first output feature map.

[0087] Specifically, the convolution kernel of the first convolution layer is 3, and the number of input and output channels is equal to the input feature map, which is used to perform preliminary feature extraction on the input feature map.

[0088] In the first segmentation layer, the output feature map of the first convolutional layer is divided into two parts in the channel dimension, providing different feature subsets for subsequent multi-scale feature extraction and fusion, so that the model can process these two parts of features separately.

[0089] The first sub-feature map of the first output feature map is subjected to channel segmentation in the second segmentation layer after features are extracted by the second convolution layer, and the output feature map of the second convolution layer is evenly divided to obtain the first sub-feature map of the second output feature map and the second sub-feature map of the second output feature map; wherein the second convolution layer is a grouped convolution, and the number of channels is the number of channels of the first convolution layer divided by 2 and rounded down.

[0090] Specifically, in the second convolutional layer, a grouped convolution structure is used to further extract features from the first sub-feature map output by the first segmentation layer. The number of channels of the output feature map is reduced, thereby reducing the amount of calculation. At the same time, feature information between different channels is retained, making the feature information more concentrated and optimized.

[0091] The output feature map of the second convolutional layer is again divided into two parts in the channel dimension, which further refines the multi-scale representation of the features and enables the model to perform more in-depth analysis and fusion of features of different scales.

[0092] Furthermore, the first sub-feature map of the second output feature map is subjected to feature extraction through the third convolutional layer to obtain a third output feature map; wherein the third convolutional layer is a grouped convolution, and the number of channels is the number of channels of the first convolutional layer divided by 4 and rounded down.

[0093] Specifically, the first sub-feature map output by the second segmentation layer continues to be subjected to feature extraction using a grouped convolutional structure, thereby further reducing the number of channels and extracting deeper feature information, which helps the model capture more abstract and advanced feature representations.

[0094] Furthermore, the second sub-feature map of the first output feature map, the second sub-feature map of the second output feature map, and the third output feature map are spliced ​​in the channel dimension at the feature splicing layer to obtain a spliced ​​feature map.

[0095] Specifically, by splicing the feature maps, feature information of different scales and levels is integrated to form a comprehensive feature representation.

[0096] Furthermore, the concatenated feature map passes through the fourth convolutional layer to reduce the number of channels, and the number of channels of the obtained feature map is the same as the input feature map of the local multi-scale feature fusion module.

[0097] Specifically, the fourth convolutional layer is a 1x1 convolutional layer, which is used to reduce the number of channels to make it the same as the number of channels of the input feature map.

[0098] Furthermore, the output feature map of the fourth convolutional layer and the input feature map of the local multi-scale feature fusion module are added at the output layer to obtain the output feature map of the local multi-scale feature fusion module.

[0099] Specifically, the output feature map of the fourth convolutional layer is added to the input feature map of the local multi-scale feature fusion module to realize residual connection, retain the information in the original input feature map, and supplement the new features after multi-scale feature extraction and fusion, thereby enhancing the feature expression ability and robustness of the model.

[0100] The local multi-scale feature module adopts a grouped convolution structure and a residual connection mechanism. While maintaining the feature extraction effect, the module significantly reduces the amount of calculation and the number of parameters, so that the model can perform more efficient feature processing under limited computing resources, and is more suitable for real-time or resource-constrained crack detection scenarios. Through residual connection and multi-scale feature fusion, the module enhances the robustness of the model to noise and interference. Even under complex backgrounds or undesirable data conditions, the model can more accurately detect cracks, thereby improving the reliability of crack detection.

[0101] Furthermore, the feature map F5 is subjected to multi-scale pooling and feature fusion through the spatial pyramid pooling module.

[0102] Specifically, the spatial pyramid pooling module includes multiple pooling layers, each pooling layer corresponds to a specific scale, and through pooling operations at different scales, the spatial pyramid pooling module generates pooling features of multiple scales from the feature map F5. These features respectively contain information of different scales and can better describe the crack features in the image.

[0103] The pooled features of different scales are fused by feature splicing, so that the fused feature map can capture both local details and global context information in the image.

[0104] Furthermore, the output feature map of the spatial pyramid pooling layer generates an attention weight map through the attention mechanism module, adjusts the importance of each area in the output feature map of the spatial pyramid pooling layer, and obtains the crack extraction feature map output by the crack feature extraction module.

[0105] Specifically, the attention mechanism module adopts the SegNext attention mechanism to adaptively enhance the crack edge information while suppressing background noise. It dynamically adjusts the attention weights of different regions, prioritizes the crack edge details, effectively reduces the interference of background regions, and enables the model to allocate computing resources more accurately.

[0106] Furthermore, the crack feature fusion module includes two multi-dimensional feature fusion modules and two multi-dimensional enhanced feature fusion modules which are connected in sequence.

[0107] Specifically, the crack feature fusion module is used to effectively integrate the crack features extracted from different scales and levels to obtain a more comprehensive, accurate and discriminative feature representation, thereby improving the performance of crack detection.

[0108] Furthermore, the multi-dimensional feature fusion module includes an upsampling layer, a context feature fusion module and a multi-scale feature fusion module.

[0109] Specifically, through the multi-dimensional feature fusion module, the crack extraction feature map is comprehensively optimized and enhanced in terms of resolution, detail information, context information and multi-scale information.

[0110] Furthermore, in the first multidimensional feature fusion module, the crack extraction feature map passes through the upsampling layer and is then fused with the feature map F4 in the context feature fusion module. The obtained features are subjected to local multiscale feature fusion by the multiscale feature fusion module to obtain a fused feature map.

[0111] Specifically, the spatial resolution of the crack extraction feature map may have been reduced after deep processing by the convolutional neural network, and the upsampling layer amplifies these low-resolution feature maps to a higher resolution to match the original input image or a higher-resolution feature map.

[0112] Furthermore, the context feature fusion module includes a channel attention module, a spatial attention module and a feature splicing module.

[0113] Specifically, Figure 4 As shown, the context fusion feature module is a module for integrating local features in an image with global context information, and is used to generate a feature representation containing rich semantic information and spatial correlation, thereby improving the model's ability to understand and analyze image content.

[0114] Furthermore, the channel attention module is used to splice the first input feature map and the second input feature map in the channel dimension, process the spliced ​​feature map using the SE attention mechanism, and then split the processed feature map into a first weight feature map and a second weight feature map having the same number of channels as the first input feature map and the second input feature map.

[0115] Specifically, the two input feature maps are spliced ​​in the channel dimension, integrating the information of the two input feature maps, providing a richer feature basis for the subsequent attention mechanism processing. The SE mechanism compresses the feature map through a global pooling operation to obtain a global feature vector; then the global feature vector is nonlinearly transformed through two fully connected layers to generate a weight vector; finally, the weight vector is multiplied channel by channel with the spliced ​​feature map to achieve weighted feature channels, highlight important feature channels, and suppress unimportant feature channels. The weighted feature maps contain the feature information weighted by the channel attention mechanism, providing a weighted feature basis for the subsequent spatial attention module.

[0116] Furthermore, the spatial attention module is used to perform weighted fusion of the first weight feature map and the second weight feature map with the first input feature map and the second input feature map, respectively.

[0117] Specifically, the weighted fusion operation uses an element-by-element multiplication method to multiply the weights in the weighted feature map with the feature values ​​in the input feature map, thereby weighting the features of different spatial positions in the input feature map, highlighting important spatial features and suppressing unimportant spatial features. Through weighted fusion, the spatial attention module strengthens the spatial correlation in the feature map, allowing the model to pay more attention to important areas related to the target object in the image, while suppressing the interference features of the background area, improving the model's understanding and analysis of the image spatial structure.

[0118] Furthermore, the feature splicing module is used to splice the channel dimensions of the two weighted fused feature maps obtained by the spatial attention module to obtain the output feature map of the context feature fusion module.

[0119] Specifically, the two weighted fused feature maps obtained by the spatial attention module are spliced ​​in the channel dimension. The spliced ​​feature map integrates the feature information processed by channel attention and spatial attention to form a comprehensive feature representation. The output feature map of the context feature fusion module contains rich semantic information and spatial correlation, which can provide strong feature support for subsequent image processing and analysis tasks, helping the model to complete tasks more accurately.

[0120] The output feature map of the context feature fusion module is processed by a multi-scale feature fusion module to further generate a fusion of detail features and multi-scale features.

[0121] Furthermore, in the second multidimensional feature fusion module, after the fused feature map passes through the upsampling layer, feature fusion is performed with the feature map F3 in the context feature fusion module, and the obtained features are subjected to local multi-scale feature fusion by the multi-scale feature fusion module to obtain a fused enhanced feature map.

[0122] Specifically, the fused feature map is subjected to a second multi-dimensional feature fusion module to perform multi-scale feature reintegration, contextual information enhancement and channel information optimization, so that the feature representation is more comprehensive, balanced, concise and efficient, containing rich detail features and extensive contextual information, and highlighting important channel features, thereby better capturing the target and scene information in the image, and improving the model's adaptability to complex scenes and the accuracy of understanding.

[0123] Furthermore, the multi-dimensional enhanced feature fusion module includes a convolution module, a context feature fusion module and a multi-scale feature fusion module.

[0124] Specifically, through the multi-dimensional enhanced feature fusion module, the model can fully mine and integrate the multi-dimensional feature information in the image, generate a richer, more accurate and robust feature representation, thereby significantly improving the ability to understand and analyze the image content.

[0125] Furthermore, in the first multi-dimensional enhanced feature fusion module, the fused enhanced feature map passes through the convolution module and then is fused with the fused feature map in the context feature fusion module. The obtained features are subjected to local multi-scale feature fusion through a multi-scale feature fusion module to obtain a multi-scale fused feature map.

[0126] Specifically, the fusion enhanced feature map is downsampled through the convolution module to extract deep feature information, and the context feature fusion module fuses local features with global context information, so that the features not only contain detailed information, but also cover the overall structure and semantic information of the image. The multi-scale feature fusion module further integrates feature details of different scales, so that the features can simultaneously describe the local area and the overall scene in the image, enhancing the multi-dimensional expression ability of the features.

[0127] It should be noted that the convolution module of the first multi-dimensional enhanced feature fusion module includes a convolution layer with a convolution kernel of 3, a stride of 2, and a channel number of 256, a batch normalization layer, and an activation function.

[0128] Furthermore, in the second multi-dimensional enhanced feature fusion module, the multi-scale fusion feature map passes through the convolution module and is then fused with the crack extraction feature map in the context feature fusion module. The obtained features are subjected to local multi-scale feature fusion through the multi-scale feature fusion module to obtain a context-guided fusion feature map.

[0129] Specifically, the multi-scale fusion feature map is further extracted and deeply fused with the crack extraction feature map in the context feature fusion module by combining local and global information. The obtained features are then integrated with feature details of different scales through the multi-scale feature fusion module to finally generate a context-guided fusion feature map that can accurately describe the crack features and guide context information.

[0130] It should be noted that the convolution module of the second multi-dimensional enhanced feature fusion module includes a convolution layer with a convolution kernel of 3, a step size of 2, and a channel number of 512, a batch normalization layer, and an activation function.

[0131] Furthermore, in the crack detection module, the fused enhanced feature map, the multi-scale fused feature map and the context-guided fused feature map are respectively passed through the detection layer to obtain the fused enhanced detection feature map, the multi-scale fused detection feature map and the context-guided fused detection feature map, and then the fused enhanced detection feature map, the multi-scale fused detection feature map and the context-guided fused detection feature map are respectively dimensionally reshaped and tensor splicing is performed to obtain the target detection frame.

[0132] Specifically, Figure 5 As shown, the crack detection module introduces mask prototype processing, so that the model can complete the target detection and segmentation tasks in a single forward propagation, thereby significantly enhancing the model's ability to capture crack contours and edges, and is suitable for the detection of complex backgrounds and irregular crack morphologies.

[0133] Furthermore, the detection layer includes a standard convolution and group normalization layer, two detail enhancement convolution and group normalization layers and a convolution layer, which is used to convert the input feature map into a feature map containing target detection related information.

[0134] Specifically, the detection layer is used to predict the target detection box, that is, to determine the position and size of the crack in the image, and to extract information related to the crack position and shape from the comprehensive feature map. By learning the characteristic patterns and spatial distribution laws of the cracks, the detection layer can accurately predict the bounding box of the crack, including the position, category and confidence of the crack.

[0135] The standard convolution and group normalization layer of the detection layer is a convolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 64. After performing a convolution operation on the input features, group normalization is performed.

[0136] It should be noted that the group normalization is to divide the channels of the feature map into several groups and normalize the features in each group. Compared with batch normalization, group normalization does not depend on the batch size and is more suitable for small batches or single samples. It helps to stabilize the training process, accelerate model convergence, and improve the model's adaptability to features of different scales.

[0137] The detail enhancement convolution and group normalization layer of the detection layer is a deconvolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 64. After restoring the low-resolution feature map to a high-resolution pixel space, group normalization is performed to enhance the detail features in the feature map.

[0138] The feature map output by the detail enhancement convolution and group normalization layer is integrated and optimized through a convolution layer with a convolution kernel of 1, a step size of 1, and 65 channels, so as to highlight important feature channels and suppress unimportant feature channels.

[0139] The three input feature maps are passed through the detection layer respectively to further extract features related to the crack detection task, and the features are optimized and screened. The obtained fusion enhanced detection feature map, the multi-scale fusion detection feature map and the context guided fusion detection feature map are reshaped in dimension respectively to ensure that they have the same dimension, and then tensor splicing is performed to integrate feature information from different processing paths for more complex feature combination and analysis. Exemplarily, dimension reshaping and tensor splicing are implemented using the view() function and torch.cat() function in PyTorch.

[0140] Furthermore, the fused enhanced feature map, the multi-scale fused feature map and the context-guided fused feature map are respectively passed through the feature fusion convolution layer to obtain the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map, and then the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map are respectively dimensionally reshaped and tensor splicing is performed to obtain the mask coefficient.

[0141] Furthermore, non-maximum suppression processing is performed on the target detection frame to obtain the crack detection frame.

[0142] Specifically, the non-maximum suppression process is used to screen out the best bounding box and remove unnecessary overlapping bounding boxes, thereby ensuring that each detected crack has a clear, non-overlapping bounding box.

[0143] Furthermore, the feature fusion convolution layer includes a standard convolution and a group normalization layer, a detail enhancement convolution and a group normalization layer, and a convolution layer, which is used to convert the input feature map into a feature map containing mask related information.

[0144] Specifically, the mask coefficient represents the weight or importance of each pixel or region in the segmentation task, and its role is to control the contribution of different regions to the final segmentation result, or to weight different features when calculating the mask.

[0145] The standard convolution and group normalization layer of the feature fusion convolution layer is a convolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 256. After performing a convolution operation on the input features, group normalization is performed.

[0146] The detail enhancement convolution and group normalization layer of the feature fusion convolution layer is a deconvolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 256. After restoring the low-resolution feature map to a high-resolution pixel space, group normalization is performed to enhance the detail features in the feature map.

[0147] The feature map output by the detail enhancement convolution and group normalization layer is integrated and optimized through a convolution layer with a convolution kernel of 1, a step size of 1, and a channel number of 32, so as to highlight important feature channels and suppress unimportant feature channels.

[0148] The three input feature maps are respectively passed through the feature fusion convolution layer to further extract features related to the calculation of the mask coefficients, and the features are optimized and screened. The obtained fusion enhanced convolution feature map, the multi-scale fusion convolution feature map and the context-guided fusion convolution feature map are respectively dimensionally reshaped to ensure that they have the same dimension, and then tensor splicing is performed to integrate feature information from different processing paths for more complex feature combination and analysis. Exemplarily, dimension reshaping and tensor splicing are implemented using the view() function and torch.cat() function in PyTorch.

[0149] Furthermore, the context-guided fusion feature map is convolved and up-sampled through a mask prototype layer to obtain a mask prototype.

[0150] Specifically, the mask prototype is a learned standard template or shape, representing the shape of a standard crack or target. It is a "template" of a certain target or area learned by the network, and serves as a reference and guide in the mask generation process.

[0151] Furthermore, the mask prototype layer includes a convolution layer, an upsampling layer and two convolution layers of different scales, which are used to obtain the mask prototype.

[0152] Specifically, the convolution layer of the mask prototype layer is a convolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 256, which is used to extract local features in the input feature map.

[0153] The upsampling layer of the mask prototype layer is used to restore the spatial information previously lost due to the convolution or pooling operation, and provide a higher resolution feature map for subsequent mask prototype generation.

[0154] The second convolution layer of the mask prototype layer is a convolution layer using a convolution kernel of 3, a step size of 1, and a channel number of 256.

[0155] The third convolution layer of the mask prototype layer is a convolution layer using a convolution kernel of 1, a step size of 1, and a channel number of 32, which is used to generate a mask prototype.

[0156] Furthermore, the mask coefficients and the mask prototype are matrix-multiplied to obtain the crack segmentation mask.

[0157] Specifically, the mask coefficients and the mask prototype play complementary roles in mask generation. The mask prototype provides the basic form and spatial structure of the target, and the mask coefficients dynamically adjust the weights and positions of these forms according to the actual features and context information in the image, thereby generating a final accurate mask.

[0158] Furthermore, the crack detection model is trained using the following method:

[0159] A training data set for the crack detection model is constructed; wherein the training data includes a set of crack images, a category label and a bounding box corresponding to the crack in each image, and a segmentation mask label for each image.

[0160] Specifically, the image set including cracks is a plurality of public crack data sets and images containing cracks collected by the user. The crack data sets and the crack images collected by the user are preprocessed, and the preprocessing includes affine transformation, normalization and dimension conversion. Among them, the warpAffine() function of OpenCV is used to perform affine transformation on the images in the crack image set to meet the model input size requirements; the normalization is to normalize the images in the crack image set and convert the pixel values ​​from 0-255 to 0-1 to accelerate model convergence; the dimension conversion is to convert the images in the crack image set from BHWC (batch, height, width, channel) to BCHW (batch, channel, height, width) format to meet the model input requirements while improving computational efficiency and performance.

[0161] Since only some images in the public crack dataset contain the label format required for YOLO training, the unlabeled data are annotated using Labelme annotation software to obtain the category labels and bounding boxes corresponding to the cracks.

[0162] Parse the image annotated with Labelme, extract the coordinate information of the annotated polygon, and use the fillPoly() function of OpenCV to create a mask image as a segmentation mask label based on the polygon coordinate information. The mask image is a binary image, in which the pixel value of the target area is a specific value, such as 255, and the pixel value of the background area is another value, such as 0.

[0163] Furthermore, the training data set is loaded, and the crack detection model is trained using the total loss function of the target prediction box loss function, the mask loss function, the category loss function and the distributed focus loss function, and the model parameters are updated using gradient back propagation. When the loss function value converges, the training is terminated to obtain a trained crack detection model.

[0164] Specifically, the target prediction box loss function (Box Loss) is used to measure the difference between the position and size of the prediction box and the real box, and is usually calculated using the IoU (intersection over union) loss, that is, the IoU value between the prediction box and the real box is calculated, and then 1 minus the IoU value is calculated to obtain the loss value.

[0165] The mask loss function (Mask Loss) is used to measure the difference between the predicted instance segmentation mask and the true mask, and is usually calculated by comparing the pixel-level difference between the predicted mask and the true mask. For example, a binary cross-entropy loss (Binary Cross-Entropy Loss) is used to measure the similarity between the predicted mask and the true mask.

[0166] The category loss function (Cls Loss) is used to measure the difference between the predicted category probability and the true category. Exemplarily, it is calculated using the binary cross-entropy loss, that is, the difference between the predicted category probability and the true category label is calculated, and then the loss value is calculated using the cross entropy formula.

[0167] The distributed focus loss function (DFL loss) is used to optimize the regression of the prediction box. It takes into account the uncertainty of the target box and reduces the focus on easy-to-classify samples by adjusting the weight of the loss function. It pays more attention to difficult-to-classify samples. The core idea is to use the cross entropy function to optimize the probabilities of the two positions near the label, so that the network distribution focuses on the label value.

[0168] The total loss function is a loss function obtained by adding a target prediction box loss function, a mask loss function, a category loss function, and a distributed focus loss function.

[0169] It should be noted that the condition for the end of training is that the number of training times reaches the preset value, or the early stopping strategy is triggered when the training effect does not improve in 50 consecutive batches.

[0170] Step S3: Based on the crack segmentation mask, obtain the width and length of the crack of the concrete composite slab.

[0171] Specifically, since the segmentation mask realizes fine-grained division of the image area by classifying and marking each pixel, each pixel is assigned a label to indicate whether it belongs to a crack or background, thereby accurately separating the object in the image from the background.

[0172] Further, based on the crack segmentation mask of the image, the width of the crack of the concrete composite slab is obtained, including the following steps S311-S313:

[0173] Step S311: Based on the crack segmentation mask, connected domains are marked to obtain the coordinates of each connected domain.

[0174] Specifically, the method for calculating the width of the crack is to estimate the width of the crack by calculating the distance from each point in the connected domain to the crack boundary. The connected domain is an image region composed of foreground pixels with the same pixel value and adjacent positions in the image.

[0175] Step S312: For each point in each connected domain, a binary search algorithm is used to determine the maximum radius of the intersection of a circle with each point as the center and the crack boundary.

[0176] Specifically, starting from an initial radius, gradually increase or decrease the radius value to check whether the circle with the current radius intersects with the crack boundary. If it intersects, try to increase the radius; if it does not intersect, try to decrease the radius. Through continuous iteration, the maximum radius of the circle with the point as the center intersecting with the crack boundary is finally determined.

[0177] Step S313, after subtracting 1 from the maximum radius, gradually increase the radius value with a preset floating point precision until the inscribed circle is tangent to the boundary, thereby obtaining the maximum width of the crack.

[0178] Specifically, the determined maximum radius is subtracted by 1 to obtain an initial radius value, and then the radius value is gradually increased with a preset floating point precision, for example, 0.1, and after each increase, it is checked whether a circle with the current radius as the radius is tangent to the crack boundary. When a radius value is found that makes the circle tangent to the boundary, the radius value is the maximum width of the crack.

[0179] Further, based on the crack segmentation mask of the image, the length of the crack of the concrete composite slab is obtained, including the following steps S321-S324:

[0180] Step S321: Based on the crack segmentation mask, use a skeleton extraction algorithm to extract the skeleton structure of the crack.

[0181] Specifically, the skeleton structure of the crack is extracted from the crack segmentation mask as the basis for subsequent length calculation. The skeleton structure is the center line of the crack and can represent the shape and direction of the crack.

[0182] The skeleton extraction algorithm gradually reduces the crack area through iterative corrosion operations until only a skeleton line with a width of one pixel remains. Exemplarily, the skeleton extraction algorithm can be a thinning algorithm, including a Zhang-Suen thinning algorithm and a Guo-Hall thinning algorithm.

[0183] Step S322: identify the endpoints of the skeleton structure of the crack through a convolution operation, and use the Sobel operator to calculate the gradient of each skeleton endpoint in the x and y directions to determine the preferred growth direction of each skeleton endpoint.

[0184] Specifically, the endpoints of the crack skeleton structure are identified, and the priority growth directions of these endpoints in the crack extension direction are determined to provide a basis for subsequent crack repair.

[0185] The endpoints of the skeleton structure are those points on the skeleton where there are no further branches, and they mark the starting point, end point or branching point of the crack.

[0186] The gradient is a vector that represents the direction and magnitude of the maximum rate of change at a certain point. The Sobel operator is a commonly used edge detection operator that can effectively calculate the gradient information of pixel points in an image. By calculating the gradient of each skeleton endpoint, the preferred growth direction of the endpoint in the crack extension direction can be determined.

[0187] Step S323: Based on the priority growth direction of each skeleton endpoint, a regional growing algorithm is used to repair the broken crack skeleton to obtain a complete crack skeleton.

[0188] Specifically, the region growing algorithm is an iterative process that starts from the endpoint of the crack skeleton and gradually expands to the endpoints of the adjacent crack skeletons according to the growth criterion, which is the gradient direction in this implementation, and marks these pixels as visited until all the broken crack parts are connected to form a continuous crack skeleton.

[0189] Step S324, traverse the complete skeleton pixel points of the crack to obtain the total length of the crack.

[0190] Specifically, starting from one end point of the crack skeleton, traverse the pixels one by one along the skeleton until reaching the other end point. During the traversal process, the distances between adjacent pixels are calculated, and these distances are added up to obtain the total length of the crack. In this embodiment, the Euclidean distance algorithm can be used to calculate the distance between adjacent pixels.

[0191] The target detection frame of the crack and the geometric information (length and width) of the crack extracted by the model can be sent to the operation terminal, and the detection results are presented in real time in the visual control interface.

[0192] In summary, the lightweight concrete composite slab crack detection method according to the embodiment of the present invention has the following beneficial effects:

[0193] 1. The crack detection model used in the present invention can extract crack features of different scales from the input image, and can maintain high detection accuracy even in complex backgrounds or under different lighting conditions. The lightweight design reduces the computational complexity and the number of parameters, so that the model can run efficiently on resource-constrained devices. This lightweight design ensures the real-time performance of the model and can meet the needs of rapid on-site detection.

[0194] 2. The present invention can not only detect the existence and location of cracks, but also automatically quantify the length and width of cracks through crack segmentation masks, providing reliable data support for engineering decision-making.

[0195] 3. In the scheme of the present invention, through the collaborative work of the crack feature extraction module and the crack feature fusion module, the model can extract and fuse crack features of different scales in the image, including low-level edge and texture information and high-level semantic information. This multi-scale feature fusion helps the model to more accurately identify and locate cracks, and maintain a high detection accuracy even in complex backgrounds or cracks of different sizes.

[0196] 4. The context feature fusion module of the solution of the present invention utilizes the attention mechanism to enhance the context perception ability of crack features. The model can better understand the environment and background of the cracks, thereby effectively suppressing the interference of background noise during the detection process, highlighting the characteristics of the crack area, and further improving the accuracy of detection.

[0197] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for detecting cracks in lightweight concrete composite slabs, characterized in that: The steps include: Acquire a surface image of the concrete composite slab to be inspected and perform preprocessing to obtain a processed image; The processed image is subjected to crack detection through a trained crack detection model to obtain crack detection results in the image; wherein the crack detection model is a lightweight multi-scale context feature fusion model based on YOLOv8, including a crack feature extraction module, a crack feature fusion module and a crack detection module; the crack feature extraction module is used to extract features of different scales of the image; the crack feature fusion module is used to fuse features of different scales to obtain a fusion enhancement feature map, a multi-scale fusion feature map and a context-guided fusion feature map; the crack detection module obtains a crack detection frame and a crack segmentation mask based on the fusion enhancement feature map, the multi-scale fusion feature map and the context-guided fusion feature map; Based on the crack segmentation mask, the width and length of the crack of the concrete composite slab are obtained.

2. The method according to claim 1, characterized in that: In the crack detection module, the fused enhanced feature map, the multi-scale fused feature map, and the context-guided fused feature map are respectively passed through the detection layer to obtain the fused enhanced detection feature map, the multi-scale fused detection feature map, and the context-guided fused detection feature map, and then the fused enhanced detection feature map, the multi-scale fused detection feature map, and the context-guided fused detection feature map are respectively dimensionally reshaped and tensor spliced ​​to obtain a target detection frame; The fused enhanced feature map, the multi-scale fused feature map and the context-guided fused feature map are respectively passed through the feature fusion convolution layer to obtain the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map, and then the fused enhanced convolution feature map, the multi-scale fused convolution feature map and the context-guided fused convolution feature map are respectively dimensionally reshaped and then tensor spliced ​​to obtain mask coefficients; The context-guided fusion feature map is convolved and up-sampled through a mask prototype layer to obtain a mask prototype; The mask coefficients and the mask prototype are matrix-multiplied to obtain the crack segmentation mask; The target detection frame is subjected to non-maximum suppression processing to obtain the crack detection frame.

3. The method according to claim 2, characterized in that: The detection layer includes a standard convolution and group normalization layer, two detail enhancement convolution and group normalization layers and a convolution layer, which is used to convert the input feature map into a feature map containing target detection related information; The feature fusion convolution layer includes a standard convolution and group normalization layer, a detail enhancement convolution and group normalization layer and a convolution layer, which is used to convert the input feature map into a feature map containing mask related information; The mask prototype layer includes a convolution layer, an upsampling layer and two convolution layers of different scales, which are used to obtain a mask prototype.

4. The method according to claim 1, characterized in that: The crack feature extraction module includes a first convolution module, four convolution feature fusion modules, a spatial pyramid pooling module and an attention mechanism module; wherein, The processed image is passed through the first convolution module to obtain a feature map F1; The feature map F1 is downsampled in turn through four convolution feature fusion modules to obtain feature maps F2, F3, F4 and F5 respectively; The feature map F5 is subjected to multi-scale pooling and feature fusion through the spatial pyramid pooling module; The output feature map of the spatial pyramid pooling layer is passed through the attention mechanism module to generate an attention weight map, and the importance of each area in the output feature map of the spatial pyramid pooling layer is adjusted to obtain the crack extraction feature map output by the crack feature extraction module.

5. The method according to claim 4, characterized in that: The convolution feature fusion module includes a convolution module and a multi-scale feature fusion module; wherein, The convolution module includes a convolution layer, a batch normalization layer and an activation function, and is used to extract features from the input feature map; The multi-scale feature fusion module includes a plurality of local multi-scale feature fusion modules and an output module connected in sequence, and the output feature maps of each local multi-scale feature fusion module are spliced ​​in the output module.

6. The method according to claim 5, characterized in that: The local multi-scale feature fusion module includes a first convolution layer, a first segmentation layer, a second convolution layer, a second segmentation layer, a third convolution layer, a feature concatenation layer, a fourth convolution layer and an output layer; wherein, The input feature map of the local multi-scale feature fusion module is subjected to channel segmentation in the first segmentation layer after feature extraction by the first convolution layer, and the output feature map of the first convolution layer is evenly divided to obtain a first sub-feature map of the first output feature map and a second sub-feature map of the first output feature map; The first sub-feature map of the first output feature map is subjected to channel segmentation in the second segmentation layer after features are extracted by the second convolution layer, and the output feature map of the second convolution layer is evenly divided to obtain the first sub-feature map of the second output feature map and the second sub-feature map of the second output feature map; wherein the second convolution layer is a grouped convolution, and the number of channels is the number of channels of the first convolution layer divided by 2 and rounded down; The first sub-feature map of the second output feature map is subjected to feature extraction by the third convolution layer to obtain a third output feature map; wherein the third convolution layer is a grouped convolution, and the number of channels is the number of channels of the first convolution layer divided by 4 and rounded down; Splicing the second sub-feature map of the first output feature map, the second sub-feature map of the second output feature map, and the third output feature map in the channel dimension at the feature splicing layer to obtain a spliced ​​feature map; The concatenated feature map passes through the fourth convolutional layer to reduce the number of channels, and the number of channels of the obtained feature map is the same as the input feature map of the local multi-scale feature fusion module; The output feature map of the fourth convolutional layer and the input feature map of the local multi-scale feature fusion module are added at the output layer to obtain the output feature map of the local multi-scale feature fusion module.

7. The method according to claim 4, characterized in that: The crack feature fusion module includes two multi-dimensional feature fusion modules and two multi-dimensional enhanced feature fusion modules connected in sequence; wherein, The multi-dimensional feature fusion module includes an upsampling layer, a context feature fusion module and a multi-scale feature fusion module; The multi-dimensional enhanced feature fusion module includes a convolution module, a context feature fusion module and a multi-scale feature fusion module.

8. The method according to claim 7, characterized in that: In the first multi-dimensional feature fusion module, the crack extraction feature map passes through the upsampling layer and is then fused with the feature map F4 in the context feature fusion module. The obtained features are then fused locally through the multi-scale feature fusion module to obtain a fused feature map. In the second multidimensional feature fusion module, after the fused feature map passes through the upsampling layer, it is fused with the feature map F3 in the context feature fusion module, and the obtained features are fused locally through the multiscale feature fusion module to obtain a fused enhanced feature map; In the first multi-dimensional enhanced feature fusion module, the fused enhanced feature map passes through the convolution module, and then is fused with the fused feature map in the context feature fusion module. The obtained features are fused locally through the multi-scale feature fusion module to obtain a multi-scale fused feature map. In the second multi-dimensional enhanced feature fusion module, the multi-scale fusion feature map passes through the convolution module and is then fused with the crack extraction feature map in the context feature fusion module. The obtained features are subjected to local multi-scale feature fusion through the multi-scale feature fusion module to obtain a context-guided fusion feature map.

9. The method according to claim 8, characterized in that: The context feature fusion module includes a channel attention module, a spatial attention module and a feature splicing module; wherein, A channel attention module is used to concatenate the first input feature map and the second input feature map in the channel dimension, process the concatenated feature map using the SE attention mechanism, and then split the processed feature map into a first weight feature map and a second weight feature map having the same number of channels as the first input feature map and the second input feature map; The spatial attention module is used to perform weighted fusion of the first weight feature map and the second weight feature map with the first input feature map and the second input feature map respectively; The feature splicing module is used to splice the channel dimensions of the two weighted fused feature maps obtained by the spatial attention module to obtain the output feature map of the context feature fusion module.

10. The method according to claim 1, characterized in that: Based on the crack segmentation mask of the image, the width of the crack of the concrete composite slab is obtained, including: Based on the crack segmentation mask, connected domains are marked to obtain the coordinates of each connected domain; For each point in each connected domain, a binary search algorithm is used to determine the maximum radius of the circle centered at each point intersecting with the crack boundary; After subtracting 1 from the maximum radius, the radius value is gradually increased with a preset floating point precision until the inscribed circle is tangent to the boundary, thereby obtaining the maximum width of the crack; Based on the crack segmentation mask of the image, the length of the crack of the concrete composite slab is obtained, including: Based on the crack segmentation mask, using a skeleton extraction algorithm to extract the skeleton structure of the crack; By means of a convolution operation, the endpoints of the skeleton structure of the crack are identified, and the gradients of each skeleton endpoint in the x and y directions are calculated using a Sobel operator to determine the preferred direction of growth of each skeleton endpoint; Based on the priority growth direction of each skeleton endpoint, the regional growing algorithm is used to repair the broken crack skeleton to obtain the complete crack skeleton; The complete skeleton pixel points of the crack are traversed to obtain the total length of the crack.

Citation Information

Patent Citations

  • Method and system for detecting and segmenting length and width of tunnel lining crack

    CN116863134A

  • Concrete crack detection method and system combining linear guidance and grid optimization

    CN117422691A

  • Double-encoder pavement crack detection method based on Sobel operator bridging

    CN117689897A

  • Light-weight road crack detection method and system capable of self-adapting to crack size

    CN117765373A

  • Bridge concrete crack full-process intelligent detection method based on deep neural network

    CN118628454A

Cited By

  • Intelligent detection method for surface cracks of laminated slab

    CN120147305A

  • An intelligent detection method for surface cracks of laminated plates

    CN120147305B

  • Hydraulic engineering concrete crack detection method and system

    CN121074034A

  • Pavement crack segmentation algorithm based on YOLO11

    CN121236375A

  • Crack detection method and system based on dual-path feature extraction and gating fusion

    CN121661353A