Lightweight real-time road disease detection algorithm
By improving the YOLOv5 algorithm model, the C3GhostV2 module was constructed, the CARAFE operator, EMA attention mechanism and Focal-EIoU loss function were introduced, and the existing algorithms were solved in real-time and feature information loss in road surface disease detection, achieving real-time detection effects with high accuracy and low complexity.
Patent Information
- Application Number
- CN202411886332.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-25
AI Technical Summary
The existing two-stage object detection algorithms such as Faster R-CNN and single-stage object detection algorithms such as YOLOv5 are difficult to meet real-time requirements in road surface disease detection, and the upsampling method of YOLOv5 is likely to lead to the loss of road surface disease characteristic information, resulting in poor detection performance for small target diseases.
By improving the YOLOv5 algorithm model, the C3GhostV2 module is built to replace the C3 module in the backbone network, the CARAFE operator is introduced to replace the nearest neighbor interpolation in the Neck network structure, the EMA attention mechanism is introduced, and the Focal-EIoU loss function is introduced to improve detection performance.
A lightweight real-time road disease detection algorithm is implemented, with high detection accuracy and low computational complexity, and is suitable for real-time road disease detection tasks.
Smart Images

Figure CN119888440A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of disease detection, and in particular to a lightweight real-time road disease detection algorithm. Background Art
[0002] The detection of road conditions is crucial for the maintenance and repair of highways. If road defects are not dealt with in a timely manner, it will not only reduce driving comfort and safety, but may also shorten the service life of the road. At present, road defect detection methods based on deep learning have been widely used. Compared with traditional methods, they can more accurately identify various types of road defects and have stronger generalization capabilities. Deep learning algorithms can automatically learn and extract features without human intervention, greatly simplifying the task workflow, including single-stage (such as YOLO, SSD) and dual-stage (such as R-CNN series) target detection algorithms.
[0003] Since the pavement disease detection task has high requirements for accuracy, real-time performance and algorithm model generalization ability, the detection algorithm needs to have both high accuracy and low time complexity and space complexity. The current two-stage target detection algorithms such as Faster R-CNN have large model parameters and large model calculations, making it difficult to meet real-time requirements. In order to ensure high accuracy, single-stage target detection algorithms such as YOLOv5 are also relatively complex in their algorithm models. The current YOLO series algorithms all use nearest neighbor interpolation upsampling (Upsample) in the upsampling stage. This upsampling method easily causes the loss of pavement disease feature information, resulting in poor detection performance of YOLOv5 for small target diseases. Summary of the invention
[0004] The purpose of the present invention is to provide a lightweight real-time road defect detection algorithm, which has a high degree of lightweight, high detection accuracy, and is more suitable for real-time road defect detection tasks.
[0005] The purpose of the present invention is achieved through the following technical solutions:
[0006] A lightweight real-time road damage detection algorithm, including the following improvements to the YOLOv5 algorithm model:
[0007] S1. Build the C3GhostV2 module to replace the C3 module in the backbone network, so that the algorithm model generates an attention feature map with a global receptive field in the fully connected layer;
[0008] S2. Introduce the CARAFE operator to replace the neighbor interpolation in the Neck network structure, reduce the loss of pavement disease feature information in upsampling, and improve the network feature fusion performance;
[0009] S3, after introducing the EMA attention mechanism and adding it to the C3GhostV2 module in the Neck network, the global information is encoded to reduce the loss of channel feature information and computational overhead;
[0010] S4. Introduce the Focal-EIoU loss function to replace the CIoU loss function, focus on high-quality bounding boxes, and accelerate model convergence.
[0011] Furthermore, the C3GhostV2 module is constructed by combining the C3 module with the GhostV2 module. The bottleneck part of the C3 module is replaced by n Ghostv2 bottleneck modules. The basic feature map is generated by ordinary convolution. Features are extracted from the bottleneck structure after batch normalization and SiLU activation function, and then concatenated with the feature map obtained by ordinary convolution. Subsequently, the number of channels is adjusted through ordinary convolution to obtain the output feature map.
[0012] Furthermore, the CARAFE operator consists of a kernel prediction module and a content-aware repackaging module;
[0013] The kernel prediction module uses channel compression to reduce the number of input channels of the feature map, and then uses the encoding module to take the compressed feature map as input and encode its content to generate a recombinant kernel, and finally generates weights through Softmax normalization;
[0014] The content-aware repackaging module rearranges the generated features into spatial blocks to achieve feature upsampling.
[0015] Furthermore, the calculation process of the CARAFE operator is as follows:
[0016] The upsampling multiple is δ, and the input dimension is C×H×W feature map X. After CARAFE processing, the upsampled feature map X′ with the dimension of C×δH×δW is obtained. The original position of any target position l′=(x′+y′) in the feature map X′ is l=(x+y), where x=[x′ / δ], y=[y′ / δ]. l , K) is defined as the k×k subregion of the feature map X centered at position ι, the kernel prediction module According to X l A location kernel W is predicted for each location l′ in the sub-region l′ , as shown in formula (1):
[0017]
[0018] Content-Aware Reload Module X l The neighborhood and W l′ Through weighted combination, the spatial relationship between feature points and the semantic information in the feature map are obtained to generate accurate upsampling results, as shown in formula (2):
[0019]
[0020] In the formula, K encoder is the kernel size of the convolutional layer, K up is the kernel size of the upsampling layer.
[0021] Furthermore, the EMA attention mechanism divides the input feature map into G sub-feature maps in the channel dimension, and extracts the attention weights of each grouped feature map through three parallel paths, rearranges the G groups of features and integrates them into the batch dimension, reconstructs the input tensor, and then encodes the global spatial information in the output through two-dimensional global average pooling, where the two-dimensional global average pooling operation formula is shown in formula (3):
[0022]
[0023] In the formula, Z c represents the output value of the Cth channel after two-dimensional global average pooling, H and W are the spatial dimensions of the input features, C is the number of channels, and X c (i, j) represents the input of the Cth channel with width i and height j. Finally, the nonlinear activation function Softmax is applied to the output of the two-dimensional global average pooling, and the two obtained spatial attention weight values are fused through the Sigmoid function to obtain each set of output feature maps.
[0024] Furthermore, the Focal-EIoU loss function is shown in formula (4):
[0025] L Focal-EIOU =IOUγL EIOU (4)
[0026] In the formula, the adjustment factor γ = 0.5, IoU is the ratio of the intersection area of the predicted box and the true box to the area of the merged area;
[0027] Among them, the EIoU loss function is shown in formula (5):
[0028]
[0029] In the formula, ρ 2 (b,b gt ) is the center point b of the predicted box and the center point b of the real box gt The square of the Euclidean distance between 2 is the square of the minimum diagonal length of the bounding box between the predicted box and the real box, ρ 2 (w,w gt ) is the predicted box width w and the real box w gt The square of the Euclidean distance between is the normalized parameter of the width difference between the predicted box and the real box; ρ 2 (h,h gt ) is the predicted box height h and the real box height h gt The square of the Euclidean distance between them; It is the normalized parameter of the height difference between the predicted box and the true box.
[0030] The present invention has the following advantages: the algorithm of the present application is highly lightweight and has a high detection accuracy, and is more suitable for real-time road disease detection tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 Schematic diagram of the algorithm model of the present invention.
[0032] Figure 2 Schematic diagram of the structure of the Ghostv2 bottleneck module.
[0033] Figure 3 This is a schematic diagram of the structure of the C3GhostV2 module.
[0034] Figure 4 Schematic diagram of the structure of the CARAFE operator.
[0035] Figure 5 Schematic diagram of the structure of the EMA attention mechanism.
[0036] Figure 6 This is a comparison diagram of the detection structure of the algorithm of the present invention and the existing YOLO series algorithms. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0038] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0039] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0040] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0041] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, or the positions or positional relationships in which the product of the invention is usually placed when in use, or the positions or positional relationships commonly understood by those skilled in the art, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0042] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0043] refer to Figure 1-5 As shown, one embodiment of the present invention is:
[0044] A lightweight real-time road damage detection algorithm, including the following improvements to the YOLOv5 algorithm model:
[0045] S1. Build the C3GhostV2 module to replace the C3 module in the backbone network, so that the algorithm model generates an attention feature map with a global receptive field in the fully connected layer.
[0046] Specifically, the C3GhostV2 module is constructed by combining the C3 module and the GhostV2 module. The bottleneck part of the C3 module is replaced by n Ghostv2 bottleneck modules. The basic feature map is generated by ordinary convolution. Features are extracted from the bottleneck structure after batch normalization and SiLU activation function, and then concatenated with the feature map obtained by ordinary convolution. Then, the number of channels is adjusted through ordinary convolution to obtain the output feature map.
[0047] Specifically, in order to obtain more comprehensive information, traditional convolutional networks will generate a large number of similar feature maps, which leads to problems such as a large number of parameters and long calculation time. In order to make the model lightweight, the Ghostv2 module is introduced into the network structure. This module is built on the basis of Ghost convolution and combined with the decoupled fully connected (DFC) attention mechanism. It has the ability to dynamically calibrate and capture long-distance spatial information, which can greatly reduce the number of model parameters and the amount of calculation without losing detection accuracy. The bottleneck of Ghostv2 lies in its ability to dynamically calibrate and capture long-distance spatial information, which can greatly reduce the number of model parameters and the amount of calculation without losing detection accuracy. Figure 2 As shown in Figure 1, when the step size is equal to 1, the input features are first enhanced by Ghostv2 convolution, and then the number of channels is adjusted by Ghost convolution to obtain the output features. When the step size is equal to 2, the input features are first enhanced by Ghostv2 convolution, and then the number of channels is adjusted by Ghost convolution to obtain the output features.
[0048] In order to make the backbone network more lightweight while ensuring good feature extraction capabilities, this embodiment combines the C3 module with the GhostV2 module to construct a C3GhostV2 module. Figure 3 As shown in the figure, C3Ghostv2 replaces the bottleneck part of the C3 module with n Ghostv2 bottleneck modules. First, the basic feature map is generated by ordinary convolution, and then the features are extracted from the bottleneck structure through batch normalization (BN) and SiLU activation function, and then concatenated with the feature map obtained by ordinary convolution. Finally, the number of channels is adjusted through ordinary convolution to obtain the output feature map. The improved Backbone structure is lighter and has lower computational complexity.
[0049] After the introduction of the C3GhostV2 module, it can dynamically calibrate and capture long-distance spatial information, greatly reducing the parameters of the model without losing detection accuracy; at the same time, it also reduces the computational complexity of the model, making the entire model more lightweight, which is conducive to improving the detection speed; the algorithm model generates an attention feature map with a global receptive field in the fully connected layer, thereby aggregating local information and global feature dependency information at the same time, enhancing the expressiveness of the model, and achieving a better balance between accuracy and speed.
[0050] The CBS module in the backbone network consists of a convolutional layer (Conv), a batch normalization layer (BN), and an activation function layer (SiLU), which are used to extract features. By stacking multiple CBS modules, the model can gradually extract more abstract and advanced feature representations.
[0051] S2. Introduce the CARAFE operator to replace the nearest neighbor interpolation in the Neck network structure, reduce the loss of pavement disease feature information in upsampling, and improve the network feature fusion performance. The CARAFE operator is used to avoid over-simplification or loss of feature information, thereby enhancing the expressiveness of the output feature map and effectively retaining more feature information, especially for the case of large background noise in pavement disease images;
[0052] Specifically, feature upsampling is a key operation in the modern convolutional neural network architecture, and its design is crucial for target detection tasks. The existing YOLOv5 uses the nearest neighbor interpolation (Upsample) in the process of extracting features. This upsampling method easily causes the loss of road disease feature information, resulting in poor detection performance of YOLOv5 for small target diseases. Therefore, this embodiment uses the CARAFE operator to replace the nearest neighbor interpolation in the Neck network structure, such as Figure 4 As shown in Figure 1, the CARAFE operator consists of a kernel prediction module and a content-aware reassembly module. In the kernel prediction module, channel compression is used to reduce the number of input channels of the feature map. Then, the content encoding module takes the compressed feature map as input and encodes its content to generate a reorganized kernel. Finally, the weights are generated through Softmax normalization. In the content-aware reassembly module, feature upsampling is achieved by rearranging the generated features into spatial blocks.
[0053] By adapting the size and position of different feature blocks through prediction kernels, features from different scales and positions can be better integrated. This helps the model to more accurately identify and locate pavement damage areas. By improving the feature fusion method, the CARAFE operator helps the model to better understand the contextual information of the image, thereby improving the detection accuracy and recall rate in the pavement damage detection task. Although the introduction of the CARAFE module may increase the computational complexity to a certain extent, overall it can achieve the goal of optimizing computing resources while maintaining or improving detection performance by more efficiently processing feature maps.
[0054] The specific calculation process is as follows: set the upsampling multiple to δ, input the feature map X with a dimension of C×H×W, and after CARAFE processing, obtain the upsampled feature map x′ with a dimension of C×δH×δW. For any target position l′=(x′+y′) of the feature map X′, the corresponding original position l=(x+y) can be found in the feature map X, where x=[x′ / δ], y=[y′ / δ]. l , K) is defined as the k×k subregion of the feature map X centered at position l. First, the kernel prediction module Will be based on Xl A location kernel W is predicted for each location l′ in the sub-region l′ , as shown in formula (1):
[0055]
[0056] Then, the content-aware reloading module X l The neighborhood and W l′ Through weighted combination, the spatial relationship between feature points and the semantic information in the feature map are obtained to generate a more accurate upsampling result, as shown in formula (2):
[0057]
[0058] In the formula, K encoder is the kernel size of the convolutional layer, K up is the kernel size of the upsampling layer. Formula (1) is obtained through the kernel prediction module The position kernel W of each l′ position is predicted l′ , Formula (2) uses the content-aware repackaging module X l The domain and position kernel W l′ This embodiment uses the CARAFE operator in the feature fusion layer to enable the algorithm to obtain more image information, improve the neighborhood interpolation method, sample image samples with a single convolution kernel, and obtain an automatic adaptive image sample sampling method, so that the algorithm can focus more on the recognition of small target road surface diseases.
[0059] S3, after introducing the EMA attention mechanism and adding it to the C3GhostV2 module in the Neck network, the global information is encoded to reduce the loss of channel feature information and computational overhead;
[0060] Specifically, in the process of pavement disease detection, due to partial occlusion between cracks and changes in ambient light, it is easy to miss detection; in addition, there are certain feature similarities between different types of defect features and between defects and surrounding objects, which can easily cause false detection. Therefore, this embodiment uses the construction of the EMA attention mechanism to effectively integrate cross-spatial information and multi-scale features, further enhance the generalization ability of the model, and enable the model to adapt more flexibly to complex and changing environments. In order to improve the model's ability to detect pavement diseases, it is added to the C3 module in the Neck network of YOLOv5. Figure 1 , as shown in 5,
[0061] The EMA attention mechanism divides the input feature map into G sub-feature maps in the channel dimension to learn different semantic information. At the same time, the attention weights of each grouped feature map are extracted through three parallel paths. The specific operations are as follows: XAvg Pool performs average pooling in the horizontal direction, Y Avg Pool performs average pooling in the vertical direction, Sigmoid is used as the activation function, and Softmax is used as the normalized exponential function; in the two 1×1 branches, the channels in the two spatial directions are encoded by one-dimensional global average pooling respectively; and in the 3×3 branch, multi-scale features are captured by stacking only one 3×3 convolution kernel. Then these G groups of features are rearranged and integrated into the batch processing dimension to reconstruct the input tensor. On the one hand, the two encoded features are spliced along the height direction of the image and processed by a shared 1×1 convolution. The processed output is decomposed into two vectors, and two Sigmoid nonlinear functions are used to simulate the two-dimensional binomial distribution of linear convolution; on the other hand, the 3×3 branch captures local cross-channel interactions through 3×3 convolution to expand the feature space. Then, the global spatial information is encoded in the output of the 1×1 and 3×3 branches through two-dimensional global average pooling. The two-dimensional global average pooling operation formula is shown in formula (3):
[0062]
[0063] In the formula, Z c represents the output value of the Cth channel after two-dimensional global average pooling, H and W are the spatial dimensions of the input features, C is the number of channels, and X c (i, j) represents the input of the Cth channel with width i and height j. Finally, the nonlinear activation function Softmax is applied to the output of the two-dimensional global average pooling. Finally, the two obtained spatial attention weight values are fused through the Sigmoid function to obtain each set of output feature maps.
[0064] S4. Introduce the Focal-EIoU loss function to replace the CIoU loss function, focus on high-quality bounding boxes, and accelerate model convergence.
[0065] Specifically, pavement disease datasets usually have a large number of samples that are difficult to distinguish or detect. These samples often contribute most of the gradients, thus limiting the learning and optimization of the model on key, high-quality samples. The loss function of the original YOLOv5 consists of three parts, namely, bounding box regression loss, target confidence loss, and category loss. Among them, the bounding box regression loss uses the complete intersection-over-union (CloU) loss function, as shown in the following formula:
[0066]
[0067] Where: IoU is the ratio of the intersection area of the predicted box and the real box to the area of the merged area. The calculation formula is as follows:
[0068]
[0069] ρ 2 (b,b gt ) represents the square of the Euclidean distance between the center points of the predicted box and the true box, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the true box. α is the weight function, and the calculation formula is as follows:
[0070]
[0071] v is used to measure the similarity of aspect ratios, and the formula is as follows:
[0072]
[0073] where w, h and w gt 、h gt Represent the height and width of the predicted box and the height and width of the real box respectively. Although the CIoU loss function takes into account the overlapping area, center point distance and aspect ratio of the bounding box regression, the aspect ratio defines a relative value and does not involve the problem of sample difficulty imbalance, while the difficult and easy samples in the road damage dataset are extremely unbalanced. Therefore, this embodiment selects the focal enhanced intersection-over-union (Focal-EIoU) loss function. EIoU calculates the difference in width and height on the basis of CIoU to replace the aspect ratio, and introduces Focal Loss to solve the problem of imbalance in difficult and easy samples in the road damage dataset. Inspired by the Focal loss function's handling of the foreground and background imbalance problem in single-stage target detection, most of the current loss functions ignore the imbalance problem of the bounding box, that is, many low-quality samples contribute most of the gradients, thereby limiting the regression of the bounding box. Therefore, it is necessary to increase the weight of high-quality samples and suppress the weight of low-quality samples to solve the problem of difficulty imbalance of samples in the pavement disease dataset.
[0074] The Focal-EIoU loss function is shown in formula (4):
[0075]
[0076] In the formula, the adjustment factor γ = 0.5 is used to adjust the focal length of the loss function and control the degree of attention to samples of different qualities. IoU is the ratio of the intersection area of the predicted box and the true box to the area of the merged area.
[0077] Among them, the EIoU loss function is shown in formula (5):
[0078]
[0079] In the formula, ρ 2 (b,b gt ) is the center point b of the predicted box and the center point b of the real box gt The square of the Euclidean distance between 2 is the square of the minimum diagonal length of the bounding box between the predicted box and the real box, ρ 2 (w,w gt ) is the predicted box width w and the real box w gt The square of the Euclidean distance between is the normalized parameter of the width difference between the predicted box and the real box; ρ 2 (h,h gt ) is the predicted box height h and the real box height h gt The square of the Euclidean distance between them; It is the normalized parameter of the height difference between the predicted box and the true box.
[0080] The loss function includes: overlap loss, center distance loss, and width and height loss. The first two parts continue the method in CIoU Loss, but the width and height loss directly minimizes the difference between the width and height of the target and the anchor, making the convergence speed faster and effectively improving the accuracy of the regression box.
[0081] The Focal-EIoU loss function modifies the width-height loss based on the original complete intersection-over-union (CIoU) loss function, directly calculating the difference between the width and height of the target bounding box and the anchor box, rather than using the relative aspect ratio like CIoU. This modification makes the loss function more focused on improving the detection accuracy of high-quality samples while suppressing the negative impact of low-quality samples on model training. By introducing the parameter γ to adjust the focal distance of the loss function, the model's attention to samples of different qualities can be controlled, thereby optimizing the model's bounding box regression performance and improving the accuracy and efficiency of pavement disease detection.
[0082] The GCE-YOLO algorithm model proposed in this embodiment by combining the above four points is more suitable for real-time road disease detection tasks, has a high degree of lightweight and high detection accuracy.
[0083] The algorithm model of this embodiment is compared with the existing YOLO series algorithms (YOLOv5s, YOLOv7tiny, YOLOv8s, YOLOv9s, and YOLOv10s) in road damage detection. Training and testing are performed in the same experimental environment and the same data set (RDD2022) to compare the performance of different models. The detection results of each algorithm are shown in Figure 2. Figure 6As shown in the figure, it can be seen that in an environment with multiple road damage features, the six algorithms can detect road damage. YOLOv5s and YOLOv7tiny have low confidence in detecting Transverse Crack (transverse cracks), YOLOv9s has false detections, YOLOv10s has missed detections, YOLOv8s and GCE-YOLO have detected all targets, but the confidence of GCE-YOLO's detection results is generally higher than that of YOLOv8s, and the lightweight degree is high enough.
[0084] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A lightweight real-time road damage detection algorithm, characterized by: Including the following improvements to the YOLOv5 algorithm model: S1. Build the C3GhostV2 module to replace the C3 module in the backbone network, so that the algorithm model generates an attention feature map with a global receptive field in the fully connected layer; S2. Introduce the CARAFE operator to replace the neighbor interpolation in the Neck network structure, reduce the loss of pavement disease feature information in upsampling, and improve the network feature fusion performance; S3, after introducing the EMA attention mechanism and adding it to the C3GhostV2 module in the Neck network, the global information is encoded to reduce the loss of channel feature information and computational overhead; S4. Introduce the Focal-EIoU loss function to replace the CIoU loss function, focus on high-quality bounding boxes, and accelerate model convergence.
2. A lightweight real-time road damage detection algorithm according to claim 1, characterized in that: The C3GhostV2 module is constructed by combining the C3 module with the GhostV2 module. The bottleneck part of the C3 module is replaced by n Ghostv2 bottleneck modules. A basic feature map is generated by ordinary convolution. Features are extracted from the bottleneck structure through batch normalization and SiLU activation function, and then spliced with the feature map obtained by ordinary convolution. Subsequently, the number of channels is adjusted through ordinary convolution to obtain the output feature map.
3. A lightweight real-time road damage detection algorithm according to claim 1, characterized in that: The CARAFE operator consists of a kernel prediction module and a content-aware reassembly module; The kernel prediction module uses channel compression to reduce the number of input channels of the feature map, and then uses the encoding module to take the compressed feature map as input and encode its content to generate a recombinant kernel, and finally generates a weight through Softmax normalization; The content-aware repackaging module rearranges the generated features into spatial blocks to achieve feature upsampling.
4. A lightweight real-time road damage detection algorithm according to claim 3, characterized in that: The calculation process of the CARAFE operator is as follows: The upsampling multiple is δ, and the input dimension is C×H×W feature map X. After CARAFE processing, the upsampled feature map X′ with the dimension of C×δH×δW is obtained. The original position of any target position l′=(x′+y′) in the feature map X′ is l=(x+y), where x=[x′ / δ], y=[y′ / δ]. l , K) is defined as the k×k subregion of the feature map X centered at position l, the kernel prediction module According to X l A location kernel W is predicted for each location l′ in the sub-region l′ , as shown in formula (1): Content-Aware Reload Module X l The neighborhood and W l′ Through weighted combination, the spatial relationship between feature points and the semantic information in the feature map are obtained to generate accurate upsampling results, as shown in formula (2): In the formula, K encoder is the kernel size of the convolutional layer, K up is the kernel size of the upsampling layer.
5. The lightweight real-time road damage detection algorithm according to claim 1, characterized in that: The EMA attention mechanism divides the input feature map into G sub-feature maps in the channel dimension, and extracts the attention weights of each grouped feature map through three parallel paths, rearranges the G groups of features and integrates them into the batch dimension, reconstructs the input tensor, and then encodes the global spatial information in the output through two-dimensional global average pooling, where the two-dimensional global average pooling operation formula is shown in formula (3): Where Zc represents the output value of the Cth channel after two-dimensional global average pooling, H and W are the spatial dimensions of the input features, C is the number of channels, and X c (i, j) represents the input of the Cth channel with width i and height j. Finally, the nonlinear activation function Softmax is applied to the output of the two-dimensional global average pooling, and the two obtained spatial attention weight values are fused through the Sigmoid function to obtain each set of output feature maps.
6. A lightweight real-time road damage detection algorithm according to claim 1, characterized in that: The Focal-EIoU loss function is shown in formula (4): L Focal-EIOU =IOU γ L EIOU (4) In the formula, the adjustment factor γ = 0.5, IoU is the ratio of the intersection area of the predicted box and the true box to the area of the merged area; Among them, the EIoU loss function is shown in formula (5): In the formula, ρ 2 (b,b gt ) is the center point b of the predicted box and the center point b of the real box gt The square of the Euclidean distance between 2 is the square of the minimum diagonal length of the bounding box between the predicted box and the real box, ρ 2 (w,w gt ) is the predicted box width w and the real box w gt The square of the Euclidean distance between is the normalized parameter of the width difference between the predicted box and the real box; ρ 2 (h,h gt ) is the predicted box height h and the real box height h gt The square of the Euclidean distance between them; It is the normalized parameter of the height difference between the predicted box and the true box.