chapter 2, part 2 relaxation - ucla statisticssczhu/courses/ucla/stat_232b/handouts/... · 2013. 4....

16
1 Chapter 2, part 2 relaxation Chapter 2 covers topics to study the typical problems, data structures, and algorithms for inferring hierarchical and flat models. Part 1: Search on hierarchical Generative representations Heuristic search algorithms on And-Or graphs -– Best First Search, A*, Generalized Best First Search. Part 2: Search on flat descriptive representations 2.1 Relaxation algorithm on line drawing interpretations 22 Belief propagation on poly-trees Stat 232B Statistical Computing and Inference in Vision S.C. Zhu 2.2 Belief propagation on poly-trees 2.3 Dynamic programming on chains. Relaxation in a flat graph Common properties: 1. A graph representation G=<V, E>. G could be directed undirected such as chain tree DAG lattice etc G could be directed, undirected, such as chain, tree, DAG, lattice, etc. 2. hard constraints or soft “energy” preference between adjacent vertices. candidate label x i Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Examples: constraint-and-satisfaction, line drawings, graph partition/coloring, Turbo coding, image segmentation, scene labeling, … site i label x i

Upload: others

Post on 30-Dec-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

1

Chapter 2, part 2 relaxation

Chapter 2 covers topics to study the typical problems, data structures, and algorithmsfor inferring hierarchical and flat models.

Part 1: Search on hierarchical Generative representationsHeuristic search algorithms on And-Or graphs

-– Best First Search, A*, Generalized Best First Search.

Part 2: Search on flat descriptive representations2.1 Relaxation algorithm on line drawing interpretations 2 2 Belief propagation on poly-trees

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

2.2 Belief propagation on poly-trees2.3 Dynamic programming on chains.

Relaxation in a flat graph

Common properties:1. A graph representation G=<V, E>.

G could be directed undirected such as chain tree DAG lattice etcG could be directed, undirected, such as chain, tree, DAG, lattice, etc.

2. hard constraints or soft “energy” preference between adjacent vertices.

candidatelabel xi

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Examples: constraint-and-satisfaction, line drawings, graph partition/coloring, Turbo coding,image segmentation, scene labeling, …

site i

label xi

Page 2: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

2

Ex 1: Symbolic interpretation of line drawings (Waltz, 1960s)

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Labeling the lines with 4 symbols

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 3: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

3

Excluding accidental views

Accidental views cause alignments(lines or junctions) which are unstable.

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Examples of impossible realizations of corner by 3 faced object junctions

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 4: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

4

Finding all allowable junctions by considering all combinations of cubes in 8 quadrants in 3D

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

This is to exhaust all possible cases, all other non-accidental junctionswill be equivalent to one of these junctions.

Finding all allowable junctions by considering all combinations of cubes in 8 quadrants in 3D

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 5: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

5

All allowable 2-way / 3-way junctions

18 valid junctions out of208 possible combinations

(208= 16 + 64 + 64 + 64)

Remarks: in general vision modeling, the space of parts/objects/scenes is combinatorial,but the true elements in real world is tiny.This leads to huge constraints as in linedrawing interpretation.

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

For an alternative way, one may manually labela number of representative block objects andthen find the valid junctions from the label. Thismay not be exhaustive but is quite effective.In vision, we find vocabulary/elements this wayAs we couldn’t possibly enumerate all cases.

Finding a valid interpretation through relaxation:constraints-and-satisfaction

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 6: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

6

Finding a valid interpretation through relaxation:constraints-and-satisfaction

Note that what we compute hereis still candidate labels at eachis still candidate labels at eachvertex. When you have multipleways to label an object, then we have to extract the solution.

Discussion:

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

marginal beliefs vs. joint solutions

More complex labeling scheme by Waltz

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 7: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

7

Ex 2: 3D line drawing interpretation (Marill 91, Leclerc-Fishler’92)

1, Real 3D shapes2, Soft-energy

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

The energy function to optimize

SDA enforces equal angelsSDA stands for the standard deviation of

DP enforces co-planarityfor angels in each face.

SDA enforces equal angelsat each 3D vertex (thus toreach symmetry.

SDA stands for the standard deviation ofall angles at a vertex.

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 8: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

8

A typical result

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

More recent work on space reasoning on real images

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Results from Yibiao Zhao, UCLA 2011.other reference: Lee, Gupta, Hebert and Kanade, Estimating spatial layout of rooms using

volumtric reasoning about objects and surfaces, NIPS 2010.

Page 9: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

9

Ex 3: Belief propagation

b(x) = p(e- | x) p(x | e+) = (x) (x)

In a Markov chain representation

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

BP is equivalent to DP in a chain

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 10: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

10

on a flat graph (no-loop)

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Message passing

Belief is the marginal posterior probability of a node x over all evidence e

b(x) = prob(x | e) = p(e- | x) p(x | e+) = (x) (x)

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 11: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

11

BP on Factor Graphs

, , , , , , , ,f x y z w v x y z z w z v

x

y

z

w

v

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

y

• The messages sent across the edges are the “local” marginal pdfs.

• The marginal pdf of z is the multiplication of all incoming messages

Belief Propagation Algorithm

x

y

z

w

v

~ \

z az a N z

m X m

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

\z f z

f N z

m m

Page 12: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

12

• Nodes generate messages and send them to their neighbors

• BP provides the right answer if the graph has no loops

Belief Propagation

p g g p p

• Message propagation schedule is well defined

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Loopy BP

• If graph has loops:– BP is no longer guaranteed to converge

– If it converges it is not necessarily to the right answer

– BP becomes an iterative algorithm where the message passing schedule is not well defined

• However, loopy BP has been shown to perform very well for many applications

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Page 13: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

13

Visiting order of nodes in the flat graph

The visiting order (scheduling) is an interesting problemThe visiting order (scheduling) is an interesting problem.

1, Discuss the case of global constraints and random belief updates

2, The visiting order in an And-Or graph can also be formulated in aBP algorithm.

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Example: applying BP to channel coding

A binary-channel code can be seen as a constraint-and –satisfaction problem

(example from Dr. Andres I. Vila Casado EE, UCLA)

x1

x

x2 c11 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

1 0 1 0 1

1 1 1 1 0

c1

c2

x1 x2 x3 x4 x5

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

x4

x5

x3

c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

0 1 1 1 1c3

c2

Each row is a constraint

Page 14: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

14

Loopy BP for Channel decoding

Global function is the joint-probability of the received signal y and the true codeword x

1 1 1 1 1,..., , ,..., ,..., ,..., ,...,n n n n np x x y y p x x p y y x x

n

n

1 1 11

,..., , ,..., ,...,n n n i ii

p x x y y x x p y x

C 1 11

,..., ,...,n

n n i ii

p y y x x p y x

x1

x3

x2 c1

c

y1

y3

y2

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

x4

x5

3

c3

c2

y4

y5

y3

(Vila Casado)

Message-passing scheduling problem

How to schedule the message-passing algorithm in decoding?Pre-determined scheduling:

FloodingStandard Sequential Scheduling

Informed Dynamic Scheduling (IDS): Use the current state of messages in the graph to find

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

g g pthe next message to be propagated

(Vila Casado)

Page 15: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

15

Simultaneous (Flooding) Schedule

On every iteration– All variable nodes are simultaneously updated– All check nodes are simultaneously updated

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

(Vila Casado)

Standard Sequential Schedule (SSS)

Update messages sequentially:

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

(Vila Casado)

Page 16: Chapter 2, part 2 relaxation - UCLA Statisticssczhu/Courses/UCLA/Stat_232B/Handouts/... · 2013. 4. 4. · Stat 232B Statistical Computing and Inference in Vision S.C. Zhu Example:

16

100

Eb/No = 1.75 dB

Simultaneous (Flooding)LBP

Speed comparison

10-3

10-2

10-1

FE

R

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

31

0 5 10 15 20 25 30 35 40 45 5010

-4

Iterations

Andres I. Vila Casado, UCLA

Historical Milestones

Line drawing labeling (Waltz, 1972)

Relaxation-Labeling algorithm (Rosenfeld, Hummel and Zucker, 1976)

Belief propagation (Pearl, 1982)

Gibbs sampler (Geman and Geman, 1984)

Cluster sampling (Swendsen-Wang,1987)

For special cases: On Chains:

D i i

Stat 232B Statistical Computing and Inference in Vision S.C. Zhu

Dynamic programming (Bellman 1957)

= Belief propagation = Exact sampling (Gibbs sampler)