Concrete bridge crack detection method based on YOLOv8 lightweight improvement
Through lightweight improvements based on YOLOv8, the problems of low detection efficiency and resource and environment limitation in bridge disease detection are solved, and efficient and accurate crack detection is achieved, suitable for edge equipment and resource limitation environments.
Patent Information
- Application Number
- CN202510036859.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-01-09
AI Technical Summary
The prior art has problems such as low detection efficiency, high cost, and limited resource and environment in bridge disease detection, making it difficult to achieve efficient and accurate crack detection.
The crack detection method of concrete bridge based on YOLOv8 is adopted. By improving network algorithms, replacing computing modules and using customized detection heads, the feature extraction capability of the model and the multi-scale information fusion effect are improved, and the number of model parameters and calculation complexity are reduced.
It achieves higher detection accuracy and accuracy, has faster convergence speed, reduces the amount of model parameters, calculation amount and weight size, and is suitable for edge devices and resource-constrained environments.
Smart Images

Figure CN119963904A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent detection of concrete bridge defects, and specifically to a concrete bridge crack detection method based on lightweight improvement of YOLOv8. Background Art
[0002] With the acceleration of urbanization and the rapid development of infrastructure construction, bridges, as key hubs of the transportation network, are directly related to public safety and the normal operation of the economy and society. Due to its superior performance, long service life, and low maintenance cost, concrete bridges are currently one of the most widely used bridge structures among existing bridges. As the service life of the bridge increases, internal damage and deterioration reduce the bearing capacity of the structure. Cracks are a direct reflection of damage and are one of the important contents of bridge surface inspection. The appearance of cracks will accelerate the corrosion process of steel bars, significantly shorten the service life of the bridge structure, and weaken the overall strength and stability. Severe through-hole cracks may cause serious damage to the structure, posing a major threat to the safety performance of the bridge. Therefore, how to efficiently and accurately detect the defects of concrete bridges has become an important issue in the current maintenance and management of bridges.
[0003] Traditional bridge inspection mainly relies on manual inspection and simple physical equipment inspection. These methods have the disadvantages of low detection efficiency, high cost, and limited by subjective judgment. Especially when facing the daily maintenance needs of a large number of bridge structures, it is often difficult to detect defects in real time and accurately. Based on this, intelligent detection technology has begun to receive widespread attention in recent years. With the rise of computer vision, especially the rapid development of deep learning technology, new solutions have been provided for bridge defect detection.
[0004] At present, scholars have developed a large number of integrated models for bridge crack identification and segmentation through deep learning technology, which has solved the problems of insufficient automation and low detection accuracy of bridge crack detection to a certain extent. However, in actual bridge engineering detection, due to factors such as limited resources and environment, complex disease detection models, large number of parameters and calculations, these methods are limited in their effective use on engineering sites. Therefore, a lightweight and improved concrete bridge crack detection method based on YOLOv8 is proposed to improve detection efficiency and adaptability, thereby achieving efficient bridge crack detection. Summary of the invention
[0005] In view of the technical problems existing in the prior art, the present invention provides a concrete bridge crack detection method based on lightweight improvement of YOLOv8.
[0006] The technical solution of the present invention to solve the above technical problems is as follows: A method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 comprises the following steps:
[0007] Step 1: Build a lightweight and improved network algorithm of YOLOv8: Backbone part improvement, Neck part improvement, Head part replacement;
[0008] Step 2: Collect the data set for training the YOLOv8 lightweight improved network algorithm, and annotate the training set data to obtain the annotated training set data;
[0009] Step 3: Preprocess the training set data annotated in step 2;
[0010] Step 4: Input the training set data preprocessed in step 3 into the lightweight improved YOLOv8 network algorithm in step 1 for training, obtain the trained lightweight improved YOLOv8 model, and use the trained lightweight improved YOLOv8 model to detect the test set.
[0011] As a preferred method, this method combines StarNet's excellent lightweight design and information extraction capabilities, introduces the StarBlocks structure, replaces the Bottleneck in the original C2f module in the Backbone and Neck parts with StarNet's StarBlocks, and forms the STNC2f module. This improvement aims to enhance the network's feature extraction capabilities and multi-scale information fusion effects, while reducing the number of model parameters and computational complexity.
[0012] As a preferred method, the present method replaces the SPPF module in the Backbone part with the AIFI module. The SPPF module is an important component in YOLOv8 for improving the efficiency and performance of feature extraction. By pooling features at different scales, SPPF can effectively capture contextual information and enhance the spatial invariance of the model. The AIFI module is a key component in the RT-DETR model. It improves the efficiency and effectiveness of feature extraction through the interaction of internal scale features based on the attention mechanism. The core lies in applying the attention mechanism between features of the same scale, enhancing the focusing ability of the network, and promoting richer feature fusion. At the same time, the present method adds an additional convolutional layer (Conv) before the AIFI module. This combination helps to capture the dependencies between features, making the model more efficient in processing and fusing important feature information, thereby improving the overall detection performance and taking into account the detection accuracy of large, medium and small targets.
[0013] As a preferred method, this method proposes a customized task alignment detection head structure, called Task Dynamic Mutual Detection Head (TDMDH), which further optimizes the model performance through the task alignment label allocation strategy. TDMDH generates joint features through the interaction of information at different scales, which significantly reduces the number of model parameters while ensuring that the average precision does not fluctuate much, making it more lightweight and more suitable for resource-constrained devices. In terms of model normalization methods, BN (Batch Normalization) is effective in improving training and convergence speed, but its strong dependence on batch size will affect performance. To this end, this method replaces BN in some convolutional layers of the Head with GN (Group Normalization), thereby overcoming the limitations of batch normalization and preventing the loss of accuracy caused by lightweight operations.
[0014] The beneficial effects of the present invention are:
[0015] A crack detection method for concrete bridges based on the lightweight improvement of YOLOv8 is provided. The improved YOLOv8 algorithm is obtained by replacing the Bottleneck, SPPF modules and Head parts in the original C2f modules in the Backbone and Neck parts. The collected image data is input into the lightweight improved YOLOv8 model to identify concrete bridge diseases, so that it has higher precision and accuracy in identifying crack diseases and has a faster convergence speed. At the same time, the number of model parameters, the amount of calculation and the size of weights are greatly reduced, which effectively meets the lightweight requirements in edge devices and resource-constrained environments.
[0016] A lightweight and improved concrete bridge crack detection method based on YOLOv8 is provided. For irregular geometric targets such as cracks, the model's ability to extract fine-grained information and the fusion effect of multi-scale information are effectively improved by replacing the operation module and using a detection head with information sharing and dynamic feature selection. The speed and accuracy of target recognition are effectively improved and lightweight is achieved, which is of great significance for the application of YOLOv8 in the field of intelligent detection of concrete bridge diseases.
[0017] The present invention can be applied to the operation and maintenance of concrete bridges during their life cycle, and can be promoted in the detection of defects in other building structures. At the same time, it can explore the integration with other detection technologies (such as drone inspections, laser scanning, etc.) to promote the development of bridge defect detection towards a more intelligent and automated direction. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1This is a flow chart of a concrete bridge crack detection method based on lightweight improvement of YOLOv8 in the present invention;
[0019] Figure 2 The present invention is a STNC2f module structure diagram of a concrete bridge crack detection method based on YOLOv8 lightweight improvement of the present invention;
[0020] Figure 3 This is a Conv_GN module structure diagram of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8 in the present invention;
[0021] Figure 4 This is a DYFS module structure diagram of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8 in the present invention;
[0022] Figure 5 This is a task dynamic interactive detection head structure diagram of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8 in the present invention;
[0023] Figure 6 This is a network algorithm structure diagram of a concrete bridge crack detection method based on YOLOv8 lightweight improvement of the present invention;
[0024] Figure 7 This is a visualization effect comparison diagram of a lightweight and improved concrete bridge crack detection method based on YOLOv8 in the present invention;
[0025] Figure 8 This is a comparison table of detection effects of a lightweight and improved concrete bridge crack detection method based on YOLOv8 in the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0027] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, "plurality" means two or more, unless otherwise clearly and specifically defined.
[0028] In the description of the present application, the term "for example" is used to mean "used as an example, illustration or description". Any embodiment described as "for example" in the present application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is given to enable any technician in the field to implement and use the present invention. In the following description, details are listed for the purpose of explanation. It should be understood that a person of ordinary skill in the art can recognize that the present invention can be implemented without using these specific details. In other examples, well-known structures and processes will not be elaborated in detail to avoid unnecessary details to obscure the description of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown, but is consistent with the widest scope consistent with the principles and features disclosed in the present application.
[0029] Example 1
[0030] The specific process of the concrete bridge crack detection method based on the lightweight improvement of YOLOv8 in this embodiment is as follows:
[0031] A lightweight and improved concrete bridge crack detection method based on YOLOv8 is proposed. The method replaces the Bottleneck part of the original C2f module in the Backbone and Neck parts; replaces the SPPF module at the end of the Backbone; replaces the original Head with a customized task dynamic interactive detection head; uses image acquisition equipment to collect concrete bridge cracks under different scenes and different lighting conditions, and manually annotates the images; divides the data set and performs data enhancement through Mosaic; inputs the preprocessed data for training, selects the optimal model verification test set after convergence, and outputs the detection results. This method solves the problem that in the current era of intelligent engineering construction and intelligent detection, the traditional target detection algorithm YOLOV8 is difficult to give full play to its performance advantages in the actual application of bridge disease detection due to its high model calculation complexity and limited calculation speed, and effectively meets the lightweight requirements in edge devices and resource-constrained environments.
[0032] Step 1: Build a lightweight and improved network algorithm of YOLOv8: Backbone part improvement, Neck part improvement, Head part replacement;
[0033] Through the above operations, the trained model has stronger fine-grained information extraction and feature fusion capabilities, and also has lightweight features.
[0034] Step 2: Collect the data set for training the YOLOv8 lightweight improved network algorithm, and annotate the training set data to obtain the annotated training set data;
[0035] Step 3: Preprocess the training set data annotated in step 2;
[0036] Step 4: Input the training set data preprocessed in step 3 into the lightweight improved YOLOv8 network algorithm in step 1 for training, obtain the trained lightweight improved YOLOv8 model, and use the trained lightweight improved YOLOv8 model to detect the test set.
[0037] Example 2
[0038] The difference between this embodiment and embodiment 1 is that: in step 1, a YOLOv8 lightweight improved network algorithm is constructed; the specific process is:
[0039] By combining StarNet's excellent lightweight design and information extraction capabilities, the StarBlocks structure is introduced, and the Bottleneck in the original C2f module in the Backbone and Neck parts is replaced with StarNet's StarBlocks to form the STNC2f module. This improvement aims to enhance the network's feature extraction capabilities and multi-scale information fusion effects, while reducing the number of model parameters and computational complexity.
[0040] See also Figure 2 , Figure 2 The STNC2f module structure diagram of a concrete bridge crack detection method based on a YOLOv8 lightweight improvement provided by an embodiment of the present invention. Figure 2 As shown, an embodiment of the present invention provides an STNC2f module, in which Bottleneck in the C2f module is replaced with Star Blocks to form an STNC2f module, including convolution (Conv), separation (Spilt), Bottleneck, and concatenation (Concat). The StarNet star operation is shown below:
[0041]
[0042] Where: O star represents the result after the star operation; W represents the weight matrix of the linear layer; B represents the bias of the linear layer; X represents the input; * represents the star operation.
[0043] To simplify the analysis, StarNet focuses on scenarios involving single output channel conversion and single element input. Based on equations (1), (2), and (3), we define w1, w2, Where q is the number of input channels. The star operation can be further expressed as:
[0044]
[0045] Where: m, n represent the channel subscripts, and α represents the coefficient of each item:
[0046]
[0047] After further expressing the star operation described in formula (1), as shown in formula (4), it is expanded into a combination of (q+2)(q+1) / 2 different terms. Except for the special terms, each of the remaining terms has a nonlinear relationship with x, indicating that they are independent and implicit dimensions. After calculating using the star operation in the q-dimensional space, the dimension can be obtained as The implicit dimension feature space of , thus significantly amplifying the feature dimension, and does not incur any additional computational overhead within a single layer. By stacking multiple layers, the star operation can recursively increase the implicit dimension exponentially to near infinity:
[0048]
[0049] Where: O l Represented as the output of the lth star operation.
[0050] As shown in formula (6), using l-layer star operation, we can get a The implicit dimensional feature space of .
[0051] By replacing the SPPF module at the end of Backbone with the AIFI module, the problem that the SPPF module is overly dependent on pooling operations, is difficult to fully capture fine-grained feature information, and has certain disadvantages in feature fusion accuracy, information focusing ability, and adaptability to complex scenes is solved. The introduction of the intra-scale feature interaction AIFI module can capture more detailed local feature relationships. The SPPF module is an important component in YOLOv8 for improving feature extraction efficiency and performance. By pooling features at different scales, SPPF can effectively capture contextual information and enhance the spatial invariance of the model. The AIFI module is a key component in the RT-DETR model. Through the intra-scale feature interaction based on the attention mechanism, the efficiency and effectiveness of feature extraction are improved. The core lies in applying the attention mechanism between features of the same scale, enhancing the network's focusing ability, and promoting richer feature fusion. At the same time, this method adds an additional convolutional layer (Conv) before the AIFI module. This combination helps capture the dependency between features, making the model more efficient in processing and fusing important feature information, thereby improving the overall detection performance and taking into account the detection accuracy of large, medium, and small targets.
[0052] By replacing the Head part with a customized Task Dynamic Interaction Detection Head (TDMDH), the model performance is further optimized through the task alignment label allocation strategy. TDMDH generates joint features through the interaction of information at different scales, which significantly reduces the number of model parameters while ensuring that the average precision does not fluctuate much, making it more lightweight and more suitable for resource-constrained devices. In terms of model normalization methods, BN (Batch Normalization) is effective in improving training and convergence speed, but its strong dependence on batch size will affect performance. To this end, this method replaces BN in the convolutional layer of the Head part with GN (Group Normalization), thereby overcoming the limitations of batch normalization and preventing the loss of accuracy caused by lightweight operations.
[0053] See also Figure 5 , Figure 5 The structure diagram of the task dynamic interactive detection head of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8 provided in an embodiment of the present invention. Figure 3 As shown, an embodiment of the present invention provides a task dynamic interaction detection head, including Conv_GN, Concat, TaskDecomposition, GeneratorMask&Offet, DCNV2, Multiply, DYFS, Conv_Reg, Conv_Cls, and Scale parts.
[0054] The feature interaction mechanism of TDMDH is as follows: the three feature layers (P3, P4, P5) input from the Neck part pass through two shared convolution modules (Conv_GN) in sequence. The convolution kernel size of each module is 3×3. The information sharing between the two convolution layers effectively reduces the number of parameters and the amount of calculation. Afterwards, these features are spliced and aggregated into interactive features with joint information through the Concat operation. The interactive features are separated into regression shared branches and classification shared branches through the task decomposition module (Task Decomposition).
[0055] In the regression sharing branch, the interactive features generate offsets and masks, and combined with the Deformable ConvNets v2, DCNv2 can more flexibly adjust the position and weight of the convolution kernel, which is especially effective when dealing with complex geometric deformation targets such as cracks. Finally, the coordinate offset of the bounding box is predicted by 1×1 convolution, and the output features are adjusted using the Scale layer to adapt to different target scales.
[0056] In the classification sharing branch, the DYFS (Dynamic Features Select) module performs dynamic feature selection on interactive features and generates corresponding weights to improve the recognition ability of disease targets. Finally, the probability of each category is predicted through a 1×1 convolutional layer.
[0057] See also Figure 6 , Figure 6 A network algorithm structure diagram of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8 provided in an embodiment of the present invention. Figure 6 As shown, an embodiment of the present invention provides a network structure of a concrete bridge crack detection method based on a lightweight improvement of YOLOv8, including replaced STNC2f and AIFI modules in the Backbone and Neck parts, and a complete task dynamic interactive detection head (TDMDH) in the Head part.
[0058] Example 3
[0059] The difference between this embodiment and embodiments 1 and 2 is that: in step 2, a data set for training the YOLOv8 lightweight improved network algorithm is collected, and the training set data is labeled to obtain the labeled training set data; the specific process is:
[0060] Step 1: Use image acquisition equipment to collect images of bridge cracks in different scenes and under different lighting conditions. Use frontal and horizontal angles to ensure that the collected data is clear and unobstructed. To improve the generalization and robustness of the training model, it is necessary to obtain a sufficiently rich variety of data sets under different scenes and lighting conditions.
[0061] Step 2: Use labelImg software with the assistance of semi-automatic labeling software to mark the crack position of each collected image.
[0062] Example 4
[0063] The difference between this embodiment and embodiments 1, 2, and 3 is that in step 3, the training set data annotated in step 2 is preprocessed; the specific process is:
[0064] Step 1: Use the code written in Python to convert the format of the training set data from xml to txt to obtain the training set data in txt format to meet the needs of lightweight improved YOLOv8 network algorithm training;
[0065] Step 2: Use the Mosica data enhancement algorithm to enhance the training set data converted into txt format. Generate diverse crack image data by rotating, scaling, translating, mirror flipping, and adding noise to the original image, simulating different environments and working conditions, thereby improving the generalization ability of the model, and add the generated new data to the training set to obtain the preprocessed training set data.
[0066] Example 5
[0067] The difference between this embodiment and embodiments 1, 2, 3, and 4 is that: in the step 4, the training set data preprocessed in step 3 is input into the lightweight improved YOLOv8 network algorithm in step 1 for training, the trained lightweight improved YOLOv8 model is obtained, and the trained lightweight improved YOLOv8 model is used to detect the test set; the specific process is:
[0068] Step 1: Configure the training (train.py) file, input the training set into the lightweight improved YOLOv8 network algorithm for training, and obtain the trained lightweight improved YOLOv8 model after convergence;
[0069] Select appropriate parameters according to the computer configuration, give full play to the graphics performance of the GPU, set the early stopping mechanism, save model training time, output Precision, Recall, mAP@0.5, mAP@0.5:0.95, FPS and training time after each round of training, and select the best weight file best.pt for the next step of target detection.
[0070] Step 2: Configure the test (test.py) file and input the test set to be identified into the trained lightweight improved YOLOv8 model for detection.
[0071] Precision is used to determine the probability of correct detection of the target, Recall is used to determine whether the target in the complete data set can be found, and mAP is the average AP value of all categories. The calculation formula is as follows:
[0072]
[0073]
[0074] In formulas (7) and (8), T P (True positive) indicates the number of correctly predicted positive samples; F P (Falsepositive) indicates a false positive situation, that is, the location of the target can be identified, but the category of the target is incorrectly identified. N(Falsenegative) indicates the number of targets that are not detected. Formula (9) is the average precision mean (F AP ), that is, the average of the precision values obtained when the recall rate is between 0 and 1. In formula (10), n is the number of classes of samples in the data set, and F APi represents the average precision of the i-th class of samples, so F mAP It is the average of all categories of AP. This method uses mAP@50 for evaluation when discussing mAP. mAP@50 means the mAP obtained by taking the average of the sum of the APs of the samples when IoU is 0.5; IoU indicates the degree of overlap between the predicted box and the true value.
[0075] Confusion matrix of concrete bridge crack detection method based on YOLOv8 lightweight improvement
[0076] Prediction is P Prediction is N The actual value is P TP FN The actual value is N FP TN
[0077] The confusion matrix is a tool widely used in the performance evaluation of classification models. It is used to show the correspondence between the model prediction results and the actual results. Its structure and content are as follows:
[0078] The confusion matrix contains two dimensions: true value and predicted value, which are defined as follows:
[0079] 1. True value:
[0080] The actual value is P: it means that there are concrete cracks in the sample (positive sample).
[0081] The actual value is N: it means that there is no concrete crack in the sample (negative sample).
[0082] 2. Prediction value:
[0083] Prediction is P: It means the model predicts that the sample has concrete cracks.
[0084] Prediction is N: It means that the model predicts that there is no concrete crack in the sample.
[0085] The four core elements of the confusion matrix are:
[0086] ●True Positive (TP): The sample actually has a crack, and the model correctly predicts that there is a crack.
[0087] ●False Positive (FP): There is no crack in the sample, but the model mistakenly predicts that there is a crack.
[0088] False negative (FN): The sample actually has cracks, but the model incorrectly predicts that there are no cracks.
[0089] ●True Negative (TN): The sample does not actually have a crack, and the model correctly predicts that there is no crack.
[0090] In order to demonstrate the advantages of this method in concrete bridge crack detection, a comparative analysis was conducted between this method and the YOLOv3-tiny, YOLOv5n, YOLOv6, YOLOv9t, YOLOv10n and YOLOv11n with relatively excellent performance in the YOLO series.
[0091] See also Figure 8 , Figure 8 The following is a comparison table of the detection effects of the concrete bridge crack detection method based on the YOLOv8 lightweight improvement provided by the embodiment of the present invention. Figure 8 As shown in the figure, the performance of this method in concrete bridge crack disease image detection is better than the currently commonly used target detection algorithm, and its mean average precision (mAP@50) is the best among all the compared algorithms, while achieving the lightweight requirements of the model. Therefore, a concrete bridge crack detection method based on the lightweight improvement of YOLOv8 is more suitable for application in resource-constrained environments and edge devices.
[0092] It should be noted that in the above embodiments, the description of each embodiment has its own emphasis, and for parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0093] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0094] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0098] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A concrete bridge crack detection method based on lightweight improvement of YOLOv8, characterized in that: The following steps are involved: Step 1: Build a lightweight and improved network algorithm of YOLOv8: Backbone part improvement, Neck part improvement, Head part replacement; Step 2: Collect the data set for training the YOLOv8 lightweight improved network algorithm, and annotate the training set data to obtain the annotated training set data; Step 3: Preprocess the training set data annotated in step 2; Step 4: Input the training set data preprocessed in step 3 into the lightweight improved YOLOv8 network algorithm in step 1 for training, obtain the trained lightweight improved YOLOv8 model, and use the trained lightweight improved YOLOv8 model to detect the test set.
2. According to claim 1, a method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 is characterized in that: In the step 1, a YOLOv8 lightweight improved network algorithm is constructed; the specific process of improving Backbone and Neck parts is as follows: Step 1: Replace Bottleneck in C2f module with Star Blocks of StarNet to form STNC2f module; Step 2: Replace the SPPF module with the intra-scale feature interaction AIFI module and add an additional convolutional layer before AIFI; The feature fusion process of the AIFI module is as follows: first, the two-dimensional S5 features are converted into high-dimensional vectors and processed by the AIFI module; Specifically, the output of Multi-Head Self-Attention (MHSA) is added to the input through residual connection, and then normalized by layer to efficiently capture the complex relationship of the input sequence; Then, these features are passed to the Feed-Forward Network (FFN) to complete nonlinear transformation and feature extraction; Finally, the output is layer-normalized again to generate an attention score containing important feature information and converted back to a two-dimensional form, denoted as F5, for subsequent cross-scale feature fusion.
3. According to claim 1, a method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 is characterized in that: In the step 1, a YOLOv8 lightweight improved network algorithm is constructed; the specific process of improving the Head part is: replacing the Head part with a lightweight Task Dynamic Interaction Detection Head (T DMDH): The feature interaction mechanism of TDMDH is as follows: the three feature layers (P3, P4, and P5) input from the Neck part pass through two shared convolution modules (Conv_GN) in sequence. The convolution kernel size of each module is 3×3. The information sharing between the two convolution layers effectively reduces the number of parameters and the amount of calculation. After that, these features are spliced and aggregated into interactive features with joint information through the Concat operation. The interactive features are separated into regression shared branches and classification shared branches through the task decomposition module (Task Decomposition); In the regression shared branch, the coordinate offset of the bounding box is predicted by 1×1 convolution, and the output features are adjusted to adapt to different target scales using the Scale layer; In the classification sharing branch, the interactive features are dynamically selected to generate corresponding weights to improve the recognition ability of disease targets. Finally, the probability of each category is predicted through a 1×1 convolutional layer.
4. According to claim 1, a method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 is characterized in that: In the step 2, a data set for training the YOLOv8 lightweight improved network algorithm is collected, and the training set data is labeled to obtain the labeled training set data; the specific process is: Step 1: Use image acquisition equipment to collect cracks in concrete bridges under different scenes and different lighting conditions, and use frontal and horizontal angles to shoot during the acquisition process; Step 2: After the image data is collected, manual labeling is performed using the labelImg image labeling tool with the assistance of a semi-automatic labeling tool.
5. According to claim 1, a method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 is characterized in that: In the step 3, the training set data annotated in the step 2 is preprocessed to obtain the preprocessed training set data; the specific process is: Step 1: Get the training set data from XML format to TXT format; Step 2: Use the data enhancement algorithm to enhance the training set data converted into txt format, add the generated new data to the training set, and obtain the preprocessed training set data.
6. The method for detecting cracks in concrete bridges based on lightweight improvement of YOLOv8 according to claim 1 is characterized in that: Input the training set data preprocessed in step 3 into the lightweight improved YOLOv8 network algorithm in step 1 for training, obtain the trained lightweight improved YOLOv8 model, and use the trained lightweight improved YOLOv8 model to detect the test set; the specific process is: Step 1: Input the images and annotation information of the training set into the lightweight improved YOLOv8 algorithm until convergence to obtain the trained lightweight improved YOLOv8 model; Step 2: Input the test set to be identified into the trained lightweight improved YOLOv8 model for identification.
Citation Information
Patent Citations
Improved YOLOv5 bridge crack detection method based on coordinate attention mechanism
CN118262145A
Lightweight PCB defect detection method based on improved YOLOv8 algorithm
CN118608509A
Electric vehicle helmet intelligent detection method and device based on BottleNeck structure and SLLU
CN118628990A
Student classroom behavior detection method based on improved YOLOv8 model
CN118762396A
Target detection and identification method and system based on aerial image of unmanned aerial vehicle
CN118823607A