Trajectory Analysis Sourav Bhattacharya, Petteri Nurmi 12.4.2014 1
Questions What are trajectories? How are they represented? What are the challenges with large trajectory data? How can we reduce trajectory data? What is trajectory simplification? How to perform simplification of trajectories? How can we enforce error bounds during simplification? What is trajectory segmentation? How can we segment trajectories? What is the role of trajectory analysis in Locationawareness? 12.4.2014 2
Trajectory Representation Trajectory An object s movement over time Represented with a continuous spatio-temporal function mathematically a mapping from time to plane (d=2) or space (d=3) is the actual trajectory 12.4.2014 3
Trajectory Representation (Cnt.) At current time instant the actual position is: Actual trajectory (function) is defined up to Contrary to the continuous case, in Location-aware computing, positioning sensor (e.g., a GPS) measures position at discrete intervals. Often periodically (with a time period of ) s 1 s 2 s 3 s 4 s s 6 s 7 s 8 5 12.4.2014 4
Trajectory Representation (Cnt.) Sensed trajectory most recent sensed measurement s 1 s 2 s 3 s 4 s 5 s 6 s 7 s8 = s R 12.4.2014 5
Trajectory Representation (Cnt.) Sensed trajectory Continuous, piecewise linear function s 1 s 2 s 3 s 4 s 5 s 6 s 7 s8 = s R Defined for the time interval 12.4.2014 6
Trajectory Representation (Cnt.) Spatio-temporal line segment Between two successive measurements 12.4.2014 7
Trajectory Representation (Cnt.) Sensed trajectory Defined by the sequence On the domain s 1 s 2 s 3 s 4 s 5 s 6 s 7 s8 = s R 12.4.2014 8
Moving Object Databases y time Manages trajectories of mobile objects, e.g., people, vehicles and containers. x Mobile objects carry a positioning device (e.g., GPS) and have wireless communicating capabilities (e.g., GPRS). The moving objects can passively determine their location and inform wirelessly about their movements to a moving object database (MOD). MODs represent a trajectory by a polyline in time and space 12.4.2014 9
Moving Object Databases (Cnt.) Storing all sensed location on MOD requires huge space Single object produces over 31 million GPS measurements per year (@1 Hz) We might be tracking millions of objects Searching task becomes time consuming To reduce the requirement of space, often trajectory simplification is performed Minimizing the number of vertices Simplified trajectory does not deviate more than an error bound from the actual trajectory 12.4.2014 10
Moving Object Databases Suppose we are tracking all taxi cabs in a city Each taxi cab s position has to be updated frequently Error in location information is kept low Update load can be very high Less frequent updates make the positioning error significantly high To overcome the problem, MOD store motion vectors (i.e., speed and direction) We can derive position at a later time 12.4.2014 11
Line Simplification: Intuition Sensed Trajectory Location measurements Simplified Trajectory Measurements retained Simplified Trajectory 12.4.2014 12
Trajectory Simplification: Error e 4 e 5 e 6 e 1 e 2 e 3 Error (e i ) = perpendicular distance from a point to the simplified line segment. Line simplification strategy: the maximum error due to simplification should be bounded i.e., max(e 1,e 2,,e n ) Error Threshold 12.4.2014 13
Trajectory Error Bound Trajectory error bound is the maximum permissible error for a line simplification algorithm often application specific E.g., LBS might require to know the trajectory of an object with an accuracy of 500 meters (i.e., Trajectory error bound = 500 meters) 12.4.2014 14
Role of Trajectory Error Bound Energy efficient tracking By duty sampling of GPS Lecture 2, page 34 Reduction in data transmission costs Less data transmission over wireless link Further reduction of power consumption Reduction in space requirements for MODs Improves search time 12.4.2014 15
Trajectory Simplification Significant amount of research can be found related to trajectory simplification, e.g., in Computer graphics or vision Computational geometry Trajectory mining Optimal line/trajectory simplification algorithm Outputs minimum no. of points obeying error threshold We will focus on three non-optimal algorithms Turn-based segmentation Douglas-Peucker algorithm MDL-based algorithm 12.4.2014 16
Turn-Based Segmentation One of the simplest approach, segments trajectories based on significant changes in direction of motion Measure changes in azimuth Segment the trajectory when change exceeds a predefined threshold Often measured cumulatively to account for small-scale fluctuations and sensor errors Analogous to the turn-detection for improving energy-efficiency of tracking (Lecture II) 12.4.2014 17
Turn-Based Segmentation - Example 12.4.2014 18
Douglas-Peucker Algorithm Probably the most well known heuristic-algorithm for line simplification Off-line algorithm The algorithm requires all data points before simplification can be computed (batch process) In addition to all data points, the algorithm requires an error threshold Non-optimal There exists algorithms that output results with fewer number of data points (e.g., GRTS Sec by Lange et al.) 12.4.2014 19
Douglas-Peucker: Overview Follows a divide-and-conquer paradigm Begins by generating a line segment i.e., a line segment between first and last points e Finds a point,,furthest from the line segment 12.4.2014 20
Douglas-Peucker (Cnt.) If distance to the furthest point is within the error bound, then return points s 1,s n as the simplification. Otherwise, add point s i to the simplification list and recursively call Douglas-Peucker on {s 1,,s i } and {s i,, s n }. e e e e e e 12.4.2014 21
Douglas-Peucker (Cnt.) Performance evaluation Reduction rate Ratio of the number of sensed points to the number of points left after simplification, in our example 30/5 = 6 Time complexity Worst case running time O(n 2 ) 12.4.2014 22
MDL-based Trajectory Simplification Minimum Description Length (MDL) was introduced by Jorma Rissanen MDL is an information theoretic approach According to MDL: the best hypothesis for a given dataset is the one that leads to the best compression of the data The MDL principle can be applied to solve the trajectory simplification problem An optimal partition of a trajectory should posses two desirable properties: preciseness and conciseness 12.4.2014 23
MDL-based Trajectory Simplification (Cnt.) Preciseness The difference between the original trajectory and its simplification should be as small as possible Conciseness The number of trajectory partitions should be as small as possible Preciseness and Conciseness are contradictory to each other We need a trade-off between above two properties 12.4.2014 24
MDL-based Trajectory Simplification (Cnt.) 12.4.2014 25
MDL-based Trajectory Simplification (Cnt.) MDL principle is used to select a particular partitioning of the trajectory and we refer to the partitioning as the hypothesis We evaluate each hypothesis with the MDL cost MDL cost function is composed of L(H) length in bits required to describe the hypothesis H L(D H) length in bits required to describe the data D when encoded with the help of the hypothesis H 12.4.2014 26
MDL-based Trajectory Simplification (Cnt.) s 2 s 3 s 5 s 4 s 1 Hypothesis (H): simplified representation is s 1 s 4 MDL cost can be calculated as: L(H) + L(D H) 12.4.2014 27
MDL-based Trajectory Simplification (Cnt.) s i s j s i s j 12.4.2014 28
MDL-based Trajectory Simplification (Cnt.) True s i+1 s i+2 False s i+3 False s i s i+4 = s j Follows a greedy approach, running time O(n) 12.4.2014 29
Comparison of Trajectory Simplification Algorithms MDL-based approach is agnostic of any error threshold, whereas, Douglas-Peuker adapts to an input error bound Both algorithms are designed for offline line simplifications Douglas-Peucker follows a divide-and-conquer paradigm, whereas, MDL-based algorithm follows a greedy approach Both of the algorithms are non-optimal 12.4.2014 30
Example: EnTracked T System Apparatus Biking Running Nokia N97 Driving u-blox LEA-5H GPS Receiver Walking 12.4.2014 31
Example: Gesture Recognition Hand gesture can be decomposed into strokes using line segmentation techniques 12.4.2014 32
Example: Navigation Navigation systems can use line / trajectory segmentation to determine when to play instructions Intuition: 1. Find optimal path 2. Segment the path 3. Associate each change of segment with a new instruction 12.4.2014 33
Summary Object s trajectory sensed using a position sensor is represented by a spatio-temporal piecewise linear function To improve performance of MOD, often trajectory simplification is carried out Improves search time Minimizes space requirement Saves energy and cost of mobile devises Example of trajectory simplification algorithm Douglas-Peucker algorithm, MDL-Based approach 12.4.2014 34
Summary (Cnt.) Douglas-Peucker follows a divide and conquer algorithmic paradigm MDL-based approach balances between preciseness and conciseness, follows a greedy methodology Both of the algorithms has good applications in Location-aware computing 12.4.2014 35
Literature Lange, R.; Farrell, T.; Durr, F. & Rothermel, K. Remote real-time trajectory simplification IEEE International Conference on Pervasive Computing and Communications, 2009. PerCom 2009., 2009, 1-10 Kjærgaard, M. B.; Bhattacharya, S.; Blunck, H. & Nurmi, P. Energy-efficient Trajectory Tracking for Mobile Devices Proceeding of 9th International Conference on Mobile Systems, Applications and Services (MobiSys), 2011, 307-320 Lee, J., Han, J., and Whang, K., "Trajectory Clustering: A Partition-and-Group Framework," In Proc. 2007 ACM SIGMOD Int'l Conf. on Management of Data, Beijing, China, pp. 593 ~ 604, June 2007 12.4.2014 36