{'fraction_non_alphanumeric': 0.023127536346085654, 'fraction_numerical': 0.005870533075922934, 'mean_word_length': 4.699977543229283, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Tracking in Urban Traffic Scenes from Background Subtraction and Object Detection

In this paper, we propose to combine detections from background subtraction and from a multiclass object detector for multiple object tracking (MOT) in urban traffic scenes. These objects are associated across frames using spatial, colour and class label information, and trajectory prediction is evaluated to yield the final MOT outputs. The proposed method was tested on the Urban tracker dataset and shows competitive performances compared to state-of-the-art approaches. Results show that the integration of different detection inputs remains a challenging task that greatly affects the MOT performance.


Introduction
The task of multiple object tracking (MOT) is to produce a set of trajectories that represent the actual real-life movements of the objects of interest across frames. In the context of urban scenes such as traffic intersection, MOT is performed for the road users (vehicles, pedestrians, cyclists, motorcyclists, etc.) as objects of interest for the purpose of traffic control and management to improve traffic while mitigating the adverse impacts. Due to the nature of such settings, interactions among the objects are expected and frequent, thus leading to object occlusions. Compared to conventional traffic scenes where the speeds of the road users are usually more consistent and directions homogeneous, MOT in urban traffic scenes remains a difficult and challenging task as it deals with objects interacting in different directions and speeds. Furthermore, because of the typical camera setups used, object scales varies significantly, which can make them difficult to detect.
The advances and reported good results in recent years of multiclass object detection algorithms with deep learning [4] have prompted us to integrate them into the tracking process. In addition, the class label information can provide a useful description of objects to help with their association across frames in the tracking steps. However, the recent work of Ooi et al. [10] has shown that tracking with a multiclass object detector (MOD) is very challenging since detections are often incorrect or missing. Since the incorrect or missing detection of an object at that stage can propagate and leave a huge impact on the final tracking arXiv:1905.06381v1 [cs.CV] 15 May 2019 results, we seek to improve the detection inputs in order to achieve better MOT results. Therefore, we extend the work of Ooi et al. [10] by using as inputs, detections from both a MOD and a background subtraction algorithm. To handle the problem of occlusion, a Kalman filter is used for prediction when an object of interest is not seen at the detection stage. This helps in keeping track of object of interest that might have been hidden by other objects at certain time steps during the lifespan of the trajectory.
In this paper, we introduce a MOT solution for urban traffic scenes with fused inputs from the integration of background subtraction inputs [2] with detections from a pre-trained MOD. Our two main contributions are: 1) a novel method to fuse detections from two sources that may contradict each other and 2) an object descriptor based on object class labels and their learned detection confidence.

Related Works
MOT usually comprises several steps: 1) object detection, 2) appearance modeling, and 3) data association. A large part of the past literature on MOT emphasized the challenge of data association [3] and its effect on MOT performance. Researchers proposed sophisticated data association strategies that often extend the Hungarian algorithm. For example, the Joint probabilistic data association filter (JPDAF) tracks objects based on the most likely outcome for each trajectory by considering every detection available, as well as missing or spurious detections [12,1]. Another example is the minimum-cost flow algorithm that formulates the data association problem as finding the shortest path from the apparition of the object to its last appearance in the scene [11].
On the other hand, object detection is necessary before data association, as poor detections will severely deteriorate the tracking performance. Hence, some previous MOT solutions have proposed combining detection methods to allow better object inputs for improved tracking in the end. The main drawback of using inputs from background subtraction is the difficulty of distinguishing the merging, fragmentation and splitting of objects. In cases where multiple road users are in close proximity, partial occlusion will cause the incorrect merging of these road users. IMOT (Improved Multiple Object Tracking) was introduced by Beaupré et al. [2] as an improved version of background subtraction using edge processing and optical flow, converting blobs of objects into compact bounding boxes that outline individual objects if there is evidence based on motion that two or more objects were grouped together.
More generally, the MOT problem in urban scenes was tackled several times in the past. A combination of background subtraction and feature points were proposed in Urban tracker [6]. Based on detections from background subtraction, objects are described by several keypoints which provide robustness to partial occlusion as a subset of keypoints can be matched if they are not all hidden. MKCF [15] was proposed as a solution for MOT, combining the background subtraction with multiple individual KCF (Kernelized Correlation Filters) single object trackers [5]. This method capitalizes on the robustness of newer visual object tracker. It shows good performances even if it uses rudimentary data association. Saunier et al. [13] used optical flow to detect the motion of objects of interest and the classic Kanade-Lucas-Tomasi (KLT) framework [14] to match road users from frame to frame. Recently, Ooi et al. [10] used a MOD for road user tracking. However, the tracking performance was severely impacted by the inadequate and inconsistent detections across frames.

Methods
Three steps are involved in the proposed MOT strategy: (i) Fusion of objects from detection methods, (ii) Object description, and (iii) The association of objects across frames. Our proposed method is illustrated in Figure 1. It starts by fusing the input from a multiclass object detector (MOD) and from the improved background subtraction method IMOT. The resulting object detections are then tracked. Objects are described using colour, position and the class labels coming from the MOD. Then, data association is performed.

Object fusion
In our proposed method, we integrate the bounding boxes from both IMOT and MOD into our tracking framework. The MOD objects are the result of the application of a pre-trained deep learning detection network, in our case RFCN [4], that was fine-tuned on the MIO-TCD dataset [8] containing varied road users such as cars, buses, bicycles, pedestrians, pickup trucks, etc. IMOT objects are the results of a post-processing over a background subtraction method in order to separate erroneously merged road users using edges and optical flow [2]. The objects from the two sources are matched and filtered before starting the tracking process. Due to the nature of IMOT objects, there could be some small bounding boxes that are not relevant as a result of shaking cameras and moving background elements. On the other hand, MOD objects will include long-term stationary road users that are beyond the scope of interest of our applications and there are occasions where objects of interest are missed out [10]. We hypothesize that the merged inputs can be fed into the tracker to give more satisfactory tracking results. However, results are often contradictory, sometimes IMOT gives better results while sometimes, it is MOD. One cannot simply merge the two sets of detections.
The following fusion strategy is proposed. We assume that all IMOT objects are relevant to the tracking framework as stray small IMOT objects that are not representative of objects of interest are filtered out according to size prior to the matching. IMOT objects were shown to be more reliable. They also had better performance in detecting the objects in the scene. MOD objects are used to provide class labels and to merge fragmented IMOT objects.
For matching the input objects of both sources, we compared their similarities in terms of bounding box (BB) overlaps and colour histogram. The BB overlap S o is given by where A i denotes the i th BB from IMOT output whereas B j denotes the j th BB from MOD output. We also calculate the colour similarity between IMOT objects and between IMOT and MOD objects. The colour similarity S c is given by where G denotes the colour histogram of a first BB and H denotes the colour histogram of a second BB. N is the total number of histogram bins.Ḡ andH are the mean of the N bins. Pairings between IMOT objects and MOD objects are performed based on the overlap of the BBs with Equation 1 and a threshold T o . IMOT objects that are matched with MOD objects will benefit from the class label information of MOD objects for data association in the tracking phase. On the contrary, IMOT objects that do not matched with MOD objects will be fed into the tracker with a dummy class label. There are cases where the matching is not one-to-one. For instance, several IMOT objects could be matched with the same MOD object and vice versa, though the latter is a rare occurrence since IMOT objects are usually smaller in size and more compact. MOD objects, on the other hand, are larger and often encompassed several objects at the same time. Hence, the merging of input objects is performed only on the IMOT objects and only if the colour of the objects to merge are similar enough based on Equation 2.
Algorithm 1 describes the process for obtaining the final fused inputs for the MOT task. If multiple IMOT objects are matched to a particular MOD object, the colour histogram similarities of the multiple IMOT objects will be compared among themselves using the Bhattacharyya distance (Equation 2) and a threshold T c . If the similarity is high, then these objects are thought to be fragmented parts of an object and hence the BB from the MOD object would be taken as the input for the tracker. If the similarity is low, these objects will be considered individually in the subsequent steps. Figure 2 illustrates how fragmented parts of an object are fused together to recover the whole object after taking into consideration the output of the MOD. Colour similarity is used for merging IMOT because there are cases where the BB from the MOD object contains more than one actual object that should not be merged. Hence, care must taken to handle the different cases. To avoid excessive merging of IMOT objects that overlap with often large MOD objects, merging IMOT based on pairings between objects from the two approaches will only be evaluated if there is significant overlap (larger than T m ). Finally, when a single IMOT object is matched with multiple MOD objects, the similarity in terms of BB overlap and colour histogram will be used to determine the final label from MOD that will be used with the IMOT object.

Data association costs
The cost of assigning pairings among the objects across frames is calculated by using the Hungarian algorithm [7]. The cost of matching a detected object and a tracked object is in the range of 0 and 1. The lower the cost, the more likely the two objects are referring to the same object.
For matching the objects across frames, the spatial cost C d is measured by the spatial distance between BBs of the compared objects using Algorithm 1 IMOT and MOD object fusion 1: procedure IMOT-MOD Pairing 2: for each IMOT objects do 3: for each MOD objects do 4: Compute overlap of BBs with Eq. 1 5: if So >= To then 6: Assign as pairs and update pairing matrix 7: procedure Merging multiple IMOT into single detection object 8: for each MOD objects do 9: if Pair with more than one IMOT then 10: for each IMOT objects that are paired do 11: Compute colour similarity with Eq. 2 12: if So >= Tm and Sc <= Tc then 13: Use MOD object as tracker input, discard the IMOT object 14: else Keep IMOT object 15: procedure Update IMOT object with label from paired MOD object 16: for each Remaining IMOT objects do 17: if No pairing found then 18: Use the IMOT as tracker input with dummy label 19: else if One-to-one pairing found then 20: Use the IMOT as tracker input with label from paired MOD 21: else 22: for each Paired MOD objects do 23: Compute Sc and So of IMOT with each MOD object 24: Use IMOT as input with label of MOD object with largest similaritȳ where x min and y min denotes the minimum x and y coordinates, whereas x max and y max denotes the maximum x and y coordinate of an object. T indicates an object that is currently tracked and D indicates a detected object in a frame. SD is the mean spatial distance of the x coordinates and y coordinates of the four corners of the BBs of the compared objects whereas a fixed parameter T d is used to penalize objects that are too far and to normalize C s . For describing objects in terms of appearance, colour cost C c is computed based on the Bhattacharyya distance on colour histogram as in Equation 2, where G denotes the colour histogram of a detection and H denotes the colour histogram of a currently tracked object. N is the total number of histogram bins (we used 256).
Finally, the class labels are also considered in the matching cost. Detection confidence is used in our formulation. C l is given by where L i denotes the class label of object i and W i its confidence value (between 0 and 1). As we will see in the results, using the confidence value from the MOD, and not just the class label for the cost is a beneficial strategy since confidence values tend to be similar in consecutive frames for a given object. The final association cost is a combination of C d , C c , C l , and is given by where α, β, γ denotes the weights for the corresponding cost.

Overall Tracking Framework
In the tracking phase, each input object that appeared at the start of the video will be included into a set that contains all the active objects, thereafter denoted as the tracked objects. New input objects in the subsequent frames are denoted as detected objects and are matched accordingly to the tracked objects. We enforce one-to-one matching using the Hungarian algorithm [7], since it is expected that there exists only one true object at the next frame that corresponds to a currently tracked object. In addition, because of the non-ideal cases caused by occlusions or objects missing from the inputs that are common in urban scenes, some predictions are used to compensate the shortcomings of the inputs. Hence, for each processed frame, sets of matched detections, unmatched detections and unmatched tracks are obtained. Matched detections are essentially the successful pairings of detected objects and tracked objects. Unmatched detections refers to detected objects without pairing with the existing set of tracked objects. This can be due to the entrance of a new object into the scene or as a result of spurious detections from the inputs. Unmatched tracks are when there is no corresponding pairing found in the set of detected objects. This is usually due to occlusion or being missed by IMOT, but also by objects that have left the scene.
For each active tracked objects, a Kalman filter is used to get a prediction of its expected location in the subsequent frame based on its history. If the tracked objects are matched with the detected objects, the prediction result will be discarded and the tracked object will be updated with information from the latest matched detected object. In the case where a tracked object is unable to find a matching counterpart in the set of detected objects, the prediction result may be used instead if it is deemed good. For each step of a track, the state or quality of the tracking is defined as "D" (Detection), "GP" (Good Prediction), "BP" (Bad Prediction) or "UP" (Uncertain Prediction). Overlap between the prediction result and the previous position in the trajectory (history) is used to evaluate the quality of a prediction. If the previous time stamp is marked as "D" (indicating it is from a matched pairing) or "GP" (indicating it as a reasonably good prediction), there is a good chance that the trajectory history is reliable. Hence, if the overlap is high (larger than T p ) between the prediction at the current step and the previous history step, the prediction result will be used and the state will be marked as "GP". If the overlap is not good, the state will be marked as "BP" and the prediction result will not be used. Instead the previous result in the tracking history will be used. For cases of unmatched tracked objects with a history that is not marked "D" or GP, the state will be marked at "UP" since there is no known reliable history that can be used to verify the current prediction. Algorithm 2 summarizes the inspection of the tracking prediction quality. for each Unmatched track do 3: if Previous time step is "D" or "GP" then 4: if Overlap of prediction with previous time step < Tp then 5: Use BB output from previous time step and mark as "BP" 6: else 7: Use prediction and mark as "GP" 8: else 9: Use prediction but mark as "UP" At the end of the tracking process, trajectories with significant amount of "BP" and "UP" will be removed eventually since these final trajectories are likely to contain incorrect prediction that does not reflect the actual movement of the objects of interest.
For active track management, when a tracked object is unable to find a matching detection object for T n frames, the object is assumed to have left the scene. The track will therefore be terminated along with its last T n steps of tracking results removed since they are most likely not valid.

Experiments
The proposed method was tested on the Urban tracker dataset [6] and compared with several state-of-the-art methods. We also performed an ablation study on the data association cost components. The dataset includes four videos: Rouen, Sherbrooke, St-Marc and Rene-Levesque. We chose this dataset because it includes a large variety of object classes and background subtraction is applicable.
The tracking performance is evaluated by using the CLEAR MOT metrics [9] that are comprised of MOTA (Multiple Object Tracking Accuracy) and MOTP (Multiple Object Tracking Precision). MOTA evaluates the tracking performance by taking into consideration the number of objects that are mismatched, the false positives (FP) and false negatives (FN). MOTP evaluates the quality of the localization of the matches by checking the similarity of true positives (TP) with the corresponding targets in ground truths.
We also report the following information. Ground truth (GT) is the number of actual object instants in the whole video. Misses are missing GT object instances in tracks. FP are spurious object detections that are not in the ground truth. Mismatches are the number of tracks that suffer from object identity switches. The identification of correct tracks, misses and FP are based on the overlap of bounding boxes from our tracking output with respect to the ones of the ground truth. We used a threshold of 0.3 for the overlap in tracking performance evaluation as proposed by Beaupré et al. [2]. In our experiments, T o = 0.05, T m = 0.5, T c = 0.5, T d = 0.5 and T p = 0.01.

Ablation study
We start our evaluation of our method with an ablation study on the data association cost. The individual effects of the cost components are compared in Table 1. Generally it is observed that the spatial cost has the smallest number of mismatches and FP for all the evaluated videos. Since the spatial cost is based on the proximity of BBs, it is an essential component that describes the similarity of objects to determine across frames. In the results for St-Marc and Rene-Levesque, it has the highest number of correct tracks compared to the other association costs.
Colour cost gives slightly inferior tracking performance, having more FP and mismatches with slightly fewer correct tracks compared to the spatial cost. This could be due to presence of multiple objects that share similar colour properties and the fact that proximity is ignored. In addition, since BBs contain a certain portion of background as well (depending how well the object is enclosed in the BB), this might not be the best cost component. However, it can disambiguate the association of nearby objects with different colours.
Lastly, the class label cost gives the lowest performing tracking results due to reasons similar to the colour cost. There could be several objects that share the same class label in the same frame. With only the class label information it is often insufficient to do the right pairings. Also, some IMOT objects are fed into the tracker with dummy class labels since they are not paired with MOD objects in the object fusion stage. Nevertheless, the performance with this feature is better than expected thanks to the similarity of confidence values for the same object between frames. Since, the confidence value is used in Equation 5, objects are both discriminated by their class and the confidence value.

Comparison with state-of-the-art methods
The performance of the proposed method is compared with previous state-ofthe-art work, IMOT [2], Urban tracker [6], MKCF [15] and Ooi et al. [10] that were evaluated on the Urban tracker dataset. For the data association cost, the weights of spatial, colour and label costs are 0.6, 0.3 and 0.1 respectively for α, β and γ. As shown in Table 2, the proposed method yields better tracking  [10] show that MOD BBs although not very reliable can give object locations that are sometimes more precise.

Discussion
The integration of objects from IMOT and a MOD is proposed in order to better capture the objects of interest during the tracking process. It was expected that the combined inputs can complement each other, producing better inputs compared to the inputs produced individually from the different approaches. For instance, with the presence of fragmented objects from background subtraction that are difficult to group together, having a reference BB from the MOD that encompasses the whole object could be a useful indicator to improve the representation of the complete object. However, from the experiments, we have noticed the tendency of the MOD to generate large BBs that often include areas that do not belong to the object of interest. While in certain frames, it is helpful to have such BBs showing objects that are partially occluded, there are many occasions that such BBs include several objects of interest as one detection, especially for objects of small sizes such as pedestrians in urban traffic scene. This led to a difficulty of tracking them effectively as the input objects to the tracker are already merged as one whole object instead of distinct objects. In addition, there are cases where IMOT objects encompassed more than one object of interest that appeared on the scene as well due its origin of background subtraction. As an effort to mitigate these effects, we have imposed a stricter merging threshold to reduce the amount of incorrect fusion of objects. To distinguish the case between combining BBs of fragmented parts into one whole object, and the case of having multiple objects interacting in close proximity, we take into consideration the colour of IMOT objects to make the merging decision.
The excessive inclusion of areas that are not relevant may impact the tracking process as well. This is because the colour histogram will consider the background portion that was included in the BB for object description in the association cost for matching across frames, leading to possibly less accurate descriptions of the objects of interest. However, despite the effort to differentiate the two cases, some missed objects are still missed in the final tracking outputs because of the imperfect representation of some objects of interest that get fed into the tracker. The missed objects could be the result of MOD objects that are not paired with the available IMOT objects. Indeed, sometimes the MOD can detect object that IMOT cannot.

Conclusion
In this paper, we presented a novel approach for fusing input objects from a multiclass object detector and an improved object extraction approach based on background subtraction for multiple object tracking. We use the integrated set of objects into a proposed MOT framework that associates objects across frames using spatial, colour and class label information to form trajectories in challenging urban traffic scenes. The prediction quality of unmatched objects in the MOT paradigm is evaluated to further improve the final tracking results. Results show that our method is competitive, but that it is very challenging to combine detections from multiple sources. First, they may not detect the same objects, and secondly, even if the same objects are detected, objects are not bounded in the same way. Our ablation study show that using class labels and their confidence can contribute positively to the data association cost function.