Slides

advertisement
NUS – School of Computing
CS6234 Advanced Topics in Algorithms
๐‘ณ๐ŸŽ Gradient Minimization
Abdelhak Bentaleb (A0135562H), Lei Yifan (A0138344E),
Ji Xin (A0138230R), Dileepa Fernando (A0134674B),
Abdelrahman Kamel (A0138294X)
Outline
• Introduction (Abdelhak)
• ๐ฟ0 gradient minimization using coordinate descent optimization
(Ji Xin)
• ๐ฟ0 gradient minimization using alternating optimization and
region fusion (Abdelrahman & Dileepa)
• Experiments & Applications (Lei Yifan)
7/1/2016
L0 Gradient Minimization
2
Introduction
Abdelhak
7/1/2016
L0 Gradient Minimization
3
Introduction
• ๐ฟ0 norm
• ๐ฟ0 gradient
• ๐ฟ0 gradient minimization
• Why it is NP hard
• Alternating optimization
7/1/2016
L0 Gradient Minimization
4
Introduction
๐‘ณ๐ŸŽ Norm
• ๐‘ณ๐’‘ norm for vector x is
๐‘ฅ
๐‘ =
๐‘
๐‘ฅ๐‘– ๐‘ , ๐‘ ∈ โ„
๐‘–
• A pth root of a summation of all elements to the pth power
• ๐‘ณ๐ŸŽ norm is
๐‘ฅ
0 =
0
๐‘–
๐‘ฅ๐‘–
0
• Mathematically, not a norm
• because there is a presence of zeroth-power (00) and zeroth-root in it
• For applicability reasons, ๐ฟ0 norm can be redefined
๐‘ฅ 0 = #(๐‘–โ”‚๐‘ฅ๐‘– ≠ 0)
• total number of non-zero elements in a vector
• Wide applications on discrete functions/signals
7/1/2016
L0 Gradient Minimization
5
Introduction
๐‘ณ๐ŸŽ Gradient
• Recall: ๐ฟ0 norm is the number of non-zero elements
• ๐‘ณ๐ŸŽ gradient is the number of non-zero gradients
• Example:
8
6
6
4
2
20 points
0
3 zero gradients -2
17 non-zero gradients
๐ฟ0 gradient = 17
1
1
2
4
3
1
0
2
3
4
5
-1
6
-1
3
2
8
3
1
9
10
11
12
13
14
2
2
17
18
3
1
0
15
16
-1
19
20
Discrete Function
5
1
1
2
3
0
0
1
-5
7
5
4
-3
5
-1
6
2
7
1
8
2
2
9
10
3
0
11
-1
12
-2
13
0
14
-2
15
-1
16
-1
17
18
1
19
20
-2
Gradients
7/1/2016
L0 Gradient Minimization
6
Introduction
๐‘ณ๐ŸŽ Gradient Minimization
• Convert input function ๐ผ ๏ƒ  Output function ๐‘†
Minimize the number of non-zero gradients (๐‘ณ๐ŸŽ)
in ๐ผ to get ๐‘†
while maintaining the similarity
between ๐ผ and ๐‘†
as possible
• To minimize ๐ฟ0 gradient is an optimization problem
7/1/2016
L0 Gradient Minimization
7
8
6
6
Ad-hoc Example
4
1
2
2
3
1
1
0
0
-2
4
2
3
4
5
-1
6
-1
7
3
2
8
3
1
9
10
11
12
13
14
2
2
17
18
3
1
0
15
16
-1
19
20
Discrete Function
Original Function I
5
• ๐ฟ0 gradient = 17
5
1
1
2
3
0
0
1
-5
4
-3
5
-1
6
2
7
1
8
2
2
9
10
3
0
11
-1
12
13
3
3
-2
1
0
14
-2
15
-1
16
-1
17
18
19
20
2
2
2
2
-2
Gradients
Removing some small gradients
6
4
2
2
5
2
2
2
5
2
0
0
1
2
3
4
-2
5
-1
6
-1
7
Output Function S
• ๐ฟ0 gradient = 8
5
8
9
10
11
12
13
0
0
0
14
15
16
17
18
19
20
0
0
2
0
0
0
15
16
17
18
19
20
Discrete Function with less non-zero gradients
10
0
-10
1
0
0
2
3
0
4
-2
5
-1
3
6
7
0
8
3
9
0
0
10
11
0
12
-2
13
14
-3
Gradients
7/1/2016
L0 Gradient Minimization
8
Introduction
It is NP Hard
• Discrete
• Non-convex
• Non-derivative
• Can’t use traditional optimization techniques (such as gradient
descent)
• So, we need to use Alternating Optimization to get an Approximate
Solution
• (See appendix A for detailed proof)
7/1/2016
L0 Gradient Minimization
9
Introduction
Alternating Optimization – Overview
• Iterative method that generates a sequence of improving
approximate solutions for a problem.
• An optimization problem can be written as:
• minimize some objective function ๐’‡(๐’™) given a set of data points x
• Partition x ∈ ๐‘† into ๐‘ non-overlapping parts ๐‘ฆ๐‘™ such that
This is some kind of
local optimization
7/1/2016
L0 Gradient Minimization
10
Introduction
Alternating Optimization – Overview
7/1/2016
L0 Gradient Minimization
11
Introduction
Alternating Optimization – Overview
• For each iteration ๐’Œ (until convergence)
• For each partition of data ๐’š๐’
• Find ๐’š๐’ values for next iteration such that ๐’‡(๐’™) is minimized sufficiently
• i.e., optimize one partition while fixing all other partitions
7/1/2016
L0 Gradient Minimization
12
Introduction
Alternating Optimization – Overview
7/1/2016
L0 Gradient Minimization
13
๐‘ณ๐ŸŽ Gradient Minimization (1)
Using Coordinate Descent
Ji Xin
7/1/2016
L0 Gradient Minimization
14
๐‘ณ๐ŸŽ Gradient Minimization (1)
๐‘ณ๐ŸŽ Gradient Minimization (1)
• Recall: L0 gradient is the number of non-zero gradients
• Original function ๐ผ ๏ƒจ Desired output ๐‘†
• Denote the gradient of ๐‘† as ๐›ป๐‘†
• The original function usually consists of discrete points (e.g.,
signals for 1D, pixels for 2D) in real-world applications.
• Thus, ๐›ป๐‘† can be computed by subtraction between neighbor
points.
• For 1D signal, one way to calculate the gradient at point ๐‘– is
๐›ป๐‘†๐‘– = ๐‘†๐‘– − ๐‘†๐‘–−1 + |๐‘†๐‘–+1 − ๐‘†๐‘– |
7/1/2016
๐ฟ0 Gradient Minimization
15
2D Formulation
๐‘ณ๐ŸŽ Gradient Minimization (1)
• Original image ๐ผ ๏ƒจ smoothed output ๐‘†
• Gradient for pixel p is ๐›ป๐‘†๐‘ = (๐›ป๐‘†๐‘๐‘ฅ , ๐›ป๐‘†๐‘๐‘ฆ )๐‘‡ where each dimension
can be treated as a 1D situation independently.
• The L0 gradient is
๐›ป๐‘† 0 = ๐‘ | ๐›ป๐‘†๐‘๐‘ฅ + ๐›ป๐‘†๐‘๐‘ฆ ≠ 0
• Objective function:
๐‘“ = ๐‘† − ๐ผ 2 + ๐œ† · ๐›ป๐‘† 0
• λ controls the weight between L2 norm measure (input-output
similarity) and L0 gradient (smoothness)
7/1/2016
๐ฟ0 Gradient Minimization
16
๐‘ณ๐ŸŽ Gradient Minimization (1)
Solver
• Introduce auxiliary variables ๐›ฟ, ๐›ฟ is initially the gradient of the input
image.
• Each pixel p of ๐›ฟ is denoted by ๐›ฟ๐‘ = (๐›ฟ๐‘๐‘ฅ , ๐›ฟ๐‘๐‘ฆ )๐‘‡ , corresponding to ๐›ป๐‘†๐‘๐‘ฅ
and ๐›ป๐‘†๐‘๐‘ฆ .
• Objective function:
๐‘“ = ๐‘†−๐ผ
2
+๐œ†โˆ™ ๐›ฟ
0 + ๐›พ โˆ™ ๐›ป๐‘† − ๐›ฟ
2
• ๐›พ controls the similarity between ๐›ฟ and their corresponding gradient
๐›ป๐‘†, ๐›พ > 0
• Can be solved by the following two subproblems
7/1/2016
๐ฟ0 Gradient Minimization
17
๐‘ณ๐ŸŽ Gradient Minimization (1)
Subproblem 1: Fix ๐œน and Compute ๐‘บ
๐‘“ = ๐‘†−๐ผ
2
+λโˆ™ ๐›ฟ
• Objective function
๐‘“ = ๐‘†−๐ผ
2
0 + ๐›พ โˆ™ ๐›ป๐‘† − ๐›ฟ
+ ๐›พ โˆ™ ๐›ป๐‘† − ๐›ฟ
2
2
• This is a quadratic function, global minimum ๐‘“ achieved
by gradient descent. (Let ๐›ป๐‘“ = 0, compute ๐‘†)
7/1/2016
๐ฟ0 Gradient Minimization
18
๐‘ณ๐ŸŽ Gradient Minimization (1)
Subproblem 2: Fix ๐‘บ and Compute ๐œน
๐‘“ = ๐‘†−๐ผ
• Objective function
2
+λโˆ™ ๐›ฟ
0 + ๐›พ โˆ™ ๐›ป๐‘† − ๐›ฟ
2
๐œ†
๐‘“ = ๐›ป๐‘† − ๐›ฟ + โˆ™ ๐›ฟ 0
๐›พ
• Compute optimal pixel-wise objective function at a time
• Pixel-wise objective function
๐œ†
2
๐‘“๐‘ = ๐›ป๐‘†๐‘ − ๐›ฟ๐‘ + โˆ™ ๐›ฟ๐‘ 0
๐›พ
2
7/1/2016
๐ฟ0 Gradient Minimization
19
๐‘ณ๐ŸŽ Gradient Minimization (1)
Subproblem 2: Fix ๐‘บ and Compute ๐œน
• Compute optimal ๐›ฟ๐‘ for every pixel p
• Objective function
๐‘“๐‘ = ๐›ป๐‘†๐‘ − ๐›ฟ๐‘
7/1/2016
0
=
1
๐œ†
+ โˆ™ ๐›ฟ๐‘
๐›พ
0
2
0
๐›ฟ๐‘
2
๐‘“๐‘ = ๐›ป๐‘†๐‘ − ๐›ฟ๐‘
๐‘“๐‘ = ๐›ป๐‘†๐‘
๐œ†
๐œ†
2
+ =0+ ,
๐›พ
๐›พ
๐ฟ0 Gradient Minimization
๐›ฟ๐‘ ← ๐›ป๐‘†๐‘
20
๐‘ณ๐ŸŽ Gradient Minimization (1)
Subproblem 2: Fix ๐‘บ and Compute ๐œน
• Compute optimal ๐›ฟ๐‘ for every pixel p
• Objective function
๐‘“๐‘ = ๐›ป๐‘†๐‘ − ๐›ฟ๐‘
• Case 1: Condition
๐œ†
๐›พ
≥ ๐›ป๐‘†๐‘
• Case 2: Condition
< ๐›ป๐‘†๐‘
๐œ†
+ โˆ™ ๐›ฟ๐‘
๐›พ
0
2
• ๐‘“๐‘ can achieve the minimum ๐›ป๐‘†๐‘
๐œ†
๐›พ
2
2
2
when ๐œน๐’‘ = (๐ŸŽ, ๐ŸŽ)๐‘ป .
.
λ
๐›พ
• ๐‘“๐‘ can achieve the minimum when ๐œน๐’‘ = ๐œต๐‘บ๐’‘ .
7/1/2016
๐ฟ0 Gradient Minimization
21
๐‘ณ๐ŸŽ Gradient Minimization (1)
Subproblem 2 – Combined Result
• Minimum ๐‘“๐‘ achieved under the condition
๐›ฟ๐‘ =
0, 0
๐‘‡, ๐œ†
๐›พ
≥ ๐›ป๐‘†๐‘
๐›ป๐‘†๐‘ , ๐‘œ๐‘กโ„Ž๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’
2
.
• Corresponding ๐‘“๐‘
๐‘“๐‘ =
๐›ป๐‘†๐‘
2
, ๐‘คโ„Ž๐‘’๐‘› ๐›ฟ๐‘ = 0,0
๐œ†
, ๐‘คโ„Ž๐‘’๐‘›
๐›พ
๐›ฟ๐‘ = ๐›ป๐‘†๐‘
๐‘‡
.
• So, the global objective function achieves by aggregating the objective
function of every pixel.
7/1/2016
๐ฟ0 Gradient Minimization
22
๐‘ณ๐ŸŽ Gradient Minimization (1)
Algorithm
• Input: image ๐ผ, smoothing weight λ, parameters ๐›พ, ๐›พ0 and rate κ
• Initialization: ๐‘† ← ๐ผ, ๐›พ ← ๐›พ0 , ๐‘– ← 0
• repeat
• With ๐‘† , solve for ๐›ฟ
(๐‘–)
(๐‘–)
in Eq. ๐›ฟ๐‘ =
0, 0
๐‘‡ ๐œ†
,
๐›พ
≥ ๐›ป๐‘†๐‘
2
for every pixel.
๐›ป๐‘†๐‘ , ๐‘œ๐‘กโ„Ž๐‘’๐‘Ÿ๐‘ค๐‘–๐‘ ๐‘’
• With ๐›ฟ (๐‘–) , solve ๐‘† (๐‘–+1) by gradient descent. • ๐›พ starts form small ๐›พ0 , in this case 2๐œ†
• ๐›พ ← κ๐›พ, ๐‘– + +.
• ๐›พ ends with ๐›พ๐‘š๐‘Ž๐‘ฅ , ๐›พ๐‘š๐‘Ž๐‘ฅ is set to 1e5
• until ๐›พ ≥ ๐›พ๐‘š๐‘Ž๐‘ฅ
• Output: smoothed image ๐‘†
7/1/2016
• ๐›พ is multiplied by κ every iteration
• κ controls the growth of ๐›พ
• finally becomes the approximation of
the gradient of the output image
๐ฟ0 Gradient Minimization
23
๐‘ณ๐ŸŽ Gradient Minimization (2)
Abdelrahman & Dileepa
7/1/2016
L0 Gradient Minimization
24
Objective Function
๐‘ณ๐ŸŽ Gradient Minimization (2)
• Original function ๐ผ
Desired output ๐‘†
• We need to minimize number of non-zero gradients in ๐ผ to get ๐‘†
• while maintaining the similarity between ๐ผ and ๐‘† as possible
Maintaining
similarity
7/1/2016
L0 Gradient Minimization
Minimizing
gradients
Parameter to control the ๐ฟ0 gradient
Larger ๐œ† means smaller ๐ฟ0 gradient
25
Objective Function
๐‘ณ๐ŸŽ Gradient Minimization (2)
• Removing a gradient depends on the neighbors of some point
• For example, in 1D, point ๐‘†๐‘– affects 2 gradients (๐‘†๐‘– − ๐‘†๐‘–−1 ) and (๐‘†๐‘–+1 − ๐‘†๐‘– )
• So, rewrite the previous function as summation over all points
• If we have ๐‘ด points
Maintaining
similarity
๐œ† is divided by 2 as each
gradient is calculated twice
7/1/2016
L0 Gradient Minimization
Minimizing
gradients
Sum of all gradients from
point ๐‘– to all its neighbors ๐‘๐‘–
26
Neighborhood
๐‘ณ๐ŸŽ Gradient Minimization (2)
• What are the neighbors of some point ๐‘†๐‘–
• Some examples:
๐‘บ๐’Š
๐‘บ๐’Š
7/1/2016
L0 Gradient Minimization
๐‘บ๐’Š
27
๐‘ณ๐ŸŽ Gradient Minimization (2)
Alternating Optimization
• Recall that ๐ฟ0 minimization is NP-hard
•
•
•
•
So, we need to apply alternating optimization
How:
Optimize for each pair of neighboring points at a time (partition)
So, for one pair, the minimization step becomes
๐‘†๐‘– and ๐‘†๐‘— are some pair of
neighbor points
7/1/2016
L0 Gradient Minimization
28
Minimization Step
๐‘ณ๐ŸŽ Gradient Minimization (2)
• Now, we need to solve this minimization step
• Let’s consider two cases:
• When ๐‘†๐‘– ≠ ๐‘†๐‘—
• When ๐‘†๐‘– = ๐‘†๐‘—
7/1/2016
L0 Gradient Minimization
29
๐‘ณ๐ŸŽ Gradient Minimization (2)
Minimization Step – Case 1
• Case 1: When ๐‘†๐‘– ≠ ๐‘†๐‘—
• ๐‘†๐‘– − ๐‘†๐‘—
0
= 1 because the gradient ๐‘†๐‘– − ๐‘†๐‘— ≠ 0
1
• So, ๐‘“ becomes
• And, ๐‘†๐‘– = ๐ผ๐‘– and ๐‘†๐‘— = ๐ผ๐‘— give us the minimum value of ๐‘“ = ๐œ†
7/1/2016
L0 Gradient Minimization
30
๐‘ณ๐ŸŽ Gradient Minimization (2)
Minimization Step – Case 2
• Case 2: When ๐‘†๐‘– = ๐‘†๐‘—
• ๐‘†๐‘– − ๐‘†๐‘—
0
= 0 because the gradient ๐‘†๐‘– − ๐‘†๐‘— = 0
0
• So, ๐‘“ becomes a simple quadratic equation in one variable ๐‘†๐‘–
See Appendix B for
detailed solution
๐Ÿ
• And, ๐‘บ๐’Š = ๐‘บ๐’‹ = (๐‘ฐ๐’Š + ๐‘ฐ๐’‹ )/๐Ÿ give us the minimum value of ๐’‡ = ๐‘ฐ๐’Š − ๐‘ฐ๐’‹ /๐Ÿ
7/1/2016
L0 Gradient Minimization
31
Fusion Criterion
๐‘ณ๐ŸŽ Gradient Minimization (2)
• Based on Case 1 & 2, we have 2 possible minimum values of ๐‘“
• To solve the minimization step, we need to know which is smaller
• Combined together, we have the solution:
• This is called the Fusion Criterion
7/1/2016
L0 Gradient Minimization
32
๐‘ณ๐ŸŽ Gradient Minimization (2)
Example – Fusion Criterion
• Assume ๐€ = ๐Ÿ‘
5
4
3
2
1
5
4
2
๐ผ๐‘–
๐ผ๐‘—
1
2
4
๐ผ๐‘– − ๐ผ๐‘—
2
2
=2<๐œ†
๐ผ๐‘– + ๐ผ๐‘—
๐‘†๐‘– = ๐‘†๐‘— =
=3
2
0
3
2
1
3
3
๐‘†๐‘–
๐‘†๐‘—
1
2
0
๐‘ณ๐ŸŽ = ๐Ÿ
๐‘ณ๐ŸŽ = ๐ŸŽ
5
5
4
3
2
1
4
๐ผ๐‘–
๐ผ๐‘—
1
๐ผ๐‘– − ๐ผ๐‘—
2
2
=8>๐œ†
๐‘†๐‘– = ๐ผ๐‘– = 1 ,
๐‘†๐‘— = ๐ผ๐‘— = 5
0
3
2
1
๐‘†๐‘–
๐‘†๐‘—
1
0
1
7/1/2016
5
5
2
๐‘ณ๐ŸŽ = ๐Ÿ
1
L0 Gradient Minimization
2
๐‘ณ๐ŸŽ = ๐Ÿ
33
Region Fusion
๐‘ณ๐ŸŽ Gradient Minimization (2)
• Up to now,
we considered minimizing ๐ฟ0 for pairs of points,
๐‘ฎ๐’Š
• For alternating optimization, it is better to optimize
regions or groups of points together at a time
๐‘ฐ๐’Š
• For faster convergence
• Lets assume, for each point ๐ผ๐‘– we have a
group of points ๐‘ฎ๐’Š of ๐’˜๐’Š points
that is fused together to the same value ๐‘†๐‘–
๐‘ฎ๐’Š
๐‘บ๐’Š
๐‘บ๐’Š
๐‘บ๐’Š
• Example: in the figure ๐‘ค๐‘– = 3
7/1/2016
L0 Gradient Minimization
34
Region Fusion
๐‘ณ๐ŸŽ Gradient Minimization (2)
• For generality, in 2D and 3D functions, we must consider
the number of gradients ๐’„๐’Š,๐’‹ between pairs of neighboring
groups ๐‘– and ๐‘—
• ๐’‹ ∈ ๐‘ต๐’Š
• Example: in the figure,
๐‘1,2 = ๐‘2,1 = 5,
๐‘ค1 = 10
• Note that ๐’˜๐’Š and ๐’„๐’Š,๐’‹ are initially set to ๐Ÿ.
7/1/2016
L0 Gradient Minimization
35
Region Fusion
๐‘ณ๐ŸŽ Gradient Minimization (2)
• After adding the notion of groups, the minimization step becomes:
• Now, ๐‘Œ๐‘– and ๐‘Œ๐‘— are the average value of the original function in the
regions ๐บ๐‘– and ๐บ๐‘—, respectively
• ๐‘ค๐‘– , ๐‘ค๐‘— = number of points in ๐บ๐‘– and ๐บ๐‘—
• ๐›ฝ is to control the number of gradients between ๐บ๐‘– and ๐บ๐‘—
• ๐‘๐‘–,๐‘— = number of gradients between ๐บ๐‘– and ๐บ๐‘—
• The above equation can be solved in the exact same manner used for
Minimization Step
7/1/2016
L0 Gradient Minimization
36
๐‘ณ๐ŸŽ Gradient Minimization (2)
Region Fusion
• Solution:
• ๐ต = (๐‘ค๐‘– ๐‘Œ๐‘– + ๐‘ค๐‘— ๐‘Œ๐‘— )/(๐‘ค๐‘– + ๐‘ค๐‘— )
weighted average of the two groups
๐บ๐‘– and ๐บ๐‘— .
• This criterion is used to decide
whether to fuse the group ๐บ๐‘– into
the group ๐บ๐‘— or not.
7/1/2016
L0 Gradient Minimization
37
Region
Fusion
Algorithm
7/1/2016
=1
๐ฟ0 Gradient Minimization
38
๐‘ณ๐ŸŽ Gradient Minimization (2)
Initialization of the Algorithm
7/1/2016
๐ฟ0 Gradient Minimization
39
๐‘ณ๐ŸŽ Gradient Minimization (2)
Fusion
Step for Gi
with Gj
7/1/2016
๐ฟ0 Gradient Minimization
40
๐‘ณ๐ŸŽ Gradient Minimization (2)
Fusion Step Explained
• Decision for merging is taken by comparing objective function
change
• A neighbour is merged and it’s information is also merged
• After deleting merged group, Indexes are updated
• Number of groups is updated
• Loop goes through the neighbours of the merged group for more
fusions
7/1/2016
๐ฟ0 Gradient Minimization
41
๐‘ณ๐ŸŽ Gradient Minimization (2)
Reduction of the objective function
• Claim : The sum of non zero gradients removed from the merged
neighbours after any fusion steps, is a lower bound for the total
non zero gradients removed
• Sub Claim: At the end of ๐›ฝ = 0 iteration,
1. ∀๐‘ < ๐‘€ , ๐ผ๐‘ = ๐‘†๐‘
2. For any two neighbours ๐‘1 , ๐‘2 ∈ ๐ผ, ๐ผ๐‘1 = ๐ผ๐‘2 โŸน ๐บ ๐‘1 = ๐บ(๐‘2 )
(Here ๐บ ๐‘ฅ is the group which pixel ๐‘ฅ belonging to)
7/1/2016
๐ฟ0 Gradient Minimization
42
๐‘ณ๐ŸŽ Gradient Minimization (2)
Reduction of the objective function
Why the sub claim is correct?
1. When ๐›ฝ = 0 ,two groups ๐บ๐‘– , ๐บ๐‘— are merged only if ๐‘Œ๐‘– = ๐‘Œ๐‘—
i.e.(๐‘ค๐‘– ๐‘ค๐‘— ๐‘Œ๐‘– − ๐‘Œ๐‘—
2
≤ 0)
1. New value after merging does not change because, weighted
average of equal values is the value itself. (Objective function is
not changed)
2. Since each pixel is visited at least once, if two pixels have similar
values, they should be merged to the same group.
7/1/2016
๐ฟ0 Gradient Minimization
43
๐‘ณ๐ŸŽ Gradient Minimization (2)
Reduction of the objective function
When ๐›ฝ > 0,
• Initially, no two neighbouring groups have zero gradients
(sub claim)
• In the first iteration for ๐›ฝ > 0 , zero gradients are introduced for
the neighbours considered (fusion step- ๐บ๐‘– and ๐บ๐‘— )
• Some side neighbours (๐บ๐‘˜ ) may also introduce zero gradients.
• In a later iteration, they may result in non-zero gradients
• Non-zero gradients of the side neighbours does not exceed the
initial count
7/1/2016
๐ฟ0 Gradient Minimization
44
๐‘ณ๐ŸŽ Gradient Minimization (2)
Reduction of the objective function (upper bound)
• An upper bound for the objective function exists
• It keeps on decreasing from the initial value ๐œ†||∇S||0
• Amount of reduction at each fusion step is at least ,
๐œ†ci,j − wi wj ||Yi − Yj||2 /(wi + wj)
7/1/2016
๐ฟ0 Gradient Minimization
45
Choice of β
๐‘ณ๐ŸŽ Gradient Minimization (2)
• β=0 case, groups neighbours with zero gradient
• Increasing β in small intervals gives a very smooth solution but it
consumes time.
7/1/2016
๐ฟ0 Gradient Minimization
46
Choice of β
๐‘ณ๐ŸŽ Gradient Minimization (2)
• For an extreme example, let’s say β’s first non zero value is ๐œ†.
• Then very large gradients can be merged resulting a larger
objective function.
• If β starts from a small value, small gradients are merged and after
merge a large gradient between two input pixels may be converted
into much larger gradient between two groups containing the
input pixels.
• Then the inputs pixels are not grouped, resulting in a smaller
objective function value.
7/1/2016
๐ฟ0 Gradient Minimization
47
๐‘ณ๐ŸŽ Gradient Minimization (2)
Choice of β
Assume β ๐’Š๐’” ๐’„๐’‰๐’๐’”๐’†๐’ ๐’”. ๐’•. ๐’‘๐’Š๐’™๐’†๐’๐’” ๐Ÿ ๐’‚๐’๐’… ๐Ÿ ๐’‚๐’“๐’† ๐’๐’๐’• ๐’Ž๐’†๐’“๐’ˆ๐’†๐’… ๐’‡๐’๐’“ ๐’”๐’Ž๐’๐’๐’•๐’‰ β , ๐’‚๐’๐’… ๐’‚๐’“๐’† ๐’Ž๐’†๐’“๐’ˆ๐’†๐’… ๐’‡๐’๐’“ ๐’๐’๐’ − ๐’”๐’Ž๐’๐’๐’•๐’‰ β
Output – smooth beta
Input
Output – non-smooth beta
7
7
7
6
6
6
5
5
5
4
4
4
3
3
3
2
2
2
1
1
1
0
0
0
Pixel position
1
2
3
Pixel position
1
2
3
F= 1.5
7/1/2016
๐ฟ0 Gradient Minimization
Pixel position
1
2
3
F= 14
48
Applications
Lei Yifan
7/1/2016
L0 Gradient Minimization
49
Applications
Demo
L0 norm
L2 norm
7/1/2016
L0 Gradient Minimization
50
Applications
Experiment
Objective Function ๐œ† = 0.01
6000
5000
4000
3000
L0 norm
2000
1000
L2 norm
0
0
10
20
30
40
50
60
70
80
90
100
# of iterations
7/1/2016
L0 Gradient Minimization
51
Applications
Experiment – Comparison
input
The result of 1st
algorithm.
The result of 2nd
algorithm.
input
7/1/2016
L0 Gradient Minimization
The result of 1st
algorithm.
The result of 2nd
algorithm.52
Applications
Experiment – Comparison
input
The result of 1st
algorithm.
The result of 2nd
algorithm.
input
7/1/2016
L0 Gradient Minimization
The result of 1st
algorithm.
The result of 2nd
algorithm.
53
Applications
Example Applications
• Due to its unique property, it can be used in many application.
1.
2.
3.
4.
5.
6.
7/1/2016
Edge Enhancement
Color Quantization
JPEG artifact removal
3D Mesh Denoising
Underdetermined linear system
…
L0 Gradient Minimization
54
Applications
Edge Enhancement
• Edge extraction is very useful in many application. However,
sometimes the edge of the original input is not sufficient enough.
To address this problem, L0 minimization method could be used.
Original input
7/1/2016
Extracted Edge from
original input
Image after
L0-minimazition
L0 Gradient Minimization
Extracted Edge from
Image after L0-minimazition
55
Applications
Color Quantization
• L0 gradient can also be used to do color quantization. Color
quantization is really helpful for image compression.
Input, # of colors is 41290
7/1/2016
Output, # of colors is 38
L0 Gradient Minimization
56
Applications
JPEG Artifact Removal
• It is with high probability that there could be some artifact when
compressing image especially for Clip-Art. This algorithm can
address this problem well.
7/1/2016
L0 Gradient Minimization
57
Applications
3D Mesh Denoising
7/1/2016
L0 Gradient Minimization
58
Applications
Underdetermined Linear Systems
• Solve underdetermined linear system, if a sparse solution is
needed.
• To solve Ax=v, we can minimize
๐‘“ ๐‘ฅ = ๐ด๐‘ฅ − ๐‘ฃ + ๐œ† ๐‘ฅ
0
• We can use similar strategy to optimize this objective function.
7/1/2016
L0 Gradient Minimization
59
Conclusion
• We started by introducing some background.
• Then, we presented L0 gradient minimization using two
algorithms.
• Coordinate descent optimization.
• Alternating optimization with region fusion.
• Also, we presented some experiments and comparisons between
the two algorithms.
• Finally, we showed the applicability of the algorithms on some
problems.
7/1/2016
L0 Gradient Minimization
60
Thank You!
Appendix A
Proof: ๐‘ณ๐ŸŽ Minimization is NP Hard
• The solution for ๐ฟ0 gradient minimization for some vector ๐‘ฅ is given by: min ๐‘ฅ
• The definition of ๐‘ฅ
0
0
s. t. ๐ด๐‘ฅ − ๐‘ < ฯต
is number of non-zero entries in ๐‘ฅ.
• Consider the simplest case where ๐‘ฅ
0
= 1 but you don't know the location of that non-zero entry.
• We have ๐‘1 possibilities and to find the solution we have to examine the values of all the
unique minimizer.
• Similarly, if ๐‘ฅ
0
= ๐‘˜, you need to search
๐‘
๐‘˜
possibilities. i.e., the algorithm grows as
๐‘
๐‘˜
๐‘
1
possibilities for finding the
with increase in ๐‘˜.
• Since ๐‘˜ is not known a priori, you have to check for all the ๐‘ possible values of ๐‘˜.
• Hence, the complexity of the algorithm is
๐‘
๐‘–=1
๐‘
๐‘–
• This is NP hard.
7/1/2016
L0 Gradient Minimization
62
Appendix B
Solving Minimization Step
๐‘“ = ๐‘†๐‘– − ๐ผ๐‘–
2
+ ๐‘†๐‘– − ๐ผ๐‘—
2
๐‘“′ = 0
2 ๐‘†๐‘– − ๐ผ๐‘– + 2 ๐‘†๐‘– − ๐ผ๐‘— = 0
4๐‘†๐‘– − 2๐ผ๐‘– − 2๐ผ๐‘— = 0
(๐ผ๐‘– +๐ผ๐‘— )
๐‘†๐‘– =
2
7/1/2016
L0 Gradient Minimization
63
References
1. Xu, L., Lu, C., Xu, Y., and Jia, J., "Image smoothing via L0 gradient
minimization." ACM Transactions on Graphics (TOG), Vol. 30, No. 6, ACM,
2011.
2. Cheng, X., Zeng, M., and Liu, X., "Feature-preserving filtering with L0 gradient
minimization." Computers & Graphics, 38, 150-157, 2014.
3. Nguyen, Rang M. H., and Brown, M. S., "Fast and Effective L0 Gradient
Minimization by Region Fusion." International Conference on Computer
Vision (ICCV), 2015.
7/1/2016
L0 Gradient Minimization
64
Download