Highway crack detection method based on unmanned aerial vehicle shooting
Through the improved Mask R-CNN and U-Net algorithms, combined with the convolutional conditional random field and attention gate mechanism, the problems of high labor cost, low accuracy and poor timeliness in highway crack detection are solved, and the drone is realized Shooting fast and accurate detection of highway cracks ensures traffic safety.
Patent Information
- Application Number
- CN202410742152.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-11
- Publication Date
- 2024-09-06
AI Technical Summary
Existing highway crack detection methods have problems such as high labor costs, low detection accuracy, poor timeliness, and difficulty in data processing. Especially under severe weather conditions, it is difficult to quickly and timely detect and repair cracks, which affects traffic safety.
A highway crack detection method captured by drones based on OpenCV technology and deep learning methods is used to generate synthetic data and optimize cracks by improving Mask R-CNN and U-Net algorithms, combined with convolutional conditional random fields and attention gate mechanisms. Boundary detection and segmentation to improve detection accuracy and robustness.
It achieves fast and accurate highway crack detection, reduces labor costs, improves detection efficiency and accuracy, enhances the generalization ability to various crack situations, and ensures traffic safety.
Smart Images

Figure CN118608962A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a highway crack detection method based on unmanned aerial vehicle photography. Background Art
[0002] As an important infrastructure, highways play a vital role in transportation. However, with the increase in traffic volume and heavy vehicles, cracks on the surface of highways have become a common problem. These cracks not only affect the smoothness and driving comfort of the road, but also cause serious traffic accidents. Especially in severe weather conditions, such as rain and snow, cracks are more likely to accumulate water, causing the road surface to be slippery and increasing the risk of traffic accidents. Therefore, timely detection and repair of highway cracks is crucial to maintaining traffic safety and reducing traffic accidents.
[0003] In recent years, with the rapid development of computer vision technology and drone technology, highway crack detection based on drone photography has become an efficient and accurate method. Drones can take comprehensive and three-dimensional photos of roads, and combined with computer vision algorithms, they can realize automatic detection and identification of cracks, which greatly saves labor costs and improves the accuracy and efficiency of detection. At the same time, we use synthetic data to overcome the problem that traditional deep learning methods require a large amount of manually labeled data. Summary of the invention
[0004] The present invention proposes a method based on OpenCV technology and deep learning to solve the problems faced by existing highway crack detection, such as high labor cost, low detection accuracy, poor timeliness, and difficulty in data processing.
[0005] In order to overcome the above problems, the present invention provides a highway crack detection method based on drone photography, and the specific steps are as follows: S1. Obtain highway pavement crack data; collect highway pavement information based on drone photography, use mask technology, and combine actual highway pavement crack data to generate synthetic crack data; S2. Improve the Mask R-CNN algorithm; establish a backbone network composed of feature maps composed of ResNet101 and FPN, introduce convolutional conditional random fields (ConvCRF) to optimize the segmentation results, and improve the accuracy and robustness of crack boundaries; S3. Improved U-Net algorithm: The image detected by the improved Mask R-CNN is input into the improved U-Net for segmentation. The improved U-Net mainly adds the attention gate mechanism (AttentionGates) on the basis of the original network to automatically learn and focus on target structures of different shapes and sizes. S4. Model establishment: Based on the improved Mask R-CNN algorithm, the surface cracks of highways are quickly and accurately identified. Based on the improved U-Net algorithm, an attention gate mechanism is added to suppress irrelevant areas in the input image and highlight significant features that are useful for specific tasks. Furthermore, the step S1 includes: S101. Collect data using a drone to obtain highway road surface image information.
[0006] S102. In order to identify the part corresponding to the road in the image, firstly select all pixels in the road mask, apply the connected component algorithm with 8-connectivity to process the binary mask, identify the connected area, and define the part with the largest number of pixels as the main road mask.
[0007] S103. In order to reduce the computational complexity of subsequent processing steps, we need to crop the original crack image and its mask to retain only the area within the minimum bounding rectangle. The cropped image will only contain the crack part related to the road.
[0008] S104: Perform necessary scaling operations on these cropped crack images with masks, and randomly rotate them to increase data diversity, so as to obtain crack images D and their corresponding mask images for deep learning model training.
[0009] S105, select a point located at the center of the overlapping area in the main road area mask, and cut out the point corresponding to the overlapping area from the original image mask. Same size To blend the two images within the mask region, for the crack images that are not under the mask, the mean pitch value in each channel c is calculated. :
[0010] In the formula, Here, c represents the channel, which can be any one of R (red), G (green), and B (blue), D represents the crack image, and p represents the pixel value.
[0011] S106. Then, when applying the crack to the image of the road, only the values under the mask of the road and the crack are considered:
[0012] Cracks are added by changing the values of pixels of the original image S that lie under the common mask M. represents the image cut out from the original image mask, and p represents the pixel value.
[0013] S107. Next, their values are multiplied by the calculated ratio of the average asphalt surface to crack pixel values:
[0014] In the formula represents the mean pitch value in each channel c, The mask values representing roads and cracks, represents the ratio of average asphalt surface to crack pixel values, The pixel value representing the crack. From 1 to 5 intersecting cracks are generated on one image.
[0015] Furthermore, the step S2 includes: S201. A new Mask branch combined with convolutional conditional random field is proposed to replace the original branch.
[0016] S202, the new Mask branch is given input P, whose shape is , respectively represent the batch size, the number of categories, the height and width of the input, for the feature vector The Gaussian kernel g is defined, for each shape , its kernel matrix is defined by the following formula:
[0017] In the formula, represents the Gaussian kernel function, Represents the batch index, Represents the offset of the convolution kernel in the x and y directions, Indicates the pixel position currently being processed, represents the number of feature dimensions, represents the function of the i-th feature dimension, Represents the standard deviation of the Gaussian kernel in the i-th feature dimension.
[0018] S203, the message passing output result Q of all s cores is defined as:
[0019] Where Q represents the message passing output of category c at (x, y), c represents the category index, k represents the filter size, and K represents the fused kernel. Represents the segmentation probability map of the input.
[0020] S204, using the improved convolutional conditional random field to replace the original Mask-RCNN part to detect the crack target.
[0021] Furthermore, the step S3 includes: S301, Improved U-Net mainly adds the attention gate mechanism (AttentionGates) to the original network. The model trained with AGs implicitly learns to suppress irrelevant areas in the input image while highlighting salient features that are useful for specific tasks.
[0022] S302, the formula of the added attention gate mechanism is as follows:
[0023] In the formula, Indicated in l Layer is the current pixel i Calculate the attention score, represents the weight vector, represents a nonlinear activation function, Represents the input feature map In the l The weight transformation of the layer, Indicates the gate signal The weight transformation of , b represents the bias term.
[0024] S303. In addition, the attention gate filters neuron activations during forward propagation and also during backpropagation. Gradients from background areas are down-weighted during backpropagation. This allows shallow model parameters to be updated mainly based on spatial regions relevant to a given task. The update rule is as follows:
[0025] In the formula, Indicated in l Layer, Location i The output features after the attention mechanism are: f(.) Indicates that from l-1 Layer to l The forward propagation function of the layer, Representation output For l-1 The partial derivatives of the layer parameters, Represents the forward propagation function f For l-1 Partial derivatives of the layer parameters.
[0026] Beneficial effects of the present invention: 1. Drones can quickly cover a large area of road surface. Compared with manual inspections, using drones for data collection is more efficient and can collect a large amount of data in a short time.
[0027] 2. Through masking technology, cracks of different shapes, sizes and types can be synthesized on existing pavement images, which helps to increase the diversity of training data and improve the model's generalization ability to various crack conditions.
[0028] 3. The advantage of the Mask-RCNN-based method combined with the convolutional conditional random field (ConvCRF) is that it can effectively extract image features. At the same time, by utilizing the convolutional neural network to optimize the global semantic information and the connection between pixels, it achieves a fast and efficient model training and reasoning process.
[0029] 4. Based on the improved U-Net algorithm, an attention gate mechanism is added to suppress irrelevant areas in the input image while highlighting significant features that are useful for specific tasks; Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 It is a flow chart of a highway crack detection method based on drone photography of the present invention; Figure 2 It is a network architecture diagram of the improved U-Net model proposed in the present invention; Figure 3 It is a framework diagram for improving the attention mechanism in the U-Net model network. DETAILED DESCRIPTION
[0031] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0032] like Figure 1 As shown: The present invention proposes a highway crack detection method based on drone photography, and the specific implementation method is as follows: Step S1: Acquire highway pavement crack data.
[0033] (1) In a specific embodiment of the present invention, the highway pavement crack data is first acquired. Specifically, the use of drones for data collection is to overcome the inconvenience and inefficiency of traditional manual data collection. The distance between the drone camera and the road surface is set to 5m, and the field of view is 45°, so as to ensure that a larger range of road surface information can be captured. The parameters set in this way enable the camera to process a square road surface area of 4m×4m, thereby covering a sufficient road surface area. The collected images are processed offline in the laboratory to ensure the quality and accuracy of the data. During the processing, in order to balance the relationship between image size and processing efficiency, the pixel size of the image is set to 320×320 to facilitate subsequent crack detection and analysis.
[0034] (2) In actual situations, it may be very difficult to obtain a large amount of labeled crack data, especially for cracks of a specific type or in special circumstances. By synthesizing data, a large amount of labeled crack data can be quickly generated to make up for the scarcity of data, thereby making the training model more sufficient and comprehensive. In an embodiment of the present invention, synthetic crack data is generated by using masking technology combined with actual highway pavement crack data.
[0035] In order to improve the information content of the training image samples, 1 to 5 intersecting cracks were generated on one image. As a result, the training set contains 1524 images, while the test dataset contains 505.
[0036] Step S2: Object Detection In the embodiment of the present invention, an improved convolutional neural network Mask R-CNN is used to detect cracks on highway pavement. In the embodiment of the present invention, in the improved Mask R-CNN, an RGB image with a size of 1024×1024 is used as input, and 0.33, 0.5, 1, 2, and 3 are used as anchor scales. 40 epochs were used in the training process, and each epoch contained 400 iterations. In order to optimize the use of computer memory, a mini mask with a size of 56×56 pixels was used. The learning rate annealing method was used, and the initial learning rate was 0.001, and it was reduced by 10 times every 10 epochs. If the IoU (Intersection over Union) value between the bounding boxes is greater than 0.7, the detection results of the same category are deleted. The calculation method of IoU is as follows:
[0037] Step S3: Target segmentation After target detection, the image detected by the improved Mask R-CNN is input into the improved U-Net for segmentation. The improved U-Net mainly adds the attention gate mechanism (AttentionGates) on the basis of the original network, which can automatically learn to focus on target structures of different shapes and sizes. The model trained with AGs implicitly learns to suppress irrelevant areas in the input image while highlighting salient features that are useful for specific tasks.
[0038] The U-Net model uses RGB images with a resolution of 512×512 as input, and the output prediction mask has the same size. VGG16 pre-trained on ImageNet is used as the encoder. In order to avoid the loss of input boundary pixels due to the convolution sequence, the images from the synthetic dataset are resized to 472×472 in the experiment and padded to the input size. The Adam optimizer is used with a batch size of 8, a momentum of 0.9, a learning rate of 0.001, a decay of 0.000001, and trained for 17 epochs.
[0039] Step S4: Model building and verification (1) The synthetic data set of highway pavement cracks is divided into a training set and a test set to train the crack detection model. Specifically, 70% of the data is used as the training set and the remaining 30% is used as the test set. Combined with the loss function of contrastive learning, the final loss function of the crack detection classification model is shown in the following formula:
[0040] (2) Input the highway pavement image to be detected into the trained crack detection model to obtain the detection results. As shown in Table 1:
[0041] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0042] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A highway crack detection method based on drone photography, characterized in that: The following steps are involved: S1: Obtain highway pavement crack data; collect highway pavement information based on drone photography, use mask technology, and combine actual highway pavement crack data to generate synthetic crack data; S2: Improve the Mask R-CNN algorithm; establish a backbone network composed of feature maps composed of ResNet101 and FPN, introduce convolutional conditional random fields (ConvCRF) to optimize the segmentation results, and improve the accuracy and robustness of crack boundaries; S3: Improved U-Net algorithm: The image detected by the improved Mask R-CNN is input into the improved U-Net for segmentation. The improved U-Net mainly adds the attention gate mechanism (AttentionGates) on the basis of the original network to automatically learn and focus on target structures of different shapes and sizes; S4: Model establishment; Based on the improved Mask R-CNN algorithm, the surface cracks of the highway are quickly and accurately identified. Based on the improved U-Net algorithm, an attention gate mechanism is added to suppress irrelevant areas in the input image, while highlighting significant features that are useful for specific tasks.
2. The highway crack detection method based on drone photography according to claim 1 is characterized in that: In step S1: mask technology is used to mark and synthesize crack samples in road surface images to increase the diversity and quantity of training data to meet the training requirements of deep learning models.
3. The highway crack detection method based on drone photography according to claim 1 is characterized in that: In the step S2: modify the original Mask R-CNN model proposed by Abdulla et al., and use a backbone network constructed by feature maps composed of ResNet101 and FPN.
4. The highway crack detection method based on drone photography according to claim 1 is characterized in that: In the step S2: a convolutional conditional random field (ConvCRF) is introduced to optimize the segmentation result, thereby improving the accuracy and robustness of the crack boundary.
5. The highway crack detection method based on drone photography according to claim 1 is characterized in that: In step S3: an Attention gate module is proposed, soft-attention is used, and attention is integrated into the skip connection and upsampling modules of U-Net to realize the spatial attention mechanism.
Citation Information
Patent Citations
Pavement crack detection method and system based on deep learning network
CN115082450A
Dam crack intelligent detection method based on unmanned aerial vehicle visual perception and deep learning
CN115880594A
Cited By
Method, device and equipment for generating image from text and medium
CN119722875A
Low-altitude airspace operation supervision method and system for expressway maintenance inspection
CN121030380A
Shooting angle adjusting mechanism
CN224104309U
Unmanned aerial vehicle airborne platform for road defect detection and detection device
CN224197987U
