Improved byte track pedestrian multi-target tracking method and related device

By implementing high and low confidence levels and two-stage matching in the ByteTrack algorithm, and combining lightweight appearance features and IoU motion information, the problem of mismatch in dense occlusion and similar pedestrian scenes is solved, improving the accuracy and robustness of multi-target tracking and achieving continuous and stable trajectory updates.

CN123182269APending Publication Date: 2026-11-27LANZHOU JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611522856.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-29
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

The existing ByteTrack algorithm is prone to mismatch and identity switching problems in dense occlusion and similar pedestrian scenes, and lacks effective appearance discrimination ability, resulting in insufficient accuracy and robustness in multi-target tracking.

Method used

By classifying the detection boxes into high and low confidence levels, lightweight appearance features of high-confidence detection boxes are extracted and combined with IoU motion information to construct a joint cost matrix. The position is predicted by Kalman filter, and a two-stage matching is performed using the Hungarian algorithm to fuse appearance and motion information and update the trajectory state.

Benefits of technology

It improves target tracking accuracy and identity consistency in complex scenarios, solves the mismatch problem caused by occlusion and similar pedestrians, maintains the efficiency and real-time performance of the algorithm, and ensures continuous and stable trajectory iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182269A_ABST
    Figure CN123182269A_ABST
Patent Text Reader

Abstract

The application discloses an improved ByteTrack pedestrian multi-target tracking method and related device, and relates to the technical field of computer vision. The method comprises the following steps: acquiring a current frame image and a historical trajectory set, each historical trajectory corresponding to a tracked target, comprising a lightweight appearance template and a motion state; inputting the current frame into YOLOX to obtain a detection frame and a confidence score, and dividing the detection frame into a high-confidence detection frame set and a low-confidence detection frame set; extracting a lightweight appearance feature from the high-confidence detection frame, calculating a lightweight appearance distance, and constructing a lightweight appearance distance matrix; generating a predicted frame by using a Kalman filter, calculating an IoU distance, and constructing an IoU matrix; fusing the two matrices to construct a joint cost matrix, and completing the first-stage matching by using a Hungarian algorithm; performing the second-stage matching on the historical trajectories that are not matched in the first stage and the low-confidence detection frame, and updating the historical trajectories according to the two-stage matching results. The application can improve the precision and robustness of pedestrian multi-target tracking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to an improved ByteTrack pedestrian multi-target tracking method and related apparatus. Background Technology

[0002] With the development of intelligent surveillance, smart transportation, and urban public safety systems, multi-object pedestrian tracking has significant application value in video understanding tasks. Its goal is to simultaneously locate multiple pedestrians in a continuous video sequence while maintaining consistency in the identity of the same target across different frames. Currently, most mainstream multi-object tracking methods employ a detection-by-detection framework, which first uses detectors to obtain bounding boxes and then generates continuous trajectories through motion prediction and data association. However, in densely populated areas, intersecting traffic, and scenes with long-term occlusion, pedestrians often overlap significantly, and detection boxes are prone to shifting, truncation, or decreased confidence, leading to trajectory breaks, identity switching, and failure to re-identify the target.

[0003] Early online multi-object tracking methods primarily relied on motion prediction and spatial overlap to associate targets. Simple Online and Realtime Tracking (SORT) uses Kalman filtering to predict target states and the Hungarian algorithm to complete data association, offering advantages such as simple structure and high speed. However, it lacks appearance discrimination capabilities and is prone to identity confusion in occluded and overlapping target scenarios. To enhance identity preservation, methods such as Deep Simple Online and Realtime Tracking (DeepSORT) based on deep appearance features further introduce re-identification (ReID) appearance features, combining motion and appearance information for data association, which improves occlusion recovery and similar target differentiation to some extent. However, traditional ReID networks typically have a large number of parameters, and directly introducing them into the online tracking framework increases inference overhead. ByteTrack achieves good overall performance by fully utilizing low-confidence detection boxes without explicitly introducing complex appearance models. This method has a simple structure and high operating efficiency, but its association process still mainly relies on IoU and motion information. In scenarios with dense occlusion and similar pedestrians, relying solely on spatial overlap may still result in mismatches.

[0004] Therefore, how to effectively improve the target identity discrimination capability in complex scenarios and alleviate the mismatch problem caused by dense occlusion and interference from similar pedestrians while retaining the simplicity and efficiency of the ByteTrack algorithm is the focus of multi-target tracking technology research. Summary of the Invention

[0005] The purpose of this application is to provide an improved ByteTrack pedestrian multi-target tracking method and related apparatus, which can improve the accuracy and robustness of pedestrian multi-target tracking.

[0006] To achieve the above objectives, this application provides the following solution: Firstly, this application provides an improved ByteTrack pedestrian multi-target tracking method, including: Obtain the current frame image and the historical trajectory set; the historical trajectory set includes several historical trajectories, each historical trajectory corresponds to a tracked target, and the historical trajectory includes the lightweight appearance template and motion state of the corresponding tracked target.

[0007] The current frame image is input into the YOLOX detector to obtain the detection bounding box and confidence score of each detected target.

[0008] Based on a preset confidence threshold, the detection boxes of each detection target are divided into high-confidence detection boxes and low-confidence detection boxes, resulting in a set of high-confidence detection boxes and a set of low-confidence detection boxes.

[0009] For the set of high-confidence detection boxes, the lightweight appearance feature vector of each high-confidence detection box is extracted, and combined with the lightweight appearance template of each historical trajectory, the lightweight appearance distance between each high-confidence detection box and each historical trajectory is calculated to construct a lightweight appearance distance matrix.

[0010] Based on the motion state of each historical trajectory, a Kalman filter is used to predict the position of the tracked target corresponding to each historical trajectory in the current frame image, and a prediction box is generated based on the position.

[0011] Calculate the IoU distance between each predicted bounding box and each high-confidence detection bounding box, and construct the IoU distance matrix.

[0012] Based on the lightweight apparent distance matrix and the IoU distance matrix, a joint cost matrix is ​​constructed.

[0013] Based on the joint cost matrix, the Hungarian algorithm is used to perform a first-stage matching between each high-confidence detection box and each historical trajectory to obtain the first-stage matching result.

[0014] For the set of low-confidence detection boxes, unmatched historical trajectories in the first stage are obtained, the IoU distance between the predicted box corresponding to the unmatched historical trajectory and each low-confidence detection box is calculated, an IoU cost matrix is ​​constructed, and the Hungarian algorithm is used to perform a second-stage matching between the unmatched historical trajectory and each low-confidence detection box based on the IoU cost matrix to obtain the second-stage matching result.

[0015] Based on the matching results of the first stage and the matching results of the second stage, the historical trajectories of each tracked target are updated.

[0016] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the improved ByteTrack pedestrian multi-target tracking method described above.

[0017] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the improved ByteTrack pedestrian multi-target tracking method described above.

[0018] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the improved ByteTrack pedestrian multi-target tracking method described above.

[0019] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides an improved ByteTrack pedestrian multi-target tracking method and related apparatus. It acquires a current frame image and a historical trajectory set; the historical trajectory set includes several historical trajectories, each corresponding to a tracked target, and maintains a corresponding lightweight appearance template and motion state. The current frame image is input into a YOLOX detector to obtain the detection box and confidence score for each detected target. These are divided into high-confidence and low-confidence detection boxes, solving the problem of low-quality detection samples interfering with tracking matching under the unified matching mode, achieving accurate classification of detection samples, and laying the foundation for implementing differentiated matching strategies. By extracting lightweight appearance feature vectors from high-confidence detected targets, and combining trajectory appearance features with IoU motion information to construct a joint cost matrix for matching, it solves the shortcomings of traditional ByteTrack, which relies solely on IoU motion matching and is prone to ID jumps and mismatches in occluded scenes. It achieves fusion matching of target appearance and motion information, significantly improving target tracking accuracy and identity consistency in normal and slightly occluded scenes. By employing a differentiated matching strategy that uses only IoU matching for unmatched historical trajectories and low-confidence detection boxes, this approach addresses the issues of blurriness, occlusion, and feature distortion in low-confidence detection boxes. It also mitigates the problems of appearance drift and matching failure caused by introducing apparent features, enabling the effective utilization of low-quality detection samples. This strategy preserves missed target trajectories without increasing computational overhead, balancing the algorithm's tracking integrity and real-time performance. Furthermore, by fusing the results of two matching operations to uniformly update the trajectory state, the approach resolves the issues of trajectory state discontinuity and chaotic updates after segmented matching. This achieves continuous and stable iteration of historical trajectories, effectively improving the robustness of multi-target tracking in complex scenarios such as dense pedestrian traffic and overlapping occlusions. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is an application environment diagram of an improved ByteTrack pedestrian multi-target tracking method according to an embodiment of this application; Figure 2 A flowchart illustrating an improved ByteTrack pedestrian multi-target tracking method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

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

[0023] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] The improved ByteTrack pedestrian multi-target tracking method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send the current frame image and historical trajectory set to server 104. Server 104 receives the current frame image and historical trajectory set to be processed. The historical trajectory set includes several historical trajectories, each corresponding to a tracked target. The historical trajectory includes the lightweight appearance template and motion state of the corresponding tracked target. Server 104 inputs the current frame image into a YOLOX detector to obtain the detection box and confidence score of each detected target. According to a preset confidence threshold, the detection boxes of each detected target are divided into high-confidence detection boxes and low-confidence detection boxes, resulting in a set of high-confidence detection boxes and a set of low-confidence detection boxes. For the high-confidence detection box set, the lightweight appearance feature vector of each high-confidence detection box is extracted, and combined with the lightweight appearance template of each historical trajectory, the lightweight appearance distance between each high-confidence detection box and each historical trajectory is calculated to construct a lightweight appearance distance matrix. Based on the motion state of each historical trajectory, Kalman filtering is used. The system predicts the position of the tracked target corresponding to each historical trajectory in the current frame image and generates a prediction box based on the position. It calculates the IoU distance between each prediction box and each high-confidence detection box, constructing an IoU distance matrix. Based on the lightweight apparent distance matrix and the IoU distance matrix, it constructs a joint cost matrix. Based on the joint cost matrix, it performs a first-stage matching between each high-confidence detection box and each historical trajectory using the Hungarian algorithm, obtaining the first-stage matching result. For the set of low-confidence detection boxes, it obtains the unmatched historical trajectories from the first stage, calculates the IoU distance between the prediction box corresponding to the unmatched historical trajectory and each low-confidence detection box, constructs an IoU cost matrix, and uses the Hungarian algorithm to perform a second-stage matching between the unmatched historical trajectories and each low-confidence detection box based on the IoU cost matrix, obtaining the second-stage matching result. Based on the first-stage matching result and the second-stage matching result, it updates the historical trajectory of each tracked target. The server 104 can feed back the updated trajectory status to the terminal 102. In addition, in some embodiments, the improved ByteTrack pedestrian multi-target tracking method can also be implemented by the server 104 or the terminal 102 separately. For example, the terminal 102 can directly perform multi-target tracking processing on the current frame image, or the server 104 can obtain the current frame image and historical trajectory set from the data storage system and perform multi-target tracking processing on the current frame image.

[0025] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.

[0026] In one exemplary embodiment, such as Figure 2 As shown, an improved ByteTrack pedestrian multi-target tracking method is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 210: Step 201: Obtain the current frame image and the historical trajectory set; the historical trajectory set includes several historical trajectories, each historical trajectory corresponds to a tracked target, and the historical trajectory includes the lightweight appearance template and motion state of the corresponding tracked target.

[0027] Step 202: Input the current frame image into the YOLOX detector to obtain the detection box and confidence score of each detected target.

[0028] Step 203: Divide the detection boxes of each detection target into high-confidence detection boxes and low-confidence detection boxes according to the preset confidence threshold, and obtain the set of high-confidence detection boxes and the set of low-confidence detection boxes.

[0029] Step 204: For the set of high-confidence detection boxes, extract the lightweight appearance feature vector of each high-confidence detection box, and combine it with the lightweight appearance template of each historical trajectory to calculate the lightweight appearance distance between each high-confidence detection box and each historical trajectory, and construct the lightweight appearance distance matrix.

[0030] Step 205: Based on the motion state of each historical trajectory, use a Kalman filter to predict the position of the tracked target corresponding to each historical trajectory in the current frame image, and generate a prediction box based on the position.

[0031] Step 206: Calculate the IoU distance between each predicted bounding box and each high-confidence detection box, and construct the IoU distance matrix.

[0032] Step 207: Construct a joint cost matrix based on the lightweight apparent distance matrix and the IoU distance matrix.

[0033] Step 208: Based on the joint cost matrix, the high-confidence detection boxes are matched with the historical trajectories using the Hungarian algorithm to obtain the first-stage matching results.

[0034] Step 209: For the set of low-confidence detection boxes, obtain the unmatched historical trajectories in the first stage, calculate the IoU distance between the predicted box corresponding to the unmatched historical trajectory and each low-confidence detection box, construct the IoU cost matrix, and use the Hungarian algorithm based on the IoU cost matrix to perform a second-stage matching between the unmatched historical trajectory and each low-confidence detection box to obtain the second-stage matching result.

[0035] Step 210: Based on the matching results of the first stage and the matching results of the second stage, update the historical trajectory of each tracked target.

[0036] By implementing steps 201 to 210 above, this application addresses the shortcomings of the ByteTrack algorithm, which relies solely on IoU motion correlation and lacks appearance constraints. It performs high- and low-confidence tiered processing on the detection boxes and constructs a two-stage differentiated matching mechanism: for high-confidence detection boxes, a joint cost matrix is ​​constructed by fusing lightweight appearance features and IoU motion information, and matching is completed to suppress ID jumps and mismatches in occluded scenarios; for low-confidence detection boxes, only the IoU cost matrix is ​​constructed and matching is completed to avoid appearance drift caused by feature distortion of detection samples, thereby fully utilizing the role of low-quality detection samples and controlling overall computational overhead. Subsequently, the historical trajectory is updated uniformly by combining the two-stage matching results to ensure the continuity of trajectory iteration, thereby improving the identity consistency and robustness of multi-target tracking in dense pedestrian and cross-occlusion scenarios.

[0037] As an optional implementation, a dual-threshold strategy can be used to distinguish between high-confidence and low-confidence detection boxes. Specifically, detection boxes are graded and filtered based on their confidence scores. Detection boxes with confidence scores greater than the high-confidence threshold are classified as high-confidence detection boxes and used for the first-stage trajectory association. Detection boxes with confidence scores greater than the low-confidence threshold but less than or equal to the high-confidence threshold are classified as low-confidence detection boxes and used for the second-stage trajectory association. Detection boxes with confidence scores less than or equal to the low-confidence threshold are determined to be invalid detection boxes and are directly discarded. It should be noted that the high-confidence threshold is usually set between 0.25 and 0.7. The default value in the Ultralytics implementation is 0.25, while in the YOLOX detector scenario, it is often set to 0.4 to 0.6. The low-confidence threshold is usually set to 0.1 to filter out detection boxes below this threshold (directly discarded). In practical engineering, the high confidence threshold is usually set by adding a buffer of 0.1 to the base threshold track_thresh (e.g., when track_thresh=0.5, 0.6 is actually used).

[0038] As an optional implementation, step 204 involves extracting the lightweight appearance feature vector of each high-confidence detection box from the set of high-confidence detection boxes, and combining it with the lightweight appearance templates of each historical trajectory to calculate the lightweight appearance distance between each high-confidence detection box and each historical trajectory, thus constructing a lightweight appearance distance matrix. The specific steps are 2041 to 2044. Step 2041: From the set of high-confidence detection boxes, based on the position information of each high-confidence detection box, crop the corresponding target region from the current frame image, and extract the inner center region of the target region as the input image.

[0039] Step 2042: After scaling the input image to a preset size, input it into a lightweight appearance feature extraction network and output the lightweight appearance feature vectors of each high-confidence detection box.

[0040] Step 2043: Normalize the appearance feature vectors of each high-confidence detection target to obtain the normalized lightweight appearance feature vectors of each high-confidence detection box.

[0041] Step 2044: Based on the normalized lightweight appearance feature vectors of each high-confidence detection box and the lightweight appearance templates of each historical trajectory, calculate the lightweight appearance distance between each high-confidence detection box and each historical trajectory, and construct the lightweight appearance distance matrix.

[0042] Specifically, for each detected target in the set of high-confidence detection boxes, the target region is first cropped from the original image based on the detection box position and used as the input image. This input is then fed into a lightweight appearance feature extraction network to obtain the lightweight appearance feature vector for each high-confidence detection box. Considering that the edge regions of the detection boxes may contain background information or local regions of adjacent targets, directly using the complete detection boxes for appearance feature extraction can easily introduce additional interference. Therefore, this embodiment further employs a center region cropping strategy, extracting only the central region inside the detection box as the input of the appearance branch. The height and width ratio thresholds for the center region cropping are both set to 0.7. The cropped target regions are uniformly scaled to 256×128 before being input into the lightweight appearance feature extraction network. The aspect ratio threshold for cropping the central region was set to 0.7. This is because this ratio effectively removes background interference and local areas of adjacent targets at the edges of the detection box, while retaining core discriminative information such as the pedestrian's torso and clothing. This central region cropping aspect ratio threshold has been verified as a good balance point in pedestrian re-identification experiments and is consistent with common threshold experiences in fields such as Non-Maximum Suppression (NMS). Scaling to 256×128 is because this size is a common input standard in the field of pedestrian re-identification, matching the typical aspect ratio of pedestrians (2:1), and maintaining sufficient feature resolution while considering computational efficiency, making it convenient to utilize mainstream pre-trained models.

[0043] This application uses MobileNetV2 as a lightweight appearance feature extraction network. The standard version of MobileNetV2 1.0 (width multiplier of 1.0) is used, with approximately 2.2M parameters. The network retains the inverse residual structure (expansion ratio of 6) and linear bottleneck layers, with an input size of 256×128×3. After global average pooling, it outputs a 128-dimensional normalized appearance feature vector (which can be replaced with a 256-dimensional vector). The recommended training configuration is: Adam optimizer, learning rate 2×10⁻⁶. -4 The batch size is 64, the loss function is a combination of triplet loss and Softmax cross-entropy loss, and data augmentation techniques such as random horizontal flipping and random erasure are employed. For the detected target... d i The apparent feature vector is obtained by extracting it using MobileNetV2: ; in, This represents the MobileNetV2 appearance feature extraction network; d i Indicates the first The corresponding detection target of each high-confidence detection box; Indicates the target of detection d iThe corresponding cropped input image area; Indicates the first The original lightweight appearance feature vector of a high-confidence detection box; express The dimension is 1280; It is the set of real numbers.

[0044] This application uses L2 normalization pairs, and the expression for the L2 normalization process is as follows: ; in, Indicates the first The normalized lightweight appearance feature vector of a high-confidence detection box; This represents the L2 norm.

[0045] When calculating the lightweight apparent distance between each high-confidence detection box and each historical trajectory, this application uses cosine distance calculation, and the formula for calculating the lightweight apparent distance is as follows: ; in, Indicates the first The high-confidence detection box and the first Lightweight apparent distance between lightweight apparent templates of historical trajectories; Indicates the first Normalized lightweight appearance feature vectors of high-confidence detection boxes; Indicates the first A normalized lightweight appearance template for a historical trajectory; This indicates transpose.

[0046] It's important to note that L2 normalization is a prerequisite and mathematical simplification basis for cosine distance calculation. L2 normalization scales the original feature vectors to a unit sphere (i.e., a magnitude of 1). At this point, the denominator in the cosine distance formula (the L2 norm product of the detected feature and the template feature) is always equal to 1 × 1 = 1. The cosine distance is directly simplified to 1 minus the dot product of the two vectors, eliminating the need for additional division. This means that the normalization step transforms the measurement of cosine distance from "angle calculation" to efficient "vector inner product operation," significantly reducing the computational complexity of cosine distance while mathematically ensuring that the distance value strictly falls within the [0,2] interval. L2 normalization eliminates the interference of feature vector amplitude differences on distance measurement, making the calculation of cosine distance entirely dependent on the direction information (i.e., angle) of the feature vectors, rather than the magnitude of the feature. This is crucial in pedestrian tracking because the apparent features of the same pedestrian can vary in amplitude due to factors such as light intensity and camera gain, but the feature direction (i.e., the relative proportions of each dimension) remains relatively stable. By using normalization preprocessing, the cosine distance can reflect the shape similarity of two feature vectors, avoiding misjudgments of appearance distance due to feature amplitude fluctuations in the cosine distance calculation step, and enhancing the robustness of appearance matching to changes in illumination and contrast. Furthermore, the normalized features can be directly used for subsequent trajectory template updates, ensuring that the template and detected features always reside in the same unit metric space.

[0047] In another exemplary embodiment of this application, steps 205 to 206 specifically include the following: A Kalman filter is used to predict the position of existing trajectories in the current frame, resulting in a trajectory prediction box. The Kalman filter is used to predict the position of each trajectory in the current frame, providing spatial prior for subsequent IoU distance calculation. This application adopts the Constant Velocity Model of the SORT algorithm, where the trajectory motion state is represented by an eight-dimensional spatial vector: Where (u,v) are the bounding box center coordinates; a is the aspect ratio; h is the height; vu is the inter-frame rate of change of the bounding box center x-coordinate u; vv is the inter-frame rate of change of the bounding box center y-coordinate v; va is the inter-frame rate of change of the aspect ratio a; and vh is the inter-frame rate of change of the bounding box height h. The prediction process recursively transfers the motion state vector from the previous frame to the current frame using an 8×8 state transition matrix, while simultaneously updating the state covariance matrix to characterize prediction uncertainty. After prediction, the IoU distance between each predicted bounding box and each high-confidence detection bounding box is calculated, and an IoU distance matrix is ​​constructed.

[0048] As an optional implementation, the joint cost matrix is ​​expressed as follows: ; in, Represents the joint cost matrix; Represents the weight coefficients of the IoU distance matrix; Represents the IoU distance matrix; Represents the weighting coefficients of the lightweight apparent distance matrix; This represents the lightweight apparent distance matrix. Weight coefficients. and The values ​​of are all within the interval [0,1], and satisfy . There are generally two methods for determining the weights: one is empirical setting and grid search, which involves iterating through different weight combinations on the validation set (e.g., with a step size of 0.1) and selecting the set with the highest tracking accuracy—such as Multiple Object Tracking Accuracy (MOTA) and Identity-F1 Score (IDF1)—as fixed parameters. For example, the original ByteTrack implementation sets both motion and appearance weights to 0.5 by default. The second method is adaptive adjustment, which dynamically adjusts the weights based on the difference between the detection confidence or IoU distance and the lightweight appearance distance. When the overlap of the detection boxes is high, the motion weight is increased; when the appearance difference is significant, the appearance weight is increased. The core idea of ​​this fusion strategy is that motion information can provide stable spatial constraints for target matching, while appearance features can supplement the basis for identity discrimination under target intersection, occlusion, and similar motion states.

[0049] As an optional implementation, the Hungarian algorithm is used to solve the optimal binary matching problem between the detected target and historical trajectories. Its calculation process is as follows: First, construct... m×n The joint cost matrix C; where, m This represents the total number of high-confidence detection boxes in the current frame. n The total number of historical trajectories; where the joint cost matrix is... C Each element C ( i,k ) indicates the first i The high-confidence detection box and the first The algorithm calculates the weighted fusion cost of historical trajectories. It then transforms the matching problem into an objective function that minimizes the total matching cost. Through iterative steps such as row and column reduction (subtracting the minimum value from each row and column), trial assignment, covering zero elements, and matrix adjustments, the algorithm finds the optimal matching scheme that minimizes the total cost in polynomial time. Finally, it returns the successfully matched high-confidence detection box-historical trajectory pairs, the unmatched high-confidence detection boxes, and the unmatched historical trajectories.

[0050] It should be noted that in the first stage of high-confidence detection box association, this embodiment not only calculates the IoU distance between the predicted trajectory box and the high-confidence detection box, but also extracts lightweight appearance features from the high-confidence detected target and calculates the lightweight appearance distance between the detected target and the lightweight appearance template of the historical trajectory. Subsequently, the IoU distance and the lightweight appearance distance are weighted and fused to construct a joint cost matrix, and the matching between the high-confidence detection box and the historical trajectory is completed using the Hungarian algorithm.

[0051] The second stage only performs association matching on the trajectories that were not successfully matched in the first stage, rather than rematching all trajectories. The first stage (matching high-confidence detection boxes with all trajectories) is executed first, followed by the second stage (matching low-confidence detection boxes with trajectories that were not matched in the first stage). The second stage does not extract additional appearance features, but only uses the remaining trajectory information after the first stage matching for IoU matching. The first stage aims to establish reliable identity associations for high-confidence detection boxes, while the second stage provides a "second chance" for trajectories that were not matched in the first stage, using low-confidence detection boxes to recover the true targets whose detection scores have decreased due to occlusion, blurring, or changes in lighting.

[0052] In the second stage of low-confidence bounding box association, this application maintains the original ByteTrack IoU matching strategy and does not extract additional appearance features. This allows us to continue to use low-confidence bounding boxes to recover some occluded or reduced-confidence true targets, while avoiding the introduction of unreliable appearance information by low-quality bounding boxes, thus maintaining the computational efficiency and structural simplicity of the original framework.

[0053] As an optional implementation, updating the historical trajectory of each tracked target based on the first-stage matching result and the second-stage matching result specifically includes: For the detection boxes that are successfully matched in the first stage, update the motion state of the corresponding historical trajectory, and calculate the detection confidence, matching IoU and appearance consistency. Determine whether to update the lightweight appearance template of the corresponding historical trajectory to obtain the first judgment result.

[0054] If the first judgment result is yes, then based on the lightweight appearance feature vector of the detection box, the lightweight appearance template of the corresponding historical trajectory is updated.

[0055] If the first judgment result is negative, then the lightweight appearance template of the corresponding historical trajectory remains unchanged.

[0056] For the detection boxes that are successfully matched in the second stage, only the motion state of the corresponding historical trajectory is updated.

[0057] Historical trajectories that did not match a detection box in either the first or second stage are identified as lost trajectories, and lost trajectories with a consecutive number of lost frames exceeding the maximum allowed number of frames are removed from the historical trajectory set.

[0058] The high-confidence detection boxes that did not match the historical trajectory in the first stage are initialized as new trajectories and added to the set of historical trajectories.

[0059] As an optional implementation, after initializing the high-confidence detection boxes that did not match historical trajectories in the first stage as new trajectories and adding them to the historical trajectory set, the following content is also included: If the number of consecutive frames that the new trajectory successfully matches after initialization reaches a preset threshold, it is confirmed as a valid tracking trajectory.

[0060] If the new trajectory does not match any detection box within a preset number of consecutive frames after initialization, the new trajectory will be discarded.

[0061] Specifically, after completing the Hungarian matching, three types of results are output: successfully matched detection-trajectory pairs, unmatched detections, and unmatched trajectories. Based on these three types of results, differentiated updates are performed: (1) For trajectories that are successfully matched in the first stage, the QAU mechanism is used to determine whether to update the lightweight appearance template; (2) For trajectories that are successfully matched in the second stage, only the motion state is updated, and no appearance feature extraction or lightweight appearance template update is performed; (3) For trajectories that are continuously lost for more than the maximum allowed number of frames, they are terminated and removed from the historical trajectory set; (4) For new detection boxes that are continuously matched, they are initialized as new trajectories. Therefore, the matching quality of the first stage matching and the second stage matching directly determines the update strategy and lifecycle management decision for each subsequent trajectory.

[0062] For trajectories that are successfully matched in the first stage of matching, this embodiment further utilizes a Quality Aware Appearance Update (QAU) mechanism to determine whether the current detection sample is suitable for updating the lightweight appearance template of the trajectory. Only when the detection confidence, matching IoU, and appearance consistency simultaneously meet the set conditions is the appearance feature of the current detection box used to update the trajectory template; otherwise, the historical lightweight appearance template remains unchanged. For trajectories that are successfully matched in the second stage of matching, no appearance feature extraction or template update is performed; only the motion state is updated. Trajectories that continuously lose more than the maximum allowed number of frames will be terminated, while newly matched detection boxes will be initialized as new trajectories. The maximum allowed number of frames (max_age / track_buffer) is typically set to 30 frames, meaning that a trajectory is terminated and removed from the trajectory set after 30 consecutive frames without matching any detection boxes. This value can be adjusted according to the scenario: it can be set to 10-30 frames for short-term occlusion scenarios, and increased to 60 frames for long-term occlusion scenarios; it can be set to 5 frames in some lightweight deployment scenarios (such as embedded devices). The minimum number of consecutive successful matches (minimum_consecutive_frames / n_init) is typically set to 2-3 frames. This means that a new track must be successfully matched for 2-3 consecutive frames before it is confirmed as a valid track (Tracked state). If a track is lost consecutively during the initialization phase, it is deleted prematurely. In the Ultralytics implementation, this parameter defaults to 1 (meaning a single frame match is sufficient for confirmation).

[0063] Furthermore, the Quality-Aware Appearance Update (QAU) mechanism designed in this application embodiment only allows updating the trajectory lightweight appearance template when the current matched sample simultaneously meets three conditions. The specific determination conditions are: ; in, Indicates the first The confidence score of each high-confidence detection box; This represents the IoU between the high-confidence detection box and the trajectory prediction box; Indicates the first The high-confidence detection box and the first Lightweight apparent distance between lightweight apparent templates of historical trajectories; Indicates the detection confidence threshold; Indicates the IoU threshold for matching; This represents the lightweight apparent distance threshold.

[0064] Detection confidence threshold The threshold is typically set between 0.1 and 0.7, with the specific value determined based on the detector's performance. Its logic lies in filtering low-confidence detection results—a high threshold improves tracking accuracy but may miss real targets; a low threshold improves recall but may introduce false detections. In the original ByteTrack implementation, the high-confidence threshold is usually set to 0.6 and the low-confidence threshold to 0.1. Some studies have determined optimal values ​​of 0.25, 0.45, or 0.55 through grid search. (Matching IoU threshold) The setting range is generally 0.1 to 0.8. Its setting logic aims to ensure the consistency of the current detection box and the trajectory prediction box in spatial location. The higher the value, the stricter the spatial constraints, requiring the detection box to highly overlap with the predicted trajectory before updates are allowed. This can avoid incorrect associations but may miss matches due to slight offsets. A lower threshold allows for greater spatial deviation and greater inclusiveness, but also increases the risk of false associations. In ByteTrack, setting the IoU distance threshold to 0.8 actually requires an IoU greater than 0.2; other studies have fixed the IoU threshold at 0.3. Apparent distance threshold The setting range is generally 0.3 to 0.7 (cosine distance). Its setting logic aims to ensure the consistency in appearance between the currently detected features and the historical trajectory template. The smaller the value, the stricter the appearance constraints, allowing updates only when features are highly similar, which helps prevent template degradation due to appearance drift; A larger cosine distance allows for greater appearance differences, but may mistakenly identify targets with different identities as the same target, leading to incorrect updates. In pedestrian re-identification research, the optimal threshold for cosine distance is typically between 0.55 and 0.71.

[0065] The detection confidence constraint is used to filter out low-confidence detection results, the matching IoU constraint is used to ensure the consistency of the current detection box and the predicted trajectory in spatial location, and the apparent distance constraint is used to ensure the consistency of the current feature and the historical trajectory template in appearance.

[0066] The above determination process can be expressed as: ; in, This indicates that the trajectory template can be updated using the appearance features of the current detection box; This indicates a refusal to update and a decision to keep the original trajectory template unchanged.

[0067] For matching results that meet the above quality constraints, this embodiment of the application uses an Exponential Moving Average (EMA) strategy to smoothly update the lightweight appearance template of the trajectory. Let the... The historical trajectory in the first tThe normalized lightweight appearance template for frame -1 is Current frame t The extracted normalized lightweight appearance feature vector is The updated lightweight appearance template is then represented as: ; in, Indicates the first The historical trajectory in the first Normalized lightweight appearance template for frames; This represents the smoothing coefficient, which is usually taken to be close to 1 to enhance the stability of historical templates; Indicates the first The historical trajectory in the first Normalized lightweight appearance template for frames; Indicates the first The first frame extracted Normalized lightweight appearance feature vectors of high-confidence detection boxes. The smoothing coefficients recommended in this application embodiment are... The value ranges from 0.9 to 0.95, with a typical value of 0.9. This value aims to balance the stability of the historical template with the adaptability of current observations. The closer it is to 1 (e.g., 0.95), the smoother the update of the historical template, the stronger the ability to suppress short-term fluctuations and noise, and the more suitable it is for scenarios where the appearance of the target changes slowly. Setting it to 0.9 allows the current frame features to be incorporated into the template with a 10% weight, giving the template a certain response speed to gradual changes in pedestrian pose or lighting. In related work on pedestrian re-identification and multi-object tracking, the exponential moving average... The default value is 0.9. This value has been widely verified to effectively track the reasonable evolution of the appearance while maintaining the stability of the template. It avoids the template from being unable to adapt to real appearance changes due to over-reliance on historical information, and also prevents template drift problems caused by too rapid updates.

[0068] If the current sample does not meet the quality constraints set by QAU, then the update is rejected, and the trajectory history template remains unchanged. .

[0069] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 3As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database is used to implement data in the process of improving the ByteTrack pedestrian multi-target tracking method. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an improved ByteTrack pedestrian multi-target tracking method.

[0070] Figure 3 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0071] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0072] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0073] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations and be authorized by the owner of the corresponding device.

[0074] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0075] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0076] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0077] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. An improved ByteTrack pedestrian multi-target tracking method, characterized in that, The method includes: Obtain the current frame image and the historical trajectory set; the historical trajectory set includes several historical trajectories, each historical trajectory corresponds to a tracked target, and the historical trajectory includes the lightweight appearance template and motion state of the corresponding tracked target; The current frame image is input into the YOLOX detector to obtain the detection box and confidence score of each detected target; Based on a preset confidence threshold, the detection boxes of each detection target are divided into high-confidence detection boxes and low-confidence detection boxes, resulting in a set of high-confidence detection boxes and a set of low-confidence detection boxes. For the set of high-confidence detection boxes, the lightweight appearance feature vector of each high-confidence detection box is extracted, and combined with the lightweight appearance template of each historical trajectory, the lightweight appearance distance between each high-confidence detection box and each historical trajectory is calculated to construct a lightweight appearance distance matrix. Based on the motion state of each historical trajectory, the position of the tracked target corresponding to each historical trajectory in the current frame image is predicted using a Kalman filter, and a prediction box is generated based on the position. Calculate the IoU distance between each predicted bounding box and each high-confidence detection box, and construct the IoU distance matrix; Based on the lightweight apparent distance matrix and the IoU distance matrix, a joint cost matrix is ​​constructed; Based on the joint cost matrix, the Hungarian algorithm is used to perform a first-stage matching between each high-confidence detection box and each historical trajectory to obtain the first-stage matching result. For the set of low-confidence detection boxes, unmatched historical trajectories in the first stage are obtained, the IoU distance between the predicted box corresponding to the unmatched historical trajectory and each low-confidence detection box is calculated, an IoU cost matrix is ​​constructed, and the Hungarian algorithm is used to perform a second-stage matching between the unmatched historical trajectory and each low-confidence detection box based on the IoU cost matrix to obtain the second-stage matching result. Based on the matching results of the first stage and the matching results of the second stage, the historical trajectories of each tracked target are updated.

2. The improved ByteTrack pedestrian multi-target tracking method according to claim 1, characterized in that, The step of updating the historical trajectory of each tracked target based on the first-stage matching result and the second-stage matching result specifically includes: For the detection boxes that are successfully matched in the first stage, update the motion state of the corresponding historical trajectory, and calculate the detection confidence, matching IoU and appearance consistency. Determine whether to update the lightweight appearance template of the corresponding historical trajectory and obtain the first judgment result. If the first judgment result is yes, then based on the lightweight appearance feature vector of the detection box, update the lightweight appearance template of the corresponding historical trajectory. If the first judgment result is negative, then the lightweight appearance template of the corresponding historical trajectory remains unchanged; For the detection boxes that are successfully matched in the second stage, only the motion state of the corresponding historical trajectory is updated; Historical trajectories that did not match detection boxes in both the first and second stages are identified as lost trajectories, and lost trajectories with a consecutive number of lost frames exceeding the maximum allowed number of frames are removed from the historical trajectory set; The high-confidence detection boxes that did not match the historical trajectory in the first stage are initialized as new trajectories and added to the set of historical trajectories.

3. The improved ByteTrack pedestrian multi-target tracking method according to claim 2, characterized in that, After initializing the high-confidence detection boxes that did not match historical trajectories in the first stage as new trajectories and adding them to the historical trajectory set, the process also includes: If the number of consecutive frames that the new trajectory successfully matches after initialization reaches a preset threshold, it is confirmed as a valid tracking trajectory. If the new trajectory does not match any detection box within a preset number of consecutive frames after initialization, the new trajectory will be discarded.

4. The improved ByteTrack pedestrian multi-target tracking method according to claim 2, characterized in that, The criterion for determining whether to update the lightweight appearance template corresponding to the historical trajectory is: ; in, This indicates that the lightweight appearance template can be updated; This indicates a refusal to update and a decision to retain the original lightweight appearance template. Indicates the first The confidence score of each high-confidence detection box; This represents the IoU between the high-confidence detection box and the trajectory prediction box; Indicates the first The high-confidence detection box and the first Lightweight apparent distance between lightweight apparent templates of historical trajectories; Indicates the detection confidence threshold; Indicates the IoU threshold for matching; This represents the lightweight apparent distance threshold.

5. The improved ByteTrack pedestrian multi-target tracking method according to claim 2, characterized in that, The expression for the updated lightweight appearance template of the historical trajectory is: ; in, Indicates the first The historical trajectory in the first Normalized lightweight appearance template for frames; Indicates the smoothing coefficient; Indicates the first The historical trajectory in the first Normalized lightweight appearance template for frames; Indicates the first The first frame extracted Normalized lightweight appearance feature vectors of a high-confidence detection box.

6. The improved ByteTrack pedestrian multi-target tracking method according to claim 1, characterized in that, For the set of high-confidence detection boxes, lightweight appearance feature vectors are extracted from each high-confidence detection box. Combined with lightweight appearance templates of each historical trajectory, lightweight appearance distances are calculated between each high-confidence detection box and each historical trajectory, constructing a lightweight appearance distance matrix. Specifically, this includes: From the set of high-confidence detection boxes, based on the position information of each high-confidence detection box, the corresponding target region is cropped from the current frame image, and the inner center region of the target region is extracted as the input image; After scaling the input image to a preset size, it is input into a lightweight appearance feature extraction network, which outputs lightweight appearance feature vectors for each high-confidence detection box. The lightweight appearance feature vectors of each high-confidence detection box are normalized to obtain the normalized lightweight appearance feature vectors of each high-confidence detection box. Based on the normalized lightweight appearance feature vectors of each high-confidence detection box and the lightweight appearance templates of each historical trajectory, the lightweight appearance distance between each high-confidence detection box and each historical trajectory is calculated, and a lightweight appearance distance matrix is ​​constructed. The formula for calculating the lightweight apparent distance is: ; in, Indicates the first The high-confidence detection box and the first Lightweight apparent distance between lightweight apparent templates of historical trajectories; Indicates the first Normalized lightweight appearance feature vectors of high-confidence detection boxes; Indicates the first A normalized lightweight appearance template for a historical trajectory; This indicates transpose.

7. The improved ByteTrack pedestrian multi-target tracking method according to claim 1, characterized in that, The expression for the joint cost matrix is: ; in, Represents the joint cost matrix; Represents the weight coefficients of the IoU distance matrix; Represents the IoU distance matrix; Represents the weighting coefficients of the lightweight apparent distance matrix; This represents the lightweight apparent distance matrix.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the improved ByteTrack pedestrian multi-target tracking method according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the improved ByteTrack pedestrian multi-target tracking method as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the improved ByteTrack pedestrian multi-target tracking method as described in any one of claims 1-7.