Road crack intelligent detection method based on YOLOv8 optimization
By optimizing the YOLOv8 model and utilizing the CARAFF+DCNv3 module, ParNetAttention, and Fracture-ASFF mechanism, the problems of complex background interference, missed detection of small targets, and morphological diversity in road crack detection were solved, achieving high-precision and efficient road crack detection.
Patent Information
- Application Number
- CN202510863379.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-21
AI Technical Summary
Existing technologies for road crack detection suffer from complex background interference, missed detection of small targets, diversity of crack morphology, and the balance between accuracy and speed, resulting in low detection efficiency, high cost, and strong subjectivity.
By introducing the CARAFF+DCNv3 module, ParNetAttention mechanism and Fracture-ASFF mechanism to optimize the YOLOv8 model, combined with data enhancement technology and optimized loss function, the recognition accuracy and detection speed of the model in complex scenarios are improved.
It significantly improves the recognition accuracy of small targets and background interference objects, maintains efficient detection speed, and realizes fast and accurate detection and evaluation of road cracks.
Smart Images

Figure CN120823364A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and road detection technology, and in particular to an intelligent road crack detection method based on YOLOv8 optimization, which is applicable to the field of highway maintenance. Background Art
[0002] Road cracks are a common early-stage disease of road structures, directly impacting road life and driving safety. Therefore, quickly and accurately detecting and assessing the distribution and severity of road cracks is crucial for road maintenance and management.
[0003] Road crack detection is a key link in road maintenance and traffic safety assessment. Traditional road crack detection methods mainly rely on manual detection and rule-based image processing technology. Manual detection methods usually require professionals to conduct on-site inspections through visual inspection or simple tools. Although this method is intuitive, it has shortcomings such as large workload, low efficiency, and strong subjectivity. Traditional detection methods mainly rely on manual inspections, which are inefficient, costly, and highly subjective. In recent years, automatic detection methods based on deep learning, especially target detection algorithms (such as the YOLO series), have been widely used in this field due to their high efficiency. Although methods based on models such as YOLO have significantly improved detection efficiency, they still face many challenges in the actual road crack detection task:
[0004] (1) Complex background interference
[0005] (2) Missed detection of small target cracks
[0006] (3) Diversity of crack morphology
[0007] (4) Balance between accuracy and speed
[0008] To address the shortcomings of the aforementioned existing technologies, this paper proposes an intelligent road crack detection method based on YOLOv8 optimization. The core of this invention lies in key improvements to the YOLOv8 model architecture, significantly improving its recognition accuracy in complex road scenarios, particularly for small targets and background interference, while maintaining efficient detection speed. Summary of the Invention
[0009] The purpose of this invention is to provide an intelligent road crack detection method based on YOLOv8 optimization, which can detect and automatically classify road cracks and help users obtain crack detection results.
[0010] In order to achieve the above objectives, the technical solution adopted by the present invention includes the following steps:
[0011] Step S1. After importing the road crack dataset, the annotation files in the dataset were converted and images with annotation errors were cleaned. Furthermore, the road crack images were divided into a training set and a validation set in an 8:2 ratio to ensure scientific and accurate model training and evaluation.
[0012] Step S2. Introduce the CARAFF+DCNv3 module into the C2f module to construct the C2f_CD module. Combined with the ParNetAttentio attention mechanism to optimize the YOLOv8 target detection algorithm, the present invention introduces the Fracture-ASFF mechanism into the YOLOv8 detection head for small crack design, so that the model focuses on high-frequency channels carrying crack textures (such as gradient feature channels), and constructs an intelligent road crack detection method based on YOLOv8 optimization.
[0013] Step S3. Use the optimized network model to train the processed road crack dataset. By adjusting hyperparameters, using data enhancement technology and optimizing loss functions, the convergence speed and detection accuracy of the model are improved.
[0014] Step S4. Input the test set into the optimized road crack detection model for prediction, obtain the detection results, and quantify the model performance to evaluate the effect and drive further improvement.
[0015] The data set in step S1 is divided as follows:
[0016] S11: Use the GRDDC2020 road crack image public dataset and divide it into a training set and a validation set in a ratio of 8:2;
[0017] The network model optimization in step S2 is as follows:
[0018] S21: The ParNet Attention mechanism module is embedded after the output of the C2f module of the backbone network;
[0019] S22: In the neck network, the deformable convolutional network (DNCv3) plus the upsampling operator CARAFF are introduced into the C2f module to form the C2f_CD module. The C2f module consists of four key processing layers: a pre-convolutional layer (Conv), a feature splitting layer (Split), a feature parallel processing layer, and a post-convolutional layer (Conv). In the feature parallel processing layer, the Bottleneck_CoordAtt module is innovatively used to replace the original Bottleneck module.
[0020] S23: The Fracture-ASFF mechanism is introduced in the detection head, the crack-sensitive channel response of the feature map is enhanced through the channel attention mechanism, and the multi-scale feature fusion weights are generated using the MLP network.
[0021] The step S3 data set training is as follows:
[0022] S31: The input feature map first passes through the convolution layer to extract basic features, and then uses the channel splitting strategy to divide the feature channels into two independent subsets;
[0023] S32: An innovative processing flow is proposed as follows: Branch 1 (attention enhancement path): The feature maps of 50% of the channels are input into the Coordinate Attention module, which models the channel-space joint relationship through the coordinate attention mechanism to enhance the feature response of the crack area; Branch 2 (feature preservation path): The feature maps of the remaining 50% of the channels transmit the original feature information in a residual direct connection manner;
[0024] S33: Finally, the outputs of the two paths are concatenated in the channel dimension, and cross-channel feature fusion and dimensionality reduction are achieved through the convolution layer to form an optimized output that has both attention enhancement characteristics and original feature integrity.
[0025] The step S4 quantifies the performance and drives the model improvement as follows:
[0026] S41: Model learning is driven by a dynamic weight decay strategy implemented using the AdamW optimizer, with a 200-epoch intensive training cycle. The convergence of the loss function is monitored in real time during training. Training is terminated when the model reaches stable convergence conditions, generating an optimized road crack detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flow chart of an intelligent road crack detection method based on YOLOv8 optimization according to the present invention.
[0028] Figure 2 This is the YOLOv8 network model structure diagram of the present invention.
[0029] Figure 3 A C2f_CD structure diagram provided by the present invention
[0030] Figure 4 This is the improved YOLOv8 network structure diagram of the present invention. DETAILED DESCRIPTION
[0031] The technical solution of the present invention is described in detail below with reference to the accompanying drawings:
[0032] As attached Figure 1 , the present invention provides a road crack detection method based on deep learning network, comprising the following steps:
[0033] The step S1 of data set division is as follows: loading the road crack image dataset, performing a labeling file format conversion operation on the original road crack dataset, and uniformly converting it into a YOLO format labeling system to ensure that the labeling information is compatible with the model input specification.
[0034] This paper uses the GRDDC2020 multinational road image dataset as the benchmark data source. The dataset contains 21,041 road images from Japan, India, and the Czech Republic, with a sample distribution of 10,506, 7,706, and 2,829 images across the three countries. The original annotation system has 10 categories ['d00', 'd01', 'd0w0', 'd10', 'd11', 'd20', 'd40', 'd43', 'd44', and 'd50'], including d00: longitudinal crack; d01 (d0w0 is an incorrect label): longitudinal seam; d10: transverse crack; d11: transverse seam; d20: crack; d40: pothole; d43: blurred intersection; d44: blurred white line; and d50: manhole cover. A technical audit revealed significant differences in the markings of the three countries. For example, the number of valid marking categories in Japan is 7; in India, 9; and in the Czech Republic, 4. To address the imbalance in categories and the need for cross-national consistency, the inventors established a dual filtering mechanism:
[0035] (1) Category relevance filtering: remove annotations that are not related to the road crack detection target (joint seams d01 / d11, fuzzy d43 / d44, manhole cover d50)
[0036] (2) Cross-national comparability filtering: only the core crack types (d00 / d10 / d20 / d40) common to the three countries are retained
[0037] After the above technical processing, the effective sample size increased to 14,007. A standardized four-category system was established: (d00) longitudinal cracks → (d10) transverse cracks → (d20) network cracks → (d40) potholes. Stratified random division was performed into training and validation sets in an 8:2 ratio to ensure that samples from the three countries were evenly distributed in the training and validation sets.
[0038] The network model optimization in step S2 is as follows: a ParNetAttention mechanism module is embedded after the output of the C2f module of the backbone network; in the neck network, the deformable convolutional network DNCv3+ upsampling operator CARAFF is introduced into the C2f module to form a C2f_CD module.
[0039] After the output layer of the C2f module of the YOLOv8 backbone network (i.e., the terminal feature map output position of the C2f module), the ParNet Attention mechanism module is embedded and integrated. The calculation formula of the ParNet Attention mechanism is:
[0040]
[0041] in It is channel dimension splicing, is a 1×1 convolutional fusion layer, is the Sigmoid activation function, is the global channel branch, Spatial context branch, It is a cross-channel branch.
[0042] Secondly, the deformable convolutional network DNCv3 and the upsampling operator CARAFF are introduced into the C2f module for feature fusion to form the C2f_CD module. The C2f module consists of four key processing layers: the pre-convolutional layer (Conv), the feature slicing layer (Split), the feature parallel processing layer, and the post-convolutional layer (Conv). In the feature parallel processing layer, the Bottleneck_CoordAtt module is innovatively used to replace the original Bottleneck module. The multi-scale feature fusion formula is:
[0043]
[0044] in is the characteristic transformation function of the original C2f module, is the input feature map, is the parameter set of the original C2f module, is the parameter set of the DCNv3 module, , is the DCNv3 deformable convolution operation, It is the CARAFE upsampling operator.
[0045] To overcome the industry challenges of missed detection of small targets and false detection of complex cracks in road crack detection, this paper introduces the Fracture-ASFF mechanism into the YOLOv8 detection head and uses channel attention to enhance high-resolution texture features. The formula is as follows:
[0046]
[0047] in is the Sigmoid activation function, It is a two-layer fully connected network. is global average pooling, It is the cth channel of the P3-level feature map output by the backbone network.
[0048] The step S3 data set training: using the optimized network model to train the processed road crack data set, by adjusting hyperparameters, using data enhancement technology and optimizing loss function, to improve the convergence speed and detection accuracy of the model.
[0049] The improved YOLOv8 model was used for the road crack detection task. The training set was input into the model for training. The network model was trained using the AdamW optimizer for 200 iterations until the model converged, thus obtaining the final object detection model.
[0050] In this example, the YOLOv8s model was used as the training benchmark, and the hyperparameters were set as follows: the AdamW optimizer was used, the initial learning rate was set to 0.001, the batch size was set to 16, the number of iterations was set to 200, and the IoU threshold was set to 0.5. Through multiple iterations of training, the optimal weight parameter model was ultimately obtained and used as the object detection model.
[0051] The step S4 quantifies performance and drives model improvement: the test set is input into the optimized road crack detection model for prediction, the detection results are obtained, and the model performance is quantified to evaluate the effect.
[0052] The test set is imported into the optimal target network model trained on S3 for testing. After obtaining the test results, the model's performance is analyzed using the specified evaluation metrics, including precision (P), recall (R), average precision (AP), and mean average precision (mAP).
[0053] This paper proposes an intelligent road crack detection method based on YOLOv8 optimization. First, the road crack images are divided into training and validation sets. Secondly, a new target detection network model is obtained by improving the modules in the network. Finally, the test set is input into the optimal target detection model for testing. After the test results are generated, the model performance is evaluated according to preset evaluation indicators.
Claims
1. A road crack intelligent detection method based on YOLOv8 optimization, characterized in that: The method comprises the following steps: Step S1. After importing the road crack dataset, the format of the annotation files in the dataset is converted and images with annotation errors are cleaned up; Step S2. Introduce the CARAFF+DCNv3 module into the C2f module to construct the C2f_CD module, combine the ParNetAttentio attention mechanism to optimize the YOLOv8 target detection algorithm, and build an intelligent road crack detection method based on YOLOv8 optimization; Step S3. Using the optimized network model to train the processed road crack dataset, the convergence speed and detection accuracy of the model are improved by adjusting hyperparameters, using data augmentation techniques, and optimizing the loss function. Step S4. Input the test set into the optimized road crack detection model for prediction, obtain the detection results, and quantify the model performance to evaluate the effect and drive further improvement.
2. The method for intelligent road crack detection based on YOLOv8 optimization according to claim 1, characterized in that: The step S1 specifically includes: using the GRDDC2020 road crack image public dataset and dividing it into a training set and a validation set in a ratio of 8:
2.
3. The method for intelligent road crack detection based on YOLOv8 optimization according to claim 1, characterized in that: The step S2 specifically includes: embedding a ParNet Attention mechanism module after the output of the C2f module of the backbone network; in the neck network, introducing the deformable convolutional network DNCv3+ upsampling operator CARAFF into the C2f module to form a C2f_CD module; the C2f module contains four key processing layers: a pre-convolutional layer (Conv), a feature slicing layer (Split), a feature parallel processing layer, and a post-convolutional layer (Conv); among them, in the feature parallel processing layer, the Bottleneck_CoordAtt module is innovatively used to replace the original Bottleneck module; introducing the Fracture-ASFF mechanism in the detection head, enhancing the crack-sensitive channel response of the feature map through the channel attention mechanism, and using the MLP network to generate multi-scale feature fusion weights.
4. The method for intelligent road crack detection based on YOLOv8 optimization according to claim 1, characterized in that: The step S3 specifically includes: the input feature map is first subjected to basic feature extraction through a convolutional layer, and then the feature channels are divided into two independent subsets by a channel diversion strategy; an innovative processing flow is proposed as follows: Branch 1 (attention enhancement path): the feature maps of 50% of the channels are input into the Coordinate Attention module, and the channel-space joint relationship is modeled through the coordinate attention mechanism to enhance the feature response of the crack area; Branch 2 (feature preservation path): the feature maps of the remaining 50% of the channels transmit the original feature information in a residual direct connection manner; finally, the outputs of the two paths are concatenated (concatenation) in the channel dimension, and cross-channel feature fusion and dimensionality reduction are achieved through a convolutional layer to form an optimized output with both attention enhancement characteristics and original feature integrity.
5. The method for intelligent road crack detection based on YOLOv8 optimization according to claim 1, characterized in that: Step S4 specifically includes: implementing a dynamic weight decay strategy through the AdamW optimizer to drive model learning, setting an intensive training cycle of 200 iterations; monitoring the convergence status of the loss function in real time during the training process, terminating the training when the model reaches stable convergence conditions, and generating an optimized road crack detection model.