Full text
Pattern Recognition 121 (2022) 108205 Contents lists available at ScienceDirect Pattern Recognition journal homepage: www.elsevier.com/locate/patcog Tracking more than 100 arbitrary objects at 25 FPS through deep learning Lorenzo Vaquero ∗, Víctor M. Brea , Manuel Mucientes Centro Singular de Investigación en Tecnoloxías Intelixentes (CiTIUS), Universidade de Santiago de Compostela, Santiago de Compostela, Spain a r t i c l e i n f o Article history: Received 23 March 2021 Revised 8 June 2021 Accepted 24 July 2021 Available online 25 July 2021 Keywords: Multiple visual object tracking Motion estimation Deep learning Siamese networks a b s t r a c t Most video analytics applications rely on object detectors to localize objects in frames. However, when real-time is a requirement, running the detector at all the frames is usually not possible. This is somewhat circumvented by instantiating visual object trackers between detector calls, but this does not scale with the number of objects. To tackle this problem, we present SiamMT, a new deep learning multiple visual object tracking solution that applies single-object tracking principles to multiple arbitrary objects in realtime. To achieve this, SiamMT reuses feature computations, implements a novel crop-and-resize operator, and defines a new and efficient pairwise similarity operator. SiamMT naturally scales up to several dozens of targets, reaching 25 fps with 122 simultaneous objects for VGA videos, or up to 100 simultaneous objects in HD720 video. SiamMT has been validated on five large real-time benchmarks, achieving leading performance against current state-of-the-art trackers. © 2021 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ ) 1. Introduction Video analytics systems carry out functions such as automatic video summarization [1] or path planning in autonomous vehicles [2] , to name a few. Many of these systems follow the multiobject tracking (MOT) framework, which processes a video sequence and generates the track —set of bounding-boxes— for each object appearing in the scene [3] . They perform this task using the different com ponents shown in Fig. 1 . Thus, for each new frame, a pre-trained detector is run to locate the categories of interest in the scene. Then, these detections are compared with the objects identified in the previous frames, generating an affinity score, to finally make an association in which they are matched, looking for the lowest overall cost. However, when real-time is a must for video analytics, typical MOT frameworks are not suitable due to their high computational cost. For example, in MOT2020 [4] there are only 5 approaches that report real-time speeds, but they do not take into account the running time of the detector. Considering also the detector times, all those approaches are ruled out. 1 Typical runtimes for accurate detectors on an NVIDIA TITAN V for an HD720 image are 23 fps for ∗Corresponding author. E-mail address: lorenzo.vaq[email protected] (L. Vaquero). 1 We consider that a system/module operates in real-time if it runs at least at 25 fps for HD720 resolution on an NVIDIA TITAN V or similar. EfficientDet-D3 [5] , or 16 fps for RetinaNet [6] . Certainly, there are detectors that can run in real-time, even on embedded GPU systems, like the lightweight Tiny-YOLOv3 [7] , but they often have a poor accuracy or resort to shrinking the input image. Therefore, the most extended approach to enable real-time processing is to call the detector at a lower frame rate and perform motion estimation between detector calls, allowing the system to provide the position of the objects in all the frames. Thus, the motion estimation module feeds the affinity block when the detector is not called [7] ( Fig. 1 , red path). There are different approaches to address motion estimation, being Bayesian filters and Visual Object Trackers (VOT) the most widely used [8] . Visual object trackers are usually class-agnostic, so they are able to track any object regardless of their category, without requiring specific retraining or knowing the class to which the object belongs [9] , which results in much more general motion models than those detection-inspired [10] . Yet, the problem with motion models based on multiple visual object tracking (MVOT) is that they work by instantiating multiple single-object trackers [11] , which is only feasible —in terms of computational time— when there are few targets in the scene. In order to address motion estimation, we propose SiamMT, an MVOT proposal capable of applying single-object online tracking techniques to multiple simultaneous targets in real-time. SiamMT is based on SiamFC [9] . Our approach solves different challenges ( Fig. 2 ) to create a scalable solution, allowing the sharing of feahttps://doi.org/10.1016/j.patcog.2021.108205 0031-3203/© 2021 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license ( http://creativecommons.org/licenses/by-nc-nd/4.0/ )
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Fig. 1. Diagram of a typical MOT system. They have three well-defined steps (colored blue) for generating tracks from input frames. However, real-time systems cannot have detections in all frames (dashed path), so most of the time they rely on a motion estimation module (red path). The purpose of SiamMT is to perform this motion estimation using visual object tracking techniques. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) Fig. 2. Different architectures that show the evolution from SiamFC to SiamMT: a) instantiates multiple SiamFC trackers; b) reuses features computations with a single backbone ϕ; c) introduces ˜ κto solve the location and scaling problems; and d) adds ˜ to support multiple comparisons. Bringing all these three elements together gives rise to SiamMT. tures between objects, adding a feature crop-and-resize module and including a novel pairwise similarity operation. To the best of our knowledge, SiamMT is the first deep-learning-based real-time arbitrary MVOT. The main novelties of our proposal are summarized as follows: •We propose SiamMT, a Siamese Convolutional Neural Network capable of real-time-tracking multiple arbitrary objects in a scalable manner. Its design allows its application in SiamFC- based architectures, either by training it end-to-end or by maintaining their learned weights via a network-based transfer learning procedure. •In order to allow the tracking of different sized objects in the same frame, we establish a reformulation of the RoIAlign operator [12] , making it capable of cropping and resizing features extracted with a fully-convolutional backbone without padding. •We define a new similarity operator which, based on the properties of depthwise cross-correlation, enables the efficient pairwise comparison of multiple feature maps. •We perform a deep analysis on the speed and performance benefits of each operator in the architecture. •Our approach is able to track 122 simultaneous objects in VGA video and 100 objects in HD720 video at 25 fps, all with robustness and accuracy that exceed the current state-of-the-art. The main contributions of this paper with respect to [13] are: •The foundations of design decisions are further deepened, extending the motives behind them and why other possible approaches are not appropriate. Along with this, the introduced operators are defined and analysed in more detail, exploring their effects and performance in greater depth. •Experimental validation is improved, focusing on real-time performance and adding more benchmarks with greater diversity and challenges. •Training is improved, obtaining better accuracy and robustness metrics. •The network architecture is further optimized, achieving a 1 . 69 ×speedup. 2. Related work Motion Estimation. The main contribution of this paper lies in the development of a multiple visual object tracker (MVOT) for motion estimation. There are approaches that allow maintaining the identity of multiple objects by associating their detections across frames [14] . However, since they require detections in all the frames, they cannot be considered for real-time systems. Some of them report near-real-time speeds, but they are achieved without taking into account the detector time or by using multiple GPUs in parallel, so we cannot consider them truly viable solutions. The preferred solutions are those that are completely decoupled from the detector. Within this category, one of the first approaches consisted in the use of Kalman filters to estimate a linear constant velocity model [15] . However, with the rise of visual deep learning models, these Bayesian-based predictors were soon displaced by MVOT methods. Thus, systems emerge that base their motion estimation on single-object trackers, either by including them as an independent stage [16] or by unifying the object motion and affinity model into a single architecture [11] . But the drawback they all have so far is that they simply instantiate multiple single-object trackers, so speeds are low, especially when there are multiple targets in the scene —for example, [11] runs at 5 fps for 21 objects on FHD video. Visual Object Tracking. Single-object visual object trackers receive the location and the dimensions of the target for the first frame of the sequence. From this point on, they search for the object of interest in each frame of the video, updating its coordinates and size. Specifically, Discriminative Correlation Filters (DCF) trackers predict the position of the object by training a filter that distinguishes between the element of interest and the background of the scene [17] , with some works modeling them as convolutional layers [18] to adaptively weight the local target information. However, while these techniques provide great speeds, they have been somewhat displaced by more accurate deep learning approaches. 2
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Table 1 State-of-the-Art Approaches for MVOT. Tracker Real-time Deter. Backbone Similarity SiamFC [9] AlexNet XCorr SiamRPN [21] AlexNet RPN SiamRPN ++ [23] ResNet-50 Depthwise-RPN ATOM [19] ResNet-18 DiMP [20] ResNet-50 AGUnet [24] Custom Mask SiamCAR [22] ResNet-50 Cls + Reg+Cen SiamFC ++ [26] GoogleNet Cls + Reg+Qua ASCT [18] VGG16 TIFC [25] VGG16 XCorr SiamMT AlexNet Pairwise-XCorr Deep learning-based trackers employ deep convolutional neural networks (CNNs) to train a similarity function which, starting from the initial appearance of the object, indicates its position in each new frame. The ATOM [19] family of trackers is one example of this, using specific components for target estimation and classification with the aim of iteratively refining the bounding-box. These trackers adapt themselves online to focus on the tracked object, with approaches that improve the classification module by introducing distractor information and inserting a subnetwork for the prediction of a good initialization [20] , greatly improving the accuracy. Nevertheless, these target estimation methods are very computationally expensive and involve tuning highly-sensitive hyperparameters. Siamese Object Trackers. The most widely adopted trend for object tracking involves the use of a Siamese structure to compare the initial appearance of the object with each frame’s search area, with SiamFC [9] being the forerunner of the state-of-the- art. Several contributions have been made to the original architecture, allowing the regression of the object’s bounding-box —either with [21] or without anchors [22] —, incorporating more powerful backbones [23] , including segmentation information [24] , adopting new objective functions during training [25] , or defining new guidelines for target state estimation [26] . However, most of these new approaches tend to add considerable complexity or significantly decrease the tracking speed, so they are less suitable for extension towards MVOT systems. Table 1 shows a brief summary of the approaches discussed above with their main features. “Deter.” denotes whether the approach is deterministic and “Similarity” specifies the similarity operation of the algorithm (“XCorr”. for cross-correlation, “RPN” for Region Proposal Network, “Cls” for class, “Reg” for regression, “Cen” for center-ness, “Qua” for quality assessment, and empty if the network is non-Siamese). Non-deterministic models lean towards online learning, so they are often less popular due to their higher overhead. The lightest and simplest models are currently the most widely used alternatives for MVOT. This is why we have developed our multi-object tracking approach from SiamFC [9] , because it is fast, simple, effective, and is the basis of the current state-of-the- art in tracking. Therefore, present and future Siamese correlation architectures could follow our proposal. 3. SiamMT Network architecture SiamMT is built around SiamFC [9] , redesigning its architecture to allow the efficient tracking of multiple simultaneous objects ( Fig. 3 ), all while following the techniques employed by individual object trackers. Hence, we will first make a brief description of the foundations of SiamFC and then describe how SiamMT applies and adapts them to multiple targets. 3.1. SiamFC’s network architecture SiamFC is the forerunner of the current state of the art in single object tracking. Its architecture, described in Fig. 4 a, uses deeplearning similarity metrics to track individual objects at a high number of frames per second. The tracking process starts with the initial location of the object at Frame 0. Based on this information, this first frame is cropped and resized, obtaining the exemplar image of the tracked object. This exemplar image consists of the bounding box containing the object plus a context margin ζ, all scaled to a size of 127 ×127 pixels. Following this, the features of this image are extracted using an AlexNet-based [31] fullyconvolutional neural network without padding —as no padding is applied, the strict translation invariance property of the convolutions is maintained [23] . The resulting 6 ×6 pixels and 256 channels features tensor defines the appearance of the object, and will be reused throughout the whole tracking process. Once obtained the exemplar features, the tracking process itself begins, and is repeated for each frame in the sequence. The new frame is loaded and a search area is defined around the last known position of the object. This region is then cropped and resized with κ, obtaining the search area image —255 ×255 pixels—, which is processed using ϕto obtain a features tensor of 22 ×22 pixels and 256 channels. After this, the previously extracted exemplar features are compared with each one of the regions of the search area by means of a cross-correlation operation , generating a score map of 17 ×17 elements. Lastly, this map is bicubically upsampled to 272 ×272 pixels and large displacements are penalized to finally apply non-maximum-suppression and obtain the new position of the object. This process has a number of important insights. First, if we adhere to the above description, the process would only recognize displacements, not changes in scale. In order to detect scale changes, SiamFC considers two additional search areas that cover regions of different sizes (slightly smaller and slightly larger). Once the similarity between the exemplar features and the 3 search areas is computed, the score map with the highest probability is chosen as the new size of the object. Second, due to the way the exemplar image and the search area images are defined, they always represent any object with the same proportion. This is an essential factor in this type of architectures, since it allows to: (i) learn a feature extractor that will always consider similar sized objects; (ii) and define a similarity operation that can assume that the size of the object in exemplar features and in search area features is approximately similar. As a result, the network gains a lot of precision and is able to maintain the object’s scale between frames. 3.2. Modifying the SiamFC architecture to multiple objects The architecture of SiamMT emerges from modifying the architecture proposed by SiamFC as shown in Fig. 4 b, allowing the efficient tracking of multiple simultaneous objects. The main features of SiamMT and its differences from SiamFC are described below. Global features extraction. In the pipeline of SiamFC and its subsequent evolutions, for each new frame, the first step consists of cropping and resizing ( κ) the object’s search area to then extract its features ( ϕ). For a frame with N objects this would be inefficient. Therefore, the solution proposed by SiamMT consists in removing the image crop-and-resize module κand applying the ϕ operator directly on the input frame ( Fig. 4 b). This allows the reuse of features when there are multiple objects on the scene, which enables the scalability of the system since ϕis the most expensive operation in the architecture and its execution per search area —as in SiamFC— would be unfeasible. 3
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Fig. 3. Qualitative examples of SiamMT on different sequences from (a) ILSVRC [27] , (b) VisDrone [28] , (c) MOT-2017 [29] , and (d), (e) YT-BB [30] . Fig. 4. a) SiamFC and b) SiamMT network architectures during the inference phase. SiamMT first extracts the features of the entire frame via a ϕbackbone, enabling the reuse of features. After this, the features of the various search areas are cropped and resized with the ˜ κoperator. Finally, these features are combined with those of their respective exemplars through ˜ , obtaining score maps that indicate the new positions of the Nobjects. Cropping and resizing of features. Once the features of the whole frame have been extracted, the following naïve step would consist in directly comparing said features with those of each exemplar using ˜ . However, doing so would result in two major problems: (i) it is inefficient to analyze the entire frame looking for an object, as it is unlikely that said object has undergone a large displacement relative to the previous frame —thus it is better to search for each object in a reduced area—; (ii) the similarity function would become less efficient as the object changes in scale, since the main trackers through similarity [9,21,23,26] have a relatively low tolerance for discrepancies between the object’s size in the exemplar image and in the search area —supporting a maximum difference of up to a 15% , according to our experiments. To solve this, in SiamMT it is necessary to introduce a features crop and resize module ˜ κprior to the similarity operation ( Fig. 4 b). This ˜ κoperator is applied to the frame features and creates new fixedsize tensors in which each object is represented with a constant size, analogously to SiamFC’s κoperation. However, while crop and resize operations result straightforward in images, they are particularly challenging when carried out on features. The first proposal to obtain a set of fixed-size feature maps from a nonuniform sized input and a series of regions of interest Fig. 5. Pooled pixels when applying a) ˜ κ, b) RoIPool, and c) RoIAlign over a 4 ×4 features tensor (depicted as a blue dashed grid). The region of interest (represented in black) has 2 ×2 bins, and the sampling points (colored red) have arrows linking them to the pixels they query. Quantizations in RoIPool produce misalignments, and RoIAlign uses 4 sampling points per bin that are merged into one value (colored purple). (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) comes with RoIPool [32] . RoIPool delimits each region of interest and divides it into a predetermined number of sections (bins) - – e.g. 2 ×2 —, to then assign each bin the value corresponding to the highest value of the pixels it contains ( Fig. 5 b). As an RoIPool suc- 4
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Fig. 6. Transformation between pixel coordinates and features coordinates for a) a backbone with padding using RoIAlign and b) backbone without padding using ˜ κ. When the backbone has no padding, the transformation cannot be performed directly using RoIAlign. Thus, we first clip the input tensor to its effective size (step 1) ), and then apply the RoIAlign calculation on that tensor (step 2) ). cessor, aiming for higher precision, RoIAlign [12] arises, which prevents misalignments by avoiding quantizations and obtains more representative values by computing the values of each bin by aggregating —maximum or average— 4 bilinearly interpolated sampling points ( Fig. 5 c). Following RoIAlign’s approach, in SiamMT we introduce the ˜ κ operator in order to crop and resize features. It is an RoIAlign variant that applies a region calculation capable of handling features extracted with a backbone without padding —see below—, and that employs a single sampling point per bin ( Fig. 5 a). This allows ˜ κ to maintain the inference speed while obtaining more precise and representative values than with RoIPool. The ultimate goal of this operator is to reconstruct the information that would have been obtained from the direct features extraction of each rescaled image. Features coordinates calculation. For the correct determination of the regions of interest, ˜ κredefines the way in which areas are delimited. In RoIPool and RoIAlign, the transformation between image coordinates x i and features coordinates x f is done by simply dividing the pixel coordinates by the backbone’s ( ϕ p ) global stride S( Fig. 6 a). This, whilst it works when the feature extractors are architectures with padding such as ResNet [33] or Dark- Net [34] , is incorrect if the backbone has no padding, as is the case of AlexNet [31] , the backbone employed in SiamFC. Therefore, in order to calculate the region coordinates for backbones without padding, it is necessary to apply the transformations considering the effective size of the input tensor. Let T be an input tensor of size Nthat produces an output of size Mafter passing through a fully-convolutional backbone ϕ without padding. We define N , the effective size of T with respect to ϕ, as the size of the minimum subtensor of T that produces an output of size Mafter passing through ϕapplying padding in all its operations —we denote this configuration of the backbone as ϕ p . It is possible to prove that every tensor T would have an effective size of: N = N −K + 1 S ·S −( S −1 ) (1) where Kand Sare the receptive field and the global stride of ϕ, respectively. This implies that T generates an M-sized tensor after passing through ϕ, and T (the N -sized clipping of T ) generates a tensor with exactly the same size Mafter passing through ϕ p . As we define N as the minimum size that fulfills this property, if T shrank, its features extracted using ϕ p would be smaller than M. Conversely, if T grew (but no more than S −1 pixels in each dimension), the size of its features extracted with ϕ p would remain M. By defining N in this way, we can use T as an intermediate step to transform coordinates extracted with a backbone without padding ( ϕ), as shown in Fig. 6 b. Therefore, the step 1) consists in calculating the new position of the object inside T , namely x i . After this, it is possible to pose the problem as the extraction of the features of T with ϕ p , so the position x f of the object in features will be obtained by dividing its new coordinates x i by the global stride of the backbone S(step 2) ). Finally, these coordinates will become the new position of the object, since the dimensionality of the tensor generated by ϕ p is the same as that of the tensor generated by ϕ. Consequently, given some input coordinates in pixels x i , their respective coordinates in features extracted with the fully-convolutional backbone ϕwithout padding will be calculated as follows, by concatenating said steps: x f = 1 S ·x i −N −N 2 (2) This transformation reveals two issues: •In the SiamFC architecture, the size of the exemplar features tensor is smaller than the object it represents. As seen in Fig. 7 a, on step 3) we extract the features of a 127 ×127 image containing a 63 . 5 ×63 . 5 object. As the backbone has a global stride of 8, the object becomes 7 . 9 ×7 . 9 pixels in size. However, since the backbone does not employ padding, the resulting exemplar features tensor has a size of only 6 ×6 pixels, and thus some of the object’s edge information is washed away. Hence, during the similarity operation, the central regions of the object will receive the most attention and its edges will be mostly ignored. •In the SiamMT architecture, if the region sizes were computed over the frame, the scale of the object would differ between exemplar and search area features. This becomes evident on Fig. 7 b, step 3) , as the exemplar features undergo a rescaling of a factor of 0.73, while the factor for the search area features is 1.33. This scaling difference is due to the fact that the size ratio between the defined areas is different from the size ratio between the features tensors. Thus, at the end of the process we obtain an object of size 3 ×3 at the exemplar branch, while the object has a size of 5 . 4 ×5 . 4 pixels at the search area branch. Ultimately, a difference like this ends up being very harmful to the network’s performance, as the similarity operation will not be able to appropriately match the exemplar and the search area. In summary:(i) SiamFC’s exemplar features tensor is smaller than the object it represents, causing an information loss at its edges; (ii) in our architecture, if we computed the exemplar and search area regions over the input frame, the size of the object would differ between the exemplar and the search area tensors. Therefore, in order to solve these two issues, we calculate the regions over the frame features and without any additional context 5
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Fig. 7. Numerical example for a 33 ×33 -pixel object across different architectures. Object is represented in gray, while its exemplar and search area regions are represented in green and red, respectively. a) depicts the standard SiamFC architecture, b) illustrates the mismatch when computing regions over the input frame, and c) shows the method followed by SiamMT. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) ( ζ= 0 ), as shown in Fig. 7 c, step 2) . This way, at the end of the process, the size of the object is the same for both tensors, and there is no loss of information at the edges. Similarity operation. Finally, of particular interest is the reformulation of the features comparison operation applied at the end of the architecture. This is because, in SiamFC and its derived architectures, it is defined as a cross-correlation operation between the exemplar features and the search area features tensor. In the case of SiamMT, as it is necessary to cross-correlate multiple pairs of tensors, this operation would have to be replicated throughout the batch size, which is computationally inefficient. As a solution, taking advantage of the properties of GPGPU architectures, we propose the use of the pairwise cross-correlation ˜ . The proposed ˜ operation ( PairwiseXCorr ) is described in Algorithm 1 , and takes as inputs the exemplar and search area features ( T E and T A ) of N objects and efficiently compares them, generating N score maps. As we want this operator to be general and applicable to other architectures, the exemplar features tensor supports an additional dimension o, to vary the depth of the resulting score maps. This dimension allows the application of ˜ on architectures that require many outputs for each cross-correlated pair, like the anchors regressions in a Region Proposal Network [23] . Operator ˜ is made possible by the properties of twodimensional depthwise cross-correlation ( DwXCorr ). The latter takes as inputs a three-dimensional tensor T Y and a set of twodimensional filters T Z , and applies a different filter to each of the cchannels of T Y . Therefore, by appropriately stacking the objects’ features contained in T A and T E , it is possible to obtain the T Y and T Z tensors (lines 2 and 3), which are the inputs to the depthwise cross-correlation operation. After the operation, an output T P with N ·cchannels is generated (line 4). Finally, this output is reshaped (line 5) and aggregated for each object (line 6), which would correspond to the final sum of the cchannels for each filter in a standard cross-correlation. This new operator is mathematically equivalent to applying to each pair and has a great impact on the speed of the architec- 6
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Algorithm 1: Pairwise cross-correlation. •Let T σ, be the permutation of the dimensions in tensor T , where σis the permutation in cycle notation. •Let vec( T ) , be the vectorization of tensor T , which converts it into a column vector. •Let vec −1 a 1 , ... ,a i , ... ,a n (V ) , be the folding of vector V into an n - dimensional tensor, where a i is the size of each dimension. •Let DwXCorr T Y , T Z , be the two-dimensional depthwise cross-correlation between tensors T Y and T Z , with T Z acting as the filters. 1 Function PairwiseXCorr T A , T E Input : A T A tensor of dimensions [ N , w A , h A , c] containing the features of N search areas, and a T E tensor of dimensions [ N , w E , h E , c, o] containing the features of N exemplars to obtain o output channels. Output : A T S tensor of size [ N , w A −w E + 1 , h A −h E + 1 , o] containing the similarity score map between each search area in T A and its corresponding exemplar T E . 2 T Y ← vec −1 1 ,w A ,h A , N·c vec T (1 , 2 , 3) A 3 T Z ← vec −1 w E ,h E ,c·N,o vec T (1 , 2 , 3) E 4 T P ← DwXCorr T Y , T Z 5 T Q ← vec −1 w A −w E +1 ,h A −h E +1 , N,c E ,o ( vec ( T P ) ) (1 , 3 , 2) 6 T S ← c l=1 T Q (i, j, k, l, m ) where 1 ≤i ≤N , and 1 ≤j ≤w A −w E + 1 , and 1 ≤k ≤h A −h E + 1 , and 1 ≤m ≤o 7 return T S ture, allowing it to scale to several dozen objects. Also, as the exemplar of an object remains constant during the inference phase, SiamMT can cache T E and reuse it during the tracking process. Lastly, if multiple scales were to be considered for each object —as is the case with SiamMT—, the batch dimension of the exemplar and search area features would have a size of ν·N , where νis the number of scales considered. 3.3. System training SiamMT supports reusing the weights learned by SiamFC through a network-based transfer learning procedure, which consists in collecting all the parameters learned by a previously trained SiamFC network —backbone and similarity operation’s weights and biases— and copying them into their respective SiamMT operations. This alone is sufficient for performing inference, and provides good results as demonstrated in Section 4.2 , hinting at the direct extensibility of SiamMT to other SiamFC-based architectures. However, due to the use of the crop-and-resize operator ˜ κ, it is convenient to fine-tune the last layers of the network. This tuning is very similar to an end-to-end network training, but freezing the first 3 convolutional layers and with a lower learning rate. Regardless of whether the training is performed end-to-end or just fine-tuning, SiamMT’s training is very similar to the one designed by SiamFC. For each iteration, two different frames containing the same object are fed into the network, one at the exemplar branch and the other at the search area branch. The features of the frames are extracted with ϕ, to later create the exemplar and search area features tensors through ˜ κusing the locations provided by the dataset annotations. Following this, these two tensors are compared using ˜ , obtaining an m ×n -size score map lg that seeks to represent the likelihood that the object is present in each region of the search area. Since the training is defined as a binary classification problem, the error is obtained by comparing this score map with a ground truth map gt , through a sigmoid cross-entropy loss: loss = m j=1 n i =1 max lg ij , 0 −lg ij ·gt ij + log 1 + e −| lg ij | (3) Since the exemplar and search area regions are defined around the locations provided by the dataset annotations, during training the object will always stand in the center of the search area tensor. Therefore, we can define the groundtruth map gt as an m ×n -size matrix with the positive classes in an area of radius R around the center v of the tensor. Taking into account the global stride Sof the network, the value of each element of this matrix can be defined as follows: gt i,j = 1 , if S · (i, j) −v ≤R 0 , if S · (i, j) −v > R where 1 ≤i ≤n, and 1 ≤j ≤m (4) In addition to this, we also contemplate the use of negative examples, to prevent the network from learning to detect objects rather than distinguishing among targets. We achieve this by introducing pairs of frames that do not display the same object. During training, there is the risk that the network erroneously learns that the tracked object always has the same proportion with respect to the search area. This is because, even though the frames go through a data augmentation process —involving translations, scale changes, rotations, color variations, motion blur and noise addition—, as the ˜ κoperator uses the locations provided by the dataset annotations, it always generates a perfectly cropped and rescaled search area tensor. As this does not accurately represent a real tracking scenario, during training, a random factor is applied to the calculation of the dimensions of each search area. Therefore the system is able to gain tolerance towards object scale changes. Finally, handling the disparity in size of the different objects across the datasets is not straightforward, as the training would have difficulties to converge if the same feature extractor was used for objects with very different sizes. Therefore, in order to reduce training time and ensure stability, the input frames are rescaled so that the considered objecs always have a size among a predefined range. This phenomenon does not affect SiamFC-based architectures [9,21,23,26] , as they always rescale the images before extracting their features. 4. Experiments This section evaluates SiamMT under different scenarios. The experiments were conducted on a computer with an Intel Core i7- 9700K, 16 GB of DDR4 RAM and an NVIDIA TITAN Xp. The chosen deep learning framework was TensorFlow. 4.1. Implementation details Feature extractor. The choice of the backbone is a determining factor in the network performance. While other state-of-the- art architectures such as ResNet [33] or DarkNet [34] would allow for richer features, they would result in a much longer inference time. Therefore, following the example of SiamFC [9] and some of its successors, we have opted for a backbone based on AlexNet for its simplicity and speed, but with a few modifications. The specific architecture of the adopted backbone is shown in Fig. 8 . It incorporates batch normalization and non-linear Leaky ReLU activation functions after each convolutional intermediate 7
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Fig. 8. SiamMT’s feature extractor. The tensors and their sizes are represented in black, while the operations and their names are colored in blue. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.) layer. Moreover, convolutions in layers 2, 4 and 5 are grouped, as it makes training faster and helps in learning better representations of the data [35] . Finally, it is particularly important to note that no padding is introduced into the network, as this would lead to the loss of translation invariance [23] . Exemplar and search area sizes. For the formulation of the exemplar and search area sizes, a similar approach to SiamFC [9] is taken. Thus, if we denote the size of an object’s bounding box as (w, h ) , its exemplar will correspond to the region centered on its location, with an area A = ( w + ζ( w + h ) ) ×( h + ζ( w + h ) ) (5) where ζis a context factor. After cropping the exemplar region, it is resized to the size of the destination tensor. In SiamFC, ζ is set to 0.5 and the rescaling is done to 127 ×127 pixels, as the crop-and-resize is performed on images. However, since SiamMT’s calculations are made directly on features, a value of ζ= 0 with a destination tensor of size 6 ×6 provides the best results. In the case that the weights of the original SiamFC [9] architecture are directly reused, ζshould be adjusted accordingly to replicate SiamFC’s field of view. Similarly, the search area size is calculated as the quotient between its destination tensor and the destination tensor for the exemplar, all multiplied by the exemplar’s crop region. In SiamFC, where the crop is made on an image, the destination tensor has a size of 255 ×255 pixels. On the other hand, as SiamMT crops features, a tensor of size 22 ×22 is chosen as the destination. Training process. The system was trained using the video databases provided by the ImageNet Large Scale Visual Recognition Challenge (ILSVRC) [27] , the YouTube-BoundingBoxes Dataset (YT-BB) [30] , and the Generic Object Tracking Benchmark (GOT- 10k) [36] . Together, these databases have about 255 , 0 0 0 sequences with over 9.8 million labelled bounding boxes, populating more than 560 object classes. The initial weights of the network are generated following a normal distribution. During training, we employ an Adam optimizer [37] to minimize the error function over 1 , 0 0 0 epochs, starting from a learning rate of 3 ×10 −4 that is geometrically annealed to 3 ×10 −6 , and applying L2 regularization ( λ= 5 ×10 −5 ) to the learned weights. Each epoch consists on 65 , 536 pairs of images —one for the exemplar and the other for the search area, containing the same object and spaced no more than 100 frames for the positive samples— arranged in size-32 batches. The best model is selected based on the validation error of the last 250 epochs. Inference process. The inference phase aims to be as simple as possible to achieve high tracking speeds. To accomplish this, the features of each exemplar are extracted at the beginning of the process and reused throughout it. This greatly reduces the number of operations, and also allows the tracker to be formulated as a one-shot detector. Indeed, it has been demonstrated that simple methods for updating the exemplars do not offer great advantages for short-term tracking. However, high-level updating techniques could be very useful for improving the performance on long-term crowded videos [19] . To tackle small objects, we resize the input frames so that the median size of the targets in the scene is above 32 px 2 . And lastly, SiamMT allows for the partial extraction of the frame features. With this technique, it considers only the minimum region in which the followed objects are found, plus a slight margin. This offers lar ge speed gains when the objects are close together. 4.2. Tracking quality evaluation Since SiamMT is an MVOT, it initially receives the starting location for each object and provides its new position in each frame, without further interaction with a detector. This, by definition, is how single-object trackers operate, and thus SiamMT’s quality can be evaluated using the protocols of single object tracking benchmarks. As MVOTs are used in situations where processing time is a constraint, the metric that most faithfully represents this behavior is VOTChallenge’s VOT-RT [38] , considering each object in each video as an individual sequence at the time of aggregating the values. This method reports two values: accuracy —amount of overlap between the prediction and the groundtruth— and robustness —percentage of frames in which the tracker has not lost the object, with an exponential sensitivity of S = 30 —, both with a realtime threshold of 20 fps. We have also run the tests with a 25 fps threshold, to be consistent with the definition of real-time of the rest of this work. The experiments were run in various public multi-object video databases, seeking to cover a wide variety of scenarios where motion estimation systems are commonly used: MOT-2017 [29] , MOT- 2020 [4] , UAVDT [39] , VisDrone [28] , and JTA [40] . We have compared SiamMT and SiamMT-W —i.e., SiamMT with its weights and parameters obtained directly from a previously trained SiamFC network through a transfer learning procedure— with their baseline, SiamFC [9] , and the state-of-the-art methods of SiamRPN [21] , SiamRPN ++ [23] , SiamCAR [22] , and SiamFC ++ [26] , whose multiple instantiations are frequently used as MVOTs for motion estimation tasks. The results are shown in Table 2 . As can be seen, the accuracy and robustness obtained by SiamMT are superior to those of the existing approaches, with differences as large as 21.2 points if we compare the accuracy of SiamMT against SiamFC ++ —the state-of-the-art tracker with the highest score— at MOT-20 @25 fps. If we consider the experiments with the threshold @20 fps, SiamMT obtains results that are, on average, 7.2 points higher for the accuracy and 7.5 points higher for 8
L. Vaquero, V.M. Brea and M. Mucientes Pattern Recognition 121 (2022) 108205 Table 2 Quantitative Results for Tracking Quality. Red , blue and green, represent the approaches that rank 1st, 2nd and 3rd, respectively. the robustness, comparing it with the state-of-the-art tracker that scores the highest at each dataset. Those datasets where SiamMT really excels are those with a larger number of targets, most notably MOT-2020 and VisDrone, which have an average density of 127 and 46 objects per frame, respectively. In such crowded scenarios the use of traditional MVOT systems is unfeasible, with our proposal scoring the best results by a large margin. The difference between SiamMT and the other approaches becomes significantly larger if we increase the real-time threshold. For a video at 25 fps, the quality of the state-of-the-art methods drops noticeably, while SiamMT only drops on average 0.1 points in accuracy and 0.5 points in robustness. Thus, if we compare SiamMT against the best-performing state-of-the-art models @25 fps, SiamMT’s accuracy and robustness are 9.3 and 9.7 points higher on average. These experiments show that traditional MVOT systems are unfeasible when there are many objects in the scene, being our approach the only able to scale naturally in real time. Finally, although SiamMT-W obtains slightly worse results than SiamMT, they are still remarkably good considering that it has not been retrained or fine-tuned. In fact, for VisDrone, SiamMT-W consistently scores slightly better results than SiamMT, which may be attributed to it being the dataset with the largest number of distinct categories. This demonstrates the versatility of SiamMT’s paradigm, and suggests its potential extension to other SiamFC- based architectures. 4.3. Tracking speed evaluation As previously stated, the inference speed of an MVOT solution is a key aspect since it determines whether a system is suitable for real-life scenarios or not. The main objective of SiamMT is to enable the real-time tracking of a large number of arbitrary objects in a scalable manner, something that has not yet been achieved in MVOT. Consequently, we have designed two different test sets to represent the most typical multiple object tracking scenarios: the MT-VGA benchmark, composed of videos with a size of 640 ×480 pixels, and the MT-HD benchmark, with 1280 ×720 -pixel videos. The purpose of these experiments is to test the scalability of a tracker with respect to the number of tracked objects. Thus, the benchmark starts by measuring the time required to track a single object for each video, and gradually increases the number of tracked targets all the way up to 100. To demonstrate the scalability of the proposed solution, the SiamMT architecture will be compared against the multiple instantiations of SiamFC [9] and SiamFC-MI. SiamFC-MI is a proposal of ours that optimizes the SiamFC algorithm for multiple instantiations by stacking objects along its batch size to maximize GPU parallelization. However, it does not reuse features computations, nor does it implement any of our novel operators. It is worth noting that SiamMT’s partial extraction of the frame features has not been applied during these tests. This technique provides a significant speed boost on most situations, so it would make SiamMT perform better for some sequences. However, we believe that employing it for these benchmarks would not be fair, as it is the network architecture itself the one that should stand out for its scalability, not the extra add-ons. MT-VGA benchmark. The results for the MT-VGA benchmark are shown in Fig. 9 a. For a single object, all three architectures offer speeds above 60 frames per second, with SiamFC being the fastest due to its simplicity, reaching 112 fps. SiamFC-MI tracks one object at 89 fps —it is slower than SiamFC due to its batch management—, and SiamMT tracks one object at 63 fps as, unlike the other two, it extracts the features of the whole frame. As more objects are added, the SiamFC and SiamFC-MI tracking speeds are reduced exponentially to just 11 and 16 fps for 10 objects, respectively. Meanwhile, the scalability of the SiamMT 9