{'fraction_non_alphanumeric': 0.02849350232632761, 'fraction_numerical': 0.01190437991336435, 'mean_word_length': 5.106191222570533, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Target Transformed Regression for Accurate Tracking

Accurate tracking is still a challenging task due to appearance variations, pose and view changes, and geometric deformations of target in videos. Recent anchor-free trackers provide an efficient regression mechanism but fail to produce precise bounding box estimation. To address these issues, this paper repurposes a Transformer-alike regression branch, termed as Target Transformed Regression (TREG), for accurate anchor-free tracking. The core to our TREG is to model pair-wise relation between elements in target template and search region, and use the resulted target enhanced visual representation for accurate bounding box regression. This target contextualized representation is able to enhance the target relevant information to help precisely locate the box boundaries, and deal with the object deformation to some extent due to its local and dense matching mechanism. In addition, we devise a simple online template update mechanism to select reliable templates, increasing the robustness for appearance variations and geometric deformations of target in time. Experimental results on visual tracking benchmarks including VOT2018, VOT2019, OTB100, GOT10k, NFS, UAV123, LaSOT and TrackingNet demonstrate that TREG obtains the state-of-the-art performance, achieving a success rate of 0.640 on LaSOT, while running at around 30 FPS. The code and models will be made available at https://github.com/MCG-NJU/TREG.


Introduction
Visual object tracking [1,24,9,2] is an important yet challenging task in computer vision with a wide range of applications, such as robotics, surveillance [38], and humancomputer interaction [26]. It aims to estimate the state of an arbitrary object in video frames, given the target bounding box in an initial frame. Although much progress [1,24,9,2] had been made in recent years, accurate tracking still remains challenging, due to the fact that the target might be with deformation, pose and viewpoint changes, and even occluded by other objects. In general, tracking a single object can be decomposed into sub-tasks of classification Figure 1. A comparison of our approach with state-of-the-art tracker. Observed from the visualization results, our TREG produces more precise bounding boxes than the state-of-the-art trackers PrDiMP [11] and other anchor-free trackers, such as Ocean [42], when encountering circumstances of deformation, scale changes and fast movement. and regression, which is to localize the target roughly and regress the precise bounding box, respectively.
In order to build an accurate tracker, regression branch design is of great importance as it is responsible for generating the precise bounding box. The previous works on box estimation can be roughly grouped into two types: (1) indirect bounding box estimation and (2) direct bounding box regression. For the first type, early approaches [1] simply use a multi-scale searching strategy based on the classification branch. Then, ATOM [9] method presents a specialized IoU prediction network to select and refines the final object box. For the second type, the seminal Siamese trackers [24,43,23] resort to anchor-based mechanism to direct regress the bounding size based on the predefined anchors. More recently, some anchor-free trackers [42,39,5,16] are more popular owning to its simplicity in design and superior performance, by directly regressing the box size. However, unlike image object detection, these anchor-free trackers are not sufficiently accurate and robust for object tracking, due to the essential illness of tracking problem that we expect a tracker to be trained with a one-shot supervision yet to generalize well to unseen deformations and variations.
In this paper, our objective is to design a more accurate anchor-free tracker by proposing a customized regression branch to effectively handle object deformation, pose and view changes. Based on the above analysis, we argue that the core problem of accurate anchor-free tracking is how to integrate the target information to regression branch to retain its precise boundary information and handle its variations in time. The existing anchor-free trackers [42,39,5,16] simply utilize a depth-wise correlation representation to fuse target information or a target guided attention module to modulate the visual representations. Although these techniques provide feasible solutions for target information integration, they may contain insufficient target information for precise regression, and lack flexibility to deal with object variations. Accordingly, we figure out two important factors that need to be considered specifically. First, in order to generate precise object boundaries, we need to keep sufficient target information in regression branch. Second, for handling appearance variations and object deformation, regression branch is expected to be flexible with deformation and adaptive over time.
Following the above analysis, we devise an anchor-free and target-guided regression branch with a transformeralike design, termed as Target Transformed Regression (TREG), partially inspired by the success of Transformer [32] in context modeling. Basically, we utilize the cross-attention mechanism in transformer to explicitly model all pairwise interactions between elements of target template and search areas, making these enhanced representations particularly suitable for precise boundary offset regression. Specifically, the feature cells in target template are encoded as key and value at first. Then, for each position in search area, we enhance its visual representation by querying its feature over all the pairs of key-val in the target template. This retrieved target-aware representation is able to enhance the target-relevant information and deal with object deformation to some extent, thanks to the local and dense matching between all elements of target template and search regions. To further improve the effectiveness of our TREG, we establish an online target template queue to maintain the variations of the tracked object, and design a confidence based update strategy to adaptively select reliable target templates. Finally, we place a feed-forward network on top of the target transformed representation to perform object boundary offset regression.
Combined with the existing online classification branch from DiMP [2], we develop a principled anchor-free tracking framework. We perform comprehensive experiments on eight benchmarks [22,21,19,37,30,13,29,14] to demonstrate the superior performance of our TREG to previous state-of-the-art methods. The contributions of this work are three-fold: • We propose an accurate anchor-free tracker by specifically devising a target transformed regression branch (TREG). The advantage of modeling pair-wise relation between elements in target template and search area enables our TREG to keep precise boundary information and effectively deal with objects variations.
• We present a simple online target update mechanism by establishing a confidence based template queue, which enables the tracker to be flexible to deal with appearance variations and geometric deformations of object over time.

Related Work
In this section, we briefly introduce recent trackers from the aspect of target regression. Besides, we discuss the transformer mechanism used in tracking.
Target regression for tracking Target regression is employed in estimating the precise target state. Previous works can be roughly grouped into two types, indirect target estimation and direct bounding box regression. For the former one, some CF-based trackers [18,8,28,31] and SiamFC [1] employed brutal multi-scale test to estimate the target scale roughly. ATOM [9] and DiMP [2] employ a specialized IoU prediction network to select and refine the final object box. For the latter one, RPN-based trackers [24,23,43,41,40,35] regress the location shift and size difference between pre-defined anchor boxes and target location. SATIN [15] and CGACD [12] detect corners using cross-correlation operation and correlation-guided attention operation respectively. SiamFC++ [39] directly regresses the offset to box corners. Anchor-free trackers [5,16,42,6] are more and more popular owning to its simplicity in design and superior performance. However, to use target information, the existing anchor-free trackers employ a targetguided attention or a depth-wise correlation to modulate the search frame representation, which may contain insufficient target information for precise regression, and lack flexibility to deal with object variations. We devise a target transformed regression branch to tackle these issues and acquire superior performance.  Figure 2. TREG Framework. We present an end-to-end anchor-free tracker, termed as TREG, for accurate tracking, which is composed of a backbone to extract common features, classification feature extractors and a regression feature extractor to extract task-specific features, multi-scale classification module and target-aware transformer based regression module to localize the target center and estimate the precise target bounding box respectively. Similarly to FCOT [6], We employ a multi-scale online classification component, where the discriminative model generator is proposed in DiMP [2], to localize an accurate target center. For regression, a simple online updating target-aware transformer is proposed to yield a robust and precise regressor. Detailed structure of the online target-aware transformer can be found at Figure. 3.
Transformer mechanism in tracking Generalized transformer mechanism [32] is a group of neural network layers that aggregates information from the entire input sequence. It introduces attention layers, which scan through each element of a sequence and update it by aggregating information from the whole sequence. In the area of visual tracking, CSR-DCF [27] constructs an object spatial attention map to constrain correlation filter learning and calculates the channel reliability values of weighted sum correlation response maps. Then RASNet [34] introduces spatial and channelwise attention to a Siamese network. CGCAD [12] further proposes a correlation-guided attention for corner detection. However, the pixel-wise correlation-guided spatial attention overlooks the fact that there are some background parts in the target, which may result in high attention weights outside the object region. Consequently, they adopt a complex two-stage structure for estimating one RoI and then detecting the corners, so as to alleviate the issue. Compared with them, our target-aware transformer retains sufficient target information to enhance the regression representation and can be easily deployed for online regression thanks to its simple structure.

Proposed Method
We develop a target transformed regression branch with online updating mechanism for accurate anchor-free tracking. The online target transformed regression component is basically devised complying with the following guidelines: (i) a fully target integration module to yield high-quality visual representation to retain sufficient target information for precise object boundary generation, (ii) pixel-wise context modeling to enhance the target-relevant features and cope with object deformation, and (iii) an efficient online mechanism so as to handle appearance variations in a consecutive sequence.
We take inspirations from the transformer in context modeling and its variants [32,36] in computer vision, and devise a transformer-alike structure for anchor-free regression. Given a query element and a set of key elements, a transformer function adaptively aggregates the key contents to transform the query feature based on attentive weights that measure the compatibility of query-key pairs. Following this technical perspective, a target-aware transformer is designed for incorporating target appearance into our regression features. The feature cells of target template extracted by a backbone and an ROI pooling layer is encoded as key and value elements. Then for each position in search region, we enhance its visual representation by querying its feature over all the pairs of key-value. Then the retrieved representations are fused to original feature so that we can obtain rich target-aware information for regression. Through the local and dense matching between all elements of target template and search regions, we can not only preserve sufficient target information to produce high-quality representation for regression, but also be able to handle with object deformation to some extent. Additionally, we establish an online target template queue to maintain the variations of the tracked object, composed of three static targets augmented by the given template and reliable online targets adaptively selected based on the classification confidence.  (a) Target-aware transformer takes search region feature and pooled targets feature as input, producing transformed regression feature. Two 3D Conv with kernel size of 1 × 1 × 1 is performed to targets feature to generate key and value respectively. Similarly, a 2D Conv with kernel size of 1 × 1 is performed to search region feature to yield query element. " " denotes matrix multiplication, and " " denotes element-wise sum. N orm. denotes scaling by 1/(t × h × w). (b) Online template update mechanism is implemented by maintaining a targets template queue with size of 7, which is composed of 3 static targets feature and 4 online updating ones. The static targets is acquired by performing an augmentation to the given target. The online targets memory is updated every n frames. An online samples bar is to reserve n targets feature with classification scores. Then the proper online target is selected by maximize the confidence scores from the samples bar.
Finally, a feed-forward network is placed on top of the target transformed representation to perform object boundary offset regression directly. By these designs, we construct a simple yet accurate target transformed regression branch.
Based on our proposed target transformed regression branch, we build an efficient and principled anchor-free tracker (TREG), by combining an online classification branch. The framework of the proposed tracker is shown in Figure. 2. The whole framework is composed of a common backbone to extract features for both classification and regression branches, a classification branch to localize the target center, and a regression branch to estimate precise target state. Similar to FCOT [6], we employ a multi-scale online classification component, where the discriminative model generator is proposed in DiMP [2], to estimate a robust target center location. Given the target center location and template in online targets queue, the target-aware transformer produces the enhanced visual features, which are used to regress offset to the object boundary directly. We describe the target transformed regression branch and the framework in details in the next subsections.

Target transformed regression
In general, anchor-free regression is solely based on the appearance representation to predict the geometric offsets of box boundary with respect to object center by using a feed-forward network. In order to bridge the gap between appearance information and geometric structure, we hope to incorporate more detailed structure information (e.g., object boundary) into our visual representation, thus relieving the difficulty of geometric structure prediction. As for the specific anchor-free object tracking, we aim to leverage more detailed target information to enhance the object relevant areas while suppress the distractor from background. However, the depth-wise correlation [5,39,42,16] yields similarity map with inconspicuous boundary of the target facing with object deformation since the whole target is served as a correlation filter. Meanwhile, the pixel-wise correlationbased attention [12] imposes other challenge due to retaining insufficient target information. The region outside the object may be assigned with a high attention weight when there exists background parts in target. To overcome these shortcomings, we choose to better exploit the all pair-wise correlation between the elements in target and search area, and aim to leverage this rich and high-order features to keep sufficient target-related information, and as well handle the object variation issues during tracking.
Target-aware transformer. As outlined in the above analysis, our target transformed regression is inspired and re-purposed from the Transformer architecture [32]. Ba-sically, we use the search area as a query to enhance its representation with target information. Concretely, the target hidden representation is encoded as key and value elements in a pixel-wise way, providing weighted aggregation response for a query which is a position of search region feature. We define the target-aware feature transformation as: Here, i indexes a position in search region with representation x i . j is the index that enumerates all possible positions in target template with feature representation t j . k indexes the template in our target queue and Ω k specifies the feature cells in target template for query. The function ω computes a representation of the target signal at the position j which is served as value element. A pairwise function A(t j , x i ) depicts the relations between t j and x i . The implementation form of A(t j , x i ) is as follows: where θ function encodes x i as a query element and φ function encodes t j as a key element. Target-aware information aggregation is with a weighted sum. Then the weighted sum is scaled by 1/N to perform normalization. N is the total number of elements in our target queue, which is t × h × w and t is the number of template and h and w is template size. Particularly, the normalization factor 1/(t × h × w) can not be substituted with Softmax function as in [36,32]. The reason lies in that some positions in background and distractors of the search region are expected to have low dependency with target, while Softmax function will amplify this noise influence as the sum of attention weights between the query and all the keys is always 1. Besides, W represents feature transform to make the queried feature to be the same shape with x i . y i is the target transformed representation with a simple average of original features and retrieved representation. As in Figure. 3, target-aware transformer takes search region feature and ROI-pooled target feature as input, where the spatial size of search region feature is 88 × 88 and the target size is 5 × 5 in this work. The functions φ and ω are implemented with a 3D convolution layer with kernel size of 1 × 1 × 1 respectively, since an online 3D targets memory is maintained as described in 3.2. Similarly, the functions θ and W are 2D convolution layers with kernel size of 1 × 1. A target-aware transformer operation is a flexible building block and can be easily inserted to the current anchor-free trackers. There are only 4 convolution layers with kernel size of 1 to be trained offline in the block. Furthermore, we can keep a target queue of variable sizes, which can be easily deployed for online updating.
Discussion with other anchor-free regression. To better expound the insight of our target-aware transformer, we compare with the regression component of previous anchorfree trackers. In general, there are the two major methods for integrating target information to search region feature in anchor-free regression. First, most of them [39,16,5,42] employ depth-wise correlation to produce similarity map based on the whole template. Since the correlation filter simply possesses global information of the target, it is difficult to reflect the object boundary precisely when encountering deformation or similar intricate circumstances. Secondly, CGACD [12] brings in a complex correlation-guided attention for detecting the corner which imposes other limitations. Pixel-wise correlation is the primary operation to generate target-aware spatial attention. However, it overlooks the fact that there are some background parts in the target, which may result in high attention weights outside the object region. Consequently, they adopt a complex twostage structure for estimating one RoI expected to contain the target and then detecting the corners, so as to alleviate the issue.
In contrast, our target-aware transformer explicitly models all pair-wise interactions between elements of target template and search area, and uses the retrieved feature representation to enhance the original features. This unique design makes our target transformed representation to attain more detailed target-relevant information than previous methods, and well handle the appearance variation and deformation of object due to our local and dense matching mechanism. The exploration study demonstrates that our target transformed regression is able to yield more accurate tracking results, as discussed in Section 4.1.

Online template update
In order to cope with the target variations in a consecutive sequence, we present an online template update mechanism for regression as visualized in Figure. 3(b). An inherent issue that comes with the online scheme, is that the tracked objects may be imprecise. The tracker is thus confused and tends to drift. It is crucial for accurate regression to make a trade-off between using online targets and static targets. Therefore, an online targets template queue comprising 3 static targets and 4 online targets is maintained. The static targets are acquired by performing a data augmentation to the given template. The online targets memory is updated every n frames, where n is the updating interval. Since the tracked targets are unstable, we design a confidence based updating strategy to adaptively select reliable target templates. When the object is predicted with the maximum confidence among the online targets in the samples bar, its template will be added into target queue. Experimental results demonstrate the effectiveness of online template update mechanism in Section 4.1.

Implementation details
Framework. Following the architecture of [2], we employ a ResNet-50 [17] as the backbone to extract common feature. Then an U P layer, composed of 2 convolutional layers and 2 up-sampling layers are used to generate highresolution feature. Then the Classification head and the regression head extract task-specific features to cope with classification and regression tasks separately. The classification head and the regression head are composed of a convolutional layer and 2 deformable convolutional layers [7].
We employ the multi-scale classification branch similar with [6], learning discriminative models proposed in [2]. At first, Low-resolution score map and high-resolution score map are generated by separate online classifiers. Then these two maps are fused to predict a robust and precise target center. During training, the classification objective is a Gaussian function map centered at the ground-truth target center.
The regression branch is composed of the presented target-aware transformer and a feed-forward network containing 2 convolutional layers and a deformable convolutional layer to estimate the offset from a point to the target boundary. During the offline training process, we perform regression for positions in the vicinity of the target center, which is an area with a radius of 2 in this work.
Offline training. Similar with some popular trackers [2,11,9,6], we use the training splits of LaSOT [13], Track-ingNet [30], GOT-10k [19] and COCO [25]. We train the model for 50 epochs by sampling 40000 videos per epoch, giving a total training time of 100 hours on 8 Nvidia Tesla V100 GPUs. The whole network is trained end-to-end with a mini-batch size of 80. We use ADAM [20] with learning rate decay of 0.2 at the epoch of 25 and 35. The classification training loss settings are the same with DiMP [2]. For regression, we use IoU loss and the loss weight is set to 1.
Online tracking. We perform data augmentation to the first frame with translation, rotation,and blurring, yielding a total of 15 initial online training samples for online classification. And we select 3 samples as the static targets for the online target template queue. During the tracking process, we employ the designed confidence based updating strategy to select reliable samples. We ensure a maximum queue size of 7 by discarding the oldest sample. Online classification is performed as in [6].

Experiments
Our tracking approach is implemented in Python based on PyTorch. For inference, we test our tracker on a single Nvidia RTX 2080Ti GPU, achieving a tracking speed of   around 30 FPS. The code for training and inference will be made public.

Exploration study
Here, we describe the experiments to analyze the impact of the target transformed regression and the online template updating mechanism for the transfromer proposed in this work. The experiments are performed on the combined UAV123 [29] and NFS [14] datasets, as in ATOM [9]. There are a total of 233 challenging videos. We report two metrics, area-under-the-curve(AUC) score and precision score (Precision). For fair comparison, all the following experiments are performed under identical training setting.
Target-aware transformer for regression. Our primary contribution is the proposed target transformed regression branch. To evaluate its effectiveness, we take comparison with the following analogous methods for anchor-free tracking. For a fair comparison, We only substitute the target-aware transformer with the following modules, while the other components including classification branch and feed-forward network are the same. And our TREG only utilize the given target as template without the online samples. Baseline: we compare with a baseline approach that removes the target-aware transformer. As shown in Table. 1, the performance drops by 3.5% in terms of Precision and 4.4% in terms of AUC, which indicates that incorporating the target information into regression representation is of vital importance. DW-Corr: then we take comparison with depth-wise correlation based regression method as being commonly used in [42,5,16,39]. The performance has a obvious drop compared with ours, since it can not handle with target deformation for accurate regression. PCorr-Att: we also compare with the pixelwise correlation-guided spatial attention module proposed in [12], since it has high relevance with the target-aware transformer. It generates inferior performance than ours, which demonstrates that retaining sufficient target informa-  Figure 5. Visualization of classification feature when applying our target-aware transformer to classification branch. Red box denotes the ground-truth bounding box and the green one denotes the tracked negative object.
Online Selected Samples tion for regression representation is essential for eliminating the interference of the background or distractors. In Figure. 4, we further provide intuitive visualization samples for regression feature to illustrate that the proposed method represents the boundary of targets better than other methods. It can be seen that the boundary of the diver including head and foot are get augmented through our target-aware transformer although the object changes in the sequence.
Target-aware transformer for classification. We further analyze the appliance of target-aware transformer for classification branch, only substituting the high-resolution classification module with the proposed transformer-alike structure. We can see from Table. 1 that the performance of TAT-Cls is not so good as ours TREG. Specifically, the pixelto-pixel matching method is not suitable for discriminating similar objects since it tends to overlook the overall information of targets, which can be derived from Figure. 5. As a consequence, target-aware transformer is not employed for classification in our design.
Online template update. We investigate the impact of the online transformer mechanism for regression. The results of the investigation are shown in Table. 2. In our design, the online targets queue is composed of a static targets  memory and an online updating targets memory. We can derive that the size of the static targets memory is of slight influence. Compared with only using a static target, maintaining an online targets template queue improves the AUC by 0.9% and the Precision by 1.2%. It demonstrates the effectiveness of the online regression mechanism. Furthermore, we observe that the performance drops a little if without the confidence based updating strategy since the online targets may be unreliable, which proves the effectiveness of the scheme. Furthermore, we visualize the online targets queue in Figure. 6. It can be derived that high confidence scores generally correspond to high-quality samples, which proves that the online samples selection strategy is useful.
OTB-100 OTB100 [37] is a commonly used benchmark, which evaluates performance on Precision and AUC scores. Figure. 7 presents evaluation results of our TREG on both two metrics on OTB-100 benchmark. Achieving 71.4% and 94.5% in AUC score and precision score, our tracker reaches the state-of-the-art level w.r.t. other trackers in comparison.   LaSOT LaSOT [13] has 280 videos in its test set. We evaluate our TREG on the test set to validate its long-term capability. The Figure. 8    GOT10k GOT10k [19] is a large-scale dataset with over 10000 video segments and has 180 segments for the test set. Apart from generic classes of moving objects and motion patterns, the object classes in the train and test set are zerooverlapped. Our TREG obtain state-of-the-art performance on the test split.
UAV123 UAV123 [29] is a large dataset containing 123 Sequences with average sequence length of 915 frames, which is captured from low-altitude UAVs. Table. 7 shows our results on UAV123 dataset. Our proposed TREG outperforms the previous best reported result in precision. For AUC score, our TREG achieves 66.9%, which is close to PrDiMP.
NFS NFS dataset [14] contains a total of 380K frames in 100 videos from real world scenarios. We evaluate our TREG on the 30 FPS version of this dataset. As shown in Table. 8, Our TREG outperforms all previous approaches by a significant margin. Our result demonstrates the effectiveness of TREG for accurate regression.

Conclusions
We proposed a target-aware transformer, termed as TREG, to transfer an regression component from detection into tracking. We formulated the process of target integration for regression as a pixel-wise feature transformation guided by the target features. Additionally, we explored an efficient online regression mechanism which maintains an updating targets memory and selects the confident samples. Our approach provided accurate target estimation while being robust against distractor objects in the scene, outperforming previous methods on eight datasets.