Computational Movement Analysis
This presentation is the property of its rightful owner.
Sponsored Links
1 / 74

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


  • 55 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

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

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Computational movement analysis lecture 5 segmentation popular places and regular patterns joachim gudmundsson

Computational Movement AnalysisLecture 5:

Segmentation, Popular Places and Regular PatternsJoachim Gudmundsson


Problem

Problem

Input:

x1, … , xn: 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

σ

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.

T1

T2


Results

Results

Continuous model:

maximum number of visitorsO(2n2)

(2n2)

Discrete model:

maximum number of visitorsO(n log n)

(n log n)


What should we output

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

Continuous model – report all


Continuous model report all1

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 all2

Continuous model – report all

Idea: Use a sweep-line algorithm


Continuous model report all3

Continuous model – report all

Complexity: O(2)


Continuous model report all4

Continuous model – report all

Straight forward approach (almost):

Running time:O(t2n2 log tn)

Space: O(t2n2)

Apply topological sweep by Edelsbrunner and Guibas:

Running time:O(t2n2)

Space: O(t2n)


Continuous model report all5

Continuous model – report all

Find the maximum “colour depth” using topological sweep by Edelsbrunner & Guibas.


Continuous model report all6

Continuous model – report all

Improvement (incl. topological sweep [Edelbsbrunner & Guibas’89])

Running time:O(t2n2)

Space: O(tn)

Non-trivial to implement due to the degenerate cases.

The problem has an (2n2) lower bound.


Continuous model report all7

Continuous model – report all

n=32

t=1000

Time: 5 seconds

Compression + finding all popular places


Results1

Results

Discrete model:

maximum number of visitorsO(n log n)

(n log n)

Continuous model:

maximum number of visitorsO(2n2)

(2n2)


Problem1

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

Example

Trajectory T sampled with equal time intervals.


Example1

Example

Trajectory T sampled with equal time intervals.

Top right:speed cannot differ more than a factor 2


Example2

Example

Trajectory T sampled with equal time intervals.

Bottom left:direction of motion differs by at most 90◦


Example3

Example

Trajectory T sampled with equal time intervals.

Bottom right:both criteria are used in conjunction (speed and direction)


Problem2

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

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 segmentation1

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

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 algorithm1

Greedy Algorithm

Observation:

If criteria are decreasing monotone, a greedy strategy works.


Greedy algorithm2

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 algorithm3

Greedy Algorithm

  • Observation:

    For some criteria, iterative double & search is faster.

    Double & search: An exponential search followed by a binary search.


Criteria based segmentation2

Criteria-Based Segmentation

  • Boolean or linear combination of decreasing monotone criteria

  • Greedy Algorithm

  • incremental in O(n) time or constant-update criteriae.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

Decreasing and Increasing Monotone Criteria

Observation:

For a combination of decreasing and increasing monotone criteria the

greedy strategy does not always work.

Example:

Min duration 2ANDMax speed range 4

5

speed

1


Case study geese migration

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 migration1

Case Study: Geese Migration

Data

Spring migration tracks

  • White-fronted geese

  • 4-5 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

Comparison

manual

computed


Evaluation

Evaluation

Few local differences:

Shorter stops, extra cuts in computed segmentation


Criteria

Criteria

A combination of decreasing and increasing monotone criteria

stopover

migration flight

Within radius 30km

At least 48h

  • Change in heading

    • <120°

AND

OR


Non monotone segmentation

Non-Monotone Segmentation

  • 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

Start-Stop Diagram

  • Algorithmic approach:

input trajectory compute start-stop diagram compute segmentation


Start stop diagram1

Start-Stop Diagram

  • Given a trajectory T over time interval I = {t0,…,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 [ti,tj] with

  • (i,j) is in free spaceif C holds on [ti,tj]

  • (i,j) is in forbidden space if C does not hold on [ti,tj]

  • A (minimal) segmentation of T corresponds to a (min-link) staircasein D

forbidden space

free space

staircase


Start stop diagram2

Start-Stop Diagram

A (minimal) segmentation of T corresponds to a (min-link) staircasein D.

12

11

10

9

8

7

6

5

4

3

2

1

7

6

8

5

9

10

11

4

12

3

2

1 2 3 4 5 6 7 8 9 10 11 12

123456789101112

1


Start stop diagram3

Start-Stop Diagram

A (minimal) segmentation of T corresponds to a (min-link) staircasein D.

12

11

10

9

8

7

6

5

4

3

2

1

7

6

8

5

9

10

11

4

12

3

2

1 2 3 4 5 6 7 8 9 10 11 12

123456789101112

1


Start stop diagram4

Start-Stop Diagram

  • Discrete case:

  • A non-monotone segmentation can be computed in O(n2) time.

12

11

10

9

8

7

6

5

4

3

2

1

4

8

5

11

12

1

6

9

10

7

1 2 3 4 5 6 7 8 9 10 11 12

123456789101112


Start stop diagram5

Start-Stop Diagram

  • Discrete case:

  • A non-monotone segmentation can be computed in O(n2) time.

12

11

10

9

8

7

6

5

4

3

2

1

4

8

5

11

12

1

6

9

10

7

1 2 3 4 5 6 7 8 9 10 11 12

123456789101112

[Aronov et al.13]


Stable criteria

Stable Criteria

  • Definition:

  • A criterion is stableif and only if where

  • = number of changes of validity on segments [0,i], [1,i],…, [i-1,i]


Stable criteria1

Stable Criteria

  • Definition:

  • A criterion is stableif and only if where

  • = number of changes of validity on segments [0,i], [1,i],…, [i-1,i]

  • Observations:

  • Decreasing and increasing monotone criteria are stable.

  • A conjunction or disjunction of stable criterion are stable.


Compressed start stop diagram

Compressed Start-Stop Diagram

For stable criteria the start-stop diagram can be compressed by applying run-length encoding.

Examples:

decreasing monotone

increasing monotone

9

22


Computing the compressed start stop diagram

Computing the Compressed Start-Stop Diagram

For a decreasing criterion consider the algorithm:

ComputeLongestValid(critC, trajT)

Algorithm:

Move two pointersi,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.

9

i

j

22


Computing the compressed start stop diagram1

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

i

j

9

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.

22


Computing the compressed start stop diagram2

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.

9

22


Attributes and criteria

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

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(n2) time

n

S

0

22


Computing the optimal segmentation1

Computing the Optimal Segmentation

  • More efficient dynamic programming algorithm for compressed diagrams

  • Process blocks of white cellsusing 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(nlog n)time

T

[Alewijnse et al.’14]

22


Summary

Summary

  • 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(n2) 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

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

Motivation

Time

start

end

outside

inside


Motivation1

Motivation

Time

start

end

Length = 5

offset

period

length


Motivation2

Motivation

Time

start

end

Length = 9

Visit 78% of the times

offset

period

length


Motivation3

Motivation

Time

start

end

period

offset

period

length


Simplest case

Simplest case

Given period offset and period length.

period

length

Time

0 1 1 0 1 1 1 0 1 1 0

period

offset

period

offset

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’.


Longest dense substring problem

Longest Dense Substring problem

S = 100011100110

i

f(i) =  si

Maximize b - a

s.t. f(b) - f(a)  c(b-a)

g(i)= f(i) – ci

Maximize b - a

s.t. g(b) - g(a)  0

j=1

1

6

g(i)

f(i)

0

3

-1

0

6

9

3

12

6

9

3

12


Longest dense substring problem1

Longest Dense Substring problem

S = 100011100110

Maximize b - a

s.t. g(b)  g(a)

g(b) must lie on the URE

g(a) must lie on the LLE

g(i)= f(i) – ci

Maximize b - a

s.t. g(b) - g(a)  0

1

URE

0

1

g(i)

0

-1

LLE

-1

0

6

9

3

12

0

6

9

3

12


Longest dense substring problem2

Longest Dense Substring problem

Longest Dense Substring can be computed in O(n) time

Compressed case:

11100010100000011100000  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

Given period length, but no period offset

Time


Given period length1

Given period length

Time


Given period length2

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”.

A

offset


Given period length3

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(n3/2log2 n) time using O(n log n) space.

Time


General case

General case

What if neither period offset nor period length is known?

(no two consecutive visits in the “same region”)

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.


General case1

General case

Theorem:

There are O(n2) pairs of distances. Each distance may generate n/c period lengths, thus O(n3/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(n4/c) time in total.

Can be improved to O(n7/2log3 n).

[Djordjevic et al.’10]


Summary1

Summary

Theorem:

Offset & period lengthO(n)

Period lengthO(n3/2log2 n)

Period length O(n log n) - approximate

NothingO(n7/2log3 n)


Open problems

Open problems

Approximate version of the general version?

Improve running times?

Lower bounds?


Problem3

Problem

Input:A Euclidean graph G in the plane

PreprocessG into a data structure such that given a polygonal query

curve Q and a positive constant 

report all subcurves  Gfor which

(,Q) ≤ 

G

Q

( does not need to start and end at a vertex of G)


Previous results

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)

Q

P

de Berg et al.’11: (Counting)

6-distance approximation

Preprocessing O(n2 + s polylog n)

Space O(s polylog n)

Query time O(n/s polylog n), for n<s<n2


Our results

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)

T

Gudmundsson and Smid:

(3+)-distance approximation

Preprocessing O(n polylog n)

Space O(n polylog n)

Query time O(m polylog n)


Our results1

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)

T

Q

Gudmundsson and Smid:

(3+)-distance approximation

Preprocessing O(n polylog n)

Space O(n polylog n)

Query time O(m polylog n)


Our results2

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”

Q

G


Computational movement analysis lecture 5 segmentation popular places and regular patterns joachim gudmundsson

References

  • M. Benkert, B. Djordjevic, J. Gudmundsson and T. Wolle. Finding popular places. IJCGA, 2010.

  • S. Alewijnse, T. Bagautdinov, M. de Berg, Q. Bouts, A. ten Brink, K. Buchin and M. Westenberg. Progressive Geometric Algorithms. SoCG, 2014.

  • 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, 2011.

  • B. Aronov, A. Driemel, M. J. Kreveld, M. Loffler and F. Staals. Segmentation of Trajectories for Non-Monotone Criteria. SODA, 2013.

  • M. Buchin, H. Kruckenberg and A. Kölzsch. Segmenting Trajectories based on Movement States. SDH, 2012.

  • B. Djordjevic, J. Gudmundsson, A. Pham and T. Wolle. Detecting Regular Visit Patterns. Algorithmica, 2011.


Computational movement analysis lecture 5 segmentation popular places and regular patterns joachim gudmundsson

References

  • B. A. Burton. Searching a bitstream in linear time for the longest substring of any given density, Algorithmica, 2011.

  • B. Djordjevic and J. Gudmundsson. Detecting areas visited regularly. COCOON 2010.

  • M. de Berg, A. F. Cook IV and J. Gudmundsson. Fast Frechet Queries. CGTA, 2013.

  • J. Gudmundsson and M. Smid. Frechetqueries in geometric trees. ESA, 2013.


  • Login