Fast Agglomerative Clustering for Rendering Bruce Walter, Kavita Bala, Cornell University Milind Kulkarni, Keshav Pingali University of Texas, Austin.

Slides:



Advertisements
Similar presentations
Sven Woop Computer Graphics Lab Saarland University
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Multidimensional Lightcuts Bruce Walter Adam Arbree Kavita Bala Donald P. Greenberg Program of Computer Graphics, Cornell University.
SEEM Tutorial 4 – Clustering. 2 What is Cluster Analysis?  Finding groups of objects such that the objects in a group will be similar (or.
Ch2 Data Preprocessing part3 Dr. Bernard Chen Ph.D. University of Central Arkansas Fall 2009.
Hierarchical Clustering. Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram – A tree-like diagram that.
Scalability with Many Lights 1 Lightcuts & Multidimensonal Lightcuts Course: Realistic Rendering with Many-Light Methods Note: please see website for the.
Fast Algorithms For Hierarchical Range Histogram Constructions
Transform and Conquer Chapter 6. Transform and Conquer Solve problem by transforming into: a more convenient instance of the same problem (instance simplification)
Greedy Algorithms Greed is good. (Some of the time)
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Searching on Multi-Dimensional Data
Image Indexing and Retrieval using Moment Invariants Imran Ahmad School of Computer Science University of Windsor – Canada.
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
RT06 conferenceVlastimil Havran On the Fast Construction of Spatial Hierarchies for Ray Tracing Vlastimil Havran 1,2 Robert Herzog 1 Hans-Peter Seidel.
Experiences with Streaming Construction of SAH KD Trees Stefan Popov, Johannes Günther, Hans-Peter Seidel, Philipp Slusallek.
Paper Presentation - An Efficient GPU-based Approach for Interactive Global Illumination- Rui Wang, Rui Wang, Kun Zhou, Minghao Pan, Hujun Bao Presenter.
Sorting Chapter Sorting Consider list x 1, x 2, x 3, … x n We seek to arrange the elements of the list in order –Ascending or descending Some O(n.
TCSS 343, version 1.1 Algorithms, Design and Analysis Transform and Conquer Algorithms Presorting HeapSort.
University of CreteCS4831 The use of Minimum Spanning Trees in microarray expression data Gkirtzou Ekaterini.
4. Ad-hoc I: Hierarchical clustering
Comp 122, Spring 2004 Heapsort. heapsort - 2 Lin / Devi Comp 122 Heapsort  Combines the better attributes of merge sort and insertion sort. »Like merge.
Lightcuts: A Scalable Approach to Illumination Bruce Walter, Sebastian Fernandez, Adam Arbree, Mike Donikian, Kavita Bala, Donald Greenberg Program of.
Lars Arge1, Mark de Berg2, Herman Haverkort3 and Ke Yi1
Ray Tracing Dynamic Scenes using Selective Restructuring Sung-eui Yoon Sean Curtis Dinesh Manocha Univ. of North Carolina at Chapel Hill Lawrence Livermore.
Optimized Subdivisions for Preprocessed Visibility Oliver Mattausch, Jiří Bittner, Peter Wonka, Michael Wimmer Institute of Computer Graphics and Algorithms.
Matrix Row-Column Sampling for the Many-Light Problem Miloš Hašan (Cornell University) Fabio Pellacini (Dartmouth College) Kavita Bala (Cornell University)
1 Advanced Scene Management System. 2 A tree-based or graph-based representation is good for 3D data management A tree-based or graph-based representation.
PQ, binary heaps G.Kamberova, Algorithms Priority Queue ADT Binary Heaps Gerda Kamberova Department of Computer Science Hofstra University.
Clustering. What is clustering? Grouping similar objects together and keeping dissimilar objects apart. In Information Retrieval, the cluster hypothesis.
Chapter 3: Cluster Analysis  3.1 Basic Concepts of Clustering  3.2 Partitioning Methods  3.3 Hierarchical Methods The Principle Agglomerative.
Computer Graphics 2 Lecture x: Acceleration Techniques for Ray-Tracing Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Data Structures for Computer Graphics Point Based Representations and Data Structures Lectured by Vlastimil Havran.
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
Chapter Tow Search Trees BY HUSSEIN SALIM QASIM WESAM HRBI FADHEEL CS 6310 ADVANCE DATA STRUCTURE AND ALGORITHM DR. ELISE DE DONCKER 1.
1 Single Scattering in Refractive Media with Triangle Mesh Boundaries Bruce Walter Shuang Zhao Nicolas Holzschuch Kavita Bala Cornell Univ. Grenoble Univ.
Hierarchical Clustering
On a Few Ray Tracing like Algorithms and Structures. -Ravi Prakash Kammaje -Swansea University.
Visible-Surface Detection Jehee Lee Seoul National University.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
PRESENTED BY – GAURANGI TILAK SHASHANK AGARWAL Collision Detection.
Sorting. Pseudocode of Insertion Sort Insertion Sort To sort array A[0..n-1], sort A[0..n-2] recursively and then insert A[n-1] in its proper place among.
Lossless Compression CIS 465 Multimedia. Compression Compression: the process of coding that will effectively reduce the total number of bits needed to.
Saarland University, Germany B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes Sven Woop Gerd Marmitt Philipp Slusallek.
Click to edit Master title style HCCMeshes: Hierarchical-Culling oriented Compact Meshes Tae-Joon Kim 1, Yongyoung Byun 1, Yongjin Kim 2, Bochang Moon.
Fast BVH Construction on GPUs (Eurographics 2009) Park, Soonchan KAIST (Korea Advanced Institute of Science and Technology)
Chapter 2: Basic Data Structures. Spring 2003CS 3152 Basic Data Structures Stacks Queues Vectors, Linked Lists Trees (Including Balanced Trees) Priority.
Hierarchical Penumbra Casting Samuli Laine Timo Aila Helsinki University of Technology Hybrid Graphics, Ltd.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
Marwan Al-Namari Hassan Al-Mathami. Indexing What is Indexing? Indexing is a mechanisms. Why we need to use Indexing? We used indexing to speed up access.
Chapter 11 Collision Detection 가상현실 입문 그래픽스 연구실 민성환.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
B-TREE. Motivation for B-Trees So far we have assumed that we can store an entire data structure in main memory What if we have so much data that it won’t.
Hierarchical Clustering
Ray Tracing Optimizations
Ray Tracing Acceleration (5). Ray Tracing Acceleration Techniques Too Slow! Uniform grids Spatial hierarchies K-D Octtree BSP Hierarchical grids Hierarchical.
Hierarchical clustering approaches for high-throughput data Colin Dewey BMI/CS 576 Fall 2015.
Data Structures and Algorithms Instructor: Tesfaye Guta [M.Sc.] Haramaya University.
1 Parallel Datacube Construction: Algorithms, Theoretical Analysis, and Experimental Evaluation Ruoming Jin Ge Yang Gagan Agrawal The Ohio State University.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach, Kumar Introduction.
Ontology Engineering and Feature Construction for Predicting Friendship Links in the Live Journal Social Network Author:Vikas Bahirwani 、 Doina Caragea.
Hierarchical Clustering
Ge Yang Ruoming Jin Gagan Agrawal The Ohio State University
Combining Edges and Points for Interactive High-Quality Rendering
Deformable Collision Detection
Real-Time Ray Tracing Stefan Popov.
Accelerated Single Ray Tracing for Wide Vector Units
Hierarchical and Ensemble Clustering
Hierarchical and Ensemble Clustering
Deformable Collision Detection
Presentation transcript:

Fast Agglomerative Clustering for Rendering Bruce Walter, Kavita Bala, Cornell University Milind Kulkarni, Keshav Pingali University of Texas, Austin

2 Clustering Tree Hierarchical data representation – Each node represents all elements in its subtree – Enables fast queries on large data – Tree quality = average query cost Examples – Bounding Volume Hierarchy (BVH) for ray casting – Light tree for Lightcuts PQRS

3 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

4 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

5 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

6 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

7 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

8 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS

9 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRS PQ

10 Tree Building Strategies Agglomerative (bottom-up) – Start with leaves and aggregate Divisive (top-down) – Start root and subdivide PQRSPQRS

11 Conventional Wisdom Agglomerative (bottom-up) – Best quality and most flexible – Slow to build - O(N 2 ) or worse? Divisive (top-down) – Good quality – Fast to build

12 Goal: Evaluate Agglomerative Is the build time prohibitively slow? – No, can be almost as fast as divisive – Much better than O(N 2 ) using two new algorithms Is the tree quality superior to divisive? – Often yes, equal to 35% better in our tests

13 Related Work Agglomerative clustering – Used in many different fields including data mining, compression, and bioinformatics [eg, Olson 95, Guha et al. 95, Eisen et al. 98, Jain et al. 99, Berkhin 02] Bounding Volume Hierarchies (BVH) – [eg, Goldsmith and Salmon 87, Wald et al. 07] Lightcuts – [eg, Walter et al. 05, Walter et al. 06, Miksik 07, Akerlund et al. 07, Herzog et al. 08]

14 Overview How to implement agglomerative clustering – Naive O(N 3 ) algorithm – Heap-based algorithm – Locally-ordered algorithm Evaluating agglomerative clustering – Bounding volume hierarchies – Lightcuts Conclusion

15 Agglomerative Basics Inputs – N elements – Dissimilarity function, d(A,B) Definitions – A cluster is a set of elements – Active cluster is one that is not yet part of a larger cluster Greedy Algorithm – Combine two most similar active clusters and repeat

16 Dissimilarity Function d(A,B): pairs of clusters  real number – Measures “cost” of combining two clusters – Assumed symmetric but otherwise arbitrary – Simple examples: Maximum distance between elements in A+B Volume of convex hull of A+B Distance between centroids of A and B

17 Naive O(N 3 ) Algorithm Repeat { Evaluate all possible active cluster pairs Select one with smallest d(A,B) value Create new cluster C = A+B } until only one active cluster left Simple to write but very inefficient!

18 Naive O(N 3 ) Algorithm Example P U Q R T S

19 Naive O(N 3 ) Algorithm Example P U Q R T S

20 Naive O(N 3 ) Algorithm Example P U Q R T S

21 Naive O(N 3 ) Algorithm Example PQ U R T S

22 Naive O(N 3 ) Algorithm Example PQ U R T S

23 Naive O(N 3 ) Algorithm Example PQ U R T S

24 Naive O(N 3 ) Algorithm Example PQ U RS T

25 Acceleration Structures KD-Tree – Finds best match for a cluster in sub-linear time – Is itself a cluster tree Heap – Stores best match for each cluster – Enables reuse of partial results across iterations – Lazily updated for better performance

26 Heap-based Algorithm Initialize KD-Tree with elements Initialize heap with best match for each element Repeat { Remove best pair from heap If A and B are active clusters { Create new cluster C = A+B Update KD-Tree, removing A and B and inserting C Use KD-Tree to find best match for C and insert into heap } else if A is active cluster { Use KD-Tree to find best match for A and insert into heap } } until only one active cluster left

27 Heap-based Algorithm Example P U Q R T S

28 Heap-based Algorithm Example P U Q R T S

29 Heap-based Algorithm Example P U Q R T S

30 Heap-based Algorithm Example U R T S PQ

31 Heap-based Algorithm Example PQ U R T S

32 Heap-based Algorithm Example PQ U R T S

33 Heap-based Algorithm Example PQ U RS T

34 Locally-ordered Insight Can build the exactly same tree in different order How can we use this insight? – If d(A,B) is non-decreasing, meaning d(A,B) <= d(A,B+C) – And A and B are each others best match – Greedy algorithm must cluster A and B eventually – So cluster them together immediately PQRS 12 3 PQRS 21 3 =

35 Locally-ordered Algorithm Initialize KD-Tree with elements Select an element A and find its best match B using KD-Tree Repeat { Let C = best match for B using KD-Tree If d(A,B) == d(B,C) { //usually means A==C Create new cluster D = A+B Update KD-Tree, removing A and B and inserting D Let A = D and B = best match for D using KD-Tree } else { Let A = B and B = C } } until only one active cluster left

36 Locally-ordered Algorithm Example P U Q R T S

37 Locally-ordered Algorithm Example P U Q R T S

38 Locally-ordered Algorithm Example P U Q R T S

39 Locally-ordered Algorithm Example P U Q R T S

40 Locally-ordered Algorithm Example P U Q R T S

41 Locally-ordered Algorithm Example P U Q RS T

42 Locally-ordered Algorithm Example P U Q RS T

43 Locally-ordered Algorithm Example P U Q RS T

44 Locally-ordered Algorithm Example P U Q RS T

45 Locally-ordered Algorithm Example P U Q RS T

46 Locally-ordered Algorithm Example PQ U RS T

47 Locally-ordered Algorithm Roughly 2x faster than heap-based algorithm – Eliminates heap – Better memory locality – Easier to parallelize – But d(A,B) must be non-decreasing

48 Results: BVH BVH – Binary tree of axis-aligned bounding boxes Divisive [from Wald 07] – Evaluate 16 candidate splits along longest axis per step – Surface area heuristic used to select best one Agglomerative – d(A,B) = surface area of bounding box of A+B Used Java 1.6JVM on 3GHz Core2 with 4 cores – No SIMD optimizations, packets tracing, etc.

49 Results: BVH Kitchen TableauGCT Temple

50 Results: BVH Surface area heuristic with triangle cost = 1 and box cost = 0.5

51 Results: BVH 1280x960 Image with 16 eye and 16 shadow rays per pixel, without build time

52 Lightcuts Key Concepts Unified representation – Convert all lights to points ~200,000 in examples Build light tree – Originally agglomerative Adaptive cut – Partitions lights into clusters – Cutsize = # nodes on cut Cut Light Tree Lights

53 Lightcuts Divisive – Split middle of largest axis – Two versions 3D – considers spatial position only 6D – considers position and direction Agglomerative – New dissimilarity function, d(A,B) Considers position, direction, and intensity

54 Results: Lightcuts 640x480 image with 16x antialiasing and ~200,000 point lights

55 Results: Lightcuts 640x480 image with 16x antialiasing and ~200,000 point lights

56 Results: Lightcuts Kitchen model with varying numbers of indirect lights

57 Conclusions Agglomerative clustering is a viable alternative – Two novel fast construction algorithms Heap-based algorithm Locally-ordered algorithm – Tree quality is often superior to divisive – Dissimilarity function d(A,B) is very flexible Future work – Find more applications that can leverage this flexibility

58 Acknowledgements Modelers – Jeremiah Fairbanks, Moreno Piccolotto, Veronica Sundstedt & Bristol Graphics Group, Support – NSF, IBM, Intel, Microsoft