Implicit Crowds: Optimization Integrator for Robust Crowd ... · IMPLICIT POWER-LAW CROWDS Problem:...
Transcript of Implicit Crowds: Optimization Integrator for Robust Crowd ... · IMPLICIT POWER-LAW CROWDS Problem:...
Ioannis Karamouzas1, Nick Sohre2, Rahul Narain2, Stephen J. Guy2
1Clemson University
2University of Minnesota
IMPLICIT CROWDS:
OPTIMIZATION INTEGRATOR FOR ROBUST CROWD SIMULATION
COLLISION AVOIDANCE IN CROWDS
Given desired velocities, how should agents navigate around each other?
2
COLLISION AVOIDANCE IN CROWDS
Given desired velocities, how should agents navigate around each other?
3
LOCAL COLLISION AVOIDANCE
Adding Realism
• Vision-based approaches [Ondřej et al. 2010,
Kapadia et al. 2012, Hughes et al. 2015, Dutra et al. 2017]
• Probabilistic approaches [Wolinski et al. 2016]
• …..
4[Wolinski et al. 2016] [Kapadia et al. 2012]
[Yu et al. 2012]
LOCAL COLLISION AVOIDANCE
Force-based methods [Reynolds 1987,
1999; Helbing et al. 2000; Pelechano et al.
2007, …]
• Require very small time steps for
stability
Velocity-based methods [van den Berg
et al. 2008, 2011; Pettré et al 2011, …]
• Overly conservative behavior
5
[8agent/ttc_0.25] ORCA
Δt = 0.1s
DESIDERATA
We seek a generic technique for multi-agent navigation that
• guarantees collision-free motion
• is robust to variations in scenario, density, time step
• exhibits high-fidelity behavior
• can update at footstep rates (0.3-0.5 s)
6
OUR CONTRIBUTIONS
1. General form of collision avoidance behaviorsd𝐯
d𝑡= −
𝜕𝑅 𝐱, 𝐯
𝜕𝐯supporting optimization-based implicit integration
2. Application to state-of-the-art power law model
𝑅 𝐱, 𝐯 ∝ 𝜏(𝐱, 𝐯)−𝑝
for practical crowd simulations
7
I. OPTIMIZATION INTEGRATOR FOR CROWDS
8
IMPLICIT INTEGRATION
𝐱𝑛+1 − 𝐱𝑛 = 𝐯𝑛+1∆𝑡,𝐌 𝐯𝑛+1 − 𝐯𝑛 = 𝐟𝑛+1∆𝑡
• Unconditionally stable, but
9
•𝑑
𝑑𝑡
𝐱𝐯
=𝐯
𝐌−1𝐟(𝐱, 𝐯) ⟺
[Baraff and Witkin, 1998]
IMPLICIT INTEGRATION
𝐱𝑛+1−𝐱𝑛 = 𝐯𝑛+1∆𝑡,𝐌 𝐯𝑛+1 − 𝐯𝑛 = 𝐟𝑛+1∆𝑡
• Unconditionally stable, but
• Need to solve a non linear system
• Slow (but we can use large time steps)
10
•𝑑
𝑑𝑡
𝐱𝐯
=𝐯
𝐌−1𝐟(𝐱, 𝐯) ⟺
[Kaufman et al. 2014]
OPTIMIZATION INTEGRATORS
As long as forces are conservative:
𝐟 𝐱 = −d𝑈 𝐱
d𝐱,
we can express backward Euler in optimization
form [Martin et al. 2011; Gast et al. 2015]:
𝐱𝑛+1 = arg min𝐱
1
2∆𝑡2𝐱 − 𝐱 𝐌
2 + 𝑈(𝐱)
Interpretation: tradeoff between conserving
momentum and reducing potential energy
11
[Martin et al. 2011]
[Bouaziz et al. 2014]
OPTIMIZATION INTEGRATORS
As long as forces are conservative:
𝐟 𝐱 = −d𝑈 𝐱
d𝐱,
we can express backward Euler in optimization
form [Martin et al. 2011; Gast et al. 2015]:
𝐱𝑛+1 = arg min𝐱
1
2∆𝑡2𝐱 − 𝐱 𝐌
2 + 𝑈(𝐱)
Interpretation: tradeoff between maintaining
velocity and reducing potential energy
12
[Bouaziz et al. 2014]
[Martin et al. 2011]
OPTIMIZATION INTEGRATORS
𝐱𝑛+1 = arg min𝐱
1
2∆𝑡2𝐱 − 𝐱 𝐌
2 + 𝑈(𝐱)
Why this is good:
• Simple and fast algorithms (e.g. gradient descent, Gauss-
Seidel) can be given guarantees
• Highly nonlinear forces can be used without linearization
• Lots of recent advances in optimization for data mining,
machine learning, image processing, …
13
[Fratarcangeli et al. 2016]
NON-CONSERVATIVE FORCES
14
Conservative potentials 𝑈(𝐱) can only model position-dependent forces
NON-CONSERVATIVE FORCES
15
Crowd forces depend both on positions and velocities!
Conservative potentials 𝑈(𝐱) can only model position-dependent forces
• Humans anticipate
• People anticipate future trajectories of others [Cutting et al. 2005, Olivier et al. 2012; Karamouzas
et al. 2014]
• Brains have special neurons for estimating collisions [Gabbiani 2002]
ANTICIPATORY FORCES
16
Hypothesis: Multi-agent interactions can be expressed as
𝐟 𝐱, 𝐯 = −𝜕𝑅 𝐱, 𝐯
𝜕𝐯where 𝑅 is an anticipatory potential that drives agents away from high-cost
velocities
(This is analogous to dissipation potentials [Goldstein 1980] in classical mechanics)
OPTIMIZATION INTEGRATOR FOR
NON-CONSERVATIVE FORCES
17
Anticipatory forces
𝐯𝑛+1 = arg min𝐯
1
2𝐯 − 𝐯 𝐌
2 + 𝑅(𝐱 + 𝐯∆𝑡, 𝐯)∆𝑡
• First-order accurate, equivalent to previous formula if 𝑅 = 0
• 𝑈(∙) + 𝑅(∙)∆𝑡 is analogous to the “effective interaction potential” in symplectic
integrators [Kane et al. 2000; Kharevych et al. 2006]
• Simple interpretation: tradeoff between conserving momentum, reducing 𝑈,
and reducing 𝑅
OPTIMIZATION INTEGRATOR FOR
NON-CONSERVATIVE FORCES
Anticipatory + conservative forces
𝐯𝑛+1 = arg min𝐯
1
2𝐯 − 𝐯 𝐌
2 + 𝑈(𝐱 + 𝐯∆𝑡) + 𝑅(𝐱 + 𝐯∆𝑡, 𝐯)∆𝑡
• First-order accurate
• 𝑈(∙) + 𝑅(∙)∆𝑡 is analogous to the “effective interaction potential” in symplectic
integrators [Kane et al. 2000; Kharevych et al. 2006]
• Simple interpretation: tradeoff between maintaining velocity, reducing 𝑈, and
reducing 𝑅
18
SOME EXISTING MODELS
Alignment behavior in boids [Reynolds 1987]:
𝐟𝑖𝑗 = −𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗 ⟺ 𝑅𝑖𝑗 = 𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗2
Velocity obstacles [van den Berg et al 2011]:
𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗 ⟺ 𝑅𝑖𝑗 = ቊ∞ if 𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗
0 otherwise
Power law model [Karamouzas et al 2014]:
𝑅𝑖𝑗 ∝ 𝜏(𝐱𝑖𝑗 , 𝐯𝑖𝑗)−𝑝
19
SOME EXISTING MODELS
Alignment behavior in boids [Reynolds 1987]:
𝐟𝑖𝑗 = −𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗 ⟺ 𝑅𝑖𝑗 = 𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗2
Velocity obstacles [Fiorini and Shiller 1998]:
𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗 ⟺ 𝑅𝑖𝑗 = ቊ∞ if 𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗
0 otherwise
Power law model [Karamouzas et al 2014]:
𝑅𝑖𝑗 ∝ 𝜏(𝐱𝑖𝑗 , 𝐯𝑖𝑗)−𝑝
20
𝐱𝑖
𝐱𝑗
𝑣𝑥
𝑣 𝑦
VO
SOME EXISTING MODELS
Alignment behavior in boids [Reynolds 1987]:
𝐟𝑖𝑗 = −𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗 ⟺ 𝑅𝑖𝑗 = 𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗2
Velocity obstacles [Fiorini and Shiller 1998]:
𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗 ⟺ 𝑅𝑖𝑗 = ቊ∞ if 𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗
0 otherwise
What is 𝑅𝑖𝑗 for humans?
Power law model [Karamouzas et al 2014]
SOME EXISTING MODELS
Alignment behavior in boids [Reynolds 1987]:
𝐟𝑖𝑗 = −𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗 ⟺ 𝑅𝑖𝑗 = 𝑤 𝐱𝑖𝑗 𝐯𝑖𝑗2
Velocity obstacles [Fiorini and Shiller 1998]:
𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗 ⟺ 𝑅𝑖𝑗 = ቊ∞ if 𝐯𝑖𝑗 ∈ VO 𝐱𝑖𝑗
0 otherwise
What is 𝑅𝑖𝑗 for humans?
Power law model [Karamouzas et al 2014]
II. IMPLICIT CROWDS USING
THE POWER-LAW MODEL
23
POWER-LAW MODEL
For each pair of agents:
• Compute time to collision 𝜏 𝐱, 𝐯
• Compute potential 𝑅(𝐱, 𝐯) ∝ 𝜏 𝐱, 𝐯 −𝑝
24
Collisions occurs when
𝐱𝑖𝑗 + 𝐯𝑖𝑗𝜏 = r𝑖 + r𝑗
𝐱𝑖 𝐱𝑗
𝐯𝑖 𝐯𝑗
[Karamouzas et al. 2014]
POWER-LAW MODEL
25
𝐱𝑖 𝐱𝑗
𝐯𝑖 𝐯𝑗
For each pair of agents:
• Compute time to collision 𝜏 𝐱, 𝐯
• Compute potential 𝑅(𝐱, 𝐯) ∝ 𝜏 𝐱, 𝐯 −𝑝
Collisions occurs when
𝐱𝑖𝑗 + 𝐯𝑖𝑗𝜏 = r𝑖 + r𝑗
[Karamouzas et al. 2014]
POWER-LAW MODEL
26
𝐱𝑖 𝐱𝑗
𝐯𝑖 𝐯𝑗
For each pair of agents:
• Compute time to collision 𝜏 𝐱, 𝐯
• Compute potential 𝑅(𝐱, 𝐯) ∝ 𝜏 𝐱, 𝐯 −𝑝
Collisions occurs when
𝐱𝑖𝑗 + 𝐯𝑖𝑗𝜏 = r𝑖 + r𝑗
[Karamouzas et al. 2014]
POWER-LAW MODEL
27
𝐱𝑖 𝐱𝑗
𝐯𝑖 𝐯𝑗
For each pair of agents:
• Compute time to collision 𝜏 𝐱, 𝐯
• Compute potential 𝑅(𝐱, 𝐯) ∝ 𝜏 𝐱, 𝐯 −𝑝
Collisions occurs when
𝐱𝑖𝑗 + 𝐯𝑖𝑗𝜏 = r𝑖 + r𝑗
[Karamouzas et al. 2014]
IMPLICIT POWER-LAW CROWDS
Problem: Apply power law potential to optimization-based backward Euler
Easy? Not quite…
• 𝑅 is discontinuous at boundary of collision cone
• 𝑅 becomes infinitely steep as agents graze past
Both phenomena cause numerical solvers to “get stuck”
28
R
IMPLICIT POWER-LAW CROWDS
Problem: Apply power law potential to optimization-based backward Euler
Easy? Not quite…
• 𝑅 is discontinuous at boundary of collision cone
• 𝑅 becomes infinitely steep as agents graze past
Both phenomena cause numerical solvers to “get stuck”.
29
𝐱𝑗
𝐱𝑖
A CONTINUOUS TTC POTENTIAL
Discontinuity due to time to collision (finite if collision predicted, infinite if not)
30
𝐱𝑗
𝐱𝑖
A CONTINUOUS TTC POTENTIAL
Discontinuity due to time to collision (finite if collision predicted, infinite if not)
31
𝑣 𝑝
𝑣𝑡
0
∞
𝐱𝑗
A CONTINUOUS TTC POTENTIAL
Discontinuity due to time to collision (finite if collision predicted, infinite if not)
32
𝑣 𝑝
𝑣𝑡
R
0
∞
A CONTINUOUS TTC POTENTIAL
Solution:
Let’s work with 1
𝜏(or, “imminence” of collision)
• Replace it with a continuous approximation, e.g., by linear extrapolation
• 𝑅 becomes 𝐶𝑝−1-smooth
33
1/𝜏
A CONTINUOUS TTC POTENTIAL
Solution:
Let’s work with 1
𝜏(or, “imminence” of collision)
• Replace it with a continuous approximation, e.g., by linear extrapolation
• 𝑅 becomes 𝐶𝑝−1-smooth
34
1/𝜏
MAINTAINING SEPARATION
Grazing trajectories make 𝑅 badly behaved
• Add some distance-based repulsion 𝑈𝑖𝑗 ∝1
𝐱𝑖𝑗 −𝑟𝑖𝑗
• Continuous collision detection: replace distance 𝐱𝑖𝑗 with minimum distance
over the time step
Alternative approach to repulsion: add uncertainty to time to collision
computation [Forootaninia 2017]
35
MAINTAINING SEPARATION
Grazing trajectories make 𝑅 badly behaved
• Add some distance-based repulsion 𝑈𝑖𝑗 ∝1
𝐱𝑖𝑗 −𝑟𝑖𝑗
• Continuous collision detection: replace distance 𝐱𝑖𝑗 with minimum distance
over the time step
Alternative approach to repulsion: add uncertainty to time-to-collision
computation [Forootaninia et al. 2017]
36
III. ANALYSIS AND RESULTS
37
THEORETICAL ANALYSIS
Implicit integration + continuous PowerLaw potential
• Guaranteed collision-free motion
• Smooth (C2-continuous) trajectories
38
THEORETICAL ANALYSIS
Implicit integration + continuous PowerLaw potential
• Guaranteed collision-free motion
• Smooth (C2-continuous) trajectories
Collision-free proof
• 𝐯𝑛+1 minimizes 1
2𝐯𝑛+1 − 𝐯
𝐌
2+ 𝑈(𝐱𝑛+1) + 𝑅(𝐱𝑛+1, 𝐯𝑛+1)∆𝑡
• 𝑅 is infinite for a colliding state. 𝑈 is infinite for a tunneling step. So these
cannot be minima.
39
COLLISION-FREE MOTION
• Comparisons to
– ORCA [van den Berg et al. 2011] (representative velocity-based approach)
– PowerLaw [Karamouzas et al. 2014] (non-continuous TTC + forward Euler)
40
COLLISION-FREE MOTION
• Comparisons to
– ORCA [van den Berg et al. 2011] (representative velocity-based approach)
– PowerLaw [Karamouzas et al. 2014] (non-continuous TTC + forward Euler)
41
COLLISION-FREE MOTION
• Comparisons to
– ORCA [van den Berg et al. 2011] (representative velocity-based approach)
– PowerLaw [Karamouzas et al. 2014] (non-continuous TTC + forward Euler)
42
FIDELITY TO HUMAN DATA
Comparison to human crowds [Charalambous et al. 2014]
43
Implicit
Δt=0.4sORCA
Δt=0.4s
TIME STEP STABILITY
44
Implicit
Δt=0.4s
(1.5x playback speed)
TIME STEP STABILITY
Motion doesn’t change significantly with time step
Potential applications:
• Collision avoidance synced with footstep-based character animation
• Crowd timestep level of detail without affecting behavior
45
PERFORMANCE
[fig: performance graph]
Cost is linear in number of agents,
increases slowly with time step size
(Still, 2x-10x slower than ORCA or PowerLaw on
a 6-core Intel Xeon E5-1650)
46
Δ
Future work: Improve performance via
local-global alternating minimization techniques
Δ
[Liu et al. 2017]
[Narain et al. 2016]
LIMITATIONS AND FUTURE WORK
• Can other recent crowd models be formulated via interaction energies
[Wolinksi et al. 2016, Dutra et al. 2017; …]?
• Incorporating asymmetrical interactions, e.g., leader-following behavior
• What is the Δt threshold where quality is maintained?
47Δt=0.1s Δt=1s Δt=4s
LIMITATIONS AND FUTURE WORK
• Can other recent crowd models be formulated via interaction energies
[Wolinksi et al. 2016, Dutra et al. 2017; …]?
• Incorporating asymmetrical interactions, e.g., leader-following behavior
• What is the Δt threshold where quality is maintained?
48Δt=0.1s Δt=1s Δt=4s
FUTURE WORK
• Applications to LOD systems and footstep-based animation engines
• Applications to nonlinear dissipation forces in physics-based animation
49
[Xu and Barbic 2017]
[Zhu et al. 2015]
THANK YOU
50
https://www.cs.clemson.edu/~ioannis/implicit-crowds/