Target tracking method and apparatus
By calculating the consistency between the tracking query and the detection prior box frame by frame in the target tracking method, the lock loss can be detected in time and reactivated. This solves the problem that the detection prior is only used for initialization and improves the continuity of tracking and the stability of identity.
Patent Information
- Application Number
- CN202611597382.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-15
- Publication Date
- 2026-11-27
AI Technical Summary
In existing target tracking methods, the detection prior is only used for the one-time initialization of the tracking query, and cannot correct the tracking query that has lost its lock during runtime, resulting in identity breakage and decreased tracking continuity.
By calculating the consistency between the predicted output information of the tracking query and the detection prior box set frame by frame, the tracking state is determined. When the lock is lost, the target prior box is matched from the detection prior box set for reactivation processing, thereby improving the correction supervision signal and avoiding reinitialization after the lock is lost.
It significantly reduces the false alarm rate and identity switching frequency of the lost-lock sequence, and improves the tracking continuity and identity stability of the target.
Smart Images

Figure CN123181510A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of target tracking technology, and in particular to a target tracking method and apparatus. Background Technology
[0002] Multi-target tracking in video aims to simultaneously locate multiple targets in a video sequence while maintaining the consistency of their identities. It is a key foundational technology in applications such as drone surveillance, autonomous driving, and intelligent security. As video scenes become increasingly complex, with drastic changes in target scale, frequent motion blur, and widespread occlusion and overlap, higher demands are placed on tracking methods in terms of detection accuracy, identity stability, and tracking continuity under highly degraded conditions.
[0003] End-to-end multi-object tracking methods based on Transformer query mechanisms, such as End-to-End Multiple-Object Tracking with Transformer (MOTR) and Bootstrapping End-to-End Multi-Object Tracking by Pretrained Object Detectors (MOTRv2), are representative technical approaches in this field. These methods predict target bounding boxes frame-by-frame using a set of learnable tracking queries while preserving target identity. To alleviate the insufficient detection capability of end-to-end trackers for degenerate targets, the existing representative scheme MOTRv2 further introduces a detection prior mechanism. This involves an independent, general-purpose object detector detecting each frame and providing the detected target boxes as a detection box database to the tracking network for initial alignment of the tracking queries. For newly appearing targets, reference points and content embeddings are generated based on their detection boxes, activating an idle tracking query. This introduction of external detection priors improves the initial detection capability of new targets to some extent.
[0004] However, the detection prior's effect is limited to the one-time initialization of the tracking query. Once the tracking query is activated and continues running in subsequent frames, the detection prior no longer constrains or influences the tracking query's state. This leads to a situation where the tracking query loses lock due to target degradation, such as rapid movement, partial occlusion, or drastic scale changes. This manifests as a continuously decreasing output confidence level leading to the cessation of bounding box output, or the bounding box output by the tracking query gradually deviating from the actual target position. The existing query interaction module passively tolerates consecutive missed detections with a miss tolerance limit. When the number of frames tolerated exceeds a preset limit, the query is terminated, and a new query with a new identity is initialized based on the detection box. This results in a break in the identity of the tracked target, significantly restricting tracking continuity and identity stability. Summary of the Invention
[0005] This invention provides a target tracking method and apparatus to solve the defects of the prior art, which only uses the detection prior for one-time initialization of tracking query, cannot correct the tracking query after the lock is lost during the runtime, can only passively tolerate missed detection and re-initialize with a new identity after exceeding the threshold, resulting in identity breakage and reduced tracking continuity.
[0006] This invention provides a target tracking method, comprising the following steps.
[0007] Obtain the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set; The tracking query set and the detection prior box set are input into the end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network. Based on the consistency between the predicted output information of each tracking query and the detection prior box set, the tracking status of each tracking query is determined; When the tracking status of the tracking query is an unlocked state, the tracking query is determined to be an unlocked tracking query; The target prior box that matches the lost-lock tracking query is determined from the set of detection prior boxes. The lost-lock tracking query is reactivated based on the target prior box to obtain a reactivated tracking query set. The target tracking result corresponding to the reactivated tracking query set is obtained. The next frame image of the current frame image is updated to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0008] According to a target tracking method provided by the present invention, the step of determining the unlocked state includes: If the prediction confidence in the prediction output information of the tracking query is lower than the confidence threshold, the number of silent frames of the tracking query is incremented by 1; if the prediction confidence in the prediction output information of the tracking query is not lower than the confidence threshold, the number of silent frames of the tracking query is cleared to zero. Determine the intersection-union ratio (IUU) between the predicted bounding boxes in the prediction output information of each tracking query and each detection prior bounding box in the detection prior bounding box set, and determine the maximum IUU among the IUUU as the maximum detection IUU of the tracking query; If the maximum detected cross-union ratio (CUNR) of the tracking query is lower than the CUNR threshold, increment the drift frame count of the tracking query by 1; if the maximum detected CUNR of the tracking query is not lower than the CUNR threshold, reset the drift frame count of the tracking query to zero. If the number of silent frames in the tracking query reaches a silence threshold, or the number of drift frames in the tracking query reaches a drift threshold, the tracking status of the tracking query is determined to be unlocked.
[0009] According to a target tracking method provided by the present invention, after determining that the tracking status of the tracking query is an unlocked state, the method further includes: When the number of silent frames reaches the silence threshold, the lock loss type of the lock loss tracking query is determined to be a silent lock loss; When the number of drift frames reaches the drift threshold, the type of lock loss in the lock loss tracking query is determined to be a drift-type lock loss.
[0010] According to a target tracking method provided by the present invention, determining a target prior box matching the lost-lock tracking query from the set of detected prior boxes includes: When the lock loss type of the lock loss tracking query is a drifting lock loss, the prediction box in the prediction output information of the lock loss tracking query is determined as the lock loss prediction box; Determine the intersection-union ratio (IUU) of the predicted unlock box with each detection prior box in the set of detection prior boxes; The detection prior box with the largest intersection-union ratio with the lost-lock prediction box and greater than the reactivation threshold is selected from the set of detection prior boxes and used as the first target prior box for the lost-lock tracking query matching.
[0011] According to a target tracking method provided by the present invention, the method further includes: When the lock loss type of the lock loss tracking query is a silent lock loss, the detection prior boxes that have not been assigned to other lock loss tracking queries in the same frame are determined from the detection prior box set as candidate detection prior boxes; wherein, the other lock loss tracking queries in the same frame refer to the remaining lock loss tracking queries in the current frame image other than the lock loss tracking query. The detection prior box with the highest detection confidence in the candidate detection prior box is determined as the second target prior box for the lock loss tracking query matching; The detection confidence level is the confidence level corresponding to each detection prior box in the detection prior box set.
[0012] According to a target tracking method provided by the present invention, the unlock tracking query has a reference point, content embedding, and identity identifier; The reactivation process of the lost-lock tracking query based on the target prior box yields a reactivated tracking query set, including: The reference point of the lost lock tracking query is updated with the normalized center coordinates and size of the target prior box to obtain the reactivation reference point; The content embedding of the lost lock tracking query is updated to the sum of the position code corresponding to the target prior box and the detection prior embedding to obtain the reactivated content embedding; wherein, the detection prior embedding is an embedding vector generated based on the target prior box; Based on the identity identifier obtained from the lost lock tracking query, the reactivation identity identifier is determined; Based on the reactivation reference point, the reactivation content embedding, and the reactivation identity identifier, determine the reactivation tracking query corresponding to the unlock tracking query; The reactivation tracking query set is obtained based on the reactivation tracking query corresponding to the lost lock tracking query.
[0013] According to a target tracking method provided by the present invention, the lost-lock tracking query further includes a prediction box and a prediction confidence level; The reactivation process also includes: Update the predicted bounding box of the lost lock tracking query to the target prior bounding box; Set the prediction confidence level of the lost lock tracking query to a preset high value.
[0014] According to a target tracking method provided by the present invention, determining a target prior box matching the lost-lock tracking query from the set of detected prior boxes includes: The visibility of the target is predicted by performing visibility prediction on the lost lock tracking query; When the target visibility characterizes that the target is visible, the target prior box that matches the lost-lock tracking query is determined from the set of detection prior boxes.
[0015] According to a target tracking method provided by the present invention, the method further includes: When the target visibility characterization indicates that the target is not visible, the target tracking results corresponding to the reactivation tracking query set are prohibited from being obtained.
[0016] The present invention also provides a target tracking device, comprising the following modules: The acquisition module is used to acquire the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set; The input module is used to input the tracking query set and the detection prior box set into the end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network. The first determining module is used to determine the tracking status of each tracking query based on the consistency between the predicted output information of each tracking query and the detection prior box set; The second determining module is used to determine that the tracking query is an unlocked tracking query when the tracking status of the tracking query is an unlocked state; The activation processing module is used to determine the target prior box that matches the lost-lock tracking query from the detection prior box set, reactivate the lost-lock tracking query based on the target prior box to obtain a reactivated tracking query set, obtain the target tracking result corresponding to the reactivated tracking query set, and update the next frame image of the current frame image to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0017] 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 the processor executes the computer program to implement the target tracking method as described above.
[0018] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target tracking method as described above.
[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the target tracking method as described above.
[0020] The target tracking method and apparatus provided by this invention determine the tracking status of each tracking query by calculating the consistency between the predicted output information of each tracking query and the detection prior box set frame by frame. This enables timely detection of lock loss due to target degradation during the tracking process. Then, the target prior box is matched with the lock-loss tracking query from the detection prior box set and reactivation processing is performed. The detection prior is upgraded from a one-time initialization prior to a correction and supervision signal throughout the entire process. This avoids the target identity break caused by the lack of correction mechanism after the tracking query loses lock and is terminated and re-initialized with a new identity. This significantly reduces the false detection rate and identity switching number of the lock-loss sequence, and improves the tracking continuity and identity stability of target tracking. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0022] Figure 1 This is one of the flowcharts of the target tracking method provided by the present invention.
[0023] Figure 2 This is the second flowchart of the target tracking method provided by the present invention.
[0024] Figure 3 This is a flowchart illustrating the lock loss determination and matching strategy provided by the present invention.
[0025] Figure 4 This is a flowchart illustrating the unlock tracking query reactivation process and identity preservation mechanism provided by the present invention.
[0026] Figure 5 This is a schematic diagram of the lock loss tracking query reactivation control process based on visibility prediction provided by the present invention.
[0027] Figure 6 This is a schematic diagram of the overall architecture of the target tracking system provided by the present invention.
[0028] Figure 7 This is a schematic diagram of the end-to-end tracking network output head extension and visibility prediction mechanism provided by the present invention.
[0029] Figure 8 This is a schematic diagram of the target tracking device provided by the present invention.
[0030] Figure 9 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0032] The terms "first," "second," etc., used in this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and that the objects distinguished by "first," "second," etc., are generally of the same class.
[0033] This invention provides a target tracking method. Figure 1 This is one of the flowcharts illustrating the target tracking method provided by the present invention, such as... Figure 1 As shown, the method includes the following: Step 110: Obtain the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set.
[0034] Specifically, in the process of processing video sequences frame by frame, it is first necessary to obtain the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set.
[0035] The video sequence to be tracked refers to a continuous image sequence containing the target to be tracked. The current frame image refers to the image data corresponding to the current frame to be processed in the video sequence to be tracked. It can be an RGB image frame, a grayscale image frame, or an image tensor after preprocessing such as normalization and scaling. Its specific format depends on the input requirements of the end-to-end tracking network used.
[0036] Here, the detection prior box set is a set of bounding boxes detected by a general object detector that is separate from the end-to-end tracking network for the current frame image. Each detection prior box in the bounding box set contains the coordinate information of the bounding box, such as the center coordinates and width and height, or the coordinates of the top left corner and the bottom right corner, as well as the corresponding detection confidence.
[0037] As one optional implementation, the detection prior box set can be generated in real-time by a detector deployed in the online inference link for the current frame. Alternatively, the detection prior box set can be obtained frame-by-frame by reading a detection box database pre-obtained from offline detection of the entire video sequence. This database is organized by frame index, and the corresponding detection prior box set can be obtained by querying the current frame index during inference. The specific selection of the general object detector is not limited; for example, YOLO series detectors, Faster Region-based Convolutional Neural Networks (Faster R-CNN), DetectionTransformers (DETR), etc., can be used, as long as they can output bounding boxes with confidence for the current frame. It is particularly important to note that this detection prior box set not only serves the initial alignment of new target tracking queries but is also the core supervisory signal used throughout the entire operation of this invention to correct lost-track tracking queries. This differs from existing practices that only use the detection prior for one-time initialization.
[0038] The activated tracking query set refers to the collection of tracking queries that are active and inherited from the previous frame. Each tracking query logically represents a target entity that is being continuously tracked and carries state information accumulated from previous frames. At the beginning of video processing, before any target has been detected and initialized, the activated tracking query set is empty. As detection prior boxes continuously trigger the activation of new queries, the activated tracking query set is dynamically updated frame by frame. Taking a drone tracking scenario as an example, when the detection prior box set of the first frame of the video contains a detection box of a drone, the inference processor generates a new tracking query based on the detection box and activates it, adding it to the activated tracking query set. In subsequent frames, this tracking query is continuously inherited and used to track the drone target.
[0039] Step 120: Input the tracking query set and the detection prior box set into the end-to-end tracking network to obtain the prediction output information of each tracking query in the tracking query set output by the end-to-end tracking network.
[0040] Specifically, the tracking query set and the detection prior box set are input into the end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network.
[0041] The end-to-end tracking network refers to a tracking network that employs a learnable query mechanism and can simultaneously perform object detection and identity preservation during a single forward inference process. In an optional embodiment, the end-to-end tracking network can be a Transformer-based network, such as the network structure used in MOTRv2, which includes a backbone network, such as ResNet50; a feature extraction module, such as Deformable-DETR with iterative box refinement; and a query interaction module. A set of detection prior boxes serves as auxiliary input, participating in attention calculation and feature alignment for tracking queries during the network's forward inference process. The specific architecture of the end-to-end tracking network is not limited; any tracking network that uses a set of learnable tracking queries as its core and outputs prediction results through frame-by-frame forward inference is applicable to this invention.
[0042] The prediction output information for each tracking query is the inference output of the end-to-end tracking network for each tracking query in the current frame, including the predicted bounding box and the prediction confidence score. The predicted bounding box is the coordinate of the predicted bounding box of the target corresponding to the tracking query in the current frame, and the prediction confidence score is the confidence score that the target corresponding to the tracking query is detected in the image of the current frame.
[0043] In an optional embodiment, the predicted output information may further include additional information such as target category prediction, the specific content of which depends on the output head design of the end-to-end tracking network. Taking the drone tracking scenario as an example, the current frame image and its detection prior box set, along with the tracking query set inherited from the previous frame, are input into the end-to-end tracking network. After forward inference, for the tracking query of the drone being tracked, the predicted output information includes a predicted box and a corresponding prediction confidence, where the predicted box represents the predicted position and size of the drone in the current frame.
[0044] Step 130: Based on the consistency between the predicted output information of each tracking query and the detection prior box set, determine the tracking status of each tracking query.
[0045] Specifically, the tracking status of each tracking query is determined based on the consistency between the predicted output information of each tracking query and the detection prior box set. The tracking status measures whether a tracking query still reliably follows its corresponding target and serves as the basis for deciding whether to apply intervention measures to that query.
[0046] The consistency metric reflects the degree of agreement between the predicted output of the tracking query and the target location information given by the detection prior: if the predicted output of the tracking query is highly consistent with the set of detection prior boxes, the tracking query is considered to be in a normal tracking state; if the two are inconsistent for a long time, the tracking query is considered to have lost the lock and its tracking state should be marked as lost.
[0047] It should be noted that the consistency measurement method is unrestricted. It can be quantified based on the spatial overlap between the predicted bounding box and the detected prior bounding box, such as by calculating their Intersection over Union (IoU); it can also be based on prediction confidence to reflect whether the query still has the ability to output effectively; or it can combine the above two types of indicators to jointly evaluate the tracking status from the two dimensions of spatial location and output confidence. Specifically, for the cumulative calculation of consistency, the consistency measurement results of the current frame can be counted frame by frame to suppress misjudgments caused by occasional factors such as single-frame occlusion or motion blur. Only when the inconsistent state continues for a certain number of frames is the tracking status of the tracking query determined to be a lost state.
[0048] It should be noted that the above consistency evaluation process is only performed during the inference phase and does not involve changes to the end-to-end tracking network training process and training loss. Therefore, the solution provided by this invention can be seamlessly integrated into existing converged end-to-end tracking networks without retraining.
[0049] Step 140: When the tracking status of the tracking query is a lost-lock status, determine that the tracking query is a lost-lock tracking query.
[0050] Specifically, when the tracking status of a tracking query is a lost-lock status, the tracking query is determined to be a lost-lock tracking query.
[0051] Among them, the lock-out state is a specific type of tracking query state, indicating that the tracking query can no longer reliably follow its corresponding target in the current frame image. The root cause of lock-out is that during the inference phase of the end-to-end tracking network, target degradation, such as rapid movement, strong light changes, partial occlusion, and small target scale, can cause the tracking query's prediction to gradually deviate from the true target. Existing networks lack an autonomous correction mechanism, leading to the accumulation of deviations and eventually lock-out. By comparing the current predicted output of the tracking query with the real-time acquired detection prior box set for consistency, this deviation behavior can be captured in a timely manner, allowing for early intervention after lock-out occurs, rather than waiting for the tracking query to time out.
[0052] In a specific implementation scenario taking drone tracking as an example, if the predicted bounding box of a tracking query for a certain drone target has deviated from any of the detection prior boxes in the detection prior box set for multiple consecutive frames, that is, the consistency between the two is continuously lower than the set standard, or the prediction confidence is lower than the confidence level for multiple consecutive frames, then the tracking status of the tracking query is determined to be a lost state, and thus it is determined to be a lost tracking query.
[0053] Step 150: Determine the target prior box that matches the lost-lock tracking query from the detection prior box set; reactivate the lost-lock tracking query based on the target prior box to obtain a reactivated tracking query set; obtain the target tracking result corresponding to the reactivated tracking query set; and update the next frame image of the current frame image to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0054] Specifically, a target prior box matching the lock-loss tracking query is determined from the set of detection prior boxes. The target prior box is the detection prior box with the highest matching degree with the lock-loss tracking query selected from the set of detection prior boxes in the current frame. Its role is to provide an accurate target location reference for the lock-loss tracking query, which serves as the input basis for the reactivation process.
[0055] In one optional embodiment, the target prior box can be selected based on the spatial similarity between the predicted bounding box of the lock loss tracking query and each detection prior box in the detection prior box set. The detection prior box with the highest similarity and meeting the minimum matching condition can be selected as the target prior box. In another optional embodiment, the target prior box can be selected based on the detection confidence of each detection prior box in the detection prior box set. The detection prior box with the highest confidence and not yet occupied by other lock loss tracking queries can be selected as the target prior box. Alternatively, spatial similarity and detection confidence can be used together to adopt appropriate matching strategies for different lock loss patterns.
[0056] Furthermore, the unlocked tracking query can be reactivated based on the target prior bounding box to obtain a reactivated tracking query set, and the target tracking result corresponding to the reactivated tracking query set can be obtained.
[0057] The essence of reactivation is to update the internal state parameters of the lost-lock tracking query to the position indicated by the target prior box, so that the tracking query is re-anchored to the target area, thereby restoring the ability to continuously track the target.
[0058] Here, the reactivation process may include one or a combination of the following operations: updating the reference point of the lost-lock tracking query to the center coordinates and size of the target prior box; updating the content embedding of the lost-lock tracking query to the sum of the positional encoding generated by the target prior box and the detection prior embedding, aligning its feature representation to the visual semantics of the target prior box location; overwriting the predicted box output of the lost-lock tracking query with the target prior box, and setting the prediction confidence to a preset high value to ensure that the query can be retained and included in the output with a sufficiently high confidence in the post-processing stage, avoiding the query being filtered out by post-processing due to the end-to-end tracking network becoming conservative after convergence. It is particularly important to emphasize that the identity of the lost-lock tracking query remains unchanged throughout the entire reactivation process; that is, the output result of reactivation still belongs to the original identity of the lost-lock tracking query, rather than terminating the tracking query and re-initializing it with a new identity. This avoids the identity breakage problem that inevitably occurs under the timeout termination and re-initialization mechanism of existing methods.
[0059] After reactivation, all reactivated tracking queries and normal tracking queries that did not lose lock together constitute the reactivated tracking query set. Based on this reactivated tracking query set, the target tracking result of the current frame is obtained. The target tracking result includes the predicted bounding box of each tracked target in the current frame image and its corresponding identifier, which serves as the final output of the current frame image. The reactivated tracking query set is then passed to the next frame to continue participating in the tracking inference of subsequent frames. After the current frame image is processed, the next frame image is updated to the current frame image, and steps 110 to 150 are repeated until the current frame image is the last frame of the video sequence to be tracked, thereby achieving continuous tracking processing of the entire video sequence.
[0060] As an optional implementation, if there are no unlocked tracking queries in the current frame image, the target prior box matching and reactivation process is skipped, and the already activated tracking query set is directly used as the reactivation tracking query set to output the corresponding target tracking results.
[0061] The method provided in this invention determines the tracking status of each tracking query by calculating the consistency between the predicted output information of each tracking query and the detection prior box set frame by frame. This enables timely detection of lock loss due to target degradation during the tracking process. Then, it matches the target prior box for the locked tracking query from the detection prior box set and performs reactivation processing. The detection prior is upgraded from a one-time initialization prior to a correction and supervision signal throughout the entire process. This avoids the target identity break caused by the lack of correction mechanism after the tracking query loses lock and is terminated and re-initialized with a new identity. It significantly reduces the false negative rate and identity switching number of the locked sequence and improves the tracking continuity and identity stability of the target tracking.
[0062] Based on the above embodiments, the step of determining the unlocked state includes: Step 21: If the prediction confidence in the prediction output information of the tracking query is lower than the confidence threshold, increment the number of silent frames of the tracking query by 1; if the prediction confidence in the prediction output information of the tracking query is not lower than the confidence threshold, reset the number of silent frames of the tracking query to zero. Step 22: Determine the intersection-union ratio (IUU) between the predicted bounding boxes in the prediction output information of each tracking query and each detection prior bounding box in the detection prior bounding box set, and determine the maximum IUU among the IUU ratios as the maximum detection IUU of the tracking query; Step 23: If the maximum detected cross-union ratio (CUNR) of the tracking query is lower than the CUNR threshold, increment the number of drift frames of the tracking query by 1; if the maximum detected CUNR of the tracking query is not lower than the CUNR threshold, clear the number of drift frames of the tracking query to zero. Step 24: If the number of silent frames in the tracking query reaches the silence threshold, or the number of drift frames in the tracking query reaches the drift threshold, determine that the tracking status of the tracking query is a lost state.
[0063] Specifically, for each active tracking query in the tracking query set, the prediction confidence score in its prediction output information is read first. The prediction confidence score is the probability score of the target output by the end-to-end tracking network in the current frame. Its value range is usually [0,1]. The higher the value, the more confident the end-to-end tracking network is that the target corresponding to the tracking query is visible and effectively tracked in the current frame.
[0064] The predicted confidence level is compared with a pre-set confidence threshold. The confidence threshold is a preset value used to distinguish whether the output of a tracking query is reliable; for example, it can be 0.5, and the specific value can be adjusted according to the application scenario and the output characteristics of the end-to-end tracking network. If the predicted confidence level of a tracking query is lower than the confidence threshold, the output of the tracking query in the current frame is considered unreliable, and the number of silent frames for that tracking query is incremented by 1. If the predicted confidence level of a tracking query is not lower than the confidence threshold, the tracking query is considered to have recovered a reliable output in the current frame, and the number of silent frames for that tracking query is reset to zero.
[0065] Here, the silent frame count is a frame-by-frame cumulative counter maintained for each tracking query, recording the number of frames in which the tracking query continuously outputs unreliable results. It is set to zero when the tracking query is initialized and is updated frame-by-frame during the tracking process. Taking a drone tracking scenario as an example, when the prediction confidence of a tracking query in three consecutive frames is 0.3, 0.2, and 0.1, all below the confidence threshold of 0.5, the silent frame count for that tracking query increases sequentially to 1, 2, and 3. If the prediction confidence in the fourth frame rises back to 0.7, the silent frame count is immediately reset to zero.
[0066] Simultaneously, the intersection-union ratio (IUR) of the predicted bounding boxes in the prediction output information of each tracking query with that of each detection prior bounding box in the detection prior box set is determined. Here, the predicted bounding box is the target's predicted bounding box in the current frame of the end-to-end tracking network for the tracking query output, represented by coordinates indicating the predicted position and size of the target. The IUR is a standard metric for measuring the degree of spatial overlap between two bounding boxes, defined as the intersection area divided by the union area, with a value ranging from [0,1]. A higher value indicates a greater degree of overlap.
[0067] Specifically, the intersection-union ratio (IUR) of the predicted bounding box of a tracking query is calculated with each detection prior bounding box in the detection prior bounding box set, resulting in a set of IUR values. The maximum IUR value in this set is determined as the maximum IUR of the tracking query. Here, the maximum IUR reflects the degree of spatial fit between the predicted bounding box of the tracking query and the closest detection prior bounding box in the current frame: a high maximum IUR indicates that the predicted bounding box of the tracking query has good spatial consistency with at least one detection prior bounding box; a low maximum IUR indicates that the predicted bounding box of the tracking query has deviated from the target position indicated by all detection prior bounding boxes.
[0068] The maximum detection cross-union ratio (CUI) is compared with a pre-set CUI threshold. The CUI threshold is a preset value used to determine whether the predicted bounding box has spatially shifted; for example, it can be 0.5, and the specific value can be adjusted according to the target scale characteristics and detector performance. If the maximum detection CUI of a tracking query is lower than the CUI threshold, it is considered that the predicted bounding box of the tracking query has deviated from all target positions indicated by the detection prior, and the drift frame count of the tracking query is incremented by 1. If the maximum detection CUI of a tracking query is not lower than the CUI threshold, it is considered that the tracking query is still spatially consistent with the detection prior, and the drift frame count of the tracking query is reset to zero. Similar to the silent frame count, the drift frame count is a frame-by-frame cumulative counter maintained for each tracking query, recording the number of consecutive frames in which the predicted bounding box of the tracking query deviates from the detection prior.
[0069] After the number of silent frames and drift frames are accumulated and updated, the unlock status is determined. The number of silent frames tracked and queried is compared with a preset silence threshold, and the number of drift frames is compared with a preset drift threshold.
[0070] Here, the silence threshold is the maximum number of frames that a tracking query is allowed to continuously output unreliable results. When the number of silence frames reaches this threshold, the tracking query is considered to have fallen into a state of continuous silence. The drift threshold is the maximum number of frames that a tracking query prediction box is allowed to continuously deviate from the detection prior. When the number of drift frames reaches this threshold, the tracking query is considered to have experienced continuous drift.
[0071] If the number of silent frames in a tracking query reaches the silence threshold, or the number of drift frames in a tracking query reaches the drift threshold, the tracking status of the tracking query is determined to be unlocked.
[0072] The values of the silence threshold and drift threshold can be set according to the actual scenario. In one optional embodiment, the silence threshold can be 1 to 3 frames, and the drift threshold can be 3 to 8 frames. It is understood that the silence threshold is usually set to a smaller value because the output confidence of the tracking query is consistently lower than the confidence threshold, which itself indicates that the tracking ability of the query has seriously degraded and a faster response is required. The drift threshold is set to a relatively larger value because short-term offsets of the predicted bounding box may be caused by instantaneous factors such as motion blur and scale changes, and more frames of evidence are needed to avoid misjudgment.
[0073] The method provided in this invention, through a dual-channel frame-by-frame accumulation mechanism, can simultaneously cover two typical forms of lock loss in tracking queries: continuously decreasing output confidence and continuously deviating prediction boxes. Furthermore, by using a threshold filtering of the accumulated frame count, it suppresses misjudgments that may be caused by single-frame disturbances, thereby achieving a balance between the timeliness and accuracy of lock loss detection.
[0074] Based on the above embodiments, after determining that the tracking status of the tracking query is a lost-lock state, the method further includes: When the number of silent frames reaches the silence threshold, the lock loss type of the lock loss tracking query is determined to be a silent lock loss; When the number of drift frames reaches the drift threshold, the type of lock loss in the lock loss tracking query is determined to be a drift-type lock loss.
[0075] Specifically, when the number of silent frames reaches the silence threshold, the lock loss type of the tracking query is determined to be a silent lock loss. The typical characteristic of a silent lock loss is that the tracking query tends to stop outputting valid bounding boxes. The prediction confidence of the end-to-end tracking network for this query remains consistently below the confidence threshold, causing the query to be repeatedly filtered out in the post-processing stage without generating any output. Taking actual test data from a drone tracking scenario as an example, in a sequence of 128 consecutive frames, the detected prior boxes provide accurate boxes with an intersection-union ratio (IoU) of approximately 73% with the ground truth in each frame. However, the tracking query remains silent for approximately 127 of those frames, not outputting any bounding boxes. This phenomenon exemplifies the typical characteristics of a silent lock loss, where the tracking query, although still being inherited, has lost its ability to output valid bounding boxes.
[0076] When the number of drift frames reaches the drift threshold, the lock loss type of the tracking query is determined to be drift-type lock loss. A typical characteristic of drift-type lock loss is that the tracking query is still in the output bounding box and the prediction confidence may still be above the confidence threshold, but the position of the box has deviated from the true target, and its maximum detection intersection-union ratio (IUU) remains below the IUU threshold. In another experimental sequence, the average IUU of the detected prior box and the ground truth was as high as approximately 98% within 287 consecutive frames, while the tracking query drifted for about 128 frames, indicating that drift-type lock loss also caused serious tracking bias.
[0077] As an optional implementation, when the number of silent frames and the number of drift frames reach their respective thresholds, the lock loss type can be preferentially determined as silent lock loss or drift lock loss. The specific priority strategy can be set according to the distribution characteristics of the two lock loss forms in the application scenario.
[0078] The method provided in this invention, by distinguishing between different types of lock loss, can employ differentiated matching strategies based on the characteristics of different lock loss types when matching target prior boxes for lock loss tracking queries from the set of detected prior boxes. For tracking queries of silent lock loss, since its predicted box is unreliable, it is not advisable to rely on the predicted box for spatial matching; for tracking queries of drifting lock loss, although its predicted box has deviated from the target, it can still serve as a rough location clue to assist in matching. This type-based matching method can improve the accuracy and applicability of target prior box matching.
[0079] Based on the above embodiments, step 150, which involves determining the target prior box that matches the lock-loss tracking query from the set of detection prior boxes, includes: Step 150-1: When the lock loss type of the lock loss tracking query is a drifting lock loss, the prediction box in the prediction output information of the lock loss tracking query is determined as the lock loss prediction box. Step 150-2: Determine the intersection-union ratio (IUU) of the predicted unlock box with each detection prior box in the set of detection prior boxes; Step 150-3: Select the detection prior box from the detection prior box set that has the largest intersection-union ratio with the lost-lock prediction box and is greater than the reactivation threshold, and use it as the first target prior box for the lost-lock tracking query matching.
[0080] Specifically, firstly, when the lock loss type of the lock loss tracking query is a drift-type lock loss, the predicted bounding box in the prediction output information of the drift-type lock loss tracking query is determined as the lock loss prediction bounding box. Here, the lock loss prediction bounding box is the predicted bounding box output by the end-to-end tracking network for the current frame of the lock loss tracking query. Although the predicted box has deviated from the true target position due to the accumulation of drift, its deviation from the true target is usually gradual frame by frame. In most cases, the lock loss prediction bounding box is still located in the vicinity of the target, and therefore can serve as a rough spatial localization clue.
[0081] Then, determine the intersection-union ratio (CUI) between the lost-lock prediction box and each detection prior box in the detection prior box set. That is, calculate the CUI between the lost-lock prediction box and each detection prior box in the detection prior box set to obtain a set of CUI values.
[0082] Finally, the detection prior box with the largest intersection-union ratio (IU) with the lost-lock prediction box and greater than the reactivation threshold is selected from the set of detection prior boxes and used as the first target prior box to match the lost-lock tracking query. The reactivation threshold is a pre-set lower limit of the IU to prevent matching when the lost-lock prediction box has no effective spatial overlap with any of the detection prior boxes. In an optional embodiment, the reactivation threshold can be 0.3.
[0083] Here, the first target prior box is the target prior box determined for the drifting lock-loss tracking query based on the intersection-union ratio (IU) matching strategy. If there is no detection prior box in the detection prior box set whose IU with the lock-loss prediction box is greater than the reactivation threshold, then the current frame will not perform reactivation processing on the lock-loss tracking query.
[0084] This cross-union ratio (CUNR) based matching strategy makes full use of the location clues left by the predicted bounding boxes in drift-type unlocked tracking queries. It locates the detection prior boxes in the target neighborhood based on spatial overlap, so that the matching of the target prior boxes has clear spatial constraints and reduces the possibility of matching non-target detection boxes.
[0085] Based on the above embodiments, the method further includes: Step 31: When the lock loss type of the lock loss tracking query is a silent lock loss, determine the detection prior boxes that have not been assigned to other lock loss tracking queries in the same frame from the detection prior box set as candidate detection prior boxes; wherein, other lock loss tracking queries in the same frame refer to the remaining lock loss tracking queries in the current frame image other than the lock loss tracking query. Step 32: The detection prior box with the highest detection confidence in the candidate detection prior box is determined as the second target prior box for the lock loss tracking query matching; The detection confidence level is the confidence level corresponding to each detection prior box in the detection prior box set.
[0086] Specifically, firstly, when the lock loss type of the lock loss tracking query is a silent lock loss, the detection prior boxes that have not been assigned to other lock loss tracking queries in the same frame can be determined from the detection prior box set as candidate detection prior boxes; where other lock loss tracking queries in the same frame refer to the remaining lock loss tracking queries in the current frame image other than the lock loss tracking query.
[0087] In the same frame, there may be multiple lock-loss tracking queries that need to match the target prior box simultaneously. To avoid conflicts or duplicate tracking caused by multiple lock-loss tracking queries matching the same detection prior box, when matching each silent lock-loss tracking query, it is necessary to exclude detection prior boxes that have been occupied by other lock-loss tracking queries. Other lock-loss tracking queries in the same frame include silent lock-loss tracking queries and drifting lock-loss tracking queries. The remaining detection prior boxes constitute the candidate detection prior boxes.
[0088] Then, the detection prior box with the highest detection confidence in the candidate detection prior box can be determined as the second target prior box for matching the lost lock tracking query.
[0089] Among them, the detection confidence score is the confidence score corresponding to each detection prior box in the detection prior box set. It is output by the general target detector when generating the detection prior boxes and reflects the detector's confidence in the existence of a target in the region selected by a certain detection prior box.
[0090] Here, the second target prior box is the target prior box determined for the silent lock-loss tracking query based on the detection confidence matching strategy. The candidate detection prior box with the highest detection confidence is selected as the matching result because, given that the predicted box of the silent lock-loss tracking query is unreliable, the detection prior box with the highest detection confidence usually corresponds to the most likely location of the target in the current frame, and using it as an anchor reference for reactivation has high reliability.
[0091] As an optional implementation, a detection prior box that has been matched as a target prior box for a certain lost-lock tracking query is removed from the candidate detection box used to initialize a new tracking query, so as to avoid using a certain detection prior box to both reactivate a lost-lock tracking query and initialize a new query in the same frame, thereby preventing repeated tracking of the same target.
[0092] Taking a drone tracking scenario as an example, suppose there is a silent lock-loss tracking query in the current frame, and its silent frame count has reached the silent threshold. The detection prior set contains three detection prior boxes, where detection prior box A has a detection confidence of 0.92, detection prior box B has a detection confidence of 0.78, and detection prior box C has a detection confidence of 0.65. Detection prior box A has already been matched as the first target prior box by another drifting lock-loss tracking query. After excluding detection prior box A, the candidate detection prior boxes are B and C. Among them, detection prior box B has the highest detection confidence and is therefore determined as the second target prior box for this silent lock-loss tracking query.
[0093] Based on the above embodiments, the lock loss tracking query has reference points, content embedding, and identity identification; Step 150, which involves reactivating the lost-lock tracking query based on the target prior box to obtain a reactivated tracking query set, includes: Step 1501: Update the reference point of the lost-lock tracking query to the normalized center coordinates and size of the target prior box to obtain the reactivation reference point; Step 1502: Update the content embedding of the lost lock tracking query to the sum of the position code corresponding to the target prior box and the detection prior embedding to obtain the reactivated content embedding; wherein, the detection prior embedding is an embedding vector generated based on the target prior box; Step 1503: Determine the reactivation identity based on the identity identifier obtained from the lost lock tracking query; Step 1504: Based on the reactivation reference point, the reactivation content embedding, and the reactivation identity identifier, determine the reactivation tracking query corresponding to the unlock tracking query; Step 1505: Based on the reactivation tracking query corresponding to the lost lock tracking query, obtain the reactivation tracking query set.
[0094] Specifically, a lost-lock tracking query has a reference point, content embedding, and identity identifier. The reference point is the anchor position of the tracking query in the feature space, typically represented by normalized coordinates indicating the target's center position and size. The end-to-end tracking network uses the reference point to determine the sampling region on the feature map. The content embedding is a high-dimensional feature vector of the tracking query, encoding the appearance semantic information of the target being tracked. The end-to-end tracking network uses the content embedding for feature matching and updating during query interactions. The identity identifier is a unique label assigned to the tracking query, used to annotate the identity of the target being tracked in the output.
[0095] Accordingly, the reference point for the lost-lock tracking query can be updated with the normalized center coordinates and dimensions of the target prior bounding box, resulting in a reactivated reference point. The normalized center coordinates and dimensions are obtained by dividing the absolute center coordinates (cx, cy) and width and height (w, h) of the target prior bounding box by the width and height of the image, respectively, thus normalizing the reference point values to the [0, 1] interval, consistent with the representation format of reference points within the end-to-end tracking network. This step is expressed by the formula: p B*; Where p represents the reference point for the tracking query, and its value before the update is denoted as p. B* represents the normalized representation of the target prior box determined by the lost-lock tracking query matching, i.e., the first target prior box or the second target prior box. After this update, the tracking query will be redirected to the region where the target prior box is located by feature sampling with the reactivation reference point as the starting anchor position in the forward inference of the next frame of the end-to-end tracking network.
[0096] Then, the content embedding of the lock loss tracking query can be updated to the sum of the position encoding corresponding to the target prior box and the detection prior embedding to obtain the reactivated content embedding, where the detection prior embedding is an embedding vector generated based on the target prior box.
[0097] The location encoding is a high-dimensional vector generated by mapping the center coordinates of the target prior bounding box through a location encoding function. This vector is used to inject the spatial location information of the target prior bounding box into the content embedding. The detection prior embedding is an embedding vector generated based on the target prior bounding box, obtained from the corresponding features of the detection prior bounding box, and encodes the visual semantic information of the region selected by the target prior bounding box. This step is expressed by the formula: ; in, This indicates that the content of the tracking query is embedded. This represents the position encoding function. That is, the target prior box The position code generated from the center coordinates, This indicates the detection prior embedding. After this update, the content embedding of the tracking query includes both the spatial location information and visual semantic information of the target prior box, enabling the query to be effectively matched with the image features of the target prior box location during attention calculation in subsequent frames.
[0098] Furthermore, a reactivation identity can be determined based on the identity identifier from the lock-loss tracking query. That is, the reactivation identity identifier is obtained by keeping the identity identifier from the lock-loss tracking query unchanged. The reactivation identity identifier shares the same label value as the identity identifier before the lock loss. This means that the reactivated tracking query still labels the target with the original identity identifier at the output level, and the output of the target prior box will be attributed to the identity before the lock loss rather than being assigned a new identity identifier, thus maintaining continuity in the identity chain of the tracking results.
[0099] Then, based on the reactivation reference point, the reactivation content embedding, and the reactivation identity identifier, the reactivation tracking query corresponding to the lock loss tracking query is determined. Finally, based on the reactivation tracking queries corresponding to the lock loss tracking queries, a set of reactivation tracking queries can be obtained.
[0100] Among them, the reactivation tracking query is the tracking query after the above triplet state update. Its reference point has been anchored to the location of the target prior box, the content embedding has been aligned to the visual semantics of that location, and the identity identifier remains unchanged. After performing the above reactivation process on each unlocked tracking query in the tracking query set, all reactivation tracking queries together constitute the reactivation tracking query set.
[0101] The method provided in this invention re-anchors the lost-lock tracking query to the accurate position indicated by the detection prior in the feature space during the reactivation process, while maintaining the continuity of the identity identifier. This allows the accurate position information of the detection prior to be effectively utilized during the inference process, avoiding the identity breakage caused by terminating the query and re-initializing with a new identity in existing solutions.
[0102] Based on the above embodiments, the lock loss tracking query also has a prediction box and a prediction confidence level; The reactivation process also includes: Update the predicted bounding box of the lost lock tracking query to the target prior bounding box; Set the prediction confidence level of the lost lock tracking query to a preset high value.
[0103] Specifically, converged end-to-end tracking networks typically tend to be conservative. For tracking queries that have been out of lock for a long time, even if their reference point and content embedding have been updated to the target prior box location through reactivation, the network may still output a low prediction confidence for the query during forward inference in the current frame, causing the query to be filtered out in the post-processing stage, such as during confidence-based threshold filtering or non-maximum suppression. To address this issue, the reactivation process further includes the following steps: The predicted bounding box of the lost-lock tracking query is updated to the target prior box. That is, the predicted bounding box output by the end-to-end tracking network for the query is directly updated to the coordinates of the target prior box determined by the aforementioned matching. The target prior box is either the first target prior box or the second target prior box.
[0104] Set the prediction confidence level of the lock loss tracking query to a preset high value. The preset high value is a pre-set confidence level value that ensures the tracking query output is not filtered out in the post-processing stage; for example, it can be 1.0.
[0105] In an alternative embodiment, the preset high value can also be any other sufficiently high value, such as 0.95 or 0.99, as long as it ensures that the query is retained and output with high confidence in post-processing.
[0106] The method provided in this invention outputs the coordinates of the target prior bounding box and a preset high confidence score in the current frame upon reactivation of the tracking query, and labels it with its original identifier. This mechanism ensures that even if the end-to-end tracking network still outputs a low confidence score for the re-anchored query, the reactivation result will not be filtered out by post-processing.
[0107] Based on the above embodiments, step 150, which involves determining the target prior box that matches the lock-loss tracking query from the set of detection prior boxes, includes: Step 41: Perform visibility prediction on the lost lock tracking query to obtain target visibility; Step 42: When the target visibility characterization indicates that the target is visible, determine the target prior box that matches the lost-lock tracking query from the detection prior box set.
[0108] Specifically, visibility prediction is performed on the lost-lock tracking query to obtain the target visibility. Target visibility is an indicator that characterizes whether the target corresponding to the lost-lock tracking query is currently visible, used to determine whether the target is still within the field of view of the current frame and is not completely occluded.
[0109] In an alternative embodiment, target visibility can be output by a visibility prediction head added to the end-to-end tracking network. This visibility prediction head, for example, is composed of a multilayer perceptron, takes the features of the tracking query as input, and outputs a numerical value representing the visibility of the target. During training, the visibility prediction head is supervised by the visibility annotation of the target, such as whether the target is in the field of view or whether it is not completely occluded.
[0110] In another alternative embodiment, target visibility can also be estimated by other means such as extrapolation of motion trajectories or the relationship between target position and image boundaries.
[0111] When the target visibility indicates that the target is visible, the visibility prediction result means that the target corresponding to the lost-lock tracking query is still within the field of view of the current frame and is detectable. At this time, the target prior box matching the lost-lock tracking query is determined from the detection prior box set, and subsequent reactivation processing is performed. Allowing reactivation when the target is visible and the tracking query has indeed lost lock can correct tracking deviations in a timely manner.
[0112] Based on the above embodiments, the method further includes: When the target visibility characterization indicates that the target is not visible, the target tracking results corresponding to the reactivation tracking query set are prohibited from being obtained.
[0113] Specifically, when the target visibility characterization indicates that the target is invisible, meaning the visibility prediction result indicates that the target corresponding to the lost-lock tracking query has moved out of the current frame's field of view or is completely occluded and invisible, the target prior box matching and reactivation processing for this lost-lock tracking query is skipped, and the target tracking result corresponding to the reactivated tracking query set is prohibited from being acquired. The underlying principle is that when the target is no longer in the field of view, the detection prior box set will not contain detection prior boxes belonging to that target. If the lost-lock tracking query is still forcibly matched with a target prior box and reactivated, the matched detection prior box is very likely to belong to a different target, causing the tracking query to be incorrectly anchored to a non-target location and output with its original identity, resulting in false detection and identity confusion. Furthermore, for cases where the target is still in the field of view but the query only experiences momentary jitter caused by motion blur or scale changes, visibility prediction can also suppress false triggering. In this case, the deviation of the tracking query is temporary and does not require intervention through reactivation; the end-to-end tracking network itself is capable of resuming normal tracking in subsequent frames.
[0114] In an optional embodiment, when the target is not visible and the unlocked tracking query has been determined to be in an unlocked state for multiple consecutive frames, the tracking query can be further marked as inactive and its inheritance in subsequent frames can be stopped, thereby releasing the query resources.
[0115] Based on any of the above embodiments Figure 2 This is the second flowchart of the target tracking method provided by the present invention, as shown below. Figure 2As shown, the process first acquires the current frame image and its detection prior box set. Then, it performs forward inference on the tracking query set to obtain the predicted output information for each tracking query, thus obtaining the network's initial prediction of the target in the current frame. Based on this, the consistency between each predicted output information and the detection prior box set can be calculated, along with the cumulative number of silent and drift frames for each tracking query, to evaluate the tracking status using quantitative metrics. Subsequently, the process enters the lock-out determination stage, judging whether the silence / drift threshold is exceeded: if it does not exceed the threshold, the tracking is normal, and the process jumps directly to the output stage; if it exceeds the threshold, visibility gating is further used to determine if the target is visible and indeed locked: if the target is not visible or not truly locked, intervention is skipped and output is performed directly; if the target is confirmed to be visible and indeed locked, the core correction step is executed, namely, re-anchoring the target prior box based on the lock-out state and forcing output. Forced output maintains identity recognition, using the detection prior box to reactivate the lock-out tracking query and maintain its original identity. Finally, all processed or unprocessed queries are incorporated into the output tracking box and identification step to generate the tracking result for the current frame. By entering the next frame node, the loop starts again, thus achieving continuous tracking of the video sequence.
[0116] Based on any of the above embodiments Figure 3 This is a flowchart illustrating the lock loss determination and matching strategy provided by the present invention, as shown below. Figure 3 As shown, the process of this lock loss determination and matching strategy first obtains the tracking query output box. With detection prior box The system calculates the maximum IoU / confidence between the two through consistency monitoring. Based on the monitoring results, the system executes the cumulative number of silent frames. / number of drift frames The operation quantifies the degree of anomaly tracking. The process then splits into two branches: if it is determined to be a silent lock loss, i.e., the confidence level is < and If the condition is met, the corresponding matching strategy is adopted: the detection prior box with the highest detection confidence is taken as the reference box; if it is determined to be a drift-type loss of lock, that is, the maximum IoU < and If the condition is met, another matching strategy is adopted: select the one with the largest IoU that exceeds the reactivation threshold. The detection prior boxes are obtained. Through the above differential processing, the target prior boxes can be accurately matched for different types of unlock states.
[0117] Figure 4 This is a flowchart illustrating the unlock tracking query reactivation processing and identity preservation mechanism provided by the present invention, as shown below. Figure 4 As shown, the process first obtains the target prior box B* that matches the lock loss tracking query based on the detection prior box database. The detection prior box database is used to provide the target prior box B*. Subsequently, for targets with reference points... Regarding the tracking query for lost identity k, this invention employs a re-anchoring strategy. This involves updating the query using B while maintaining the original identity k, and then performing a forced output step to ensure the output box equals B and the identity remains k, thus preserving the identity. In contrast, existing methods terminate the original query and create a new one, causing the identity to change from k to k', resulting in an identity break. Here, k represents the identity identifier, visually demonstrating the technical advantage of this invention in maintaining identity continuity during reactivation.
[0118] Figure 5 This is a schematic diagram of the lock loss tracking query reactivation control process based on visibility prediction provided by the present invention, as follows: Figure 5 As shown, this process takes a lost-lock tracking query as input. First, visibility prediction is performed to obtain the predicted target visibility *v*. Then, a judgment phase is initiated to assess whether the condition of target visibility and actual lost-lock status is met: if the judgment result is yes, a release and reactivation step is executed to detect bounding box correction, allowing positional correction of the query; if the judgment result is no, a step to suppress output (target out of view / only momentary jitter) is executed to avoid unnecessary intervention. The annotation at the bottom of the figure further explains the function of this mechanism: it determines when to safely reactivate based on visibility *v*, avoiding erroneous corrections for queries that are out of view or only momentarily jittery, thereby effectively preventing erroneous re-anchoring caused by temporary target invisibility or momentary network fluctuations.
[0119] Figure 6 This is a schematic diagram of the overall architecture of the target tracking system provided by the present invention, as shown below. Figure 6 As shown, the architecture first feeds the input image sequence into two processing links. On one hand, a general object detector generates a detection prior box database to provide prior box data. On the other hand, the image is directly input into an end-to-end tracking network. This end-to-end tracking network includes a backbone, tracking query, and query interaction modules, and receives prior boxes from the database as auxiliary input. After inference, the end-to-end tracking network produces two outputs. The output boxes are sent to the lock-out determination module for consistency monitoring and silent or drift classification to identify lock-out tracking queries. The predicted output information of each tracking query is sent to the visibility prediction module, a new module in this invention, to generate a gating v. Finally, the lock-out tracking query and the gating v are combined into the core reactivation module. This module performs re-anchoring, forced output, and identity preservation operations, and corrects deviations by retrieving detection prior boxes, thereby outputting stable tracking boxes and identity identifiers.
[0120] Figure 7 This is a schematic diagram of the end-to-end tracking network output head extension and visibility prediction mechanism provided by the present invention, as shown below. Figure 7As shown, this mechanism takes the tracking query features as input and connects to three processing branches in parallel. The bounding box regression head generates the output bounding box, the confidence head generates the output confidence, and the visibility prediction head outputs the visibility *v*. This visibility *v* is used as a gating signal input to the reactivation module, guiding the module to perform detection prior re-anchoring and identity preservation operations. It can be understood that by adding the visibility prediction head output *v*, gating reactivation determines when to correct biases, thereby achieving precise control over the timing of reactivation while preserving the original network functionality.
[0121] The target tracking device provided by the present invention is described below. The target tracking device described below can be referred to in correspondence with the target tracking method described above.
[0122] Based on any of the above embodiments, the present invention provides a target tracking device. Figure 8 This is a schematic diagram of the target tracking device provided by the present invention, as shown below. Figure 8 As shown, the device includes: The acquisition module 810 is used to acquire the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set; Input module 820 is used to input the tracking query set and the detection prior box set into the end-to-end tracking network to obtain the prediction output information of each tracking query in the tracking query set output by the end-to-end tracking network. The first determining module 830 is used to determine the tracking status of each tracking query based on the consistency between the predicted output information of each tracking query and the detection prior box set. The second determining module 840 is used to determine that the tracking query is an unlocked tracking query when the tracking status of the tracking query is an unlocked state; The activation processing module 850 is used to determine the target prior box that matches the lost-lock tracking query from the detection prior box set, reactivate the lost-lock tracking query based on the target prior box to obtain a reactivated tracking query set, obtain the target tracking result corresponding to the reactivated tracking query set, and update the next frame image of the current frame image to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0123] The apparatus provided in this invention determines the tracking status of each tracking query by calculating the consistency between the predicted output information of each tracking query and the detection prior box set frame by frame. This enables timely detection of lock loss due to target degradation during the tracking process. Then, it matches the target prior box for the lock-loss tracking query from the detection prior box set and performs reactivation processing. This elevates the detection prior from a one-time initialization prior to a correction and supervision signal throughout the entire process. This avoids target identity breakage caused by the lack of correction mechanism after the tracking query loses lock and is terminated and re-initialized with a new identity. This significantly reduces the false detection rate and identity switching number of the lock-loss sequence, and improves the tracking continuity and identity stability of target tracking.
[0124] Based on any of the above embodiments, a unit for determining the unlocked state is further included, wherein the unit for determining the unlocked state is specifically used for: If the prediction confidence in the prediction output information of the tracking query is lower than the confidence threshold, the number of silent frames of the tracking query is incremented by 1; if the prediction confidence in the prediction output information of the tracking query is not lower than the confidence threshold, the number of silent frames of the tracking query is cleared to zero. Determine the intersection-union ratio (IUU) between the predicted bounding boxes in the prediction output information of each tracking query and each detection prior bounding box in the detection prior bounding box set, and determine the maximum IUU among the IUUU as the maximum detection IUU of the tracking query; If the maximum detected cross-union ratio (CUNR) of the tracking query is lower than the CUNR threshold, increment the drift frame count of the tracking query by 1; if the maximum detected CUNR of the tracking query is not lower than the CUNR threshold, reset the drift frame count of the tracking query to zero. If the number of silent frames in the tracking query reaches a silence threshold, or the number of drift frames in the tracking query reaches a drift threshold, the tracking status of the tracking query is determined to be unlocked.
[0125] Based on any of the above embodiments, a type determination unit is further included, wherein the type determination unit is specifically used for: When the number of silent frames reaches the silence threshold, the lock loss type of the lock loss tracking query is determined to be a silent lock loss; When the number of drift frames reaches the drift threshold, the type of lock loss in the lock loss tracking query is determined to be a drift-type lock loss.
[0126] Based on any of the above embodiments, the activation processing module 850 is specifically used for: When the lock loss type of the lock loss tracking query is a drifting lock loss, the prediction box in the prediction output information of the lock loss tracking query is determined as the lock loss prediction box; Determine the intersection-union ratio (IUU) of the predicted unlock box with each detection prior box in the set of detection prior boxes; The detection prior box with the largest intersection-union ratio with the lost-lock prediction box and greater than the reactivation threshold is selected from the set of detection prior boxes and used as the first target prior box for the lost-lock tracking query matching.
[0127] Based on any of the above embodiments, a priori box determination unit is further included, wherein the priori box determination unit is specifically used for: When the lock loss type of the lock loss tracking query is a silent lock loss, the detection prior boxes that have not been assigned to other lock loss tracking queries in the same frame are determined from the detection prior box set as candidate detection prior boxes; wherein, the other lock loss tracking queries in the same frame refer to the remaining lock loss tracking queries in the current frame image other than the lock loss tracking query. The detection prior box with the highest detection confidence in the candidate detection prior box is determined as the second target prior box for the lock loss tracking query matching; The detection confidence level is the confidence level corresponding to each detection prior box in the detection prior box set.
[0128] Based on any of the above embodiments, the lock loss tracking query has a reference point, content embedding, and identity identifier; The activation processing module 850 is specifically used for: The reference point of the lost lock tracking query is updated with the normalized center coordinates and size of the target prior box to obtain the reactivation reference point; The content embedding of the lost lock tracking query is updated to the sum of the position code corresponding to the target prior box and the detection prior embedding to obtain the reactivated content embedding; wherein, the detection prior embedding is an embedding vector generated based on the target prior box; Based on the identity identifier obtained from the lost lock tracking query, the reactivation identity identifier is determined; Based on the reactivation reference point, the reactivation content embedding, and the reactivation identity identifier, determine the reactivation tracking query corresponding to the unlock tracking query; The reactivation tracking query set is obtained based on the reactivation tracking query corresponding to the lost lock tracking query.
[0129] Based on any of the above embodiments, the lock loss tracking query also has a prediction box and a prediction confidence level; The reactivation process also includes: Update the predicted bounding box of the lost lock tracking query to the target prior bounding box; Set the prediction confidence level of the lost lock tracking query to a preset high value.
[0130] Based on any of the above embodiments, the activation processing module 850 is specifically used for: The visibility of the target is predicted by performing visibility prediction on the lost lock tracking query; When the target visibility characterizes that the target is visible, the target prior box that matches the lost-lock tracking query is determined from the set of detection prior boxes.
[0131] Based on any of the above embodiments, an acquisition prohibition unit is further included, wherein the acquisition prohibition unit is specifically used for: When the target visibility characterization indicates that the target is not visible, the target tracking results corresponding to the reactivation tracking query set are prohibited from being obtained.
[0132] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 910, a communications interface 920, a memory 930, and a communications bus 940, wherein the processor 910, the communications interface 920, and the memory 930 communicate with each other through the communications bus 940. The processor 910 can call logic instructions in the memory 930 to execute a target tracking method, the method comprising: acquiring the current frame image in the video sequence to be tracked, a set of detection prior boxes corresponding to the current frame image, and an activated tracking query set; inputting the tracking query set and the set of detection prior boxes into an end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network; determining the tracking state of each tracking query based on the consistency between the predicted output information of each tracking query and the set of detection prior boxes; determining the tracking query as an unlocked tracking query when the tracking state of the tracking query is an unlocked state; determining the target prior box matching the unlocked tracking query from the set of detection prior boxes; reactivating the unlocked tracking query based on the target prior box to obtain a reactivated tracking query set; acquiring the target tracking result corresponding to the reactivated tracking query set; and updating the next frame image of the current frame image to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0133] Furthermore, the logical instructions in the aforementioned memory 930 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0134] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the target tracking method provided by the above methods. The method includes: acquiring a current frame image in a video sequence to be tracked, a set of detection prior boxes corresponding to the current frame image, and an activated tracking query set; inputting the tracking query set and the set of detection prior boxes into an end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network; based on The consistency between the predicted output information of each tracking query and the detection prior box set determines the tracking state of each tracking query; when the tracking state of the tracking query is a lost state, the tracking query is determined to be a lost tracking query; a target prior box matching the lost tracking query is determined from the detection prior box set, and the lost tracking query is reactivated based on the target prior box to obtain a reactivated tracking query set, the target tracking result corresponding to the reactivated tracking query set is obtained, and the next frame image of the current frame image is updated to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0135] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the target tracking method provided by the methods described above. The method includes: acquiring a current frame image in a video sequence to be tracked, a set of detection prior boxes corresponding to the current frame image, and an activated tracking query set; inputting the tracking query set and the set of detection prior boxes into an end-to-end tracking network to obtain prediction output information for each tracking query in the tracking query set output by the end-to-end tracking network; and based on the prediction output information of each tracking query... The tracking status of each tracking query is determined by the consistency between the detection prior box set and the tracking status of the tracking query. When the tracking status of the tracking query is unlocked, the tracking query is determined to be an unlocked tracking query. A target prior box matching the unlocked tracking query is determined from the detection prior box set. The unlocked tracking query is reactivated based on the target prior box to obtain a reactivated tracking query set. The target tracking result corresponding to the reactivated tracking query set is obtained. The next frame image of the current frame image is updated to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
[0136] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0137] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A target tracking method, characterized in that, include: Obtain the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set; The tracking query set and the detection prior box set are input into the end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network. Based on the consistency between the predicted output information of each tracking query and the detection prior box set, the tracking status of each tracking query is determined; When the tracking status of the tracking query is an unlocked state, the tracking query is determined to be an unlocked tracking query; The target prior box that matches the lost-lock tracking query is determined from the set of detection prior boxes. The lost-lock tracking query is reactivated based on the target prior box to obtain a reactivated tracking query set. The target tracking result corresponding to the reactivated tracking query set is obtained. The next frame image of the current frame image is updated to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
2. The target tracking method according to claim 1, characterized in that, The steps for determining the unlocked state include: If the prediction confidence in the prediction output information of the tracking query is lower than the confidence threshold, the number of silent frames of the tracking query is incremented by 1; if the prediction confidence in the prediction output information of the tracking query is not lower than the confidence threshold, the number of silent frames of the tracking query is cleared to zero. Determine the intersection-union ratio (IUU) between the predicted bounding boxes in the prediction output information of each tracking query and each detection prior bounding box in the detection prior bounding box set, and determine the maximum IUU among the IUUU as the maximum detection IUU of the tracking query; If the maximum detected cross-union ratio (CUNR) of the tracking query is lower than the CUNR threshold, increment the drift frame count of the tracking query by 1; if the maximum detected CUNR of the tracking query is not lower than the CUNR threshold, reset the drift frame count of the tracking query to zero. If the number of silent frames in the tracking query reaches a silence threshold, or the number of drift frames in the tracking query reaches a drift threshold, the tracking status of the tracking query is determined to be unlocked.
3. The target tracking method according to claim 2, characterized in that, After determining that the tracking status of the tracking query is in an unlocked state, the process further includes: When the number of silent frames reaches the silence threshold, the lock loss type of the lock loss tracking query is determined to be a silent lock loss; When the number of drift frames reaches the drift threshold, the type of lock loss in the lock loss tracking query is determined to be a drift-type lock loss.
4. The target tracking method according to claim 3, characterized in that, Determining the target prior box that matches the lost-lock tracking query from the set of detection prior boxes includes: When the lock loss type of the lock loss tracking query is a drifting lock loss, the prediction box in the prediction output information of the lock loss tracking query is determined as the lock loss prediction box; Determine the intersection-union ratio (IUU) of the predicted unlock box with each detection prior box in the set of detection prior boxes; The detection prior box with the largest intersection-union ratio with the lost-lock prediction box and greater than the reactivation threshold is selected from the set of detection prior boxes and used as the first target prior box for the lost-lock tracking query matching.
5. The target tracking method according to claim 4, characterized in that, The method further includes: When the lock loss type of the lock loss tracking query is a silent lock loss, the detection prior boxes that have not been assigned to other lock loss tracking queries in the same frame are determined from the detection prior box set as candidate detection prior boxes; wherein, the other lock loss tracking queries in the same frame refer to the remaining lock loss tracking queries in the current frame image other than the lock loss tracking query. The detection prior box with the highest detection confidence in the candidate detection prior box is determined as the second target prior box for the lock loss tracking query matching. The detection confidence level is the confidence level corresponding to each detection prior box in the detection prior box set.
6. The target tracking method according to any one of claims 1 to 5, characterized in that, The lost-lock tracking query has reference points, embedded content, and identity identifiers; The reactivation process of the unlocked tracking query based on the target prior box yields a reactivated tracking query set, including: The reference point of the lost lock tracking query is updated with the normalized center coordinates and size of the target prior box to obtain the reactivation reference point; The content embedding of the lost lock tracking query is updated to the sum of the position code corresponding to the target prior box and the detection prior embedding to obtain the reactivated content embedding; wherein, the detection prior embedding is an embedding vector generated based on the target prior box; Based on the identity identifier obtained from the lost lock tracking query, the reactivation identity identifier is determined; Based on the reactivation reference point, the reactivation content embedding, and the reactivation identity identifier, determine the reactivation tracking query corresponding to the unlock tracking query; The reactivation tracking query set is obtained based on the reactivation tracking query corresponding to the lost lock tracking query.
7. The target tracking method according to claim 6, characterized in that, The lost-lock tracking query also includes a prediction box and prediction confidence. The reactivation process also includes: Update the predicted bounding box of the lost lock tracking query to the target prior bounding box; Set the prediction confidence level of the lost lock tracking query to a preset high value.
8. The target tracking method according to any one of claims 1 to 5, characterized in that, Determining the target prior box that matches the lost-lock tracking query from the set of detection prior boxes includes: The visibility of the target is predicted by performing visibility prediction on the lost lock tracking query; When the target visibility characterization indicates that the target is visible, the target prior box that matches the lost-lock tracking query is determined from the detection prior box set.
9. The target tracking method according to claim 8, characterized in that, The method further includes: When the target visibility characterization indicates that the target is not visible, the target tracking results corresponding to the reactivation tracking query set are prohibited from being obtained.
10. A target tracking device, characterized in that, include: The acquisition module is used to acquire the current frame image in the video sequence to be tracked, the set of detection prior boxes corresponding to the current frame image, and the activated tracking query set; The input module is used to input the tracking query set and the detection prior box set into the end-to-end tracking network to obtain the predicted output information of each tracking query in the tracking query set output by the end-to-end tracking network. The first determining module is used to determine the tracking status of each tracking query based on the consistency between the predicted output information of each tracking query and the detection prior box set; The second determining module is used to determine that the tracking query is an unlocked tracking query when the tracking status of the tracking query is an unlocked state; The activation processing module is used to determine the target prior box that matches the lost-lock tracking query from the detection prior box set, reactivate the lost-lock tracking query based on the target prior box to obtain a reactivated tracking query set, obtain the target tracking result corresponding to the reactivated tracking query set, and update the next frame image of the current frame image to the current frame image until the current frame image is the last frame of the video sequence to be tracked.
