SlideShare a Scribd company logo
1 of 155
Download to read offline
ECE 285
Image and video restoration
Chapter IV – Variational methods
Charles Deledalle
March 21, 2019
1
Heat equation
Heat diffusion – Motivation
?
−→
• How can we remove noise from an image?
• What image can best explain this noisy observation?
• Takes inspiration from our physical world
Best explanation is the one with maximal entropy
i.e., with the minimum amount of chaos
• Heat, in an isolated system, evolves such that
the total entropy increases over time
2
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 6
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 11
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 16
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 21
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 26
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 31
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 36
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 41
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 46
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
3
Heat diffusion
time t = 1
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
time t = 46
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Heat diffusion acts as a denoiser
• Spatial fluctuations of temperatures vanish with time (maximum entropy),
• Think of pixel values as temperature,
• Can heat diffusion help us to reduce noise?
3
Heat equation – Definition
Heat equation
The heat equation, a Partial Differential Equation (PDE), given by
∂x
∂t
(s, t) = α∆x(s, t) or in short
∂x
∂t
= α∆x and x(s, 0) = y(s)
+ some boundary conditions and where
• s = (s1, s2) ∈ [0, 1]2
: space location
• t 0: time location
• x(s, t) ∈ R: temperature at position s and time t
• α > 0: thermal conductivity constant
• ∆: Laplacian operator
∆ =
∂2
∂s2
1
+
∂2
∂s2
2
The rate of change is proportional to the spatial curvature of the temperature.
4
Heat equation – Implementation
How to solve the heat equation?
2 solutions:
1 Heat equation −→ Discrete equation −→ Numerical scheme
2 Heat equation −−→ Continuous solution −−→ Discretization
5
Heat equation – Implementation
How to solve the heat equation?
2 solutions:
1 Heat equation −→ Discrete equation −→ Numerical scheme
2 Heat equation −−→ Continuous solution −−→ Discretization
5
Heat equation – Discretization
Discretization of the working space
• Periodical boundary conditions
x(0, s2, t) = x(1, s2, t) and x(s1, 0, t) = x(s1, 1, t).
• Map the discrete grid to the continuous coordinates (s1, s2, t)
(s1, s2, t) = (iδs1 , jδs2 , kδt)
where (i, j) ∈ [0, n1] × [0, n2], k ∈ [0, m], δsi =
1
ni
and δt =
Tmax
m
.
6
Heat equation – Discretization
• Then, replace function x by its discrete version:
xk
i,j = x(iδs1 , jδs2 , kδt)
• i: index for pixels with first coordinate s1 = iδs1
• j: index for pixels with second coordinate s2 = jδs2
• k: is an index for time t = kδt
The notation xk
is not “x to the power k” but “x at time index k”.
7
Heat equation – Finite differences
Recall: we want to discretize
∂x
∂t
(s, t) = α∆x(s, t) and x(s, 0) = y(s)
Finite differences
• Replace first order derivative by forward finite difference in time
∂x
∂t
(iδs1 , jδs2 , kδt) ≈
xk+1
i,j − xk
i,j
δt
8
Heat equation – Finite differences
Recall: we want to discretize
∂x
∂t
(s, t) = α∆x(s, t) and x(s, 0) = y(s)
Finite differences
• Replace first order derivative by forward finite difference in time
∂x
∂t
(iδs1 , jδs2 , kδt) ≈
xk+1
i,j − xk
i,j
δt
• Replace second order derivative by central finite difference in space
∆x(iδs1 , jδs2 , kδt) ≈
xk
i−1,j + xk
i+1,j + xk
i,j−1 + xk
i,j−1 − 4xk
i,j
δs1 δs2
8
Heat equation – Finite differences
Recall: we want to discretize
∂x
∂t
(s, t) = α∆x(s, t) and x(s, 0) = y(s)
Finite differences
• Rewrite everything in matrix/vector form
∂x
∂t
(·, ·, kδt) ≈
1
δt
(xk+1
− xk
) and ∆x(·, ·, kδt) ≈
1
δs1 δs2
∆xk
where ∆ in the right-hand side is the discrete Laplacian.
• We get
1
δt
(xk+1
− xk
) =
α
δs1 δs2
∆xk
and x0
= y
9
Heat equation – Discrete Laplacian
∆x =



















































First line Second line
. . .
Last line
4 −1 −1 −1 −1
−1 4 −1 −1 −1
...
...
...
... 0
...
...
...
...
...
...
−1 −1 4 −1 −1
−1 4 −1 −1 −1
−1 −1 4 −1 −1
...
...
...
...
... 0
...
...
...
...
...
−1 −1 −1 4 −1
0
...
...
...
−1 −1 4 −1 −1
−1 −1 −1 4 −1
... 0
...
...
...
...
...
...
...
...
−1 −1 −1 −1 4





































































































x1,1
x1,2
...
...
x1,n2
x2,1
x2,2
...
...
x2,n2
...
xn1,1
xn1,2
...
...
xn1,n2


















































because of periodical boundary conditions.
10
Heat equation – Explicit Euler scheme
Forward discretized scheme – Explicit Euler scheme
The heat equation ∂x
∂t
= α∆x and x(s, 0) = y(s)
rewrites as 1
δt
(xk+1
− xk
) =
α
δs1 δs2
∆xk
and x0
= y
which leads to the iterative scheme, that repeats for k = 0 to m
xk+1
= xk
+ γ∆xk
and x0
= y where γ =
αδt
δs1 δs2
11
Heat equation – Explicit Euler scheme
Forward discretized scheme – Explicit Euler scheme
The heat equation ∂x
∂t
= α∆x and x(s, 0) = y(s)
rewrites as 1
δt
(xk+1
− xk
) =
α
δs1 δs2
∆xk
and x0
= y
which leads to the iterative scheme, that repeats for k = 0 to m
xk+1
= xk
+ γ∆xk
and x0
= y where γ =
αδt
δs1 δs2
Convergence: |xk
i,j − x(iδs1 , jδs2 , kδt)| −−−−−→
δs1 →0
δs2
→0
δt→0
0, for all (i, j, k)
11
Heat equation – Explicit Euler scheme
Forward discretized scheme – Explicit Euler scheme
The heat equation ∂x
∂t
= α∆x and x(s, 0) = y(s)
rewrites as 1
δt
(xk+1
− xk
) =
α
δs1 δs2
∆xk
and x0
= y
which leads to the iterative scheme, that repeats for k = 0 to m
xk+1
= xk
+ γ∆xk
and x0
= y where γ =
αδt
δs1 δs2
Convergence: |xk
i,j − x(iδs1 , jδs2 , kδt)| −−−−−→
δs1 →0
δs2
→0
δt→0
0, for all (i, j, k)
δs1 and δs2 are fixed (by the size of the image grid).
δt influences the number of iterations k used to reach t = kδt.
δt should be small enough (for convergence),
and large enough (for computation time).
11
Heat equation – Explicit Euler scheme
Stability
• The discretization scheme is stable, if there exists C > 0 such that
for all (i, j, k), |xk
i,j| C|yi,j|.
• Stability prevents the iterates from diverging.
• If moreover numerical errors do not accumulate, xk
converges with k.
12
Heat equation – Explicit Euler scheme
Stability
• The discretization scheme is stable, if there exists C > 0 such that
for all (i, j, k), |xk
i,j| C|yi,j|.
• Stability prevents the iterates from diverging.
• If moreover numerical errors do not accumulate, xk
converges with k.
Courant-Friedrichs-Lewy (CFL) conditions
The sequence xk is stable if: γ =
αδt
δs1 δs2
<
1
2d
where d = 2 for images
In particular we get m > 2dαTmaxn1n2
#iterations increases linearly with #pixels
⇒ for k to reach m, at least O(n2
1n2
2) operations, i.e., it is really slow.
12
Heat equation – Explicit Euler scheme
Geometric progression
The explicit Euler scheme can be rewritten as
xk+1
= xk
+ γ∆xk
= (Idn + γ∆)xk
, (n = n1n2)
it is a geometric progression, hence: xk
= (Idn + γ∆)k
y
13
Heat equation – Explicit Euler scheme
Geometric progression
The explicit Euler scheme can be rewritten as
xk+1
= xk
+ γ∆xk
= (Idn + γ∆)xk
, (n = n1n2)
it is a geometric progression, hence: xk
= (Idn + γ∆)k
y
Diagonalization
• ∆ performs a periodical convolution with kernel:



0 1 0
1 −4 1
0 1 0



• Diagonal in the discrete Fourier domain: ∆ = F−1
ΛF, with Λ diagonal
(a) ∆ (b) Re[F(∆)] (c) Im[F(∆)]
13
Heat equation – Explicit Euler scheme
Geometric progression + Diagonalization
• The explicit Euler scheme becomes
xk
= (Idn + γF−1
ΛF)k
y
= (F−1
F + γF−1
ΛF)k
y
= (F−1
(Id + γΛ)F)k
y
= F−1
(Id + γΛ)F × F−1
(Id + γΛ)F × . . . × F−1
(Id + γΛ)F
k times
y
= F−1
(Id + γΛ) × . . . × (Id + γΛ)
k times
Fy
= F−1
(Id + γΛ)k
diagonal matrix
Fy
• The explicit Euler solution is a convolution,
• Solution in O(n log n) whatever k.
14
Heat equation – Explicit Euler scheme – Results
# Load image (assumed to be square)
x = plt.imread('assets/cat.png')
n1, n2 = x.shape
sw = 20/255
y = x + sw * np.random.randn(n1, n2)
# Create Laplacian kernel in Fourier
nu = (im.kernel('laplacian1'),
im.kernel('laplacian2'))
L = im.kernel2fft(nu, n1, n2, separable='sum')
# Define problem setting (T = m * dt)
m = 10
rho = .99
alpha = 1
dx2 = 1 / (n1 - 1) / (n2 - 1)
dt = rho * dx2 / (4 * alpha)
gamma = alpha * dt / dx2
# Compute explicit Euler solution
K_ee = (1 + gamma * L)**m
x_ee = im.convolvefft(y, K_ee)
(d) x (unknown) (e) y (observation)
(f) T=10−4
, ρ=0.99 (g) T=10−4
, ρ=1.30
15
Heat equation – Implicit Euler scheme
Backward discretized scheme – Implicit Euler scheme
If instead we choose a backward difference in time
1
δt
(xk+1
− xk
) = α
1
δs1 δs2
∆xk+1
and x0
= y
this leads to the iterative scheme
xk+1
= (Idn − γ∆)−1
xk
and x0
= y.
This sequence is stable whatever γ, but requires solving a linear system.
16
Heat equation – Implicit Euler scheme
Geometric progression and diagonalization
• Geometric progression: xk
= (Idn − γ∆)−k
y
• Again, since ∆ = F−1
ΛF is diagonal in the Fourier domain
xk
= F−1
(Idn − γΛ)−k
Fy.
• The implicit Euler solution is again a convolution.
• Can be computed in O(n log n) whatever k.
17
Heat equation – Implicit Euler scheme
# Compute explicit Euler solution
K_ee = (1 + gamma * L)**k
x_ee = im.convolvefft(y, K_ee)
# Compute implicit Euler solution
K_ie = 1 / (1 - gamma * L)**k
x_ie = im.convolvefft(y, K_ie)
18
Heat equation – Implicit Euler scheme
# Compute explicit Euler solution
K_ee = (1 + gamma * L)**k
x_ee = im.convolvefft(y, K_ee)
# Compute implicit Euler solution
K_ie = 1 / (1 - gamma * L)**k
x_ie = im.convolvefft(y, K_ie)
(a) x (unknown) (b) y (observation)
ExplicitEuler
(c) T=10−4
, ρ=0.99 (d) T=10−4
, ρ=1.30
ImplicitEuler
(e) T=10−4
, ρ=0.99 (f) T=10−4
, ρ=1.30
18
Heat equation – Implicit Euler scheme
# Compute explicit Euler solution
K_ee = (1 + gamma * L)**k
x_ee = im.convolvefft(y, K_ee)
# Compute implicit Euler solution
K_ie = 1 / (1 - gamma * L)**k
x_ie = im.convolvefft(y, K_ie)
(a) x (unknown) (b) y (observation)
ExplicitEuler
(c) T=10−4
, ρ=0.99 (d) T=10−4
, ρ=1.30
ImplicitEuler
(e) T=10−4
, ρ=0.99 (f) T=10−4
, ρ=1.30
Q: How both schemes compare
to the continuous solution
when ρ < 1?
18
Heat equation – Implementation
How to solve the heat equation?
2 solutions:
1 Heat equation −→ Discrete equation −→ Numerical scheme
2 Heat equation −−→ Continuous solution −−→ Discretization
19
Heat equation – Continuous solution
Theorem
• Consider the continuous heat equation defined as
∂x
∂t
(s, t) = α∆x(s, t) and x(s, 0) = y(s)
where s ∈ Rd
(no restrictions to [0, 1]d
, without boundary conditions).
• The exact solution is given by the d-dimensional Gaussian convolution
x(s, t) = (y ∗ G2αt)(s) =
Rd
y(s − u)
1
√
4παt
d
e−
||u||2
2
4αt du
(d = 2 for images).
20
Heat equation – Discretization of the solution
Continuous solution for d = 2
x(s1, s2, t) =
1
4παt
+∞
−∞
y(s1 − u1, s2 − u2)e−
||u||2
2
4αt du1 du2 = (y ∗ G2αt)(s1, s2)
Discretization
xk
i,j = x(iδs1 , jδs2 , kδt) ≈
1
4πγk u∈Z v∈Z
yi−u,j−ve
− u2+v2
4γk
discrete convolution
= (y ∗ G2γk)i,j
Periodization
• Finally, we approximate the convolution in our periodic grid [1,
√
n]2
.
u∈Z v∈Z
≈
n1/2
u=− n1/2 +1
n2/2
v=− n2/2 +1
21
Heat equation – Discretization of the solution – Python demo
# Compute explicit Euler solution
K_ee = (1 + gamma * L)**k
x_ee = im.convolvefft(y, K_ee)
# Compute implicit Euler solution
K_ie = 1 / (1 - gamma * L)**k
x_ie = im.convolvefft(y, K_ie)
# Compute continuous solution
u, v = im.fftgrid(n1, n2)
K_cs = np.exp(-(u**2 + v**2) / (4*gamma*k)) / (4*np.pi*gamma*k)
K_cs = nf.fft2(K_cs, axes=(0, 1))
x_cs = im.convolvefft(y, K_cs)
22
Heat equation – Comparing the results
(a) y (observation)
T=10−4
T=10−3
T=10−2
(b) Explicit Euler (c) Implicit Euler (d) Continuous
23
Heat equation – Comparing the results
(a) y (observation)
T=10−4
T=10−3
T=10−2
(b) Explicit Euler (c) Implicit Euler (d) Continuous
The three schemes provide similar solutions in O(n log n).
23
Heat equation – Comparing the convolution kernels
T=10−4
-15 -10 -5 0 5 10 15
0
0.01
0.02
0.03
0.04
0.05
0.06
Explicit Euler
Implicit Euler
Continuous
T=10−3
-40 -20 0 20 40
0
1
2
3
4
10 -3
Explicit Euler
Implicit Euler
Continuous
T=10−2
(a) Explicit Euler (b) Implicit Euler (c) Continuous
-100 -50 0 50 100
0
1
2
3
4
10 -4
Explicit Euler
Implicit Euler
Continuous
(d) 1D slice
24
Heat equation – Comparing the convolution kernels
T=10−4
-15 -10 -5 0 5 10 15
0
0.01
0.02
0.03
0.04
0.05
0.06
Explicit Euler
Implicit Euler
Continuous
T=10−3
-40 -20 0 20 40
0
1
2
3
4
10 -3
Explicit Euler
Implicit Euler
Continuous
T=10−2
(a) Explicit Euler (b) Implicit Euler (c) Continuous
-100 -50 0 50 100
0
1
2
3
4
10 -4
Explicit Euler
Implicit Euler
Continuous
(d) 1D slice
For the same choice of δt satisfying the CFL condition,
the implicit and continuous solutions have less oscillations.
All three converge with t to the same solution.
24
Heat equation – Summary
Summary
• Solutions of the heat equations reduce fluctuations/details of the image,
• The continuous solution is a Gaussian convolution (LTI filter),
• Discretizations lead to near Gaussian convolutions,
• The width of the convolution kernel increases with time t,
• For t → ∞, the solution is the constant mean image.
(a) t = 0 (b) t = 10−4
(c) t = 10−3
(d) t = 10−2
25
Scale space
Scale space
Definition (Scale space)
• A family of images x(s1, s2, t), where
• t is the scale-space parameter
• x(s1, s2, 0) = y(s1, s2) is the original image
• increasing t corresponds to coarser resolutions
• and satisfying (scale-space conditions)
• causality: coarse details are “caused” by fine details
• new details should not arise in coarse scale images
Gaussian blurring is a local averaging operation.
It does not respect natural boundaries 26
Scale space
Linear scale space
• Solutions of the heat equation define a linear scale space,
• Each scale is a linear transform/convolution of the previous one.
• Recall that Gaussians have a multi-scale property: Gγ2 ∗ Gγ2 = G2γ2 .
27
Scale space
Linear scale space
• Solutions of the heat equation define a linear scale space,
• Each scale is a linear transform/convolution of the previous one.
• Recall that Gaussians have a multi-scale property: Gγ2 ∗ Gγ2 = G2γ2 .
• Define an edge as a local extremum of the first derivative [Witkin, 1983]
1 Edge location is not preserved across the scale space,
2 Two edges may merge with increasing size,
3 An edge may not split into two with increasing size. 27
Scale space
• Nonlinear-filter (e.g., median filters) can be used to generate a scale-space,
• But, they usually violate the causality condition.
28
Scale space
• Nonlinear-filter (e.g., median filters) can be used to generate a scale-space,
• But, they usually violate the causality condition.
Non-linear scale space
• Immediate localization: fixed edge locations
• Piece-wise smoothing: diffuse between boundaries
At all scales the image will consist of smooth regions separated by edges.
How to build such a scale-space?
28
Anisotropic diffusion
Towards non-linear diffusion
The conductivity α controls the amount of smoothing per time unit
∂x
∂t
= α∆x ≡ x(s, t) = y ∗ G2αt
Image-dependent conductivity
∆ =
∂2
∂s2
1
+
∂2
∂s2
2
= ∂
∂s1
∂
∂s2
∂
∂s1
∂
∂s2
= T
= div
• Rewrite the heat equation as
∂x
∂t
= div(α x)
• Basic ideas:
• make α evolve with space/time in order to preserve edges,
• set α = 0 around edges, and α > 0 inside regions,
• encourage intra-region smoothing,
• and discourage inter-region smoothing.
29
Anisotropic diffusion – Perona-Malik model
Anisotropic diffusion [Perona and Malik, 1990]
∂x
∂t
= div(g(|| x||2
2)
α
x) with x(s1, s2, 0) = y(s1, s2)
where g : R+
→ [0, 1] is decreasing and satisfies
g(0) = 1 and lim
u→∞
g(u) = 0.
• Inside regions with small gradient: fast isotropic diffusion,
• Around edges with large gradients: small diffusion,
• In fact isotropic, sometimes referred to as inhomogeneous diffusion.
(a) Heat equation / linear diffusion (b) Inhomogeneous diffusion 30
Anisotropic diffusion – Perona-Malik model
Common choices (for β > 0):
g(u) =
β
β + u
or g(u) = exp −
u
β
0 1 2 3 4 5 6 7 8 9 10
0
0.2
0.4
0.6
0.8
1
31
Anisotropic diffusion – Variants
Regularized Perona-Malik model [Catt´e, Lions, Morel, Coll, 1992]
• Classical Perona-Malik solution may be ill-posed:
The PDE may have no solution or an infinite number of solutions,
⇒ In practice: small perturbations in y lead to strong deviations.
• Idea: smooth the conductivity field at a small cost of localization
∂x
∂t
= div(g(|| (Gσ ∗ x)||2
2) x)
where Gσ2 is a small Gaussian kernel of width σ > 0.
(c) x0 (d) y = x0 + w (e) x400
(AD) (f) x400
(R-AD)
32
Anisotropic diffusion – Resolution schemes
General diffusion model
∂x
∂t
= A(x)x
with



• Heat equation: A(x) = ∆ = div
• Perona-Malik: A(x) = div g(|| x||2
2)
• Reg. Perona-Malik: A(x) = div g(|| (Gσ∗x)||2
2)
Except for the heat equation,
no explicit continuous solutions in general.
33
Anisotropic diffusion – Resolution schemes
Resolution schemes: discretization in time
1 Explicit: xk+1
= (Id + γA(xk
))xk
(direct)
2 Semi-implicit: xk+1
= (Id − γA(xk
))−1
xk
(linear system to invert)
3 Fully-implicit: xk+1
= (Id − γA(xk+1
))−1
xk
(nonlinear)
Because A depends on xk
, these are not geometric progressions.
• Need to be run iteratively,
• For explicit scheme:



• Same CFL conditions γ < 1
2d
⇒ at least O(n2
) for k to reach time m.
34
Anisotropic diffusion – Explicit scheme – Python example
Example (Explicit scheme for R-AD)
xk+1
= xk
+ γ div(g(|| (Gσ ∗ xk
)||2
2) xk
)
with g : R → R and γ <
1
2d
g = lambda u: beta / (beta + u)
nu = im.kernel('gaussian', tau=sigma, s1=2, s2=2)
# Explicit scheme for regularized anisotropic diffusion
x = y
for k in range(m):
x_conv = im.convolve(x, nu)
alpha = g(im.norm2(im.grad(x_conv)))
x = x + gamma * im.div(alpha * im.grad(x))
35
Anisotropic diffusion – Explicit scheme – Results
(a) x0 (b) x5
(heat) (c) x15
(heat) (d) x30
(heat) (e) x300
(heat)
(f) y = x0 + w (g) x5
(R-AD) (h) x15
(R-AD) (i) x30
(R-AD) (j) x300
(R-AD)
36
Anisotropic diffusion – Explicit scheme – Results
(a) x0 (b) g5
(R-AD) (c) g15
(R-AD) (d) g30
(R-AD) (e) g300
(R-AD)
(f) y = x0 + w (g) x5
(R-AD) (h) x15
(R-AD) (i) x30
(R-AD) (j) x300
(R-AD)
36
Anisotropic diffusion – Semi-implicit scheme
Example (Implicit scheme)
xk+1
= (Id − γA(xk
))−1
xk
and converges for any γ > 0
Naive idea
• At each iteration k, build the matrix M = Id − γA(xk
)
• Invert it with the function inv of Python.
Problem of the naive idea (1/2)
• M is a n × n matrix,
• If your image is n = 1024 × 1024 (8Mb), this will require
sizeof(double) × n × n = 8 · 240
= 8Tb
37
Anisotropic diffusion – Semi-implicit scheme
Problem of the naive idea (2/2)
• Best case scenario, you have a few Gb of RAM:
Python stops and says “Out of memory”
• Not too bad scenario, you have more than 8Tb of RAM:
computation takes forever (in general O(n3
)) −→ kill Python
• Worst case scenario, you have less but close to 8Tb of RAM:
OS starts swapping and is non-responsive −→ hard reboot
38
Anisotropic diffusion – Semi-implicit scheme
Take home message
• When we write on paper y = Mx (with x and y images), in your code:
never
39
Anisotropic diffusion – Semi-implicit scheme
Take home message
• When we write on paper y = Mx (with x and y images), in your code:
never, never
39
Anisotropic diffusion – Semi-implicit scheme
Take home message
• When we write on paper y = Mx (with x and y images), in your code:
never, never, never
39
Anisotropic diffusion – Semi-implicit scheme
Take home message
• When we write on paper y = Mx (with x and y images), in your code:
never, never, never, never build the matrix M
39
Anisotropic diffusion – Semi-implicit scheme
Take home message
• When we write on paper y = Mx (with x and y images), in your code:
never, never, never, never build the matrix M
• What is the alternative?
• Use knowledge on the structure of M to compute y = Mx quickly
• As for the FFT: Fx = fft2(x) (you never had to build F)
• If M = 1
n






1 1 . . . 1
1 1 . . . 1
...
1 1 . . . 1






, how do I compute Mx in O(n)?
• If M is sparse (# of non-zero entries in O(n)), use sparse matrices.
Design the operator z → Mz rather than M
39
Anisotropic diffusion – Semi-implicit scheme
But how do I compute x = M−1
y if I do not build M?
• Solve the system
Mx = y
with a solver that only needs to know the operator z → Mz.
Conjugate gradient
• If M is square symmetric definite positive, conjugate gradient solves the
system by iteratively evaluating z → Mz at different locations z.
• Use im.cg. Example to solve 2x = y:
x = im.cg(lambda z: 2 * z, y)
40
Anisotropic diffusion – Semi-implicit scheme
Explicit: xk+1
= (Id + γA(xk
))xk
Implicit: xk+1
= (Id − γA(xk
))−1
xk
# Explicit vs Implict scheme for regularized anisotropic diffusion
x_e = y
x_i = y
for k in range(m):
# Explicit (0 < gamma < 0.25)
x_e = rad_step(x_e, x_e, sigma, gamma, g)
# Implicit (0 < gamma)
x_i = im.cg(lambda z: rad_step(x_i, z, sigma, -gamma, g), x_i)
# One step r = (Id + gamma A(x)) z for the regularized AD
nu = im.kernel('gaussian', tau=sigma, s1=2, s2=2)
def rad_step(x, z, sigma, gamma, g):
x_conv = im.convolve(x, nu)
alpha = g(im.norm2(im.grad(x_conv)))
r = z + gamma * im.div(alpha * im.grad(z))
41
Anisotropic diffusion – Semi-implicit scheme – Results
Input
(a) σw = 20
Explicit
(b) k = 100, γ = 0.24 (c) k = 1, γ = 0.24 × 100
Implicit
(d) k = 100, γ = 0.24 (3× slower) (e) k =1, γ =0.24×100 (2× faster)
(Note: M also block tri-diagonal ⇒ Thomas algorithm can be used and is even faster)
42
Anisotropic diffusion – Limitations
(a) x0 (original) (b) y = x0 + w (c) x (Perona-Malik) (d) y − x (method noise)
Behavior
• Inside regions with small gradient magnitude: fast isotropic smoothing.
• Diffusion stops around strong image gradients (structure-preserving).
• Noise on edges are not reduced by Perona-Malik solutions.
Can we be really anisotropic?
43
Anisotropic diffusion – Truly anisotropic behavior?
(a) Homogeneous (b) Inhomogeneous (c) Anisotropic
• Make neighborhoods truly anisotropic.
• Reminder: ellipses in 2d = encoded by a 2 × 2 sdp matrix
(rotation + re-scaling)
• Replace the conductivity by a matrix-valued function
∂x
∂t
= div(T(x) x
matrix vector product
).
• T maps each pixel position of x to a 2 × 2 matrix.
• T(x) is called a tensor field,
• The function T should control the direction of the flow.
44
Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999]
45
Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999]
45
Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999]
∂x
∂t
= div(T(x) x)
where T(x) = h[Gρ∗(( Gσ∗x)( Gσ∗x)T
local covariance matrix
)]
with h E
λ2
1
λ2
2
E−1
= E
g(λ2
1)
g(λ2
2)
E−1
decreasing (matrix-valued) function of the eigenvalues
and E = e1 e2 ←− eigenvectors
46
Anisotropic diffusion – Comparison
(a) x (P-M., 1990) (b) y − x (method noise) (c) x (Weickert, 1999) (d) y − x (method noise)
Behavior
• Inside regions with small gradient magnitude: fast smoothing,
• Around objects: diffusion aligns to anisotropic structures,
• Noise on edges reduced compared to inhomogeneous isotropic diffusion.
47
Anisotropic diffusion – Illustrations
Figure 1 – (left) input y. (right) truly anisotropic diffusion
Source: A. Roussos
48
Anisotropic diffusion – Illustrations
Figure 2 – (left) input y. (middle) inhomogeneous diffusion. (right) truly anisotropic.
Source: A. Roussos
49
Anisotropic diffusion – Illustrations
Figure 3 – (left) input y. (middle) inhomogeneous diffusion. (right) truly anisotropic.
Source: A. Roussos
50
Anisotropic diffusion – Remaining issues
• When to stop the diffusion?
• How to use that for deblurring / super-resolution / linear inverse problems?
• Non-adapted for non-Gaussian noises (e.g., impulse noise).
GaussiannoiseImpulsenoise
(a) Input image (b) Perona-Malik (c) Conductivity
51
Variational methods
Variational methods
Definition
A variational problem is as an optimization problem of the form
min
x
F(x) =
Ω
f(s, x, x) ds
where
• Ω: image support (ex: [0, 1]2
),
• x : Ω → R: function that maps a position s to a value,
• x : Ω → R2
: gradient of x,
• s = (s1, s2) ∈ Ω: space location,
• f(s, p, v): loss chosen for a given task,
• F: functional that maps a function to a value.
(function of a function)
52
Variational methods - Tikhonov functional
Example (Tikhonov functional)
• Consider the inverse problem y = H(x) + w, with H linear.
• The Tikhonov functional F is, for τ > 0, defined as
F(x) =
1
2 Ω
(H(x)(s) − y(s))2
+ τ|| x(s)||2
2 ds
or, in short, we write
=
1
2 Ω
(H(x) − y)2
data fit
+τ || x||2
2
smoothing
ds
• Look for x such that its degraded version H(x) is close to y.
• But, discourage x to have large spatial variations.
• τ: regularization parameter (trade-off).
53
Variational methods - Tikhonov functional
Pick the image x with smallest: Data-fit + Smoothness
54
Variational methods - Tikhonov functional
F(x) =
1
2 Ω
(H(x) − y)2
data fit
+ τ || x||2
2
smoothing
ds
Example (Tikhonov functional)
• The image x is forced to be close to the noisy image y through H, but the
amplitudes of its gradient are penalized to avoid overfitting the noise.
• The parameter τ > 0 controls the regularization.
• For τ → 0, the problem becomes ill-posed/ill-conditioned,
noise remains and may be amplified.
• For τ → ∞, x tends to be constant (depends on boundary conditions).
55
Variational methods - Tikhonov functional
(a) Low resolution y
Tikhonov regularization for × 16 super-resolution
(b) τ = 0 (c) Small τ (d) Good τ (e) High τ (f) τ → ∞
56
Variational methods
How to solve this variational problem?
2 solutions:
1 Functional −→ Discretization −→ Numerical scheme
2 Functional −→ PDE −→ Discretization & Euler schemes
57
Variational methods
How to solve this variational problem?
2 solutions:
1 Functional −→ Discretization −→ Numerical scheme
2 Functional −→ PDE −→ Discretization & Euler schemes
(we won’t discuss it, cf., Euler-Lagrange equation)
57
Variational methods – Smooth optimization
Discretization of the functional
min
x
F(x) =
n
k=1
f(k, x, x)
• n: number of pixels,
• k: pixel index, corresponding to location sk,
• x ∈ Rn
: discrete image,
• x: discrete image gradient,
• F : Rn
→ R: function of a vector.
• Classical optimization problem,
• Look for a vector x that cancels the gradient of F,
• If no explicit solutions, use gradient descent.
58
Variational methods – Smooth optimization
Lipschitz gradient
• A differentiable function F has L Lipschitz gradient, if
|| F(x1) − F(x2)||2 L||x1 − x2||2, for all x1, x2 .
• The mapping x → F(x) is necessarily continuous.
• If F is twice differentiable
L = sup
x
|| 2
F(x)
Hessian matrix of F
||2.
where for a matrix A, its 2-norm ||A||2 is its maximal singular value.
59
Variational methods – Smooth optimization
Be careful:
• x ∈ Rn×2
is a 2d discrete vector field,
corresponding to the discrete gradient of the image x.
• ( x)k ∈ R2
is a 2d vector: the discrete gradient of x at location sk.
• F(x) ∈ Rn
is the (continuous) gradient of F at x.
• ( F(x))k ∈ R: variation of F for an infinitessimal variation of the pixel value xk.
60
Variational methods – Smooth optimization
Gradient descent
• Let F be a real function, differentiable and lower bounded with a L
Lipschitz gradient. Then, whatever the initialization x0
, if 0 < γ < 2/L,
the sequence
xk+1
= xk
− γ F(xk
) ,
converges to a stationary point x (i.e., it cancels the gradient)
F(x ) = 0 .
• The parameter γ is called the step size.
• A too small step size γ leads to slow convergence.
• For 0 < γ < 2/L, the sequence F(xk
) decays with a rate in O(1/k).
61
Variational methods – Smooth optimization
These two curves cross at x such that F(x ) = 0
62
Variational methods – Smooth optimization
Here γ is small: slow convergence
62
Variational methods – Smooth optimization
γ a bit larger: faster convergence
62
Variational methods – Smooth optimization
γ ≈ 1/L even larger: around fastest convergence
62
Variational methods – Smooth optimization
γ a bit too large: convergence slows down
62
Variational methods – Smooth optimization
γ too large: convergence too slow again
62
Variational methods – Smooth optimization
γ > 2/L: divergence
63
Variational methods – Smooth optimization
Gradient descent for convex function
• If moreover F is convex
F(λx1 + (1 − λ)x2) λF(x1) + (1 − λ)F(x2), ∀x1, x2, λ ∈ (0, 1) ,
then, the gradient descent converges towards a global minimum
x ∈ argmin
x
F(x).
• Note: All stationary points are global minimum (non necessarily unique).
64
Variational methods – Smooth optimization
One-dimension
Two-dimensions
*
*
*
*
65
Variational methods – Smooth optimization
Example (Tikhonov functional (1/6))
• The functional F is
F(x) =
1
2 Ω
(H(x) − y)2
data fit
+τ || x||2
2
smoothing
ds .
• Its discretization leads to
F(x) =
1
2
k
((Hx)k − yk)2
+
τ
2
k
||( x)k||2
2
=
1
2
||Hx − y||2
2 +
τ
2
|| x||2
2,2
• 2,2/Frobenius norm of a matrix:
||A||2
2,2 =
k
||Ak||2
2 =
l
A2
kl = tr A∗
A = A, A .
• Scalar product between matrices: tr A∗
B = A, B .
66
Variational methods – Smooth optimization
F(x) =
1
2
||Hx − y||2
2 +
τ
2
|| x||2
2,2
Example (Tikhonov functional (2/6))
• This function is differentiable and convex, since
• If f convex, x → f(Ax + b) is convex,
• Norms are convex,
• Quadratic functions are convex,
• Sums and compositions of convex functions are convex.
• We can solve this problem using gradient descent.
67
Variational methods – Smooth optimization
F(x) =
1
2
||Hx − y||2
2 +
τ
2
|| x||2
2,2
Example (Tikhonov functional (3/6))
• Note that || x||2
2,2 = x, x = x, − div x = − x, ∆x , then
F(x) =
1
2
(||Hx||2
+ ||y||2
− 2 Hx, y ) −
τ
2
x, ∆x
=
1
2
( x, H∗
Hx + ||y||2
− 2 x, H∗
y ) −
τ
2
x, ∆x
• The gradient is thus given by
F(x) =
1
2
((H∗
H + H∗
H)x − 2H∗
y − τ(∆ + ∆∗
)x)
= H∗
(Hx − y) − τ∆x
Note: x, Ay = Ay and x, Ax = (A + A∗
)x
68
Variational methods – Smooth optimization
Example (Tikhonov functional (4/6))
• The gradient descent reads as
xk+1
= xk
− γ F(xk
)
= xk
− γ(H∗
(Hxk
− y) − τ∆xk
)
with γ < 2
L
where L = ||H∗
H + τ∆||2.
• Triangle inequality: L ||H||2
2 + τ4d since ||∆||2 = 4d.
• For τ → ∞ and x0
= y, this converges to the explicit Euler scheme for the
Heat equation. The condition γ < 2
L
is equivalent to the CFL condition.
Solutions of the Heat equation tends to
minimize the smoothing term.
This explains why at convergence the Heat equation provides constant
solutions (when using periodical boundary solutions).
69
Variational methods – Smooth optimization
Example (Tikhonov functional (5/6))
xk+1
= xk
− γ(H∗
(Hxk
− y)
retroaction
−τ∆xk
)
• The retroaction allows to remain close to the observation.
• Unlike the solution of the Heat equation,
this numerical scheme converges to a solution of interest.
• Classical stopping criteria:
• fixed number m of iterations (k = 1 to m),
• |F(xk+1
) − F(xk
)|/|F(xk
)| < ε, or
• ||xk+1
− xk
||/||xk
|| < ε.
Where does Tikhonov regularization converge to?
70
Variational methods
Example (Tikhonov regularization (6/6))
• Explicit solution
F(x) = H∗
(Hx − y) − τ∆x = 0
⇔
x = (H∗
H − τ∆)−1
H∗
y
• Can be directly solved by conjugate gradient.
• Tikhonov regularization is linear (non-adaptive).
• If H is a blur, this is a convolution by a sharpening kernel (LTI filter).
How to incorporate inhomogeneity `a la Perona-Malik?
71
Variational methods - Robust regularization
Use robust regularizers to pick the good canditate
72
Variational methods – Robust regularization
Example (Robust regularization (1/2))
F(x) =
1
2 Ω
(Hx − y)2
data fit
+τ G(|| x||2
2)
regularization
ds
• After discretization, its gradient is given by
F(x) = H∗
(Hx − y) − τ div(g(|| x||2
2) x)
where g(u) = G (u).
• The gradient descent becomes
xk+1
= xk
− γ(H∗
(Hx − y)
retroaction
−τ div(g(|| x||2
2) x) .
Without the retroaction term (τ → ∞),
this is exactly the explicit Euler scheme for the anisotropic diffusion.
73
Variational methods – Robust regularization
(a) Low resolution y
Robust regularization for × 16 super-resolution
(b) Tiny τ (c) Small τ (d) Good τ (e) High τ (f) Huge τ
74
Variational methods – Robust regularization
(a) Low resolution y
Tikhonov regularization for × 16 super-resolution
(b) Tiny τ (c) Small τ (d) Good τ (e) High τ (f) Huge τ
74
Variational methods – Robust regularization
What are the choice of G,
leading to the choice of Perona and Malik?
Example (Robust regularization (2/2))
G(u) = u ⇒ g(u) = 1 (Heat)
G(u) = β log(β + u) ⇒ g(u) =
β
β + u
(AD)
G(u) = β 1 − exp −
u
β
⇒ g(u) = exp −
u
β
(AD)
75
Variational methods – Robust regularization
-10 -8 -6 -4 -2 0 2 4 6 8 10
0
1
2
3
4
5
• Tikhonov (blue) is convex:
⇒ global minimum
• huge penalization for large gradients: does not allow for edges,
⇒ smooth solutions.
• The other two are non-convex:
⇒ stationary point depending on the initialization
• small penalization for large gradients: allows for edges (robust),
⇒ sharp solutions.
76
Total-Variation
Total-Variation
Can we take the best of both worlds?
Total-Variation (TV) or ROF model [Rudin, Osher, Fatemi, 1992]
F(x) =
Ω
1
2
(Hx − y)2
+ τ|| x||2 ds TV(x) =
Ω
|| x||2 ds
-5 -4 -3 -2 -1 0 1 2 3 4 5
0
1
2
3
4
5
• Tightest convex penalty. • Convex, robust and induces sparsity.
77
Total-Variation – One-dimensional case
One-dimensional case
F(x) =
1
2
(Hx − y)2
+ τ| x| ds
1d Total-Variation
• Its discretization leads to
F(x) =
1
2
||Hx − y||2
2 +
τ
2
k
|( x)k|
=
1
2
||Hx − y||2
2 +
τ
2
|| x||1
• p norm of a vector:
||v||p =
k
|vk|p
1/p
78
Total-Variation – One-dimensional case
Source:J.Salmon
For TV, the gradient will be zero for most of its coordinates.
This is due to the corners of the 1 ball.
79
Total-Variation – One-dimensional case
Gradient sparsity
• Sparsity of the gradient ⇔ piece wise constant solutions
• Non-smooth (non-differentiable) ⇒ can’t use gradient descent.
Large noise reduction with edge preservation
but, convex non-smooth optimization problem.
A solution: proximal splitting methods (in a few classes),
kinds of implicit Euler schemes.
80
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the regularization parameter τ
• Too small: noise overfitting / staircasing,
• Too large: loss of contrast, loss of objects.
81
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the noise level σ
• Large noise: staircasing + loss of contrast.
• Small noise: noise reduction + edge preservation
82
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the noise level σ
• Large noise: staircasing + loss of contrast.
• Small noise: noise reduction + edge preservation
82
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the noise level σ
• Large noise: staircasing + loss of contrast.
• Small noise: noise reduction + edge preservation
82
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the noise level σ
• Large noise: staircasing + loss of contrast.
• Small noise: noise reduction + edge preservation
82
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Evolution with the noise level σ
• Large noise: staircasing + loss of contrast.
• Small noise: noise reduction + edge preservation
83
Total-Variation – One-dimensional case (denoising)
20 40 60 80 100 120 140 160 180
-50
0
50
100
150
200
250
Set of non-zero gradients (jumps) is sparse
20 40 60 80 100 120 140 160 180
83
Total-Variation – Two-dimensional case
Two-dimensional case
F(x) =
1
2
(Hx − y)2
+ τ|| x||2 ds
2d Total-Variation
• Its discretization leads to
F(x) =
1
2
||Hx − y||2
2 +
τ
2
k
||( x)k||2
=
1
2
||Hx − y||2
2 +
τ
2
|| x||2,1
• p,q norm of a matrix:
||A||p,q =


k l
|Akl|p
q/p


1/q
84
Total-Variation – Results
(a) Blurry image y
TV regularization for deconvolution of motion blur
(b) Tiny τ (c) Small τ (d) Medium τ (e) High τ (f) Huge τ 85
Total-Variation – Results
(a) Blurry image y
85
Total-Variation – Results
(b) Tiny τ
85
Total-Variation – Results
(c) Small τ
85
Total-Variation – Results
(d) Relatively small τ
85
Total-Variation – Results
(e) Medium τ
85
Total-Variation – Results
(f) Large τ
85
Total-Variation – Results
(g) Largerer τ
85
Total-Variation – Results
(h) Even smaller τ
85
Total-Variation – Results
(i) Huge τ
85
Total-Variation – Results
TV regularization for denoising
NoisyimageTotal-Variation(≈50s)
(a) Noise σ = 10 (b) σ = 20 (c) σ = 40 (d) σ = 60 86
Total-Variation – Results
TV regularization for denoising
NoisyimageBNL-means(≈30s)
(a) Noise σ = 10 (b) σ = 20 (c) σ = 40 (d) σ = 60 86
Total-Variation – Two-dimensional case
Variant: Anisotropic TV
F(x) =
1
2
(Hx − y)2
+ τ|| x||1 ds
Anisotropic Total-Variation
• Its discretization leads to
F(x) =
1
2
||Hx − y||2
2 +
τ
2
k
||( x)k||1
=
1
2
||Hx − y||2
2 +
τ
2
|| x||1,1
• Anisotropic behavior:
• Penalizes more the gardient in diagonal directions,
• Favor horizontal and vertical structures,
• By opposition the 2,1 version is called Isotropic TV.
87
Total-Variation – Two-dimensional case
(a) Sparsity induced by ||Ax||1,1 (b) Group sparsity induced by ||Ax||2,1
⇒ many zero entries ⇒ many zero rows
Anisotropic TV: components of the gradient of each pixel are independent.
Isotropic TV: the two components of the gradient are grouped together.
88
Total-Variation – Two-dimensional case
(a) Independent (b) Blocks of gradients (c) Gradients and colors
We can also group the colors to avoid color aberrations.
89
Total-Variation – Two-dimensional case
(a) Noisy image (b) Anisotropic TV (c) Anisotropic TV + Color
90
Total-Variation – Two-dimensional case
(a) Noisy image (b) Isotropic TV (c) Isotropic TV + Color
90
Total-Variation – Remaining issues
• What to choose for the regularization τ?
• Loss of textures (high frequency objects)
−→ images are not piece-wise constant,
• Non-adapted for non-Gaussian noises (e.g., impulse noise).
(a) Gaussian noise (b) TV result (c) Impulse noise (d) TV result
91
Variational methods – Further reading
For further reading
• Variational methods for image segmentation:
• Mumford-Shah functional (1989),
• Active contours / Snakes (Kass et al, 1988),
• Chan-Vese functional (2001).
• Link with Gibbs priors and Markov Random Fields (MRF):
• Geman & Geman model (1984),
• Graph cuts (Boykov, Veksler, Zabih, 2001), (Ishikawa, 2003),
−→ Applications in Computer-Vision.
• For more evolved regularization terms:
• Fields of Experts (Roth & Black, 2008).
• Total-Generalized Variation (Bredies, Kunisch, Pock, 2010).
• Link with Machine learning / Sparse regression:
• LASSO (Tibshirani, 1996) / Fused LASSO / Group LASSO.
92
Questions?
Next class: Bayesian methods
Sources and images courtesy of
• L. Condat
• I. Kokkinos
• G. Rosman
• A. Roussos
• J. Salmon
• Wikipedia
92

More Related Content

What's hot

Scattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisScattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisVjekoslavKovac1
 
Gamma beta functions-1
Gamma   beta functions-1Gamma   beta functions-1
Gamma beta functions-1Selvaraj John
 
Bellman functions and Lp estimates for paraproducts
Bellman functions and Lp estimates for paraproductsBellman functions and Lp estimates for paraproducts
Bellman functions and Lp estimates for paraproductsVjekoslavKovac1
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential slides
 
Discrete control2 converted
Discrete control2 convertedDiscrete control2 converted
Discrete control2 convertedcairo university
 
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerCopy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerJoepang2015
 
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...Tomoya Murata
 
Some Examples of Scaling Sets
Some Examples of Scaling SetsSome Examples of Scaling Sets
Some Examples of Scaling SetsVjekoslavKovac1
 
Tales on two commuting transformations or flows
Tales on two commuting transformations or flowsTales on two commuting transformations or flows
Tales on two commuting transformations or flowsVjekoslavKovac1
 
Introduction to neural networks
Introduction to neural networks Introduction to neural networks
Introduction to neural networks Ahmad Hammoudeh
 
Gamma and betta function harsh shah
Gamma and betta function  harsh shahGamma and betta function  harsh shah
Gamma and betta function harsh shahC.G.P.I.T
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theoremWathna
 
Signals and Systems Formula Sheet
Signals and Systems Formula SheetSignals and Systems Formula Sheet
Signals and Systems Formula SheetHaris Hassan
 

What's hot (20)

Scattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisScattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysis
 
Computer science-formulas
Computer science-formulasComputer science-formulas
Computer science-formulas
 
Gamma beta functions-1
Gamma   beta functions-1Gamma   beta functions-1
Gamma beta functions-1
 
Bellman functions and Lp estimates for paraproducts
Bellman functions and Lp estimates for paraproductsBellman functions and Lp estimates for paraproducts
Bellman functions and Lp estimates for paraproducts
 
2018 MUMS Fall Course - Mathematical surrogate and reduced-order models - Ral...
2018 MUMS Fall Course - Mathematical surrogate and reduced-order models - Ral...2018 MUMS Fall Course - Mathematical surrogate and reduced-order models - Ral...
2018 MUMS Fall Course - Mathematical surrogate and reduced-order models - Ral...
 
Tables
TablesTables
Tables
 
Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential Solution to schrodinger equation with dirac comb potential
Solution to schrodinger equation with dirac comb potential
 
Discrete control2 converted
Discrete control2 convertedDiscrete control2 converted
Discrete control2 converted
 
Copy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquerCopy of y16 02-2119divide-and-conquer
Copy of y16 02-2119divide-and-conquer
 
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...
Doubly Accelerated Stochastic Variance Reduced Gradient Methods for Regulariz...
 
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
2018 MUMS Fall Course - Bayesian inference for model calibration in UQ - Ralp...
 
2018 MUMS Fall Course - Sampling-based techniques for uncertainty propagation...
2018 MUMS Fall Course - Sampling-based techniques for uncertainty propagation...2018 MUMS Fall Course - Sampling-based techniques for uncertainty propagation...
2018 MUMS Fall Course - Sampling-based techniques for uncertainty propagation...
 
Some Examples of Scaling Sets
Some Examples of Scaling SetsSome Examples of Scaling Sets
Some Examples of Scaling Sets
 
Tales on two commuting transformations or flows
Tales on two commuting transformations or flowsTales on two commuting transformations or flows
Tales on two commuting transformations or flows
 
Introduction to neural networks
Introduction to neural networks Introduction to neural networks
Introduction to neural networks
 
Legendre functions
Legendre functionsLegendre functions
Legendre functions
 
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
2018 MUMS Fall Course - Statistical Representation of Model Input (EDITED) - ...
 
Gamma and betta function harsh shah
Gamma and betta function  harsh shahGamma and betta function  harsh shah
Gamma and betta function harsh shah
 
Rosser's theorem
Rosser's theoremRosser's theorem
Rosser's theorem
 
Signals and Systems Formula Sheet
Signals and Systems Formula SheetSignals and Systems Formula Sheet
Signals and Systems Formula Sheet
 

Similar to IVR - Chapter 4 - Variational methods

LINEAR SYSTEMS
LINEAR SYSTEMSLINEAR SYSTEMS
LINEAR SYSTEMSJazzieJao1
 
Recurrences
RecurrencesRecurrences
RecurrencesDEVTYPE
 
Solved exercises double integration
Solved exercises double integrationSolved exercises double integration
Solved exercises double integrationKamel Attar
 
Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...Alexander Litvinenko
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFTtaha25
 
Ray : modeling dynamic systems
Ray : modeling dynamic systemsRay : modeling dynamic systems
Ray : modeling dynamic systemsHouw Liong The
 
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...Alexander Litvinenko
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniquesKrishna Gali
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationAlexander Litvinenko
 
Week 8 [compatibility mode]
Week 8 [compatibility mode]Week 8 [compatibility mode]
Week 8 [compatibility mode]Hazrul156
 

Similar to IVR - Chapter 4 - Variational methods (20)

Rand final
Rand finalRand final
Rand final
 
numerical.ppt
numerical.pptnumerical.ppt
numerical.ppt
 
LINEAR SYSTEMS
LINEAR SYSTEMSLINEAR SYSTEMS
LINEAR SYSTEMS
 
Recurrences
RecurrencesRecurrences
Recurrences
 
Ch[1].2
Ch[1].2Ch[1].2
Ch[1].2
 
Solved exercises double integration
Solved exercises double integrationSolved exercises double integration
Solved exercises double integration
 
Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...Low rank tensor approximation of probability density and characteristic funct...
Low rank tensor approximation of probability density and characteristic funct...
 
M220w07
M220w07M220w07
M220w07
 
Dsp U Lec10 DFT And FFT
Dsp U   Lec10  DFT And  FFTDsp U   Lec10  DFT And  FFT
Dsp U Lec10 DFT And FFT
 
The Gaussian Hardy-Littlewood Maximal Function
The Gaussian Hardy-Littlewood Maximal FunctionThe Gaussian Hardy-Littlewood Maximal Function
The Gaussian Hardy-Littlewood Maximal Function
 
Ray : modeling dynamic systems
Ray : modeling dynamic systemsRay : modeling dynamic systems
Ray : modeling dynamic systems
 
002 ray modeling dynamic systems
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systems
 
002 ray modeling dynamic systems
002 ray modeling dynamic systems002 ray modeling dynamic systems
002 ray modeling dynamic systems
 
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
Computing f-Divergences and Distances of\\ High-Dimensional Probability Densi...
 
Integration techniques
Integration techniquesIntegration techniques
Integration techniques
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
 
Maths05
Maths05Maths05
Maths05
 
Quick run through on classical mechancis and quantum mechanics
Quick run through on classical mechancis and quantum mechanics Quick run through on classical mechancis and quantum mechanics
Quick run through on classical mechancis and quantum mechanics
 
UNIT I_4.pdf
UNIT I_4.pdfUNIT I_4.pdf
UNIT I_4.pdf
 
Week 8 [compatibility mode]
Week 8 [compatibility mode]Week 8 [compatibility mode]
Week 8 [compatibility mode]
 

More from Charles Deledalle

MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferCharles Deledalle
 
MLIP - Chapter 5 - Detection, Segmentation, Captioning
MLIP - Chapter 5 - Detection, Segmentation, CaptioningMLIP - Chapter 5 - Detection, Segmentation, Captioning
MLIP - Chapter 5 - Detection, Segmentation, CaptioningCharles Deledalle
 
MLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsMLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsCharles Deledalle
 
MLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningMLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningCharles Deledalle
 
MLIP - Chapter 2 - Preliminaries to deep learning
MLIP - Chapter 2 - Preliminaries to deep learningMLIP - Chapter 2 - Preliminaries to deep learning
MLIP - Chapter 2 - Preliminaries to deep learningCharles Deledalle
 
IVR - Chapter 5 - Bayesian methods
IVR - Chapter 5 - Bayesian methodsIVR - Chapter 5 - Bayesian methods
IVR - Chapter 5 - Bayesian methodsCharles Deledalle
 
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and waveletsIVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and waveletsCharles Deledalle
 
IVR - Chapter 7 - Patch models and dictionary learning
IVR - Chapter 7 - Patch models and dictionary learningIVR - Chapter 7 - Patch models and dictionary learning
IVR - Chapter 7 - Patch models and dictionary learningCharles Deledalle
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) Charles Deledalle
 
IVR - Chapter 3 - Basics of filtering II: Spectral filters
IVR - Chapter 3 - Basics of filtering II: Spectral filtersIVR - Chapter 3 - Basics of filtering II: Spectral filters
IVR - Chapter 3 - Basics of filtering II: Spectral filtersCharles Deledalle
 
IVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionIVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionCharles Deledalle
 

More from Charles Deledalle (12)

Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transferMLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
MLIP - Chapter 6 - Generation, Super-Resolution, Style transfer
 
MLIP - Chapter 5 - Detection, Segmentation, Captioning
MLIP - Chapter 5 - Detection, Segmentation, CaptioningMLIP - Chapter 5 - Detection, Segmentation, Captioning
MLIP - Chapter 5 - Detection, Segmentation, Captioning
 
MLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNsMLIP - Chapter 4 - Image classification and CNNs
MLIP - Chapter 4 - Image classification and CNNs
 
MLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learningMLIP - Chapter 3 - Introduction to deep learning
MLIP - Chapter 3 - Introduction to deep learning
 
MLIP - Chapter 2 - Preliminaries to deep learning
MLIP - Chapter 2 - Preliminaries to deep learningMLIP - Chapter 2 - Preliminaries to deep learning
MLIP - Chapter 2 - Preliminaries to deep learning
 
IVR - Chapter 5 - Bayesian methods
IVR - Chapter 5 - Bayesian methodsIVR - Chapter 5 - Bayesian methods
IVR - Chapter 5 - Bayesian methods
 
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and waveletsIVR - Chapter 6 - Sparsity, shrinkage and wavelets
IVR - Chapter 6 - Sparsity, shrinkage and wavelets
 
IVR - Chapter 7 - Patch models and dictionary learning
IVR - Chapter 7 - Patch models and dictionary learningIVR - Chapter 7 - Patch models and dictionary learning
IVR - Chapter 7 - Patch models and dictionary learning
 
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb) IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
IVR - Chapter 2 - Basics of filtering I: Spatial filters (25Mb)
 
IVR - Chapter 3 - Basics of filtering II: Spectral filters
IVR - Chapter 3 - Basics of filtering II: Spectral filtersIVR - Chapter 3 - Basics of filtering II: Spectral filters
IVR - Chapter 3 - Basics of filtering II: Spectral filters
 
IVR - Chapter 1 - Introduction
IVR - Chapter 1 - IntroductionIVR - Chapter 1 - Introduction
IVR - Chapter 1 - Introduction
 

Recently uploaded

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 

IVR - Chapter 4 - Variational methods

  • 1. ECE 285 Image and video restoration Chapter IV – Variational methods Charles Deledalle March 21, 2019 1
  • 3. Heat diffusion – Motivation ? −→ • How can we remove noise from an image? • What image can best explain this noisy observation? • Takes inspiration from our physical world Best explanation is the one with maximal entropy i.e., with the minimum amount of chaos • Heat, in an isolated system, evolves such that the total entropy increases over time 2
  • 4. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 5. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 6 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 6. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 11 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 7. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 16 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 8. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 21 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 9. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 26 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 10. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 31 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 11. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 36 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 12. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 41 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 13. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 46 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 3
  • 14. Heat diffusion time t = 1 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 time t = 46 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 Heat diffusion acts as a denoiser • Spatial fluctuations of temperatures vanish with time (maximum entropy), • Think of pixel values as temperature, • Can heat diffusion help us to reduce noise? 3
  • 15. Heat equation – Definition Heat equation The heat equation, a Partial Differential Equation (PDE), given by ∂x ∂t (s, t) = α∆x(s, t) or in short ∂x ∂t = α∆x and x(s, 0) = y(s) + some boundary conditions and where • s = (s1, s2) ∈ [0, 1]2 : space location • t 0: time location • x(s, t) ∈ R: temperature at position s and time t • α > 0: thermal conductivity constant • ∆: Laplacian operator ∆ = ∂2 ∂s2 1 + ∂2 ∂s2 2 The rate of change is proportional to the spatial curvature of the temperature. 4
  • 16. Heat equation – Implementation How to solve the heat equation? 2 solutions: 1 Heat equation −→ Discrete equation −→ Numerical scheme 2 Heat equation −−→ Continuous solution −−→ Discretization 5
  • 17. Heat equation – Implementation How to solve the heat equation? 2 solutions: 1 Heat equation −→ Discrete equation −→ Numerical scheme 2 Heat equation −−→ Continuous solution −−→ Discretization 5
  • 18. Heat equation – Discretization Discretization of the working space • Periodical boundary conditions x(0, s2, t) = x(1, s2, t) and x(s1, 0, t) = x(s1, 1, t). • Map the discrete grid to the continuous coordinates (s1, s2, t) (s1, s2, t) = (iδs1 , jδs2 , kδt) where (i, j) ∈ [0, n1] × [0, n2], k ∈ [0, m], δsi = 1 ni and δt = Tmax m . 6
  • 19. Heat equation – Discretization • Then, replace function x by its discrete version: xk i,j = x(iδs1 , jδs2 , kδt) • i: index for pixels with first coordinate s1 = iδs1 • j: index for pixels with second coordinate s2 = jδs2 • k: is an index for time t = kδt The notation xk is not “x to the power k” but “x at time index k”. 7
  • 20. Heat equation – Finite differences Recall: we want to discretize ∂x ∂t (s, t) = α∆x(s, t) and x(s, 0) = y(s) Finite differences • Replace first order derivative by forward finite difference in time ∂x ∂t (iδs1 , jδs2 , kδt) ≈ xk+1 i,j − xk i,j δt 8
  • 21. Heat equation – Finite differences Recall: we want to discretize ∂x ∂t (s, t) = α∆x(s, t) and x(s, 0) = y(s) Finite differences • Replace first order derivative by forward finite difference in time ∂x ∂t (iδs1 , jδs2 , kδt) ≈ xk+1 i,j − xk i,j δt • Replace second order derivative by central finite difference in space ∆x(iδs1 , jδs2 , kδt) ≈ xk i−1,j + xk i+1,j + xk i,j−1 + xk i,j−1 − 4xk i,j δs1 δs2 8
  • 22. Heat equation – Finite differences Recall: we want to discretize ∂x ∂t (s, t) = α∆x(s, t) and x(s, 0) = y(s) Finite differences • Rewrite everything in matrix/vector form ∂x ∂t (·, ·, kδt) ≈ 1 δt (xk+1 − xk ) and ∆x(·, ·, kδt) ≈ 1 δs1 δs2 ∆xk where ∆ in the right-hand side is the discrete Laplacian. • We get 1 δt (xk+1 − xk ) = α δs1 δs2 ∆xk and x0 = y 9
  • 23. Heat equation – Discrete Laplacian ∆x =                                                    First line Second line . . . Last line 4 −1 −1 −1 −1 −1 4 −1 −1 −1 ... ... ... ... 0 ... ... ... ... ... ... −1 −1 4 −1 −1 −1 4 −1 −1 −1 −1 −1 4 −1 −1 ... ... ... ... ... 0 ... ... ... ... ... −1 −1 −1 4 −1 0 ... ... ... −1 −1 4 −1 −1 −1 −1 −1 4 −1 ... 0 ... ... ... ... ... ... ... ... −1 −1 −1 −1 4                                                                                                      x1,1 x1,2 ... ... x1,n2 x2,1 x2,2 ... ... x2,n2 ... xn1,1 xn1,2 ... ... xn1,n2                                                   because of periodical boundary conditions. 10
  • 24. Heat equation – Explicit Euler scheme Forward discretized scheme – Explicit Euler scheme The heat equation ∂x ∂t = α∆x and x(s, 0) = y(s) rewrites as 1 δt (xk+1 − xk ) = α δs1 δs2 ∆xk and x0 = y which leads to the iterative scheme, that repeats for k = 0 to m xk+1 = xk + γ∆xk and x0 = y where γ = αδt δs1 δs2 11
  • 25. Heat equation – Explicit Euler scheme Forward discretized scheme – Explicit Euler scheme The heat equation ∂x ∂t = α∆x and x(s, 0) = y(s) rewrites as 1 δt (xk+1 − xk ) = α δs1 δs2 ∆xk and x0 = y which leads to the iterative scheme, that repeats for k = 0 to m xk+1 = xk + γ∆xk and x0 = y where γ = αδt δs1 δs2 Convergence: |xk i,j − x(iδs1 , jδs2 , kδt)| −−−−−→ δs1 →0 δs2 →0 δt→0 0, for all (i, j, k) 11
  • 26. Heat equation – Explicit Euler scheme Forward discretized scheme – Explicit Euler scheme The heat equation ∂x ∂t = α∆x and x(s, 0) = y(s) rewrites as 1 δt (xk+1 − xk ) = α δs1 δs2 ∆xk and x0 = y which leads to the iterative scheme, that repeats for k = 0 to m xk+1 = xk + γ∆xk and x0 = y where γ = αδt δs1 δs2 Convergence: |xk i,j − x(iδs1 , jδs2 , kδt)| −−−−−→ δs1 →0 δs2 →0 δt→0 0, for all (i, j, k) δs1 and δs2 are fixed (by the size of the image grid). δt influences the number of iterations k used to reach t = kδt. δt should be small enough (for convergence), and large enough (for computation time). 11
  • 27. Heat equation – Explicit Euler scheme Stability • The discretization scheme is stable, if there exists C > 0 such that for all (i, j, k), |xk i,j| C|yi,j|. • Stability prevents the iterates from diverging. • If moreover numerical errors do not accumulate, xk converges with k. 12
  • 28. Heat equation – Explicit Euler scheme Stability • The discretization scheme is stable, if there exists C > 0 such that for all (i, j, k), |xk i,j| C|yi,j|. • Stability prevents the iterates from diverging. • If moreover numerical errors do not accumulate, xk converges with k. Courant-Friedrichs-Lewy (CFL) conditions The sequence xk is stable if: γ = αδt δs1 δs2 < 1 2d where d = 2 for images In particular we get m > 2dαTmaxn1n2 #iterations increases linearly with #pixels ⇒ for k to reach m, at least O(n2 1n2 2) operations, i.e., it is really slow. 12
  • 29. Heat equation – Explicit Euler scheme Geometric progression The explicit Euler scheme can be rewritten as xk+1 = xk + γ∆xk = (Idn + γ∆)xk , (n = n1n2) it is a geometric progression, hence: xk = (Idn + γ∆)k y 13
  • 30. Heat equation – Explicit Euler scheme Geometric progression The explicit Euler scheme can be rewritten as xk+1 = xk + γ∆xk = (Idn + γ∆)xk , (n = n1n2) it is a geometric progression, hence: xk = (Idn + γ∆)k y Diagonalization • ∆ performs a periodical convolution with kernel:    0 1 0 1 −4 1 0 1 0    • Diagonal in the discrete Fourier domain: ∆ = F−1 ΛF, with Λ diagonal (a) ∆ (b) Re[F(∆)] (c) Im[F(∆)] 13
  • 31. Heat equation – Explicit Euler scheme Geometric progression + Diagonalization • The explicit Euler scheme becomes xk = (Idn + γF−1 ΛF)k y = (F−1 F + γF−1 ΛF)k y = (F−1 (Id + γΛ)F)k y = F−1 (Id + γΛ)F × F−1 (Id + γΛ)F × . . . × F−1 (Id + γΛ)F k times y = F−1 (Id + γΛ) × . . . × (Id + γΛ) k times Fy = F−1 (Id + γΛ)k diagonal matrix Fy • The explicit Euler solution is a convolution, • Solution in O(n log n) whatever k. 14
  • 32. Heat equation – Explicit Euler scheme – Results # Load image (assumed to be square) x = plt.imread('assets/cat.png') n1, n2 = x.shape sw = 20/255 y = x + sw * np.random.randn(n1, n2) # Create Laplacian kernel in Fourier nu = (im.kernel('laplacian1'), im.kernel('laplacian2')) L = im.kernel2fft(nu, n1, n2, separable='sum') # Define problem setting (T = m * dt) m = 10 rho = .99 alpha = 1 dx2 = 1 / (n1 - 1) / (n2 - 1) dt = rho * dx2 / (4 * alpha) gamma = alpha * dt / dx2 # Compute explicit Euler solution K_ee = (1 + gamma * L)**m x_ee = im.convolvefft(y, K_ee) (d) x (unknown) (e) y (observation) (f) T=10−4 , ρ=0.99 (g) T=10−4 , ρ=1.30 15
  • 33. Heat equation – Implicit Euler scheme Backward discretized scheme – Implicit Euler scheme If instead we choose a backward difference in time 1 δt (xk+1 − xk ) = α 1 δs1 δs2 ∆xk+1 and x0 = y this leads to the iterative scheme xk+1 = (Idn − γ∆)−1 xk and x0 = y. This sequence is stable whatever γ, but requires solving a linear system. 16
  • 34. Heat equation – Implicit Euler scheme Geometric progression and diagonalization • Geometric progression: xk = (Idn − γ∆)−k y • Again, since ∆ = F−1 ΛF is diagonal in the Fourier domain xk = F−1 (Idn − γΛ)−k Fy. • The implicit Euler solution is again a convolution. • Can be computed in O(n log n) whatever k. 17
  • 35. Heat equation – Implicit Euler scheme # Compute explicit Euler solution K_ee = (1 + gamma * L)**k x_ee = im.convolvefft(y, K_ee) # Compute implicit Euler solution K_ie = 1 / (1 - gamma * L)**k x_ie = im.convolvefft(y, K_ie) 18
  • 36. Heat equation – Implicit Euler scheme # Compute explicit Euler solution K_ee = (1 + gamma * L)**k x_ee = im.convolvefft(y, K_ee) # Compute implicit Euler solution K_ie = 1 / (1 - gamma * L)**k x_ie = im.convolvefft(y, K_ie) (a) x (unknown) (b) y (observation) ExplicitEuler (c) T=10−4 , ρ=0.99 (d) T=10−4 , ρ=1.30 ImplicitEuler (e) T=10−4 , ρ=0.99 (f) T=10−4 , ρ=1.30 18
  • 37. Heat equation – Implicit Euler scheme # Compute explicit Euler solution K_ee = (1 + gamma * L)**k x_ee = im.convolvefft(y, K_ee) # Compute implicit Euler solution K_ie = 1 / (1 - gamma * L)**k x_ie = im.convolvefft(y, K_ie) (a) x (unknown) (b) y (observation) ExplicitEuler (c) T=10−4 , ρ=0.99 (d) T=10−4 , ρ=1.30 ImplicitEuler (e) T=10−4 , ρ=0.99 (f) T=10−4 , ρ=1.30 Q: How both schemes compare to the continuous solution when ρ < 1? 18
  • 38. Heat equation – Implementation How to solve the heat equation? 2 solutions: 1 Heat equation −→ Discrete equation −→ Numerical scheme 2 Heat equation −−→ Continuous solution −−→ Discretization 19
  • 39. Heat equation – Continuous solution Theorem • Consider the continuous heat equation defined as ∂x ∂t (s, t) = α∆x(s, t) and x(s, 0) = y(s) where s ∈ Rd (no restrictions to [0, 1]d , without boundary conditions). • The exact solution is given by the d-dimensional Gaussian convolution x(s, t) = (y ∗ G2αt)(s) = Rd y(s − u) 1 √ 4παt d e− ||u||2 2 4αt du (d = 2 for images). 20
  • 40. Heat equation – Discretization of the solution Continuous solution for d = 2 x(s1, s2, t) = 1 4παt +∞ −∞ y(s1 − u1, s2 − u2)e− ||u||2 2 4αt du1 du2 = (y ∗ G2αt)(s1, s2) Discretization xk i,j = x(iδs1 , jδs2 , kδt) ≈ 1 4πγk u∈Z v∈Z yi−u,j−ve − u2+v2 4γk discrete convolution = (y ∗ G2γk)i,j Periodization • Finally, we approximate the convolution in our periodic grid [1, √ n]2 . u∈Z v∈Z ≈ n1/2 u=− n1/2 +1 n2/2 v=− n2/2 +1 21
  • 41. Heat equation – Discretization of the solution – Python demo # Compute explicit Euler solution K_ee = (1 + gamma * L)**k x_ee = im.convolvefft(y, K_ee) # Compute implicit Euler solution K_ie = 1 / (1 - gamma * L)**k x_ie = im.convolvefft(y, K_ie) # Compute continuous solution u, v = im.fftgrid(n1, n2) K_cs = np.exp(-(u**2 + v**2) / (4*gamma*k)) / (4*np.pi*gamma*k) K_cs = nf.fft2(K_cs, axes=(0, 1)) x_cs = im.convolvefft(y, K_cs) 22
  • 42. Heat equation – Comparing the results (a) y (observation) T=10−4 T=10−3 T=10−2 (b) Explicit Euler (c) Implicit Euler (d) Continuous 23
  • 43. Heat equation – Comparing the results (a) y (observation) T=10−4 T=10−3 T=10−2 (b) Explicit Euler (c) Implicit Euler (d) Continuous The three schemes provide similar solutions in O(n log n). 23
  • 44. Heat equation – Comparing the convolution kernels T=10−4 -15 -10 -5 0 5 10 15 0 0.01 0.02 0.03 0.04 0.05 0.06 Explicit Euler Implicit Euler Continuous T=10−3 -40 -20 0 20 40 0 1 2 3 4 10 -3 Explicit Euler Implicit Euler Continuous T=10−2 (a) Explicit Euler (b) Implicit Euler (c) Continuous -100 -50 0 50 100 0 1 2 3 4 10 -4 Explicit Euler Implicit Euler Continuous (d) 1D slice 24
  • 45. Heat equation – Comparing the convolution kernels T=10−4 -15 -10 -5 0 5 10 15 0 0.01 0.02 0.03 0.04 0.05 0.06 Explicit Euler Implicit Euler Continuous T=10−3 -40 -20 0 20 40 0 1 2 3 4 10 -3 Explicit Euler Implicit Euler Continuous T=10−2 (a) Explicit Euler (b) Implicit Euler (c) Continuous -100 -50 0 50 100 0 1 2 3 4 10 -4 Explicit Euler Implicit Euler Continuous (d) 1D slice For the same choice of δt satisfying the CFL condition, the implicit and continuous solutions have less oscillations. All three converge with t to the same solution. 24
  • 46. Heat equation – Summary Summary • Solutions of the heat equations reduce fluctuations/details of the image, • The continuous solution is a Gaussian convolution (LTI filter), • Discretizations lead to near Gaussian convolutions, • The width of the convolution kernel increases with time t, • For t → ∞, the solution is the constant mean image. (a) t = 0 (b) t = 10−4 (c) t = 10−3 (d) t = 10−2 25
  • 48. Scale space Definition (Scale space) • A family of images x(s1, s2, t), where • t is the scale-space parameter • x(s1, s2, 0) = y(s1, s2) is the original image • increasing t corresponds to coarser resolutions • and satisfying (scale-space conditions) • causality: coarse details are “caused” by fine details • new details should not arise in coarse scale images Gaussian blurring is a local averaging operation. It does not respect natural boundaries 26
  • 49. Scale space Linear scale space • Solutions of the heat equation define a linear scale space, • Each scale is a linear transform/convolution of the previous one. • Recall that Gaussians have a multi-scale property: Gγ2 ∗ Gγ2 = G2γ2 . 27
  • 50. Scale space Linear scale space • Solutions of the heat equation define a linear scale space, • Each scale is a linear transform/convolution of the previous one. • Recall that Gaussians have a multi-scale property: Gγ2 ∗ Gγ2 = G2γ2 . • Define an edge as a local extremum of the first derivative [Witkin, 1983] 1 Edge location is not preserved across the scale space, 2 Two edges may merge with increasing size, 3 An edge may not split into two with increasing size. 27
  • 51. Scale space • Nonlinear-filter (e.g., median filters) can be used to generate a scale-space, • But, they usually violate the causality condition. 28
  • 52. Scale space • Nonlinear-filter (e.g., median filters) can be used to generate a scale-space, • But, they usually violate the causality condition. Non-linear scale space • Immediate localization: fixed edge locations • Piece-wise smoothing: diffuse between boundaries At all scales the image will consist of smooth regions separated by edges. How to build such a scale-space? 28
  • 54. Towards non-linear diffusion The conductivity α controls the amount of smoothing per time unit ∂x ∂t = α∆x ≡ x(s, t) = y ∗ G2αt Image-dependent conductivity ∆ = ∂2 ∂s2 1 + ∂2 ∂s2 2 = ∂ ∂s1 ∂ ∂s2 ∂ ∂s1 ∂ ∂s2 = T = div • Rewrite the heat equation as ∂x ∂t = div(α x) • Basic ideas: • make α evolve with space/time in order to preserve edges, • set α = 0 around edges, and α > 0 inside regions, • encourage intra-region smoothing, • and discourage inter-region smoothing. 29
  • 55. Anisotropic diffusion – Perona-Malik model Anisotropic diffusion [Perona and Malik, 1990] ∂x ∂t = div(g(|| x||2 2) α x) with x(s1, s2, 0) = y(s1, s2) where g : R+ → [0, 1] is decreasing and satisfies g(0) = 1 and lim u→∞ g(u) = 0. • Inside regions with small gradient: fast isotropic diffusion, • Around edges with large gradients: small diffusion, • In fact isotropic, sometimes referred to as inhomogeneous diffusion. (a) Heat equation / linear diffusion (b) Inhomogeneous diffusion 30
  • 56. Anisotropic diffusion – Perona-Malik model Common choices (for β > 0): g(u) = β β + u or g(u) = exp − u β 0 1 2 3 4 5 6 7 8 9 10 0 0.2 0.4 0.6 0.8 1 31
  • 57. Anisotropic diffusion – Variants Regularized Perona-Malik model [Catt´e, Lions, Morel, Coll, 1992] • Classical Perona-Malik solution may be ill-posed: The PDE may have no solution or an infinite number of solutions, ⇒ In practice: small perturbations in y lead to strong deviations. • Idea: smooth the conductivity field at a small cost of localization ∂x ∂t = div(g(|| (Gσ ∗ x)||2 2) x) where Gσ2 is a small Gaussian kernel of width σ > 0. (c) x0 (d) y = x0 + w (e) x400 (AD) (f) x400 (R-AD) 32
  • 58. Anisotropic diffusion – Resolution schemes General diffusion model ∂x ∂t = A(x)x with    • Heat equation: A(x) = ∆ = div • Perona-Malik: A(x) = div g(|| x||2 2) • Reg. Perona-Malik: A(x) = div g(|| (Gσ∗x)||2 2) Except for the heat equation, no explicit continuous solutions in general. 33
  • 59. Anisotropic diffusion – Resolution schemes Resolution schemes: discretization in time 1 Explicit: xk+1 = (Id + γA(xk ))xk (direct) 2 Semi-implicit: xk+1 = (Id − γA(xk ))−1 xk (linear system to invert) 3 Fully-implicit: xk+1 = (Id − γA(xk+1 ))−1 xk (nonlinear) Because A depends on xk , these are not geometric progressions. • Need to be run iteratively, • For explicit scheme:    • Same CFL conditions γ < 1 2d ⇒ at least O(n2 ) for k to reach time m. 34
  • 60. Anisotropic diffusion – Explicit scheme – Python example Example (Explicit scheme for R-AD) xk+1 = xk + γ div(g(|| (Gσ ∗ xk )||2 2) xk ) with g : R → R and γ < 1 2d g = lambda u: beta / (beta + u) nu = im.kernel('gaussian', tau=sigma, s1=2, s2=2) # Explicit scheme for regularized anisotropic diffusion x = y for k in range(m): x_conv = im.convolve(x, nu) alpha = g(im.norm2(im.grad(x_conv))) x = x + gamma * im.div(alpha * im.grad(x)) 35
  • 61. Anisotropic diffusion – Explicit scheme – Results (a) x0 (b) x5 (heat) (c) x15 (heat) (d) x30 (heat) (e) x300 (heat) (f) y = x0 + w (g) x5 (R-AD) (h) x15 (R-AD) (i) x30 (R-AD) (j) x300 (R-AD) 36
  • 62. Anisotropic diffusion – Explicit scheme – Results (a) x0 (b) g5 (R-AD) (c) g15 (R-AD) (d) g30 (R-AD) (e) g300 (R-AD) (f) y = x0 + w (g) x5 (R-AD) (h) x15 (R-AD) (i) x30 (R-AD) (j) x300 (R-AD) 36
  • 63. Anisotropic diffusion – Semi-implicit scheme Example (Implicit scheme) xk+1 = (Id − γA(xk ))−1 xk and converges for any γ > 0 Naive idea • At each iteration k, build the matrix M = Id − γA(xk ) • Invert it with the function inv of Python. Problem of the naive idea (1/2) • M is a n × n matrix, • If your image is n = 1024 × 1024 (8Mb), this will require sizeof(double) × n × n = 8 · 240 = 8Tb 37
  • 64. Anisotropic diffusion – Semi-implicit scheme Problem of the naive idea (2/2) • Best case scenario, you have a few Gb of RAM: Python stops and says “Out of memory” • Not too bad scenario, you have more than 8Tb of RAM: computation takes forever (in general O(n3 )) −→ kill Python • Worst case scenario, you have less but close to 8Tb of RAM: OS starts swapping and is non-responsive −→ hard reboot 38
  • 65. Anisotropic diffusion – Semi-implicit scheme Take home message • When we write on paper y = Mx (with x and y images), in your code: never 39
  • 66. Anisotropic diffusion – Semi-implicit scheme Take home message • When we write on paper y = Mx (with x and y images), in your code: never, never 39
  • 67. Anisotropic diffusion – Semi-implicit scheme Take home message • When we write on paper y = Mx (with x and y images), in your code: never, never, never 39
  • 68. Anisotropic diffusion – Semi-implicit scheme Take home message • When we write on paper y = Mx (with x and y images), in your code: never, never, never, never build the matrix M 39
  • 69. Anisotropic diffusion – Semi-implicit scheme Take home message • When we write on paper y = Mx (with x and y images), in your code: never, never, never, never build the matrix M • What is the alternative? • Use knowledge on the structure of M to compute y = Mx quickly • As for the FFT: Fx = fft2(x) (you never had to build F) • If M = 1 n       1 1 . . . 1 1 1 . . . 1 ... 1 1 . . . 1       , how do I compute Mx in O(n)? • If M is sparse (# of non-zero entries in O(n)), use sparse matrices. Design the operator z → Mz rather than M 39
  • 70. Anisotropic diffusion – Semi-implicit scheme But how do I compute x = M−1 y if I do not build M? • Solve the system Mx = y with a solver that only needs to know the operator z → Mz. Conjugate gradient • If M is square symmetric definite positive, conjugate gradient solves the system by iteratively evaluating z → Mz at different locations z. • Use im.cg. Example to solve 2x = y: x = im.cg(lambda z: 2 * z, y) 40
  • 71. Anisotropic diffusion – Semi-implicit scheme Explicit: xk+1 = (Id + γA(xk ))xk Implicit: xk+1 = (Id − γA(xk ))−1 xk # Explicit vs Implict scheme for regularized anisotropic diffusion x_e = y x_i = y for k in range(m): # Explicit (0 < gamma < 0.25) x_e = rad_step(x_e, x_e, sigma, gamma, g) # Implicit (0 < gamma) x_i = im.cg(lambda z: rad_step(x_i, z, sigma, -gamma, g), x_i) # One step r = (Id + gamma A(x)) z for the regularized AD nu = im.kernel('gaussian', tau=sigma, s1=2, s2=2) def rad_step(x, z, sigma, gamma, g): x_conv = im.convolve(x, nu) alpha = g(im.norm2(im.grad(x_conv))) r = z + gamma * im.div(alpha * im.grad(z)) 41
  • 72. Anisotropic diffusion – Semi-implicit scheme – Results Input (a) σw = 20 Explicit (b) k = 100, γ = 0.24 (c) k = 1, γ = 0.24 × 100 Implicit (d) k = 100, γ = 0.24 (3× slower) (e) k =1, γ =0.24×100 (2× faster) (Note: M also block tri-diagonal ⇒ Thomas algorithm can be used and is even faster) 42
  • 73. Anisotropic diffusion – Limitations (a) x0 (original) (b) y = x0 + w (c) x (Perona-Malik) (d) y − x (method noise) Behavior • Inside regions with small gradient magnitude: fast isotropic smoothing. • Diffusion stops around strong image gradients (structure-preserving). • Noise on edges are not reduced by Perona-Malik solutions. Can we be really anisotropic? 43
  • 74. Anisotropic diffusion – Truly anisotropic behavior? (a) Homogeneous (b) Inhomogeneous (c) Anisotropic • Make neighborhoods truly anisotropic. • Reminder: ellipses in 2d = encoded by a 2 × 2 sdp matrix (rotation + re-scaling) • Replace the conductivity by a matrix-valued function ∂x ∂t = div(T(x) x matrix vector product ). • T maps each pixel position of x to a 2 × 2 matrix. • T(x) is called a tensor field, • The function T should control the direction of the flow. 44
  • 75. Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999] 45
  • 76. Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999] 45
  • 77. Anisotropic diffusion – Truly anisotropic behavior [Weickert, 1999] ∂x ∂t = div(T(x) x) where T(x) = h[Gρ∗(( Gσ∗x)( Gσ∗x)T local covariance matrix )] with h E λ2 1 λ2 2 E−1 = E g(λ2 1) g(λ2 2) E−1 decreasing (matrix-valued) function of the eigenvalues and E = e1 e2 ←− eigenvectors 46
  • 78. Anisotropic diffusion – Comparison (a) x (P-M., 1990) (b) y − x (method noise) (c) x (Weickert, 1999) (d) y − x (method noise) Behavior • Inside regions with small gradient magnitude: fast smoothing, • Around objects: diffusion aligns to anisotropic structures, • Noise on edges reduced compared to inhomogeneous isotropic diffusion. 47
  • 79. Anisotropic diffusion – Illustrations Figure 1 – (left) input y. (right) truly anisotropic diffusion Source: A. Roussos 48
  • 80. Anisotropic diffusion – Illustrations Figure 2 – (left) input y. (middle) inhomogeneous diffusion. (right) truly anisotropic. Source: A. Roussos 49
  • 81. Anisotropic diffusion – Illustrations Figure 3 – (left) input y. (middle) inhomogeneous diffusion. (right) truly anisotropic. Source: A. Roussos 50
  • 82. Anisotropic diffusion – Remaining issues • When to stop the diffusion? • How to use that for deblurring / super-resolution / linear inverse problems? • Non-adapted for non-Gaussian noises (e.g., impulse noise). GaussiannoiseImpulsenoise (a) Input image (b) Perona-Malik (c) Conductivity 51
  • 84. Variational methods Definition A variational problem is as an optimization problem of the form min x F(x) = Ω f(s, x, x) ds where • Ω: image support (ex: [0, 1]2 ), • x : Ω → R: function that maps a position s to a value, • x : Ω → R2 : gradient of x, • s = (s1, s2) ∈ Ω: space location, • f(s, p, v): loss chosen for a given task, • F: functional that maps a function to a value. (function of a function) 52
  • 85. Variational methods - Tikhonov functional Example (Tikhonov functional) • Consider the inverse problem y = H(x) + w, with H linear. • The Tikhonov functional F is, for τ > 0, defined as F(x) = 1 2 Ω (H(x)(s) − y(s))2 + τ|| x(s)||2 2 ds or, in short, we write = 1 2 Ω (H(x) − y)2 data fit +τ || x||2 2 smoothing ds • Look for x such that its degraded version H(x) is close to y. • But, discourage x to have large spatial variations. • τ: regularization parameter (trade-off). 53
  • 86. Variational methods - Tikhonov functional Pick the image x with smallest: Data-fit + Smoothness 54
  • 87. Variational methods - Tikhonov functional F(x) = 1 2 Ω (H(x) − y)2 data fit + τ || x||2 2 smoothing ds Example (Tikhonov functional) • The image x is forced to be close to the noisy image y through H, but the amplitudes of its gradient are penalized to avoid overfitting the noise. • The parameter τ > 0 controls the regularization. • For τ → 0, the problem becomes ill-posed/ill-conditioned, noise remains and may be amplified. • For τ → ∞, x tends to be constant (depends on boundary conditions). 55
  • 88. Variational methods - Tikhonov functional (a) Low resolution y Tikhonov regularization for × 16 super-resolution (b) τ = 0 (c) Small τ (d) Good τ (e) High τ (f) τ → ∞ 56
  • 89. Variational methods How to solve this variational problem? 2 solutions: 1 Functional −→ Discretization −→ Numerical scheme 2 Functional −→ PDE −→ Discretization & Euler schemes 57
  • 90. Variational methods How to solve this variational problem? 2 solutions: 1 Functional −→ Discretization −→ Numerical scheme 2 Functional −→ PDE −→ Discretization & Euler schemes (we won’t discuss it, cf., Euler-Lagrange equation) 57
  • 91. Variational methods – Smooth optimization Discretization of the functional min x F(x) = n k=1 f(k, x, x) • n: number of pixels, • k: pixel index, corresponding to location sk, • x ∈ Rn : discrete image, • x: discrete image gradient, • F : Rn → R: function of a vector. • Classical optimization problem, • Look for a vector x that cancels the gradient of F, • If no explicit solutions, use gradient descent. 58
  • 92. Variational methods – Smooth optimization Lipschitz gradient • A differentiable function F has L Lipschitz gradient, if || F(x1) − F(x2)||2 L||x1 − x2||2, for all x1, x2 . • The mapping x → F(x) is necessarily continuous. • If F is twice differentiable L = sup x || 2 F(x) Hessian matrix of F ||2. where for a matrix A, its 2-norm ||A||2 is its maximal singular value. 59
  • 93. Variational methods – Smooth optimization Be careful: • x ∈ Rn×2 is a 2d discrete vector field, corresponding to the discrete gradient of the image x. • ( x)k ∈ R2 is a 2d vector: the discrete gradient of x at location sk. • F(x) ∈ Rn is the (continuous) gradient of F at x. • ( F(x))k ∈ R: variation of F for an infinitessimal variation of the pixel value xk. 60
  • 94. Variational methods – Smooth optimization Gradient descent • Let F be a real function, differentiable and lower bounded with a L Lipschitz gradient. Then, whatever the initialization x0 , if 0 < γ < 2/L, the sequence xk+1 = xk − γ F(xk ) , converges to a stationary point x (i.e., it cancels the gradient) F(x ) = 0 . • The parameter γ is called the step size. • A too small step size γ leads to slow convergence. • For 0 < γ < 2/L, the sequence F(xk ) decays with a rate in O(1/k). 61
  • 95. Variational methods – Smooth optimization These two curves cross at x such that F(x ) = 0 62
  • 96. Variational methods – Smooth optimization Here γ is small: slow convergence 62
  • 97. Variational methods – Smooth optimization γ a bit larger: faster convergence 62
  • 98. Variational methods – Smooth optimization γ ≈ 1/L even larger: around fastest convergence 62
  • 99. Variational methods – Smooth optimization γ a bit too large: convergence slows down 62
  • 100. Variational methods – Smooth optimization γ too large: convergence too slow again 62
  • 101. Variational methods – Smooth optimization γ > 2/L: divergence 63
  • 102. Variational methods – Smooth optimization Gradient descent for convex function • If moreover F is convex F(λx1 + (1 − λ)x2) λF(x1) + (1 − λ)F(x2), ∀x1, x2, λ ∈ (0, 1) , then, the gradient descent converges towards a global minimum x ∈ argmin x F(x). • Note: All stationary points are global minimum (non necessarily unique). 64
  • 103. Variational methods – Smooth optimization One-dimension Two-dimensions * * * * 65
  • 104. Variational methods – Smooth optimization Example (Tikhonov functional (1/6)) • The functional F is F(x) = 1 2 Ω (H(x) − y)2 data fit +τ || x||2 2 smoothing ds . • Its discretization leads to F(x) = 1 2 k ((Hx)k − yk)2 + τ 2 k ||( x)k||2 2 = 1 2 ||Hx − y||2 2 + τ 2 || x||2 2,2 • 2,2/Frobenius norm of a matrix: ||A||2 2,2 = k ||Ak||2 2 = l A2 kl = tr A∗ A = A, A . • Scalar product between matrices: tr A∗ B = A, B . 66
  • 105. Variational methods – Smooth optimization F(x) = 1 2 ||Hx − y||2 2 + τ 2 || x||2 2,2 Example (Tikhonov functional (2/6)) • This function is differentiable and convex, since • If f convex, x → f(Ax + b) is convex, • Norms are convex, • Quadratic functions are convex, • Sums and compositions of convex functions are convex. • We can solve this problem using gradient descent. 67
  • 106. Variational methods – Smooth optimization F(x) = 1 2 ||Hx − y||2 2 + τ 2 || x||2 2,2 Example (Tikhonov functional (3/6)) • Note that || x||2 2,2 = x, x = x, − div x = − x, ∆x , then F(x) = 1 2 (||Hx||2 + ||y||2 − 2 Hx, y ) − τ 2 x, ∆x = 1 2 ( x, H∗ Hx + ||y||2 − 2 x, H∗ y ) − τ 2 x, ∆x • The gradient is thus given by F(x) = 1 2 ((H∗ H + H∗ H)x − 2H∗ y − τ(∆ + ∆∗ )x) = H∗ (Hx − y) − τ∆x Note: x, Ay = Ay and x, Ax = (A + A∗ )x 68
  • 107. Variational methods – Smooth optimization Example (Tikhonov functional (4/6)) • The gradient descent reads as xk+1 = xk − γ F(xk ) = xk − γ(H∗ (Hxk − y) − τ∆xk ) with γ < 2 L where L = ||H∗ H + τ∆||2. • Triangle inequality: L ||H||2 2 + τ4d since ||∆||2 = 4d. • For τ → ∞ and x0 = y, this converges to the explicit Euler scheme for the Heat equation. The condition γ < 2 L is equivalent to the CFL condition. Solutions of the Heat equation tends to minimize the smoothing term. This explains why at convergence the Heat equation provides constant solutions (when using periodical boundary solutions). 69
  • 108. Variational methods – Smooth optimization Example (Tikhonov functional (5/6)) xk+1 = xk − γ(H∗ (Hxk − y) retroaction −τ∆xk ) • The retroaction allows to remain close to the observation. • Unlike the solution of the Heat equation, this numerical scheme converges to a solution of interest. • Classical stopping criteria: • fixed number m of iterations (k = 1 to m), • |F(xk+1 ) − F(xk )|/|F(xk )| < ε, or • ||xk+1 − xk ||/||xk || < ε. Where does Tikhonov regularization converge to? 70
  • 109. Variational methods Example (Tikhonov regularization (6/6)) • Explicit solution F(x) = H∗ (Hx − y) − τ∆x = 0 ⇔ x = (H∗ H − τ∆)−1 H∗ y • Can be directly solved by conjugate gradient. • Tikhonov regularization is linear (non-adaptive). • If H is a blur, this is a convolution by a sharpening kernel (LTI filter). How to incorporate inhomogeneity `a la Perona-Malik? 71
  • 110. Variational methods - Robust regularization Use robust regularizers to pick the good canditate 72
  • 111. Variational methods – Robust regularization Example (Robust regularization (1/2)) F(x) = 1 2 Ω (Hx − y)2 data fit +τ G(|| x||2 2) regularization ds • After discretization, its gradient is given by F(x) = H∗ (Hx − y) − τ div(g(|| x||2 2) x) where g(u) = G (u). • The gradient descent becomes xk+1 = xk − γ(H∗ (Hx − y) retroaction −τ div(g(|| x||2 2) x) . Without the retroaction term (τ → ∞), this is exactly the explicit Euler scheme for the anisotropic diffusion. 73
  • 112. Variational methods – Robust regularization (a) Low resolution y Robust regularization for × 16 super-resolution (b) Tiny τ (c) Small τ (d) Good τ (e) High τ (f) Huge τ 74
  • 113. Variational methods – Robust regularization (a) Low resolution y Tikhonov regularization for × 16 super-resolution (b) Tiny τ (c) Small τ (d) Good τ (e) High τ (f) Huge τ 74
  • 114. Variational methods – Robust regularization What are the choice of G, leading to the choice of Perona and Malik? Example (Robust regularization (2/2)) G(u) = u ⇒ g(u) = 1 (Heat) G(u) = β log(β + u) ⇒ g(u) = β β + u (AD) G(u) = β 1 − exp − u β ⇒ g(u) = exp − u β (AD) 75
  • 115. Variational methods – Robust regularization -10 -8 -6 -4 -2 0 2 4 6 8 10 0 1 2 3 4 5 • Tikhonov (blue) is convex: ⇒ global minimum • huge penalization for large gradients: does not allow for edges, ⇒ smooth solutions. • The other two are non-convex: ⇒ stationary point depending on the initialization • small penalization for large gradients: allows for edges (robust), ⇒ sharp solutions. 76
  • 117. Total-Variation Can we take the best of both worlds? Total-Variation (TV) or ROF model [Rudin, Osher, Fatemi, 1992] F(x) = Ω 1 2 (Hx − y)2 + τ|| x||2 ds TV(x) = Ω || x||2 ds -5 -4 -3 -2 -1 0 1 2 3 4 5 0 1 2 3 4 5 • Tightest convex penalty. • Convex, robust and induces sparsity. 77
  • 118. Total-Variation – One-dimensional case One-dimensional case F(x) = 1 2 (Hx − y)2 + τ| x| ds 1d Total-Variation • Its discretization leads to F(x) = 1 2 ||Hx − y||2 2 + τ 2 k |( x)k| = 1 2 ||Hx − y||2 2 + τ 2 || x||1 • p norm of a vector: ||v||p = k |vk|p 1/p 78
  • 119. Total-Variation – One-dimensional case Source:J.Salmon For TV, the gradient will be zero for most of its coordinates. This is due to the corners of the 1 ball. 79
  • 120. Total-Variation – One-dimensional case Gradient sparsity • Sparsity of the gradient ⇔ piece wise constant solutions • Non-smooth (non-differentiable) ⇒ can’t use gradient descent. Large noise reduction with edge preservation but, convex non-smooth optimization problem. A solution: proximal splitting methods (in a few classes), kinds of implicit Euler schemes. 80
  • 121. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 122. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 123. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 124. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 125. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 126. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 127. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 128. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the regularization parameter τ • Too small: noise overfitting / staircasing, • Too large: loss of contrast, loss of objects. 81
  • 129. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the noise level σ • Large noise: staircasing + loss of contrast. • Small noise: noise reduction + edge preservation 82
  • 130. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the noise level σ • Large noise: staircasing + loss of contrast. • Small noise: noise reduction + edge preservation 82
  • 131. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the noise level σ • Large noise: staircasing + loss of contrast. • Small noise: noise reduction + edge preservation 82
  • 132. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the noise level σ • Large noise: staircasing + loss of contrast. • Small noise: noise reduction + edge preservation 82
  • 133. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Evolution with the noise level σ • Large noise: staircasing + loss of contrast. • Small noise: noise reduction + edge preservation 83
  • 134. Total-Variation – One-dimensional case (denoising) 20 40 60 80 100 120 140 160 180 -50 0 50 100 150 200 250 Set of non-zero gradients (jumps) is sparse 20 40 60 80 100 120 140 160 180 83
  • 135. Total-Variation – Two-dimensional case Two-dimensional case F(x) = 1 2 (Hx − y)2 + τ|| x||2 ds 2d Total-Variation • Its discretization leads to F(x) = 1 2 ||Hx − y||2 2 + τ 2 k ||( x)k||2 = 1 2 ||Hx − y||2 2 + τ 2 || x||2,1 • p,q norm of a matrix: ||A||p,q =   k l |Akl|p q/p   1/q 84
  • 136. Total-Variation – Results (a) Blurry image y TV regularization for deconvolution of motion blur (b) Tiny τ (c) Small τ (d) Medium τ (e) High τ (f) Huge τ 85
  • 137. Total-Variation – Results (a) Blurry image y 85
  • 140. Total-Variation – Results (d) Relatively small τ 85
  • 144. Total-Variation – Results (h) Even smaller τ 85
  • 146. Total-Variation – Results TV regularization for denoising NoisyimageTotal-Variation(≈50s) (a) Noise σ = 10 (b) σ = 20 (c) σ = 40 (d) σ = 60 86
  • 147. Total-Variation – Results TV regularization for denoising NoisyimageBNL-means(≈30s) (a) Noise σ = 10 (b) σ = 20 (c) σ = 40 (d) σ = 60 86
  • 148. Total-Variation – Two-dimensional case Variant: Anisotropic TV F(x) = 1 2 (Hx − y)2 + τ|| x||1 ds Anisotropic Total-Variation • Its discretization leads to F(x) = 1 2 ||Hx − y||2 2 + τ 2 k ||( x)k||1 = 1 2 ||Hx − y||2 2 + τ 2 || x||1,1 • Anisotropic behavior: • Penalizes more the gardient in diagonal directions, • Favor horizontal and vertical structures, • By opposition the 2,1 version is called Isotropic TV. 87
  • 149. Total-Variation – Two-dimensional case (a) Sparsity induced by ||Ax||1,1 (b) Group sparsity induced by ||Ax||2,1 ⇒ many zero entries ⇒ many zero rows Anisotropic TV: components of the gradient of each pixel are independent. Isotropic TV: the two components of the gradient are grouped together. 88
  • 150. Total-Variation – Two-dimensional case (a) Independent (b) Blocks of gradients (c) Gradients and colors We can also group the colors to avoid color aberrations. 89
  • 151. Total-Variation – Two-dimensional case (a) Noisy image (b) Anisotropic TV (c) Anisotropic TV + Color 90
  • 152. Total-Variation – Two-dimensional case (a) Noisy image (b) Isotropic TV (c) Isotropic TV + Color 90
  • 153. Total-Variation – Remaining issues • What to choose for the regularization τ? • Loss of textures (high frequency objects) −→ images are not piece-wise constant, • Non-adapted for non-Gaussian noises (e.g., impulse noise). (a) Gaussian noise (b) TV result (c) Impulse noise (d) TV result 91
  • 154. Variational methods – Further reading For further reading • Variational methods for image segmentation: • Mumford-Shah functional (1989), • Active contours / Snakes (Kass et al, 1988), • Chan-Vese functional (2001). • Link with Gibbs priors and Markov Random Fields (MRF): • Geman & Geman model (1984), • Graph cuts (Boykov, Veksler, Zabih, 2001), (Ishikawa, 2003), −→ Applications in Computer-Vision. • For more evolved regularization terms: • Fields of Experts (Roth & Black, 2008). • Total-Generalized Variation (Bredies, Kunisch, Pock, 2010). • Link with Machine learning / Sparse regression: • LASSO (Tibshirani, 1996) / Fused LASSO / Group LASSO. 92
  • 155. Questions? Next class: Bayesian methods Sources and images courtesy of • L. Condat • I. Kokkinos • G. Rosman • A. Roussos • J. Salmon • Wikipedia 92