{'fraction_non_alphanumeric': 0.030854987774047826, 'fraction_numerical': 0.008392390898918314, 'mean_word_length': 4.588119499768411, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 1, 'https://': 0, '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}}
TagMe: GPS-Assisted Automatic Object Annotation in Videos

Training high-accuracy object detection models requires large and diverse annotated datasets. However, creating these data-sets is time-consuming and expensive since it relies on human annotators. We design, implement, and evaluate TagMe, a new approach for automatic object annotation in videos that uses GPS data. When the GPS trace of an object is available, TagMe matches the object's motion from GPS trace and the pixels' motions in the video to find the pixels belonging to the object in the video and creates the bounding box annotations of the object. TagMe works using passive data collection and can continuously generate new object annotations from outdoor video streams without any human annotators. We evaluate TagMe on a dataset of 100 video clips. We show TagMe can produce high-quality object annotations in a fully-automatic and low-cost way. Compared with the traditional human-in-the-loop solution, TagMe can produce the same amount of annotations at a much lower cost, e.g., up to 110x.


INTRODUCTION
Accurate object detection is a core component of many applications such as autonomous driving [27], search and rescue [5], traffic surveillance [25], and infrastructure monitoring [9]. Existing techniques for training high-accuracy object detectors require large annotated datasets for training, and while pretrained detectors exist for many object classes, their accuracy can be improved significantly via domain-specific fine-tuning [35] on datasets that are similar to those observed in deployment (e.g., similar camera angles, resolutions, lighting, and weather conditions). Creating these datasets is a major challenge in practice, often requiring people to manually annotate objects in a huge number of images, which is labor-intensive and expensive.
In this paper, we focus on automatic object annotation in videos. Traditional object annotation solutions often assume that the videos have already been collected (e.g., from the web) and all their data sources are limited to videos themselves. However, we find in many scenarios, we can easily collect additional location information for objects in videos. For example, in outdoor settings, GPS traces from objects such as vehicles and bicycles may be available either from their embedded GPS receivers or from the smartphones of the riders. The availability of this additional location information provides an opportunity to improve video object annotation: when we need to annotate an object in a video (e.g., bounding box annotation), we may use the location information of the object as a hint to automate the annotation task. The question is how can we systematically leverage this additional location information to automate the video annotation task?
Why might this approach help? Suppose we want to obtain a large number of annotated images of a new car model under a variety of conditions and angles. If we could obtain videos, e.g., from outdoor traffic cameras, containing that car, and we also had GPS traces associated with that car, then we could use these two datasets to produce a series of annotated images of that car. For example, these GPS traces could be provided by a vehicle fleet of the new car model operated by the manufacturer, a dealership, a car-sharing company, etc.
TagMe is a system that provides this capability. We focus on GPS sensors in outdoor settings for obtaining location traces, but this approach extends to precise indoor localization methods too. We show the workflow of TagMe in Figure 1. TagMe can automatically annotate objects if their GPS traces are available. When an object (e.g., a person) equipped with a GPS receiver (e.g., a smartphone) is captured by a camera (e.g., a traffic camera), and the corresponding GPS trace is available, TagMe analyzes the motion of pixels in the video and uses the GPS traces to find the most likely pixels belonging to the target object in the video. Once these pixels are found in the video, TagMe produces the bounding box annotation of the target object in each video frame. The whole process is automatic.
The core problem we solve in TagMe is: given both the video and the location (GPS) trace of the target object, produce the bounding box of the target object in each video frame. A strawman solution to this problem consists of two steps: (1) detect moving objects in each video frame by analysing the motion of pixels (i.e., optical flows) and (2) map the coordinates of all the moving objects from the frame coordinate to the world coordinate, find the nearest moving object to the GPS position, and use the bounding box of the matched moving object as the output. However, we find that this strawman yields poor precision for three reasons: (1) the moving object detection algorithm is not perfect, e.g., when there are two objects moving close to each other, the moving object detection algorithm may consider them as one object, (2) the GPS trace of the target object is often noisy (when there are multiple objects in the video, the GPS position may be closer to the wrong object), (3) there is no mechanism in this solution to automatically assess the quality of the output annotations, requiring manual verification.
To overcome these challenges, we propose a robust object annotation pipeline with four stages: candidate object proposal, GPS-object matching, bounding box refinement, and bounding box ranking. The key intuition is that the bounding box sequence of an object in the video has to follow some continuity properties; e.g., the sizes and locations of the bounding boxes in two consecutive video frames have to be similar. Our pipeline also uses the continuity properties to rank the annotations, so that TagMe can filter out bad-quality annotations.
We have implemented TagMe and evaluate it using a dataset of 100 video clips from stationary cameras and UAV drones. Our experiments show that TagMe's annotation pipeline can improve the precision of bounding box annotations from 28.2% (the strawman solution) to 88.3% and 94.4% if we keep the top-50% and the top-10% of the output annotations respectively (through annotation quality prediction and ranking). Compared with a human-in-the-loop annotation solution [2], we find that TagMe can produce the same number of annotations at a much lower cost (all of which is from computing): 110x, 59x, and 18x lower if we keep all, top-50%, and top-10% of the output annotations respectively. We also present two case studies to evaluate the end-to-end quality of the generated bounding boxes. We find that when we use the top-50% of the generated bounding boxes as training data, they have similar end-to-end quality to the manual-annotated bounding boxes in fine-tuning tasks.
TagMe is an example of using mobile sensing and computing to help with machine learning tasks, in this case automating image annotations using GPS traces as hints, achieving high quality at much lower cost than traditional humancentric methods.

MOTIVATION
In this section, we discuss the motivation behind TagMe system. We focus on three issues, • Need for additional object annotations.
• Use cases of TagMe system in real world.

Need for Additional Object Annotations
Additional annotated datasets are useful for at least two reasons: (1) Existing datasets cannot cover all the object categories. When we need to use an object detector in an application, the first challenge we may face is that there is no dataset covering the objects we want to detect. For example, we may not find a dataset if we want to create an object detector for all the new car models produced this year. In this case, we need additional object annotations to train the model.
(2) Scenario biases. Even if we can find a dataset that covers the objects we want to detect, the dataset may still have scenario biases, e.g., camera-angle bias or environmental bias. For camera-angle bias, we take a YOLO-V3 [23] object detector trained on the COCO [21] dataset as an example. We find that this object detector does not detect persons from top-down aerial images (see Figure 2). For environmental bias, the same detector works well for person detection from a camera in spring, but the precision drops in winter ( Figure 3).
In the above examples, we need to fine-tune an existing object detectors on additional annotated datasets that are similar to the scenarios where the object detectors are deployed. Figure 2: An object detector trained with non-aerial imagery applied to aerial imagery.

Usability of Auto-Generated Annotations
We show examples of TagMe's generated bounding boxes in Figure 4. TagMe is capable of producing high-quality annotations. These bounding box annotations can be directly used for image classification models. For object detection models, when there are multiple objects of the same cate-

Missing Person Detections
Person Detection in Spring Person Detection in Winter  gory in a video frame, because TagMe can only annotate objects with GPS traces, we may only have partial annotations for the entire video frame. For example, when the target object is a person, and there is more than one person in a video frame, we will only have the bounding box annotation of the target person. Training or fine-tuning object detectors directly with these partial annotations may yield defective results. Fortunately, this is a known challenge in computer vision and many solutions have been proposed [28,29,30,34]. In our case study 2, we show an example of how we can use partial annotations to fine-tune a pretrained object detector (Section 5.2). Although existing solutions may not be sufficient to fully solve the partial annotation problem, we believe more advanced solutions will be developed in the future, perhaps atop annotation systems like TagMe.

Use Cases for TagMe
We discuss two use cases: crowd-sourcing scenarios and private scenarios.
(1) Crowd-sourcing scenarios. In crowd-sourcing scenarios, contributors provide their object tags (which describe what they are) and GPS traces to TagMe. TagMe combines the GPS traces and the videos from cameras to produce new object annotations. These new object annotations are then be used to improve the object detection or image classification models in different applications such as autonomous driving and smart traffic light scheduling. Finally, the improved performance of these applications gives the value back to the data contributors.
We have seen great success in many crowd-sourcing applications deployed in real world, for examples, crowd-sourcing live traffic maps [17] and crowd-sourcing digital maps [15] where both of them use crowd-sourced GPS traces. Therefore, we believe TagMe has the potential to grow into another successful crowd-sourcing application that can benefit the society.
(2) Private scenarios. As a pure annotation technique, TagMe can also be used in many private scenarios, e.g., annotating equipment at a construction site, annotating livestock in a farm, etc. In these scenarios, TagMe works in a more controlled environment, e.g., no malicious data contributors and no privacy issues. Figure 5 shows TagMe's video object annotation pipeline. The goal of this pipeline is to generate the bounding box annotation of a target object in the input video. The pipeline takes both the video and the GPS trace of the target object as input and generates annotations in four stages:

DESIGN
Stage-1: Candidate Object Proposal (Section 3.1). The first stage takes the video as input and generates candidate objects in each video frame. Each candidate object consists of a group of pixels, allowing us to create the bounding box of the object. We use these candidate objects as a superset of all the real objects in the video, and hopefully, the target object will be in this superset.
Stage-2: GPS-object matching (Section 3.2). The second stage takes the candidate objects and the GPS trace of the target object as input, and infers the most likely candidate object that matches the target object in each video frame. The matching is challenging because (1) the candidate objects produced in Stage-1 often come with errors such as false objects and noisy bounding boxes, and (2) the noisy GPS locations may be far away from their true locations in the video. To overcome these challenges, we model this problem as an inference problem in a hidden Markov model (HMM) [22].
Stage-3: Bounding box refinement (Section 3.3). After Stage-2, we get a sequence of candidate objects (one at each frame) and each candidate object comes with a bounding box. However, because the bounding boxes from the candidate objects may not be perfect, the bounding box sequence may have scattered errors. For example, in Figure 5, the generated bounding boxes for the target object are too large in some video frames (e.g., the second column). In the third stage, we fix these scattered errors in the bounding box sequence by exploiting the continuity properties of the bounding boxes using a sequence-to-sequence neural network model.
Stage-4: Bounding box ranking (Section 3.4). The first three stages generate the bounding box annotation for each video frame. However, some of these bounding boxes may still be inaccurate and should be excluded to produce a highquality annotated dataset. In the fourth stage, we use another sequence-to-sequence neural network model to predict the quality of each generated bounding box and rank them by the predicted quality scores. This quality ranking allows us to select high-quality (e.g., the top 50%) bounding boxes. The goal of the first stage is to find all the potential objects in a video. Object detection in videos is a well-studied computer vision task [18,32,8]. Because the goal of this work is to annotate datasets, we adapt an unsupervised approach based on moving object detection to create the candidate object proposals.

Candidate Object Proposal
In our approach, we first create the optical flows [16] for the video, which capture the motions of the pixels in each video frame. Here, we use sparse optical flows that estimate the optical flows only for the key points, e.g., the corners.
In each video frame (e.g., Figure 6), if we look at all the moving optical flows, we can find that they form several clusters in 2D space, and each cluster corresponds to a moving object in the video. We adapt DBSCAN [10] clustering algorithm to find all the moving objects (clusters) in a video. Once the moving objects are detected, we track each moving object after they have stopped moving to find stationary objects (we also track backward before an object moved). This strategy can cover all the moving objects and most of the stationary objects (they have to move at least once) in each video frame. We call the detected moving objects together with the stationary objects the candidate objects. We expect the candidate objects to be a superset of all the objects in a video (e.g., all the white bounding boxes in Figure 5 Stage-1), and very likely, the target object will be in this superset. DBSCAN clustering algorithm has a distance threshold parameter. If the distance between two points is closer than this threshold, the two points are considered connected. We found DBSCAN with a small distance threshold works well for small and far-away objects, while DBSCAN with a large distance threshold works well for large and close-by objects. However, there is no single threshold that can work well for all objects. As the need here is to produce a superset that contains the target object, we choose to trade precision for better coverage. In our algorithm, we use the union of candidate objects produced by DBSCAN algorithm with different distance thresholds as the superset.

GPS-Object Matching
In the second stage, TagMe selects one candidate object in each video frame that is most likely to be the target object. To achieve this goal, TagMe uses the GPS trace collected on the target object as a hint.
We assume the input videos are calibrated 1 so that we know the GPS coordinate of each pixel in a video frame. For each candidate object, we use the bottom-center pixel of its bounding box to estimate its GPS coordinate. This estimation approach works for most of the objects on the ground.
Once we know the GPS locations of the candidate objects and the GPS location (from GPS sensor) of the target object, we can simply find the nearest candidate object at each frame. However, we find that this basic solution doesn't work because commodity GPS sensors don't have sufficient precision. Meanwhile, the denoising algorithms used in commodity GPS receivers often lead to GPS drifting and motion lags, making it impossible to find the target object from the candidate object pool by just considering the GPS location in one frame.
To solve this problem, we use an HMM. Let {Y n } be the GPS observations from the target object and {X n } be a Markov process representing the sequence of candidate objects that are assigned to the target object in the video. Here, the subscript n corresponds to the n-th video frame. {X n } is not directly observable (hidden). As show in Figure 7, in the n-th video frame, the candidate objects are represented as hidden states x n,k in the Markov chain. The subscript k represents different hidden states in one frame. For convenience, we omit the subscript k and use x n instead in the following text. Each hidden state x n has an emission probability, P (Y n |X n = x n ), which is the likelihood of observing the GPS location Y n conditioned on the hidden state x n being assigned to the target object. In the Markov chain, the hidden state x n transits to hidden state x n+1 following the transition probability that depends only on the two involved hidden states x n and x n+1 .  We denote the emission probability of observing the GPS location Y n at hidden state x n as E(Y n |X n = x n ), and the transition probability from x n to x n+1 as T (x n , x n+1 ). The GPS-object matching problem may then be stated as follows: Given a video of N frames and N GPS observations [Y 1 , Y 2 , ..., Y N ], find a sequence of hidden states, S = [x 1 , x 2 , ..., x N ] that maximizes the likelihood over the HMM ({X n }, {Y n }).
We can write the likelihood L(Y |S) as and the solution to the GPS-object matching problem is The Viterbi algorithm [13] solves this problem, but the result S * may not always match the target object in a video. In fact, the quality of the matching result depends on the emission probability and the transition probability. Next, we show how to construct these probabilities, first as a basic step, and then discuss two improvements.

Basic HMM
We model the emission probability as a 1-D Gaussian function where d(Y n , x n ) is the distance between the GPS observation Y n and the hidden state x n (a candidate object). When the distance between the GPS observation and the hidden state is small, the emission probability tends to be 1.0. This emission probability models the property that the location of the target object should be close to the GPS observation.
Here, the scale is controlled by the hyper-parameter σ emission . For the transition probability, there are two possible cases. First, recall that each candidate object (hidden state) is defined by a set of optical flows. If two candidate objects in adjacent frames share a significant amount (i.e., greater than 50%) of common optical flows, we say these two objects belong to the same object, and we set the transition probability to 1. Conversely, we model the transition probability as a Gaussian function multiplied by a fixed penalty term.
We can write the transition probability as otherwise.
(4) This transition probability encourages the transitions between the same object in adjacent frames and penalizes jumps from one object to a different object.

Motion Constraints
For an object in the video, we can link its corresponding candidate object in each video frame to create a sequence of candidate objects. We call this sequence the candidate object flow (COF). Given a COF, we can estimate the object's moving speed and heading angle. Because each candidate object (hidden state) belongs to one COF, we can obtain the speed and heading information for each candidate object (hidden state) in every video frame. Together with the speed and heading estimates from GPS data, we can improve the emission probability by considering more features.
The motion of the GPS data should match the motion of the matched candidate object. We express this intuition in the emission probability as additional speed and heading constraints.
Speed constraint. Intuitively, if the GPS location is moving rapidly, we should not match it to a stationary candidate object. We implement this heuristic into our emission probability. When the moving speed of GPS is faster than a threshold v thr1 , but the moving speed of the candidate object is slower than a threshold v thr2 , we set the emission probability to 0. In this case, Y n cannot match x n .
In reality, we find the speed estimation of the GPS may lag the motion of the target object. For example, an object stopped moving at timestamp 10, but the GPS is still moving toward the true location of the object at timestamp 10 and stopped moving at timestamp 13 (3 seconds later). When this happens, the GPS observations from timestamp 10 to 13 cannot be matched to the target object because the GPS reading is moving but the target object is stationary. To avoid this issue, we use the minimal GPS speed over a period of time, i.e., 5 seconds, to trigger the speed constraint.
Heading constraint. Similar to the speed constraint, we can also add a heading constraint. If the GPS observation and the candidate object have opposite moving directions, they are much less likely to be matched. While computing the emission probability of a moving GPS-object pair, we first compute the dot product between the heading vectors from GPS and the candidate object. If the dot product is less than a threshold θ thr , we set the emission probability to 0. We find this constraint is helpful to ensure correctness when other objects are moving closely to the target object with different headings.

Shape Preference
Besides the location information, each candidate object also comes with its shape information, i.e., the width and the height of the bounding box. We improve the basic transition probability by taking this shape information into account. Because the target object's shape should not change significantly between two adjacent frames, the transition between two adjacent candidate objects with similar bounding box shapes should be more likely. We express this shape preference intuition in the transition probability.
Here, we define the shape-distance between two bounding boxes as, h 1 ) and (w 2 , h 2 ) are the widths and heights of the two bounding boxes. We model the shape transition probability as a 1-D Gaussian function, We multiply this shape term with the original transition probability to get the final transition probability. Here, we use the hyper-parameter σ shape to control the significance of the shape transition term.

Out-of-Frame Objects
The target object may not always be within the video frame. It may move into the video frame at the beginning of a video clip and move out of the frame at the end of the clip. This behavior violates the assumption we made in the HMM. To solve this problem, we introduce additional hidden states locating at the boundary of the video frame. These special hidden states can transit to or transit from other normal hidden states (the candidate objects). We find that this simple mechanism works well in practice across our video datasets. In our evaluation, we use this mechanism as a default feature.

Hyper-parameter Optimization
In the emission probability and the transition probability, we have defined several hyper-parameters. We don't assign values to these parameters a priori, but search for the best parameters using Hyperopt [6,3].

Bounding Box Refinement
After the GPS-object matching stage, we get a sequence of bounding boxes that are supposed to be the bounding boxes of the target object. However, the bounding boxes may not always fit the target object perfectly. We show an example in Figure 8. Here, there is another object (a person) moving closely to the target object (a bicyclist). The candidate object proposal algorithm (in Stage-1) failed to produce two separate bounding boxes for the two objects, but instead created an oversized bounding box surrounding the two objects. As a result, the first two stages failed to produce correct bounding boxes in frames 331 to 357. To fix the inaccurate bounding boxes, we use a neural network model. The intuition here is that there is generalizable prior knowledge on how a sequence of bounding boxes from one object look. For example, the bounding boxes should be smooth over time and we don't expect to see the size of the bounding box changes rapidly between adjacent frames.
We design a sequence-to-sequence neural network model to learn this prior knowledge and use it to refine the bounding box sequence. We show the architecture of our model in Figure 9. The model consists of a learnable outlier filter module. The input to the module is N 4-dimension vectors. Here, N is the length of the bounding box sequence, the 4-dimension vector encodes the center location (x, y), the width w, and the height h of the bounding box. The outlier filter module refines the bounding box sequences and yields the output sequence in the same format. We pass the output sequence to the outlier filter module again and repeat this process for 16 times to let the outlier filter module gradually refine the bounding box sequence.

Conv
Inside the outlier filter module, we first split the input sequence into the raw input sequence X raw and a smooth input sequence X smooth . We use a convolutional layer followed by two fully connected layers to decide which elements in the input sequence are outliers. Here, we use second as the unit to describe the kernel size in a convolutional layer. For example, if the frame rate of the video is 30 FPS, then the size of a 1-second kernel is 30. We denote the decision from the outlier selection sub-module as G, which is a N by 4 array where each element is a real number between 0 and 1. Finally, the output Y is the mixture of X raw and X smooth controlled by G, We train the entire model with 16 outlier filter modules with L 1 loss. Here, we use a relatively simple neural network module and repeat it 16 times rather than using a deeper neural network model to avoid over-fitting.

Bounding Box Ranking
In final state, we predict the quality of each generated bounding box. Although TagMe can continuously generate bounding box annotations from videos and GPS traces, we may not have to use all of them but can select a subset of high-quality bounding boxes. This is because even if we only create annotations for 1% of the video frames, that will be a huge amount of annotations per day. In order to select highquality annotations, we need to determine which bounding boxes have better quality compared with others.
To achieve this goal, we use another sequence-to-sequence neural network model to predict the quality score for each bounding box. We can use this score to rank all the bounding boxes, or even rank different video clips, using this quality prediction.
We show the neural network model in Figure 10. The model takes a sequence of bounding boxes as input. It starts with a high-pass filter which is designed to avoid model overfitting. The model consists of three convolutional layers and three fully connected layers. We use a skip connection link to gather information from convolution layers with different kernel sizes. The output score is a real number between 0 and 1. We use the IoU of each bounding box as the groundtruth label for the quality score, and train the model with L 2 loss. In our evaluation, we find this model can learn good quality scores for ranking propose in both intra-video case (rank bounding box annotations in each video separately) and inter-video case (rank bounding box annotations from all videos together).

Dataset
To evaluate TagMe, we collected a dataset with 100 video clips from 9 scenarios at 8 different camera positions (see Figure 11). Each video clip is around 40 seconds long. Along with each video, we collect the GPS traces of the target object at 1 Hz from an Android phone. In this dataset, we use three objects, a person, a cyclist, and a car, as the target objects. The 9 scenarios have different GPS noise levels and varying numbers of other moving objects. The dataset also covers different camera tilt angles from low-tilt angles typical of traffic cameras to high-tilt angles typical of aerial videos. For each video clip, we manually annotated the bounding boxes of the target object in each frame as ground-truth (the target object appears in 96.5% of the video frames).

Evaluation Metrics
We use two metrics to evaluate the quality of the generated bounding boxes. First, Intersection-over-union (IoU), which evaluates the similarity between two bounding boxes. Second, the normalized-distance (ND), which measures the distance between the centers of the proposed and ground-truth bounding boxes and normalizes this distance by the diagonal size of the ground-truth bounding box. ND evaluates the localization quality of the generated bounding boxes.
To evaluate a video clip, we use Precision-at-IoU-0.5 which measures the percentage of bounding boxes whose IoU is greater than 0.5 in the clip, and Median-ND, which measures the median normalized distance for all the bounding boxes in the clip.
Three-Fold Cross-Validation. In all the experiments where hyper-parameter search or model training is needed, we use three-fold cross-validation. We split the dataset into three even pieces and search for the best parameters or train the neural network models on two pieces and test on the other one. We repeat this process three times to cover the whole dataset.

Bounding Box Generation
The bounding box generation algorithm covers the candidate object proposal stage (Stage-1), the GPS-object matching stage (Stage-2) and the bounding box refinement stage (Stage-3). We first discuss an ablation study of the overall performance of the bounding box generation algorithm, and then discuss the performance and the limitations of the algorithm in different conditions. Ablation Study. In Table 1, we show the different versions of the bounding box generation algorithm and their corresponding version names, from the baseline (base) to the proposed algorithm with all features (V4).
In Figure 13, we show the precision-at-IoU-0.5 and the median-ND results for the five different versions. Because of the limited GPS precision, the baseline approach (base), which uses the nearest candidate object as the output in each

Features \ Versions
Base V1 V2 V3 V4 Nearest Box Basic HMM + Motion Constraints + Shape Preference BBox. Refinement Table 1: Versions of the bounding box generation algorithm. video frame, does not perform well on both metrics. After improving it with the basic hidden Markov model (V1), we find that the quality of the generated bounding boxes improves significantly as the HMM takes temporal information into account.
We evaluated two improvements (V2 and V3) over the basic HMM. We find that both of them produce additional improvements in terms of the quality of the generated bounding boxes because they introduce more constraints to the HMM and make the probabilistic model more realistic.
Finally, we use a sequence-to-sequence neural network model to refine the generated bounding box sequence (V4). We find the refined bounding boxes provides much better IoU and a slight improvement in the localization quality (median ND). Overall, we made several improvements over the baseline approach and improved the precision-at-IoU-0.5 from 28.2% to 68.5% (2.4x) and decreased the median-ND from 0.96 to 0.19 (5x).
Performance in Different Environments. We show how different factors in the environments may affect the quality of the generated bounding boxes. In this evaluation, we study the following three factors, (1) GPS Error, (2) Count of Moving Objects in the Video, and (3) Camera Tilt Angle.
(1) Impact on GPS error. For each video clip, we measure the GPS error by measuring the distance between the GPS observation and the ground-truth location at each frame. Because we know the perspective transformation from the frame coordinate to the world coordinate, we can estimate the ground truth location in the world coordinate from its bounding box's location in the frame coordinate.
In Figure 14(a), we show how the GPS error can impact the performance of our bounding box generation algorithm. Here, we report the 95th tail GPS error for each video clip. We color the data points (each data point is a video clip) from different scenarios with different colors. In general, we find there is a weak negative-correlation between the performance and the GPS error. Among all the scenarios, we observe a strong negative-correlation in scenario 9 where there are constant GPS biases in some of the video clips. We show an example in Figure 15. In most of the cases, our matching algorithm can handle this constant GPS bias, however, with the magnitude of the bias increases, the matching algorithm becomes more likely to fail. We find in other scenarios, although the GPS errors exist, they are unbiased over time. HMM can handle most of the unbiased errors. Therefore, we observe a week correlation between the performance and the GPS error in most of the cases.
(2) Impact on the count of moving objects. We use our candidate object proposal algorithm to estimate the count of moving objects at each video frame. In Figure 14(b), we show how the count of moving objects can impact the performance of our bounding box generation algorithm.
As our bounding box generation pipeline needs to pick up the target object from all the moving objects in a video, intuitively, the problem becomes harder when there are more moving objects in the video. However, we find our algorithm is robust to the count of moving objects. This is because even though there are many moving objects in the video, they may not all take the same path as the target object does. In this case, the HMM algorithm can still distinguish them.
(3) Impact on the camera tilt angle. We put the 9 scenarios into three buckets according to their camera tile angles (from low to high). We show the per-scenario results in Figure 16. We find the camera tilt angle is not a dominate factor in the performance of our algorithm. The algorithm can work well in both low tilt angle scenarios and high tilt angle scenarios. Failure Cases. From Figure 16, we can see the performance in scenario 3 and scenario 4 is much lower than others. We find there are three common reasons that may cause failures. (1) The noise filter of GPS receivers, (2) Objects with similar motion, and (3) Shadows.
(1) GPS Noise Filter. When the GPS signal is noisy, the de-noising algorithm may filter out the real motion of the target object. For example, in Figure 17, the target object moves across the road through a cross-walk. However, the GPS position stuck on a fixed location at the very beginning for a long time and failed to capture any motion of the target object. We find this behavior may lead to failures in our matching algorithm, especially when the trajectory of the target object is very short, e.g., less than 20 meters.

GPS Trace
True Trace from Video Start End Figure 17: GPS traces and the true positions of a target object at an intersection cross-walk.
(2) Objects with similar motion. We find another failure case is caused by other moving objects with a similar motion to the target object. We show an example in Figure 18. (3) Shadow. In fact, the most distracted 'other' object is the shadow of the target object. We show an example in Fig-ure 19, where the target object and its shadow are considered as one object. Figure 19: The shadow of the target object could be considered as a part of the target object because they have the same motion.
The reason behind this failure type and the previous one is because of the clustering algorithm used in the bounding box proposal stage. The clustering algorithm relies on the distance metric among optical flows to create objects. When two objects are close to each other for a long time, they will be treated as one object, e.g., the examples in Figure 18 and Figure 19.
We find many of the above errors can be partially detected through bounding box ranking (Section 3.4). Meanwhile, TagMe is a proof-of-concept research prototype, we believe there are still optimization spaces left in each stage of the TagMe pipeline.

Bounding Box Ranking
We evaluate the bounding box ranking performance with two ranking policies, intra-video ranking and inter-video ranking. With intra-video ranking, we rank the bounding boxes in each video clip separately. With inter-video ranking, we rank the bounding boxes generated from all videos together. In Figure 20, we show the quality of the remaining bounding boxes when we filter out the low-rank bounding boxes using the two ranking policies. We find that the bounding box quality prediction model works as expected. For example, if we only consider the top-50% of the generated bounding boxes, the precision increases from 68.6% to 84.3% with the intra-video ranking policy, and to 88.3% with the inter-video ranking policy. Comparing the intra-video ranking policy with the inter-video ranking policy, we find the inter-video ranking policy can purify the bounding boxes more efficiently. This is because inter-video ranking policy can avoid excluding too many high-quality bounding boxes in a video where most of the bounding boxes have good quality, and avoid including too many bad quality bounding boxes in a video where most of the bounding boxes have bad quality.
Qualitative Results. Besides the quantitative evaluation, we show examples of good bounding boxes (IoU > 0.85) and bad bounding boxes (IoU < 0.3), as well as their inter-video quality ranks in Figure 21. These examples are random samples from our dataset. We can find the quality prediction is a good indicator for bounding box quality -most of the good quality bounding boxes have high quality ranks while most of the bad quality bounding boxes have low quality ranks. Figure 21: Examples of good and bad bounding boxes. We show the corresponding quality ranks in green if the quality rank is greater than 50%, otherwise, we show them in red.

TagMe's Annotation Expense
Although TagMe doesn't require human operators, it still consumes computing resources. Here, we measure the running time of processing all the 100 video clips on an AWS c5.9xlarge instance [1]. We show the total running time and the running time of each pipeline component in Table 2. We find that the motion analysis and the object proposal components are the two most resource-intensive components that make up 98% of the total CPU time. The HMM matching and the refinement & ranking components are much faster.
We use the wall-clock time to estimate the cost of the computation. The on-demand price of the AWS c5.9xlarge instance is $1.54 per hour [1], so the total cost is 76 cents.
We compare TagMe's annotation cost with the annotation cost from Google Data Labeling Service [2]. In this service, the labeling process for our dataset consists of two tasks: (1) the video object detection task, which only needs to label one object per video as we only have one target object in each video, and (2) the video tracking task, which tracks the target object and generate the bounding boxes over the entire video.
In Table 3, we show the estimated labeling cost of recruiting one annotator to label the data from Google Data Labeling Service. When we only use the top-x% of the TagMe's auto-annotations, we change the manual annotation workload accordingly. In this comparison, we find that TagMe can reduce the annotation cost by one or two orders of magnitute, by a factor ranging from 18x to 110x.  Table 3: Annotation cost reduction from TagMe.
These cost savings are a conservative estimate as we usually need to recruit two or three annotators to ensure labeling quality, and the computing cost of TagMe can be much cheaper if we port the Python implementation to a faster language and use reserved instances rather than on-demand instances on AWS.
In this evaluation, we did not directly compare the annotation quality through the IoU metric or ND metric. Instead, we evaluate the annotation quality by comparing the performance of the models trained with different annotations. We show an evaluation of this in Section 5. We find the quality of TagMe's auto-annotations (top-50%) is similar to the manual annotations.

Per-Camera Fine-Tuning for Cyclist Detection
We use the YOLO-v3 object detector to find cyclists from videos recorded by a surveillance camera (scenario 5 in the dataset). The YOLO-v3 object detector was pre-trained on the COCO dataset (80 different objects). We find that us-ing this pre-trained model to detect cyclists in scenario 5 is difficult because of the limited object categories in the training dataset. Although the COCO dataset covers 80 different objects, it doesn't include cyclists. We can only use the detection of bicycles to represent cyclists. As a result, the pre-trained model doesn't perform well in this scenario. To make the object detector work, we can fine-tune the model with additional annotated dataset from the target camera. In this case, we can use TagMe to collect the dataset. We find the dataset collected by TagMe is sufficient for this task.
In the evaluation, we randomly split the videos in scenario 5 into two even-sized groups. We use the videos from one group as the testing dataset and feed the videos from another group to TagMe. We use the top-50% of the generated bounding boxes as the training dataset to fine-tune the pre-trained model. We report the average precision (AP) metric [11] on the testing dataset with both the pre-trained model and the fine-tuned model (ours). We find TagMe's automatically-generated annotations have sufficient quality and they can significantly improve the precision of the cyclist detector, i.e., improve the AP score from 38.7% to 93.1%. We show detection examples from both the pre-trained model and the fine-tuned model in Figure 22.

Improving Person Detection in Aerial Imagery
Detecting persons from aerial imagery with the pre-trained YOLO-V3 model (on COCO dataset) is difficult. Because the camera angle (top-down) is totally different from the majority of the camera angles in the training dataset. As a result, we find the pre-trained model failed to detect many persons in scenario 7 of our dataset ( Figure 23).
In this case study, we use the auto-annotations from TagMe to improve person detection in aerial imagery. TagMe can only generate bounding boxes on the target object, but there may exist many other same-category objects (other persons) in the video. To overcome this issue, we use a repeatedteaching method [29] to perform fine-tuning. We find this method works well in our scenario and fine-tuning on TagMe's auto-annotations can improve the precision (AP) of person detection from 5.9% to 71.1% (Figure 23).

Quality Assessment
We compare the quality of models fine-tuned with TagMe's auto-annotations and the models fine-tuned with human-labeled ground truth (GT). We find the label quality of TagMe is sufficient in these two case studies (see Table 4).  Table 4: Average precision (AP) of the object detectors.

RELATED WORK
Video Object Detection. Existing video object detection solutions fall into two categories 2 , supervised approaches and unsupervised approaches. Supervised approaches [23,32,4,36,19] often have good precision and lead the stateof-the-art performance in video object detection tasks. However, they rely on high-quality annotated datasets for training. In contrast, unsupervised approaches [32] don't rely on annotated datasets and require less computing resources, but they usually have compromised precision. In this work, we adapts an unsupervised approach at the candidate object proposal stage (the first stage) so that it doesn't rely on annotated datasets. As the goal of the candidate object proposal stage is to achieve high coverage (or recall) rather than high precision, using an unsupervised approach here is sufficient 3 .
Video Object Annotation. Given the growing need for ground-truth labels, many video object annotation tools have been proposed. Because of the temporary locality in videos, human annotators don't need to label the objects in all the video frames, instead, they can only label a few key frames 2 There are also weak-supervised and semi-supervised approaches which can be considered as supervised and unsupervised approaches respectively. 3 Video object detection consists of object localization and object recognition. We only need to localize objects and we don't need to recognize each object. and let the tools to propagate the annotations to the unlabeled frames. For example, LabelME-Video [33], VATIC [26], and CVAT [24] allow users to annotate key frames and creates annotations for the unlabeled frames through interpolation or tracking.
Besides interpolation and tracking, the annotations can also be propagated to the unlabeled frames through an object detector. For example, Yao [31] and iVAT [7] train an object detector incrementally on the labeled frames and apply it to the unlabelled frames to speed up the annotation task.
When we use an incrementally-trained object detector to propagate the object annotations, the choices of the key frames to annotate are often critical to the overall annotation time. A recent work to solve a similar problem is BubbleNets [14], where they use a deep learning model to sort the video frames and let the annotators label the high-rank frames first to improve the annotation efficiency.
Although these approaches proposed many techniques to reduce the annotation cost, they all require human annotators. In contrast, TagMe uses crowd-sourced GPS traces to achieve fully-automatic object annotation in videos. Therefore, TagMe can significantly reduce the annotation cost.
GPS-Aided Object Localization and Tracking. The idea of using both GPS and videos to localize and track objects has been explored in a few works. For example, Liao [20] proposed a people tracking solution which first localizes the target person in videos using GPS readings and then tracks the target person using vision-based tracking. Feuerhake [12] proposed an approach to fuse the GPS readings with the object locations obtained from videos to improve the precision of object localization, e.g., improving the precision of person localization in soccer games.
We find the basic idea of using GPS and videos together in these works are similar to TagMe. However, TagMe focuses on the object annotation task in a different context. As the result, the task itself is more challenging, and we have to make different design choices and introduce specific components such as the refinement and ranking stages in TagMe to overcome the challenges.

CONCLUSION
In this work, we propose TagMe, which combines GPS traces with motion analysis of videos to automatically generate bounding box annotations. We conducted a comprehensive evaluation of TagMe and show TagMe can produce good quality annotations at much lower cost than traditional human-centric methods.
TagMe focuses on GPS sensors in outdoor settings but the approach can extend to other localization methods in indoor settings and support other annotation types, e.g., segmentation. As an example of using mobile sensing and computing to help with machine learning tasks, TagMe makes an exploration of sensor-assisted automatic data annotation, which holds the potential to enable low-cost annotated dataset creation at scale.