Download - Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Transcript
Page 1: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov/Graph Cuts

Alireza Shafaei

University of British Columbia

August, 2015

1 / 30

Page 2: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For a general chain-structured UGM we have:

p(x1, x2, . . . , xn) ∝n∏

i=1

φi(xi)

n∏i=2

φi,i−1(xi, xi−1),

X1 X2 X3 X4 X5 X6 X7

In this case we only have local Markov property,

xi ⊥ x1, . . . , xi−2, xi+2, . . . , xn|xi−1, xi+1,

Local Markov property in general UGMs:

given neighbours, conditional independence of other nodes.(Marginal independence corresponds to reachability.)

2 / 30

Page 3: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For a general chain-structured UGM we have:

p(x1, x2, . . . , xn) ∝n∏

i=1

φi(xi)

n∏i=2

φi,i−1(xi, xi−1),

X1 X2 X3 X4 X5 X6 X7

In this case we only have local Markov property,

xi ⊥ x1, . . . , xi−2, xi+2, . . . , xn|xi−1, xi+1,

Local Markov property in general UGMs:

given neighbours, conditional independence of other nodes.(Marginal independence corresponds to reachability.)

2 / 30

Page 4: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the Viterbi decodingalgorithm.

Forward phase:

V1,s = φ1(s), Vi,s = maxs′{φi(s)φi,i−1(s, s

′)Vi−1,s′},

Backward phase: backtrack through argmax values.Solves the decoding problem in O(ns2) instead of O(sn).

3 / 30

Page 5: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the Viterbi decodingalgorithm.

Forward phase:

V1,s = φ1(s), Vi,s = maxs′{φi(s)φi,i−1(s, s

′)Vi−1,s′},

Backward phase: backtrack through argmax values.Solves the decoding problem in O(ns2) instead of O(sn).

3 / 30

Page 6: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For inference in chain-structured UGMs we learned theforward-backward algorithm.

1 Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s =∑s′

φi(s)φi,i−1(s, s′)Vi−1,s′ , Z =

∑s

Vn,s.

2 Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′

φi+1(s′)φi+1,i(s

′, s)Bi+1,s′ .

3 Marginals are given by p(xi = s) ∝ Vi,sBi,s.

4 / 30

Page 7: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For inference in chain-structured UGMs we learned theforward-backward algorithm.

1 Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s =∑s′

φi(s)φi,i−1(s, s′)Vi−1,s′ , Z =

∑s

Vn,s.

2 Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′

φi+1(s′)φi+1,i(s

′, s)Bi+1,s′ .

3 Marginals are given by p(xi = s) ∝ Vi,sBi,s.

4 / 30

Page 8: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For inference in chain-structured UGMs we learned theforward-backward algorithm.

1 Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s =∑s′

φi(s)φi,i−1(s, s′)Vi−1,s′ , Z =

∑s

Vn,s.

2 Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′

φi+1(s′)φi+1,i(s

′, s)Bi+1,s′ .

3 Marginals are given by p(xi = s) ∝ Vi,sBi,s.

4 / 30

Page 9: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For inference in chain-structured UGMs we learned theforward-backward algorithm.

1 Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s =∑s′

φi(s)φi,i−1(s, s′)Vi−1,s′ , Z =

∑s

Vn,s.

2 Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′

φi+1(s′)φi+1,i(s

′, s)Bi+1,s′ .

3 Marginals are given by p(xi = s) ∝ Vi,sBi,s.

4 / 30

Page 10: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.Binary and attractive state UGMs.

5 / 30

Page 11: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.Binary and attractive state UGMs.

5 / 30

Page 12: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.Binary and attractive state UGMs.

5 / 30

Page 13: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.Binary and attractive state UGMs.

5 / 30

Page 14: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.

Binary and attractive state UGMs.

5 / 30

Page 15: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

A Quick Review

For chain-structured UGMs we learned the forward-backwardand Viterbi algorithm.

The same idea was generalized for tree-structured UGMs.

For graphs with small cutset we learned the Cutset Conditioningmethod.

For graphs with small tree-width we learned the Junction Treemethod.

Two more group of problems that we can deal with exactly inpolynomial time.

Semi-Markov chain-structured UGMs.Binary and attractive state UGMs.

5 / 30

Page 16: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Local Markov property in general chain-structured UGMs:

Given neighbours, we have conditional independence of othernodes.

In Semi-Markov chain-structured models:

Given neighbours and their lengths, we have conditionalindependence of other nodes.

A subsequence of nodes can have the same state.

You can encourage smoothness.

Useful when you wish to keep track of how long you have beenstaying on the same state.

6 / 30

Page 17: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Local Markov property in general chain-structured UGMs:

Given neighbours, we have conditional independence of othernodes.

In Semi-Markov chain-structured models:

Given neighbours and their lengths, we have conditionalindependence of other nodes.

A subsequence of nodes can have the same state.

You can encourage smoothness.

Useful when you wish to keep track of how long you have beenstaying on the same state.

6 / 30

Page 18: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Local Markov property in general chain-structured UGMs:

Given neighbours, we have conditional independence of othernodes.

In Semi-Markov chain-structured models:

Given neighbours and their lengths, we have conditionalindependence of other nodes.

A subsequence of nodes can have the same state.

You can encourage smoothness.

Useful when you wish to keep track of how long you have beenstaying on the same state.

6 / 30

Page 19: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Local Markov property in general chain-structured UGMs:

Given neighbours, we have conditional independence of othernodes.

In Semi-Markov chain-structured models:

Given neighbours and their lengths, we have conditionalindependence of other nodes.

A subsequence of nodes can have the same state.

You can encourage smoothness.

Useful when you wish to keep track of how long you have beenstaying on the same state.

6 / 30

Page 20: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Previously, the potential of each edge was a function ofneighboring vertices φi,i−1(s, s′).

In Semi-Markov chain-structured models we define the potentialas φi,i−1(s, s′, l)

The potential of making a transition from s′ to s after l steps.

You can encourage staying in certain states for a period of time.

7 / 30

Page 21: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Previously, the potential of each edge was a function ofneighboring vertices φi,i−1(s, s′).

In Semi-Markov chain-structured models we define the potentialas φi,i−1(s, s′, l)

The potential of making a transition from s′ to s after l steps.

You can encourage staying in certain states for a period of time.

7 / 30

Page 22: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Previously, the potential of each edge was a function ofneighboring vertices φi,i−1(s, s′).

In Semi-Markov chain-structured models we define the potentialas φi,i−1(s, s′, l)

The potential of making a transition from s′ to s after l steps.

You can encourage staying in certain states for a period of time.

7 / 30

Page 23: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Semi-Markov chain-structured UGMs

Previously, the potential of each edge was a function ofneighboring vertices φi,i−1(s, s′).

In Semi-Markov chain-structured models we define the potentialas φi,i−1(s, s′, l)

The potential of making a transition from s′ to s after l steps.

You can encourage staying in certain states for a period of time.

7 / 30

Page 24: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 25: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 26: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 27: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 28: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 29: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Decoding the Semi-Markov chain-structured UGMs

Let us look at the Viterbi decoding again:

V1,s = φ1(s), Vi,s = φi(s) ·maxs′{φi,i−1(s, s′) · Vi−1,s′},

How can we update the formula to solve Semi-Markov chainstructures?

V1,s = φ1(s), Vi,s = φi(s) ·maxs′,l{φi,i−1(s, s′, l) · Vi−l,s′},

Depending on the application we can bound the maximumpossible value of l to be L.

For the unbounded case, L is simply n, the total length of chain.

Note that it is different from having an order-L Markov chain(why?).

8 / 30

Page 30: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Inference in the Semi-Markov chain-structured UGMs

Forward-backward algorithm for the Semi-Markov models:

Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s = φi(s)·∑s′,l

φi,i−1(s, s′, l)Vi−l,s′ , Z =

∑s

Vn,s.

Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′,l

φi+1(s′)φi+1,i(s

′, s, l)Bi+l,s′ .

Marginals are given by p(xi = s) ∝ Vi,sBi,s.

Questions?

9 / 30

Page 31: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Inference in the Semi-Markov chain-structured UGMs

Forward-backward algorithm for the Semi-Markov models:

Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s = φi(s)·∑s′,l

φi,i−1(s, s′, l)Vi−l,s′ , Z =

∑s

Vn,s.

Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′,l

φi+1(s′)φi+1,i(s

′, s, l)Bi+l,s′ .

Marginals are given by p(xi = s) ∝ Vi,sBi,s.

Questions?

9 / 30

Page 32: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Inference in the Semi-Markov chain-structured UGMs

Forward-backward algorithm for the Semi-Markov models:

Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s = φi(s)·∑s′,l

φi,i−1(s, s′, l)Vi−l,s′ , Z =

∑s

Vn,s.

Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′,l

φi+1(s′)φi+1,i(s

′, s, l)Bi+l,s′ .

Marginals are given by p(xi = s) ∝ Vi,sBi,s.

Questions?

9 / 30

Page 33: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Inference in the Semi-Markov chain-structured UGMs

Forward-backward algorithm for the Semi-Markov models:

Forward phase (sums up paths from the beginning):

V1,s = φ1(s), Vi,s = φi(s)·∑s′,l

φi,i−1(s, s′, l)Vi−l,s′ , Z =

∑s

Vn,s.

Backward phase: (sums up paths to the end):

Bn,s = 1, Bi,s =∑s′,l

φi+1(s′)φi+1,i(s

′, s, l)Bi+l,s′ .

Marginals are given by p(xi = s) ∝ Vi,sBi,s.

Questions?

9 / 30

Page 34: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 35: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 36: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 37: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.

2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 38: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 39: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 40: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 41: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 42: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 43: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Solving with graph cuts

Restricting the structure of graph is just one way to simplify ourtasks.

We can also restrict the potentials.

Here we look at a group of pairwise UGMs with the followingrestrictions:

1 Binary variables.2 Pairwise potential makes a submodular problem.

Can be decoded by reformulation as a Max-Flow problem.

Can be generalized to non-binary cases.

Can be 2-approximated when not submodular (under a differentconstraint).

In the general case it is known to be NP-Hard.

The following material is borrowed from Simon Prince’s (@UCL)slides. Available at computervisionmodels.com

10 / 30

Page 44: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The Max-Flow problem

The goal is to push as much ’flow’ as possible through thedirected graph from the source to the sink.Cannot exceed the (non-negative) capacities Cij associated witheach edge.

11 / 30

Page 45: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The Max-Flow problem

The goal is to push as much ’flow’ as possible through thedirected graph from the source to the sink.

Cannot exceed the (non-negative) capacities Cij associated witheach edge.

11 / 30

Page 46: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The Max-Flow problem

The goal is to push as much ’flow’ as possible through thedirected graph from the source to the sink.Cannot exceed the (non-negative) capacities Cij associated witheach edge.

11 / 30

Page 47: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Saturation

When we push the maximum flow from source to sink:

There must be at least one saturated edge on any path fromsource to sink, otherwise you can push more flow.

The set of saturated edges hence separate the source and sink.This set is simultaneously the min-cut and the max-flow.

12 / 30

Page 48: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Saturation

When we push the maximum flow from source to sink:

There must be at least one saturated edge on any path fromsource to sink, otherwise you can push more flow.The set of saturated edges hence separate the source and sink.

This set is simultaneously the min-cut and the max-flow.

12 / 30

Page 49: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Saturation

When we push the maximum flow from source to sink:

There must be at least one saturated edge on any path fromsource to sink, otherwise you can push more flow.The set of saturated edges hence separate the source and sink.This set is simultaneously the min-cut and the max-flow.

12 / 30

Page 50: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

Two numbers are: current flow/ total capacity

13 / 30

Page 51: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

Chose any path from source to sink with spare capacity andpush as much flow as possible.

14 / 30

Page 52: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

15 / 30

Page 53: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

16 / 30

Page 54: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

17 / 30

Page 55: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

18 / 30

Page 56: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

No further ‘augmenting path’ exists.

19 / 30

Page 57: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

An example

The saturated edges partition the graph into two subgraphs.

20 / 30

Page 58: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

In the simplest form, let us constrain the pairwise potentials foradjacent nodes m,n to be:

φm,n(0, 0) = φm,n(1, 1) = 0.φm,n(1, 0) = θ10.φm,n(0, 1) = θ01.

Will make a graph such that each cut corresponds to aconfiguration.

21 / 30

Page 59: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

In the simplest form, let us constrain the pairwise potentials foradjacent nodes m,n to be:

φm,n(0, 0) = φm,n(1, 1) = 0.φm,n(1, 0) = θ10.φm,n(0, 1) = θ01.

Will make a graph such that each cut corresponds to aconfiguration.

21 / 30

Page 60: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

22 / 30

Page 61: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

23 / 30

Page 62: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

24 / 30

Page 63: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

25 / 30

Page 64: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

In the general case:

Constraint θ10 + θ01 > θ11 + θ00 (attraction).

If met, the problem is called “submodular” and we can solve it inpolynomial time.

26 / 30

Page 65: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

In the general case:

Constraint θ10 + θ01 > θ11 + θ00 (attraction).

If met, the problem is called “submodular” and we can solve it inpolynomial time.

26 / 30

Page 66: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

The binary MRFs

In the general case:

Constraint θ10 + θ01 > θ11 + θ00 (attraction).

If met, the problem is called “submodular” and we can solve it inpolynomial time.

26 / 30

Page 67: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Other cases

27 / 30

Page 68: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Other cases

27 / 30

Page 69: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Other cases

Another type of constraint allows approximate solutions.

if the pairwise potential is a metric

Alpha Expansion Algorithm (next week) uses the max-flow ideaas a subroutine to do coordinate descent in the label space.

28 / 30

Page 70: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Other cases

Another type of constraint allows approximate solutions.

if the pairwise potential is a metric

Alpha Expansion Algorithm (next week) uses the max-flow ideaas a subroutine to do coordinate descent in the label space.

28 / 30

Page 71: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Other cases

Another type of constraint allows approximate solutions.

if the pairwise potential is a metric

Alpha Expansion Algorithm (next week) uses the max-flow ideaas a subroutine to do coordinate descent in the label space.

28 / 30

Page 72: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.Exact solution in multi-label case if submodular.Approximate solution in multi-label case if a metric.

29 / 30

Page 73: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.Exact solution in multi-label case if submodular.Approximate solution in multi-label case if a metric.

29 / 30

Page 74: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.Exact solution in multi-label case if submodular.Approximate solution in multi-label case if a metric.

29 / 30

Page 75: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.

Exact solution in multi-label case if submodular.Approximate solution in multi-label case if a metric.

29 / 30

Page 76: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.Exact solution in multi-label case if submodular.

Approximate solution in multi-label case if a metric.

29 / 30

Page 77: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Conclusion

Decoding and inference is still efficient with Semi-Markovmodels.

Useful if need to control the length of each state over a sequence.

Graph cuts help with decoding on models with pairwisepotentials.

Exact solution in binary case if submodular.Exact solution in multi-label case if submodular.Approximate solution in multi-label case if a metric.

29 / 30

Page 78: Semi-Markov/Graph Cuts · For inference inchain-structuredUGMs we learned the forward-backwardalgorithm. 1 Forward phase (sums up paths from the beginning): V 1;s = ...

Thank you!

Questions?

30 / 30