Road disease detection method, device, electronic device and storage medium based on RDNet

By optimizing the YOLOv5 network structure, RDNet is formed, which solves the problem of low accuracy of road disease detection in the existing technology and achieves accurate identification and detection of diverse road diseases.

CN118429946BActive Publication Date: 2024-10-01STREAMAP TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410727536.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-06
Publication Date
2024-10-01
Estimated Expiration
2044-06-06

AI Technical Summary

Technical Problem

Existing road disease detection methods based on image processing technology have low accuracy and are difficult to accurately identify diverse road diseases and changes in environmental factors.

Method used

By optimizing the YOLOv5 network structure, the C3 block is replaced with a cross-stage multi-branch convolution block (CSPMBC block), combined with the residual parallel atrous convolution block (RPD block) and the adaptive scale space attention block (ASSA block) to form RDNet , enhance feature extraction and expression capabilities, and reduce the impact of environmental factors.

Benefits of technology

The accuracy and identification ability of road disease detection are improved, different types of road diseases can be identified more accurately, and the uncertainty of detection results is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429946B_ABST
    Figure CN118429946B_ABST
Patent Text Reader

Abstract

The present application discloses a road damage detection method based on RDNet, a road damage detection device based on RDNet, an electronic device and a computer-readable storage medium. RDNet is improved based on YOLOv5 as a basic model. Specifically, a CSPMBC block is introduced in the backbone network and / or the neck network to replace the original C3 block, and the SPPF in the backbone network is replaced by an RPD block, and the backbone network and the neck network are connected through an ASSA block, that is, YOLOv5 is structurally optimized from different angles to obtain RDNet, so that RDNet can enhance the extraction and expression capabilities of features from different angles, and at the same time, the problem of inconsistent scales is effectively improved, and a fusion feature with multiple receptive fields and strong expression capabilities is obtained. The fusion feature is detected by the detection network of RDNet, so that different road damages can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of intelligent road inspection, and in particular, relates to a road defect detection method based on RDNet, a road defect detection device based on RDNet, an electronic device, and a computer-readable storage medium. Background Art

[0002] Roads play a vital role in contemporary urban planning and infrastructure construction. Road conditions directly affect the efficiency of urban functions and the comfort of residents' lives. However, over time, roads are susceptible to multiple factors such as environmental conditions, traffic pressure, and material aging, causing various road diseases to gradually appear in their structures, such as cracks, potholes, and subsidence. These road diseases not only damage the driving body and even endanger driving safety, but also shorten the effective life of the road and increase maintenance costs.

[0003] If road damage can be detected and maintained early, the service life of the road can be extended and maintenance costs can be reduced, while ensuring driving safety and driving experience. In this process, accurate identification and assessment of road damage is crucial.

[0004] Although there are many road damage detection methods based on image processing technology, the recognition of road damage is difficult due to its diverse manifestations and susceptibility to a variety of environmental factors, which results in low detection accuracy of these detection methods. Summary of the invention

[0005] The present application provides a road damage detection method based on RDNet, a road damage detection device based on RDNet, an electronic device and a computer-readable storage medium, which can accurately detect different road damages.

[0006] In a first aspect, the present application provides a road disease detection method based on RDNet, comprising:

[0007] Based on the pre-trained RDNet backbone network, feature extraction is performed on the image to be detected to obtain image features; the image to be detected at least includes roads;

[0008] The image features are fused based on the neck network of RDNet to obtain fused features;

[0009] The fusion features are detected based on the RDNet detection network to obtain the road damage detection results based on RDNet in the image to be detected;

[0010] Among them, RDNet is a YOLOv5 in which the C3 blocks in the backbone network and / or the neck network are replaced with cross-stage multi-branch convolution blocks, which are based on the cross-stage local network and multi-branch convolution network settings.

[0011] In a second aspect, the present application provides a road disease detection device based on RDNet, comprising:

[0012] A feature extraction module is used to extract features from the image to be detected based on the pre-trained RDNet backbone network to obtain image features; the image to be detected at least includes roads;

[0013] The feature fusion module is used to fuse image features based on the RDNet neck network to obtain fused features;

[0014] The detection module is used to detect the fused features based on the RDNet detection network to obtain the road damage detection results based on RDNet in the image to be detected;

[0015] Among them, RDNet is a YOLOv5 in which the C3 blocks in the backbone network and / or the neck network are replaced with cross-stage multi-branch convolution blocks, which are based on the cross-stage local network and multi-branch convolution network settings.

[0016] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method of the first aspect when executing the computer program.

[0017] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method of the first aspect are implemented.

[0018] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by one or more processors, it implements the steps of the method of the first aspect.

[0019] Based on the first aspect, the beneficial effect of the present application compared with the prior art is: optimizing the network structure of the backbone network and / or neck network of YOLOv5 to obtain a road detection model (Road Detection Network, RDNet). Specifically, the original C3 block of YOLOv5 is replaced by the CSPMBC block. The CSPMBC block is based on the RDNet obtained by integrating CSPNet and MBCNet, which can improve the backbone network and / or neck network's ability to extract and express road disease features. Based on this, the backbone network of RDNet is first used to extract features of the image to be processed to obtain image features; then the image features are fused through the neck network of RDNet to obtain fused features. Thanks to the optimized backbone network and / or neck network, the receptive field of the fused features can be made larger and the expression ability stronger. Finally, the fused features are detected based on the detection network of RDNet, and more accurate detection results can be obtained, so that different road diseases can be accurately identified.

[0020] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0022] Figure 1 It is a schematic diagram of the network structure of YOLOv5 provided in an embodiment of the present application;

[0023] Figure 2 is a schematic diagram of a network structure of an RDNet provided in an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of the network structure of another RDNet provided in an embodiment of the present application;

[0025] Figure 4 It is a sample display diagram of different types of road diseases provided in the embodiments of the present application;

[0026] Figure 5 It is a statistical chart of the number of samples of different types of road diseases provided in the embodiments of the present application;

[0027] Figure 6 is a schematic flow chart of a road damage detection method based on RDNet provided in an embodiment of the present application;

[0028] Figure 7 It is a structural diagram of a CSPMBC block provided in an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of the structure of the RPD block provided in an embodiment of the present application;

[0030] Fig. 9 It is a schematic diagram of the structure of the ASSA block provided in the embodiment of the present application;

[0031] Fig.10 This is a performance comparison chart of the optimal RDNet and YOLOv5 provided in the embodiment of the present application;

[0032] Fig.11 is a structural schematic diagram of a road disease detection device based on RDNet provided in an embodiment of the present application;

[0033] Fig.12 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0035] In the related art, although there are many road damage detection methods based on image processing technology, since road damage has diverse manifestations and is easily affected by various environmental factors, it is difficult to identify road damage, which makes the detection accuracy of these detection methods relatively low.

[0036] In order to solve this problem, this application proposes a road disease detection method based on RDNet, which can obtain features with more receptive fields and stronger expression capabilities based on the structurally optimized backbone network and / or neck network, thereby reducing the impact of environmental factors and ensuring that different road diseases can be accurately detected. The detection method proposed in this application will be described below through specific embodiments.

[0037] The RDNet-based road defect detection method provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, vehicle-mounted equipment, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.

[0038] In some examples, in order to implement the detection method proposed in this application, YOLOv5 is used as the basic network and improved to obtain the one used in this application. The network structure of YOLOv5 can be found in Figure 1 In order to enhance the feature extraction and expression capabilities, RDNet can replace the original C3 block in the backbone network and / or neck network of YOLOv5 with a Cross Stage Partial Multi-Branch Convolution (CSPMBC) block. For example, see Figure 1 and Figure 2 RDNet replaces the original C3 blocks in the backbone network and neck network of YOLOv5 with Cross Stage Partial Multi-Branch Convolution (CSPMBC) blocks. The CSPMBC block is based on the Cross-Stage Partial Network (CSPNet) and Multi-Branch Convolutional Network (MBCNet). By integrating the two networks, the CSPMBC block can, on the one hand, make the extracted features have more receptive fields and improve the performance of multiple features; on the other hand, it will make the features corresponding to different road diseases more comprehensively represented, and the features corresponding to each road disease will be more distinguishable and easier to be accurately identified.

[0039] In some instances, in order to increase the receptive field and enrich the spatial information, the Spatial Pyramid Pooling-F (SPPF) in the backbone network can be replaced with a Residual Parallel Dilated Convolution Block (RPD block), where the RPD block includes at least two dilated convolution layers with dilation rates. The RPD block can extract features of different scales through at least two dilated convolution layers with dilation rates, which can make the features corresponding to road damages of different sizes more distinguishable, thereby helping to accurately identify various road damages of different sizes.

[0040] In some instances, in order to improve the ability to extract features of different scales, the backbone network and the neck network can be connected through the adaptive scale spatial attention block (ASSA block). Among them, the ASSA block includes a spatial sensing (Spatial Wise) layer and an attention sensing (Attention Wise) layer based on residual connection. For features of different scales, by introducing the two mechanisms of Spatial Wise and Attention Wise, RDNet can focus on important areas in the image to be detected, suppress irrelevant background information, and capture features of different scales at the same time, and adaptively learn weight coefficients of different scales. Therefore, on the one hand, by adaptively learning weight coefficients, the relationship between shallow image texture features and deep image semantic features can be balanced, which is particularly important for improving the network's ability to extract features at different scales. On the other hand, by learning the connection between different features, the inconsistency problem within the feature pyramid can be better solved, thereby improving the model's ability to understand and utilize features of different scales.

[0041] In some instances, the aforementioned embodiments optimize the network structure of RDNet from different angles, that is, introduce CSPMBC blocks, RPD blocks and / or ASSA blocks, that is, structural optimizations at different angles can be combined with each other to achieve better improvement effects.

[0042] In some embodiments, see Figure 3 , Figure 3 It is the optimal network structure of RDNet, that is, the backbone network and neck network of the basic network YOLOv5 are structurally optimized based on CSPMBC blocks, RPD blocks and ASSA blocks at the same time, so that the feature extraction and expression capabilities are enhanced from different angles.

[0043] Based on the network structure of RDNet, in order to illustrate the technical solution proposed in this application, each embodiment will be described below with an electronic device as the execution subject.

[0044] In some instances, the loss function of RDNet includes regression loss (Localization Loss), confidence loss (Confidence Loss) and classification loss (Classification Loss).

[0045] Confidence loss is used to measure the probability that the RDNet prediction box contains the target object. All prediction boxes will calculate the confidence loss, but only the prediction boxes marked as true in the mask will calculate the classification and regression losses. Confidence loss is usually calculated using the Binary Cross-Entropy (BCE) loss function.

[0046]

[0047] in, L BCE is the binary cross entropy loss, n is the number of image samples of all road diseases, y i For the i The true category of the image samples, is the predicted category of the i-th image sample.

[0048] The regression loss is used to calculate the error between the predicted bounding box and the ground truth box. The regression loss uses the CIOU loss (Complete Intersection over Union loss, L CIoU ), which is an improved version of commonly used loss functions such as L1, L2, Intersection over Union (IoU) and GIoU. L CIoU The penalty term for aspect ratio is added. When the center points of the predicted box and the labeled box coincide, the errors in different situations can be better distinguished and the scale is invariant.

[0049]

[0050] in, b and b gt They are the center points of the prediction box and the annotation box respectively; ρ is the Euclidean distance between the predicted box and the labeled box; cis the distance between the diagonal of the closed area of ​​the prediction box and the annotation box; v To ensure the consistency of the relative proportions of the predicted box and the labeled box, IoU is the intersection-over-union ratio of the predicted box and the labeled box; α is the weight coefficient; w and w gt They are the width of the prediction box and the annotation box respectively; h and h gt They are the heights of the predicted box and the labeled box respectively.

[0051] The classification loss is used to determine whether the bounding box contains road damage. If it does, the category of the road damage can be further determined. The general classification loss is also calculated using the BCE loss function.

[0052] For example, the road damage detected in this application includes 7 categories, namely sink, longitudinal crack (crack_p), longitudinal crack patch (patch_crack_p), transverse crack (crack_t), transverse crack patch (patch_crack_t), net crack (net) and net crack patch (patch_net). Figure 4 , and selected some pictures for each category for display. Figure 4 It can be seen that road diseases take various forms.

[0053] See also Figure 5 After quantitative statistical analysis of sample images of each category of road damage, it can be seen that among the seven categories, the proportion of subsidence, cracks, and crack patches is much smaller than that of other categories, that is, the number of categories of each road damage is in a serious category imbalance state. Training RDNet based on such a dataset will cause the gradients of the road damage categories with a small number to be overwhelmed by the gradients of the road damage categories with a large number during training. At this time, if the conventional binary cross entropy loss is still used, it is easy to suppress the learning of the minority categories, resulting in poor detection effect of the road damage categories with a small number.

[0054] In some embodiments, in order to reduce the impact of imbalance of road damage categories with a small number, the sample weight coefficient can be determined according to the number of each road damage category, and the classification loss of different road damage categories with a small number can be balanced by re-weighting. Specifically, the category weight coefficient can be calculated as follows:

[0055]

[0056] in, N c Road damage category c The number of samples,f ( N c ) is the road damage category c The weight coefficient of r c Road damage category c The ratio of the number of annotation boxes to all annotation boxes; t It is a hyperparameter. The value of the hyperparameter can be set based on experience. Here it can be set to 1.02.

[0057] Combining the weighted road damage categories with the binary cross entropy, we can get the classification loss function: L cls , L cls It can balance the adverse effects of the small number of road disease categories in the training sample set. The formula is as follows:

[0058]

[0059] Correspondingly, the total loss function of RDNet is L , and its calculation formula is as follows:

[0060]

[0061] Based on the total loss function of RDNet, the RDNet described in any of the above embodiments is trained. By continuously iterating RDNet, the RDNet can achieve better and more stable detection results for various road defects. The most robust version can be selected from multiple converged versions as the trained RDNet.

[0062] In some embodiments, in order to comprehensively and accurately measure the performance of each version of RDNet, it can be evaluated by a validation set. Specifically, the performance of RDNet on the validation set can be evaluated according to preset conditions. For example, these preset conditions may include performance indicators such as the intersection-over-union ratio, detection accuracy, and recall rate of RDNet for road damage.

[0063] IoU is an indicator for evaluating the degree of overlap between the predicted box and the annotated box. It calculates the ratio of the intersection and union of the predicted box and the annotated box. It plays a key role in determining whether it is a correct detection. The calculation formula of IoU can be written as:

[0064]

[0065] Precision (p), also known as the precision rate, refers to the proportion of correct positive predictions to all positive predictions, as shown in the formula:

[0066]

[0067] Recall (R), also known as recall rate, refers to the proportion of correctly predicted positives to all actual positives, as shown in the formula:

[0068]

[0069] Average Precision (AP) is calculated from precision and recall. A line graph of precision is drawn based on the recall value, and the area under the line is calculated, as shown in the formula:

[0070]

[0071] Mean Average Precision (mAP) refers to the average value of the average precision AP of C different road disease categories, as shown in the formula:

[0072]

[0073] In some embodiments, based on the trained RDNet, the road damage detection method proposed in this application is described with an electronic device as the execution subject. Figure 6 A schematic flow chart of a road damage detection method based on RDNet provided by the present application is shown, and the detection method comprises:

[0074] Step 610: The electronic device extracts features of the image to be detected based on the pre-trained RDNet backbone network to obtain image features.

[0075] Step 620: The electronic device fuses the image features based on the neck network of RDNet to obtain fused features.

[0076] Step 630: The electronic device detects the fused features based on the RDNet detection network to obtain a road damage detection result based on RDNet in the image to be detected.

[0077] The purpose of detection is to identify whether there are road damages in the image to be detected and to determine what type of road damages they are. Therefore, the image to be detected at least includes roads. The fusion features obtained in the improved backbone network and / or neck network can make the feature information of the fusion features richer and more expressive, so that the features corresponding to different road damages are more distinguishable. The electronic device inputs the fusion features into the detection network to obtain various road damage detection results based on RDNet, and the detection results are more accurate.

[0078] In some embodiments, it can be seen from the foregoing that the CSPMBC block replaces the C3 block in the original YOLOv5, that is, there are multiple CSPMBC blocks, and they are distributed in different positions of RDNet. Although the CSPMBC blocks are distributed in different positions of RDNet, the processing process of the corresponding input features is the same, and the difference lies in the input features. In order to illustrate the processing flow of the CSPMBC block, the difference in input features can be ignored, and the input features are recorded as the first input features. Accordingly, the steps performed to input the first input feature into the CSPMBC block are as follows:

[0079] Step A1: The electronic device performs a preset convolution operation on a first input feature to obtain a first convolution result.

[0080] Step A2: The electronic device performs a preset convolution operation on the first convolution result to obtain a second convolution result.

[0081] Step A3: The electronic device performs feature stitching on the first input feature, the first convolution result, and the second convolution result to obtain a first stitching feature.

[0082] Step A4: The electronic device adjusts the number of channels of the first stitching feature based on the number of channels of the first input feature.

[0083] Step A5: The electronic device performs a preset convolution operation on the first splicing feature after adjusting the number of channels to obtain a third convolution result.

[0084] Step A6: The electronic device performs a preset convolution operation on the third convolution result to obtain a fourth convolution result.

[0085] Step A7: The electronic device performs a feature stitching operation on the first convolution result, the second convolution result, the third convolution result, and the fourth convolution result to obtain a second stitching feature.

[0086] Step A8: The electronic device adjusts the number of channels of the second stitching feature based on the number of channels of the first input feature.

[0087] Step A9: The electronic device performs feature fusion on the second splicing features after adjusting the number of channels to obtain output features corresponding to the first input features.

[0088] Exemplarily, the preset convolution operation may be a 3×3 convolution operation, and the number of channels may be adjusted by a 1×1 convolution operation. It is understood that the preset convolution operation may also be a 5×5 convolution operation. The channel parameters may also be adjusted by methods such as a cascade operation or a weighted sum feature.

[0089] Specifically, the structure of the corresponding CSPMBC block is as follows: Figure 7As shown in the figure, the CSPMBC block can be divided into two parts, and the first input features can be input into the two parts respectively. The first part is a large cross-stage connection in parallel with a 3×3 convolutional layer, which mainly provides long-range gradient information and accelerates gradient back propagation. The cross-stage connection directly transmits the first input feature, and the 3×3 convolutional layer corresponds to the above step A1 to obtain the first convolution result.

[0090] The second part consists of an upper and lower part. The structure of the upper network is a small cross stage connection in parallel with a 3×3 convolution layer, which is sequentially divided into two branches. Among them, the small cross stage connection in the upper part directly transmits the first input feature as a component of the input of the lower network; the 3×3 convolution layer executes the aforementioned step A1, and directly inputs the obtained first convolution result through one branch, and executes the aforementioned step A2 through another branch to obtain the second convolution result. At this point, the first input feature is processed by the upper network to obtain the first input feature, the first convolution result, and the second convolution result. Based on the three features, the aforementioned steps A3 and A4 are executed, that is, the three features are spliced ​​to obtain the first spliced ​​feature. After adjusting the channel based on the 1×1 convolution layer, the feature input to the lower network can be obtained.

[0091] The structure of the lower network is similar to that of the upper network. The small cross stage connection directly transmits the first concatenated feature after adjusting the channel, and executes the aforementioned step A5 through the 3×3 convolution layer in parallel with the small cross stage connection. The third convolution result is directly input through one branch, and the aforementioned step A6 is executed through another branch to obtain the fourth convolution result.

[0092] At this point, based on the two parts, the first input feature, the first convolution result, the first splicing feature after adjusting the number of channels, the third convolution result and the fourth convolution result can be obtained. Based on these five features, the aforementioned steps A7 to A9 are performed, that is, the five features are spliced ​​to obtain the second splicing feature, and the number of channels of the second splicing feature is adjusted based on the 1×1 convolution layer, so as to obtain the output feature of the first input feature after being processed by the CSPMBC block.

[0093] In some embodiments, the smallest-scale feature (recorded as the second input feature) extracted based on the backbone network can be input into the RPD block for processing, and the specific processing steps include:

[0094] Step B1: The electronic device performs a dilated convolution operation on the second input feature after adjusting the number of channels based on different dilation rates to obtain various dilated convolution results.

[0095] Step B2: The electronic device sequentially performs a global average pooling operation and a scale adjustment operation on the second input feature after the number of channels is adjusted to obtain a global average pooling result; the scale of the global average pooling result is the same as the scale of each dilated convolution result.

[0096] Step B3: The electronic device performs a feature splicing operation on the global average pooling result and each dilated convolution result to obtain an initial multi-scale feature.

[0097] Step B4: The electronic device fuses the initial multi-scale features with the second input features after the number of channels is adjusted to obtain target multi-scale features.

[0098] Optionally, four dilation rates (3, 5, 7, 9) of the dilated convolutions can be used, and the number of channels can be adjusted by a 1×1 convolution operation.

[0099] Specifically, the structure of the corresponding RPD block is as follows: Figure 8 As shown. First, the channel of the second input feature is adjusted through a 1×1 convolution layer, and then input into two branches respectively, one of which is a parallel dilated convolution module, which includes four parallel dilated convolutions with different expansion rates and a global average pooling layer. First, the second input feature after adjusting the channel is input into four dilated convolution layers respectively, that is, the aforementioned step B1 is executed to obtain the corresponding four dilated convolution results; the second input feature after adjusting the channel is input into the global average pooling layer, and the output of the global average pooling layer is subjected to a 1×1 convolution operation and a bilinear upsampling operation, that is, the aforementioned step B2 is executed, so that the final output global average pooling result has the same size as the input of the dilated convolution. Then, step B4 is executed through the feature splicing layer, that is, the global average pooling result and each dilated convolution result are spliced ​​to obtain multi-scale feature information, that is, the initial multi-scale feature; finally, the initial multi-scale feature is fused with the residual of the second input feature through another feature splicing layer, so as to improve the semantic expression ability and accelerate the gradient back propagation, and obtain the target multi-scale feature.

[0100] The design of the RPD module effectively improves the performance of the network by combining dilated convolution and residual learning. It has obvious advantages, especially when dealing with tasks that require a large receptive field and rich spatial information, such as small target detection.

[0101] In some embodiments, the features at any scale extracted based on the backbone network (which may be recorded as the third input feature) may be input into the ASSA block for processing, and the specific processing steps include:

[0102] Step C1: The electronic device performs a feature stitching operation on each third input feature based on the maximum scale to obtain a third stitching feature.

[0103] Step C2: The electronic device inputs the third splicing feature into the spatial sensing layer and the attention sensing layer connected in series for adaptive learning to obtain target weight coefficients corresponding to different scales.

[0104] Step C3: The electronic device performs a feature weighting operation on the third splicing feature based on each target weight coefficient to obtain a weighted third splicing feature.

[0105] Step C4: The electronic device performs a convolution operation on the weighted third concatenated features to obtain weighted third input features corresponding to the third input features.

[0106] Optionally, features at three scales are extracted through the backbone network, and the three scales are 1 / 8 scale, 1 / 16 scale and 1 / 32 scale respectively.

[0107] Specifically, the structure of the corresponding ASSA block is as follows Fig. 9 As shown. Feature splicing is performed based on the feature of the largest scale. Before splicing, the features of the 1 / 16 scale and the 1 / 32 scale can be subjected to corresponding upsampling operations, so as to unify the features of the two scales into a 1 / 8 scale. After the scale is unified, the channel dimension can be directly spliced, that is, the aforementioned step C1 is executed to obtain the third splicing result; then the third splicing result is input into the adaptive learning module, and the adaptive learning module includes a spatial sensing layer and an attention sensing layer with residual connections, and the attention sensing layer is connected after the spatial sensing layer. After learning by the adaptive learning module, that is, executing the aforementioned step C2, 3 weight coefficients can be obtained, which correspond to the third input features of the three scales one by one. Through the weighting operation, that is, executing the aforementioned step C3, the weighted third splicing feature can be obtained; finally, the weighted input features corresponding to the three third input features are extracted from the weighted third splicing feature through a 3×3 convolution operation with a stride of 2.

[0108] In this embodiment, on the one hand, the electronic device learns the weight coefficients corresponding to the scale features through the adaptive learning module, which can effectively balance the relationship between the shallow image texture features and the deep image semantic features, thereby improving the feature extraction ability of RDNet at different scales. On the other hand, by learning the correlation between different features, the problem of internal inconsistency of the feature pyramid can be better solved, thereby enhancing RDNet's ability to understand and utilize features of different scales.

[0109] In some embodiments, when the hardware of the electronic device running RDNet is: the processor is Intel(R) Xeon(R) Platinum 8255C CPU, 314 G memory, the graphics card is NVIDIA Tesla V100 32 G, CentOS 8.5.2 64-bit operating system, RDNet is built on the pytorch deep learning framework, and the compiler is pycharm.

[0110] The same dataset is fed into the optimal RDNet and YOLOv5 models respectively. The detection performance of the two models for different road damage categories can be found in Fig.10 .from Fig.10 It can be seen that compared with YOLOv5, RDNet has the following advantages:

[0111] (1) Compared with YOLOv5, RDNet’s precision decreased by 0.9%, its recall R increased by 2.3%, and its mAP increased by 1.3%. Obviously, RDNet can significantly improve the recognition and detection accuracy of road damage.

[0112] (2) YOLOv5 has low recognition accuracy for the four categories of transverse cracks, transverse crack patches, network cracks, and network crack patches, which are difficult to identify road damage categories. RDNet has improved mAP by 0.3%, 2.4%, 4.3%, and 3.8% on these four road damage categories, respectively. It can be seen that the two categories of transverse crack patches, network cracks, and network crack patches have been greatly improved.

[0113] (3) Compared with the YOLOv5s network, the RDNet network can improve the accuracy of road damage detection with complex shapes and effectively improve the scale unification problem.

[0114] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0115] Corresponding to the road damage detection method based on RDNet in the above embodiment, Fig.11 A structural block diagram of a road defect detection device 11 based on RDNet provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0116] Reference Fig.11 , the road disease detection device 11 based on RDNet includes:

[0117] The feature extraction module 110 is used to extract features from the image to be detected based on the pre-trained RDNet backbone network to obtain image features; the image to be detected at least includes roads;

[0118] A feature fusion module 111 is used to fuse image features based on the neck network of RDNet to obtain fused features;

[0119] A detection module 112 is used to detect the fused features based on the RDNet detection network to obtain a road disease detection result based on the RDNet in the image to be detected;

[0120] Among them, RDNet is a YOLOv5 in which the C3 blocks in the backbone network and / or the neck network are replaced with cross-stage multi-branch convolution blocks, which are based on the cross-stage local network and multi-branch convolution network settings.

[0121] Optionally, the feature extraction module 110 and / or the feature fusion module 111 may be used to:

[0122] For any first input feature of the input cross-stage multi-branch convolutional block:

[0123] Performing a preset convolution operation on the first input feature to obtain a first convolution result;

[0124] Performing a preset convolution operation on the first convolution result to obtain a second convolution result;

[0125] Perform feature splicing on the first input feature, the first convolution result, and the second convolution result to obtain a first splicing feature;

[0126] Adjusting the number of channels of the first concatenated feature based on the number of channels of the first input feature;

[0127] Performing a preset convolution operation on the first concatenated feature after adjusting the number of channels to obtain a third convolution result;

[0128] Performing a preset convolution operation on the third convolution result to obtain a fourth convolution result;

[0129] Perform a feature splicing operation on the first input feature, the first convolution result, the first splicing feature after adjusting the number of channels, the third convolution result, and the fourth convolution result to obtain a second splicing feature;

[0130] Adjusting the number of channels of the second concatenated feature based on the number of channels of the first input feature;

[0131] The second concatenated features after adjusting the number of channels are subjected to feature fusion to obtain output features corresponding to the first input features.

[0132] Optionally, the spatial pyramid pooling block in the backbone network is replaced by a residual parallel dilated convolution block, and the residual parallel dilated convolution block includes at least two dilated convolution layers with different dilation rates.

[0133] Optionally, the feature extraction module 110 may further include:

[0134] The second input feature of the input residual parallel dilated convolution block:

[0135] Based on different expansion rates, a dilated convolution operation is performed on the second input feature after adjusting the number of channels to obtain various dilated convolution results;

[0136] The global average pooling operation and the scale adjustment operation are sequentially performed on the second input feature after the number of channels is adjusted to obtain a global average pooling result; the scale of the global average pooling result is the same as the scale of each dilated convolution result;

[0137] Perform feature splicing operation on the global average pooling result and each dilated convolution result to obtain the initial multi-scale features;

[0138] The initial multi-scale features are fused with the second input features after adjusting the number of channels to obtain the target multi-scale features.

[0139] Optionally, the backbone network and the neck network are connected via an adaptive scale spatial attention block, which includes a spatial sensing layer and an attention sensing layer based on residual connection.

[0140] Optionally, the detection device 11 further includes an adaptive learning module, which is used to:

[0141] For each third input feature at each scale of the input adaptive scale space attention block:

[0142] Perform a feature concatenation operation on each third input feature based on the maximum scale to obtain a third concatenated feature;

[0143] The third concatenated feature is input into the serially connected spatial sensing layer and attention sensing layer for adaptive learning to obtain target weight coefficients corresponding to different scales;

[0144] Performing a feature weighting operation on the third splicing feature based on each target weight coefficient to obtain a weighted third splicing feature;

[0145] A convolution operation is performed on the weighted third concatenated features to obtain weighted third input features corresponding to the third input features.

[0146] Optionally, RDNet is trained based on a regression loss function, a confidence loss function, and a classification loss function; the classification loss function is:

[0147]

[0148]

[0149] in, L cls is the classification loss function, t is a hyperparameter, C is the number of road hazard categories, r c Road damage category c The ratio of the number of annotation boxes to all annotation boxes; L BCE is the binary cross entropy loss, n is the number of image samples of all road diseases, y i For the i The true category of the image samples, is the predicted category of the i-th image sample.

[0150] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0151] Fig.12 This is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present application. Fig.12 As shown, the electronic device 12 of this embodiment includes: at least one processor 120 ( Fig.12 Only one processor is shown in the figure), a memory 121, and a computer program 122 stored in the memory 121 and executable on at least one processor 120. When the processor 120 executes the computer program 122, the steps in any of the above-mentioned road disease detection method embodiments based on RDNet are implemented, for example Figure 1 Steps 110-130 are shown.

[0152] The processor 120 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0153] In some embodiments, the memory 121 may be an internal storage unit of the electronic device 12, such as a hard disk or memory of the electronic device 12. In other embodiments, the memory 121 may also be an external storage device of the electronic device 12, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 12.

[0154] Furthermore, the memory 121 may also include both an internal storage unit of the electronic device 12 and an external storage device. The memory 121 is used to store operating devices, applications, boot loaders, data, and other programs, such as program codes of computer programs, etc. The memory 121 may also be used to temporarily store data that has been output or is to be output.

[0155] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the above-mentioned device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0156] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0157] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0158] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The above-mentioned computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the above-mentioned computer program includes computer program code, and the above-mentioned computer program code can be in source code form, object code form, executable file or some intermediate form. The above-mentioned computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.

[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0160] 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 herein 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.

[0161] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the above modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0162] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0163] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A road damage detection method based on RDNet, It is characterized in that include: Based on the pre-trained RDNet backbone network, feature extraction is performed on the image to be detected to obtain image features; The image to be detected at least includes a road; The image features are fused based on the neck network of the RDNet to obtain fused features; Detecting the fused features based on the RDNet detection network to obtain a road damage detection result based on RDNet in the image to be detected; Wherein, the RDNet is a YOLOv5 in which the C3 block in the backbone network and / or the neck network is replaced with a cross-stage multi-branch convolution block, and the cross-stage multi-branch convolution block is based on a cross-stage local network and a multi-branch convolution network setting; For any first input feature of the cross-stage multi-branch convolutional block: Performing a 3×3 convolution operation on the first input feature to obtain a first convolution result; Performing the 3×3 convolution operation on the first convolution result to obtain a second convolution result; Perform feature splicing on the first input feature, the first convolution result, and the second convolution result to obtain a first splicing feature; Adjusting the number of channels of the first stitching feature based on the number of channels of the first input feature; Performing the 3×3 convolution operation on the first concatenated feature after adjusting the number of channels to obtain a third convolution result; Performing the 3×3 convolution operation on the third convolution result to obtain a fourth convolution result; Perform a feature splicing operation on the first input feature, the first convolution result, the first splicing feature after adjusting the number of channels, the third convolution result, and the fourth convolution result to obtain a second splicing feature; Adjusting the number of channels of the second stitching feature based on the number of channels of the first input feature; The second concatenated features after the number of channels is adjusted are subjected to feature fusion to obtain output features corresponding to the first input features.

2. The road damage detection method according to claim 1, It is characterized in that The spatial pyramid pooling block in the backbone network is replaced by a residual parallel dilated convolution block, and the residual parallel dilated convolution block includes at least two dilated convolution layers with different dilation rates.

3. The road damage detection method according to claim 2, It is characterized in that For the second input feature of the residual parallel dilated convolution block: Performing dilated convolution operations on the second input features after adjusting the number of channels based on different dilation rates to obtain dilated convolution results; Performing a global average pooling operation and a scale adjustment operation on the second input feature after adjusting the number of channels in sequence to obtain a global average pooling result; the scale of the global average pooling result is the same as the scale of each of the dilated convolution results; Performing a feature splicing operation on the global average pooling result and each of the dilated convolution results to obtain an initial multi-scale feature; The initial multi-scale feature is fused with the second input feature after adjusting the number of channels to obtain a target multi-scale feature.

4. The road damage detection method according to claim 1, It is characterized in that The backbone network and the neck network are connected through an adaptive scale-space attention block, which includes a spatial sensing layer and an attention sensing layer based on residual connection.

5. The road damage detection method according to claim 4, It is characterized in that For each third input feature at each scale input into the adaptive scale space attention block: Perform a feature concatenation operation on each of the third input features based on the maximum scale to obtain a third concatenated feature; Inputting the third splicing feature into the spatial sensing layer and the attention sensing layer connected in series for adaptive learning to obtain target weight coefficients corresponding to different scales; Performing a feature weighting operation on the third splicing feature based on each of the target weight coefficients to obtain a weighted third splicing feature; A convolution operation is performed on the weighted third concatenated features to obtain weighted third input features corresponding to the third input features.

6. The road damage detection method according to any one of claims 1 to 5, It is characterized in that The RDNet is trained based on the regression loss function, the confidence loss function and the classification loss function; the classification loss function is: Among them, the L cls is the classification loss function, t is a hyperparameter, C is the number of road disease categories, r c Road damage category c The ratio of the number of marked boxes to all marked boxes; L BCE is the binary cross entropy loss, n is the number of image samples of all road diseases, y i For the i The true category of the image samples, is the predicted category of the i-th image sample.

7. A road disease detection device based on RDNet, It is characterized in that include: The feature extraction module is used to extract features of the image to be detected based on the pre-trained RDNet backbone network to obtain image features; The image to be detected at least includes a road; A feature fusion module, used for fusing the image features based on the neck network of the RDNet to obtain fused features; A detection module, used to detect the fused features based on the RDNet detection network, and obtain a road disease detection result based on RDNet in the image to be detected; Wherein, the RDNet is a YOLOv5 in which the C3 block in the backbone network and / or the neck network is replaced with a cross-stage multi-branch convolution block, and the cross-stage multi-branch convolution block is based on a cross-stage local network and a multi-branch convolution network setting; Wherein, the feature extraction module and / or the feature fusion module can be used for: For any first input feature of the cross-stage multi-branch convolutional block: Performing a 3×3 convolution operation on the first input feature to obtain a first convolution result; Performing the 3×3 convolution operation on the first convolution result to obtain a second convolution result; Perform feature splicing on the first input feature, the first convolution result, and the second convolution result to obtain a first splicing feature; Adjusting the number of channels of the first stitching feature based on the number of channels of the first input feature; Performing the 3×3 convolution operation on the first concatenated feature after adjusting the number of channels to obtain a third convolution result; Performing the 3×3 convolution operation on the third convolution result to obtain a fourth convolution result; Perform a feature splicing operation on the first input feature, the first convolution result, the first splicing feature after adjusting the number of channels, the third convolution result, and the fourth convolution result to obtain a second splicing feature; Adjusting the number of channels of the second stitching feature based on the number of channels of the first input feature; The second concatenated features after the number of channels is adjusted are subjected to feature fusion to obtain output features corresponding to the first input features.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the road damage detection method based on RDNet as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the RDNet-based road damage detection method according to any one of claims 1 to 6 is implemented.