Traffic target detection and inter-frame dynamic adjustment method based on cascade structure multi-level routing detection model, medium and equipment

By adopting a cascaded multi-level routing detection model and dynamic adjustment method, the detection problem caused by equipment differences in intelligent transportation systems is solved, which improves robustness and efficiency, adapts to different equipment performance, and optimizes the utilization of computing resources of edge devices.

CN121483017APending Publication Date: 2026-02-06JIANGSU HONGXIN SYST INTEGRATION
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511529168.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

In intelligent transportation systems, the data quality varies due to differences in equipment performance. Traditional single-frame target detection methods ignore temporal information and are difficult to handle complex scenarios. Edge devices have limited computing power, and traditional loss functions ignore differences in target types, leading to false detections and false negatives.

Method used

A multi-level routing detection model based on a cascaded structure is adopted. By constructing a cascaded hierarchical routing network structure, combining time-series data features, using a general detection model and an expert model, the confidence threshold is dynamically adjusted to correct the detection results, and Kalman filtering is used to optimize trajectory matching.

Benefits of technology

It improves the robustness and efficiency of traffic management, reduces false detection and false negative rates, adapts to different equipment performance, balances high accuracy in fuzzy detection and subdivision detection, and optimizes the utilization of computing resources for edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121483017A_ABST
    Figure CN121483017A_ABST
Patent Text Reader

Abstract

The invention provides a traffic target detection and inter-frame dynamic adjustment method based on a cascade structure multi-level routing detection model, a medium and equipment. The method comprises the following steps: collecting traffic time sequence data, and establishing a multi-level label structure, the first class being large class labels and the second class being subdivision labels; a universal detection model and an expert model which are cascaded are constructed and trained, the universal detection model carries out large-class classification on the detection data, the expert model is selected according to a routing algorithm, and subdivision classification is carried out through the expert model; and in combination with output results of the general detection model and the expert model, constructing a prediction trajectory combined with time series data, and correcting a preposed detection result by dynamically adjusting and returning a new large-class classification confidence threshold and a subdivision classification confidence threshold. According to the method, the fuzzy classification situation possibly encountered in actual production is fully considered, the advantages of time sequence data and performance limitation of edge equipment are combined, and a better result is achieved in a routing and parameter dynamic adjustment mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent traffic management technology, specifically to a method, medium, and device for traffic target detection and inter-frame dynamic adjustment based on a cascaded multi-level routing detection model. Background Technology

[0002] With the acceleration of urbanization and the rapid growth of transportation demand, traditional traffic management methods are struggling to cope with increasingly complex traffic problems. Intelligent transportation, as a revolution in the transportation field, is gradually changing traffic management models through the deep integration of technologies such as artificial intelligence, the Internet of Things, and big data. Intelligent transportation systems can use cameras, sensors, and other equipment to monitor traffic flow in real time, detect traffic anomalies, and assist management personnel in responding quickly, thereby significantly improving traffic management efficiency and reducing the burden of manual monitoring. However, despite the significant progress made in intelligent transportation, many challenges remain in its practical implementation.

[0003] The construction of intelligent transportation systems often relies on existing monitoring equipment, which varies significantly in performance, resolution, and installation angle. For example, older cameras may have lower resolution, while newer cameras support high-definition or even 4K resolution. This difference in equipment quality leads to inconsistent data quality, directly impacting the performance of target detection algorithms. Ensuring the robustness and generalization ability of detection models under conditions of significant equipment performance disparities is a pressing issue. Traffic scenarios exhibit significant temporal characteristics; target trajectories and behavioral patterns can be analyzed and predicted using temporal data. Traditional single-frame target detection methods often neglect temporal information, making it difficult to handle complex scenarios such as target occlusion and blurred detection. Temporal data, however, provides correlation information between consecutive frames, and analyzing target trajectories and behavioral patterns can effectively improve detection accuracy and robustness. The implementation of intelligent transportation systems relies on edge devices for real-time data processing. However, edge devices face limitations in computing power, storage resources, and energy consumption, making it difficult to directly deploy complex deep learning models. Achieving efficient and low-power target detection and tracking with limited hardware resources is one of the main challenges faced by intelligent transportation systems in practical applications. In traffic scenarios, the diversity and complexity of target types place higher demands on detection algorithms. Traditional target detection methods typically apply the same loss function to all types, leading to situations where different vehicle models and even between vehicles use the same loss function, ignoring the similarities and differences between different types. This approach is prone to false positives and false negatives when data quality is poor or equipment malfunctions. In real-world traffic scenarios, due to factors such as changes in lighting, target occlusion, and equipment performance limitations, target detection results may be blurry or inaccurate in some situations. In such cases, providing broad category classification results for targets (e.g., "vehicle" or "pedestrian") may be more practical than precise classification (e.g., "car" or "truck"). Therefore, this invention provides a traffic target detection and inter-frame dynamic adjustment method, medium, and device based on a cascaded multi-level routing detection model to address the aforementioned problems. Summary of the Invention

[0004] This invention addresses the problems existing in the prior art by providing a traffic target detection and inter-frame dynamic adjustment method, medium, and device based on a cascaded multi-level routing detection model. By constructing a cascaded hierarchical routing network structure and combining the characteristics of time-series data, this invention conducts research on a cascaded multi-level detection model and an inter-frame dynamic verification method. This approach can reduce the probability of false detection and missed detection, and improve the efficiency of traffic management, while taking into account the limited performance of edge devices and performance consumption.

[0005] To achieve the above objectives, the present invention adopts the following technical solution: (I) This invention provides a traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model, comprising the following steps: collecting traffic time-series data, including training data and detection data; establishing a multi-level label structure based on the training data, dividing the data into two categories of labels: the first category is the target's major category label, and the second category is the target's sub-category label; constructing a cascaded hierarchical network model, including a general detection model and an expert model, training the general detection model using major category labels and corresponding data, and training the expert model using sub-category labels and corresponding data; classifying the detection data into major categories using the trained general detection model to obtain major category classification results; determining whether the major category classification results meet the target's sub-category classification requirements based on the routing algorithm, and if so, selecting the corresponding trained expert model or hybrid expert model, inputting the major category classification results into the corresponding expert model for sub-category classification, and outputting sub-category classification results; combining the output results of the general detection model and the expert model, constructing a predicted trajectory based on the time-series data, and correcting the previous detection results by dynamically adjusting and transmitting new major category classification confidence thresholds and sub-category classification confidence thresholds.

[0006] Furthermore, the general detection model includes a feature extraction module, a feature fusion module, and a detection layer. The feature extraction module extracts features from the input image, generating feature layers of different scales after multiple feature extractions through a cascaded network model. The feature layers are output through an attention mechanism model. The feature fusion module fully fuses different feature layers, employing a Bi-FPN (Bidirectional Feature Pyramid Network) structure (BiFPN, containing multiple FPN structures, achieves cross-scale feature fusion by iteratively transferring information between upper and lower layers and between upper and lower layers). The feature layers output by the feature extraction module are input into the BiFPN network for cross-scale feature fusion, fully fusing the expressions between different high-level and low-level semantics to obtain a fused multi-scale feature map. The detection layer detects the fused multi-scale feature map, obtaining the detection center coordinates (centx, centy), detection box size (w, h), and the target's major category classification confidence distribution S.

[0007] Furthermore, the process of determining whether the major category classification results need to be further subdivided into target categories and the selection of expert models are as follows: S1. Let Conf be the set of confidence thresholds for each major category that satisfy the sub-classification. If the major category classification confidence distribution S output by the general detection model satisfies... If conf_low <, then delete the target; if conf_low < < If the condition is met, the corresponding major category classification result will be output directly; if the condition is met, the classification result will be output directly. and Then proceed to step S2; S2, if and First, a static confidence threshold is preset for class i. Calculate the dynamic confidence threshold: , It is the confidence level standard deviation. For the corresponding threshold coefficient; if Then the objective satisfies the expert model's requirement for detailed classification, and all confidence values ​​greater than 1 in the confidence distribution S are included. The establishment of confidence requires a corresponding set of major categories. ;like If the target satisfies the broad category classification but not the sub-category classification, the corresponding broad category classification result is directly output; where, It is the confidence score of the i-th major category; S3, When the large category set The number of elements in the middle satisfies When the corresponding expert model is selected, it becomes the activation model for subsequent sub-classification; when the set of major categories... The number of elements in the middle satisfies When the confidence level is high, the three expert models with the highest confidence are selected as the activation models for subsequent sub-classification; (Class set) The number of elements in the middle satisfies In this case, only the expert model with the highest confidence level will be activated.

[0008] Furthermore, the expert model structure is consistent for each major category, including a bounding box regressor and a classifier. The bounding box regressor is a convolutional structure for bounding box regression, and the classifier is a convolutional structure for classification. Both the bounding box regressor and the classifier include pooling layers, convolutional networks, fully connected networks, and activation function layers, respectively. The bounding box regressor is used to detect the specific location of the target object in the image, and the output is a string of length [length missing]. A one-dimensional vector, where n is the number of subcategories under the current major category, and 1 represents the corresponding background; the classifier is used to determine which specific subcategory the target object belongs to, and the output result is... The one-dimensional feature structure represents the offset of the detection box center point and the offset of the detection box size, respectively; the feature layer of the general detection model is input into the corresponding expert model, and the corresponding convolutional network is used to obtain the subdivided classification confidence distribution in the corresponding expert model. And the detection box offset; if only one expert model is selected, then output directly. The final classification result is cls; if more than one expert model is selected, the subdivision classification formula is: ;in, The confidence level of the general detection model when classifying the corresponding major category is obtained by combining the corresponding major category classification result with the sub-category classification result.

[0009] Further, training of the general detection model: The general detection model is trained using class labels and their corresponding data, employing a hybrid approach of confidence-based multi-class cross-entropy loss and bounding box-based regression loss; the cross-entropy loss function is... :

[0010] in, It is the number of object detection boxes. Let j be the true label of the j-th candidate region belonging to class c; one-hot encoding is used. Let be the predicted probability that the j-th candidate region belongs to the c-th class; In order to avoid To approximate 0, additional adjustments are made during softmax generation:

[0011] in, For the target input vector, It is a positive correction value; The regression loss function is:

[0012] in, The number of detection frames. The predicted location of the candidate region. This represents the actual detection frame location; For smoothing functions, the input is... The specific structure is as follows: .

[0013] Further, the expert model is trained using the detailed labels and the confidence distribution S output by the general detection model, along with the corresponding bounding box positions. The loss function includes two classification losses and a bounding box regression loss, specifically expressed as follows:

[0014] in, For the major category classification loss function, To refine the classification loss function, Let be the regression loss function for the detection box. and All are positive values ​​between 0 and 1.

[0015] Furthermore, the aforementioned method of combining the outputs of the general detection model and the expert model to construct a predicted trajectory based on time-series data, and then dynamically adjusting the new major category confidence threshold and sub-category confidence threshold to correct the previous detection results, specifically: S1. Based on the output results of the general detection model and the expert model, the track being tracked is formed. Kalman filtering (an algorithm that uses the state equation of a linear system to make the optimal estimate of the system state through the system input and output observation data) is introduced into all existing trajectories to predict the position of the target and its corresponding motion state in the next frame. S2. Obtain the predicted bounding boxes and corresponding major category classification results in the current frame. Collect targets that do not meet the requirements of sub-classification and major category classification as determined by the routing algorithm and obtain their detection box sequence lengths. Design a dynamically changing confidence threshold based on the detection box sequence length. ; S3. Determine whether the detection box of a target that does not meet the requirements of sub-classification and major category classification matches its predicted box. If so, adjust the corresponding sub-classification confidence threshold to Conf- Adjust the corresponding major category classification confidence threshold to conf_low- ; S4. For targets whose confidence level during historical detection is lower than the original threshold but higher than the reduced threshold, save them; for targets whose confidence level during historical detection is lower than the reduced threshold, delete them. Use the Hungarian algorithm (Kuhn-Munkres, a combinatorial optimization algorithm for solving the maximum weight matching problem in bipartite graphs, which continuously adjusts the matching relationship by finding augmenting paths and can efficiently find the optimal matching scheme for elements of two sets in a bipartite graph) to perform trajectory matching for all saved targets, and calculate the distance cost between detection boxes by calculating the corresponding Mahalanobis distance. S5. For a detection box-trajectory that is successfully matched by the Hungarian algorithm, the detection box belongs to this trajectory. The Kalman filter corresponding to the trajectory is updated, and the length of the detection box sequence of the trajectory is increased by 1. For a detection box that fails to match any existing trajectory or has no previous trajectory, if it meets the subdivision classification and the confidence level is higher than the preset high threshold conf_high, the target detection box belongs to a high-quality target. It is used as the starting point of the new trajectory, and the corresponding Kalman filter is updated.

[0016] Furthermore, in step S1, each target contains parameters in eight dimensions: These correspond to the position of the detection box and the corresponding rate of change in the four dimensions, respectively. The state transition matrix and covariance matrix are used to predict the target's position and corresponding motion state in the next frame. The state transition matrix prediction formula is as follows: , F Here is the state transition matrix; the covariance matrix prediction formula is: , The noise covariance during the state transition process; Furthermore, in step S2, the confidence threshold... The calculation formula is:

[0017] in, The decay coefficient is i, and the sequence length is i. Furthermore, in step S3, the formula for calculating the Mahalanobis distance is:

[0018] in, Here, H represents the observed values ​​of the detection box, and H is the observation matrix used to extract the corresponding state information. This represents the covariance of the corresponding Kalman filter.

[0019] (ii) The present invention also provides a computer-readable storage medium storing a computer program that enables a computer to execute the traffic target detection and inter-frame dynamic adjustment method described above.

[0020] (iii) The present invention also provides an electronic device, including: a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the traffic target detection and inter-frame dynamic adjustment method described above. The beneficial effects of this invention are: 1. The quality of visual data collected during intelligent transformation is uncontrollable, resulting in varying accuracy requirements for target detection in different scenarios. This invention addresses these practical detection needs by establishing a new model that balances the trade-offs between large-class detection and small-class regression. Furthermore, for time-series images, the superior detection results of large targets can assist in the subsequent detection of smaller targets. This combination provides robustness even with less-than-ideal edge hardware. 2. Addressing the issue that a significant portion of current traffic analysis data originates from older camera equipment, and that newer equipment is susceptible to interference, thus limiting data quality, this invention designs a cascaded, multi-level detection model. This model balances high-accuracy fuzzy detection with detailed detection based on high-quality data. Furthermore, considering edge computing hardware, a routing algorithm controls some expert models to participate in detailed detection. This effectively balances the algorithm's performance and resource consumption across different devices. 3. In time-series data, high-quality, large-scale targets can be used to assist in the detection of small targets on the same trajectory. Therefore, in this invention, a high-quality target is selected as the starting point of the trajectory. By predicting the position information of its subsequent detection boxes, the confidence threshold of similar targets within the range is dynamically iterated. After further matching, targets with insignificant features that were not detected before are retained. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the multi-level label structure of the present invention; Figure 2 This is a schematic diagram of the hierarchical network model of the cascaded structure of this invention; Figure 3 This is a schematic diagram of the expert network structure of this invention; Figure 4 This is a flowchart of the predictive dynamic threshold adjustment process of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the embodiments and accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, 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.

[0023] In one embodiment, this invention proposes a traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model. The goal of this method is to adapt to the needs of fuzzy detection and hierarchical refinement detection in different scenarios, and to optimize historical and subsequent detection results through temporal data features. The method can be divided into the following stages: 1. Data collection of temporal images and construction of corresponding layer labels; 2. Construction of the cascaded hierarchical network and corresponding model training; 3. Temporal trajectory prediction of the target and dynamic parameter adjustment.

[0024] The first phase primarily aims to collect time-series response data and construct standard-compliant label types. The second part involves designing a cascaded network structure. A pre-built general detection module performs fuzzy classification of the data, i.e., broad target classification. Based on subsequent routing results, different detection results are output using a hybrid expert model (MOE) to further refine and regress the detection results. Model training is divided into two steps: first, a general detection model is trained using all data; second, different expert models are trained using refined label data and the general module. The third part involves dynamic parameter adjustment based on trajectory prediction. This combines current detection results to predict the subsequent target's location, achieving parameter adjustment within a local area. The specific steps of each phase are as follows: Phase 1: Data collection and corresponding level tag construction Step 1: Determine the source of the data.

[0025] (1) Traffic monitoring equipment data: time-series traffic flow data collected from roadside cameras; (2) Road patrol traffic data: This includes time-series data collected by cameras mounted on patrol vehicles and patrol drones. During the data collection process, it is necessary to fully acquire data information from different scenarios to enhance the robustness of the model and avoid overfitting caused by a single scenario.

[0026] Step 2: Data preprocessing and label creation.

[0027] Traffic time-series data, including training data and detection data.

[0028] First, data with overexposure or other anomalies in the time series data is filtered out. Second, a multi-level label structure is established based on the current scenario requirements. Labels are divided into two main categories: the first category is the target's fuzzy label, also known as the broad category label (Label1, Label2, ..., LabelN); the second category is the target's detailed sub-labels (Label-n, (Label1-1, Label1-2, ..., Label1-n), ..., (LabelN-1, ..., LabelN-m)). The broad category label needs to be significantly different from the target. The specific label structure is as follows... Figure 1 As shown.

[0029] Phase Two: Construction of the cascaded hierarchical network and corresponding model training 1. Construct a hierarchical network model with a cascaded structure. The Cascaded Hierarchical Network With Layered Structure Model (CHN-L) includes a general detection model and an expert model, with different expert or hybrid expert models selected through a routing algorithm. The specific structure is as follows: Figure 2 As shown.

[0030] For general detection models, the main structure is a single-stage network structure, which consists of a feature extraction module (Backbone), a feature fusion module (Neck), and a detection layer (Detect). At the end of the detection layer, the result is directly output as the maximum value without confidence. The Backbone is used to extract features from the input image. Through a cascaded network model, features are extracted from the image multiple times and feature layers of different scales are generated. An attention mechanism model is added to the output feature layers to enhance the feature representation of the current detection target. The Neck layer is primarily responsible for fully fusing different feature layers. It employs a BiFPN bidirectional feature pyramid fusion structure, inputting the feature layers output from the feature extraction module into the BiFPN network for cross-scale feature fusion. This fully integrates the expressions between different high-level and low-level semantics, resulting in a fused multi-scale feature map. The detection layer is used to detect the fused multi-scale feature map, performing regression prediction and non-maximum suppression (NMS) on the target type and detection box, and then using the softmax function to obtain the confidence distribution S for the corresponding detection type. Specifically, the confidence distribution S(s1, s2, ..., sN) includes the detection center coordinates (cent_x, cent_y) and the corresponding detection box size (w, h). Through modular design, different structures can be selected based on the significant differences between large and small classes in the actual scenario, and the depth and breadth of the model can be determined according to the specific task.

[0031] For expert models, each major category corresponds to its own expert model. The structure of each expert model remains consistent, including a bounding box regressor and a classifier. The bounding box regressor is a convolutional structure used for bounding box regression, and the classifier is a convolutional structure used for classification. Both have the same overall structure, consisting of pooling layers, a convolutional network (CNN), a fully connected network (FC layer), and activation functions, respectively. The specific structure is as follows: Figure 3 As shown, the two differ in breadth and depth. Expert models are not fully activated during the reasoning process; this significantly reduces the computational resources required for reasoning. The specific expert models activated are determined by the routing algorithm.

[0032] In the expert model, the bounding box regressor is used to detect the specific location of the target object in the image, and the output is a bounding box of length 1. A one-dimensional vector, where n is the number of subcategories under the current major category, and 1 represents the corresponding background; the classifier is used to determine which specific subcategory the target object belongs to, and the output is... The one-dimensional feature structure represents the offset of the detection box center point and the offset of the detection box size, respectively. To reduce computational cost, the feature layer of the general detection model is input into the corresponding expert model, and the detailed classification confidence distribution in the corresponding expert model is obtained through the corresponding convolutional network. And the detection box offset. If only one expert model is selected, then output directly. The final classification result is cls; if more than one expert model is selected, the subdivision classification formula is:

[0033] in, The confidence score for the general detection model when classifying the corresponding major category is calculated by combining the major category classification result with the sub-category classification result. To distinguish the differences in results within the major category classification, the result is squared.

[0034] 2. Training of the general detection model The training of the general model is consistent with that of the single-stage network, using the first major class of data and its corresponding class label for supervised training. During this part of the training, a hybrid loss function based on confidence-based multi-class cross-entropy and a regression loss function based on detection boxes is used.

[0035] The cross-entropy loss function is :

[0036] in, It is the number of object detection boxes. Let j be the true label of the j-th candidate region belonging to class c; one-hot encoding is used. Let be the predicted probability that the j-th candidate region belongs to the c-th class. To avoid... To approximate 0, additional adjustments are made during softmax generation:

[0037] in, For the target input vector, It is a positive correction value; The regression loss function is:

[0038] in, The number of detection frames. The predicted location of the candidate region. This represents the actual detection frame location; For smoothing functions, the input is... The specific structure is as follows: .

[0039] 3. Training of expert models The expert model is trained using multi-level classification labels (Label-n) corresponding to the soft labels of the general detection model. The teacher model obtains the soft labels for the corresponding major categories and the corresponding bounding box positions through object detection inference. The major category classification and the sub-categorical classification together constitute the classification loss function. Due to the significant differences between major categories, the classification loss function is primarily based on the major category, supplemented by the sub-categorical classification loss. The total loss function includes two classification losses and the bounding box regression loss, specifically expressed as:

[0040] in, For the major category classification loss function, To refine the classification loss function, Let be the regression loss function for the detection box. and All values ​​are positive, ranging from 0 to 1. During expert model training, the general detection model weights must first be frozen, and only after a certain number of rounds can the model weights be unfrozen and trained together.

[0041] 4. Selection of expert models for routing algorithms Step 1: Judgment of fuzzy results of routing algorithm To avoid putting excessive pressure on the overall computation process due to a large number of mixed expert models, the routing algorithm determines whether secondary classification of the target is needed and which specific expert model to use.

[0042] Let Conf be the set of confidence thresholds for each major category that satisfy the subcategories. If the major category classification confidence distribution S output by the general detection model satisfies... If conf_low <, then no major category results will be output, and the target will be deleted; if conf_low < < If the condition is met, the corresponding major category classification result (fuzzy result classification) will be directly output, and the corresponding format is (cls, s, cent_x, cent_y, w, h), which correspond to the target type, confidence score, detection center, and detection box size, respectively; if the condition is met... and If the target's features meet the requirements for secondary classification, then proceed to step 2.

[0043] Where N is the number of major categories, It is the highest confidence level among N major categories, where i is The corresponding major categories, conf_low is the minimum confidence threshold for the sub-classification of category i, and conf_low is the preset minimum confidence threshold.

[0044] Step 2: Threshold determination of expert model for routing algorithm For the goal of satisfying the secondary classification requirement, that is, satisfying and Based on the target confidence distribution (s1, s2, ..., sN), the K expert models with the highest scores are selected (Top-k routing). K is typically 1-3 types, depending on the device's performance and the confidence distribution. The number of activated expert models determines the sufficiency of subsequent bounding box regression classification. Device performance varies depending on the situation. The expert models selected for the confidence distribution can be obtained through several steps: First, a static confidence threshold is preset for class i. Calculate the dynamic confidence threshold: ; mean confidence level for:

[0045] The mean is determined by the number of specific categories.

[0046] Define its standard deviation for:

[0047] The final subdivision and classification threshold is:

[0048] in, It is the confidence level standard deviation. The corresponding threshold coefficient is used to adjust the selection of the expert model. The larger the confidence level, the fewer expert models will be selected, requiring a significant difference in the distribution of confidence scores; conversely... The larger the value, the less variability in the confidence distribution. The value of also depends on the situation.

[0049] for If the confidence distribution is accurate, then the target is considered to have sufficient features to meet the classification requirements of the expert model. If the confidence distribution is such that the target satisfies the broad category classification but not the sub-category classification, the corresponding broad category classification result is directly output. For Then the threshold will be filtered.

[0050] All values ​​greater than 1 in the confidence distribution S The establishment of confidence requires a corresponding set of major categories. .in, It is the confidence score of the i-th major category.

[0051] Step 3: Activation of the expert model for the routing algorithm When the large category set The number of elements in the middle satisfies When this happens, the corresponding type of expert model is selected as the activation model for subsequent sub-classification. When the set of major categories... The number of elements in the middle satisfies When the set of major categories is large, the three expert models with the highest confidence are selected as the activation models for subsequent sub-classification. The number of elements in the middle satisfies In this case, only the expert model with the highest confidence level will be activated.

[0052] Phase 3: Dynamic Adjustment of Confidence Based on Trajectory Prediction The third stage mainly involves: acquiring high-quality targets as the starting trajectory; predicting the positions of subsequent targets by combining all existing trajectories; adjusting the threshold range based on the targets; matching existing trajectories, deleting redundant data, and updating parameters. The specific process is as follows: Figure 4 As shown.

[0053] Step 1: Based on the output results of the general detection model and the expert model, the track being tracked is formed. Kalman filtering is introduced into all existing trajectories to predict the target's position and corresponding motion state in the next frame.

[0054] Each target contains parameters in 8 dimensions: These correspond to the position of the detection box and the rate of change in the four dimensions, respectively. The state transition matrix and covariance matrix are used to predict the target's position and corresponding motion state in the next frame. The formula for predicting the state transition matrix is: , F Let be the state transition matrix.

[0055] The formula for predicting the covariance matrix is: , This represents the noise covariance during the state transition process.

[0056] Step 2: Obtain the predicted bounding boxes and corresponding major category classification results in the current frame; collect targets that do not meet the requirements of sub-classification and major category classification as determined by the routing algorithm and obtain their detection box sequence lengths; design a dynamically changing confidence threshold based on the detection box sequence lengths. As the trajectory length increases, its threshold gradually increases, but the rate of increase decreases.

[0057] Confidence threshold The calculation formula is:

[0058] in, is the attenuation coefficient, and i is the sequence length.

[0059] Step 3: Determine whether the detection boxes of targets that do not meet the requirements of sub-classification and major category classification match their predicted boxes. If so, adjust the corresponding sub-classification confidence threshold to Conf- Adjust the corresponding major category classification confidence threshold to conf_low- .

[0060] Step 4: Save targets whose confidence level during historical detection is lower than the original threshold but higher than the reduced threshold. Delete targets whose confidence level during historical detection is lower than the reduced threshold. Perform trajectory matching on all saved targets using the Hungarian algorithm, and calculate the distance cost between detection boxes by calculating the corresponding Mahalanobis distance. The formula for calculating Mahalanobis distance is:

[0061] in, Here, H represents the observed values ​​of the detection box, and H is the observation matrix used to extract the corresponding state information. This represents the covariance of the corresponding Kalman filter.

[0062] Step 5: For a detection box-trajectory successfully matched by the Hungarian algorithm, the detection box belongs to this trajectory. Update the Kalman filter corresponding to the trajectory, and increment the detection box sequence length of the trajectory by 1. For a detection box that fails to match any existing trajectory or for which no previous trajectory exists, if it meets the subdivision classification requirements and its confidence level is higher than the preset high threshold conf_high, then the target detection box belongs to a high-quality target and is used as the starting point for a new trajectory. Update the corresponding Kalman filter.

[0063] In another embodiment, the present invention provides a computer-readable storage medium storing a computer program that causes a computer to perform the traffic target detection and inter-frame dynamic adjustment method as described above.

[0064] In another embodiment, the present invention provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the traffic target detection and inter-frame dynamic adjustment method as described above.

[0065] This invention, based on real-world traffic data, constructs a cascaded network structure to route different expert models for secondary classification of targets. It then builds predicted trajectories incorporating time-series data and dynamically adjusts the returned parameters to correct previous detection results. This approach fully considers potential fuzzy classification scenarios in actual production, leveraging the advantages of time-series data while addressing the performance limitations of edge devices. By dynamically adjusting routing and parameters, it achieves superior results.

[0066] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A method for traffic target detection and inter-frame dynamic adjustment based on a cascaded multi-level routing detection model, characterized in that, Includes the following steps: Collect traffic time-series data, including training data and detection data; Based on the training data, a multi-level label structure is established, dividing the data into two categories of labels: the first category is the major category label of the target, and the second category is the sub-category label of the target. A cascaded hierarchical network model is constructed, including a general detection model and an expert model. The general detection model is trained using broad category labels and corresponding data, while the expert model is trained using detailed labels and corresponding data. The trained general detection model is used to classify the detection data into major categories to obtain the major category classification results. The routing algorithm determines whether the major category classification result meets the target's sub-classification requirements. If so, the corresponding trained expert model or hybrid expert model is selected, the major category classification result is input into the corresponding expert model for sub-classification, and the sub-classification result is output. By combining the outputs of the general detection model and the expert model, a prediction trajectory is constructed using time-series data. The previous detection results are corrected by dynamically adjusting the new major category confidence threshold and sub-category confidence threshold.

2. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, The general detection model includes a feature extraction module, a feature fusion module, and a detection layer; The feature extraction module is used to extract features from the input image. After multiple feature extractions of the image through a cascaded network model, feature layers of different scales are generated. The feature layers are output through an attention mechanism model. The feature fusion module is used to fully fuse different feature layers. It adopts a BiFPN bidirectional feature pyramid feature fusion structure, inputs the feature layer output by the feature extraction module into the BiFPN network to perform cross-scale feature fusion, and obtains the fused multi-scale feature map. The detection layer is used to detect the fused multi-scale feature map and obtain the detection center coordinates, detection box size, and target class classification confidence distribution S.

3. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, The process of determining whether the major category classification results need to be further subdivided into target categories and the selection of expert models are as follows: S1. Let Conf be the set of confidence thresholds for each major category that satisfy the sub-classification. If the major category classification confidence distribution S output by the general detection model satisfies... If conf_low <, then delete the target; if conf_low < < If the condition is met, the corresponding major category classification result will be output directly; if the condition is met, the classification result will be output directly. and Then proceed to step S2; Where N is the number of major categories, It is the highest confidence level among N major categories, where i is The corresponding major categories, conf_low is the minimum confidence threshold for the sub-classification of category i, and conf_low is the preset minimum confidence threshold. S2, if and First, a static confidence threshold is preset for class i. Calculate the dynamic confidence threshold: , It is the confidence level standard deviation. This corresponds to the threshold coefficient; like Then the objective satisfies the expert model's requirement for detailed classification, and all confidence values ​​greater than 1 in the confidence distribution S are included. The establishment of confidence requires a corresponding set of major categories. ;like If the target satisfies the broad category classification but not the sub-category classification, the corresponding broad category classification result is directly output; where, It is the confidence score of the i-th major category; S3, When the large category set The number of elements in the middle satisfies When the corresponding expert model is selected, it becomes the activation model for subsequent sub-classification; when the set of major categories... The number of elements in the middle satisfies When the confidence level is high, the three expert models with the highest confidence are selected as the activation models for subsequent sub-classification; (Class set) The number of elements in the middle satisfies In this case, only the expert model with the highest confidence level will be activated.

4. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, The expert model includes a bounding box regressor and a classifier; The bounding box regressor is a convolutional structure used for bounding box regression, and the classifier is a convolutional structure used for classification. The bounding box regressor and the classifier respectively include a pooling layer, a convolutional network, a fully connected network, and an activation function layer. The detection box regressor is used to detect the specific location of the target object in the image, and the output is a bounding box with a length of [missing information]. The vector is a one-dimensional vector, where n is the number of subcategories under the current major category, and 1 represents the corresponding background. The classifier is used to determine which subcategory the target object belongs to, and the output is the offset of the center point of the detection box and the offset of the size of the detection box. The feature layer of the general detection model is input into the corresponding expert model, and the detailed classification confidence distribution in the corresponding expert model is obtained through the corresponding convolutional network. And the detection box offset; if only one expert model is selected, then output directly. The final classification result is cls; if more than one expert model is selected, the subdivision classification formula is: in, This represents the confidence level of the general detection model when classifying the corresponding major category.

5. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, Training of the general detection model: The general detection model is trained using class labels and their corresponding data, and a combination of confidence-based multi-class cross-entropy loss function and detection box-based regression loss function is selected. The cross-entropy loss function is : in, It is the number of object detection boxes. Let j be the true label of the j-th candidate region belonging to class c; one-hot encoding is used. Let be the predicted probability that the j-th candidate region belongs to the c-th class; In order to avoid When the value is close to 0, additional corrections are added during softmax generation: in, For the target input vector, It is a positive correction value; The regression loss function is: in, The number of detection frames. The predicted location of the candidate region. This represents the actual detection frame location; For smoothing functions, the input is... The specific structure is as follows: 。 6. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, Training the expert model: The expert model is trained using data from detailed labels and the output of a general detection model. The loss function includes two classification losses and a bounding box regression loss, specifically expressed as follows: in, For the major category classification loss function, To refine the classification loss function, Let be the regression loss function for the detection box. and All are positive values ​​between 0 and 1.

7. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 1, characterized in that, The method involves combining the outputs of a general detection model and an expert model to construct a predicted trajectory based on time-series data. This is achieved by dynamically adjusting the new major category confidence threshold and sub-category confidence threshold, thereby correcting the previous detection results. Specifically: S1. Based on the output results of the general detection model and the expert model, the track being tracked is formed. Kalman filtering is introduced into all existing trajectories to predict the target's position and corresponding motion state in the next frame. S2. Obtain the predicted bounding boxes and corresponding classification results in the current frame. Collect targets that do not meet the requirements of sub-classification and major-class classification as determined by the routing algorithm and obtain their detection box sequence lengths. Design a dynamically changing confidence threshold based on the detection box sequence length. ; S3. Determine whether the detection box of a target that does not meet the requirements of sub-classification and major category classification matches its predicted box. If so, adjust the corresponding sub-classification confidence threshold to Conf- Adjust the corresponding major category classification confidence threshold to conf_low- ; S4. For targets whose confidence level is less than the original threshold but greater than the reduced threshold during historical detection, save them; for targets whose confidence level is less than the reduced threshold during historical detection, delete them; use the Hungarian algorithm to perform trajectory matching on all saved targets, and calculate the distance cost between detection boxes by calculating the corresponding Mahalanobis distance. S5. For a detection box-trajectory that is successfully matched by the Hungarian algorithm, the detection box belongs to this trajectory. The Kalman filter corresponding to the trajectory is updated, and the length of the detection box sequence of the trajectory is increased by 1. For a detection box that fails to match any existing trajectory or has no previous trajectory, if it meets the subdivision classification and the confidence level is higher than the preset high threshold conf_high, the target detection box belongs to a high-quality target. It is used as the starting point of the new trajectory, and the corresponding Kalman filter is updated.

8. The traffic target detection and inter-frame dynamic adjustment method based on a cascaded multi-level routing detection model according to claim 7, characterized in that, In step S1, each target contains parameters in 8 dimensions: These correspond to the position of the detection box and the rate of change in the four dimensions, respectively. The state transition matrix and covariance matrix are used to predict the target's position and corresponding motion state in the next frame. The formula for predicting the state transition matrix is: , F This is the state transition matrix; The formula for predicting the covariance matrix is: , The noise covariance during the state transition process; In step S2, the confidence threshold The calculation formula is: in, The decay coefficient is i, and the sequence length is i. In step S3, the formula for calculating the Mahalanobis distance is: in, Here, H represents the observed values ​​of the detection box, and H is the observation matrix used to extract the corresponding state information. This represents the covariance of the corresponding Kalman filter.

9. A computer-readable storage medium storing a computer program, characterized in that, The computer program causes the computer to execute the traffic target detection and inter-frame dynamic adjustment method as described in any one of claims 1-8.

10. An electronic device, characterized in that, include: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the traffic target detection and inter-frame dynamic adjustment method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Image recognition method and related device

    CN111104988A

  • Bottle cap detection method, device, equipment and medium

    CN118429710A

  • Intelligent image recognition method based on hierarchical reasoning and feature progression

    CN118781416A

  • Tunnel boring machine surrounding rock integrity grading method based on image classification

    CN120495776A

  • Multi-target detection and tracking method

    CN120726539A