URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and...

32
www.bsc.es URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND VISUALIZATION Isaac Rudomin May 2017

Transcript of URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and...

Page 1: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

www.bsc.es

URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND VISUALIZATION

Isaac Rudomin

May 2017

Page 2: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

2

ABSTRACT

We'll dive deep into how we use heterogeneous clusters with GPUs for accelerating urban-scale crowd data analysis, simulation, and visualization. Our main contributions are the development of new behavior models that conform to real data, the ability to scale the system by adding computing resources as needed without making programming modifications and the combination of analysis, simulation, and visualization techniques that help us achieve large-scale crowd simulations with realistic behavior.

Page 3: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

3

INTROWhy Crowd simulation?

• One of many massiveagent based simulations.

• Many applications:• Videogames, • Special events or

Emergency simulations, • Vehicular traffic , • Health

• What we learn here can be used in other examplesof largescale simulationand visualization

Page 4: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

4

INTRO

We have developed methods for realtime crowd simulation and visualization• Using several algorithms for collision avoidance and other behaviors• Developing methods for generating varied animatable characters (GOD)• Using shader based LOD techniques for rendering large crowds

For large scale problems we have parallelized• simulation using MPI + OmpSs and/or CUDA in heterogeneous clusters• visualization by using MPI and composition

Work in progress in• using XML for specifying GOD for point based hierarchical LOD• integrating map applications such as Cesium, Tangram, Mapbox and 3D scenery

generated by them• integrating real data such as GPS traces to be used to influence simulation• using deep learning for modifying behavior

Page 5: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

BLOCK STRUCTURE

Page 6: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

PW: BEHAVIOR• Effective search of neighbours, • Collision avoidance

• Boids (Reynolds), • Social Forces (Helbing),• Reciprocal Velocity

Obstacles, • Synthetic Vision

Page 7: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

7

PW: BEHAVIOR

Physical, Psychological and cultural characteristics of agents,Optimal navigation

Page 8: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

Using trajectories and spikingneural networks to teach agent to avoid colissions. Work with withIsrael Tabarez will continue.

Have usedstandard vision techniques

• will use • deep reinforcement learning• montecarlo tree search• to train from trajectories and/or

real and simulated video.

PW: VISION, LEARNING

Page 9: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

PW: GOD

GOD: Generate Animate

Page 10: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

HETEROGENEOUS CLUSTER

HETEROGENEOUS CLUSTER or PC

SimulationSimulation

Learning

RenderRender

GO-A-L

CompositionComposition

Composition

Display

SimulationSimulation

Simulation

CompositionComposition

Compression

SimulationSimulationWorld &

Models

2D MAP DATA

DisplayDisplay

3D MapCamera

ANIMATE

LOD

NEIGHBOR

AVOID COLLISION

NAVIGATE

INPUT-OUTPUT:BROWSER, UNITY, Mapbox

Render

GOD

RenderRender

IMAGE STREAM

DATA

STREAM

GENERAL DIAGRAM

Page 11: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

XML FILES: GOD, PBR, H-LOD

• Used for parameter definition and behavior

• Geometric attributes

• Distribution

• Variety Generation

• World Distribution

• Group Definitions

• Environment Definition and Actors

Page 12: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

12

Templates for XML Definition

Texture driven variety generation

XML FILES: GOD, PBR, H-LOD

Page 13: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

13

XML FILES: GOD, PBR, H-LOD

Page 14: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

14

Geometry reduction Surface splatting

• Animations are transferablebetween polygonsand pointsamples for anygiven level of detail.

XML FILES: GOD, PBR, H-LOD

Page 15: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

15

This structure is usedto generatecharacters

• varied• animated• viewable from any

camera angle• for any given LOD

XML FILES: GOD, PBR, H-LOD

Page 16: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

XML FILES: GOD, PBR, H-LOD

Page 17: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

17

A tiling system is built on top of a quadtreeallowing us to combine geometry from different agents and objects.

Each tile is indexed using the quadtree. Characters are indexed as well, knowing at all times in which tile they are currently at.

XML FILES: GOD, PBR, H-LOD

Page 18: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

18

By combining both hierarchical structures, (octree skeleton and quadtree environment) it is possible to create crowds composed by hundreds of thousands of animated characters.

Depending on the location of each character LOD is assigned dynamically to reduce computation bottlenecks.

XML FILES: GOD, PBR, H-LOD

Page 19: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

19

SYSTEM ARCHITECTURE

Page 20: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

WEB BROWSER CLIENT SERVER

(SIMULATION ENGINE)

webGL outputOSM 3D MAP

Data capture Script

OUTPUT DATA● COLOR TEXTURE (screen).● DEPTH TEXTURE.● VIRTUAL CAMERA

PARAMETERS AND WORLD POSITION

OUTPUT DATA

WEB SOCKETS

CROWD SIMULATION(2D TILE LEVEL POSITIONS)

CLIENT CAMERA SETTINGSAND DATA

CROWD 3D RENDER

SCREEN COMPOSITION

OUTPUT RENDER

OUTPUT RENDER

WEB SOCKETSPRESENTATION

IN DEVELOPMENT

Page 21: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

21

SIMPLE BEHAVIOR: 1 GPU

World: 2D grid of cells – empty or – occupied by an agent.

main computation is agent and world updates: with a single GPU once data is in GPU updating & rendering happens on the GPU without data transfers speedup is significant.

Collision Avoidance:• simple gather method • checks 8 directions with

radius 5• if another agent in path has

same direction its cell is considered a free cell

Page 22: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

MPI, OMPSS, CUDAParallel crowd simulation requires dividing the problemin blocks, and for MPI, for OMPSS the idea is the same

• subdivide world into equal sized (2D) tiles• we assign each tile to a node for MPI• we assign each subtile, within a node to the CPU or

GPU core using OmPSS• within the GPUs we use CUDA• tiles and subtiles manage their own agents• interchange of agents at borders

Double tiling technique

Four levels of parallelism

Page 23: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

CLUSTER VISUALIZATION

streaming in situ

web

Page 24: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

24

DATAData preparation collected from different sources

NoSQL

BLOBs

Data Collection

Crowd

Clean and Extraction Data Storage

Data Analysis and Visualization

GPS and Video Data

Page 25: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

25

Urban environments

OpenStreetMap

DATA

Page 26: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

T-Drive trajectory dataset- GPS trajectories of 10,357 taxis within Beijing. - 15 million of points - and the total distance of 9 million kilometers

26

Trajectory Dataset

OpenPaths project: “Crowds Simulation”- 848,000 GPX files- 2.6 Trillion GPX points- and 260GB of GPS data

DATA

Page 27: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

27

Heatmap

Query the data by: day and hour / zone / type of vehicle, / etc...

DATA

Page 28: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

28

Neural network architecture

.

.

.

.

.

.

Input3 * 20

.

.

.

ReLu FC150

ReLu FC150

Output3

DEEP

Page 29: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

29

SCENERY

In both systems 2e can import scenery, generate scenery, and we can also compose with the zbuffer generated by other systems, such as the Mapbox Unity plugin or Tangram

Page 30: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

CONCLUSIONS

We have a scalable multi agent system architecture

• Supports the simulation of hundreds of thousands of autonomous agents

• The crowd rendering engine enables geometrical, visual and animation diversity while maintaining memory requirements low.

• We have used GLSL/CUDA for data parallelism for systems with one GPU

• Large scale simulations taking advantage of heterogeneous computing clusterswith multiple CPUs and GPUs

• real-time simulation on clusters using CUDA MPI, OmPSS• streaming and in-situ+composition visualization of the results

• Working on Using real maps and trajectories

Page 31: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

ACKNOWLEDGEMENTS

This work is supported • by the Spanish Government through Programa Severo Ochoa (SEV-2015-0493) • by the Spanish Ministry of Science and Technology (project TIN2015-65316-P).• by CONACyT, Mexico through the Barcelona Supercomputing Center – Centro

Nacional de Supercomputación – Consejo Nacional de Ciencia y Tecnología Convocatoria 2016 para Estancias Posdoctorales

• by CONACyT, Mexico PhD Scholarship program

Page 32: URBAN SCALE CROWD DATA ANALYSIS, SIMULATION, AND … · 2017. 5. 5. · simulation, and visualization. Our main contributions are the development of new behavior models that conform

32

• Isaac Rudomin (BSC)

[email protected]

• Hugo Perez (UPC-BSC)

[email protected]

• Leonel Toledo (BSC)

[email protected]

• Jorge Eduardo Ramirez (BSC)

[email protected]

MORE INFO