creativeai: deep learning for graphics motion & physics · creativeai: deep learning for...

34
Niloy Mitra Iasonas Kokkinos Paul Guerrero Nils Thuerey Tobias Ritschel UCL UCL/Facebook UCL TUM UCL CreativeAI: Deep Learning for Graphics Motion & Physics

Upload: others

Post on 09-May-2020

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Niloy Mitra Iasonas Kokkinos Paul Guerrero Nils Thuerey Tobias Ritschel

UCL UCL/Facebook UCL TUM UCL

CreativeAI: Deep Learning for Graphics

Motion & Physics

Page 2: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Computer Animation

2

• Feature detection (image features, point features)

• Denoising, Smoothing, etc.

• Embedding, Distance computation

• Rendering

• Animation

• Physical simulation

• Generative models

• Motion over time

• Loads of data, expensive

• Relationships between spatial and temporal changes

Page 3: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Character Animation

3

[DeepLoco: Dynamic Locomotion Skills Using Hierarchical Deep Reinforcement

Learning, SIGGRAPH 2017][DeepMimic: Example-Guided Deep

Reinforcement Learning of Physics-Based Character Skills, SIGGRAPH 2018]

[Mode-Adaptive Neural Networks for Quadruped Motion Control,

SIGGRAPH 2018]

[A Deep Learning Framework for Character Motion Synthesis and

Editing, SIGGRAPH 2016]

• Learn controllers for character rigs

• Powerful and natural

• Beyond the scope of this course…

Page 4: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Physics-Based Animation• Leverage physical models

• Examples:

• Rigid bodies

• Cloth

• Deformable objects

• Fluids

4SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Page 5: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Physics-Based Animation

5

Experiment Theory Computation

Skip Theory with Deep Learning?[No! More on that later…]

Observations / data Model equations Discrete representation

Page 6: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Physics-Based Animation• Better goal: support solving suitable physical models • Nature = Partial Differential Equations (PDEs) • Hence we are aiming for solving PDEs with deep learning (DL) • Requirement: “regularity” of the targeted function

6

“Bypass the solving of evolution equations when these equations conceptually exist but are not available or known in closed form.” [Kevrekidis et al.]

Page 7: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Partial Differential Equations• Typical problem formulation: unknown

function

• PDE of the general form:

• Solve in domain , with boundary conditions on boundary

• Traditionally: discretize & solve numerically. Here: also discretize, but solve with DL…

7

f⇣x1, ..., xn;

@u

@x1, ...,

@u

@xn;@2u

@2x1,

@2u

@x1@x2, ...

⌘= 0

u(x1, ..., xn)

⌦ �

Page 8: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Methodology 1• Viewpoints: holistic or partial

[partial also meaning “coarse graining” or “sub-grid / up-res”]

• Influences complexity and non-linearity of solution space

• Trade off computation vs accuracy:

• Target most costly parts of solving

• Often at the expense of accuracy

8

Page 9: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Methodology 2

9

• Consider dimensionality & structure of discretization

• Small & unstructured

• Fully connected NNs only choice

• Only if necessary…

• Large & structured

• Employ convolutional NNs

• Usually well suited

Page 10: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Practical example: airfoil flow

• Given boundary conditions solve stationary flow problem on grid

• Fully replace traditional solver

• 2D data, no time dimension

• I.e., holistic approach with structured data

10

Page 11: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Data generation • Large number of pairs: input (BCs) - targets (solutions)

11

Airfoil profile Generated meshFull simulation domain

Inference region

Different free stream Velocities

Page 12: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Data generation

• Example pair

• Note - boundary conditions (i.e. input fields) are typically constant

• Rasterized airfoil shape present in all three input fields

12SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Target

Pres

sure

Velo

city

XVe

loci

ty Y

128 x 128 x 1

128 x 128 x 1

128 x 128 x 1

Free

stre

am X

Boundary Conditions

Free

stre

am Y

Mas

k128 x 128 x 1

128 x 128 x 1

128 x 128 x 1

Page 13: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL

13

Reduce spatial dimensions

Skip connections

Increase spatial dimensions

• U-net NN architecture

Page 14: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL

• Unet structure highly suitable for PDE solving • Makes boundary condition information available throughout • Crucial for inference of solution

14

• U-net NN architecture

Page 15: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Training: 80.000 iterations with ADAM optimizer

• Convolutions with enough data - no dropout necessary

• Learning rate decay stabilizes models

15

Page 16: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Results

16

Targ

et (A

) Reg

ular

dat

a(B

) Dim

ensi

on le

ss

Pressure Velocity X Velocity Y

• Use knowledge about physics to simplify space of solutions: make quantities dimension- less

• Significant gains in inference accuracy

Page 17: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Validation and test accuracy for different model sizes

17

Saturated, little gain from weights and data

Page 18: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Code example Solving PDEs with DL

18

Page 19: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Solving PDEs with DL• Source code and training data available

• Requirements: numpy / pytorch , OpenFOAM for data generation

• Details at: https://github.com/thunil/Deep-Flow-Prediction and http://geometry.cs.ucl.ac.uk/creativeai/

19

Page 20: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Additional Examples• Elasticity: material models • Fluids: up-res algorithm & dimensionality reduction • By no means exhaustive…

20

Page 21: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Neural Material - Elasticity• Learn correction of regular FEM simulation for complex materials

21[Neural Material: Learning Elastic Constitutive Material and Damping Models from Sparse Data, arXiv 2018]

Page 22: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Neural Material - Elasticity• Learn correction of regular FEM simulation for complex materials

• “Partial” approach

• Numerical simulation with flexible NN for material behavior

22[Neural Material: Learning Elastic Constitutive Material and Damping Models from Sparse Data, arXiv 2018]

Page 23: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Temporal Data• tempoGAN: 3D GAN

with temporal coherence

23[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

Page 24: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Temporal Data• tempoGAN: 3D GAN

with temporal coherence

24[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

Page 25: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Temporal Data

25[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

• tempoGAN: 3D GAN with temporal coherence

Page 26: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

26[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

“Loss” for generatorTemporal Data• tempoGAN: 3D GAN

with temporal coherence

Page 27: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

27[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

G

D_s

D_t

xa

xt-1

xt

xt+1

ya

yt-1 yt yt+1

G(xa)

G(xt-1) G(xt) G(xt+1)

Temporal Data• tempoGAN: 3D GAN

with temporal coherence

Advection encoded in loss for G

Page 28: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Temporal Data

28[tempoGAN: A Temporally Coherent, Volumetric GAN for Super-resolution Fluid Flow , SIGGRAPH 2018]

Page 29: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Latent Spaces

29

• Learn flexible reduced representation for physics problems

[Latent-space Physics: Towards Learning the Temporal Evolution of Fluid Flow, arXiv 2018][Deep Fluids: A Generative Network for Parameterized Fluid Simulations, arXiv 2018]

Page 30: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Latent Spaces

30

• Learn flexible reduced representation for physics problems • Employ Encoder part (E) of Autoencoder network to reduce dimensions

• Predict future state in latent space with FC network

• Use Decoder (D) of Autoencoder to retrieve volume data

[Latent-space Physics: Towards Learning the Temporal Evolution of Fluid Flow, arXiv 2018][Deep Fluids: A Generative Network for Parameterized Fluid Simulations, arXiv 2018]

E

tt-1t-2

. . .

EE

FC

t+1

D

Page 31: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Latent Spaces

31

• Learn flexible reduced representation for physics problems

[Latent-space Physics: Towards Learning the Temporal Evolution of Fluid Flow, arXiv 2018][Deep Fluids: A Generative Network for Parameterized Fluid Simulations, arXiv 2018]

Page 32: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

• Checklist for solving PDEs with DL:

✓ Model? (Typically given)

✓ Data? Can enough training data be generated?

✓ Which NN Architecture?

✓ Fine tuning: learning rate, number of layers & features?

✓ Hyper-parameters, activation functions etc.?

Summary

32

Page 33: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

• Approach PDE solving with DL like solving with traditional numerical methods:

- Find closest example in literature

- Reproduce & test

- Then vary, adjust, refine …

Summary

33

Page 34: CreativeAI: Deep Learning for Graphics Motion & Physics · CreativeAI: Deep Learning for Graphics Motion & Physics. ... SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

SIGGRAPH Asia Course CreativeAI: Deep Learning for Graphics

Thank you!

http://geometry.cs.ucl.ac.uk/creativeai/

34