an applied introduction - aminer...spectral graph theory an applied introduction in lectures on...

51
Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008

Upload: others

Post on 07-Jun-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Spectral graph theory

An applied introduction In Lectures on Structural Pattern Recognition @ PRIP

Ernst Schwartz 05/07/2008

Page 2: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Overview   Theory 1: Adjacency, Laplacian,

Eigendecomposition   Applications 1: Embeddings, object retrieval

  Theory 2: Normalized Laplacian   Applications 2: Segmentation, Manifold learning

  Theory 3: Random Walks   Applications 3: Manifold learning, PageRank

  Conclusions

Page 3: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Theory 1: Adjacency, Laplacian, Graph spectrum

 Many ways to represent a graph  Many ways to describe a graph (number of

edges, degree, regularity, ...)  How to gather the most discriminative

information?

Page 4: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Basic notions about graphs   Pairwise affinity

some distance measure for weighting the edges of the graph based on an embedding of the nodes.

For example   Node volume

  Volume of a cluster

  Cut between 2 clusters

Page 5: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Adjacency matrix

G is a simple graph, meaning there are no self edges (E) and at most one edge between two nodes (V)

The corresponding (weighted) adjacency matrix is defined as

Page 6: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Laplacian matrix

with D as the diagonal matrix with D(i,i) = di:

Where di is equal to the degree of the node (eg. the number of edges at that node)

if all weights are 1 (eg. the graph is unweighted) or equal to the volume of the node as seen before

Page 7: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Laplacian matrix

 Describes gradient on the graph

 Strong connection to differential geometry: discrete version of the Laplace-Beltrami operator on manifolds

Page 8: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

A (very) simple example

# Adjacency

Laplacian

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

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

(vertices are numbered from 1 to 12)

Page 9: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Eigendecomposition

Computing eigenvalues and eigenvectors of a matrix.

Corresponds to factorizing the matrix into a canonical form.

scalars (eigenvalues)

(eigen)vectors

The following is imposed on the eigenvectors:

Page 10: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

A (very) simple example

First four and the last

(eg. ordered by their corresponding eigenvalues)

eigenvector (values of every dimension)

(no vertex information...)

Page 11: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Recap 1

Laplacian strongly connected to gradient

Continuous analogue: Laplace-Beltrami (heat) operator

Page 12: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: spectral embedding

 The eigenvectors of the laplacian can be used to compute a (allmost) planar embedding of a mesh.

 No information on the vertices is needed, the embedding is based solely on the connectivity of the mesh.

Page 13: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Original mesh

gplot(A, V)

Page 14: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Spectral embedding

L = diag(sum(A)) - A; [v d] = eigs(L); gpolt(A, v(:,[1 2]));

Page 15: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: Object retrieval

  (Deduce mesh from binary image: shock graphs)

 Use spectral information for similarity measures between datasets

 Usefull for image retrieval, classification, ...

Page 16: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Object retrieval

© Jain & Zhang

Page 17: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: Brain surface flattening

© Angenent & Haker

Page 18: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Theory 2: Normalized Laplacian

  Laplacian is more informative than the adjacency matrix

 Sometimes cumbersome calculations

 Solution: normalized laplacian !

 Usefull mathematical properties ...

Page 19: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Definition

Page 20: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Properties of the normalized laplacian

Page 21: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Cheegers inequality

Conductance of a vertex set:

Volume of a set of edges joining two subsets:

Conductance of a graph:

Page 22: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Recap 2

  is a very expressive value

 Approximation using Cheeger‘s inequality

 Eigenvalues contain global information about the mesh

Page 23: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: Image segmentation

 Generate a graph representation from an image (see last week‘s lecture)

 Find „best“ cuts in that graph

 Spectral interpretation of a „good“ cut: normalized cuts.

Page 24: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized cuts uses the quantity

called the „Normalized Cut“

Normalized Cuts

Define the volume of a set of vertices S as

Page 25: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized Cuts

 Compute eigendecomposition of Laplacian

 Set V = [v1, v2, v3 ... , vk]

 View each row of V as a point in Rk ; cluster into k clusters using k-means ( )

Page 26: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized Cuts

Page 27: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized Cuts

Page 28: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized Cuts

Page 29: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Normalized Cuts

Page 30: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: Manifold learning

 New framework for dimensionality reduction  Based on the assumption of an underlying

manifold  Model this manifold implicitly using graph

techniques  Use spectral methods to measure the quality

of the embedding

Page 31: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

?

Page 32: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

?

Page 33: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

?

(semi-supervised learning)

Page 34: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

 What is needed is a way to compute the (geodesic) distance on the data

 For this, we need to be able to describe the structure of the manifold

 Use eigendecomposition of the laplacian !

 Represents geodesic distance !

Page 35: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

How to measure distances ? „swiss roll“ dataset With vertices in 3 dimensions

Page 36: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

Build graph based on k-nns !

Page 37: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Manifold learning

Use spectral embedding using first eigenvectors

First eigenvector

Sec

ond

eige

nvec

tor

Page 38: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Theory 3: Random Walks on graphs

 Use graph structure as a model for a statistical process

 Vertices are states in the system  Edges are transition probabilities for going

from one state to another  Only a small change to the Laplacian

formulation  Good statistical tools available

Page 39: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Definitions

Walk matrix

Taking one step in the walk

Normalized walk matrix

Page 40: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Interesting values of a random walk

 Access/hitting time: expected number of steps before node j is visited

 Commute time expected number of steps in a random walk starting at i, going to j and then back to i

 Cover time expected number of steps to reach every node

 Mixing rate how fast the random walk converges to it‘s limiting distribution

Page 41: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

 Access time:

 Commute time:

 Mixing rate:

Spectral computation of graph properties

Page 42: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Recap

 Random walks are a tool for statistical modelling

 Properties can easily be deduced from eigendecomposition

Page 43: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Application: Manifold Learning 2

 Concept: Diffusion on a graph  Propagate a state according to the

connectivity  Discrete time steps equivalent to multiple

resolution analysis  More resistant to noise  Usefull for dimensionality reduction,

segmentation, classification, ...

Page 44: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Diffusion maps

© Coifman & Lafon

Idea: map graph distances to euclidean distances

Use random walks for noise robustness

Very general framework; can be interpreted as

Stochastic differential equations, Graph theoretical methods Physical processes (heat kernel) ...

Connection to kernel methods (!)

Page 45: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Diffusion maps   Based on random walk   Definition of a diffusion distance   Describes distance between points in terms of their

connectivity   Use eigendecomposition to find embedding in euclidean

space (= diffusion maps)   Probability to be in state x at time k can be approximated

using eigendecomposition   More robust to noise due because more robust to

outliers   Extensions: diffusion wavelets using different kernel

sizes

Page 46: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

PageRank

© Page & Brim

Page 47: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Recap: Operators on graphs

Operator Spectrum

Adjacency: A

Laplacian: D - A

Normalized Laplacian: I - D-1/2AD-1/2 Random Walk: D-1A

Note: why consider the adjacency as an operator? A1 => nodes reachable from another in one step An => nodes reachable from another in n steps => can be interpreted as an operator on the graph

Page 48: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Conclusions   Tools for graph processing: laplacian & it‘s

eigendecomposition, random walks, diffusions

  All data is structured (even if we don‘t know how)!   Use graphs to represent the underlying structure   Use spectral analysis to find modes of the data.

  Note: classical uses in network analysis... not covered here

Page 49: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Bibliography   Videolectures.net (!!)

  http://videolectures.net/mlcued08_azran_mcl/ Spectral clustering (50min)

  http://videolectures.net/sicgt07_belkin_gmagod/ Graph methods and geometry of data (55min)

  http://videolectures.net/gbr07_hancock_gsis/ Spectral image smoothing (27min)

  http://videolectures.net/mlss05us_nadler_dmscr/ Diffusion maps (55min)

  http://videolectures.net/aop05_hancock_pagt/ Pattern analysis with graphs and trees (120min)

Page 50: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Bibliography   Fan R. Chung; Spectral Graph Theory

(chapters 1-4 online at http://www.math.ucsd.edu/~fan/research/revised.html )

  Daniel Spielman; Spectral Graph Theory and its Applications (online with Matlab code at http://www.cs.yale.edu/homes/spielman/sgta/)

  L. Lovász; Random Walks on Graphs; A Survey   Mauro Maggioni; diffusion maps (matlab code)

http://www.math.duke.edu/~mauro/

Page 51: An applied introduction - AMiner...Spectral graph theory An applied introduction In Lectures on Structural Pattern Recognition @ PRIP Ernst Schwartz 05/07/2008 Overview Theory 1: Adjacency,

Bibliography   Angenent & Haker; On the Laplacian-Beltrami

Operator for Brain Surface flattening   Shi & Malik; Normalized Cuts and Image

Segmentation   Jain & Zhang; A Spectral Approach to Shape-Based

Retrieval of Articulated 3D Models   Cayton; Algorithms for Manifold Learning   Coifmann & Lafon; Diffusion Maps   Page & Brim; The PageRank Citation Ranking:

Bringing Order to the Web