Road disease image classification method based on YOLOv8 model
Through the road disease image classification method based on the YOLOv8 model, combined with the generation adversarial network and multi-feature extraction module, the feature extraction and classification accuracy problems of road disease detection in the prior art are solved, and efficient and accurate road disease detection is achieved.
Patent Information
- Application Number
- CN202510259354.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-04-15
AI Technical Summary
The prior art has problems such as difficulty in feature extraction, large calculation overhead of classification method, poor target positioning accuracy and difficult parameter adjustment in road disease detection, resulting in limited detection effect in complex environments.
The road disease image classification method based on the YOLOv8 model is adopted to generate high-quality road disease images by generating an adversarial network, expand the training data set, and connect HOG and LBP feature extraction modules in the backbone network of YOLOv8, combining feature fusion modules and SVMs to optimize feature extraction and classification accuracy.
It improves the accuracy and reliability of road disease classification, enhances the detection accuracy and stability of the detection model, can efficiently and accurately identify road disease types, and improves the accuracy and reliability of road disease detection.
Smart Images

Figure CN119832435A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road damage detection, and in particular to a road damage image classification method based on a YOLOv8 model. Background Art
[0002] As the core infrastructure of modern transportation networks, the surface quality of highways is directly related to driving safety and traffic efficiency. Cracks and potholes are common road defects. If not handled in time, they may further deteriorate, leading to traffic accidents and serious infrastructure damage. Therefore, how to quickly and accurately detect these defects and maintain them in time is an important issue in road management. Therefore, automated defect detection methods have emerged, especially deep learning-based object detection models, which show great application potential in road defect detection.
[0003] With the continuous development of computer vision technology, automated image processing methods are gradually applied to the field of road damage detection. Existing deep learning-based methods have achieved certain results in specific scenarios, but they still face some problems. Traditional road damage detection methods have significant difficulties in feature extraction, classification, and target positioning. Manually designed feature extraction methods are affected by illumination changes, noise, etc., and it is difficult to fully and accurately capture the characteristics of damage; classification methods based on traditional classifiers cannot fully utilize the spatial information of the image and have high computational overhead; and traditional target positioning methods, such as sliding windows and region proposal networks (RPNs), have poor positioning accuracy and difficulty in adjusting parameters when dealing with small damage targets or those similar to the background. Therefore, the detection effect of traditional methods in complex environments is limited, and new technologies need to be introduced to improve the accuracy and efficiency of detection. Summary of the invention
[0004] In view of the problems existing in the prior art, the present invention provides a road damage image classification method based on the YOLOv8 model, which improves the accuracy and reliability of classification of different types of road damage.
[0005] To achieve the above technical objectives, the present invention adopts the following technical solution: a road damage image classification method based on the YOLOv8 model, specifically comprising the following steps:
[0006] Step S1, collecting road images with road damage, and marking the location and category of the road damage on the road damage image;
[0007] Step S2: construct a road damage image classification model based on the YOLOv8 model;
[0008] Step S3: inputting the road image with road damage into the generative adversarial network to expand the road image, using the expanded road image as the input of the road damage image classification model, using the location and category of the marked road damage as labels, training the road damage image classification model, and optimizing the generative adversarial network through the prediction results of the road damage image classification model;
[0009] Step S4, repeating step S3 until the loss function of the road damage image classification model converges, completing the training of the road damage image classification model;
[0010] Step S5: input the road image collected in real time into the trained road damage image classification model to predict the category of the road damage.
[0011] Furthermore, the road damage image classification model includes: a backbone network of a YOLOv8 model, an LBP feature extraction module, a HOG feature extraction module, a feature fusion module, a head network of a YOLOv8 model and an SVM. The backbone network, LBP feature extraction module and HOG feature extraction module of the YOLOv8 model are connected in parallel to a feature fusion module. The backbone network of the YOLOv8 model is used to extract local and global features of a road image, the LBP feature extraction module is used to extract texture detail features of a road image, and the HOG feature extraction module is used to extract gradient and edge features of a road image; the feature fusion module fuses and optimizes local features, global features, texture detail features, gradients and edge features through a diploid genetic algorithm to obtain optimal fusion features; the head network of the YOLOv8 model predicts the initial location and category of road damage according to the optimal fusion features, and the SVM optimizes the initial location and category of road damage to obtain the final location and category of road damage.
[0012] Furthermore, the backbone network of the YOLOv8 model includes a first convolutional layer, a second convolutional layer, a first C2f module, a third convolutional layer, a second C2f module, a fourth convolutional layer, a third C2f module, a fifth convolutional layer, a fourth C2f module and an SPPF module connected in sequence, wherein the local features output by the second C2f module, the local features output by the third C2f module and the global features output by the SPPF module all need to be input into the feature fusion module for feature fusion.
[0013] Furthermore, the feature fusion module fuses and optimizes local features, global features, texture detail features, gradient and edge features through a diploid genetic algorithm, and the specific process of obtaining the optimal fusion feature is as follows:
[0014] i. Combining the weights corresponding to local features, global features, texture detail features, gradients and edge features into individuals of the diploid genetic algorithm, initializing several individuals, setting the fitness function of the individuals and the maximum number of iterations;
[0015] ii. The extracted local features, global features, texture detail features, gradient and edge features are fused according to each individual Calculate the fitness function of feature fusion under each individual fitness = mAP (F fusion ), and retain the individual with the largest fitness function value, where n represents the number of features, i represents the index of n, and F i represents the i-th feature, w i represents the weight of the i-th feature, and mAP() represents the detection accuracy function;
[0016] iii. In the next iteration, all individuals are subjected to one or both of the random crossover and mutation operations, and step ii is repeated;
[0017] iv. Repeat step iii until the maximum number of iterations is reached, and take the individual with the largest fitness function value as the optimal individual. Through the optimal individual, local features, global features, texture detail features, gradient and edge features are fused to obtain the optimal fusion features.
[0018] Furthermore, the SVM optimizes the location and category of the initial road damage to obtain the final location and category of the road damage in the following specific process:
[0019] A. The head network of the YOLOv8 model predicts the initial location, category and confidence of road damage based on the optimal fusion features, and inputs the feature vector composed of the candidate box, category probability and confidence corresponding to the initial location of road damage into the SVM. The location and category of the marked road damage are used as labels, and the category of the feature vector is predicted through the decision function, and the confidence of the feature vector is updated through the Sigmoid function.
[0020] B. Perform non-maximum suppression based on the confidence of the feature vector and output the category and location of the road damage corresponding to the maximum confidence.
[0021] Furthermore, the specific process of predicting the category of the feature vector through the decision function is:
[0022]
[0023] Update the confidence of the feature vector through the Sigmoid function The specific process is:
[0024]
[0025] Among them, y k represents the category of the sth road image with road damage predicted by SVM, N s represents the number of road images with road damage for training, and s represents N s The index of s represents the Lagrange multiplier corresponding to the sth road image with road damage in SVM, y s represents the true category of the sth road image with road damage, b represents the bias term, K(f k ,f s ) represents the RBF kernel function, f k represents the feature vector of the sth road image with road damage, f s represents the true feature vector of the sth road image with road damage, and σ represents the width parameter of the RBF kernel.
[0026] Furthermore, the generative adversarial network includes a generator and a discriminator. The generator generates an image from random noise, and the discriminator receives the generated image and the collected road image, calculates the adversarial loss between the generated image and the collected road image, and guides the generator to update in combination with the prediction results of the road disease image classification model until the comprehensive loss function of the generator converges to generate a realistic road image.
[0027] Furthermore, the comprehensive loss function L of the generator is gen for:
[0028]
[0029] in, represents the adversarial loss of the generator, G(z) represents the image generated by the generator, D() represents the scoring function of the generator, and λ D express Hyperparameters of L loc represents the target detection and positioning loss of the generator, L loc =1-IoU(B pred ,B true ), B pred represents the target box in the generated image, B true represents the candidate box predicted by the road damage image classification model, IoU() represents the intersection over union function, and λ loc Indicates L loc Hyperparameters of L class represents the target classification loss of the generator, L class =-∑ s y k log(ps ), p s represents the predicted probability of the corresponding category in the generated image, λ class Indicates L class Hyperparameters of .
[0030] Furthermore, the updating process of the generator is:
[0031]
[0032] The updating process of the discriminator is:
[0033]
[0034] Among them, θ G represents the parameters of the generator, η represents the learning rate, represents the gradient of the generator's comprehensive loss function to the generator parameters, represents the update parameters of the generator; θ D represents the parameters of the discriminator, L D represents the adversarial loss of the discriminator, L D = -[log(D(x))+log(1-D(G(z)))], D(x) represents the collected road image, represents the gradient of the discriminator's adversarial loss to the discriminator parameters, represents the updated parameters of the discriminator.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] (1) In order to improve the accuracy and robustness of road damage classification, the road damage image classification method based on the YOLOv8 model of the present invention generates high-quality road damage images through a generative adversarial network, expands road images with road damage, and enhances the diversity of the training data set. At the same time, the generator is feedback-adjusted according to the prediction results of the road damage classification model to optimize the quality of the generated image;
[0037] (2) The present invention is based on the road damage image classification method of the YOLOv8 model. The HOG feature extraction module and the LBP feature extraction module are connected in parallel in the YOLOv8 backbone network to enrich the ability to capture the morphology, texture and edge features of the damaged area on the road image. The diploid genetic algorithm is used in the feature fusion module to fuse and optimize the multi-scale and multi-level features. The target detection capability of YOLOv8 is used to improve the detection accuracy and stability of the road damage detection model, and the SVM is further combined to improve the classification accuracy of road damage. The present invention can efficiently and accurately identify the type of road damage and improve the accuracy and reliability of road damage detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a flow chart of the road damage image classification method based on the YOLOv8 model of the present invention;
[0039] Figure 2 Schematic diagram of the road damage image classification model in the present invention;
[0040] Figure 3 A schematic diagram of generating an adversarial network in the present invention. DETAILED DESCRIPTION
[0041] The technical solution of the present invention is further explained below in conjunction with the accompanying drawings.
[0042] like Figure 1 The flowchart of the road damage image classification method based on the YOLOv8 model of the present invention is as follows:
[0043] Step S1: Collect road images with road damage, and mark the location and category of the road damage on the road damage image.
[0044] Step S2: Construct a road damage image classification model based on the YOLOv8 model. Figure 2 The road disease image classification model includes: the backbone network of the YOLOv8 model, the LBP feature extraction module, the HOG feature extraction module, the feature fusion module, the head network of the YOLOv8 model and the SVM. The backbone network of the YOLOv8 model, the LBP feature extraction module and the HOG feature extraction module are connected in parallel to the feature fusion module. The backbone network of the YOLOv8 model is used to extract the local and global features of the road image, the LBP feature extraction module is used to extract the texture detail features of the road image, and the HOG feature extraction module is used to extract the gradient and edge features of the road image. By introducing the LBP feature extraction module and the HOG feature extraction module, not only can It can effectively capture the geometric shape of road defects and better identify the subtle texture of the road surface, thereby improving the comprehensiveness and robustness of feature extraction and enhancing the recognition ability of road defect images; the feature fusion module fuses and optimizes local features, global features, texture detail features, gradients and edge features through a diploid genetic algorithm to obtain the optimal fusion features to improve the efficiency and accuracy of feature fusion; the head network of the YOLOv8 model predicts the initial location and category of road defects based on the optimal fusion features, and the SVM optimizes the initial location and category of road defects to obtain the final location and category of road defects, further improving the classification accuracy of road defect images.
[0045] The backbone network of the YOLOv8 model in the present invention includes a first convolutional layer, a second convolutional layer, a first C2f module, a third convolutional layer, a second C2f module, a fourth convolutional layer, a third C2f module, a fifth convolutional layer, a fourth C2f module and an SPPF module connected in sequence, wherein the local features output by the second C2f module, the local features output by the third C2f module and the global features output by the SPPF module all need to be input into the feature fusion module for feature fusion.
[0046] The HOG feature extraction module is used to calculate the gradient direction and amplitude of the road image to capture edge information such as road cracks, and generate the HOG feature vector through region division and directional gradient histogram construction; specifically,
[0047] Calculate the gradient of the horizontal and vertical coordinates of the road image, and then calculate the gradient direction value of each pixel position; the derivative operation can not only capture the contour and some texture information, but also further weaken the influence of lighting. The gradient formula of the pixel point (x, y) in the road image is as follows:
[0048] G x (x,y)=H(x+1,y)-H(x-1,y)
[0049] G y (x,y)=H(x,y+1)-H(x,y-1)
[0050] Where G x (x,y),G y (x,y), H(x,y) represent the horizontal gradient, vertical gradient and pixel value at the pixel point (x,y) in the road image. The gradient magnitude and gradient direction at the pixel point (x,y) are:
[0051]
[0052]
[0053] Region division and histogram construction: divide the road image into several grid cells of equal size, calculate the directional gradient histogram in each grid cell, and record the sum of the gradients in each direction. This process can retain the local edge information of the road image and help distinguish the boundaries and shapes of the diseased areas. In order to improve the robustness to illumination changes, the gradient histograms of multiple adjacent cells are combined into a larger block and normalized to ensure that the features are not affected by local brightness changes.
[0054] The HOG features of all units are spliced in sequence to generate the gradient and edge features of the road image, which can describe the geometric morphology of road cracks and other defects.
[0055] The LBP feature extraction module uses local binary patterns to encode the texture of the road image, capture the detailed texture of the road surface, and uses the LBP histogram as a texture feature to characterize the minor damage on the road surface, specifically;
[0056] For each pixel, select a group of pixels around it (usually a 3×3 neighborhood), and compare the grayscale value of the neighborhood pixels with the central pixel. If the grayscale value of the neighborhood pixel is greater than that of the central pixel, it is 1, otherwise it is 0. In this way, the neighborhood of each pixel generates an 8-bit binary value.
[0057] The binary code of each pixel is converted into a decimal value, and the distribution of these values in the road image is counted to form a feature histogram. This histogram can describe the local texture changes in the road image, and is particularly suitable for detecting surface irregularities caused by road aging, wheel rolling, etc. The LBP histograms of all local areas are connected together to form a global LBP feature vector as a texture feature description of the road image. The formula is:
[0058]
[0059] Among them, (x c ,y c ) is the coordinate of the center element of the operator, and p represents the number of surrounding elements.
[0060] The feature fusion module fuses and optimizes local features, global features, texture detail features, gradient and edge features through a diploid genetic algorithm to obtain the optimal fusion features. The optimal fusion features can significantly improve the accuracy and stability of the road disease image classification model, especially in complex disease image detection, which can effectively reduce the impact of redundant features and improve classification accuracy. The specific process is:
[0061] i. Combining the weights corresponding to local features, global features, texture detail features, gradients and edge features into individuals of the diploid genetic algorithm, initializing several individuals, setting the fitness function of the individuals and the maximum number of iterations;
[0062] ii. The extracted local features, global features, texture detail features, gradient and edge features are fused according to each individual Calculate the fitness function of feature fusion under each individual fitness = mAP (F fusion ), and retain the individual with the largest fitness function value, where n represents the number of features, i represents the index of n, and F i represents the i-th feature, w i represents the weight of the i-th feature, and mAP() represents the detection accuracy function;
[0063] iii. In the next iteration, all individuals are subjected to one or both of the random crossover and mutation operations, and step ii is repeated;
[0064] iv. Repeat step iii until the maximum number of iterations is reached, and take the individual with the largest fitness function value as the optimal individual. Through the optimal individual, local features, global features, texture detail features, gradient and edge features are fused to obtain the optimal fusion features.
[0065] SVM optimizes the location and category of the initial road damage, and the specific process of obtaining the final location and category of the road damage is as follows:
[0066] A. The head network of the YOLOv8 model generates feature maps through convolutional neural networks, and then generates multiple candidate boxes through anchor boxes. For each anchor box, the head network of the YOLOv8 model will output the following: Bounding box regression B k =(B k ,y k ,w k ,h k ), category prediction P k =(p k1 ,p k2 ,…,p kc ) and confidence prediction P conf In order to use SVM to classify these results, the candidate boxes corresponding to the initial road damage locations, the probability of the categories, and the confidence are input into the SVM to form feature vectors. The marked road damage locations and categories are used as labels, and the categories of the feature vectors are predicted through the decision function, and the confidence of the feature vectors is updated through the Sigmoid function. Since SVM has excellent ability to process high-dimensional data, it can find an optimal decision boundary in complex feature space, thereby effectively improving the accuracy and robustness of classification. In addition, SVM uses a method based on RBF kernel function to further enhance its adaptability in nonlinear separable problems, so that the road damage image classification model can still maintain high accuracy and stability when dealing with various complex road damage scenes.
[0067] The specific process of predicting the category of the feature vector through the decision function is:
[0068]
[0069] Update the confidence of the feature vector through the Sigmoid function The specific process is:
[0070]
[0071] Among them, y krepresents the category of the sth road image with road damage predicted by SVM, N s represents the number of road images with road damage for training, and s represents N s The index of s represents the Lagrange multiplier corresponding to the sth road image with road damage in SVM, y s represents the true category of the sth road image with road damage, b represents the bias term, K(f k ,f s ) represents the RBF kernel function, f k represents the feature vector of the sth road image with road damage, f s represents the true feature vector of the sth road image with road damage, and σ represents the width parameter of the RBF kernel.
[0072] B. Perform non-maximum suppression based on the confidence of the feature vector, and output the category and location of the road damage corresponding to the maximum confidence. The output of the SVM further performs secondary classification and confidence optimization on the head network output of the YOLOv8 model, thereby obtaining a more refined road damage classification category.
[0073] Step S3: Input the road image with road damage into the generative adversarial network to expand the road image, expand the training data set by generating high-quality synthetic damage images, and enhance the generalization ability of the road damage image classification model. Use the expanded road image as the input of the road damage image classification model, use the location and category of the marked road damage as labels, train the road damage image classification model, and optimize the generative adversarial network through the prediction results of the road damage image classification model. By learning the diverse characteristics of road damage, a large number of images close to real road images are generated, thereby improving the recognition ability of the road damage image classification model in different damage scenarios.
[0074] like Figure 3In the present invention, the generative adversarial network includes a generator and a discriminator. The generator generates an image from random noise, and the discriminator receives the generated image and the collected road image, calculates the adversarial loss between the generated image and the collected road image, and guides the generator to update in combination with the prediction results of the road damage image classification model, continuously optimizes the quality of the generated image, ensures the similarity between the synthetic data and the real road image, until the comprehensive loss function of the generator converges, and generates a realistic road image. Through adversarial training, the generator gradually optimizes the generated image to improve the diversity and quality of the road image. Through the feedback mechanism, the road damage image classification model detects the generated image to obtain the candidate box position, category and confidence score. The goal of the generator is to make the candidate box as close to the real box as possible, and the generated target category is as consistent as possible with the prediction result of the road damage image classification model. Therefore, the generator not only needs to optimize the authenticity of its generated image to pass the discriminator, but also needs to optimize the performance of the image in the target detection task. By combining the adversarial loss of the discriminator and the feedback of the road damage image classification model, the generator optimizes the authenticity of the generated image and the ability to adapt to the target detection task during the training process.
[0075] The comprehensive loss function L of the generator in the present invention is gen for:
[0076]
[0077] in, represents the adversarial loss of the generator, guiding the generator to generate images that are as realistic as possible, making it difficult for the discriminator to distinguish them as fake images. G(z) represents the image generated by the generator, D() represents the scoring function of the generator, and λ D express Hyperparameters of L loc represents the target detection positioning loss of the generator, so that the generator generates images that meet the requirements of target detection, L loc =1-IoU(B pred ,B true ), B pred represents the target box in the generated image, B true represents the candidate box predicted by the road damage image classification model, IoU() represents the intersection over union function, and λ loc Indicates L loc Hyperparameters of L class represents the target classification loss of the generator, which is used to evaluate whether the object category in the generated image is consistent with the output of the target detection model. class =-∑ s y k log(p s ), p srepresents the predicted probability of the corresponding category in the generated image, λ class Indicates L class Hyperparameters of .
[0078] The updating process of the generator is:
[0079]
[0080] The update process of the discriminator is:
[0081]
[0082] Among them, θ G represents the parameters of the generator, η represents the learning rate, represents the gradient of the generator's comprehensive loss function to the generator parameters, represents the update parameters of the generator; θ D represents the parameters of the discriminator, L D represents the adversarial loss of the discriminator, L D = -[log(D(X))+log(1-D(G(z)))], D(x) represents the collected road image, represents the gradient of the discriminator's adversarial loss to the discriminator parameters, represents the updated parameters of the discriminator.
[0083] Step S4, repeating step S3 until the loss function of the road damage image classification model converges, completing the training of the road damage image classification model;
[0084] Step S5: input the road image collected in real time into the trained road damage image classification model to predict the category of the road damage.
[0085] The road damage image classification method based on the YOLOv8 model of the present invention generates high-quality road damage images through a generative adversarial network, expands road images with road damage, and enhances the diversity of the training data set. At the same time, the generator is feedback-adjusted according to the prediction results of the road damage classification model to optimize the quality of the generated image; at the same time, the HOG feature extraction module and the LBP feature extraction module are connected in parallel in the YOLOv8 backbone network to enrich the ability to capture the morphology, texture and edge features of the damage area on the road image, and the diploid genetic algorithm is used in the feature fusion module to perform fusion optimization on multi-scale and multi-level features, and the target detection capability of YOLOv8 is used to improve the detection accuracy and stability of the road damage detection model, and further combine SVM to improve the classification accuracy of road damage. The method of the present invention can significantly improve the classification accuracy of road damage images, especially on complex and diverse road damage image data, showing higher robustness and detection capability, and can be widely used in practical fields such as automatic detection and maintenance management of road damage.
[0086] In the embodiments disclosed in the present application, computer storage media may be tangible media that may contain or store programs for use by or in conjunction with an instruction execution system, device, or equipment. Computer storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of computer storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0087] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0088] The above are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technicians in this technical field, some improvements and modifications without departing from the principle of the present invention should be regarded as the protection scope of the present invention.
Claims
1. A road damage image classification method based on the YOLOv8 model, characterized in that: The specific steps include: Step S1, collecting road images with road damage, and marking the location and category of the road damage on the road damage image; Step S2: construct a road damage image classification model based on the YOLOv8 model; Step S3: inputting the road image with road damage into the generative adversarial network to expand the road image, using the expanded road image as the input of the road damage image classification model, using the location and category of the marked road damage as labels, training the road damage image classification model, and optimizing the generative adversarial network through the prediction results of the road damage image classification model; Step S4, repeating step S3 until the loss function of the road damage image classification model converges, completing the training of the road damage image classification model; Step S5: input the road image collected in real time into the trained road damage image classification model to predict the category of the road damage.
2. According to the road damage image classification method based on the YOLOv8 model of claim 1, it is characterized in that: The road damage image classification model comprises: a backbone network of a YOLOv8 model, an LBP feature extraction module, a HOG feature extraction module, a feature fusion module, a head network of the YOLOv8 model and an SVM. The backbone network, the LBP feature extraction module and the HOG feature extraction module of the YOLOv8 model are connected in parallel to a feature fusion module. The backbone network of the YOLOv8 model is used to extract local and global features of a road image, the LBP feature extraction module is used to extract texture detail features of a road image, and the HOG feature extraction module is used to extract gradient and edge features of a road image. The feature fusion module fuses and optimizes local features, global features, texture detail features, gradients and edge features through a diploid genetic algorithm to obtain an optimal fusion feature. The head network of the YOLOv8 model predicts an initial position and category of a road damage according to the optimal fusion feature, and the SVM optimizes the initial position and category of the road damage to obtain a final position and category of the road damage.
3. The road damage image classification method based on the YOLOv8 model according to claim 2 is characterized in that: The backbone network of the YOLOv8 model includes a first convolutional layer, a second convolutional layer, a first C2f module, a third convolutional layer, a second C2f module, a fourth convolutional layer, a third C2f module, a fifth convolutional layer, a fourth C2f module and an SPPF module connected in sequence, wherein the local features output by the second C2f module, the local features output by the third C2f module and the global features output by the SPPF module all need to be input into the feature fusion module for feature fusion.
4. The road damage image classification method based on the YOLOv8 model according to claim 3 is characterized in that: The feature fusion module fuses and optimizes local features, global features, texture detail features, gradient and edge features through a diploid genetic algorithm to obtain the optimal fusion feature in the following specific process: i. Combining the weights corresponding to local features, global features, texture detail features, gradients and edge features into individuals of the diploid genetic algorithm, initializing several individuals, setting the fitness function of the individuals and the maximum number of iterations; ii. The extracted local features, global features, texture detail features, gradient and edge features are fused according to each individual Calculate the fitness function of feature fusion under each individual fitness = mAP (F fusion ), and retain the individual with the largest fitness function value, where n represents the number of features, i represents the index of n, and F i represents the i-th feature, w i represents the weight of the i-th feature, and mAP() represents the detection accuracy function; iii. In the next iteration, all individuals are subjected to one or both of the random crossover and mutation operations, and step ii is repeated; iv. Repeat step iii until the maximum number of iterations is reached, and take the individual with the largest fitness function value as the optimal individual. Through the optimal individual, local features, global features, texture detail features, gradient and edge features are fused to obtain the optimal fusion features.
5. The road damage image classification method based on the YOLOv8 model according to claim 4 is characterized in that: The SVM optimizes the location and category of the initial road damage to obtain the final location and category of the road damage in the following specific process: A. The head network of the YOLOv8 model predicts the initial location, category and confidence of road damage based on the optimal fusion features, and inputs the feature vector composed of the candidate box, category probability and confidence corresponding to the initial location of road damage into the SVM. The location and category of the marked road damage are used as labels, and the category of the feature vector is predicted through the decision function, and the confidence of the feature vector is updated through the Sigmoid function. B. Perform non-maximum suppression based on the confidence of the feature vector and output the category and location of the road damage corresponding to the maximum confidence.
6. The road damage image classification method based on the YOLOv8 model according to claim 5 is characterized in that: The specific process of predicting the category of the feature vector through the decision function is: Update the confidence of the feature vector through the Sigmoid function The specific process is: Among them, y k represents the category of the sth road image with road damage predicted by SVM, N s represents the number of road images with road damage for training, and s represents N s The index of s represents the Lagrange multiplier corresponding to the sth road image with road damage in SVM, y s represents the true category of the sth road image with road damage, b represents the bias term, K(f k ,f s ) represents the RBF kernel function, f k represents the feature vector of the sth road image with road damage, f s represents the true feature vector of the sth road image with road damage, and σ represents the width parameter of the RBF kernel.
7. The road damage image classification method based on the YOLOv8 model according to claim 5 is characterized in that: The generative adversarial network includes a generator and a discriminator. The generator generates an image from random noise, and the discriminator receives the generated image and the collected road image, calculates the adversarial loss between the generated image and the collected road image, and guides the generator to update in combination with the prediction results of the road disease image classification model until the comprehensive loss function of the generator converges to generate a realistic road image.
8. The road damage image classification method based on the YOLOv8 model according to claim 7 is characterized in that: The comprehensive loss function L of the generator gen for: in, represents the adversarial loss of the generator, G(z) represents the image generated by the generator, D() represents the scoring function of the generator, and λ D express Hyperparameters of L loc represents the target detection and positioning loss of the generator, L loc =1-IoU(B pred ,B true ), B pred represents the target box in the generated image, B true represents the candidate box predicted by the road damage image classification model, IoU() represents the intersection over union function, and λ loc Indicates L loc Hyperparameters of L class represents the target classification loss of the generator, L class =-∑ s y k log(p s ), p s represents the predicted probability of the corresponding category in the generated image, λ class Indicates L class Hyperparameters of .
9. The road damage image classification method based on the YOLOv8 model according to claim 7 is characterized in that: The updating process of the generator is: The updating process of the discriminator is: Among them, θ G represents the parameters of the generator, η represents the learning rate, represents the gradient of the generator's comprehensive loss function to the generator parameters, represents the update parameters of the generator; θ D represents the parameters of the discriminator, L D represents the adversarial loss of the discriminator, L D = -[log(D(x))+log(1-D(G(z)))], D(x) represents the collected road image, represents the gradient of the discriminator's adversarial loss to the discriminator parameters, represents the updated parameters of the discriminator.
Citation Information
Cited By
Highway pavement disease detection method, system and equipment
CN122023417A
A highway pavement disease detection method, system and device
CN122023417B
Tablet flaw detection and elimination system and method, medium, product and terminal
CN122098950A