Top Banner
This work was supported bu EU projects FP7- ICT-247870 NIFTi and FP7-ICT-247525 HUMAVIPS and the Czech project 1M0567 CAK 25-27 July, 2011 EMMCVPR Center for Machine Perception Czech Technical University in Prague A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push- Relabel Alexander Shekhovtsov and Václav Hlaváč [email protected], [email protected]
42

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel

Mar 16, 2016

Download

Documents

orsen

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel. Alexander Shekhovtsov and V á clav Hlav áč. [email protected], [email protected]. This work was supported bu EU projects FP7-ICT-247870 NIFTi and FP7-ICT-247525 HUMAVIPS and the Czech project 1M0567 CAK. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

This work was supported bu EU projects FP7-ICT-247870NIFTi and FP7-ICT-247525 HUMAVIPS and the Czech project 1M0567 CAK

25-27 July, 2011EMMCVPR

Center for Machine Perception

Czech Technical University in Prague

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel

Alexander Shekhovtsov and Václav Hlaváč

[email protected], [email protected]

Page 2: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

2/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Overview Goals

Main Results

Preliminary results presented on workshop 2010 in Kiev (not entirely correct)

Page 3: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

3/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Mincut in Computer Vision Test Problems (University of Western Ontario)

Page 4: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

4/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Mincut in Computer Vision Discrete Energy Minimization via Mincut

Page 5: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

5/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Mincut Capacitated network

Page 6: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

6/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Mincut Minimum s-t Cut

Page 7: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

7/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Augmenting Path Approach Path Augmentation

Page 8: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

8/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Augmenting Path Approach Residual Network

Page 9: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

9/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Augmenting Path Approach Costs of all cuts are changed by a constant

Page 10: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

10/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Augmenting Path Approach Augment next path

Page 11: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

11/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Augmenting Path Approach Minimum Cut in Residual Network

Page 12: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

12/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach Extended transformation

excess

excess

Page 13: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

13/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach

Page 14: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

14/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach

Page 15: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

15/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach

Page 16: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

16/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach

Page 17: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

17/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Push-Relabel Approach

Page 18: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

18/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Distributed Algorithms

CPU CPU

Memory

CPU

Mem

CPU

MemQuick

Slow

Distributed Sequential

CPU

MemQuick

Slow

Disk

Distributed Parallel

Shared Memory Parallel

CPU

Memory

Sequential

Distributed Model – Divide Computation AND Memory

Page 19: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

19/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Existing Distributed Algorithms Push-Relabel [Goldberg ‘94]

Region Discharge [Delong and Boykov, CVPR‘08]

t

Page 20: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

20/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Existing Distributed Algorithms Adaptive Bottom-up Merging [Liu and J. Sun, CVPR‘10]

t

Page 21: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

21/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Existing Distributed Algorithms Dual Decomposition for Mincut [Strandmark and Kahl, CVPR‘10]

¡ 1

2

2

1 ¡ 3

1 2

2

11

¡ 1

2

2

11

¡ 3

0 21

2

2

¡ 12

¡ 1

2

1¡ ¸1 1+¸1

1¡ ¸2 0+¸2

v v0 v00M N

¡ 1

2

2

11

¡ 3

1

0 21

1

1

0

1

1

2

2

¡ 1v0 v00

Page 22: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

22/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Existing Distributed Algorithms Dual Decomposition for Mincut [Strandmark and Kahl, CVPR‘10]

Page 23: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

23/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

New Algorithm New Distance Function The Algorithm Parallel Version Complexity Bound Experimental Confirmation

Page 24: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

24/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

New Distance Function

length of the path = number of boundary edges distance = length of a shortest path to the sink

d¤B(u) = 2

d¤B(v) = 0t

Valid Labeling – distance underestimate

Page 25: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

25/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

The Algorithm: Augmenting Path Region Discharge

t

1. Augment paths to the sink 2. Augment paths the boundary with label 03. Augment paths the boundary with label 1

...

Relabel the interior vertices

sweep

estimate ofthe shortestway to the sink

Page 26: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

26/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Parallel Version

t

parallel sweep

Conflicts are resolved by canceling one of the flows (similar to asynchronous parallel push-relabel [Goldberg and Tarjan 88])

all regions discharged concurrently

Page 27: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

27/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Complexity Bound

Page 28: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

28/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Experimental Confirmation

S-PRD details: highest label first push-relabel (HI-PR), region-gap heuristic, region-relabel heuristic, global gap heuristicS-ARD details: global gap heuristic

S-PRD: Sequential Push-Relabel Region DischargeS-ARD: Sequential Augmenting path Region Discharge

Test problems: 2D grid with regular connectivity and random costs

Page 29: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

29/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Efficient Implementation Standard Heuristics: global relabel and global gap Boundary Relabel Partial Discharges Boundary Search Trees

Page 30: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

30/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Efficient Implementation Global Relabel Heuristic = compute exact distance, O(m) time Global Gap Heuristic (sufficient condition of sink unreachability)

t

… cannot reach sink

cannot be in the sink set of a minimum cut“decided nodes”

Page 31: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

31/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

not possible

Efficient Implementation Boundary Relabel

0

2 11

2

1

1

1

12

2

1

1

0

1

21

2

2

1

1

0

31

4 2

2

33

A valid labeling ofboundary nodes

Group nodes by their label within each region

Compute exact distanceon the auxiliary graph

Add possible links (red)

Improve labeling, knowing only the information on the boundary?do not know how the vertices linked inside

Result: a (better) valid labeling. In the limit of small regions = global relabel.

Page 32: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

32/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Efficient Implementation Partial Discharges

1. Augment paths to the sink 2. Augment paths the boundary with label 03. Augment paths the boundary with label 1

...

Relabel the interior vertices

execute only this step in sweep 0

Page 33: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

33/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Efficient Implementation Partial Discharges

1. Augment paths to the sink 2. Augment paths the boundary with label 03. Augment paths the boundary with label 1

...

Relabel the interior vertices

execute up to here in sweep 1

Page 34: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

34/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Efficient Implementation Partial Discharges

1. Augment paths to the sink 2. Augment paths the boundary with label 03. Augment paths the boundary with label 1

...

Relabel the interior vertices

execute up to here in sweep 2

Prevents sending the flow in a wrong direction (redundant work)

Boundary Relabel + Partial Discharges effect:

Page 35: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

35/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

00

Efficient Implementation Boundary Search Trees

0

0

1

t

0

0

1

t

0

0

1

t1 1 112 00

Residual region network

Search trees of thesink and boundaryvetices

Labels of the innervertices are determinedby their tree root

Tree with higher root cannot overtake lower

(¡ 1)

Saves computation between sweeps, Integrates region-relabel into augmentation.

Find augmenting paths and encode labeling.

Page 36: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

36/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Results Dependence on Partition Sequential Competition Parallel Competition Local Problem Reduction

Page 37: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

37/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Results: Dependence on Partition

BL06-gargoyle-smlcell complex32x45x32x24partitioned by vertex number

LB07-bunny-med3D 6-connected202x199x157sparse datasliced along dimensions

liver.n6.c103D 6-connected170x170x144sliced along dimensions

Stable over partitions

Page 38: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

38/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Results: Sequential CompetitionBK – Augmenting Path [Boykov-Kolmogorov]HIPR – Highest level Push-Relabel [Goldberg-Tarjan, Cherkassky]S-ARD – Sequential Augmenting Path Region DischargeS-PRD – Sequential Push-Relable Region Discharge ([Delong-Boykov], our impl.)

Page 39: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

39/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Results: Sequential CompetitionBK – Augmenting Path [Boykov-Kolmogorov]HIPR – Highest level Push-Relabel [Goldberg-Tarjan, Cherkassky]S-ARD – Sequential Augmenting Path Region DischargeS-PRD – Sequential Push-Relable Region Discharge ([Delong-Boykov], our impl.)

...

Page 40: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

40/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Results: Parallel Competition (4 CPUs)DD – Dual Decomposition [ Strandmark and Kahl ’10] 2/4 Regions

RPR – Region Push-Relable [Delong and Boykov ‘08] impl. by Sameh Khamis

not applicable

not applicable

reduced graph

best parameters

P-ARD speed-up over BK: 0.8 – 4, robust method, few sweeps (message exchanges)

shared memory

Adaptive Bottom-up Merging [Liu and J. Sun ‘10] achieves near linear speed-up over BK

Page 41: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

41/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Local Problem Reduction How many vertices can be decided optimally by considering

regions separately?

16 regions 64 regions

2D stereo problems are largely decided locally. Other problems are significantly harder.

s

t

BR

weak sourcestrong source

strong sink

undecided

Page 42: A Distributed Mincut/Maxflow Algorithm  Combining Path Augmentation and Push-Relabel

42/9

Alexander Shekhovtsov & Vaclav Hlavac, 2011

Conclusion New distributed algorithm Terminates in at most B2+1 sweeps (few in practice) Sequential Algorithm

1) competitive with sequential solvers2) uses few sweeps (= loads/unloads of regions)3) suitable to run in the limited memory model

Parallel Algorithm 1) competitive with shared memory algorithms2) uses few sweeps (= rounds of message exchange)3) suitable for execution on a computer cluster

Implementation can be specialized for regular grids (less memory/faster)

(?) no good worst case complexity bound in terms of elementary operations

Thanks for you comments