Computational Movement Analysis Lecture 5: Segmentation, Popular Places and Regular Patterns Joachim Gudmundsson.

Slides:



Advertisements
Similar presentations
Approximation algorithms for geometric intersection graphs.
Advertisements

Trajectory Segmentation Marc van Kreveld. Algorithms Researchers … … want their problems to be well-defined (fully specified) … care about efficiency.
Polygon Triangulation
ECE 667 Synthesis and Verification of Digital Circuits
Introduction to Computer Science 2 Lecture 7: Extended binary trees
Yingcai Xiao Chapter 6 Fundamental Algorithms. Types of Visualization Transformation Types 1.Data (Attribute Transformation) 2.Topology (Topological Transformation)
Fundamental tools: clustering
Efficient access to TIN Regular square grid TIN Efficient access to TIN Let q := (x, y) be a point. We want to estimate an elevation at a point q: 1. should.
Fast Algorithms For Hierarchical Range Histogram Constructions
Approximations of points and polygonal chains
 Distance Problems: › Post Office Problem › Nearest Neighbors and Closest Pair › Largest Empty and Smallest Enclosing Circle  Sub graphs of Delaunay.
On Map-Matching Vehicle Tracking Data
Computational Movement Analysis Lecture 4: Movement patterns Joachim Gudmundsson.
Marc van Kreveld (and Giri Narasimhan) Department of Information and Computing Sciences Utrecht University.
© The McGraw-Hill Companies, Inc., Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
Computing the Fréchet Distance Between Folded Polygons
Refining Edits and Alignments Υλικό βασισμένο στο κεφάλαιο 12 του βιβλίου: Dan Gusfield, Algorithms on Strings, Trees and Sequences, Cambridge University.
Fractional Cascading CSE What is Fractional Cascading anyway? An efficient strategy for dealing with iterative searches that achieves optimal.
Lecture 3 Lower envelopes Computational Geometry, 2005/06 Prof.Dr.Th.Ottmann 1 The Lower Envelope The Pointwise Minimum of a Set of Functions.
Chapter 3 The Greedy Method 3.
Computational Geometry and Spatial Data Mining
1 Lecture 8: Voronoi Diagram Computational Geometry Prof. Dr. Th. Ottmann Voronoi Diagrams Definition Characteristics Size and Storage Construction Use.
I/O-Algorithms Lars Arge Aarhus University February 27, 2007.
Data Transmission and Base Station Placement for Optimizing Network Lifetime. E. Arkin, V. Polishchuk, A. Efrat, S. Ramasubramanian,V. PolishchukA. EfratS.
Lecture 12 : Special Case of Hidden-Line-Elimination Computational Geometry Prof. Dr. Th. Ottmann 1 Special Cases of the Hidden Line Elimination Problem.
2 -1 Chapter 2 The Complexity of Algorithms and the Lower Bounds of Problems.
On the Union of Cylinders in Esther Ezra Duke University On the Union of Cylinders in  3 Esther Ezra Duke University.
Trajectory Simplification
I/O-Algorithms Lars Arge Spring 2009 March 3, 2009.
Sequence Alignment Variations Computing alignments using only O(m) space rather than O(mn) space. Computing alignments with bounded difference Exclusion.
Computational Geometry and Spatial Data Mining Marc van Kreveld Department of Information and Computing Sciences Utrecht University.
Randomized Planning for Short Inspection Paths Tim Danner Lydia E. Kavraki Department of Computer Science Rice University.
UNC Chapel Hill M. C. Lin Overview of Last Lecture About Final Course Project –presentation, demo, write-up More geometric data structures –Binary Space.
Preference Analysis Joachim Giesen and Eva Schuberth May 24, 2006.
1 Random Walks in WSN 1.Efficient and Robust Query Processing in Dynamic Environments using Random Walk Techniques, Chen Avin, Carlos Brito, IPSN 2004.
The Complexity of Algorithms and the Lower Bounds of Problems
Area, buffer, description Area of a polygon, center of mass, buffer of a polygon / polygonal line, and descriptive statistics.
Important Problem Types and Fundamental Data Structures
Orthogonal Range Searching I Range Trees. Range Searching S = set of geometric objects Q = query object Report/Count objects in S that intersect Q Query.
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
Target Tracking with Binary Proximity Sensors: Fundamental Limits, Minimal Descriptions, and Algorithms N. Shrivastava, R. Mudumbai, U. Madhow, and S.
B-trees and kd-trees Piotr Indyk (slides partially by Lars Arge from Duke U)
4/28/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Shape Matching Carola Wenk A B   (B,A)
Geometric Matching on Sequential Data Veli Mäkinen AG Genominformatik Technical Fakultät Bielefeld Universität.
Approximation algorithms for TSP with neighborhoods in the plane R 郭秉鈞 R 林傳健.
CSIS7101 – Advanced Database Technologies Spatio-Temporal Data (Part 1) On Indexing Mobile Objects Kwong Chi Ho Leo Wong Chi Kwong Simon Lui, Tak Sing.
A New Framework for Criteria-­based Trajectory Segmentation Kevin Buchin Joint work with Sander Alewijnse, Maike Buchin, Andrea Kölzsch, Helmut Kruckenberg.
Course14 Dynamic Vision. Biological vision can cope with changing world Moving and changing objects Change illumination Change View-point.
Geometric Description
Chapter 13 Backtracking Introduction The 3-coloring problem
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 6: Segmentation.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
Course 3 Binary Image Binary Images have only two gray levels: “1” and “0”, i.e., black / white. —— save memory —— fast processing —— many features of.
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 3: Movement Patterns.
2IMA20 Algorithms for Geographic Data Spring 2016 Lecture 5: Simplification.
UNC Chapel Hill M. C. Lin Geometric Data Structures Reading: Chapter 10 of the Textbook Driving Applications –Windowing Queries Related Application –Query.
Trajectory Data: Analysis and Patterns Pattern Recognition 2015/2016.
Geometric Data Structures
RE-Tree: An Efficient Index Structure for Regular Expressions
Haim Kaplan and Uri Zwick
2IMA20 Algorithms for Geographic Data
Orthogonal Range Searching and Kd-Trees
Enumerating Distances Using Spanners of Bounded Degree
Randomized Algorithms CS648
2IMG15 Algorithms for Geographic Data
2IMG15 Algorithms for Geographic Data
Kinetic Collision Detection for Convex Fat Objects
Dynamic Programming II DP over Intervals
Major Design Strategies
Presentation transcript:

Computational Movement Analysis Lecture 5: Segmentation, Popular Places and Regular Patterns Joachim Gudmundsson

σ Problem Input: x 1, …, x n : moving entities in the plane k: a positive integer r: a positive real value An axis aligned square σ of side length r is a popular place if at least k entities visit it. σ is a popular place for k  5

σ Problem: Two models Continuous model: σ is a popular place if it is intersected by polylines from at least k different entities. Discrete model: σ is a popular place in the discrete model if it contains input points from at least k different entities. T1T1 T2T2

Results Continuous model: maximum number of visitorsO(  2 n 2 )  (  2 n 2 ) Discrete model: maximum number of visitorsO(  n log  n)  (  n log  n)

What should we output? Detect if there exists a popular place? Report the popular place with the maximum number of visitors? Report “all” popular places? …

Continuous model – report all

Problem: Given a set of polygons, with holes, find a point that stabs a maximum number of polygons.

Continuous model – report all Idea: Use a sweep-line algorithm

Continuous model – report all Complexity: O(  2 )

Straight forward approach (almost): Running time:O(t 2 n 2 log tn) Space: O(t 2 n 2 ) Apply topological sweep by Edelsbrunner and Guibas: Running time:O(t 2 n 2 ) Space: O(t 2 n) Continuous model – report all

Find the maximum “colour depth” using topological sweep by Edelsbrunner & Guibas. Continuous model – report all

Improvement (incl. topological sweep [Edelbsbrunner & Guibas’89]) Running time:O(  2 n 2 ) Space: O(  n) Non-trivial to implement due to the degenerate cases. The problem has an  (  2 n 2 ) lower bound.

Continuous model – report all n=32 t=1000 Time: 5 seconds Compression + finding all popular places

Results Discrete model: maximum number of visitorsO(  n log  n)  (  n log  n) Continuous model: maximum number of visitorsO(  2 n 2 )  (  2 n 2 )

Problem For analysis, it is often necessary to break a trajectory into pieces according to the behaviour of the entity (e.g., walking, flying, …). Input: A trajectory T, where each point has a set of attribute values, and a set of criteria. Attributes: speed, heading, curvature… Criteria: bounded variance in speed, curvature, direction, distance… Aim: Partition T into a minimum number of subtrajectories (so- called segments) such that each segment fulfils the criteria. “Within each segment the points have similar attribute values”

Example Trajectory T sampled with equal time intervals.

Example Trajectory T sampled with equal time intervals. Top right: speed cannot differ more than a factor 2

Example Trajectory T sampled with equal time intervals. Bottom left: direction of motion differs by at most 90◦

Example Trajectory T sampled with equal time intervals. Bottom right: both criteria are used in conjunction (speed and direction)

Problem Observation: Many trajectories span over several activities. Goal: Segment a trajectory into subtrajectories according to its behaviour. We will only consider segmenting trajectories at vertices.

Criteria-Based Segmentation Goal: Partition trajectory into a small number of segments such that a given criterion is fulfilled on each segment each segment are uniform e.g. heading angular range

Criteria-Based Segmentation Goal: Partition trajectory into a small number of segments such that a given criterion is fulfilled on each segment Criteria: heading, speed, location, curvature, sinuosity … and combinations of these e.g., describe movement characteristics

Greedy Algorithm Definition: A criterion is decreasing monotone, if it holds on a segment, it holds on any subsegment. Examples: disk criterion (location), angular range (heading), speed… Theorem: A combination of conjunctions and disjunctions of decreasing monotone criteria is a decreasing monotone criterion.

Greedy Algorithm Observation: If criteria are decreasing monotone, a greedy strategy works.

Greedy Algorithm Observation: If criteria are decreasing monotone, a greedy strategy works. For many decreasing monotone criteria Greedy requires O(n) time, e.g. for speed, heading…

Greedy Algorithm Observation: For some criteria, iterative double & search is faster. Double & search: An exponential search followed by a binary search.

Criteria-Based Segmentation Boolean or linear combination of decreasing monotone criteria Greedy Algorithm incremental in O(n) time or constant-update criteria e.g. bounds on speed or heading double & search in O(n log n) time for non- constant update criteria e.g. staying within some radius [Buchin et al.’11]

Decreasing and Increasing Monotone Criteria 28 Observation: For a combination of decreasing and increasing monotone criteria the greedy strategy does not always work. Example: Min duration 2 AND Max speed range 4 speed 1 5

Case Study: Geese Migration Goal: Delineate stopover sites of migratory geese Two behavioural types  stopover  migration flight Input:  GPS tracks  expert description of behaviour

Case Study: Geese Migration Data Spring migration tracks - White-fronted geese positions per day - March – June Up to 10 stopovers during spring migration - Stopover: 48 h within radius 30 km - Flight: change in heading <120° Kees Adri

Comparison manual computed

Evaluation Few local differences: Shorter stops, extra cuts in computed segmentation

stopover migration flight Criteria A combination of decreasing and increasing monotone criteria Within radius 30km At least 48h AND Change in heading <120° OR

Criteria-Based Segmentation [Buchin et al. 2011] decreasing criteria [Buchin et al. 2012] decreasing criteria min-duration few outliers [Aronov et al. 2013] general quadratic time results on continuous segmentation [Alewijnse et al. 2013] decreasing criteria increasing criteria approx. outliers near-linear time

Non-Monotone Segmentation 35 Many Criteria are not (decreasing) monotone: Minimum time Standard deviation Fixed percentage of outliers Example: Geese Migration For these Aronov et al. introduced the start-stop diagram

Start-Stop Diagram 36 Algorithmic approach: input trajectory compute start-stop diagram compute segmentation

Start-Stop Diagram 37 Given a trajectory T over time interval I = {t 0,…,t  } and criterion C The start-stop diagram D is (the upper diagonal half of) the n x n grid, where each point (i,j) is associated to segment [t i,t j ] with (i,j) is in free space if C holds on [t i,t j ] (i,j) is in forbidden space if C does not hold on [t i,t j ] A (minimal) segmentation of T corresponds to a (min-link) staircase in D free space forbidden space staircase

Start-Stop Diagram 38 A (minimal) segmentation of T corresponds to a (min-link) staircase in D

Start-Stop Diagram 39 A (minimal) segmentation of T corresponds to a (min-link) staircase in D

Start-Stop Diagram Discrete case: A non-monotone segmentation can be computed in O(n 2 ) time

Start-Stop Diagram Discrete case: A non-monotone segmentation can be computed in O(n 2 ) time [Aronov et al.13]

Stable Criteria 42

Stable Criteria 43

Compressed Start-Stop Diagram For stable criteria the start-stop diagram can be compressed by applying run-length encoding. Examples: 22 increasing monotonedecreasing monotone 9

Computing the Compressed Start-Stop Diagram For a decreasing criterion consider the algorithm: ComputeLongestValid(crit C, traj T) Algorithm : Move two pointers i,j from n to 0 over the trajectory. For every trajectory index j the smallest index i for which  [I,j] satisfies the criterion C is stored. 22 ij 9

Computing the Compressed Start-Stop Diagram For a decreasing criterion ComputeLongestValid(crit C, traj T): Move two pointers i,j from n to 0 over the trajectory 22 ij Requires a data structure for segment [i,j] allowing the operations isValid, extend, and shorten, e.g., a balanced binary search tree on attribute values for range or bound criteria. Runs in O(n  c(n)) time where c(n) is the time to update & query. Analogously for increasing criteria. 9

Computing the Compressed Start-Stop Diagram The start-stop diagram of a conjunction (or disjunction) of two stable criteria is their intersection (or union). The start-stop diagram of a negated criteria is its inverse. The corresponding compressed start-stop diagrams can be computed in O(n) time. 22 9

Attributes and criteria Examples of stable criteria Lower bound/Upper bound on attribute Angular range criterion Disk criterion Allow a fraction of outliers … 22

Computing the Optimal Segmentation Observation: The optimal segmentation for [0,i] is either one segment, or an optimal sequence of segments for  [0,j<i] appended with a segment [j,i], where j is an index such [j,i] is valid. Dynamic programming algorithm for each row from 0 to n find white cell with min link That is, iteratively compute a table S[0,n] where entry S[i] for row i stores last: index of last link count: number of links so far Runs in O(n 2 ) time 22 S 0 n

Computing the Optimal Segmentation More efficient dynamic programming algorithm for compressed diagrams Process blocks of white cells using a range query in a binary search tree T (instead of table S) storing index: row index last: index of last link count: number of links so far augmented by minimal count in subtree Runs in O(n log n) time 22 T [Alewijnse et al.’14]

Summary 51 Greedy algorithm for decreasing monotone criteria O(n) or O(n log n) time [Buchin, Driemel, van Kreveld, Sacristan, 2010] Case Study: Geese Migration [Buchin, Kruckenberg, Kölzsch, 2012] Start-stop diagram for arbitrary criteria O(n 2 ) time [Aronov, Driemel, van Kreveld, Löffler, Staals, 2012] Compressed start-stop diagram for stable criteria O(n log n) time [Alewijnse, Buchin, Buchin, Sijben, Westenberg, 2014]

Regular visits Given a query region, does an object (animal, vehicle, …) regularly visit the region? Regular behaviour? Every day? Every month? Annual migration? Regular? 75% of all Saturdays I play football. Regular?

Motivation Time startend inside outside

Motivation Time startend offset period length Length = 5

Motivation Time startend Length = 9 Visit 78% of the times offset period length

Motivation Time startend period offset period length

Simplest case Time period offset period length Given period offset and period length Problem: Given a bitstring S of length n and a constant 0<c<1, find the longest subsequence S’ of S such that there are at least c  |S’| 1s in S’. period offset

Longest Dense Substring problem S = j=1 i f(i) =  s i Maximize b - a s.t. f(b) - f(a)  c  (b-a) f(i) g(i) = f(i) – c  i Maximize b - a s.t. g(b) - g(a)  0 g(i)

Longest Dense Substring problem S = g(i) = f(i) – c  i Maximize b - a s.t. g(b) - g(a)  0 g(i) Maximize b - a s.t. g(b)  g(a) g(b) must lie on the URE g(a) must lie on the LLE LLE URE

Longest Dense Substring problem Longest Dense Substring can be computed in O(n) time Compressed case:  3,3,1,1,1,6,3,5 size n  size k Compressed LDS can be computed in O(k) time

Given period length Given period length, but no period offset Time

Given period length Time

Given period length Time Find the longest vertical segment A such that at least a fraction c of the horizontal segments it intersects are “inside”. offset A

Given period length Theorem: Given a set of intervals I, a constant 0<c  1 and a period length p the longest c-dense repetitive pattern over all offsets can be computed in O(n 3/2 log 2 n) time using O(n log n) space. Time

General case Observation: The longest pattern can be translated and scaled such that one of its “visits” coincides with the start point of an interval and one “visit” coincides the start/end point of an interval. What if neither period offset nor period length is known? (no two consecutive visits in the “same region”)

General case Theorem: There are O(n 2 ) pairs of distances. Each distance may generate n/c period lengths, thus O(n 3 /c) possible period lengths in total. This also fixes the offset! The longest c-dense repetitive pattern for each period length can be found in O(n) time, thus O(n 4 /c) time in total. Can be improved to O(n 7/2 log 3 n). [Djordjevic et al.’10]

Summary Theorem: Offset & period lengthO(n) Period lengthO(n 3/2 log 2 n) Period length O(n log n) - approximate NothingO(n 7/2 log 3 n)

Open problems 1.Approximate version of the general version? 2.Improve running times? 3.Lower bounds?

Problem (  does not need to start and end at a vertex of G) Q G  Input: A Euclidean graph G in the plane Preprocess G into a data structure such that given a polygonal query curve Q and a positive constant  report all subcurves   G for which  ( ,Q) ≤ 

Previous results Assume  is given as part of the input Input: polygonal path P of size n and a constant  >0 Query: segment Q (length >6  ) P Q de Berg et al.’11: (Counting) 6-distance approximation Preprocessing O(n 2 + s polylog n) Space O(s polylog n) Query time O(n/  s polylog n), for n<s<n 2

Our results A geometric graph G is c-packed if the total length of all the edges of G inside any ball is at most c times the radius of the ball. Input: O(1)-packed tree T of size n and a constant  >0 Query: polygonal path Q of size m (each segment >2  ) Gudmundsson and Smid: (3+  )-distance approximation Preprocessing O(n polylog n) Space O(n polylog n) Query time O(m polylog n) T

Our results A geometric graph G is c-packed if the total length of all the edges of G inside any ball is at most c times the radius of the ball. Input: O(1)-packed tree T of size n and a constant  >0 Query: polygonal path Q of size m (each segment >2  ) Gudmundsson and Smid: (3+  )-distance approximation Preprocessing O(n polylog n) Space O(n polylog n) Query time O(m polylog n) T Q

Our results Pros: Extends to trees (instead of paths) Query path instead of query segment Approximation improved from 6 to (1+  )for query segments (3+  ) for query paths Improved preprocessing time Cons: Input must be O(1)-packed If G is a tree the edges must be “long” G Q

74 M. Benkert, B. Djordjevic, J. Gudmundsson and T. Wolle. Finding popular places. IJCGA, S. Alewijnse, T. Bagautdinov, M. de Berg, Q. Bouts, A. ten Brink, K. Buchin and M. Westenberg. Progressive Geometric Algorithms. SoCG, M. Buchin, A. Driemel, M. J. van Kreveld and V. Sacristan. Segmenting trajectories: A framework and algorithms using spatiotemporal criteria. Journal of Spatial Information Science, B. Aronov, A. Driemel, M. J. Kreveld, M. Loffler and F. Staals. Segmentation of Trajectories for Non-Monotone Criteria. SODA, M. Buchin, H. Kruckenberg and A. Kölzsch. Segmenting Trajectories based on Movement States. SDH, B. Djordjevic, J. Gudmundsson, A. Pham and T. Wolle. Detecting Regular Visit Patterns. Algorithmica, References

75 B. A. Burton. Searching a bitstream in linear time for the longest substring of any given density, Algorithmica, B. Djordjevic and J. Gudmundsson. Detecting areas visited regularly. COCOON M. de Berg, A. F. Cook IV and J. Gudmundsson. Fast Frechet Queries. CGTA, J. Gudmundsson and M. Smid. Frechet queries in geometric trees. ESA, References