Lightweight road damage detection method for long-tail distribution and small target disease

CN122736963APending Publication Date: 2026-09-11KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610687744.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-19
Publication Date
2026-09-11

AI Technical Summary

Technical Problem

[0005]针对现有技术的不足,本发明提供了面向长尾分布与小目标病害的轻量化道路病害检测方法,具备在小目标病害召回率、尾部类别平均精度和多类别检测稳定性方面均有所提升等优点,解决了上述技术问题

Benefits of technology

本发明通过可变形病害特征块补充几何自适应采样和边缘残差信息,使模型能够更稳定地响应裂缝弯折、坑槽边界和剥落轮廓;此外,通过BRS提高尾部类别图像在训练过程中的出现机会,通过CASLC提高尾部类别正样本在分类损失中的梯度贡献,从数据层和损失层协同缓解类别长尾偏置;最后,BRS和CASLC均属于训练阶段策略,不增加推理阶段分支,适合在道路巡检终端和边缘计算设备上部署,本发明在小目标病害召回率、尾部类别平均精度和多类别检测稳定性方面均有所提升,同时推理阶段参数量和计算量基本保持不变。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122736963A_ABST
    Figure CN122736963A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of road infrastructure intelligent inspection and computer vision detection, and discloses a lightweight road disease detection method for long-tail distribution and small target disease. The method supplements geometric adaptive sampling and edge residual information through deformable disease feature blocks, so that the model can more stably respond to crack bending, pit groove boundary and peeling contour. In addition, BRS improves the occurrence opportunity of tail category images in the training process, and CASLC improves the gradient contribution of tail category positive samples in the classification loss, thereby cooperatively relieving the long-tail bias of categories from the data layer and the loss layer. Finally, BRS and CASLC belong to training stage strategies, do not increase the inference stage branch, and are suitable for deployment on road inspection terminals and edge computing devices. The present application has improved small target disease recall rate, tail category average precision and multi-category detection stability, while the parameter quantity and calculation quantity of the inference stage remain basically unchanged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent inspection and computer vision detection technology for road infrastructure, specifically a lightweight road defect detection method for long-tailed and small-target defects. Background Technology

[0002] Road defect detection is a fundamental aspect of road maintenance and traffic safety. Defects such as cracks, potholes, network cracks, spalling, and repairs accumulate over long-term road service. If not identified and addressed promptly, they can reduce road performance and driving comfort, and may even lead to further structural damage. With the development of vehicle-mounted data acquisition equipment, mobile terminals, and edge computing platforms, automated road defect detection based on visual perception has become an important technological direction for intelligent road maintenance.

[0003] Existing deep learning-based road defect detection methods face the following challenges: First, road defects are characterized by small scale, elongated shape, and weak texture. Continuous downsampling can easily weaken the fine-grained texture of small-scale cracks, the weak boundaries of spalling areas, and the irregular geometric contours of pothole edges. Second, existing lightweight detection networks often reduce computation by reducing the number of channels, convolutional layers, or using depthwise separable convolutions, but this can easily sacrifice shallow texture details and make them insensitive to small cracks and weak-boundary spalling. Third, existing deformable convolution methods usually directly replace the backbone convolution or the detection head convolution, which can easily increase computation and lacks gating constraints for weak boundaries and local texture differences in road defects. In addition, real road defect datasets usually exhibit a significant long-tail distribution, with the number of head class samples far exceeding the number of tail class samples. Conventional training processes are easily dominated by high-frequency classes and easily classified samples, resulting in insufficient recall of minority class defects and unstable classification boundaries.

[0004] Therefore, simply expanding the detection network size would significantly increase the deployment burden on road inspection terminals and edge devices; using only resampling or loss reweighting could easily lead to overfitting or loss scale fluctuations, making it difficult to simultaneously handle underexposed images and insufficient bounding box supervision. How to synergistically improve the detection stability of small-target defects, long-tailed defects, and irregular geometric defects from both the feature structure and training mechanism levels, while maintaining lightweight deployment characteristics, is a crucial technical problem that urgently needs to be solved in intelligent road defect inspection. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a lightweight road defect detection method for long-tailed and small-target defects, which has advantages such as improved recall rate for small-target defects, average accuracy of tail categories, and stability of multi-category detection, thus solving the aforementioned technical problems.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a lightweight road defect detection method for long-tailed and small-target defects, comprising the following steps: S1: Obtain road inspection images and their annotation files, count the image-level frequency and annotation box frequency of each category, and determine the tail category set based on the image-level frequency and annotation box frequency; S2: Construct the RDG-YOLO feature adaptation network; The RDG-YOLO feature adaptation network is a YOLO-like single-frame model, and when the RDG-YOLO feature adaptation network outputs shallow features, it processes the shallow features through deformable disease feature blocks. The deformable disease feature block is used for input shallow features Channel compression is performed, and local texture branch features, deformable sampling branch features, and edge auxiliary branch features are constructed separately. The deformable sampling features are then synthesized to obtain the deformable sampling features. S3: Construct an equalization resampling strategy based on the image-level frequency obtained in step S1 to obtain a multiset of reconstructed training images; S4: Construct a category-aware classification scaling mechanism based on the frequency of the bounding boxes obtained in step S1; S5: Use the results processed by steps S4 and S5 to train the RDG-YOLO feature adaptation network of S2 to obtain the RDG-LTDet model, and deploy the RDG-LTDet model on the edge computing device to output the disease category, confidence score and location box.

[0007] As a preferred technical solution of the present invention, step S1 includes the following steps: S1.1: Obtain road inspection images and their annotation files, wherein the road inspection image set is as follows: ; in, Indicates the first Image Represents the total number of images, for the th... Image Includes: a collection of record annotation boxes Category set and the actual category of each annotation box ; S1.2: Calculate the relative area of ​​each annotation box: in, Indicates the annotation box The relative area, Indicates the index of the annotation box. Indicates the annotation box width, Indicates the annotation box height, Representing an image width, Representing an image The height, and based on this, a small target indication quantity is generated. : In the formula, Indicates relative area. This indicates the quantity of small targets. This indicates the threshold for determining small targets. This indicates an indicator function that outputs 1 if a condition is met, and 0 otherwise. hour ,otherwise ; S1.3: Statistical analysis of image-level frequency and bounding box frequency: in, Indicates the disease category index. Indicates category Image-level frequency, Indicates category Frequency of annotation boxes Indicates the annotation box The true category, This represents summing over all training images. Indicates the image Summation of all annotation boxes within the box; S1.4: Determine the tail category set based on image-level frequency and bounding box frequency: in, Represents the set of tail categories. This represents the set of all disease categories. This represents the image-level tail determination threshold. This indicates the threshold for determining the tail of the annotation box. This represents the average image frequency across all categories. This represents the median frequency of images across all categories. This represents the maximum frequency scaling factor at the image level. Indicates image-level reference frequency. This represents the average frequency of all category bounding boxes. This represents the median frequency of all category bounding boxes. This represents the maximum frequency ratio coefficient at the annotation box level. This indicates the frequency of the maximum annotation box.

[0008] As a preferred technical solution of the present invention, the RDG-YOLO feature adaptation network of S2 includes a backbone network, a neck network, and a detection head. The backbone network includes multiple hierarchical aggregation expression units, multiple reparameterized cross-stage aggregation units, multiple lightweight downsampling units, deformable disease feature blocks, and spatial pyramid aggregation units. Three-scale features are generated through the backbone network and neck network. , Indicates shallow detail features. Indicates the characteristics of mid-layer fusion. It represents high-level semantic features.

[0009] As a preferred technical solution of the present invention, the specific output expression of the hierarchical aggregation expression unit is as follows: in, Indicates the first The aggregation characteristics of each stage Represents an aggregation mapping. Indicates the first Phase 1 The output characteristics of each branch Indicates the first Phase 1 The output characteristics of each branch Indicates the first Phase 1 The output characteristics of each branch Indicates the first The number of branches in each stage. This indicates that branches of the same type are arranged in order. This indicates the channel splicing operator.

[0010] As a preferred technical solution of the present invention, the calculation formula of the lightweight downsampling unit is expressed as follows: in, Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage Indicates the network stage index. Indicates lightweight downsampling mapping. This represents the average pooling operator. Indicates step size is Convolutional mapping, Indicates the channel splicing operator; The spatial pyramid aggregation unit is specifically SPPFLAN, and its specific expression is as follows: in, This indicates the channel splicing operator. Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage This represents the aggregated output features of the spatial pyramid. , , These represent window sizes of 1000 and 1000 respectively. , and max pooling operator, This represents the spatial pyramid fusion mapping.

[0011] As a preferred technical solution of the present invention, the deformable disease feature block provides input shallow features. Intermediate features are obtained after channel compression mapping. Based on intermediate features Local texture branch features, deformable sampling branch features, and edge-aided branch features are constructed respectively, with the following specific expressions: in, Represents local texture branch features. Represents a local depthwise convolution mapping. Indicates the sampling offset. This represents the offset prediction mapping. This represents the deformable sampling features before gating. This represents a deformable convolution operator. Indicates edge auxiliary branch features, Represents edge-assisted mapping, This represents the average pooling operator; Based on local texture branch features, deformable sampling branch features, and edge-assisted branch features, a difference-guided gating and recalibrated deformable sampling feature is constructed, with the specific expression as follows: in, Indicates the gating weight, This represents the Sigmoid activation function. Indicates gating mapping, Represents local texture branch features With edge auxiliary branch features The element-wise absolute difference between them This represents the deformable sampling features after recalibration. This represents element-wise multiplication. This indicates the output characteristics of a DDF-Block. This represents the learnable scaling factor. This indicates the channel splicing operator. This indicates a fusion mapping.

[0012] As a preferred technical solution of the present invention, the balanced resampling strategy specifically includes the following steps: S3.1: Calculate the reference frequency : in, Indicates the disease category index. Indicates category Image-level frequency, This represents the set of all disease categories. Indicates the maximum value; S3.2: Calculate the basic repeatability factor for each category: in, Indicates category The basic repeating factor, This indicates the maximum limit for repetition. Represents the stability constant. This represents the repetition intensity control factor. This indicates that the minimum value is a function; S3.3: Calculate the final repetition factor of the image: in, Representing an image The final repetition multiple, Indicates the maximum value. This represents the floor operator; S3.4: Reconstruct the training image list: in, This represents a multiple set of reconstructed training images. This indicates that multiple sets are appended based on the training image index. Representing an image Repeatedly append Second-rate.

[0013] As a preferred technical solution of the present invention, the category-aware classification scaling mechanism specifically includes the following steps: S4.1 Calculate the original inverse frequency weights: In the formula, Indicates category The original inverse frequency weights, This indicates the frequency of the highest number of bounding boxes across all categories. Represents the square root operator; S4.2 Calculate the weighted mean: in, This represents the original inverse frequency weighted mean. This indicates the total number of disease categories. Indicates a category summation index. To express summation, This represents the original inverse frequency weight of the j-th type of disease; S4.3 Perform normalization and truncation: in, This represents the truncated class weights. Indicates the upper limit of category weight. Describes the minimum value function; S4.4, Normalize again and generate classification scaling factors: in, This represents the class weights after renormalization. Indicates category The classification scaling factor, Indicates the supervision scaling intensity factor. This represents the category weight of the j-th type of disease.

[0014] As a preferred technical solution of the present invention, the S5 training process includes a total training loss, specifically expressed as: in, This represents the classification loss for positive samples after category-aware scaling. This represents the set of candidate positions for positive samples. Indicates the positive sample index. Indicates positive samples The corresponding real category, Represents the true category The corresponding classification scaling factor, This represents the binary cross-entropy loss function. Indicates positive samples Predicted as category The classification probability, Indicates total training loss. This represents the bounding box regression loss. Indicates the distribution focus loss. , and These represent the weight coefficients of the bounding box regression loss, classification loss, and distribution focus loss, respectively.

[0015] As a preferred technical solution of the present invention, the edge computing device in S5 deploys the RDG-LTDet model to output a candidate detection set: In the formula, Representing an image The candidate detection set, Indicates the candidate detection index. Indicates the number of candidate tests. and Indicates the first The center coordinates of each candidate box and Indicates the first The width and height of each candidate box. Indicates the first Confidence of each candidate box Indicates the first Each candidate box predicts the category; S5 also includes processing any two candidate boxes. and Calculate the intersection-union ratio: In the formula, Represents the intersection-union ratio function. and This represents two candidate boxes. and Indicates the candidate box index. This represents the intersection operation. This represents the union operation. Indicates the area of ​​the region.

[0016] Compared with existing technologies, this invention provides a lightweight road defect detection method for long-tailed and small-target defects, which has the following advantages: This invention supplements geometric adaptive sampling and edge residual information with deformable defect feature blocks, enabling the model to respond more stably to crack bending, pothole boundaries, and spalling contours. Furthermore, it increases the occurrence chance of tail-category images during training through BRS and enhances the gradient contribution of positive tail-category samples in the classification loss through CASLC, thus synergistically mitigating long-tail bias in the data and loss layers. Finally, both BRS and CASLC are training-stage strategies that do not add branches in the inference stage, making them suitable for deployment on road inspection terminals and edge computing devices. This invention improves recall rate for small-target defects, average precision of tail-category detection, and stability of multi-category detection, while maintaining a relatively constant number of parameters and computational cost in the inference stage. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the process of the present invention; Figure 2 This is a schematic diagram of the deformable defect feature block structure of the present invention; Figure 3 This is a schematic diagram of the long-tail optimization training strategy of the present invention; Figure 4 This is an overall structural diagram of the present invention; Figure 5 This is a comparison diagram of the backbone network of the model in this invention before and after improvement; Figure 6 This is a schematic diagram of the DDF-Block structure of the present invention. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Please see Figure 1 - Figure 6 A lightweight road defect detection method for long-tailed and small-target defects includes the following steps: S1: Establish a road defect sample set, including the following steps: S1.1: This invention first acquires road inspection images and their annotation files, and denotes the training image set as... For the first Image Record annotation box set Category set and the actual category of each annotation box , Indicates the total number of images; S1.2: Calculate the relative area of ​​each annotation box: in, Indicates the annotation box The relative area, Indicates the index of the annotation box. Indicates the annotation box width, Indicates the annotation box height, Representing an image width, Representing an image The height is determined, and a small target indicator is generated based on this. Small target samples are then defined according to their relative area: if the relative area is less than the small target determination threshold, the small target indicator = 1, which indicates that the target is a small target sample. In the formula, Indicates relative area. This indicates the quantity of small targets. This indicates the threshold for determining small targets. This indicates an indicator function that outputs 1 if a condition is met, and 0 otherwise. hour ,otherwise ; S1.3: Statistical analysis of image-level frequency and bounding box frequency: in, Indicates the disease category index. Indicates category Image-level frequency, Indicates category Frequency of annotation boxes Indicates the annotation box The true category, This represents summing over all training images. Indicates the image Sum all the annotation boxes inside. Used to describe categories The chance of appearing in training images, Used to describe categories At the level of bounding box supervision, the image The set of annotation boxes is ,image The set of disease categories that appear in the data is as follows ; S1.4: Determine the tail category set based on image-level frequency and bounding box frequency: In the formula, Represents the set of tail categories. This represents the set of all disease categories. This represents the image-level tail determination threshold. This indicates the threshold for determining the tail of the annotation box. This represents the average image frequency across all categories. This represents the median frequency of images across all categories. This represents the maximum frequency scaling factor at the image level. Indicates image-level reference frequency. This represents the average frequency of all category bounding boxes. This represents the median frequency of all category bounding boxes. This represents the maximum frequency ratio coefficient at the annotation box level. Indicates the frequency of the maximum annotation box; preferably, and The range of values ​​is to , Take the mean, median, or maximum image-level frequency. to times, Take the mean, median, or maximum frequency of the annotation boxes. to times; S2: Construct the RDG-YOLO feature adaptation network; The RDG-YOLO feature adaptation network of this invention specifically includes a backbone network, a neck network, and a detection head; Road inspection images Three-scale features are generated through the backbone network and neck network: In the formula, Indicates shallow detail features. Indicates the characteristics of mid-layer fusion. Represents high-level semantic features. This represents the mapping of main feature extraction. Indicates backbone network parameters, This represents the neck feature fusion mapping. Indicates the parameters of the neck network; The backbone network comprises multiple hierarchical aggregation expression units (ELAN1), multiple heavily parameterized cross-stage aggregation units (RepNCSPELAN4), multiple lightweight downsampling units (AConv downsampling), deformable disease feature blocks (DDF-Block), and spatial pyramid aggregation units (SPPFLAN). The connections between these units within the backbone network are sequential. Specifically, the input image, after two convolutions, is input into the hierarchical aggregation expression unit (ELAN1), then connected to the first lightweight downsampling unit (AConv downsampling), and after downsampling, input into the first heavily parameterized cross-stage aggregation unit (RepNCSPELAN4). The output of the first heavily parameterized cross-stage aggregation unit (RepNCSPELAN4) is input into the DDF-Block, which includes two output branches. One output branch connects to the neck network as a shallow feature A, and the other output branch connects to another set of sequentially connected second lightweight downsampling units (AConv downsampling) and second parametric cross-stage aggregation units (RepNCSPELAN4). The parametric cross-stage aggregation unit (RepNCSPELAN4) includes two output branches, one of which connects to the neck network as a middle-layer feature B, and the other output branch connects to another set of sequentially connected third lightweight downsampling units (AConv downsampling) and third parametric cross-stage aggregation units (RepNCSPELAN4). The third parametric cross-stage aggregation unit (RepNCSPELAN4) is connected to a spatial pyramid aggregation unit (SPPFLAN). The output of the spatial pyramid aggregation unit (SPPFLAN) is input to the neck network as a high-level feature C. The connection between the neck network and the backbone network, as well as the connection between shallow feature A, mid-level feature B, and high-level feature C, and the connection between the neck network and the detection head, can be seen in the YOLOv8s model. Specifically, after high-level feature C is upsampled once, it is skipped and connected with mid-level feature B before being input into the first C2f module, and the mid-level fusion feature is output. The mid-level fusion feature is upsampled once and skipped and connected with shallow feature A before being output to the second C2f module to obtain the P3 detection feature. The P3 detection feature is skipped and connected with the mid-level fusion feature before being input into the third C2f module to obtain the P4 detection feature. After convolution downsampling the P4 detection feature, it is skipped and connected with high-level feature C before being output to the fourth C2f module to obtain the P5 detection feature. P3, P4, and P5 detection features are respectively delivered to the detection head for detection. The terms "first," "second," and "third" in the above process only indicate the distinction between different units; please refer to the appendix for details. Figure 4 ; The output of the hierarchical aggregation expression unit (ELAN1) can be represented as: In the formula, Indicates the first The aggregation characteristics of each stage Represents an aggregation mapping. Indicates the first Phase 1 The output characteristics of each branch Indicates a branch index. Indicates the first The number of branches in each stage. This indicates that branches of the same type are arranged in order. This indicates the channel splicing operator. Indicates the first Phase 1 The output characteristics of each branch Indicates the first Phase 1 The output characteristics of each branch Indicates the first Phase 1 Output characteristics of each branch; The lightweight downsampling unit (AConv downsampling) serves as a transitional path to achieve local texture preservation of shallow features and semantic enhancement of mid-level features. Its calculation formula is expressed as follows: in, Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage Indicates the network stage index. Indicates lightweight downsampling mapping. This represents the average pooling operator. Indicates step size is Convolutional mapping, This represents the channel concatenation operator. The average pooling branch is used to preserve stable statistical information, and the stride convolution branch is used to extract downsampled semantic information. The two are concatenated and then processed... The fusion yields the next stage characteristics This unit can achieve stage transition without increasing a large number of parameters and computational load, while maintaining the sensitivity of shallow features to small target diseases; The spatial pyramid aggregation unit enhances the high-level context, and its computation method is represented as follows: in, This indicates the channel splicing operator. Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage This represents the aggregated output features of the spatial pyramid. , , These represent window sizes of 1000 and 1000 respectively. , and max pooling operator, Represents spatial pyramid fusion mapping; DDF-Block, input shallow features The specific steps for processing include: For input shallow features After channel compression, the intermediate features after channel compression are: , Indicates intermediate features. This indicates shallow input features. Represents channel compression mapping, and is based on intermediate features. Local texture branch features, deformable sampling branch features, and edge-aided branch features are constructed respectively, with the following specific expressions: in, Represents local texture branch features. Represents a local depthwise convolution mapping. Indicates the sampling offset. This represents the offset prediction mapping. This represents the deformable sampling features before gating. This represents a deformable convolution operator. Indicates edge auxiliary branch features, Represents edge-assisted mapping, This represents the average pooling operator; Then, based on local texture branch features, deformable sampling branch features, and edge auxiliary branch features, a difference-guided gating and recalibrated deformable sampling feature is constructed, specifically expressed as: In the formula, Indicates the gating weight, This represents the Sigmoid activation function. Indicates gating mapping, Represents local texture branch features With edge auxiliary branch features The element-wise absolute difference between them This represents the deformable sampling features after recalibration. This represents element-wise multiplication. This indicates the output characteristics of a DDF-Block. This represents the learnable scaling factor. This indicates the channel splicing operator. This represents the fusion mapping; the difference-guided gating takes the difference between the local texture branch features and the edge auxiliary branch features as the gating input, and is used to recalibrate the deformable sampled branch response. At this time, the deformable sampled features are output as shallow features A. S3: Construct an equalization resampling strategy based on the image-level frequency obtained in step S1 to obtain a multiset of reconstructed training images, thereby increasing the exposure probability of images of tail-category diseases during the training process. The Balanced Repeat Sampling (BRS) strategy specifically includes the following steps: S3.1: Calculate the reference frequency : in, Indicates the disease category index. Indicates category Image-level frequency, This represents the set of all disease categories. Indicates the maximum value; S3.2: Calculate the basic repeatability factor for each category: in, Indicates category The basic repeating factor, This indicates the maximum limit for repetition. Represents the stability constant. This represents the repetition intensity control factor. This indicates that the minimum value is a function; S3.3: Calculate the final repetition factor of the image: in, Representing an image The final repetition multiple, Indicates the maximum value. This represents the floor operator; S3.4: Reconstruct the training image list: in, This represents a multiple set of reconstructed training images. This indicates that multiple sets are appended based on the training image index. Representing an image Repeatedly append Second-rate, The range of values ​​is to , The range of values ​​is to , The range of values ​​is to ; When the image When including low-frequency categories, Increase, thus The image is increased, meaning it is sampled more frequently during training; when the image... When only the header category is included, Keep the value low. Limiting the upper limit of repetition can reduce the risk of overfitting caused by excessive replication of a very small number of sample classes; S4. Construct a category-aware classification scaling mechanism based on the bounding box frequency obtained in step S1, and adjust the classification supervision intensity of positive samples of the tail category by adjusting the bounding box frequency; Category-Aware Classification Scaling (CASLC) specifically includes the following steps: S4.1 Calculate the original inverse frequency weights: In the formula, Indicates category The original inverse frequency weights, This indicates the frequency of the highest number of bounding boxes across all categories. Represents the square root operator; S4.2 Calculate the weighted mean: in, This represents the original inverse frequency weighted mean. This indicates the total number of disease categories. Indicates a category summation index. This represents the original inverse frequency weight of the j-th type of disease; S4.3 Perform normalization and truncation: in, This represents the truncated class weights. Indicates the upper limit of category weight; S4.4, Normalize again and generate classification scaling factors: in, This represents the class weights after renormalization. Indicates category The classification scaling factor, Indicates the supervision scaling intensity factor. This represents the category weight of the j-th type of disease; preferably, The range of values ​​is to , The range of values ​​is to Among them, for Mean normalization is used to maintain the overall scale of class weights, upper limit truncation is used to avoid a very small number of class weights being too large, and re-normalization is used to restore the overall classification loss scale after truncation. S5: Use the results processed by steps S4 and S5 to train the RDG-YOLO feature adaptation network of S2 to obtain the RDG-LTDet model, and deploy the RDG-LTDet model on the edge computing device to output the disease category, confidence score and location box. The training process includes the total training loss, specifically expressed as: in, This represents the classification loss for positive samples after category-aware scaling. This represents the set of candidate positions for positive samples. Indicates the positive sample index. Indicates positive samples The corresponding real category, Represents the true category The corresponding classification scaling factor, This represents the binary cross-entropy loss function. Indicates positive samples Predicted as category The classification probability, Indicates total training loss. This represents the bounding box regression loss. Indicates the distribution focus loss. , and These represent the weight coefficients of the bounding box regression loss, classification loss, and distribution focus loss, respectively. S5 also includes a validation phase, specifically including precision, recall, average precision, and multi-threshold average precision, which can be expressed as follows: In the formula, Indicates the actual number of cases. Indicates the number of false positives. Indicates the number of false negatives. Indicates accuracy. Indicates recall rate, Indicates category Cross-union threshold The average accuracy is as follows. Indicates category In recall rate and threshold The accuracy function under the given conditions This represents the recall variable. Indicates the threshold sequence number; In S5, road inspection images The trained model outputs a set of candidate detections: In the formula, Representing an image The candidate detection set, Indicates the candidate detection index. Indicates the number of candidate tests. and Indicates the first The center coordinates of each candidate box and Indicates the first The width and height of each candidate box. Indicates the first Confidence of each candidate box Indicates the first Each candidate box predicts the category; For any two candidate boxes and Calculate the intersection-union ratio: In the formula, Represents the intersection-union ratio function. and This represents two candidate boxes. and Indicates the candidate box index. This represents the intersection operation. This represents the union operation. Represents the area of ​​the region; sort the candidate detection set from high to low confidence, and select the candidate boxes with the highest confidence as the retained boxes; For other candidate boxes whose intersection-union ratio (IoU) with the retained box is greater than a preset threshold and whose predicted category is the same, candidate boxes with lower confidence are suppressed (among candidate boxes of the same category with IoU exceeding the threshold, the box with lower confidence than the retained box will be suppressed); preferably, the range of the preset IoU threshold is [insert range here]. to The confidence threshold range is as follows: to .

[0020] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A lightweight road defect detection method for long-tailed and small-target defects, characterized by: Includes the following steps: S1: Obtain road inspection images and their annotation files, count the image-level frequency and annotation box frequency of each category, and determine the tail category set based on the image-level frequency and annotation box frequency; S2: Construct the RDG-YOLO feature adaptation network; The RDG-YOLO feature adaptation network is a YOLO-like single-frame model, and when the RDG-YOLO feature adaptation network outputs shallow features, it processes the shallow features through deformable disease feature blocks. The deformable disease feature block is used for input shallow features Channel compression is performed, and local texture branch features, deformable sampling branch features, and edge auxiliary branch features are constructed separately. The deformable sampling features are then synthesized to obtain the deformable sampling features. S3: Construct an equalization resampling strategy based on the image-level frequency obtained in step S1 to obtain a multiset of reconstructed training images; S4: Construct a category-aware classification scaling mechanism based on the frequency of the bounding boxes obtained in step S1; S5: Use the results processed by steps S4 and S5 to train the RDG-YOLO feature adaptation network of S2 to obtain the RDG-LTDet model, and deploy the RDG-LTDet model on the edge computing device to output the disease category, confidence level and location box.

2. The lightweight road defect detection method for long-tailed and small-target defects according to claim 1, characterized in that: S1 includes the following steps: S1.1: Obtain road inspection images and their annotation files, wherein the road inspection image set is as follows: ; in, Indicates the first Image Represents the total number of images, for the th... Image Includes: a collection of record annotation boxes Category set and the actual category of each annotation box ; S1.2: Calculate the relative area of ​​each annotation box: in, Indicates the annotation box The relative area, Indicates the index of the annotation box. Indicates the annotation box width, Indicates the annotation box height, Representing an image width, Representing an image The height, and based on this, a small target indication quantity is generated. : In the formula, Indicates relative area. This indicates the quantity of small targets. This indicates the threshold for determining small targets. This indicates an indicator function that outputs 1 if a condition is met, and 0 otherwise. hour ,otherwise ; S1.3: Statistical analysis of image-level frequency and bounding box frequency: in, Indicates the disease category index. Indicate category Image-level frequency, Indicate category Frequency of annotation boxes Indicates the annotation box The true category, This represents summing over all training images. Indicates the image Summation of all annotation boxes within the box; S1.4: Determine the tail category set based on image-level frequency and bounding box frequency: in, Represents the set of tail categories. This represents the set of all disease categories. This represents the image-level tail determination threshold. This indicates the threshold for determining the tail of the annotation box. This represents the average image frequency across all categories. This represents the median frequency of images across all categories. This represents the maximum frequency scaling factor at the image level. Indicates image-level reference frequency. This represents the average frequency of all category bounding boxes. This represents the median frequency of all category bounding boxes. This represents the maximum frequency ratio coefficient at the annotation box level. This indicates the frequency of the maximum annotation box.

3. The lightweight road defect detection method for long-tailed and small-target defects according to claim 2, characterized in that: The RDG-YOLO feature adaptation network of S2 includes a backbone network, a neck network, and a detection head. The backbone network includes multiple hierarchical aggregation expression units, multiple heavily parameterized cross-stage aggregation units, multiple lightweight downsampling units, deformable disease feature blocks, and spatial pyramid aggregation units. Three-scale features are generated through the backbone network and neck network. , Indicates shallow detail features. Indicates the characteristics of mid-layer fusion. It represents high-level semantic features.

4. The lightweight road defect detection method for long-tailed and small-target defects according to claim 3, characterized in that: The specific output expression of the hierarchical aggregation expression unit is: in, Indicates the first The aggregation characteristics of each stage Represents aggregation mapping, Indicates the first Phase 1 The output features of each branch Indicates the first Phase 1 The output features of each branch Indicates the first Phase 1 The output features of each branch Indicates the first The number of branches in each stage. This indicates that branches of the same type are arranged in order. This indicates the channel splicing operator.

5. The lightweight road defect detection method for long-tailed and small-target defects according to claim 4, characterized in that: The calculation formula for the lightweight downsampling unit is expressed as follows: in, Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage Indicates the network stage index. Indicates lightweight downsampling mapping. This represents the average pooling operator. Indicates step size is Convolutional mapping, Indicates the channel splicing operator; The spatial pyramid aggregation unit is specifically SPPFLAN, and its specific expression is as follows: in, This indicates the channel splicing operator. Indicates the first Input features at each stage, Indicates the first Output characteristics of each stage This represents the aggregated output features of the spatial pyramid. , , These represent window sizes of 1000 and 1000 respectively. , and max pooling operator, This represents the spatial pyramid fusion mapping.

6. The lightweight road defect detection method for long-tailed and small-target defects according to claim 3, characterized in that: The deformable disease feature block is used for input shallow features Intermediate features are obtained after channel compression mapping. Based on intermediate features Local texture branch features, deformable sampling branch features, and edge-aided branch features are constructed respectively, with the following specific expressions: in, Represents local texture branch features. Represents a local depthwise convolution mapping. Indicates the sampling offset. This represents the offset prediction mapping. This represents the deformable sampling features before gating. This represents a deformable convolution operator. Indicates edge auxiliary branch features, Represents edge-assisted mapping, This represents the average pooling operator; Based on local texture branch features, deformable sampling branch features, and edge-assisted branch features, a difference-guided gating and recalibrated deformable sampling feature is constructed, with the specific expression as follows: in, Indicates the gating weight, This represents the Sigmoid activation function. Indicates gating mapping, Represents local texture branch features With edge auxiliary branch features The element-wise absolute difference between them This represents the deformable sampling features after recalibration. This represents element-wise multiplication. This indicates the output characteristics of a DDF-Block. This represents the learnable scaling factor. This indicates the channel splicing operator. This indicates a fusion mapping.

7. The lightweight road defect detection method for long-tailed and small-target defects according to claim 1, characterized in that: The balanced resampling strategy specifically includes the following steps: S3.1: Calculate the reference frequency : in, Indicates the disease category index. Indicate category Image-level frequency, This represents the set of all disease categories. Indicates the maximum value; S3.2: Calculate the basic repeatability factor for each category: in, Indicate category The basic repeating factor, This indicates the maximum limit for repetition. Represents the stability constant. This represents the repetition intensity control factor. This indicates that the minimum value is a function; S3.3: Calculate the final repetition factor of the image: in, Representing an image The final repetition multiple, Indicates the maximum value. This represents the floor operator; S3.4: Reconstruct the training image list: in, This represents a multiple set of reconstructed training images. This indicates that multiple sets are appended based on the training image index. Representing an image Repeatedly append Second-rate.

8. The lightweight road defect detection method for long-tailed and small-target defects according to claim 1, characterized in that: The category-aware classification scaling mechanism specifically includes the following steps: S4.1 Calculate the original inverse frequency weights: In the formula, Indicate category The original inverse frequency weights, This indicates the frequency of the highest number of bounding boxes across all categories. Represents the square root operator; S4.2 Calculate the weighted mean: in, This represents the original inverse frequency weighted mean. This indicates the total number of disease categories. Indicates a category summation index. To express summation, Indicates the first Original inverse frequency weights for disease types; S4.3 Perform normalization and truncation: in, This represents the truncated class weights. Indicates the upper limit of category weight. Describes the minimum value function; S4.4, Normalize again and generate classification scaling factors: in, This represents the class weights after renormalization. Indicate category The classification scaling factor, Indicates the supervision scaling intensity factor. This represents the category weight of the j-th type of disease.

9. The lightweight road defect detection method for long-tailed and small-target defects according to claim 8, characterized in that: The S5 training process includes a total training loss, specifically expressed as follows: in, This represents the classification loss for positive samples after category-aware scaling. This represents the set of candidate positions for positive samples. Indicates the positive sample index. Indicates positive samples The corresponding real category, Represents the true category The corresponding classification scaling factor, This represents the binary cross-entropy loss function. Indicates positive samples Predicted as category The classification probability, Indicates total training loss. This represents the bounding box regression loss. Indicates the distribution focus loss. , and These represent the weight coefficients of the bounding box regression loss, classification loss, and distribution focus loss, respectively.

10. The lightweight road defect detection method for long-tailed and small-target defects according to claim 9, characterized in that: The edge computing device in S5 deploys the RDG-LTDet model to output a candidate detection set: In the formula, Representing an image The candidate detection set, Indicates the candidate detection index. Indicates the number of candidate tests. and Indicates the first The center coordinates of each candidate box and Indicates the first The width and height of each candidate box. Indicates the first Confidence of each candidate box Indicates the first Each candidate box predicts the category; S5 also includes processing any two candidate boxes. and Calculate the intersection-union ratio: In the formula, Represents the intersection-union ratio function. and This represents two candidate boxes. and Indicates the candidate box index. This represents the intersection operation. This represents the union operation. Indicates the area of ​​the region.