Model-Driven Matching and Segmentation of Trajectories Jiangwei Pan (Duke University) joint work with Swaminathan Sankararaman (Akamai Technologies) Pankaj K. Agarwal (Duke University) Thomas Mølhave (Scalable Algorithmics USA) Arnold P. Boedihardjo (U.S. Army Corps of Engineers)
Trajectories Definition : function from time domain to R d
Trajectories Definition : function from time domain to R d Observed : a sequence of sample points
Trajectories Definition : function from time domain to R d Observed : a sequence of sample points Examples: ◮ GPS traces of vehicles ◮ Object movement in videos ◮ Animal migration trajectories
Outline Deviation/Gap Matching A new model/algorithm for matching similar portions of two trajectories ◮ distinguish deviation (gaps) Noise from noise ◮ handle non-uniform sampling Segmentation Discover common patterns from a collection of trajectories Experiments
Trajectory Matching
Existing Approaches for Matching Two trajectories (sequences): P = � p 1 , · · · , p m � , Q = � q 1 , · · · , q n � Dynamic Time Warping (DTW) ◮ person walk on P , dog on Q , no backtrack ◮ minimize average leash length For trajectory matching: not meaningful at significant deviations
Existing Approaches for Matching Two trajectories (sequences): P = � p 1 , · · · , p m � , Q = � q 1 , · · · , q n � Dynamic Time Warping Biological Sequence (DTW) Alignment (Seq-Align) ◮ person walk on P , dog on ◮ allow gaps Q , no backtrack ◮ maximize score function ◮ minimize average leash ◮ one-to-one matching length For trajectory matching: not For trajectory matching: cannot meaningful at significant handle non-uniform sampling deviations
Existing Approaches for Matching Two trajectories (sequences): P = � p 1 , · · · , p m � , Q = � q 1 , · · · , q n � Dynamic Time Warping Biological Sequence (DTW) Alignment (Seq-Align) ◮ person walk on P , dog on ◮ allow gaps Q , no backtrack ◮ maximize score function ◮ minimize average leash ◮ one-to-one matching length For trajectory matching: not For trajectory matching: cannot meaningful at significant handle non-uniform sampling deviations Both can be computed in quadratic time.
Our Matching Model Combine the advantages of DTW and Seq-Align ◮ Handle non-uniform sampling: allow multiple-to-one matching (as DTW) ◮ Distinguish deviation from noise: allow gaps (as Seq-Align) Deviation/Gap Noise
Trajectory Matching - Assignment (Use ⊥ to denote a gap) An assignment for P and Q is a pair of functions ◮ α : P → Q ∪ {⊥} ◮ β : Q → P ∪ {⊥}
Trajectory Matching - Assignment (Use ⊥ to denote a gap) An assignment for P and Q is a pair of functions ◮ α : P → Q ∪ {⊥} ◮ β : Q → P ∪ {⊥} View as directed graph: α, β decide outgoing edges. Each point ◮ at most one outgoing edge ◮ could have multiple incoming edges
Trajectory Matching - Assignment (Use ⊥ to denote a gap) An assignment for P and Q is a pair of functions ◮ α : P → Q ∪ {⊥} ◮ β : Q → P ∪ {⊥} View as directed graph: α, β decide outgoing edges. Each point ◮ at most one outgoing edge ◮ could have multiple incoming edges
Trajectory Matching - Assignment (Use ⊥ to denote a gap) An assignment for P and Q is a pair of functions ◮ α : P → Q ∪ {⊥} ◮ β : Q → P ∪ {⊥} View as directed graph: α, β decide outgoing edges. Each point ◮ at most one outgoing edge ◮ could have multiple incoming edges
Trajectory Matching - Assignment (Use ⊥ to denote a gap) An assignment for P and Q is a pair of functions ◮ α : P → Q ∪ {⊥} ◮ β : Q → P ∪ {⊥} View as directed graph: α, β decide outgoing edges. Each point ◮ at most one outgoing edge ◮ could have multiple incoming edges
Trajectory Matching - Score of Assignment Score of assignment α, β ( λ > 0 , θ < 0 , ∆ > 0 are parameters) Score for gaps Score for matched edges ◮ E : set of matching edges ◮ gap: maximal contiguous sequence of points assigned to ⊥ ◮ Γ : set of gaps Objective: find assignment α, β with maximum score
Trajectory Matching - Score of Assignment Score of assignment α, β ( λ > 0 , θ < 0 , ∆ > 0 are parameters) Score for gaps Score for matched edges ◮ E : set of matching edges ◮ gap: maximal contiguous sequence of points assigned to ⊥ ◮ Γ : set of gaps Objective: find assignment α, β with maximum score We propose a dynamic programming algoirthm that computes optimal assignment in O ( mn ) time
Segmentation of Trajectories
Related Work [Lee, Han, Whang, 2007]: partition and cluster subtrajectories [Buchin et al., 2011]: use Fr´ echet distance to discover popular subtrajectories [Chen, Su, Huang, Zhang, Guibas, 2013, this conference]: formulate the segmentation problem as an integer linear program
Trajectory Segmentation Given a set of k trajectories T = { T 1 , · · · , T k } Goal : ◮ segment trajectories into fragments ◮ represent trajectories compactly
Segmentation Algorithm set of k trajectories T = { T 1 , · · · , T k } V : set of all trajectory points The algorithm 1. Labeling: assign a label L ( p ) ⊆ { 1 , · · · , k } to each point p ∈ V 2. Clustering: cluster points into fragments based on their labels
Segmentation Algorithm - Labeling (Assign a label L ( p ) ⊆ { 1 , · · · , k } to each point p ) Intuition: j ∈ L ( p ) means trajectory T j “pass” p
Segmentation Algorithm - Labeling (Assign a label L ( p ) ⊆ { 1 , · · · , k } to each point p ) Intuition: j ∈ L ( p ) means trajectory T j “pass” p Run matching algorithm between every pair of trajectories Labeling: L ( p ) contains ◮ trajectory that contains p ◮ trajectories that p is matched to
Segmentation Algorithm - Labeling (Assign a label L ( p ) ⊆ { 1 , · · · , k } to each point p ) Intuition: j ∈ L ( p ) means trajectory T j “pass” p Run matching algorithm between every pair of trajectories Labeling: L ( p ) contains ◮ trajectory that contains p ◮ trajectories that p is matched to Note : other matching algorithms can also be used in labeling (comparison in experiment).
Segmentation Algorithm - Clustering Fragment : maximal contiguous subsequences of points with same label
Experiments
Datasets WorkOut : 330 trajectories from road cycling and running ◮ ∼ 1M points ◮ low noise, uniform (1 second) sampling rate
Datasets WorkOut : 330 trajectories from road cycling and running ◮ ∼ 1M points ◮ low noise, uniform (1 second) sampling rate Bus : 143 trajectories of school buses in Athens, Greece ◮ ∼ 65K points ◮ high noise, uniform sampling rate
Datasets WorkOut : 330 trajectories from road cycling and running ◮ ∼ 1M points ◮ low noise, uniform (1 second) sampling rate Bus : 143 trajectories of school buses in Athens, Greece ◮ ∼ 65K points ◮ high noise, uniform sampling rate GeoLife (Microsoft Research Asia): 17,621 trajectories of 182 users in Beijing, China ◮ ∼ 5M points ◮ high noise, non-uniform sampling rate
Matching Results On a pair of trajectories from the Bus dataset. (a) Dynamic Time Warping ( DTW )
Matching Results On a pair of trajectories from the Bus dataset. (a) Dynamic Time Warping ( DTW ) (b) DTW-Pruned (prune long edges)
Matching Results On a pair of trajectories from the Bus dataset. (a) Dynamic Time Warping ( DTW ) (b) DTW-Pruned (prune long edges) (c) Sequence Alignment ( Seq-Align )
Matching Results On a pair of trajectories from the Bus dataset. (a) Dynamic Time Warping ( DTW ) (b) DTW-Pruned (prune long edges) (c) Sequence Alignment ( Seq-Align ) (d) Our matching algorithm ( Assignment ) DTW-Pruned / Seq-Align produce many spurious gaps
Matching Results Each point in figure: result on Assignment vs. DTW-Pruned one pair of trajectories (a) GeoLife dataset Assignment has fewer gaps , DTW-Pruned has many unnecessary gaps
Matching Results Each point in figure: result on Assignment vs. DTW-Pruned one pair of trajectories (b) WorkOut dataset Assignment has fewer gaps , DTW-Pruned has many unnecessary gaps
Segmentation Results WorkOut, Assignment GeoLife, Assignment
Segmentation Results - Quantitative Comparison Recall: other matching algorihtms can also be used in Labeling step Compare using Assignment and DTW-Pruned in labeling
Segmentation Results - Quantitative Comparison Assignment covers more points with the same number of fragments. DTW-Pruned , Workout DTW-Pruned , GeoLife Assignment , Workout Assignment , GeoLife 1 .0 0 0 .9 5 ts ction of Poin 0 .9 0 0 .8 5 0 .8 0 Fra 0 .7 5 0 .7 0 2 0 0 4 0 0 6 0 0 8 0 0 1 0 0 0 1 2 0 0 1 4 0 0 N u m b e r o f F r a g m e n t s vary ρ : minimum number of points in a fragment
Segmentation Results - Quantitative Comparison Assignment covers more points with the same number of fragments. DTW-Pruned , Workout DTW-Pruned , GeoLife Assignment , Workout Assignment , GeoLife 0 .9 0 .8 ts ction of Poin 0 .7 0 .6 0 .5 0 .4 Fra 0 .3 0 .2 1 0 0 2 0 0 3 0 0 4 0 0 5 0 0 6 0 0 7 0 0 8 0 0 r of Fra g m e n ts Nu m be vary η : minimum size of fragment label
Recommend
More recommend