Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 16: Earth-Mover Distance

Similar presentations


Presentation on theme: "Lecture 16: Earth-Mover Distance"β€” Presentation transcript:

1 Lecture 16: Earth-Mover Distance
COMS E F15 Lecture 16: Earth-Mover Distance Left to the title, a presenter can insert his/her own image pertinent to the presentation.

2 Administrivia, Plan Administrivia: Plan: Scriber?
NO CLASS next Tuesday 11/3 (holiday) Plan: Earth-Mover Distance Scriber?

3 Earth-Mover Distance Definition: Which metric space?
Given two sets 𝐴, 𝐡 of points in a metric space 𝐸𝑀𝐷(𝐴,𝐡) = min cost bipartite matching between 𝐴 and 𝐡 Which metric space? Can be plane, β„“ 2 , β„“ 1 … Applications in image vision Images courtesy of Kristen Grauman

4 Embedding EMD into β„“ 1 Why β„“ 1 ? At least as hard as β„“ 1
Can embed 0,1 𝑑 into EMD with distortion 1 β„“ 1 is richer than β„“ 2 Will focus on integer grid Ξ” 2 :

5 Embedding EMD into β„“ 1 [Charikar’02, Indyk-Thaper’03] Theorem: Can embed EMD over Ξ” 2 into β„“ 1 with distortion 𝑂 log Ξ” . In fact, will construct a randomized 𝑓: 2 Ξ” 2 β†’ β„“ 1 such that: for any 𝐴,π΅βŠ‚ Ξ” 2 : 𝐸𝑀𝐷 𝐴,𝐡 ≀𝑬 ||𝑓 𝐴 βˆ’π‘“ 𝐡 | | 1 ≀𝑂 log Ξ” ⋅𝐸𝑀𝐷(𝐴,𝐡) time to embed a set of 𝑠 points: 𝑂 𝑠 log Ξ” . Consequences: Nearest Neighbor Search: 𝑂(𝑐 log Ξ” ) approximation with 𝑂(𝑠 𝑛 1+1/𝑐 ) space, and 𝑂( 𝑛 1/𝑐 ⋅𝑠 log Ξ” ) query time. Computation: 𝑂(log⁑Δ) approximation in 𝑂 𝑠 log Ξ” time Best known: 1+πœ– approximation in 𝑂 𝑠 time [AS’12]

6 What if 𝐴 β‰ |𝐡| ? Suppose: Define where
𝐴 =π‘Ž 𝐡 =𝑏<π‘Ž Define 𝐸𝑀𝐷 βˆ† 𝐴,𝐡 =Ξ” π‘Žβˆ’π‘ + π‘šπ‘–π‘› 𝐴′,πœ‹ π‘Žβˆˆπ΄β€² 𝑑(π‘Ž,πœ‹ π‘Ž ) where 𝐴 β€² ranges over all subsets of 𝐴 of size 𝑏 πœ‹:𝐴′→ 𝐡 ranges over all 1-to-1 mappings For optimal 𝐴′, call π‘Žβˆˆπ΄\ 𝐴 β€² unmatched

7 Embedding EMD over small grid
Suppose =3 𝑓(𝐴) has nine coordinates, counting # points in each integer point 𝑓(𝐴)=(2,1,1,0,0,0,1,0,0) 𝑓(𝐡)=(1,1,0,0,2,0,0,0,1) Claim: distortion embedding

8 High level embedding Set in Ξ” 2 box Embedding of set 𝐴: Want to prove
take a quad-tree grid of cell size Ξ”/3 partition each cell in 3x3 recurse until of size 3x3 randomly shift it Each cell gives a coordinate: 𝑓 (𝐴)𝑐=#points in the cell 𝑐 Want to prove 𝑬 𝑓 𝐴 βˆ’π‘“ 𝐡 β‰ˆπΈπ‘€π·(𝐴,𝐡) 2 1 1 1 2 2 2 1 2 1 𝑓 𝑨 = …2210… 0002…0011…0100…0000… 𝑓 𝑩 = …1202… 0100…0011…0000…1100…

9 Main idea: intuition Decompose EMD over []2 into EMDs over smaller grids Recursively reduce to =𝑂(1) β‰ˆ +

10 Decomposition Lemma π‘˜ /π‘˜
For randomly-shifted cut-grid 𝐺 of side length π‘˜, will prove: 1) 𝐸𝑀𝐷(𝐴,𝐡) ≀ 𝐸𝑀 𝐷 π‘˜ (𝐴1, 𝐡1) + 𝐸𝑀 𝐷 π‘˜ (𝐴2,𝐡2)+… + π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ (𝐴𝐺, 𝐡𝐺) 2) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯ 1 3 𝑬[𝐸𝑀 𝐷 π‘˜ 𝐴 1 , 𝐡 1 +𝐸𝑀 𝐷 π‘˜ 𝐴 2 , 𝐡 2 +…] 3) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 )] The distortion will follow by applying the lemma recursively to (AG,BG) π‘˜ /π‘˜

11 1 (lower bound) Claim 1: for a randomly-shifted cut-grid 𝐺 of side length π‘˜: 𝐸𝑀𝐷(𝐴,𝐡) ≀ πΈπ‘€π·π‘˜(𝐴1, 𝐡1) + πΈπ‘€π·π‘˜(𝐴2,𝐡2)+… + π‘˜β‹… 𝐸𝑀 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 ) Construct a matching πœ‹ for 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 from the matchings on RHS as follows For each π‘ŽοƒŽπ΄ (suppose π‘ŽοƒŽ 𝐴 𝑖 ) it is either: 1) matched in 𝐸𝑀𝐷( 𝐴 𝑖 , 𝐡 𝑖 ) to some π‘οƒŽ 𝐡 𝑖 (if π‘Žβˆˆ 𝐴 𝑖 β€²) then πœ‹ π‘Ž =𝑏 2) or π‘Žβˆ‰ 𝐴 𝑖 β€², and then it is matched in 𝐸𝑀𝐷( 𝐴 𝐺 , 𝐡 𝐺 ) to some π‘οƒŽ 𝐡 𝑗 (𝑗≠𝑖) Cost? 1) paid by 𝐸𝑀𝐷( 𝐴 𝑖 , 𝐡 𝑖 ) 2) Move π‘Ž to center () Charge to 𝐸𝑀𝐷( 𝐴 𝑖 , 𝐡 𝑖 ) Move from cell 𝑖 to cell 𝑗 Charge π‘˜ to 𝐸𝑀𝐷( 𝐴 𝐺 , 𝐡 𝐺 ) If 𝐴 >|𝐡|, extra |𝐴|βˆ’|𝐡| pay π‘˜β‹… Ξ” π‘˜ =Ξ” on LHS & RHS π‘˜ /π‘˜

12 2 & 3 (upper bound) Claims 2,3: for a randomly-shifted cut-grid 𝐺 of side length π‘˜, we have: 2) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯ 1 3 𝑬[𝐸𝑀 𝐷 π‘˜ 𝐴 1 , 𝐡 1 +𝐸𝑀 𝐷 π‘˜ 𝐴 2 , 𝐡 2 +…] 3) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 )] Fix a matching πœ‹ minimizing 𝐸𝑀 𝐷 Ξ” (𝐴,𝐡) Will construct matchings for each EMD on RHS Uncut pairs π‘Ž,𝑏 βˆˆπœ‹ are matched in respective (𝐴,𝐡) Cut pairs π‘Ž,𝑏 βˆˆπœ‹ : are unmatched in their mini-grids are matched in ( 𝐴 𝐺 , 𝐡 𝐺 )

13 3: Cost Claim 2: 3⋅𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[𝐸𝑀 𝐷 π‘˜ 𝐴 1 , 𝐡 1 +𝐸𝑀 𝐷 π‘˜ 𝐴 2 , 𝐡 2 +…] Uncut pairs (π‘Ž,𝑏) are matched in respective ( 𝐴 𝑖 , 𝐡 𝑖 ) Total contribution from uncut pairs ≀𝐸𝑀 𝐷 Ξ” (𝐴,𝐡) Consider a cut pair (π‘Ž,𝑏) at distance π‘Žβˆ’π‘=( 𝑑 π‘₯ , 𝑑 𝑦 ) (π‘Ž,𝑏) can contribute to RHS as they may be unmatched in their own mini-grids Pr[(π‘Ž,𝑏) cut] =1βˆ’ 1βˆ’ 𝑑 π‘₯ π‘˜ βˆ’ 𝑑 𝑦 π‘˜ + ≀ 𝑑 π‘₯ π‘˜ + 𝑑 𝑦 π‘˜ ≀ 1 π‘˜ ||π‘Žβˆ’π‘| | 2 Expected contribution of (π‘Ž,𝑏) to RHS: ≀Pr[(π‘Ž,𝑏) cut] β‹…2π‘˜β‰€2 π‘Žβˆ’π‘ 2 Total expected cost contributed to RHS: 2⋅𝐸𝑀 𝐷 Ξ” (𝐴,𝐡) Total (cut & uncut pairs): 3⋅𝐸𝑀 𝐷 Ξ” (𝐴,𝐡) π‘˜ 𝑑 π‘₯

14 3: Cost Claim: 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 )]
𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 )] Uncut pairs: contribute zero to RHS! Cut pair: π‘Ž,𝑏 βˆˆπœ‹ with π‘Žβˆ’π‘=( 𝑑 π‘₯ , 𝑑 𝑦 ) if 𝑑 π‘₯ = π‘₯π‘˜+ π‘Ÿ π‘˜ , and 𝑑 𝑦 =π‘¦π‘˜+ π‘Ÿ 𝑦 , then expected cost contribution to π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 ): ≀ π‘₯+ π‘Ÿ π‘₯ π‘˜ β‹…π‘˜ + 𝑦+ π‘Ÿ 𝑦 π‘˜ β‹…π‘˜ = 𝑑 π‘₯ + 𝑑 𝑦 = π‘Žβˆ’π‘ 2 Total expected cost ≀ 𝐸𝑀 𝐷 Ξ” (𝐴,𝐡) π‘˜ π‘˜ π‘˜ 𝑑 π‘₯

15 Recurse on decomposition
For randomly-shifted cut-grid 𝐺 of side length π‘˜, we have: 1) 𝐸𝑀𝐷(𝐴,𝐡) ≀ 𝐸𝑀 𝐷 π‘˜ (𝐴1, 𝐡1) + 𝐸𝑀 𝐷 π‘˜ (𝐴2,𝐡2)+… + π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ (𝐴𝐺, 𝐡𝐺) 2) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯ 1 3 𝑬[𝐸𝑀 𝐷 π‘˜ 𝐴 1 , 𝐡 1 +𝐸𝑀 𝐷 π‘˜ 𝐴 2 , 𝐡 2 +…] 3) 𝐸𝑀 𝐷 Ξ” 𝐴,𝐡 β‰₯𝑬[π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 , 𝐡 𝐺 )] We applying decomposition recursively for π‘˜=3 Choose randomly-shifted cut-grid 𝐺 1 on []2 Obtain many grids [3]2, and a big grid [/3]2 Then choose randomly-shifted cut-grid 𝐺 2 on [/3]2 Obtain more grids [3]2, and another big grid [/9]2 Then choose randomly-shifted cut-grid 𝐺 3 on [/9]2 … Then, embed each of the small grids [3]2 into β„“1, using 𝑂(1) distortion embedding, and concatenate the embeddings Each grid occupies 9 coordinates on β„“ 1 embedding

16 Proving recursion works
Claim: embedding contracts distances by 𝑂 1 : 𝐸𝑀𝐷(𝐴,𝐡) ≀ β‰€βˆ‘π‘– πΈπ‘€π·π‘˜ 𝐴𝑖, 𝐡𝑖 +π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 1 , 𝐡 𝐺 1 ) β‰€βˆ‘π‘– 𝐸𝑀 𝐷 π‘˜ 𝐴𝑖, 𝐡𝑖 + π‘˜βˆ‘π‘– πΈπ‘€π·π‘˜ 𝐴 𝐺 1 ,𝑖 , 𝐡 𝐺 1 ,𝑖 +π‘˜β‹… 𝐸𝑀 𝐷 Ξ” π‘˜ 𝐴 𝐺 2 , 𝐡 𝐺 2 ≀ … ≀ sum of 𝐸𝑀 𝐷 3 costs of 3Γ—3 instances ≀ ||𝑓 𝐴 βˆ’π‘“ 𝐡 | | 1 Claim: embedding distorts distances by 𝑂 log Ξ” in expectation: 3 log π‘˜ Ξ” ⋅𝐸𝑀𝐷(𝐴,𝐡) β‰₯3⋅𝐸𝑀𝐷(𝐴, 𝐡) + 3 log π‘˜ Ξ” π‘˜ ⋅𝐸𝑀 𝐷 Ξ” (𝐴, 𝐡) β‰₯𝐄[ βˆ‘π‘– 𝐸𝑀 𝐷 π‘˜ (𝐴𝑖, 𝐡𝑖) + 3 log π‘˜ Ξ” π‘˜ β‹…π‘˜β‹…πΈπ‘€ 𝐷 Ξ”/π‘˜ ( 𝐴 𝐺 1 , 𝐡 𝐺 1 ) ] β‰₯… β‰₯ sum of 𝐸𝑀 𝐷 3 costs of 3Γ—3 instances β‰₯ ||𝑓 𝐴 βˆ’π‘“ 𝐡 | | 1

17 Final theorem Theorem: can embed EMD over [Ξ”]2 into β„“ 1 with 𝑂( log Ξ” ) distortion in expectation. Notes: Dimension required: 𝑂( Ξ” 2 ), but a set 𝐴 of size 𝑠 maps to a vector that has only 𝑂(𝑠⋅ log Ξ” ) non-zero coordinates. Time: can compute in 𝑂(𝑠⋅log⁑) By Markov’s, it’s 𝑂( log Ξ” ) distortion with 90% probability Applications: Can compute 𝐸𝑀𝐷(𝐴,𝐡) in time 𝑂(𝑠⋅ log Ξ” ) NNS: 𝑂(𝑐⋅log Ξ”) approximation, with 𝑂( 𝑛 1+1/𝑐 ⋅𝑠) space, and 𝑂( 𝑛 1/𝑐 ⋅𝑠⋅log Ξ”) query time.


Download ppt "Lecture 16: Earth-Mover Distance"

Similar presentations


Ads by Google