A concrete structure-oriented u-net lightweight crack detection method
The U-Net lightweight crack detection method, combined with MobileNetVIT and an efficient Trans module for feature extraction and global context modeling, and optimized by the SmoothWing loss function, solves the problems of low efficiency and insufficient accuracy in dam crack detection in existing technologies, and achieves efficient and accurate automated crack detection and quantitative measurement.
Patent Information
- Application Number
- CN202511540171.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-10-27
AI Technical Summary
Existing methods for detecting cracks in dams rely on manual inspections, which are inefficient and have a high rate of false positives and false negatives. Traditional image processing methods are greatly affected by lighting and noise, and convolutional neural networks have a large number of parameters, making them difficult to apply in real time and difficult to capture global long-range dependencies, resulting in a lack of continuity and high accuracy in the detection results.
A lightweight crack detection method using U-Net is adopted, which combines MobileNetVIT and an efficient Trans module for feature extraction and global context modeling. The network structure is optimized using the SmoothWing loss function to obtain a crack prediction probability map and perform binarization processing, thereby realizing the automated detection of crack quantity, length and width.
It achieves efficient and accurate crack detection, can capture global long-range dependencies, improves the continuity and integrity of detection results, and meets the high precision and timeliness requirements of long-term health monitoring.
Smart Images

Figure CN121010601B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of safety monitoring technology for civil engineering and water conservancy projects, and in particular to a U-Net lightweight crack detection method for concrete structures. Background Technology
[0002] Current methods for detecting cracks in dams largely rely on manual inspections or traditional image processing, resulting in low efficiency and high rates of false positives and false negatives. Manual methods depend heavily on the experience of inspectors, leading to strong subjectivity. Traditional image processing methods are significantly affected by lighting, noise, and background interference, making it difficult to reliably identify cracks, especially small ones. While convolutional neural network-based detection methods offer some automation, their large parameter count makes real-time application difficult. Large-scale models suffer from slow inference speeds and require high-performance GPUs or servers for deployment, hindering real-time online detection in scenarios such as drones and edge computing terminals. Furthermore, convolutional networks have limited receptive fields, making it difficult to capture global long-range dependencies, easily leading to blurred crack boundaries and fractures. They also lack sufficient ability to identify boundaries in complex backgrounds such as small cracks, intersecting cracks, and fine cracks, failing to meet the high accuracy and timeliness requirements of long-term health monitoring. Finally, the detection results lack continuity and completeness. Summary of the Invention
[0003] This invention discloses a U-Net lightweight crack detection method for concrete structures to overcome the above-mentioned technical problems.
[0004] To achieve the above objectives, the technical solution of the present invention is as follows:
[0005] A U-Net lightweight crack detection method for concrete structures includes the following steps:
[0006] S1: Acquire the original image of the concrete structure surface and perform preprocessing;
[0007] S2: Based on the preprocessed concrete structure surface image, a crack prediction probability map is obtained using a U-Net network structure;
[0008] S3: Based on the crack prediction probability map, obtain a binary crack region distribution map, and train the U-Net network structure based on the SmoothWing loss function;
[0009] S4: Obtain an image of the concrete structure surface to be cracked, and based on the trained U-Net network structure, obtain a crack prediction probability map of the concrete structure surface image to be cracked, and then obtain a binarized crack region distribution map of the concrete structure surface image to be cracked, so as to obtain the total number of cracks, the maximum crack width, and the total crack length, and complete the crack detection of the concrete structure.
[0010] Furthermore, the method for obtaining the crack prediction probability map is as follows:
[0011] S21: Based on the preprocessed concrete structure surface image, the backbone encoder MobileNetVIT is used to perform convolutional feature extraction, so as to obtain multiple multi-level local feature maps after feature extraction based on M bottleneck blocks in the backbone encoder MobileNetVIT.
[0012] S22: Based on the multi-level local feature map, use the efficient Trans module to obtain context features containing global dependencies;
[0013] S23: Obtain the crack prediction probability map based on the context features containing global dependencies and the multi-level local feature map.
[0014] Furthermore, the high-efficiency Trans module includes an input layer, a normalization layer, a self-attention module, a stitching and projection module, and an output module;
[0015] The normalization layer is connected to the input layer and is used to obtain a normalized multi-level local feature map based on the multi-level local feature map.
[0016] The self-attention module includes The nth self-attention unit, of which the nth Each self-attention unit is used to obtain a local feature map that integrates boundary, texture and context dependencies based on the normalized multi-level local feature map;
[0017] The stitching and projection module is used to obtain context features containing global dependencies based on multiple local feature maps that fuse boundaries, textures, and context dependencies output by multiple self-attention units, and output them through the output layer.
[0018] Furthermore, the self-attention unit is used to process the normalized multi-level local feature maps. There are 1 channel; among them, the 1st... The first self-attention unit is used to process the first [unclear] in the normalized multi-level local feature map. Channel 1 ~ Number One channel;
[0019] Where d represents the number of channels processed by the self-attention unit; D represents the total number of channels in the normalized multi-level local feature map; Indicates the total number of self-attention units; This is the index of the self-attention unit.
[0020] Furthermore, the SmoothWing loss function formula is as follows:
[0021]
[0022] In the formula: This represents the value of the overall loss; The weights representing the class balance loss; This represents the value of the class balance loss; This represents the value of the edge constraint loss;
[0023] in,
[0024]
[0025] In the formula: N represents the total number of training samples, i represents the index of the training sample; y i p represents the true label of the i-th training sample, where crack pixels are 1 and non-crack pixels are 0; i w represents the crack probability predicted by the network for the i-th sample. yi Indicates category weight;
[0026]
[0027] Where: N e This represents the total number of pixels at the crack boundary, and j represents the index of the pixel at the crack boundary. This represents the prediction error of the j-th boundary pixel, which is the difference in distance between the predicted boundary pixel and the actual boundary pixel. Indicates intermediate calculation parameters;
[0028]
[0029] in, , , , All are smooth adjustment parameters; express The absolute value of.
[0030] Furthermore, the formula used to obtain the total number of cracks is as follows:
[0031]
[0032] In the formula: R represents the total number of connected regions, i.e., the total number of crack regions; A r A represents the area of the r-th crack region; min This represents the minimum crack area threshold; Indicates the number of cracks; This indicates the indicator function; r represents the index of the crack region;
[0033] The formula used to obtain the maximum width of the crack is as follows:
[0034]
[0035] In the formula: Indicates the maximum width of the crack; This represents the maximum Euclidean distance from a skeleton point to the crack boundary;
[0036] The formula used to obtain the total length of the crack is as follows:
[0037]
[0038] In the formula: S represents the set of crack skeleton pixels; Δl(p) represents the Euclidean distance between adjacent skeleton pixels; Indicates the total length of the crack; This represents the pixels on the crack skeleton.
[0039] Beneficial Effects: This invention provides a lightweight U-Net crack detection method for concrete structures. By acquiring a crack prediction probability map, a binary crack region distribution map is obtained. Based on the SmoothWing loss function, a U-Net network structure is trained. Using the trained U-Net network structure, a crack prediction probability map of the concrete structure surface image to be cracked is acquired, thereby obtaining the total number of cracks, the maximum crack width, and the total crack length, completing the crack detection of the concrete structure. This invention, by employing a U-Net network structure to acquire the crack prediction probability map, solves the problems of low detection efficiency and high false positive and false negative rates in manual inspection or traditional image processing. It can capture global long-range dependencies and has high accuracy in boundary recognition of complex backgrounds such as small cracks and intersecting cracks. The detection results are continuous and complete, meeting the high accuracy and timeliness requirements of long-term health monitoring. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of the U-Net lightweight crack detection method for concrete structures according to the present invention.
[0042] Figure 2 This is a schematic diagram of the detection method flow in an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of the encoder structure in an embodiment of the present invention;
[0044] Figure 4 This is a schematic diagram of the high-efficiency Trans module structure in an embodiment of the present invention. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] This embodiment introduces a U-Net lightweight crack detection method for concrete structures, including the following steps: Figure 1 and Figure 2 As shown:
[0047] S1: Acquire the original image of the concrete structure surface and perform preprocessing;
[0048] Specifically, in this embodiment, the original images collected from the surface of the concrete structure are preprocessed: the original images are cropped, rotated, flipped, blurred and denoised, and illuminated in sequence to improve the diversity and robustness of the samples; at the same time, manual annotation is performed to obtain an annotated dataset, which is used as input to the feature extraction module for network training.
[0049] S2: Based on the preprocessed concrete structure surface image, a crack prediction probability map is obtained using a U-Net network structure;
[0050] Preferably, the method for obtaining the crack prediction probability map is as follows:
[0051] S21: Based on the preprocessed concrete structure surface image, the backbone encoder MobileNetVIT is used to perform convolutional feature extraction, so as to obtain multiple multi-level local feature maps after feature extraction based on M bottleneck blocks in the backbone encoder MobileNetVIT.
[0052] S22: Based on the multi-level local feature map, use the efficient Trans module to obtain context features containing global dependencies;
[0053] Preferably, the high-efficiency Trans module includes an input layer, a normalization layer, a self-attention module, a stitching and projection module, and an output module;
[0054] The normalization layer is connected to the input layer and is used to obtain a normalized multi-level local feature map based on the multi-level local feature map.
[0055] The self-attention module includes The nth self-attention unit, of which the nth Each self-attention unit is used to obtain a local feature map that integrates boundary, texture and context dependencies based on the normalized multi-level local feature map;
[0056] The stitching and projection module is used to obtain context features containing global dependencies based on multiple local feature maps that fuse boundaries, textures, and context dependencies output by multiple self-attention units, and output them through the output layer.
[0057] Preferably, the self-attention unit is used to process the normalized multi-level local feature map. There are 1, 2, 3 channels; where d represents the number of channels processed by the self-attention unit; and D represents the total number of channels in the normalized multi-level local feature map. Indicates the total number of self-attention units;
[0058] Among them, the The first self-attention unit is used to process the first [unclear] in the normalized multi-level local feature map. Channel 1 ~ Number One channel.
[0059] Specifically, in this embodiment, the preprocessed concrete structure surface image is input into the backbone encoder MobileNetVIT. As a core component of U-Net, MobileNetVIT is responsible for local convolutional feature extraction, utilizing inverse residual structures (such as... Figure 3 The bottleneck block (dashed line portion) is processed using depthwise separable convolutions to achieve lightweight processing, thereby obtaining multiple multi-level local feature maps including shallow and deep features. Shallow features are used to preserve the texture information of the cracks, while deep features contain richer semantic information. Each multi-level local feature map is then passed to the global context modeling module and the decoding module.
[0060] Specifically, this embodiment uses a high-efficiency Trans module, such as... Figure 4 As shown, global context modeling is performed, and an efficient Trans module is embedded at the key skip connections of MobileNetVIT. A grouped attention and cascaded context fusion mechanism is adopted to capture the long-range dependencies of the cracks in the spatial dimension and obtain a context feature map containing global dependencies. This feature map is then fused with local convolutional features during the decoding stage.
[0061] S23: Obtain the crack prediction probability map based on the context features containing global dependencies and the multi-level local feature map;
[0062] Specifically, this embodiment utilizes local convolutional features (i.e., multi-level local feature maps) and global attention features, based on a U-shaped network, such as... Figure 3 As shown, the symmetric decoding structure upsamples layer by layer, performs step-by-step decoding, and fuses local and global features from different scales to achieve step-by-step restoration of the crack region; obtains the crack prediction probability map; and performs mask segmentation based on the prediction results to generate a visual segmentation result.
[0063] S3: Based on the crack prediction probability map, obtain a binary crack region distribution map, and train the U-Net network structure based on the SmoothWing loss function;
[0064] Specifically, based on the crack prediction probability map, the decoded output probability map is converted into a pixel-level crack segmentation mask. The thresholding operation is then used to convert it into a binary mask map. Finally, the connected component labeling (CCL) method is used for region segmentation to obtain a clear binary crack region distribution map. This ensures that the output results are intuitive and visual, and provides a basis for subsequent counting and geometric measurements.
[0065] Preferably, the SmoothWing loss function formula is as follows:
[0066] In this embodiment, a smooth weighted loss function is proposed. This loss function consists of two parts: class balancing loss and marginal constraint loss, and is adaptively adjusted through dynamic weight parameters. Its formula is as follows:
[0067]
[0068] In the formula: This represents the value of the overall loss; The weights representing the class balance loss; This represents the value of the class balance loss; This represents the value of the edge constraint loss;
[0069] Among them, the class-balanced loss is:
[0070]
[0071] Where N represents the total number of training samples, and i represents the index of the training sample; y i p represents the true label of the i-th training sample, where crack pixels are 1 and non-crack pixels are 0; i w represents the crack probability predicted by the network for the i-th sample. yi Indicates category weight;
[0072] The edge constraint loss is:
[0073]
[0074] Where, N e This represents the total number of pixels at the crack boundary, and j represents the index of the pixel at the crack boundary. This represents the prediction error of the j-th boundary pixel, which is the difference in distance between the predicted boundary pixel and the actual boundary pixel. Indicates intermediate calculation parameters;
[0075] Where, f(e) j (This is in the form of Wing Loss)
[0076]
[0077] in, , , , All parameters are adjusted for smoothness, which allows for logarithmic compression of small error regions to avoid excessive penalty, while imposing stronger constraints on large error regions, thereby improving the accuracy of boundary characterization. express The absolute value;
[0078] This embodiment effectively alleviates the problems of sparse crack pixels and blurred boundaries by using the SmoothWing loss function, combined with class balance weights and edge-sensitive constraints. The weight coefficient β of the class balance loss gradually decreases from 0.7 to 0.3 during training. The class balance loss is used to solve the problem of sparse crack pixels and can employ smooth L1 or focus loss; the edge constraint loss is used to constrain crack boundaries and can employ the Wing Loss function to improve boundary sharpness. This loss function emphasizes class balance in the early stages of training and gradually strengthens edge constraints in the later stages of training, thereby balancing overall segmentation accuracy with fine depiction of crack boundaries.
[0079] Specifically, this embodiment uses the SmoothWing loss function, combined with class balance weights and edge-sensitive constraints, to assign higher learning weights to sparse crack pixels and blurred boundaries, thereby improving the accuracy of the U-Net network structure model in depicting crack boundaries. The output results can be used for the optimized parameter update, driving the entire network to converge. The optimized U-Net network structure model can be used for actual detection tasks and can be extended to post-processing and quantization analysis stages.
[0080] S4: Obtain an image of the concrete structure surface to be cracked, and based on the trained U-Net network structure, obtain a crack prediction probability map of the concrete structure surface image to be cracked, and then obtain a binarized crack region distribution map of the concrete structure surface image to be cracked, so as to obtain the total number of cracks, the maximum crack width, and the total crack length, and complete the crack detection of the concrete structure.
[0081] Specifically, after obtaining the crack segmentation mask, this embodiment further performs automated quantitative calculations on the number, length, and width of the cracks.
[0082] Preferably, the formula used to obtain the number of cracks is as follows:
[0083]
[0084] In the formula: R represents the total number of connected regions, i.e., the total number of crack regions; A r A represents the area of the r-th crack region; min This represents the minimum crack area threshold, and only valid cracks that meet the area requirement are counted. Indicates the number of cracks; This indicates an indicator function, which takes the value 1 if the condition is true and 0 otherwise; r represents the index of the crack region.
[0085] The maximum width of the crack is calculated using skeletonization and distance transformation. Let d be the maximum distance from the skeleton point to the crack boundary. max Then the maximum width of the crack is:
[0086]
[0087] In the formula: Indicates the maximum width of the crack; This represents the maximum Euclidean distance from a skeleton point to the crack boundary;
[0088] The total length of the crack is calculated by the cumulative length of the skeleton, using the following formula:
[0089]
[0090] In the formula: S represents the set of crack skeleton pixels; Δl(p) represents the Euclidean distance between adjacent skeleton pixels; Indicates the total length of the crack; Represents the pixels on the crack skeleton;
[0091] Using the above methods, the system can not only accurately segment cracks, but also automatically perform quantitative measurements of the number, length, and width of cracks, thus providing a reliable basis for health monitoring of large structures such as concrete structures.
[0092] Specifically, this embodiment utilizes connected component analysis to generate a binarized crack region distribution map of the concrete structure surface image to be cracked, enabling crack numbering and quantity statistics. Combined with skeletonization and distance transformation methods, the crack width distribution and maximum width are calculated, with the width value determined by twice the distance from the skeleton point to the boundary. The total crack length is measured through the cumulative length of the skeleton, thereby obtaining quantitative parameters such as crack quantity, length, and maximum width, as well as visual annotation results. These serve as the final output of the detection process and can be directly used for dam structural health assessment, maintenance decisions, and database storage.
[0093] Specifically, after obtaining the crack mask, this embodiment first performs connected component analysis to number and count the cracks. Then, it performs skeletonization on the crack region and calculates the crack width distribution and maximum width using a distance transformation method. The width value is determined by twice the distance from the skeleton point to the boundary. Simultaneously, the total crack length is measured by accumulating the skeleton length. Finally, quantitative parameters such as the number, length, and maximum width of the cracks are output, providing accurate data for structural health monitoring.
[0094] This embodiment is compared with the traditional method, as shown in Table 1;
[0095] Table 1: Comparison results between this embodiment and the traditional convenient method
[0096]
[0097] Application Example 1: Crack Detection in Concrete Structures
[0098] Scenario and Objective: During regular inspections of dam surfaces, manual inspections are inefficient and prone to missing cracks due to the complex morphology and large number of cracks. The objective is to utilize an intelligent detection system to automatically identify crack areas on the structural surface under complex lighting and rough surface conditions, achieving efficient and accurate defect detection.
[0099] Deployment and parameters: Deploy drones or fixed monitoring cameras on the concrete structure to collect surface images in real time and connect them to the crack detection system; the system uses the U-Net model for automatic segmentation, preset output probability thresholds to distinguish cracks from the background, and combines edge smoothing parameters to control the continuity of the predicted boundary.
[0100] Operation Process: During the inspection, the images of the concrete structure surface collected are preprocessed and input into the detection model, which automatically generates crack area masks. If the crack probability value in the detection results exceeds a set threshold, the system marks the crack location on the monitoring interface and records the corresponding image coordinates, while automatically archiving it in the database to form a crack distribution map.
[0101] Effects and benefits: It enables automated detection of surface cracks in concrete structures, reduces reliance on manual labor, and improves inspection efficiency and accuracy. Especially under the condition of large-area complex surfaces of concrete structures, it effectively reduces missed detections and misjudgments.
[0102] Application Example 2: Crack Counting
[0103] Scenario and Objective: In the operation and management of concrete structures, the number of cracks is a crucial reference for safety assessments and maintenance plans. Manual counting often results in omissions or duplicate calculations. The objective is to achieve real-time, comprehensive, and accurate counting and management of crack numbers based on automated crack detection.
[0104] Deployment and parameters: While outputting segmentation results, the detection system integrates a connected component analysis algorithm to independently number unconnected crack regions in the image; the system sets minimum crack length and width thresholds to filter noise and invalid fine lines.
[0105] Operation process: After automatically identifying and segmenting the crack regions, the system marks and numbers each independent connected region and displays the total number in real time. The identification results are synchronously written to the database and archived by time, region, and image number for long-term comparative analysis.
[0106] Effects and benefits: It provides accurate statistics on the number of cracks, avoiding duplication and omissions in manual inspections; it generates long-term trend data on the number of cracks, providing a reliable basis for health monitoring and preventive maintenance of concrete structures.
[0107] Application Example 3: Crack Length and Width Measurement
[0108] Scenario and Objective: The geometric characteristics of cracks in concrete structures (especially their length and width) directly reflect the degree of crack development and potential risks. Traditional manual measurement is time-consuming, labor-intensive, and inaccurate. The objective is to achieve accurate measurement and recording of crack length and width while automatically detecting cracks.
[0109] Deployment and parameters: Based on the crack boundary output by the detection model, the system introduces pixel-to-actual distance conversion parameters (provided by camera calibration and rangefinder), combines crack skeletonization algorithm to extract the length of the crack centerline, and uses vertical projection to calculate the average width and maximum width.
[0110] Operation process: The system automatically generates a crack skeleton from the segmentation results, calculates its overall length, and obtains crack width data at multiple cross-sections. The results are output in numerical and graphical form and written to the database; when the length or width exceeds the preset safety threshold, the system automatically issues an early warning.
[0111] Effects and benefits: It enables automated quantification of crack geometry with high measurement accuracy and no reliance on manual intervention. By continuously monitoring the changing trends of crack length and width, it can effectively identify early structural deterioration and support the long-term safe operation and management of concrete structures.
[0112] The detection method in this embodiment is divided into two parts: offline training and online inference. In the offline training stage, a high-quality training set is constructed by preprocessing and data augmentation of the acquired images. A lightweight convolutional network and an efficient Trans module are combined for feature extraction, context modeling, and decoding fusion. The SmoothWing loss function is used to optimize the model performance. In the online inference stage, the trained model is applied to newly acquired concrete structure images to achieve real-time segmentation of crack areas. Furthermore, quantitative measurements of crack quantity, length, and width are performed, thus forming a complete detection process that balances fine boundary characterization and real-time performance, achieving fine boundary characterization of cracks and real-time edge deployment.
[0113] This embodiment employs MobileNetVIT instead of high-parameter encoders like ResNet and VGG in traditional algorithms. This reduces the number of parameters while improving prediction accuracy. Furthermore, an efficient transformation module divides the D channels of the multi-level local feature map into several groups, which are then processed separately by parallel self-attention units, each handling D / M channels. Compared to the transformer module, this significantly reduces the computational complexity and memory footprint of each attention module, solving the problem of traditional convolutional neural network models being bulky and difficult to deploy in real-time, thus achieving lightweight design.
[0114] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A U-Net lightweight crack detection method for concrete structures, characterized in that, Includes the following steps: S1: Acquire the original image of the concrete structure surface and perform preprocessing; S2: Based on the preprocessed concrete structure surface image, a crack prediction probability map is obtained using a U-Net network structure; S3: Based on the crack prediction probability map, obtain a binary crack region distribution map, and train the U-Net network structure based on the SmoothWing loss function; The SmoothWing loss function formula is as follows: In the formula: This represents the value of the overall loss; The weights representing the class balance loss; This represents the value of the class balance loss; This represents the value of the edge constraint loss; in, In the formula: N represents the total number of training samples, i represents the index of the training sample; y i p represents the true label of the i-th training sample, where crack pixels are 1 and non-crack pixels are 0; i w represents the crack probability predicted by the network for the i-th sample. yi Indicates category weight; Where: N e This represents the total number of pixels at the crack boundary, and j represents the index of the pixel at the crack boundary. This represents the prediction error of the j-th boundary pixel, which is the difference in distance between the predicted boundary pixel and the actual boundary pixel. Indicates intermediate calculation parameters; in, , , , All are smooth adjustment parameters; express The absolute value; S4: Obtain an image of the concrete structure surface to be cracked, and based on the trained U-Net network structure, obtain a crack prediction probability map of the concrete structure surface image to be cracked, and then obtain a binarized crack region distribution map of the concrete structure surface image to be cracked, so as to obtain the total number of cracks, the maximum crack width, and the total crack length, and complete the crack detection of the concrete structure.
2. The U-Net lightweight crack detection method for concrete structures according to claim 1, characterized in that, The method for obtaining the crack prediction probability map is as follows: S21: Based on the preprocessed concrete structure surface image, the backbone encoder MobileNetVIT is used to perform convolutional feature extraction, so as to obtain multiple multi-level local feature maps after feature extraction based on M bottleneck blocks in the backbone encoder MobileNetVIT. S22: Based on the multi-level local feature map, use the efficient Trans module to obtain context features containing global dependencies; The high-efficiency Trans module includes an input layer, a normalization layer, a self-attention module, a stitching and projection module, and an output module; The normalization layer is connected to the input layer and is used to obtain a normalized multi-level local feature map based on the multi-level local feature map. The self-attention module includes The nth self-attention unit, of which the nth Each self-attention unit is used to obtain a local feature map that integrates boundary, texture and context dependencies based on the normalized multi-level local feature map; The stitching and projection module is used to obtain context features containing global dependencies based on multiple local feature maps that fuse boundaries, textures and context dependencies output by multiple self-attention units, and output them through the output layer. S23: Obtain the crack prediction probability map based on the context features containing global dependencies and the multi-level local feature map.
3. The U-Net lightweight crack detection method for concrete structures according to claim 2, characterized in that, The self-attention unit is used to process the normalized multi-level local feature maps. There are 1 channel; among them, the 1st... The first self-attention unit is used to process the first [unclear] in the normalized multi-level local feature map. Channel 1 ~ Number One channel; Where d represents the number of channels processed by the self-attention unit; D represents the total number of channels in the normalized multi-level local feature map; Indicates the total number of self-attention units; This is the index of the self-attention unit.
4. The U-Net lightweight crack detection method for concrete structures according to claim 1, characterized in that, The formula used to obtain the total number of cracks is as follows: In the formula: R represents the total number of connected regions, i.e., the total number of crack regions; A r A represents the area of the r-th crack region; min This represents the minimum crack area threshold; Indicates the number of cracks; This indicates the indicator function; r represents the index of the crack region; The formula used to obtain the maximum width of the crack is as follows: In the formula: Indicates the maximum width of the crack; This represents the maximum Euclidean distance from a skeleton point to the crack boundary; The formula used to obtain the total length of the crack is as follows: In the formula: S represents the set of pixels in the crack skeleton; Δl(p) represents the Euclidean distance between adjacent skeleton points; Indicates the total length of the crack; This represents the pixels on the crack skeleton.
Citation Information
Patent Citations
Reflective stripe detection method and device, electronic equipment and storage medium
CN117541842A
System and method for attention-based surface crack segmentation
US20220222914A1