Road disease tracking method in complex interference road scene
By combining YOLOv8, improved Bytetrack and DIoU algorithms in complex interfering road scenarios, the problem of target tracking stability and accuracy is solved, and efficient and accurate tracking of road disease detection is achieved.
Patent Information
- Application Number
- CN202411292335.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-27
AI Technical Summary
In complex interfering road scenarios, the target tracking algorithm has stability and accuracy problems in road disease detection, especially detection errors and omissions caused by light changes and occlusion.
The YOLOv8 algorithm is used for precise object detection, combined with the improved Bytetrack algorithm and DIoU tracking and matching algorithm, data correlation is performed through Kalman filtering and Hungarian algorithm, and bounding box size dynamic adjustment method is used to ensure the stability and accuracy of the tracking trajectory.
It significantly improves the accuracy and robustness of road disease tracking, reduces error detection and omissions, and enhances the stability and continuity of target detection results.
Smart Images

Figure CN119206175A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of road damage detection, and in particular to a road damage tracking method in a complex interference road scene. Background Art
[0002] In the data collection process of road disease detection, the recognition process from the beginning to the end constitutes a complete disease information chain. This continuous process can be realized by the target tracking algorithm. In the actual engineering application of road disease target detection, accurate detection of road diseases can effectively improve the efficiency of maintenance work. In addition, it is also necessary to classify and statistically track road diseases to avoid duplication of disease information and improve the convenience of actual maintenance work. The collection of disease data in road disease target detection is interfered by various factors such as external environment (such as illumination changes and occlusions) and data acquisition equipment jitter, which reduces the stability of the results that rely solely on target detection. As a follow-up task of target detection, the target tracking algorithm continuously tracks the position of the target object in the video sequence, which is a method that can optimize the real-time detection of road diseases.
[0003] The target tracking technology is applied to the road disease detection task. By continuously locating and tracking multiple road disease trajectories in the video frame sequence, the road diseases are classified and statistically tracked to avoid duplication of disease information, reduce detection omissions and false positive results. However, the target tracking computing resource requirements are high, so it is difficult to apply it in the actual field. In the study of multi-target tracking, the "tracking-by-detection" strategy is a common and efficient method. The target detection algorithm is used to identify the target frame by frame, and then the similarity between the targets is calculated to associate the detection results in consecutive video frames. The tracking trajectory is generated by updating the continuous position of each target, and the detection data is associated with the new position. However, when processing video sequences containing complex interference factors (such as partial occlusion of the target or changes in illumination), this method may produce some detection errors caused by occlusion and tracking failure.
[0004] In order to accurately track the target trajectory and reduce the impact of complex environments, traditional methods often set a fixed threshold to retain only high-confidence detection results for association matching, thereby generating a coherent tracking trajectory and discarding low-confidence results containing background noise. As a result, valid targets whose confidence temporarily drops due to intermittent occlusion are mistakenly excluded, causing recognition omissions and trajectory interruptions, reducing tracking accuracy. Bytetrack solves this problem by processing high- and low-confidence results separately. However, directly associating high- and low-confidence results with the trajectory will bring background noise. Combining the similarity evaluation of low-confidence results with the tracking trajectory, filtering background noise, and performing secondary discrimination can avoid mistakenly discarding valid targets. Summary of the invention
[0005] In response to the problem of target tracking stability in complex interference road scenarios, the present invention proposes a road damage tracking optimization algorithm in complex interference road scenarios, which comprehensively considers multi-angle factors of tracking prediction, improves the regression stability of the target trajectory frame, and improves the actual engineering detection application of road damage by integrating the target tracking algorithm.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] The present invention provides a road damage tracking method in a complex interference road scene, comprising the following steps:
[0008] S1. Use YOLOv8 algorithm to perform accurate target detection of road damage by constructing and training a road damage dataset;
[0009] S2, based on the improved Bytetrack algorithm, through similarity evaluation and secondary discrimination, background noise is filtered to avoid misjudgment of valid targets;
[0010] S3, DIoU-based tracking and matching algorithm, combined with Kalman filtering and Hungarian algorithm, to achieve accurate data association;
[0011] S4, through the bounding box size dynamic adjustment method, ensure that the bounding box is adaptively adjusted without exceeding the image boundary;
[0012] S5. Apply the improved target tracking algorithm to complex interference scenarios, maintain continuous target tracking through high-confidence detection results, and significantly improve the accuracy and robustness of road damage tracking.
[0013] Furthermore, S1 specifically includes the following sub-steps:
[0014] S1.1. Obtain a video of road damage, convert the collected video into an RGB image with a resolution, mark the damage in the image, and select the marked images including multiple damages to construct a data set;
[0015] S1.2. Use the YOLOv8 model to detect road defects. First, deploy the model test environment. In order to adapt to the diversity of road defects in images and their size differences, adjust the model parameters. Use the disease image training set as the input data of the model for model training. Save the training results to obtain the machine vision model of various diseases. Use the test set data to verify the effectiveness of the model. The effective recognition rate of the disease must reach more than 95%. Otherwise, adjust the number of model iterations until the recognition rate meets the requirements. Use the trained model for road defect detection.
[0016] Furthermore, in S1.1, the defects include six types of defects: transverse cracks, longitudinal cracks, mesh cracks, block repairs, strip repairs, and pits;
[0017] In S1.1, the dataset is also divided into training set, validation set and test set in a ratio of 8:1:1.
[0018] Furthermore, in S2, the improved Bytetrack algorithm achieves high-precision tracking on the test dataset by improving target detection and two-stage matching strategy, including:
[0019] First, the high-confidence detection results are preliminarily matched with the trajectory of the previous frame to maintain continuity;
[0020] Secondly, the trajectories that failed the initial matching were matched again with the low confidence results to reduce the false exclusion caused by occlusion;
[0021] Finally, for high-confidence but unmatched detections, new tracks are created and retained for 30 frames for future re-matching, thereby improving tracking accuracy and robustness.
[0022] Furthermore, S2 specifically includes the following sub-steps:
[0023] S2.1, using the improved target tracking algorithm for road damage on the test data set, using the road damage detection algorithm as the upstream benchmark detection algorithm for tracking, dividing the target detection results in S1 into high and low categories according to confidence, and performing two-stage matching;
[0024] S2.2, preliminarily matching the high confidence result with the tracking trajectory of the previous frame to maintain high confidence continuous tracking;
[0025] S2.3. For the tracking tracks that failed to be matched successfully in the first time, match them separately with the low confidence results to avoid excluding the targets whose confidence is reduced due to severe occlusion;
[0026] S2.4. For detection results that fail to match but have a high confidence level, create a new tracking track and keep it within 30 frames so that the target can be re-matched in subsequent frames.
[0027] Furthermore, in S3, the specific process includes:
[0028] S3.1, DIoU (Distance Intersection over Union) is used as the loss function to accelerate the regression of the bounding box and improve the matching efficiency by minimizing the center point distance in the case of non-overlap;
[0029] S3.2. Kalman filtering is used to predict the target position during data association, and DIoU and Hungarian algorithm are combined for two rounds of matching. The first round evaluates the similarity, and the second round specifically uses DIoU to filter background noise to ensure the optimal association of each detection result with the tracking trajectory.
[0030] Furthermore, in S3.1, DIoU is used as a loss function to accelerate the regression of the bounding box in the horizontal and vertical directions by minimizing the distance between the center points of the boxes when the detection box and the prediction box do not overlap at all, thereby improving the matching calculation efficiency. The formula is as follows:
[0031]
[0032] Among them, b, b gt They represent the center points of the predicted box and the real box respectively, ρ represents the Euclidean distance between the two center points, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box.
[0033] Furthermore, the DIoU-based tracking and matching process includes:
[0034] Select a frame of tracking trajectory from the unsuccessfully matched set T and add it to the new set T1 as a DIoU candidate trajectory. The unjoined trajectory is marked as unmatched.
[0035] Calculate the DIoU distance between the trajectories in set T1 and the detection box set D, and construct a cost matrix;
[0036] In the cost matrix, the DIoU distance less than the threshold τ is set to infinity to exclude low-quality matches;
[0037] Apply the Hungarian algorithm to process the cost matrix and obtain the optimal matching result;
[0038] Optimize the matching results and remove matches with too small DIoU distance to ensure matching quality;
[0039] Output the final matching result and update the tracking trajectory.
[0040] Furthermore, in S4, the specific process includes:
[0041] By dynamically adjusting the bounding box size, the width or height of the bounding box is ensured to be at least the preset ratio min_ratio of the image size, thereby optimizing the detection and tracking accuracy of the target;
[0042] Make sure the adjusted bounding box does not exceed the image boundary to avoid ignoring objects that are too small.
[0043] Furthermore, in S4, the process of adjusting the bounding box includes:
[0044] The bounding box is defined by the coordinates of its upper left corner (x min ,y min ) and the lower right corner coordinate (x max ,y max ) defines that the size of the image is W×H, which is the minimum ratio threshold of the bounding box relative to the image size;
[0045] Bounding box adjustment first calculates the width and height of the current bounding box:
[0046] w current =x max -x min
[0047] h current =y max -y min
[0048] Calculate the minimum width and height required:
[0049] w min =W×min_ratio
[0050] h min =H×min_ratio
[0051] If w current <w min , you need to adjust the width:
[0052] Δw=w min -w current
[0053] The adjusted left and right boundaries are:
[0054]
[0055]
[0056] If h current <h min , you need to adjust the height:
[0057] Δh=h current -h min
[0058] The adjusted upper and lower boundaries are:
[0059]
[0060] To ensure that the bounding box is within the image, the adjusted bounds need to be ensured not to exceed the image boundaries, that is:
[0061]
[0062] Compared with the prior art, the present invention has the following technical advantages:
[0063] (1) The present invention establishes a road damage tracking optimization algorithm under complex interference road scenes, effectively improves the regression stability of the target frame, and improves the actual engineering detection application of road damage by integrating the target tracking algorithm.
[0064] (2) The target tracking algorithm is applied to road damage detection. By continuously tracking the position of the target object in the video sequence, it can optimize the real-time detection of road damage and enhance the stability of the target detection results. The detection algorithm after adding tracking improves the detection stability and the smoothness of the output results.
[0065] (3) The tracking algorithm reduces the jitter caused by rapid changes in target size or device influence by dynamically adjusting the detection frame, making the output result smoother, giving each target unique sequence information, enhancing the ability to track the same target in consecutive frames, and improving the continuity and consistency of tracking.
[0066] (4) By automatically analyzing and extracting the trajectory features of the target, the algorithm makes up for the shortcomings of traditional visual target detection in complex scenes and effectively reduces false detections and missed detections. When the current frame detection fails, the algorithm uses the existing trajectory information and the target's movement rules to predict the target position, thereby improving the accuracy of detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a diagram of the calculation of the DIOU loss function of the present invention;
[0068] Figure 2 It is a diagram of the target tracking algorithm;
[0069] Figure 3 This is a comparison chart of the tracking algorithm before and after improvement;
[0070] Figure 4 A comparison of the occlusion results of the target tracking algorithm before and after improvement. DETAILED DESCRIPTION
[0071] Based on the basic principle of the target tracking method Bytetrack, the present invention aims to improve the target tracking algorithm in view of the problem of insufficient robustness of the algorithm in road scenes with complex interference factors. The similarity evaluation of the low confidence results and the tracking trajectory is combined to filter the background noise, and a secondary discrimination is performed to avoid erroneously discarding valid targets. DIoU is used to alleviate the problem of insufficient sensitivity of coincidence in IoU matching, and the multi-angle factors of tracking prediction are comprehensively considered to effectively improve the regression stability of the target frame. A method for dynamically adjusting the size of the bounding box is proposed, which optimizes the detection and tracking accuracy of the target by ensuring that the width or height of the bounding box is at least a certain proportion of the image size. Experiments have proved that the improvement of the algorithm in this study has improved the robustness of the original algorithm and can be applied.
[0072] In general, the present invention adopts the following technical solutions:
[0073] S1. Use YOLOv8 algorithm to implement accurate target detection of road diseases
[0074] Construct a road disease dataset, organize it into a training set and a test set, use the training set to train and test the YOLOv8 model, and use the trained disease detection model for road disease recognition and detection;
[0075] S2. Improved target tracking algorithm based on Bytetrack
[0076] The target tracking algorithm Bytetrack avoids missed recognition and track interruption by processing high and low confidence results separately. However, directly associating high and low confidence results with the track will bring background noise. Therefore, an improved target tracking algorithm is proposed that combines the low confidence results with the similarity evaluation of the tracking track, filters the background noise, and performs secondary discrimination to avoid erroneously discarding valid targets.
[0077] S3. Propose a matching algorithm design based on DIOU and perform data association
[0078] Based on the IoU improvement, DIoU is obtained. The data association uses Kalman filtering to predict the position of the target in the current frame, and combines DIoU and Hungarian algorithm for cascade matching;
[0079] S4. Propose a method for dynamically adjusting the size of the bounding box
[0080] Ensure that the width or height of the bounding box is at least a certain ratio of the image size (set by the parameter min_ratio), and ensure that the adjusted bounding box does not exceed the image boundaries;
[0081] S5. Improved target tracking algorithm to achieve road damage target tracking in complex interference scenarios
[0082] The optimized target tracking algorithm in step S3 is used and applied to the scene where the road damage is seriously obscured, and the high-confidence detection results are initially used to maintain the continuous tracking of the target.
[0083] In specific implementation, step S1 specifically includes the following sub-steps:
[0084] S1.1. Collect and process road defects. Collect road surface videos, convert the collected videos into RGB images with a resolution of 1920×1080 at a frequency of 30 frames per second, mark the defects in the images, select the marked images including various defects to construct a data set, including six types of defects: transverse cracks, longitudinal cracks, mesh cracks, block repairs, strip repairs, and potholes. The data set is divided into training set, validation set, and test set in a ratio of 8:1:1;
[0085] S1.2. Use the YOLOv8 model to detect road damage. First, deploy the model test environment. In order to adapt to the diversity of road damage in images and their size differences, adjust the model parameters, use the disease image training set as the model input data for model training, and iterate 100 times. Save the training results to obtain the machine vision model of various types of damage. Use the test set data to verify the effectiveness of the model. The effective recognition rate of the damage must reach more than 95%, otherwise adjust the number of model iterations until the recognition rate meets the requirements, and use the trained model for road damage detection.
[0086] In the specific implementation, step S2 improves the target tracking algorithm based on Bytetrack, which specifically includes:
[0087] S2.1, using the improved target tracking algorithm for road damage on the test data set, using the road damage detection algorithm as the upstream benchmark detection algorithm for tracking. The target detection results in S1 are divided into high and low categories according to the confidence, and two-stage matching is performed.
[0088] S2.2, preliminarily matching the high confidence result with the tracking trajectory of the previous frame to maintain high confidence continuous tracking;
[0089] S2.3. For the tracking tracks that failed to be matched successfully in the first time, they are matched separately with the low confidence results to avoid excluding the targets whose confidence is reduced due to severe occlusion.
[0090] S2.4. For detection results that fail to match but have a high confidence level, create a new tracking track and keep it within 30 frames so that the target can be re-matched in subsequent frames.
[0091] In specific implementation, step S3 specifically includes the following sub-steps:
[0092] S3.1, DIoU is improved based on IoU, which is used to enhance the stability and accuracy of bounding box regression in target detection and target tracking algorithms. It takes into account the center point distance, overlap rate and scale of the target box and the predicted box, effectively improving the regression stability of the target box, especially in scenarios where the sensitivity of the overlap between the target box and the predicted box is insufficient. The calculation of DIoU includes the Euclidean distance between the center points of the target box and the predicted box, and the diagonal length of the minimum closure area containing the two boxes. This calculation method maintains the scale invariance of IoU, making it suitable for comparing bounding boxes of different sizes and proportions, and also adds a penalty mechanism for position deviation. DIoU loss can accelerate the regression of the bounding box in the horizontal and vertical directions by minimizing the distance between the center points of the boxes when the detection box and the predicted box do not overlap at all, thereby improving the matching calculation efficiency. The formula is as follows:
[0093]
[0094] Among them, b, b gt They represent the center points of the predicted box and the real box respectively, ρ represents the Euclidean distance between the two center points, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box.
[0095] DIoU loss not only focuses on the overlap of bounding boxes, but also on their relative positions, making the prediction box regression more accurate and enhancing the ability of target detection and tracking algorithms to locate targets. It is more suitable for dealing with complex scenes such as target occlusion and fast movement. Even in the absence of direct overlap, it can optimize the distance between the target box and the prediction box, thereby accelerating the convergence process of the model and improving the overall performance. The algorithm is shown in Table 1.
[0096] Table 1 Tracking matching algorithm based on DIoU
[0097]
[0098] S3.2, Data Association uses Kalman filtering to predict the position of the target in the current frame, and combines the improved DIoU and Hungarian algorithm to evaluate the similarity of the first match. The second match specifically uses DIoU as a similarity evaluation, effectively filtering out background noise, and only considering low-scoring detection frames that highly overlap with existing trajectories. The Hungarian algorithm is used to complete two rounds of matching to ensure that each detection result is optimally associated with a tracking trajectory.
[0099] In specific implementation, step S4 specifically includes:
[0100] This algorithm proposes a method for dynamically adjusting the size of the bounding box to optimize the detection and tracking accuracy of the object by ensuring that the width or height of the bounding box is at least a certain ratio of the image size (set by the parameter min_ratio). In addition, this method ensures that the adjusted bounding box does not exceed the image boundary, thus avoiding ignoring objects that are too small, especially when the object size is very small relative to the entire image.
[0101] The bounding box is defined by the coordinates of its upper left corner (x min ,y min ) and the lower right corner coordinate (x max ,y max ) defines that the image size is W×H (width is W, height is H) as the minimum ratio threshold of the bounding box relative to the image size. Bounding box adjustment first calculates the width and height of the current bounding box:
[0102] w current =x max -x min
[0103] h current =y max -y min
[0104] Calculate the minimum required width and height:
[0105] w min =W×min_ratio
[0106] h min =H×min_ratio
[0107] If w current <w min , you need to adjust the width:
[0108] Δw=w min -w current
[0109] The adjusted left and right boundaries are:
[0110]
[0111] If h current <h min , you need to adjust the height:
[0112] Δh=h current -h min
[0113] The adjusted upper and lower boundaries are:
[0114]
[0115] To ensure that the bounding box is within the image, the adjusted bounds need to be ensured not to exceed the image boundaries, that is:
[0116]
[0117] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. Component models, material names, connection structures, control methods, algorithms and other features not clearly described in this technical solution are all considered to be common technical features disclosed in the prior art.
[0118] Example 1
[0119] The road defects were collected and processed. Road surface videos were acquired and converted into RGB images with a resolution of 1920×1080 at a frequency of 30 frames per second. The defects in the images were marked, and the marked images including various defects were selected to construct a data set, including six types of defects: transverse cracks, longitudinal cracks, mesh cracks, block repairs, strip repairs, and potholes. The data set was divided into training set, validation set, and test set in a ratio of 8:1:1.
[0120] The YOLOv8 model is used to detect road damage. The model test environment is first deployed. In order to adapt to the diversity of road damage in images and their size differences, the model parameters are adjusted. The training set of disease images is used as the input data of the model for model training. The number of iterations is 100. The training results are saved to obtain the machine vision model of various types of damage. The test set data is used to verify the effectiveness of the model. The effective recognition rate of the damage must reach more than 95%, otherwise the number of iterations of the model is adjusted until the recognition rate meets the requirements, and the trained model is used for road damage detection.
[0121] In order to accurately track the target trajectory and reduce the impact of complex environments, traditional methods often set a fixed threshold and only retain high-confidence detection results for association matching, thereby generating a coherent tracking trajectory and discarding low-confidence results containing background noise. As a result, valid targets whose confidence temporarily drops due to intermittent occlusion are mistakenly excluded, causing recognition omissions and trajectory interruptions, reducing tracking accuracy. Bytetrack solves this problem by processing high and low-confidence results separately, but directly associating high and low-confidence results with the trajectory will bring background noise. Therefore, it is proposed to combine the low-confidence results with the similarity evaluation of the tracking trajectory, filter the background noise, and perform secondary discrimination to avoid mistakenly discarding valid targets. The process is as follows:
[0122] (1) Experiments using the improved target tracking algorithm for road damage on the test data set, using the road damage detection algorithm as the upstream benchmark detection algorithm for tracking. The detection results are divided into high and low categories according to the confidence level, and two-stage matching is performed.
[0123] (2) Preliminarily match the high-confidence result with the tracking trajectory of the previous frame to maintain high-confidence continuous tracking.
[0124] (3) For tracking trajectories that failed to be matched successfully in the first attempt, they are matched separately with the low-confidence results to avoid excluding targets whose confidence levels are reduced due to severe occlusion.
[0125] (4) For detection results that fail to match but have a high confidence level, a new tracking track is created and retained within 30 frames so that the target can be re-matched in subsequent frames.
[0126] Cascade matching is critical in the tracking process. The core of cascade matching is how to effectively associate data. The matching state vector consists of the horizontal and vertical coordinates (cx, cy) of the center point of the target box, the aspect ratio (r), and the height (h). The similarity is calculated using the cosine distance, and the formula is as follows
[0127]
[0128] where d j represents the jth detection result in the frame, yi represents the i-th trajectory in the frame, S i-1 Represents the covariance of the two. max_age represents the number of cycles, that is, the maximum number of times the predicted trajectory successfully matches the newly activated target.
[0129] In cascade matching, the detection box and the prediction box are matched by combining the Hungarian algorithm with the IoU calculation. IoU reflects the matching quality between the detection box and the prediction box in a scale-invariant way, but cannot accurately quantify the specific size of the overlap between the two. If there is no overlap between the detection box and the real box, the calculation result of IoU will always be 0, which not only makes the loss function undifferentiable, but also reduces the sensitivity of IoU in target alignment. Therefore, the DIoU matching algorithm is obtained by improving IoU, such as Figure 1 .
[0130] DIoU is an improvement based on IoU, which is used to enhance the stability and accuracy of bounding box regression in target detection and target tracking algorithms. It takes into account the center point distance, overlap rate and scale of the target box and the predicted box, effectively improving the regression stability of the target box, especially in scenarios where the sensitivity of the overlap between the target box and the predicted box is insufficient. The calculation of DIoU includes the Euclidean distance between the center points of the target box and the predicted box, and the diagonal length of the minimum closure area containing the two boxes. This calculation method maintains the scale invariance of IoU, making it suitable for comparing bounding boxes of different sizes and proportions, and also adds a penalty mechanism for position deviation. DIoU loss can accelerate the regression of the bounding box in the horizontal and vertical directions by minimizing the distance between the center points of the boxes when the detection box and the predicted box do not overlap at all, thereby improving the matching calculation efficiency. The formula is as follows:
[0131]
[0132] Among them, b, b gt They represent the center points of the predicted box and the real box respectively, ρ represents the Euclidean distance between the two center points, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box.
[0133] DIoU loss not only focuses on the overlap of bounding boxes, but also on their relative positions, making the prediction box regression more accurate and enhancing the ability of target detection and tracking algorithms to locate targets. It is more suitable for dealing with complex scenes such as target occlusion and fast movement. Even in the absence of direct overlap, it can optimize the distance between the target box and the prediction box, thereby accelerating the convergence process of the model and improving the overall performance. The algorithm is shown in Table 1.
[0134] Data association uses Kalman filtering to predict the position of the target in the current frame, and combines DIoU and the Hungarian algorithm to evaluate the similarity of the first match. The second match specifically uses DIoU as a similarity evaluation, effectively filtering out background noise, and only considering low-scoring detection frames that highly overlap with existing trajectories. The Hungarian algorithm is used to complete two rounds of matching to ensure that each detection result is optimally associated with a tracking trajectory. It is applied in scenarios where road damage is severely occluded, and high-confidence detection results are initially used to maintain continuous tracking of the target. Based on the above association matching method, ByteTrack not only reduces misidentification, but also improves the system's adaptability to occlusion and tracking consistency.
[0135] In the process of tracking road damage targets in actual lane scenarios, the bounding boxes of small-scale targets in consecutive video frames are difficult to be correctly matched due to their small size, resulting in activation as new tracking trajectories in subsequent frames or missed recognition due to trajectory interruptions. This study proposes a method for dynamically adjusting the size of the bounding box to optimize the detection and tracking accuracy of the target by ensuring that the width or height of the bounding box is at least a certain ratio of the image size (set by the parameter min_ratio). In addition, this method also ensures that the adjusted bounding box does not exceed the image boundary, thereby avoiding the neglect of too small targets, especially when the target size is very small relative to the entire image.
[0136] The bounding box is defined by the coordinates of its upper left corner (x min ,y min ) and the lower right corner coordinate (x max ,y max ) defines that the image size is W×H (width is W, height is H) as the minimum ratio threshold of the bounding box relative to the image size. Bounding box adjustment first calculates the width and height of the current bounding box:
[0137] w current =x max -x min
[0138] h current =y max -y min
[0139] Calculate the minimum required width and height:
[0140] w min =W×min_ratio
[0141] h min =H×min_ratio
[0142] If w current <w min , you need to adjust the width:
[0143] Δw=w min -w current
[0144] The adjusted left and right boundaries are:
[0145]
[0146] If h current <h min , you need to adjust the height:
[0147] Δh=h current -h min
[0148] The adjusted upper and lower boundaries are:
[0149]
[0150] To ensure that the bounding box is within the image, the adjusted bounds need to be ensured not to exceed the image boundaries, that is:
[0151]
[0152] The tracking performance of the original algorithm and the improved algorithm in processing occluded targets in the video was analyzed through experimental comparison. The performance index values of the experimental results before and after the improvement are shown in Table 2.
[0153] Table 2 Experimental data
[0154]
[0155] The experimental results show that the improved target tracking algorithm in this study improves by 4.5% on MOTA and 1.9% on MOTP. The improvement of these two performance indicators proves the effectiveness of the improved algorithm in maintaining the target tracking trajectory and improving the tracking accuracy. It shows that without adding additional computing resources and complexity, the improved target tracking algorithm proposed in this study can maintain the target tracking trajectory through high-confidence detection results, and the target tracking effect is good.
[0156] Table 3 Experimental data
[0157]
[0158] When evaluating the performance of the improved road damage target tracking algorithm, a section of road damage target tracking file containing 1,200 damage information was randomly selected. This indicator represents the total number of targets that the algorithm can detect. Compared with the original target tracking algorithm, the number of detections of the improved algorithm increased by 14. This is because the missed targets are retrieved through the matching mechanism of target tracking, thereby improving the accuracy of target detection. The number of target tracking trajectories of the improved algorithm is less than that of the original target tracking algorithm. This is because the improved tracking trajectory has fewer jumps. The number of jumps refers to the number of times the target recognition is lost or misidentified during the tracking process. A lower number of jumps indicates more stable tracking performance. The original tracking algorithm assigns multiple trajectory sequences to a piece of damage information due to matching errors, resulting in more erroneous tracking, while the target tracking trajectory of the improved algorithm is more focused.
[0159] Figure 2The results of the target detection algorithm and the tracking algorithm were compared. The target detection algorithm had a jump phenomenon in which two frames of target recognition were lost, which affected the detection accuracy. The target tracking algorithm enhanced the stability of the target tracking trajectory, and the jumping target was correctly tracked. The tracking trajectory of the target detection algorithm was complete, and a high tracking integrity could be maintained in complex road scenes, ensuring the positioning capability of target detection and tracking. The improved algorithm improved the tracking accuracy of occluded targets. Its efficient matching mechanism of high and low confidence detection screening can accurately re-identify and search for targets that were missed in the first match, improving the overall accuracy of target detection and tracking.
[0160] Another jumping phenomenon is that due to matching errors, multiple trajectory sequences are assigned to one disease information, such as Figure 3 As shown in the figure, the original target tracking algorithm has the phenomenon of recognition sequence jump, which may be caused by the incorrect matching of the target within the 30-frame range with the existing trajectory, while the target tracking trajectory of the improved algorithm has higher focus and better positioning ability.
[0161] Comparative analysis of the results of the original target tracking and the improved algorithm, such as Figure 4 In the original algorithm, the tracking of the occluded target is shown in the figure. The defect in the video is occluded, resulting in tracking failure. The target is continuously tracked in the improved algorithm, and the original algorithm tracking remains untracked. This proves that the improvement of the original algorithm improves the robustness of the algorithm, and uses historical tracking information to predict the target position to deal with the situation where the target is temporarily occluded, which can ensure the continuity and stability of tracking.
[0162] This embodiment also proposes a road disease tracking device in a complex interference road scene, the device includes a processor and a memory, the processor and the memory are coupled, the memory stores program instructions, and the above-mentioned task management method is implemented when the program instructions stored in the memory are executed by the processor. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components; the memory may include a random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The memory can be an internal memory of the random access memory (RAM) type, and the processor and the memory can be integrated into one or more independent circuits or hardware, such as an application specific integrated circuit (ASIC). It should be noted that the computer program in the above-mentioned memory can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, an electronic device, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0163] This embodiment also proposes a computer-readable storage medium, wherein the storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the above-mentioned road disease tracking method under complex interference road scenes. The storage medium can be an electronic medium, a magnetic medium, an optical medium, an electromagnetic medium, an infrared medium, or a semiconductor system or a propagation medium. The storage medium can also include semiconductor or solid-state memory, a magnetic tape, a removable computer disk, a random access memory (RAM), a read-only memory (ROM), a hard disk, and an optical disk. The optical disk can include a compact disk-read only memory (CD-ROM), a compact disk-read / write (CD-RW), and a DVD.
[0164] The above description of the embodiments is to facilitate the understanding and use of the invention by those skilled in the art. It is obvious that those skilled in the art can easily make various modifications to these embodiments and apply the general principles described herein to other embodiments without creative work. Therefore, the present invention is not limited to the above embodiments, and improvements and modifications made by those skilled in the art based on the disclosure of the present invention without departing from the scope of the present invention should be within the scope of protection of the present invention.
Claims
1. A road damage tracking method in a complex interference road scene, characterized in that: The following steps are involved: S1. Use YOLOv8 algorithm to perform accurate target detection of road damage by constructing and training a road damage dataset; S2, based on the improved Bytetrack algorithm, through similarity evaluation and secondary discrimination, background noise is filtered to avoid misjudgment of valid targets; S3, DIoU-based tracking and matching algorithm, combined with Kalman filtering and Hungarian algorithm, to achieve accurate data association; S4, through the bounding box size dynamic adjustment method, ensure that the bounding box is adaptively adjusted without exceeding the image boundary; S5. Apply the improved target tracking algorithm to complex interference scenarios, maintain continuous target tracking through high-confidence detection results, and significantly improve the accuracy and robustness of road damage tracking.
2. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: S1 specifically includes the following sub-steps: S1.
1. Obtain a video of road damage, convert the collected video into an RGB image with a resolution, mark the damage in the image, and select the marked images including multiple damages to construct a data set; S1.
2. Use the YOLOv8 model to detect road defects. First, deploy the model test environment. In order to adapt to the diversity of road defects in images and their size differences, adjust the model parameters, use the disease image training set as the input data of the model for model training, save the training results to obtain the machine vision model of various diseases, and use the test set data to verify the effectiveness of the model. The effective recognition rate of the disease must reach more than 95%, otherwise the number of model iterations is adjusted until the recognition rate meets the requirements, and the trained model is used for road defect detection.
3. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: In S1.1, the defects include six types of defects: transverse cracks, longitudinal cracks, mesh cracks, block repairs, strip repairs, and pits; In S1.1, the dataset is also divided into training set, validation set and test set in a ratio of 8:1:
1.
4. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: In S2, the improved Bytetrack algorithm achieves high-precision tracking on the test dataset by improving target detection and two-stage matching strategy, including: First, the high-confidence detection results are preliminarily matched with the trajectory of the previous frame to maintain continuity; Secondly, the trajectories that failed the initial matching were matched again with the low confidence results to reduce the false exclusion caused by occlusion; Finally, for high-confidence but unmatched detections, new tracks are created and retained for 30 frames for future re-matching, thereby improving tracking accuracy and robustness.
5. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: S2 specifically includes the following sub-steps: S2.1, using the improved target tracking algorithm for road damage on the test data set, using the road damage detection algorithm as the upstream benchmark detection algorithm for tracking, dividing the target detection results in S1 into high and low categories according to confidence, and performing two-stage matching; S2.2, preliminarily matching the high confidence result with the tracking trajectory of the previous frame to maintain high confidence continuous tracking; S2.
3. For the tracking tracks that failed to be matched successfully in the first time, match them separately with the low confidence results to avoid excluding the targets whose confidence is reduced due to severe occlusion; S2.
4. For detection results that fail to match but have a high confidence level, create a new tracking track and keep it within 30 frames so that the target can be re-matched in subsequent frames.
6. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: In S3, the specific process includes: S3.1, DIoU (Distance Intersection over Union) is used as the loss function to accelerate the regression of the bounding box and improve the matching efficiency by minimizing the center point distance in the case of non-overlap; S3.
2. Kalman filtering is used to predict the target position during data association, and DIoU and Hungarian algorithm are combined for two rounds of matching. The first round evaluates the similarity, and the second round specifically uses DIoU to filter background noise to ensure the optimal association of each detection result with the tracking trajectory.
7. The method for tracing road damage in a complex interference road scene according to claim 6, characterized in that: In S3.1, DIoU is used as a loss function to accelerate the regression of the bounding box in the horizontal and vertical directions by minimizing the distance between the center points of the boxes when the detection box and the prediction box do not overlap at all, thereby improving the matching calculation efficiency. The formula is as follows: Among them, b, b gt They represent the center points of the predicted box and the real box respectively, ρ represents the Euclidean distance between the two center points, and c represents the diagonal distance of the minimum closure area that can contain both the predicted box and the real box.
8. The method for tracing road damage in a complex interference road scene according to claim 6, characterized in that: The tracking and matching process based on DIoU includes: Select a frame of tracking trajectory from the unsuccessfully matched set T and add it to the new set T1 as a DIoU candidate trajectory. The unjoined trajectory is marked as unmatched. Calculate the DIoU distance between the trajectories in set T1 and the detection box set D, and construct a cost matrix; In the cost matrix, the DIoU distance less than the threshold τ is set to infinity to exclude low-quality matches; Apply the Hungarian algorithm to process the cost matrix and obtain the optimal matching result; Optimize the matching results and remove matches with too small DIoU distance to ensure matching quality; Output the final matching result and update the tracking trajectory.
9. The method for tracing road damage in a complex interference road scene according to claim 1, characterized in that: In S4, the specific process includes: By dynamically adjusting the bounding box size, the width or height of the bounding box is ensured to be at least the preset ratio min_ratio of the image size, thereby optimizing the detection and tracking accuracy of the target; Make sure the adjusted bounding box does not exceed the image boundary to avoid ignoring objects that are too small.
10. The method for tracing road damage in a complex interference road scene according to claim 9, characterized in that: In S4, the bounding box adjustment process includes: The bounding box is defined by the coordinates of its upper left corner (x min ,y min ) and the lower right corner coordinate (x max ,y max ) defines that the size of the image is W×H, which is the minimum ratio threshold of the bounding box relative to the image size; Bounding box adjustment first calculates the width and height of the current bounding box: w current =x max -x min h current =y max -y min Calculate the minimum width and height required: w min =W×min_ratio h min =H×min_ratio If w current <w min , you need to adjust the width: Δw=w min -In current The adjusted left and right boundaries are: If h current <h min , you need to adjust the height: Δh=h current -h min The adjusted upper and lower boundaries are: To ensure that the bounding box is within the image, the adjusted bounds need to be ensured not to exceed the image boundaries, that is:
Citation Information
Cited By
Highway disease detection method capable of accurately positioning
CN120877121A
