1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

37
1 From High Definition Image to Low Space Optimization Micha Feigin, Danny Feldman, Nir Sochen

Transcript of 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

Page 1: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

1

From High Definition Image to

Low SpaceOptimization

Micha Feigin, Danny Feldman, Nir Sochen

Page 2: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

2

Coresets

Page 3: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

3

² Input: P in RdMean Queries

Page 4: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

4

² Input: P in Rd

² Query: a pointq2 Rd

q

Mean Queries

Page 5: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

5

² Input: P in Rd

² Query: a pointq2 Rd

q

Mean Queries

Page 6: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

6

Definition

C is an "-coreset for (P;Q; f )

if for every q 2 Q we have w.h.p

f (P;q) » f (C;q);

where the approximation depends on ".

Page 7: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

7

² AssumeP

p2P = 0.

Oterwise, translate P .¡dist(p;q)

¢2= kp¡ qk2

= kpk2 +kqk2 ¡ 2p¢q

q

²

Coresets for Mean Queries

Page 8: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

8

² AssumeP

p2P = 0.

Oterwise, translate P .¡dist(p;q)

¢2= kp¡ qk2

= kpk2 +kqk2 ¡ 2p¢q

²

X

p2P

¡dist(p;q)

¢2=

X

p2P

kpk2 +X

p2P

kqk2 ¡ 2q¢X

p2P

p

=X

p2P

kpk2 +jP j kqk2

²

Coresets for Mean Queries

Page 9: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

9

f (P;q) =X

p2P

kpk2 +jP j ¢kqk2

= g(C;q)

where C =P

p2P p= 0,

g(C;q) = jP j ¢dist(C;q) +P

p2P kpk2

Coresets for Mean Queries

Page 10: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

10

(C;g) is an "-coreset for (P;Q;F )

if for every q 2 Q we have w.h.p

f (P;q) » g(C;q);

where the approximation depends on ".

A More General Definition

Page 11: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

11

² k-mean/ median of a graph

² k-line median/ means

² Matrix low-rank approximations

² Regression/ Subspace approximations

² Google's PageRank

² Supported vector machines

² Diameter/ width of a point set

² Dealing with insertions/ deletions, outliers, ...

Other Coresets

Page 12: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

12

KSVD

Page 13: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

13

Sparse Reconstruction• Defined as a set {D,X,Y} such that

DY t X

Figure courtesy Michael Elad

Page 14: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

14

Sparse Coding• Given a D and yi, how to find xi

• Constraint : xi is sufficiently sparse

• Finding exact solution difficult

• Approximate solution good enough ?

Page 15: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

15

Orthogonal Matching Pursuit (OMP)

Select dk with maxprojection on residue

xk = arg min ||y-Dkxk||

Update residue

r = y - Dkxk

Check terminating condition

D, y x

Page 16: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

16

OMP : features

• Greedy algorithm

• Can find approximate solution

• Close solution if T is small enough

• Simplistic in nature

• Tends to be unstable for large T

Page 17: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

17

K-SVD Algorithm

• Select atoms from input

• Atoms can be patches from the image

• Patches are overlapping

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Page 18: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

18

K-SVD Algorithm

• Use OMP or any other fast method

• Output gives sparse code for all signals

• Minimize error in representation

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Page 19: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

19

K-SVD Algorithm

• Replace unused atom with minimally represented signal

• Identify signals that use k-th atom (non zero entries in rows of X)

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Page 20: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

20

K-SVD Algorithm

• Deselect k-th atom from dictionary

• Find coding error matrix of these signals

• Minimize this error matrix with rank-1 approx from SVD

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Page 21: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

21

K-SVD Algorithm

• [U,S,V] = svd(Ek)

• Replace coeff of atom dk in X with entries of s1v1

• dk = u1/u12

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Page 22: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

22

Denoising framework• A cost function for : Y = Z + n

• Solve for Prior term

Page 23: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

23

Denoising Framework• Break problem into smaller

problems

• Aim at minimization at the patch level

Select i-th patch of Z accounted for

implicitly by OMP

Page 24: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

24

Denoising Framework

• Solution :

• Denoising by normalized weighted averaging

Initialize Dictionary

Sparse Coding(OMP)

Update Dictionary

One atom at a time

Averaging of patches

Page 25: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

25

Coresets for the KSVD

Page 26: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

26

Coresets for the KSVD• Replace input set Y with a weighted

set C• Construct an optimal dictionary for

C (instead of Y)• Compute coefficients for Y based on

this dictionaryAdvantages:• The coreset C is much smaller than

Y• Constructing C is much cheaper

than solving the original problem

Page 27: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

27

3000x4000 pixels

Denoising High Definition Images

Page 28: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

28

K-SVD Denoiser for LD images [Michael Elad et

al.]

ε-Coreset for HD Images

Page 29: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

29

Algorithm: Coreset (Y,D0,c)

Input: A matrix Y, and integer and a matrix D0 (of arbitrary size)

• The columns of Y are the image patches

• c is the size of the coreset• D0 is an approximated dictionary

Output: A weighted matrix C – a coreset for Y for the K-SVD algorithm (with probability )

Page 30: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

30

Algorithm: Coreset (Y,D0,c)

• Pick a non-uniform random sample S of c i.i.d columns from Y

• The probability of choosing is

• The coreset C is constructed from the columns of S along with corresponding weights:

Page 31: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

31

Choosing D0

• The ideal choice for D0 is the optimal dictionaryo This will allow to best predict which vectors

are important to construct this dictionary

• Problem: we don’t want to solve the problem in order to find a coreset to solve the problem

• Two first order approximations:o An all ones vectoro The most significant singular vector for Y

Page 32: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

32

Random Sampling• Uniform random sampling generally

does not produce a good coresetoFor a mostly uniform image (such as line

drawings), patches with features will be chosen with low probability

oEssential to choose them to reconstruct the image

• To construct a good dictionary, we need tooMake sure outliers are representedoGive them low priority for affecting the

final outcome

Page 33: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

33

Experimental Results

Page 34: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

34

Streaming• Single pass over data• Requires only space• Fast processing time per ellement• Allows handling data sets that don’t

fit in memoryoK-SVD choked on HD images without

coresetsoWe managed to run on full length movie

(VGA resolution) with atoms being full frames (not patches)

Page 35: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

35

Tree Computation

p1 p2 p3 p4 p5 p7p6 p8 p9 p10 p11 p12 p13 p15p14 p16

From a presentation by Piotr Indyk

Page 36: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

36

Conclusion• Coresets greatly speed up

calculation• Allow handling much larger inputs

(at lower running times)• Can stabilize random seeded and

greedy algorithms due to smaller input

• Allow multiple runs on random seeded methods to allow majority vote methods (at a lower total run time)

Page 37: 1 Micha Feigin, Danny Feldman, Nir Sochen. 2 3 4.

37

Thank You