A bridge crack quantitative calculation method based on semantic segmentation and skeleton extraction
By using lightweight deep learning models and skeleton extraction technology, combined with equipment and camera parameters, high-precision, real-time automated quantitative analysis of bridge cracks was achieved, solving the problems of low measurement accuracy and automation in existing technologies, and adapting to the bridge inspection needs in complex environments.
Patent Information
- Application Number
- CN202611020336.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-11-06
Abstract
Description
Technical Field
[0001] This invention relates to the field of bridge structural health detection and quantitative analysis of defects, and in particular to an automatic detection and quantitative analysis method for bridge cracks based on image processing and deep learning algorithms. The method includes steps such as crack identification, semantic segmentation, skeleton extraction and geometric parameter calculation, aiming to achieve automated and high-precision measurement of crack width and length, and can be further integrated into intelligent detection equipment for quantitative assessment of cracks in civil engineering structures such as bridges. Background Technology
[0002] As critical transportation infrastructure, the structural safety of bridges is directly related to public safety and socio-economic development. During long-term service, bridge structures are affected by multiple factors such as natural disasters, environmental corrosion, and material aging, leading to a gradual degradation of their mechanical properties and directly impacting their load-bearing capacity and durability. To ensure the safe operation of bridges, a model combining health monitoring systems and regular manual inspections has been gradually established. Online monitoring equipment is deployed on important bridges, while regular on-site inspections remain the primary method for general bridges.
[0003] Currently, bridge surface defects detection mainly relies on manual visual inspection or close-range observation using tools such as telescopes and bridge inspection vehicles. These methods suffer from low detection efficiency, high labor costs, strong subjectivity, poor consistency of assessment results, and the need to interrupt or restrict traffic during inspection operations. In recent years, with the development of computer vision and image processing technologies, image-based defect identification methods have shown promising application prospects. Early research methods mainly relied on traditional machine learning and image processing algorithms to achieve preliminary identification of typical defects such as cracks. However, in practical applications, these methods still show insufficient adaptability to complex backgrounds, noise interference, and changes in lighting, exhibiting poor robustness.
[0004] With the advancement of deep learning technology, a series of visual detection models based on convolutional neural networks have made significant progress in bridge defect identification tasks, achieving automated detection and classification of end-to-end damage such as cracks, spalling, and corrosion. Furthermore, the introduction of semantic segmentation models has further enabled pixel-level defect extraction, improving recognition accuracy. Nevertheless, existing methods still face significant bottlenecks in the quantitative analysis of defects—especially in the accurate measurement of key geometric parameters such as crack width and length. Common width estimation methods often rely on techniques such as image binarization, skeleton extraction, centerline distance calculation, or sub-pixel edge fitting. However, most methods do not provide a clear and practical physical definition of "crack width," making them susceptible to interference from factors such as image resolution, shooting angle, and environmental noise, leading to significant deviations in measurement results.
[0005] On the other hand, traditional contact measurement methods, such as those using film rulers, reading microscopes, and vernier calipers, still heavily rely on manual on-site operation. This is not only inefficient but also only allows for the acquisition of data from discrete measurement points, making it difficult to achieve comprehensive and continuous acquisition of crack parameters. This fails to meet the growing demands of modern bridge inspection for real-time performance and automation. Although mobile platforms such as drones and crawling robots are gradually being applied to bridge image acquisition, they still face challenges in quantitative analysis of defect geometric parameters, including calibration difficulties, limited practicality, and low system integration.
[0006] Therefore, under the current technological background, there is an urgent need to develop a real-time quantitative analysis method for cracks that integrates lightweight deep learning models, has clear geometric definition capabilities, and can be adapted to automated acquisition equipment, in order to support efficient, accurate, and non-contact assessment of bridge health status and maintenance decisions. Summary of the Invention
[0007] This invention aims to provide a quantitative calculation method for bridge cracks based on semantic segmentation and skeleton extraction, addressing the problems of low measurement accuracy, reliance on manual experience, low efficiency, and difficulty in achieving automated quantitative analysis in existing bridge crack detection technologies. This invention integrates a lightweight deep learning model, a pixel resolution calculation method based on device geometry and camera parameters, and a crack geometry parameter calculation method based on skeleton extraction and neighborhood analysis. This achieves non-contact, high-precision, real-time automatic measurement of key parameters such as crack width and length, significantly improving the quantitative level and engineering practical value of bridge surface defect detection.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] A quantitative calculation method for bridge cracks based on semantic segmentation and skeleton extraction includes the following steps:
[0010] S1. Acquire high-definition crack images of the concrete structure surface using image acquisition equipment;
[0011] S2. Use a lightweight semantic segmentation model to process the image in real time, accurately segment the crack region, and obtain a binary image of the crack.
[0012] S3. Calculate the pixel resolution of the image based on the device's fixed geometric parameters and the camera's intrinsic parameters;
[0013] S4. Extract the skeleton and trim the branches of the segmented binarized crack image to obtain a crack skeleton with a width of one pixel, and trim the skeleton branches to remove redundant pixels.
[0014] S5. Using a crack geometric parameter calculation method based on neighborhood analysis, the skeleton pixels are traversed, and geometric length weights are assigned according to the distribution of their neighboring pixels and preset rules to calculate the total pixel length of the crack.
[0015] S6. Based on the semantic segmentation results, calculate the total pixel area of the crack region, and combine it with the total pixel length of the crack obtained in step S5 to calculate the average pixel width of the crack.
[0016] S7. Combining the pixel resolution obtained in step S3, convert the total pixel length and average pixel width of the crack into the actual physical length and actual physical width of the crack, respectively.
[0017] Further technology of the present invention:
[0018] Preferably, the lightweight semantic segmentation model is based on an improved U-Net architecture, which reduces relatively redundant hidden layers in the original structure and replaces ordinary convolutions with depthwise separable convolutions; the depthwise separable convolutions consist of three steps: depthwise convolution, pointwise convolution, and bound block convolution; the lightweight semantic segmentation model is optimized using the BCE loss function and introduces an adaptive dropout layer to dynamically adjust the dropout rate of each layer.
[0019] Preferably, the pixel resolution calculation step S3 is implemented in the following manner:
[0020] S31. Obtain camera focal length, image resolution, and sensor size parameters;
[0021] S32. Combining the preset 3D printing support geometric parameters, the pixel resolution is obtained through analytical calculation formulas, which is used to convert the pixel size into the real physical size.
[0022] Preferably, the crack geometric parameter calculation method based on neighborhood analysis specifically includes step S5 as follows:
[0023] S51. Traverse the crack skeleton pixels and analyze the 8-neighborhood of each pixel.
[0024] S52. Based on the connection relationship between the location of a pixel and its neighboring pixels, distinguish between horizontal, vertical and diagonal directions;
[0025] S53. Assign corresponding weight coefficients based on the actual geometric distances corresponding to different connection directions;
[0026] S54. Accumulate all weight coefficients to obtain the total pixel length of the crack.
[0027] Preferably, the neighborhood analysis rule considers the relationship between adjacent pixels in the horizontal, vertical and diagonal directions, and assigns corresponding weight values based on their actual geometric distance.
[0028] Compared with existing technologies, the beneficial effects of this invention are reflected in:
[0029] This invention achieves the integration and automation of detection and quantitative analysis, significantly improving computational efficiency. It overcomes the limitations of traditional methods that separate detection and measurement, integrating crack identification, semantic segmentation, and geometric parameter calculation into a unified framework, realizing full-process automation from image input to quantitative result output. Addressing the complexity and high resource consumption of semantic segmentation model computation, a lightweight DST convolution is proposed. By reducing redundant layers and introducing depthwise separable convolution and adaptive dropout layers, the number of parameters is reduced, computational load is lowered, and FPS is improved while maintaining accuracy, enabling real-time analysis of crack images.
[0030] This invention proposes a clear physical definition of crack geometric parameters and a robust calculation method: Addressing the issues of vague definitions and susceptibility to noise interference in most existing methods for key parameters such as "crack width," and the underestimation of calculation results due to neglecting the geometric relationships between pixels in traditional pixel statistics, this invention proposes a crack length calculation method based on neighborhood analysis. This method considers the actual geometric dimensions of adjacent pixels in the horizontal, vertical, and diagonal directions, obtains the crack pixel size through skeleton extraction and neighborhood analysis, and then converts it to the true size using pixel resolution, significantly improving the measurement accuracy and robustness of complex cracks.
[0031] We have developed a lightweight and efficient deep learning model that is compatible with various acquisition devices. By optimizing the model structure and introducing mechanisms such as depthwise separable convolution and adaptive dropout layers, we have significantly reduced the computational load and parameter count of the model while ensuring high accuracy. This allows the algorithm to be deployed not only on high-performance servers but also to support real-time edge computing on mobile platforms such as handheld width measuring instruments or crawling robots. This effectively solves the problem of high computational resource requirements and difficulty in practical application of existing deep learning models.
[0032] An innovative pixel resolution calibration method based on equipment and camera parameters was proposed: abandoning traditional calibration methods such as calibration boards or laser rangefinders that are inconvenient for field use, a novel pixel resolution calculation method was proposed by integrating the fixed geometric parameters of the equipment and the intrinsic parameters of the camera. This provides a reliable foundation for achieving high-precision and highly practical non-contact measurement and greatly enhances the system's adaptability in field and complex engineering environments. Detailed Implementation
[0033] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention.
[0034] This embodiment provides a method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction. Taking cracks on the surface of the web of a concrete bridge as the detection object, the method completes the quantitative calculation of cracks according to the following steps.
[0035] S1. Acquire high-resolution images of cracks on the surface of the concrete structure using image acquisition equipment:
[0036] An image acquisition device using an integrated industrial CMOS camera was used. The camera lens was vertically aligned with the crack area to be tested in the web of the concrete bridge. The shooting distance was adjusted so that the crack area was completely imaged in the frame. The camera resolution was set to no less than 1920×1080, and the autofocus mode was turned on to acquire high-definition images containing the crack and the surrounding background, ensuring that the crack texture was clear and the edges were distinguishable, thus completing the acquisition of the original image of the crack.
[0037] S2. Use a lightweight semantic segmentation model to process the image in real time, accurately segment the crack region, and obtain a binary image of the crack.
[0038] High-resolution crack images acquired by S1 are input into a lightweight semantic segmentation model. This model improves the U-Net architecture by removing redundant hidden layers, replacing ordinary convolutions with depthwise separable convolutions (DST convolutions), optimizing with the BCE loss function, and introducing an adaptive dropout layer. The model performs real-time pixel-level feature extraction and classification on the input image, accurately distinguishing between crack areas and concrete background areas. It outputs a binary image, where pixels in the crack area are assigned a value of 255 (white), and pixels in the non-crack background area are assigned a value of 0 (black), thus completing accurate segmentation of the crack area.
[0039] S3. Calculate the pixel resolution of the image based on the device's fixed geometric parameters and the camera's intrinsic parameters:
[0040] The system calls upon the device's built-in fixed geometric parameters, including the preset 3D printing support reference size; reads the camera's intrinsic parameters, including focal length, sensor size, and image resolution; based on the camera's imaging principle, it combines the device's reference size, camera parameters, and the support's pixel size in the image using analytical formulas to calculate the actual distance from the lens to the surface under test; substitutes these into the pixel resolution calculation formula to calculate the actual physical size corresponding to each pixel, i.e., the image pixel resolution, and establishes a conversion benchmark between pixel size and physical size.
[0041] S4. Perform skeleton extraction and branch trimming on the segmented binarized crack image to obtain a crack skeleton with a single pixel width, and trim the skeleton branches to remove redundant pixels:
[0042] For the binary crack image output by S2, a morphological thinning algorithm is used to perform skeleton extraction, gradually stripping away edge pixels of the crack region until an initial crack skeleton with only the shape of the crack centerline and a single pixel width is obtained; a branch length threshold is set, all branches of the initial skeleton are traversed, and short branches with a length less than the threshold, isolated pixels, and noise-derived pseudo branches are deleted; redundant pixels at the edges of the skeleton are removed, and the continuity of the skeleton is optimized, finally obtaining a single-pixel width crack skeleton with a complete shape and no redundancy.
[0043] S5. Using a neighborhood analysis-based method for calculating crack geometric parameters, the skeleton pixels are traversed, and geometric length weights are assigned according to preset rules based on the distribution of their neighboring pixels to calculate the total pixel length of the crack:
[0044] For the crack skeleton image processed by S4, all skeleton pixels are traversed pixel by pixel. For each skeleton pixel, the pixel distribution in its 8-neighborhood is analyzed to determine the connection direction of adjacent skeleton pixels and distinguish between horizontal, vertical and diagonal connection relationships. Preset weight rules are used to assign a first weight value to adjacent pixels in the horizontal and vertical directions and a second weight value to adjacent pixels in the diagonal direction. The weight values corresponding to all skeleton pixels are accumulated to obtain the total pixel length of the crack, which accurately represents the total number of pixels corresponding to the actual extension length of the crack.
[0045] S6. Based on the semantic segmentation results, calculate the total pixel area of the crack region, and combine it with the total pixel length of the crack obtained in step S5 to calculate the average pixel width of the crack:
[0046] Based on the binary image of the crack output by S2, the number of pixels in all crack regions with a value of 255 is counted to obtain the total area of crack region pixels. The total pixel length of the crack calculated by S5 is called, and the average pixel width of the crack is calculated according to the formula: average pixel width = total area of crack region pixels ÷ total pixel length of crack, thus realizing pixel-level quantitative representation of crack width.
[0047] S7. Combining the pixel resolution obtained in step S3, convert the total pixel length and average pixel width of the crack into the actual physical length and actual physical width of the crack, respectively:
[0048] The pixel resolution obtained from S3 is used to calculate the true physical length of the crack by multiplying the total pixel length of the crack obtained from S5 by the pixel resolution; the average pixel width of the crack obtained from S6 is multiplied by the pixel resolution to obtain the true physical width of the crack; the true physical length and true physical width of the crack are output to complete the high-precision quantitative calculation of the crack in the bridge concrete.
[0049] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction, characterized in that, Includes the following steps: S1. Acquire high-definition crack images of the concrete structure surface using image acquisition equipment; S2. Use a lightweight semantic segmentation model to process the image in real time, accurately segment the crack region, and obtain a binary image of the crack. S3. Calculate the pixel resolution of the image based on the fixed geometric parameters of the device and the intrinsic parameters of the camera; S4. Extract the skeleton and trim the branches of the segmented binarized crack image to obtain a crack skeleton with a width of one pixel, and trim the skeleton branches to remove redundant pixels. S5. Using a crack geometric parameter calculation method based on neighborhood analysis, the skeleton pixels are traversed, and geometric length weights are assigned according to the distribution of their neighboring pixels and preset rules to calculate the total pixel length of the crack. S6. Based on the semantic segmentation results, calculate the total pixel area of the crack region, and combine it with the total pixel length of the crack obtained in step S5 to calculate the average pixel width of the crack. S7. Combining the pixel resolution obtained in step S3, convert the total pixel length and average pixel width of the crack into the actual physical length and actual physical width of the crack, respectively.
2. The method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction according to claim 1, characterized in that, The lightweight semantic segmentation model is based on an improved U-Net architecture. It reduces relatively redundant hidden layers in the original structure and replaces ordinary convolutions with depthwise separable convolutions. The depthwise separable convolutions consist of three steps: depthwise convolution, pointwise convolution, and bound block convolution. The lightweight semantic segmentation model is optimized using the BCE loss function and introduces an adaptive dropout layer to dynamically adjust the dropout rate of each layer.
3. The method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction according to claim 1, characterized in that, The pixel resolution calculation step S3 is implemented in the following way: S31. Obtain camera focal length, image resolution, and sensor size parameters; S32. Combining the preset 3D printing support geometric parameters, the pixel resolution is obtained through analytical calculation formulas, which is used to convert the pixel size into the real physical size.
4. The method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction according to claim 1, characterized in that, The method for calculating crack geometric parameters based on neighborhood analysis, specifically includes step S5 as follows: S51. Traverse the crack skeleton pixels and analyze the 8-neighborhood of each pixel. S52. Based on the connection relationship between the location of a pixel and its neighboring pixels, distinguish between horizontal, vertical and diagonal directions; S53. Assign corresponding weight coefficients based on the actual geometric distances corresponding to different connection directions; S54. Accumulate all weight coefficients to obtain the total pixel length of the crack.
5. The method for quantitatively calculating bridge cracks based on semantic segmentation and skeleton extraction according to claim 4, characterized in that, The neighborhood analysis rule considers the relationship between adjacent pixels in the horizontal, vertical and diagonal directions, and assigns corresponding weight values based on their actual geometric distance.
