Pavement crack intelligent detection method, system and equipment based on image recognition and medium

By combining adaptive multi-scale illumination normalization and convolutional neural networks, the problems of illumination variation and interference factors in pavement crack detection are solved, achieving high-precision crack feature extraction and quantification, and improving the reliability and intelligence level of detection.

CN121661496APending Publication Date: 2026-03-13宋振刚
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-06
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies for detecting road surface cracks in complex real-world scenarios exhibit poor robustness to noise, shadows, water stains, oil contamination, and localized obstructions. They also struggle to accurately extract crack features in scenarios with drastic changes in lighting, resulting in inaccurate and unreliable detection results.

Method used

By employing adaptive multi-scale illumination normalization preprocessing and pre-trained convolutional neural networks, combined with multi-scale texture feature extraction, crack confidence map segmentation, and sub-pixel-level edge refinement, high-precision crack localization and quantization are achieved.

Benefits of technology

It significantly improves the accuracy and reliability of pavement crack detection, can accurately extract crack features in complex environments, enhances the continuity and generalization ability of detection results, and improves the level of intelligent road maintenance management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661496A_ABST
    Figure CN121661496A_ABST
Patent Text Reader

Abstract

The invention relates to a pavement crack intelligent detection method, system and device based on image recognition and a medium. The method comprises the steps of obtaining an original pavement image, and performing preprocessing according to global brightness distribution of the original pavement image to obtain an image after illumination equalization; inputting the illumination equalization image into a pre-trained convolutional neural network to extract multi-scale texture features, and generating a multi-scale texture feature map; mapping the feature map into a crack confidence map through a segmentation network; performing threshold segmentation based on the confidence map to obtain a crack binary image; performing sub-pixel-level edge refinement on the binary image to obtain a sub-pixel-level crack edge set; and based on the edge set, crack width and length quantization data are calculated through geometric parameters, and a detection result is output. By adopting the method, local shielding interference can be effectively resisted, a scene with dramatic illumination change is adapted, sub-pixel-level precise positioning and quantification of the crack edge are realized, the recognition capability and detection continuity of the fine crack are improved, and the reliability and generalization capability in a complex road environment are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of road surface inspection, and in particular relates to an intelligent method, system, equipment and medium for detecting road surface cracks based on image recognition. Background Technology

[0002] As road maintenance and management move towards intelligentization, automatic pavement crack detection technology based on image recognition has emerged. This technology, leveraging computer vision and deep learning algorithms, can rapidly analyze pavement images to identify, locate, and quantify crack areas, gradually replacing traditional detection methods that rely on manual inspection and experience-based judgment.

[0003] In existing technologies, image-based road crack detection typically employs the following approaches: one is based on traditional image processing methods, extracting crack features through edge detection, threshold segmentation, and morphological operations; the other is based on deep learning methods, utilizing models such as convolutional neural networks to learn semantic features of cracks from a large number of labeled images and achieve end-to-end crack segmentation or classification. These methods have achieved good detection results in ideal scenarios with uniform illumination, clear backgrounds, and no occlusion.

[0004] However, in real-world road environments, the aforementioned methods still have significant limitations. On the one hand, traditional image processing methods rely on manually designed features, which are less robust to interference factors such as noise, shadows, water stains, and oil, and are prone to false positives or false negatives. On the other hand, while deep learning-based models have stronger feature learning capabilities, they often struggle to recover the masked semantic information from single-modal images when partially occluded, such as fallen leaves, curb shadows, or tire tracks causing incomplete crack areas, drastic changes in lighting, or extremely subtle crack morphology. This leads to problems such as disrupted crack continuity, inaccurate edge localization, and decreased semantic confidence, severely impacting the reliability and generalization ability of the detection system in complex real-world scenarios. Summary of the Invention

[0005] Based on this, it is necessary to provide an image recognition-based intelligent road surface crack detection method, system, computer equipment, and computer-readable storage medium that can resist interference from noise, shadows, water stains, oil stains, and partial occlusion, adapt to scenes with drastic changes in lighting, accurately extract multi-scale texture features of cracks, achieve sub-pixel-level positioning of crack edges and accurate quantification of width and length, improve the ability to identify fine cracks and the continuity of detection results, and enhance the reliability and generalization ability of detection in complex real road environments.

[0006] In a first aspect, this application provides an intelligent method for detecting pavement cracks based on image recognition, comprising:

[0007] The original road surface image is acquired, and preprocessed by adaptive multi-scale illumination normalization based on the global brightness distribution of the original road surface image to obtain an image after illumination equalization.

[0008] The image after illumination equalization is input into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map.

[0009] Multi-scale texture feature maps are mapped through a segmentation network to obtain crack confidence maps;

[0010] Based on the crack confidence map, a binary crack map is obtained through threshold segmentation.

[0011] Subpixel-level edge refinement is performed on the binary crack image to obtain a subpixel-level crack edge set.

[0012] Based on the subpixel-level crack edge set, the crack width and length are quantified by calculating geometric parameters to obtain the detection results.

[0013] In one embodiment, based on the global brightness distribution of the original road surface image, preprocessing is performed through adaptive multi-scale illumination normalization to obtain an illumination-equalized image, including:

[0014] The original road surface image is converted to grayscale to obtain a grayscale image;

[0015] Based on the histogram distribution of grayscale images, brightness statistics are calculated through global brightness analysis to identify areas of uneven illumination.

[0016] A multi-scale Gaussian filter is used to perform convolution fusion processing on the grayscale image to obtain the fused illumination component image.

[0017] The reflection component image is obtained by calculating the reflection component of the fused illumination component image using the Retinex algorithm;

[0018] Image enhancement processing is performed on the reflection component image to obtain the image after illumination equalization.

[0019] Based on the above embodiments, a multi-scale Gaussian filter is used to convolve the grayscale image to extract illumination component images at different scales, including:

[0020] Based on the grayscale image, a set of Gaussian kernel standard deviations is pre-defined to characterize different smoothness granularities;

[0021] Gaussian convolution is performed on each standard deviation in the Gaussian kernel standard deviation set to obtain the corresponding Gaussian weight values ​​for each scale. The formula for Gaussian convolution is:

[0022]

[0023] in, coordinates The relative weight of the influence of the center point, where σ is the standard deviation of the Gaussian kernel function, and x and y are the two-dimensional coordinates of the pixels in the image;

[0024] Arrange the Gaussian weight values ​​according to their corresponding positions to obtain the Gaussian kernel matrix;

[0025] Convolve the Gaussian kernel matrix with the grayscale image to obtain multiple illumination component images;

[0026] Multiple illumination component images are obtained, and the local variance of the multiple illumination component images is calculated to obtain the variance dataset;

[0027] Based on the variance dataset, the initial weights of each illumination component image are obtained by fusing the multi-scale illumination components using the following formula:

[0028]

[0029] in, Let be the weight of the i-th scale. λ is the local variance, λ is the control parameter used to adjust the slope of the weight curve, and T is the adaptive threshold, set based on the global brightness mean.

[0030] The initial weights are normalized to obtain the normalized initial weights.

[0031] The pixel values ​​of multiple illumination component images are multiplied with their corresponding normalized weights to obtain the illumination pixel image.

[0032] The illumination pixel image is summed according to pixel position to obtain the fused illumination component image.

[0033] In one embodiment, the pre-trained convolutional neural network includes:

[0034] The ResNet50 network is used to extract multi-level features of an image and output multiple raw feature maps at different scales.

[0035] Feature pyramid networks are used to upsample or downsample multiple original feature maps at different scales to a uniform scale, resulting in feature maps of the same scale.

[0036] The squeeze-excited attention module is used to perform channel attention weighting on feature maps of the same scale, enhancing feature channels related to crack texture and suppressing irrelevant channels to obtain a weighted feature map.

[0037] Based on the above embodiments, channel attention weighting is applied to the feature maps of the same scale to enhance feature channels related to crack texture and suppress irrelevant channels, resulting in a weighted feature map, including:

[0038] Global average pooling is performed on the input feature maps of the same scale to obtain channel-level statistics;

[0039] The channel-level statistics are input into the fully connected layer, and the ReLU activation function is used to perform a nonlinear transformation to obtain the initial channel weights.

[0040] The initial channel weights are normalized by applying the Sigmoid activation function, compressing their numerical range to between 0 and 1, thus obtaining the scaling factor for each channel.

[0041] The scaling factor is multiplied channel by channel with the feature map of the same scale to complete the feature recalibration and obtain a weighted feature map that enhances the significance of crack features.

[0042] In one embodiment, a binary crack map is obtained by threshold segmentation based on the crack confidence map, including:

[0043] Convert the crack confidence map into a crack grayscale histogram;

[0044] Apply a global threshold to the crack grayscale histogram Figure 2 Value-enhancing involves setting pixels with grayscale values ​​greater than a threshold to white level and pixels with grayscale values ​​less than or equal to the threshold to black level, thus obtaining an initial binary image.

[0045] A morphological closing operation is performed on the initial binary image, and circular structuring elements are used to fill the holes and connect the fracture crack regions to obtain the connected binary image.

[0046] Based on the connected binary graph, all connected regions are marked by the connection component analysis to obtain the initial crack binary graph;

[0047] Based on the initial crack binary map, noise regions with areas smaller than the adaptive threshold are removed to obtain the crack binary map.

[0048] In one embodiment, the binary crack image is refined at the sub-pixel level to obtain a sub-pixel level crack edge set, including:

[0049] Perform a distance transformation on the binary crack map, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, and obtain the distance map;

[0050] Based on the distance map, the center line of the crack skeleton with a single pixel width is obtained by iteratively calculating the foreground pixels through a thinning algorithm.

[0051] Based on the centerline of the crack skeleton, the sub-pixel position is calculated on the binary crack map using a quadratic interpolation method to obtain the coordinates of the edge points.

[0052] The edge point coordinates are denoised and filtered, and isolated points are removed according to the curvature threshold to obtain the filtered edge point coordinates.

[0053] By integrating the filtered edge point coordinates, a sub-pixel level crack edge set is obtained.

[0054] Secondly, this application also provides an image recognition-based intelligent pavement crack detection system, comprising:

[0055] The preprocessing module is used to acquire the original road surface image and perform preprocessing based on the global brightness distribution of the original road surface image through adaptive multi-scale illumination normalization to obtain the illumination-equalized image.

[0056] The multi-scale feature extraction module is used to input the image after illumination equalization into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map.

[0057] The crack probability mapping module is used to construct a crack probability mapping based on multi-scale texture feature maps to obtain a crack confidence map.

[0058] The binary map generation module is used to obtain a binary map of cracks by threshold segmentation based on the crack confidence map;

[0059] The subpixel edge refinement module is used to refine the crack binary image at the subpixel level to obtain a subpixel level crack edge set.

[0060] The crack parameter calculation module is used to calculate the crack width and length quantification data based on the sub-pixel level crack edge set and geometric parameters to obtain the detection results.

[0061] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods in the first aspect of this application.

[0062] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any of the methods in the first aspect of this application.

[0063] This application provides an intelligent road surface crack detection method based on image recognition. Through adaptive multi-scale illumination normalization preprocessing of the global brightness distribution of the original road surface image, it effectively solves the problem of uneven image brightness caused by drastic changes in illumination and shadow interference in real road environments. This ensures that the preprocessed, illumination-equalized image retains crack texture information to the greatest extent, reduces the influence of irrelevant factors such as water stains and oil, and significantly improves the accuracy of subsequent feature extraction. The illumination-equalized image is then input into a pre-trained convolutional neural network to extract multi-scale texture features, comprehensively capturing crack features of different sizes and shapes, especially achieving effective feature capture for extremely fine cracks. This overcomes the difficulty of existing deep learning methods in recovering occluded or minute cracks in single-modal images. The system addresses the shortcomings of semantic information by using a segmentation network to obtain a crack confidence map. Threshold segmentation and sub-pixel-level edge refinement not only solve the problems of crack continuity disruption and inaccurate edge localization but also achieve high-precision crack edge extraction. Combined with geometric parameters, quantitative data on crack width and length are calculated, further enhancing the practicality of the detection results. The overall process overcomes the limitations of traditional image processing methods, which rely on manually designed features and have poor robustness. It also enhances the reliability and generalization ability of deep learning models in real-world complex scenarios such as partial occlusion and complex lighting conditions. This enables efficient identification, accurate localization, and quantitative analysis of road cracks, providing accurate and reliable data support for road maintenance and management, and significantly improving the intelligence level and efficiency of road surface detection. Attached Figure Description

[0064] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0065] Figure 1 A schematic diagram of an implementation environment provided for one embodiment of the present invention;

[0066] Figure 2 This is a flowchart of an image recognition-based intelligent road crack detection method according to one embodiment of the present invention;

[0067] Figure 3 This is a schematic diagram of the structure of an image recognition-based intelligent road crack detection system according to one embodiment of the present invention. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0069] First, a brief introduction to the terms used in the embodiments of this application will be given.

[0070] The ResNet50 network is a classic deep convolutional neural network whose core innovation lies in the concept of "residual learning." By introducing a "skip-layer connection" structure, it allows information to skip certain layers and be transmitted directly, effectively alleviating the gradient vanishing problem in deep networks and making it possible to train deep networks with up to 50 layers. This design has made it outstanding in tasks such as image recognition, becoming a milestone model in the field of computer vision. and These are feature map outputs from different stages of the ResNet50 network. It is the output of a shallower layer of the network, with a larger feature map size and higher resolution, mainly preserving detailed information such as the edges and textures of the cracks; It is the output of the deep layers of the network. Its feature map is small in size and low in resolution, but after layers of abstraction, it contains richer semantic information and can better distinguish between "cracks" and "normal road surface background".

[0071] Feature Pyramid Network (NPN) is a deep learning architecture used to solve multi-scale object detection problems. Its core idea is to construct feature pyramids with different scales by fusing strong semantic features from deep networks with high-resolution features from shallow networks. This "top-down + lateral connection" structure enables the network to generate feature maps rich in strong semantic information at all scales, thus significantly improving the detection accuracy, especially for small-sized objects.

[0072] Squeezed-incentivized attention module: This is a lightweight channel attention mechanism. Its core idea is to allow the network to automatically learn the importance of each feature channel. It obtains global information for each channel through a "squeezing" operation, generates weights for each channel through an "incentivizing" operation, and finally "recalibrates" these weights back to the original features. This process enhances important features and suppresses less important features, thereby significantly improving the network's representational ability with minimal computational overhead, effectively improving model performance.

[0073] Crack binary map: a method for determining crack confidence levels through threshold segmentation. Figure 2 The image obtained after valuerization, which contains only black and white pixels, clearly marks the crack area and background, providing a basis for subsequent subpixel edge refinement.

[0074] Crack confidence map: This is a grayscale image where the grayscale value of each pixel intuitively represents the probability that the point belongs to a crack region. It is generated by extracting multi-scale texture features from an image with equal illumination using a pre-trained convolutional neural network, and then performing pixel-level semantic mapping through a segmentation network. In the image, bright areas correspond to high crack probability, while dark areas represent low-probability background.

[0075] Otsu's method for automatic calculation is an adaptive global thresholding algorithm based on the image grayscale histogram. Its core logic is to find the optimal threshold that maximizes the inter-class variance between the foreground and background by traversing all possible thresholds. The larger the inter-class variance, the more significant the grayscale difference between the foreground and background, and the better the segmentation effect.

[0076] The image recognition-based intelligent pavement crack detection method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 100 communicates with camera 101 via a network. Terminal 100 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc.

[0077] In one exemplary embodiment, such as Figure 2 As shown, an intelligent method for detecting pavement cracks based on image recognition is provided, which can be applied to... Figure 1 Taking terminal 100 as an example, the method includes:

[0078] S101: Acquire the original road surface image, and preprocess it according to the global brightness distribution of the original road surface image through adaptive multi-scale illumination normalization to obtain the illumination-equalized image.

[0079] For example, the original road surface image is acquired through camera 101. The image undergoes format standardization processing, converting images output from different devices into digital images of a preset size. This preset size can be dynamically adjusted according to detection accuracy requirements and subsequent algorithm processing efficiency, without being limited to a specific pixel specification. The image after illumination equalization refers to a preprocessed image with uniform illumination distribution and prominent crack details. Based on the global brightness distribution characteristics of the original road surface image, the image grayscale histogram statistics module obtains the global brightness mean, variance, grayscale extreme values, and histogram peak distribution characteristics. This determines the image's brightness and contrast, providing a quantitative basis for formulating subsequent processing strategies. Adaptive Gaussian filtering is used for noise reduction. The filter kernel parameters are adaptively adjusted according to the local noise characteristics of the image, achieving dynamic matching between noise density and filtering intensity. This effectively filters out salt-and-pepper noise and Gaussian noise while fully preserving key details such as crack edges. The multi-scale Retinex algorithm is used to decompose the image. The illumination component is calculated by using multiple Gaussian wrap functions of different scales. The reflection component, which reflects the texture of the road surface and the details of cracks, is separated. The reflection component is subjected to logarithmic transformation to compress the dynamic range. Then, its gray value is mapped to the standard range by linear stretching. The brightness equalization processing results are fused to output the image after illumination equalization.

[0080] S102: Input the image after illumination equalization into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map.

[0081] For example, the image after illumination equalization is input into a ResNet50-based feature extraction network in a pre-trained convolutional neural network. During feature extraction, different layers of ResNet50 will output feature maps with different levels of abstraction. The feature maps output by shallower networks retain details such as road edges and textures, while the feature maps output by deeper networks contain richer semantic information, enabling the differentiation between cracks and the background. To construct a complete multi-scale feature representation system, a feature pyramid network is connected after the ResNet50 network. The feature pyramid network performs targeted processing on the feature maps output by each layer of ResNet50, improving the spatial resolution of deep feature maps through upsampling operations, and fusing them with shallow feature maps through lateral connections. This results in a fused feature map that contains both deep semantic information and retains shallow detailed features, forming a feature pyramid structure covering different scales. To further enhance the representation capability of crack features, a squeeze-excited attention module is embedded in the residual block of ResNet50. This module performs global information aggregation on the feature map through a squeezing operation, and then adaptively adjusts the weights of each feature channel through an excitation operation. This highlights the response of feature channels related to cracks and suppresses invalid features corresponding to interfering factors such as road stains and fallen leaves, making the features extracted by the network more targeted. After collaborative processing by the above modules, a multi-scale texture feature map is output.

[0082] S103: The multi-scale texture feature map is mapped through a segmentation network to obtain the crack confidence map.

[0083] For example, multi-scale texture feature maps are input into a segmentation network with pixel-level semantic segmentation capabilities to achieve feature mapping to crack confidence. The segmentation network adopts an encoder-decoder-based structure, using the U-Net series and optimizing feature representation capabilities by introducing dilated convolutions and attention mechanisms. Before the feature maps are input into the network, a feature fusion operation is performed, using channel-dimensional concatenation or element-level weighted fusion to integrate feature information from different scales into a unified feature tensor. The fusion weights are dynamically allocated based on the clarity and information content of features at each scale, ensuring effective utilization of the complementary advantages of multiple scales. The fused feature tensor undergoes 1×1 convolution to adjust the channel dimension, reducing subsequent computational complexity while preserving core features. The network encoder performs deep abstraction of the fused features through continuous convolution and pooling operations, uncovering the essential differences between cracks and the background; the decoder gradually restores the spatial resolution of the feature maps through upsampling operations, and combines lateral connections to introduce shallow detail features from the encoder stage to compensate for the localization error caused by resolution loss. To enhance the feature response of crack areas, a spatial attention module is embedded in the intermediate layer of the network. Through aggregation and analysis of global information in the feature map, it adaptively increases the feature weights of crack areas and suppresses the feature output of irrelevant areas such as road stains and texture interference. The core of the mapping process is pixel-level classification. The network output layer maps the feature vector of each pixel to a single numerical value through a 1×1 convolution. After activation function processing, this value is converted into the probability value that the pixel belongs to a crack area, i.e., the crack confidence score. The network training adopts a supervised learning mode, using pixel-level labeled road crack images as training samples. The Dice loss function or cross-entropy loss function is selected to optimize the network parameters, ensuring the accuracy of the mapping results. The output crack confidence map is a single-channel grayscale image, and the pixel grayscale value is positively correlated with the crack confidence score.

[0084] S104: Based on the crack confidence map, obtain the crack binary map through threshold segmentation.

[0085] For example, preprocessing is performed on the crack confidence map, using lightweight Gaussian blur or median filtering to eliminate confidence fluctuation noise. The filtering window parameters are adaptively adjusted according to the image texture fineness, smoothing local confidence abrupt change areas without destroying the crack confidence contour. A grayscale histogram analysis module is used to statistically analyze the grayscale value distribution range and peak position. By calculating the kurtosis and skewness of the histogram, the grayscale separation degree between the crack and the background is determined. If the separation degree is low, local histogram equalization is first performed to enhance contrast, and then the distribution characteristics are re-statistically analyzed. Global threshold calculation employs a dual-link mechanism of "main algorithm + verification." The Otsu method is used as the main algorithm to generate the initial threshold, and then an iterative thresholding method is used to verify and correct the initial threshold, ensuring that the threshold maximizes the inter-class variance between the two types of regions. After determining the optimal threshold, a binarization operation is performed: pixels with grayscale values ​​greater than the threshold in the confidence map are set to white level, and pixels with grayscale values ​​less than or equal to the threshold are set to black level, resulting in an initial binary image. To eliminate residual noise from segmentation, morphological opening and closing operations are performed sequentially: the opening operation removes small, isolated noise points by first eroding and then dilating, while the closing operation fills the tiny voids inside the cracks by first dilating and then eroding. Finally, connected component analysis is introduced, and effective crack regions are selected by combining morphological features such as area and aspect ratio. False cracks with too small an area or irregular shape are removed, and a binary crack map with complete outlines and eliminated interference is output.

[0086] S105: Perform subpixel-level edge refinement on the binary crack image to obtain a subpixel-level crack edge set.

[0087] For example, the binary crack image is subjected to morphological erosion operation with small-sized structuring elements to eliminate burrs and jagged edges at the crack edges. The main outline of the crack is restored through dilation, ensuring the continuity and integrity of the crack region composed of foreground pixels. The shortest distance from each foreground pixel to the background pixel is calculated based on Euclidean distance, generating a distance transformation map. Pixel values ​​in the map represent the distance from the corresponding foreground pixel to the crack edge. Pixels with the largest distance transformation values ​​are selected and connected to form a single-pixel-wide crack skeleton centerline, providing a reference for edge localization. After skeleton extraction, the Canny operator is used to perform pixel-level edge detection on the binary image, obtaining a preliminary set of pixel-level edge points. Isolated noise points are removed by calculating the Euclidean distance between adjacent edge points, retaining continuous edge segments. To improve localization accuracy to the sub-pixel level, a sub-pixel localization algorithm based on moment calculation is adopted: for each pixel-level edge point, a local grayscale model is constructed by selecting foreground and background pixels in its neighborhood. The precise position of the edge is solved by calculating the first and second moments of the model, obtaining sub-pixel edge point coordinates with multiple decimal places. Sort and connect all subpixel edge points: Using the center line of the crack skeleton as a reference, sort the edge points according to their distance and azimuth from the skeleton line, remove abnormal points that deviate from the crack direction, and connect the continuous edge points in sequence to form a complete subpixel level crack edge set, where each element is the precise edge point coordinate.

[0088] S106: Based on the sub-pixel level crack edge set, the crack width and length are quantified by calculating the crack width and length data through geometric parameters to obtain the detection results.

[0089] For example, based on a subpixel-level crack edge set, crack length is calculated through geometric analysis: for linear cracks, the central axis is fitted using the least squares method, and the length is obtained from the arc length of the axis; for irregular cracks, a distance transformation combined with a thinning algorithm is used to extract single-pixel skeleton lines, and the lengths of each segment are accumulated after segmentation according to the curvature of the skeleton lines. Crack width is calculated based on the skeleton lines. In the direction perpendicular to the crack direction, corresponding points on both sides are found through edge point matching, and the Euclidean distance is calculated as the width at that location; multiple sets of width values ​​are obtained by equal-interval or adaptive sampling, and the maximum, minimum, and average widths are statistically obtained. The calculation can be extended to include crack area, direction angle, and other parameters. The area is solved by integral of the polygon formed by the edge points. Finally, all quantized parameters are associated with the crack location information in the original image, and structured data such as JSON and XML are output, or a visualization report containing crack annotations and parameters is generated to support subsequent data applications.

[0090] The technical solution provided in this application includes the following technical effects: This application provides an intelligent road surface crack detection method based on image recognition. Through adaptive multi-scale illumination normalization preprocessing of the global brightness distribution of the original road surface image, it effectively solves the problem of uneven image brightness caused by drastic changes in illumination and shadow interference in actual road environments. This allows the preprocessed, illumination-equalized image to retain crack texture information to the greatest extent, weakening the influence of irrelevant factors such as water stains and oil stains, and significantly improving the accuracy of subsequent feature extraction. Inputting the illumination-equalized image into a pre-trained convolutional neural network to extract multi-scale texture features can comprehensively capture crack features of different sizes and shapes, especially achieving effective feature capture for extremely fine cracks, overcoming the difficulty of existing deep learning methods in single-modal images. This approach addresses the shortcomings of traditional image processing methods, such as relying on manually designed features and poor robustness. It also enhances the reliability and generalization capabilities of deep learning models in complex real-world scenarios, including partial occlusion and complex lighting. This enables efficient identification, accurate localization, and quantitative analysis of road surface cracks, providing accurate and reliable data support for road maintenance and management, and significantly improving the intelligence and efficiency of road surface detection.

[0091] In one embodiment of the present invention, based on the global brightness distribution of the original road surface image, preprocessing is performed through adaptive multi-scale illumination normalization to obtain an illumination-equalized image, including:

[0092] S201: Convert the original road surface image to grayscale to obtain a grayscale image.

[0093] For example, a grayscale image is a single-channel image containing only brightness information, where each pixel uses a single grayscale value to represent the degree of brightness, without color information. A weighted average method is preferred for grayscale conversion. This method assigns weights based on the human eye's sensitivity to different colors, better reflecting visual characteristics and preserving road surface details. Other equivalent grayscale conversion methods, such as the maximum component value method or the average value method, can also be used. During the conversion process, the multi-channel color information of the color image is integrated into a single-channel grayscale value according to the corresponding algorithm. Simultaneously, the generated grayscale value is normalized to ensure it falls within the standard grayscale range, preserving the core correlation features between road surface texture and brightness. Furthermore, the single-channel data structure reduces the data complexity and computational time of subsequent histogram analysis and filtering processes.

[0094] S202: Based on the histogram distribution of grayscale images, brightness statistics are calculated through global brightness analysis to obtain the identifier of uneven illumination areas.

[0095] For example, luminance statistics are a set of parameters that quantify the luminance characteristics of an image, used to objectively describe the overall and local brightness states and identify areas of uneven illumination. Based on the grayscale histogram of the grayscale image, the distribution frequency of pixels at each grayscale level is statistically analyzed to calculate luminance statistics, including but not limited to the luminance mean, variance, median, quartiles, and the position and width of the histogram peak. These statistics are analyzed to determine the illumination state: if the luminance mean deviates from the standard range and the variance is large, it indicates uneven illumination; if the histogram peak shifts to the high or low grayscale end, it can be identified as an overly bright or overly dark area, respectively; if multiple discrete peaks exist, they correspond to areas of abrupt brightness changes. Using the image coordinate system, the location, range, and type of uneven illumination are marked with rectangular bounding boxes or pixel masks, thus identifying areas of uneven illumination.

[0096] S203: Use a multi-scale Gaussian filter to perform convolution fusion processing on the grayscale image to obtain the fused illumination component image.

[0097] For example, the fused illumination component image is an image that retains only the illumination variation information of the original image while stripping away the features of the objects themselves, such as road surface texture and cracks. For uneven illumination regions, multiple Gaussian filter kernels of different scales are configured. Small-scale kernels are used to capture subtle local illumination changes, while large-scale kernels are used to extract global illumination trends. Convolution operations of each scale kernel are performed on the grayscale image. During convolution, a weighted average of pixels within the window is calculated using a sliding window to extract illumination information at different scales. An adaptive weighted fusion strategy is adopted, assigning weights to the convolution results at each scale. Regions with drastic illumination changes are given higher weights to small-scale convolution results, while regions with gentle illumination changes are given higher weights to large-scale convolution results. A fused illumination component image that fully reflects the illumination distribution characteristics of the original image is obtained through pixel-by-pixel weighted calculation.

[0098] S204: Calculate the reflection component of the fused illumination component image using the Retinex algorithm to obtain the reflection component image.

[0099] For example, the reflection component image preserves the essential features of objects such as road surface material, texture, and cracks, while eliminating illumination interference. The core principle of the Retinex algorithm is to decompose the image into an illumination component representing illumination changes and a reflection component representing the essential features of objects, which are multiplicative. The reflection component value is calculated using the following formula:

[0100] Where R(x,y) is the reflection component value at the (x,y) coordinate, ωk The weight coefficients for the k-th scale and satisfying Σω k =1, I k (x,y) represents the pixel values ​​of the input grayscale image at the k-th scale, L k (x,y) represents the pixel value of the illumination component image at the k-th scale. ω k The algorithm can be dynamically adjusted based on the identified uneven illumination regions. Regions with abrupt changes in illumination have increased weight at smaller scales, while regions with gradual illumination have increased weight at larger scales. During calculation, logarithmic operations are performed on the grayscale image and the illumination component image at each scale. The results are then weighted and summed according to the weighting coefficients, and the difference is calculated to obtain the logarithmic form of the reflection component. This is then restored to the original numerical range of the reflection component through an exponential transformation. The calculation results are then numerically cropped to limit the grayscale values ​​to a standard range to avoid invalid values. The resulting reflection component image effectively removes illumination interference and highlights essential features such as road surface cracks and textures.

[0101] S205: Perform image enhancement processing on the reflection component image to obtain an image after illumination equalization.

[0102] For example, to address potential issues such as insufficient contrast and blurred details in reflectance component images, a combined enhancement strategy is employed: Contrast stretching technology is used to adjust the image's grayscale dynamic range, mapping dispersed grayscale values ​​to a wider interval and enhancing the grayscale difference between the cracks and the background; grayscale normalization is used to eliminate grayscale shifts in different regions, ensuring a uniform overall grayscale distribution. For areas with unclear texture details, histogram equalization or adaptive histogram equalization can be used to enhance local detail. During the enhancement process, pixel grayscale values ​​must be monitored in real time to avoid overexposure or underexposure, resulting in an image with uniform illumination distribution, clear crack details, and appropriate contrast after illumination equalization.

[0103] This application provides an intelligent road crack detection method based on image recognition. By combining enhancement strategies to solve the contrast and detail problems of the reflection component image, and combining ResNet50, attention module and other enhanced feature representations, through segmentation, edge optimization and parameter quantization, it can achieve accurate extraction and efficient detection of crack details under illumination interference, and provide reliable data support for subsequent applications.

[0104] Based on the above embodiments, a multi-scale Gaussian filter is used to convolve the grayscale image to extract illumination component images at different scales, including:

[0105] S301: Based on the grayscale image, pre-set a set of Gaussian kernel standard deviations to characterize different smoothness granularities;

[0106] For example, by combining the scale characteristics of the identified uneven lighting regions, the standard deviation value needs to cover the range of local fine lighting and global lighting, forming a standard deviation set containing three scales: small, medium, and large. The interval of each scale is adaptively set according to the image texture density, which can capture lighting changes in different ranges.

[0107] S302: Perform Gaussian convolution on each standard deviation in the Gaussian kernel standard deviation set to obtain the corresponding Gaussian weight values ​​for each scale. The formula for Gaussian convolution is:

[0108]

[0109] in, coordinates The relative weight of the influence on the center point, where σ is the standard deviation of the Gaussian kernel function, and x and y are the two-dimensional coordinates of the pixels in the image.

[0110] For example, coordinates The relative weight value of the influence of the center point. The larger the weight value, the stronger the contribution of the illumination information of the pixel to the center pixel, and the higher its proportion in the filtering. σ is the standard deviation of the Gaussian kernel function, which determines the smoothness of the filtering. When calculating, each standard deviation should be used as an independent parameter and substituted into the formula one by one. For all (x,y) coordinates required for the subsequent construction of the Gaussian kernel matrix, the corresponding weight value should be calculated accurately. During the calculation, a certain number of decimal places can be retained to ensure the accuracy of the weight, so as to obtain the Gaussian weight value of the corresponding scale.

[0111] S303: Arrange the Gaussian weight values ​​according to their corresponding positions to obtain the Gaussian kernel matrix.

[0112] For example, the Gaussian kernel matrix is ​​a square matrix, and its side length must match the standard deviation. The larger the standard deviation, the wider the influence range of the weights, and the longer the matrix side length. Typically, the matrix side length is 2k+1 (k is a positive integer), and the value of k is calculated based on the standard deviation to ensure that the weight values ​​of pixels at the edge of the matrix have decayed to near zero, avoiding invalid weights occupying computational resources. During arrangement, with the kernel center as the origin, the Gaussian weight values ​​corresponding to each (x,y) coordinate are filled sequentially according to the row and column order of the matrix: first, all weight values ​​under the same y coordinate are filled along the positive x-axis, then the operation is repeated along the positive y-axis to the next y coordinate until the entire matrix is ​​filled. After filling, the matrix needs to be normalized to ensure that the sum of all weight values ​​in the matrix is ​​1, so that the overall brightness level of the image is not changed during the filtering process, forming a Gaussian kernel matrix that conforms to the distribution characteristics of the Gaussian function.

[0113] S304: Convolve the Gaussian kernel matrix with the grayscale image to obtain multiple illumination component images.

[0114] For example, the convolution operation is performed using a sliding window approach. The size of the sliding window is exactly the same as the side length of the Gaussian kernel matrix, ensuring that each pixel within the window completely matches the kernel matrix. During the operation, the center of the Gaussian kernel matrix is ​​aligned with the current pixel in the image, forming a sliding window covering the range of the kernel matrix. The product of each pixel value within the window and the corresponding weight value in the kernel matrix is ​​calculated. All product results are summed to obtain the convolution output value of the current pixel. The kernel matrix is ​​then moved one pixel along the x-axis, and the above calculation process is repeated until all pixels in the first row of the image have been traversed. Then, the kernel matrix is ​​moved one pixel along the y-axis to begin traversing the second row, and so on, moving pixels one by one to complete the convolution operation for the entire image. Each Gaussian kernel matrix corresponding to a standard deviation needs to undergo a complete convolution operation, resulting in single-scale illumination component images with the same number of standard deviations. These images reflect the road surface illumination distribution information under different smoothing granularities.

[0115] S305: Obtain multiple illumination component images, calculate the local variance of the multiple illumination component images, and obtain the variance dataset.

[0116] For example, local variance is used to quantify the severity of illumination changes in different regions of an illumination component image. A larger variance value indicates more pronounced illumination fluctuations in that region, and vice versa. During calculation, a uniform local window needs to be set for each illumination component image. The window size is determined based on the dimensions of common illumination abrupt change areas on the road surface, typically a square window of 3×3 to 11×11. A window that is too large can blur local details, while a window that is too small has poor noise resistance. The entire image is traversed in units of local windows. For all pixel values ​​within each window, the mean value of the pixels within the window is calculated first. Then, the sum of the squares of the differences between each pixel value and the mean value is calculated and divided by the number of pixels within the window to obtain the local variance of that window. The local variances of all windows are then organized according to their coordinate positions in the image, forming variance data specific to each scale of the illumination component image. The variance data from all scales are then aggregated to construct a complete variance dataset containing location information, scale information, and variance values.

[0117] S306: Based on the variance dataset, fuse the multi-scale illumination components using the following formula to obtain the initial weights for each illumination component image:

[0118]

[0119] in, Let be the weight of the i-th scale. λ is the local variance, λ is the control parameter used to adjust the slope of the weight curve, and T is the adaptive threshold, set based on the global brightness mean.

[0120] For example, in the formula The proportion of illumination information at this scale that contributes to the fusion is determined. λ represents the local variance of the pixel location at this scale, and λ is a control parameter used to flexibly adjust the slope of the weight curve. When it is necessary to strengthen the weight difference between different scales, the value of λ can be increased to make the curve steeper, and the weight distinction between regions with drastic changes in illumination and regions with gentle changes in illumination will be more obvious. When it is necessary to smooth the weight transition, the value of λ can be decreased to make the curve gentler. T is the adaptive threshold, which needs to be set based on the obtained global brightness mean. Usually, the variance value corresponding to the global brightness mean is taken as the benchmark so that the threshold can accurately distinguish between regions with gentle illumination and regions with abrupt changes in illumination. During calculation, the corresponding values ​​at each scale are... By substituting the values ​​one by one into the formula, and combining them with the preset λ and T values, the initial weight of each scale at the corresponding pixel position can be obtained.

[0121] S307: Normalize the initial weights to obtain normalized initial weights.

[0122] For example, for a given pixel location, the initial weights of all scales at that location are collected, denoted as w1, w2, ..., w... n ; Calculate the sum of these initial weights S = w1 + w2 + ... + w n Divide each initial weight by the sum S to obtain the normalized weight of that scale at that position, i.e., w1'=w1 / S, w2'=w2 / S, ..., w n '=w n / S. After normalization, the sum of the normalization weights of all scales at the same pixel location is 1. This preserves the relative magnitude of the weights at each scale and ensures the overall balance of illumination information during the fusion process, avoiding the problem of local over-brightness or under-brightness.

[0123] S308: Multiply the pixel values ​​of multiple illumination component images with their corresponding normalized weights to obtain an illumination pixel image.

[0124] For example, by combining weights with pixel values, illumination information at high-contribution scales is highlighted, while interference from low-contribution scales is suppressed. During computation, the coordinates of the image and weights must be synchronized. For each scale's illumination component image, all pixel positions are traversed, and the pixel value at that position is multiplied by the normalized weight for that scale at that position to obtain the weighted pixel value for that scale. Since the weight values ​​are in the (0,1) range, the weighted pixel value will be less than or equal to the original pixel value. To preserve computational precision and avoid information loss, floating-point data can be temporarily used for storage. A complete weighting operation must be performed on each scale's illumination component image, ultimately resulting in a weighted illumination pixel image consistent with the number of scales. The pixel values ​​of each image have incorporated the weight information for the corresponding scale.

[0125] S309: Sum the illumination pixel images according to pixel positions to obtain the fused illumination component image.

[0126] For example, the fused illumination component image integrates multi-scale illumination information. It preserves details in areas of abrupt illumination changes through small-scale weighting and captures global illumination trends through large-scale weighting, thus completely and accurately reflecting the illumination distribution characteristics of the original road surface image. The summation process must be based on pixel coordinates to ensure that weighted illumination information at all scales is accurately aggregated at the same location. Specifically, it iterates through the same pixel coordinates (x, y) of all weighted illumination pixel images, collects the weighted pixel values ​​at those coordinates, and accumulates these values ​​to obtain the final pixel value at that coordinate. If the accumulated result exceeds the maximum value of the standard grayscale range, a cropping process is performed to limit it to the maximum grayscale value, avoiding illumination information distortion caused by pixel overflow. After completing the accumulation calculation for all coordinates pixel by pixel, all pixel values ​​are combined according to their coordinate positions to form a complete fused illumination component image.

[0127] This application provides an intelligent road crack detection method based on image recognition. Through multi-scale Gaussian filtering and an adaptive fusion strategy, it achieves accurate extraction and optimization of illumination components, with significant technical effects: First, it pre-sets a multi-scale standard deviation set based on the characteristics of uneven illumination regions, combined with dynamic Gaussian kernel generation and convolution operations, effectively capturing full-scale illumination information from subtle local illumination fluctuations to gradual global illumination changes, solving the problem that traditional single-scale filtering cannot simultaneously capture details and the overall picture. Second, it quantifies illumination change characteristics through local variance analysis, combines dynamic allocation of initial weights with normalization processing, and emphasizes large-scale illumination information in areas with gentle illumination while enhancing small-scale details in areas with abrupt changes, achieving adaptive and accurate fusion of multi-scale illumination components. Third, the final output fused illumination component image completely retains the illumination distribution characteristics, stripping away interfering features such as road texture and cracks, while avoiding illumination information distortion, laying a high-quality data foundation for subsequent calculations to efficiently separate reflection components and improve crack detection accuracy.

[0128] Based on the above embodiments, the pre-trained convolutional neural network includes:

[0129] The ResNet50 network is used to extract multi-level features from images and output multiple raw feature maps at different scales.

[0130] ImageNet is a massive and highly influential computer vision dataset containing millions of labeled images and thousands of categories. The method described in the image employs a "transfer learning" strategy, using the parameters of a pre-trained ResNet50 model on ImageNet as initial weights. This significantly improves the model's convergence speed and performance on specific tasks without requiring training from scratch.

[0131] For example, the ResNet50 network serves as the basic feature extraction unit, taking an illumination-equalized image as input and extracting multi-level features through the collaborative operation of convolutional layers, pooling layers, and residual blocks. The network initialization employs a transfer learning strategy, loading pre-trained parameter weights on the ImageNet general image dataset, and only fine-tuning the parameters of the network's final output layer to adapt to the road crack detection task. The ResNet50's residual blocks skip some convolutional layers through shortcut connections, avoiding gradient decay during deep propagation. to Each level outputs original feature maps at different scales. Output small-scale, high-resolution feature maps while preserving detailed information such as crack edges; Output a large-scale, low-resolution feature map containing semantic information for distinguishing cracks from the background.

[0132] Feature pyramid networks are used to upsample or downsample multiple original feature maps at different scales to a uniform scale, resulting in feature maps of the same scale.

[0133] For example, the feature pyramid network receives ResNet50's... to Four sets of feature maps, for the highest layer The feature map is compressed to 256 dimensions using 1×1 convolution, and after batch normalization to stabilize the distribution, it is upsampled by a factor of 2 using parameterized bilinear interpolation to achieve the same resolution as... Feature map matching. The feature map is adapted to 256 dimensions via a 1×1 convolution, and then fine-tuned with a 3×3 convolution to achieve spatial alignment with the upsampled feature map. In the fusion stage, learnable weights α and β (α+β=1) are introduced, and element-level fusion is performed according to the formula "fused feature = α×upsampled feature + β×adapted feature," followed by feature enhancement via a 3×3 convolution. This process is repeated layer by layer downwards. , The fusion yields four sets of 256-dimensional feature maps at the same scale with increasing resolution, covering a downsampling range of 4 to 16 times.

[0134] The squeeze-excited attention module is used to perform channel attention weighting on feature maps of the same scale, enhancing feature channels related to crack texture and suppressing irrelevant channels to obtain a weighted feature map.

[0135] For example, global averaging and max pooling are performed simultaneously on the 256-dimensional feature map. The former captures the overall channel response, while the latter highlights key local features. The results of the two pooling operations are concatenated to form a 2×256 feature vector to form a channel descriptor. This vector is then input into a bottleneck network consisting of two fully connected layers. The first fully connected layer compresses the dimension from 2×256 to 2×16 to reduce computational complexity. After compression, a ReLU activation function is applied to introduce nonlinearity and enhance the ability to express complex features. The second fully connected layer restores the dimension to 2×256 to match the original number of channels. After output, a 256-dimensional dual-channel weight matrix is ​​generated by mapping the feature values ​​to the 0,1 interval through a Sigmoid activation function. Element-wise averaging of the dual-channel weight matrix yields 256-dimensional attention weights. These weights are then multiplied element-wise by channel with the same-scale feature map output by the feature pyramid network. Simultaneously, residual connections are introduced to add the original feature map and the weighted feature map to avoid the loss of effective features, resulting in a weighted feature map.

[0136] This application provides an intelligent pavement crack detection method based on image recognition. ResNet50 leverages transfer learning and residual connections to quickly adapt to the task, extracting multi-level features from details to semantics. The feature pyramid network uses channel adaptation, spatial alignment, and adaptive fusion to transform multi-scale features into a single-scale feature map that retains both semantics and details, solving the scale mismatch problem. The squeezed-excitation attention module uses dual pooling and ReLU and Sigmoid activation functions to accurately filter crack features and suppress interference, while residual connections prevent feature loss. This improves the signal-to-noise ratio of the feature map and crack recognition accuracy, providing high-quality support for subsequent segmentation and parameter quantization, and enhancing the model's adaptability and detection reliability on complex pavements.

[0137] Based on the above embodiments, channel attention weighting is applied to the feature maps of the same scale to enhance feature channels related to crack texture and suppress irrelevant channels, resulting in a weighted feature map, including:

[0138] S401: Perform global average pooling on the input feature map of the same scale to obtain channel-level statistics.

[0139] For example, global average pooling is performed on the input feature map of the same scale to obtain channel-level statistics. The input feature map of the same scale has dimensions of C×H×W, where C is the number of channels, which is fixed at 256; H and W are the height and width of the feature map. Global average pooling is performed on a channel-by-channel basis, traversing the H×W pixels of each channel and calculating the mean of all pixels in that channel, compressing the two-dimensional features into a one-dimensional value, and obtaining a channel-level statistic of dimension C×1×1. This statistic can reflect the overall response intensity of each feature channel.

[0140] S402: Input the channel-level statistics into the fully connected layer and perform a nonlinear transformation using the ReLU activation function to obtain the initial channel weights.

[0141] For example, the first fully connected layer compresses the C×1×1 statistics to a (C / 16)×1×1 dimension. After compression, it is connected to the ReLU activation function. The nonlinear transformation breaks the linear correlation between features and enhances the model's ability to express complex features such as crack textures. The second fully connected layer restores the feature dimension to C×1×1 and obtains the initial channel weights that match the original number of channels.

[0142] S403: Apply the Sigmoid activation function to normalize the initial channel weights, compressing their numerical range to between 0 and 1, to obtain the scaling factor for each channel.

[0143] For example, the Sigmoid function is expressed by the formula The initial channel weights are calculated element by element to ensure that the output scaling factor is strictly within the range of 0 to 1. The closer the factor is to 1, the stronger the correlation between the corresponding channel and the crack feature; the closer it is to 0, the weaker the correlation. This provides a clear basis for subsequent feature selection. During the calculation process, extreme values ​​that exceed the range of 0-1 are cropped and corrected.

[0144] S404: Perform channel-by-channel multiplication of the scaling factor with the feature map of the same scale to complete the feature recalibration and obtain a weighted feature map that enhances the significance of crack features.

[0145] For example, the scaling factor is multiplied channel by channel with the feature map of the same scale to complete feature recalibration, resulting in a weighted feature map that enhances the saliency of crack features. During the operation, the channel dimensions are kept aligned, and the H×W pixel values ​​of each feature channel are multiplied by the scaling factor corresponding to that channel, achieving precise control of the channel response—features of channels related to crack texture are amplified, while features of channels irrelevant to road stains, markings, etc., are suppressed; after the operation, the H×W dimension and spatial structure of the feature map are preserved, resulting in a weighted feature map with dimensions still 256×H×W.

[0146] This application provides an intelligent road crack detection method based on image recognition. By extracting channel features through global average pooling, enhancing nonlinear expression through ReLU, generating reasonable weights through Sigmoid, and performing channel-by-channel weighted calibration, the method accurately amplifies the response of crack texture-related feature channels and suppresses irrelevant interference, effectively improving the signal-to-noise ratio of feature maps and the saliency of crack features, and providing high-quality feature input for subsequent crack segmentation.

[0147] Based on the above embodiments, a binary crack map is obtained by threshold segmentation according to the crack confidence map, including:

[0148] S501: Convert the crack confidence map into a crack grayscale histogram.

[0149] For example, the pixel value range of the crack confidence map is [0,1]. Its grayscale values ​​are stretched to the standard range of [0,255] using linear mapping to ensure compatibility with histogram statistical requirements. Using grayscale levels (0-255) as the horizontal axis and the number of pixels corresponding to each grayscale level as the vertical axis, all pixels in the stretched confidence map are traversed, and the cumulative number of pixels at each grayscale level is counted to generate a crack grayscale histogram reflecting the grayscale distribution characteristics. The peak distribution of the histogram can intuitively show the grayscale difference between the crack and the background.

[0150] S502: Apply a global threshold to the crack grayscale histogram Figure 2 Value-enhancing is performed by setting pixels with grayscale values ​​greater than a threshold to white level and pixels with grayscale values ​​less than or equal to the threshold to black level, thus obtaining an initial binary image.

[0151] In this context, the global threshold refers to the parameter used to distinguish between the foreground and background of the entire image during the image binarization process, rather than being adaptively adjusted for local regions.

[0152] For example, the global threshold is automatically calculated using the Otsu method. This method determines the optimal threshold by maximizing the inter-class variance between the foreground and background, avoiding the subjectivity of manual parameter setting. The white level is uniformly set to 255 to represent the crack foreground, and the black level is set to 0 to represent the road surface background. The image pixels are traversed and assigned values ​​according to the threshold rules to generate an initial binary image containing only black and white. If there are pixels with a gray value equal to the threshold, they are uniformly classified as background pixels.

[0153] S503: Perform a morphological closing operation on the initial binary image, using circular structuring elements to fill the holes and connect the fracture crack regions to obtain the connected binary image.

[0154] Among them, the morphological closing operation is a combination of dilation and erosion in image processing. It is often performed using a circular structuring element. Dilation can connect broken crack segments in the crack binary image, while erosion can restore the main outline of the crack and eliminate the edge redundancy caused by dilation, ultimately achieving the effect of filling the small holes inside the crack and strengthening the crack connectivity.

[0155] For example, the radius of the circular structuring element is determined based on the common crack width and aperture size, typically ranging from 2 to 5 pixels, ensuring that the crack is not over-expanded while effectively filling the defect. The morphological closing operation is performed in the order of dilation followed by erosion. The dilation operation traverses the foreground pixels through the structuring element, transforming the background pixels in the neighborhood into foreground pixels and connecting the broken crack segments. The erosion operation restores the main outline of the crack, eliminates the edge redundancy caused by dilation, fills the aperture inside the crack, and strengthens the crack connectivity, resulting in a connected binary image.

[0156] S504: Based on the connected binary graph, analyze and mark all connected regions through the connection component to obtain the initial crack binary graph.

[0157] For example, using an eight-neighbor connectivity rule, the image is scanned pixel by pixel starting from the top left corner. When an unlabeled foreground pixel is encountered, a region growing algorithm is initiated to recursively label all connected foreground pixels, assigning a unique integer label to each connected region. After the scan is complete, the label information and the pixel coordinates of the corresponding regions are retained to generate an initial binary crack map containing the labels of all connected regions, with the background region label uniformly set to 0.

[0158] S505: Based on the initial crack binary map, remove noise regions with areas smaller than the adaptive threshold to obtain the crack binary map.

[0159] For example, the area of ​​all connected regions is counted, the median M of these areas is calculated, and the adaptive threshold is set to M / 5. All connected regions are traversed. If the area of ​​a region is less than the adaptive threshold, it is identified as a noise region, and its pixel value is set from 255 to 0. Regions with an area greater than or equal to the threshold are retained to obtain a binary crack map containing only valid cracks. At the same time, the label and location information of the valid regions are recorded.

[0160] This application provides an intelligent road crack detection method based on image recognition. It uses histograms to convert them into threshold segmentation to provide a basis, combines the Otsu method to achieve adaptive threshold binarization, fills crack pores and connects fracture areas through morphological closing operations, and then effectively eliminates manual parameter setting errors and detection interference through connected component analysis and noise filtering. Finally, it outputs a high-quality crack binary image with complete crack morphology and thorough noise removal, providing reliable data support for subsequent crack parameter quantification.

[0161] In an exemplary embodiment, the binary crack map is refined at the sub-pixel level to obtain a sub-pixel level crack edge set, including:

[0162] S601: Perform distance transformation on the binary image of the crack, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, and obtain the distance map.

[0163] Euclidean distance refers to the method of calculating the straight-line distance between two points in the image pixel coordinate system. The calculation formula is: , where (x1, y1) represents the coordinates of the first point in two-dimensional space, and (x2, y2) represents the coordinates of the second point.

[0164] For example, in the binary image of the crack, the foreground pixel value is 255 and the background value is 0. Using a 3×3 neighborhood as the basic calculation unit, the foreground pixels of the entire image are traversed. For each target pixel (x0, y0), all background pixels (x, y) in the neighborhood and the extended range are searched. The distance value is calculated by substituting into the Euclidean distance formula, and the minimum value is selected as the distance value of the pixel. The background pixels are uniformly assigned a value of 0 to obtain a distance map with the same size as the original binary image. The larger the pixel value in the image, the closer the position is to the crack center.

[0165] S602: Based on the distance map, the foreground pixels are iteratively calculated using a thinning algorithm to obtain the center line of the crack skeleton with a width of one pixel.

[0166] Among them, the Zhang-Suen fast thinning algorithm is a method to extract single-pixel wide skeletons of binary images by iteratively deleting boundary pixels. Its advantage lies in efficiently preserving the original topological structure.

[0167] For example, the Zhang-Suen fast thinning algorithm is used to perform pixel deletion operations in two rounds of iteration: In the first round, the foreground pixels of the distance map are traversed, and pixels that meet the following conditions are marked as to be deleted: "not an isolated point, not a boundary endpoint, the number of foreground pixels in the 8-neighborhood is 2-6, and the adjacent background pixels are continuous" and the distance value is not a local maximum; In the second round, the above operation is repeated but the order of neighborhood judgment is adjusted to avoid over-thinning. Iteration continues until no pixels can be deleted, and finally, a skeleton centerline with a width of 1 pixel is obtained, retaining only the central structure of the crack, while also preserving the branching and orientation features of the crack.

[0168] S603: Based on the centerline of the crack skeleton, the sub-pixel position is calculated using a quadratic interpolation method on the binary crack map to obtain the coordinates of the edge points.

[0169] Among them, the quadratic interpolation method refers to an algorithm that constructs a quadratic function by using the gray values ​​of the neighborhood of a pixel, and solves for the coordinates of the extreme points of the function to obtain the position with precision below the pixel level.

[0170] For example, using the centerline pixel of the skeleton as a reference, three consecutive background-foreground transition pixels are selected on each side perpendicular to the direction of the crack to form a 5-pixel window. The grayscale values ​​and corresponding pixel coordinates of these pixels are extracted. A quadratic polynomial function is constructed with the coordinates as the independent variable and the grayscale value as the dependent variable. The function curve is fitted by the least squares method, and the coordinates of the intersection point of the curve and the grayscale value 128 are solved. This intersection point is the sub-pixel level edge point. The coordinate value is retained to one decimal place to reflect the sub-pixel precision, and the edge point coordinates are obtained.

[0171] S604: Perform noise filtering on the edge point coordinates, remove isolated points according to the curvature threshold, and obtain the filtered edge point coordinates.

[0172] The curvature threshold is the basis for determining whether an edge point is isolated noise. It is determined by calculating the curvature of the local curve of the edge point. If the curvature exceeds the threshold, it is judged as noise.

[0173] For example, the curvature of each edge point is calculated using the sliding window method: a local curve is constructed using the current point and two adjacent points before and after it, and the curvature value is obtained by calculating the curvature of the curve through the cross product of vectors; the curvature distribution of all edge points is statistically analyzed, and the 95th percentile is taken as the curvature threshold. When the curvature of an edge point exceeds the threshold and the number of edge points in its 5×5 neighborhood is less than 3, it is determined to be an isolated noise point and deleted; the remaining edge points are sorted in order according to the crack direction to eliminate the coordinate disorder problem and obtain the filtered edge point coordinates.

[0174] S605: Integrate the filtered edge point coordinates to obtain a sub-pixel level crack edge set.

[0175] Among them, the sub-pixel level crack edge set is composed of a series of edge points with coordinate accuracy of 0.1 pixels, which can accurately reflect the true contour of the crack.

[0176] For example, the sorted edge points are classified according to the two-level hierarchical relationship of crack branches and main cracks. Edge points of the same branch are numbered sequentially, and the (x,y) subpixel coordinates and the branch identifier of each point are recorded. Duplicate edge points at the end of the branches are removed, and overlapping points with an adjacent distance of less than 0.3 pixels are merged to form a structured subpixel level crack edge set containing coordinate information and branch information, which can be directly used for subsequent geometric parameter calculation.

[0177] This application provides an intelligent road crack detection method based on image recognition. It extracts a precise crack skeleton through distance transformation and thinning algorithms, achieves sub-pixel level edge localization by combining quadratic interpolation, and integrates coordinates after curvature threshold filtering to remove isolated noise. Finally, it obtains a set of crack edges with clear contours and a localization accuracy of 0.1 pixels, providing high-precision data support for subsequent crack geometric parameter quantification.

[0178] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0179] Based on the same inventive concept, this application also provides an image recognition-based intelligent pavement crack detection system for implementing the above-mentioned image recognition-based intelligent pavement crack detection method. The solution provided by this system is similar to the implementation scheme described in the above method. Therefore, the specific limitations of one or more image recognition-based intelligent pavement crack detection system embodiments provided below can be found in the limitations of the image recognition-based intelligent pavement crack detection method described above, and will not be repeated here.

[0180] In one exemplary embodiment, such as Figure 3 As shown, an intelligent pavement crack detection system based on image recognition is provided, comprising:

[0181] The preprocessing module 701 is used to acquire the original road surface image and perform preprocessing based on the global brightness distribution of the original road surface image through adaptive multi-scale illumination normalization to obtain an image after illumination equalization.

[0182] The multi-scale feature extraction module 702 is used to input the image after illumination equalization into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map.

[0183] The crack probability mapping module 703 is used to map multi-scale texture feature maps through a segmentation network to obtain crack confidence maps.

[0184] Binary map generation module 704 is used to obtain a binary map of cracks by threshold segmentation based on the crack confidence map;

[0185] The subpixel edge refinement module 705 is used to refine the crack binary image at the subpixel level to obtain a subpixel level crack edge set.

[0186] The crack parameter calculation module 706 is used to calculate the crack width and length quantization data based on the sub-pixel level crack edge set and geometric parameters to obtain the detection results.

[0187] In one embodiment of the present invention, the preprocessing module 701 is further configured to:

[0188] The original road surface image is converted to grayscale to obtain a grayscale image;

[0189] Based on the histogram distribution of grayscale images, brightness statistics are calculated through global brightness analysis to identify areas of uneven illumination.

[0190] A multi-scale Gaussian filter is used to perform convolution fusion processing on the grayscale image to obtain the fused illumination component image.

[0191] The reflection component image is obtained by calculating the reflection component of the fused illumination component image using the Retinex algorithm;

[0192] Image enhancement processing is performed on the reflection component image to obtain the image after illumination equalization.

[0193] In one embodiment of the present invention, the preprocessing module 701 is further configured to: based on the grayscale image, preset a set of Gaussian kernel standard deviations to characterize different smoothness granularities;

[0194] Gaussian convolution is performed on each standard deviation in the Gaussian kernel standard deviation set to obtain the corresponding Gaussian weight values ​​for each scale. The formula for Gaussian convolution is:

[0195]

[0196] in, coordinates The relative weight of the influence of the center point, where σ is the standard deviation of the Gaussian kernel function, and x and y are the two-dimensional coordinates of the pixels in the image;

[0197] Arrange the Gaussian weight values ​​according to their corresponding positions to obtain the Gaussian kernel matrix;

[0198] Convolve the Gaussian kernel matrix with the grayscale image to obtain multiple illumination component images;

[0199] Multiple illumination component images are obtained, and the local variance of the multiple illumination component images is calculated to obtain the variance dataset;

[0200] Based on the variance dataset, the initial weights of each illumination component image are obtained by fusing the multi-scale illumination components using the following formula:

[0201]

[0202] in, Let be the weight of the i-th scale. λ is the local variance, λ is the control parameter used to adjust the slope of the weight curve, and T is the adaptive threshold, set based on the global brightness mean.

[0203] The initial weights are normalized to obtain the normalized initial weights.

[0204] The pixel values ​​of multiple illumination component images are multiplied with their corresponding normalized weights to obtain the illumination pixel image.

[0205] The illumination pixel image is summed according to pixel position to obtain the fused illumination component image.

[0206] In one embodiment of the present invention, the pre-trained convolutional neural network includes:

[0207] The ResNet50 network is used to extract multi-level features of an image and output multiple raw feature maps at different scales.

[0208] Feature pyramid networks are used to upsample or downsample multiple original feature maps at different scales to a uniform scale, resulting in feature maps of the same scale.

[0209] The squeeze-excited attention module is used to perform channel attention weighting on feature maps of the same scale, enhancing feature channels related to crack texture and suppressing irrelevant channels to obtain a weighted feature map.

[0210] In one embodiment of the present invention, the squeeze-excited attention module is further configured to:

[0211] Global average pooling is performed on the input feature maps of the same scale to obtain channel-level statistics;

[0212] The channel-level statistics are input into the fully connected layer, and the ReLU activation function is used to perform a nonlinear transformation to obtain the initial channel weights.

[0213] The initial channel weights are normalized by applying the Sigmoid activation function, compressing their numerical range to between 0 and 1, thus obtaining the scaling factor for each channel.

[0214] The scaling factor is multiplied channel by channel with the feature map of the same scale to complete the feature recalibration and obtain a weighted feature map that enhances the significance of crack features.

[0215] In one embodiment of the present invention, the binary image generation module 704 is further configured to:

[0216] Convert the crack confidence map into a crack grayscale histogram;

[0217] Apply a global threshold to the crack grayscale histogram Figure 2 Value-enhancing involves setting pixels with grayscale values ​​greater than a threshold to white level and pixels with grayscale values ​​less than or equal to the threshold to black level, thus obtaining an initial binary image.

[0218] A morphological closing operation is performed on the initial binary image, and circular structuring elements are used to fill the holes and connect the fracture crack regions to obtain the connected binary image.

[0219] Based on the connected binary graph, all connected regions are marked by the connection component analysis to obtain the initial crack binary graph;

[0220] Based on the initial crack binary map, noise regions with areas smaller than the adaptive threshold are removed to obtain the crack binary map.

[0221] In one embodiment of the present invention, the sub-pixel edge refinement module 705 is further configured to:

[0222] Perform a distance transformation on the binary crack map, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, and obtain the distance map;

[0223] Based on the distance map, the center line of the crack skeleton with a single pixel width is obtained by iteratively calculating the foreground pixels through a thinning algorithm.

[0224] Based on the centerline of the crack skeleton, the sub-pixel position is calculated on the binary crack map using a quadratic interpolation method to obtain the coordinates of the edge points.

[0225] The edge point coordinates are denoised and filtered, and isolated points are removed according to the curvature threshold to obtain the filtered edge point coordinates.

[0226] By integrating the filtered edge point coordinates, a sub-pixel level crack edge set is obtained.

[0227] In one embodiment, this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0228] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0229] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The components described as separate parts may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this disclosure according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0230] The above-described embodiments are merely illustrative of several implementation methods of the embodiments of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of the patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the embodiments of this application, and these modifications and improvements all fall within the protection scope of the embodiments of this application.

Claims

1. A method for intelligent detection of road surface cracks based on image recognition, characterized in that, The method includes: The original road surface image is acquired, and preprocessed by adaptive multi-scale illumination normalization based on the global brightness distribution of the original road surface image to obtain an image after illumination equalization. The image after illumination equalization is input into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map. The multi-scale texture feature map is mapped through a segmentation network to obtain a crack confidence map; Based on the crack confidence map, a binary crack map is obtained by threshold segmentation. The binary crack image is subjected to subpixel-level edge refinement to obtain a subpixel-level crack edge set; Based on the sub-pixel level crack edge set, the crack width and length quantization data are calculated using geometric parameters to obtain the detection results.

2. The method according to claim 1, characterized in that, The step of preprocessing the image based on the global brightness distribution of the original road surface image through adaptive multi-scale illumination normalization to obtain an illumination-equalized image includes: The original road surface image is converted to grayscale to obtain a grayscale image; Based on the histogram distribution of the grayscale image, the brightness statistics are calculated through global brightness analysis to obtain the identification of uneven lighting areas; The grayscale image is convolutionally fused using a multi-scale Gaussian filter to obtain a fused illumination component image. The reflection component of the fused illumination component image is calculated using the Retinex algorithm to obtain the reflection component image; The reflection component image is subjected to image enhancement processing to obtain the illumination-equalized image.

3. The method according to claim 2, characterized in that, The step of using a multi-scale Gaussian filter to convolve the grayscale image and extract illumination component images at different scales includes: Based on the grayscale image, a set of Gaussian kernel standard deviations is preset to characterize different smoothness granularities; Gaussian convolution is performed on each standard deviation in the Gaussian kernel standard deviation set to obtain the corresponding Gaussian weight value for the scale. The formula for Gaussian convolution is: in, coordinates The relative weight of the influence of the center point, where σ is the standard deviation of the Gaussian kernel function, and x and y are the two-dimensional coordinates of the pixels in the image; Arrange the Gaussian weight values ​​according to their corresponding positions to obtain the Gaussian kernel matrix; The Gaussian kernel matrix is ​​convolved with the grayscale image to obtain multiple illumination component images; Multiple illumination component images are obtained, and the local variance of the multiple illumination component images is calculated to obtain a variance dataset; Based on the variance dataset, the initial weights of each illumination component image are obtained by fusing the multi-scale illumination components using the following formula: in, Let be the weight of the i-th scale. λ is the local variance, λ is the control parameter used to adjust the slope of the weight curve, and T is the adaptive threshold, set based on the global brightness mean. The initial weights are normalized to obtain normalized initial weights; The pixel values ​​of the multiple illumination component images are multiplied with the corresponding normalized weights to obtain the illumination pixel image; The illumination pixel image is summed according to pixel position to obtain the fused illumination component image.

4. The method according to claim 1, characterized in that, The pre-trained convolutional neural network includes: The ResNet50 network is used to extract multi-level features of an image and output multiple raw feature maps at different scales. A feature pyramid network is used to upsample or downsample the original feature maps of multiple different scales to a uniform scale to obtain feature maps of the same scale. The squeeze-excited attention module is used to perform channel attention weighting on the same-scale feature map, enhance the feature channels related to crack texture and suppress irrelevant channels to obtain a weighted feature map.

5. The method according to claim 4, characterized in that, The step of applying channel attention weighting to the same-scale feature map, enhancing feature channels related to crack texture and suppressing irrelevant channels to obtain a weighted feature map, includes: Global average pooling is performed on the input feature map of the same scale to obtain channel-level statistics; The channel-level statistics are input into the fully connected layer, and the ReLU activation function is used to perform a nonlinear transformation to obtain the initial channel weights. The initial channel weights are normalized by applying the Sigmoid activation function, compressing their numerical range to between 0 and 1, to obtain the scaling factor for each channel. The scaling factor is multiplied channel by channel with the feature map of the same scale to complete the feature recalibration and obtain a weighted feature map that enhances the saliency of crack features.

6. The method according to claim 1, characterized in that, The step of obtaining a binary crack map by threshold segmentation based on the crack confidence map includes: The crack confidence map is converted into a crack grayscale histogram; The crack grayscale histogram is binarized by applying a global threshold. Pixels with grayscale values ​​greater than the threshold are set to white level, and pixels with grayscale values ​​less than or equal to the threshold are set to black level, thus obtaining an initial binary image. A morphological closing operation is performed on the initial binary image, and circular structuring elements are used to fill the holes and connect the fracture crack regions to obtain the connected binary image. Based on the connected binary graph, all connected regions are analyzed and marked by the connection component to obtain the initial crack binary graph; Based on the initial crack binary map, noise regions with areas smaller than the adaptive threshold are removed to obtain the crack binary map.

7. The method according to claim 1, characterized in that, The subpixel-level edge refinement of the binary crack image yields a subpixel-level crack edge set, including: Perform a distance transformation on the binary crack map, calculate the Euclidean distance from each foreground pixel to the nearest background pixel, and obtain a distance map; Based on the distance map, the center line of the crack skeleton with a single pixel width is obtained by iteratively calculating the foreground pixels through a thinning algorithm. Based on the centerline of the crack skeleton, the sub-pixel position is calculated using a quadratic interpolation method on the binary crack map to obtain the edge point coordinates. The edge point coordinates are denoised and filtered, and isolated points are removed according to the curvature threshold to obtain the filtered edge point coordinates. By integrating the filtered edge point coordinates, a sub-pixel level crack edge set is obtained.

8. A pavement crack intelligent detection system based on image recognition, characterized in that, The system includes: The preprocessing module is used to acquire the original road surface image and perform preprocessing based on the global brightness distribution of the original road surface image through adaptive multi-scale illumination normalization to obtain an image after illumination equalization. The multi-scale feature extraction module is used to input the illumination-equalized image into a pre-trained convolutional neural network to extract multi-scale texture features and obtain a multi-scale texture feature map. The crack probability mapping module is used to map the multi-scale texture feature map through a segmentation network to obtain a crack confidence map. The binary map generation module is used to obtain a binary map of cracks by threshold segmentation based on the crack confidence map. The subpixel edge refinement module is used to refine the crack binary image at the subpixel level to obtain a subpixel level crack edge set. The crack parameter calculation module is used to calculate the crack width and length quantization data based on the sub-pixel level crack edge set through geometric parameters to obtain the detection results.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • A geological disaster early warning method based on InSAR and deep learning

    CN122176872A