Variational Methods: A Short Intro Prof. Daniel Cremers Chapter 9 · 2019. 6. 25. · Short Intro...

13
Variational Methods: A Short Intro Prof. Daniel Cremers Variational Methods Variational Image Smoothing Euler-Lagrange Equation Gradient Descent Adaptive Smoothing Euler and Lagrange updated June 25, 2019 1/13 Chapter 9 Variational Methods: A Short Intro Multiple View Geometry Summer 2019 Prof. Daniel Cremers Chair for Computer Vision and Articial Intelligence Departments of Informatics & Mathematics Technical University of Munich

Transcript of Variational Methods: A Short Intro Prof. Daniel Cremers Chapter 9 · 2019. 6. 25. · Short Intro...

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 1/13

    Chapter 9Variational Methods: A Short IntroMultiple View GeometrySummer 2019

    Prof. Daniel CremersChair for Computer Vision and Artificial Intelligence

    Departments of Informatics & MathematicsTechnical University of Munich

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 2/13

    Overview

    1 Variational Methods

    2 Variational Image Smoothing

    3 Euler-Lagrange Equation

    4 Gradient Descent

    5 Adaptive Smoothing

    6 Euler and Lagrange

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 3/13

    Variational Methods

    Variational methods are a class of optimization methods. Theyare popular because they allow to solve many problems in amathematically transparent manner. Instead of implementing aheuristic sequence of processing steps (as was commonlydone in the 1980’s), one clarifies beforehand what propertiesan ’optimal’ solution should have.

    Variational methods are particularly popular forinfinite-dimensional problems and spatially continuousrepresentations.

    Particular applications are:

    • Image denoising and image restoration• Image segmentation• Motion estimation and optical flow• Spatially dense multiple view reconstruction• Tracking

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 4/13

    Advantages of Variational Methods

    Variational methods have many advantages over heuristicmulti-step approaches (such as the Canny edge detector):

    • A mathematical analysis of the considered cost functionallows to make statements on the existence anduniqueness of solutions.

    • Approaches with multiple processing steps are difficult tomodify. All steps rely on the input from a previous step.Exchanging one module by another typically requires tore-engineer the entire processing pipeline.

    • Variational methods make all modeling assumptionstransparent, there are no hidden assumptions.

    • Variational methods typically have fewer tuningparameters. In addition, the effect of respectiveparameters is clear.

    • Variational methods are easily fused – one simply addsrespective energies / cost functions.

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 5/13

    Example: Variational Image Smoothing

    Let f : Ω→ R be a grayvalue input image on the domainΩ ⊂ R2. We assume that the observed image arises by some’true’ image corrupted by additive noise. We are interested in adenoised version u of the input image f .

    The approximation u should fulfill two properties:• It should be as similar as possible to f .• It should be spatially smooth (i.e. ’noise-free’).

    Both of these criteria can be entered in a cost function of theform

    E(u) = Edata(u, f ) + Esmoothness(u)

    The first term measures the similarity of f and u. The secondone measures the smoothness of the (hypothetical) function u.

    Most variational approaches have the above form. They merelydiffer in the specific form of the data (similarity) term and theregularity (or smoothness) term.

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 6/13

    Example: Variational Image SmoothingFor denoising a grayvalue image f : Ω ⊂ R2 → R, specificexamples of data and smoothness term are:

    Edata(u, f ) =∫Ω

    (u(x)− f (x)

    )2 dx ,and

    Esmoothness(u) =∫Ω

    |∇u(x)|2 dx ,

    where ∇ = (∂/∂x , ∂/∂y)> denotes the spatial gradient.

    Minimizing the weighted sum of data and smoothness term

    E(u) =∫ (

    u(x)− f (x))2 dx + λ ∫ |∇u(x)|2 dx , λ > 0,

    leads to a smooth approximation u : Ω→ R of the input image.

    Such energies which assign a real value to a function arecalled a functionals. How does one minimize functionals wherethe argument is a function u(x) (rather than a finite number ofparameters)?

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 7/13

    Functional Minimization & Euler-Lagrange Equation

    • As a necessary condition for minimizers of a functional theassociated Euler-Lagrange equation must hold. For afunctional of the form

    E(u) =∫L(u,u′) dx ,

    it is given by

    dEdu

    =∂L∂u− d

    dx∂L∂u′

    = 0

    • The central idea of variational methods is therefore todetermine solutions of the Euler-Lagrange equation of agiven functional. For general non-convex functionals this isa difficult problem.

    • Another solution is to start with an (appropriate) functionu0(x) and to modify it step by step such that in eachiteration the value of the functional is decreased. Suchmethods are called descent methods.

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 8/13

    Gradient Descent

    One specific descent method is called gradient descent orsteepest descent. The key idea is to start from an initializationu(x , t = 0) and iteratively march in direction of the negativeenergy gradient.

    For the class of functionals considered above, the gradientdescent is given by the following partial differential equation:

    u(x ,0) = u0(x)

    ∂u(x , t)∂t

    = −dEdu

    = −∂L∂u

    +ddx

    ∂L∂u′

    .

    Specifically for L(u,u′) = 12(u(x)− f (x)

    )2+ λ2 |u

    ′(x)|2 thismeans:

    ∂u∂t

    = (f − u) + λu′′.

    If the gradient descent evolution converges: ∂u/∂t = − dEdu = 0,then we have found a solution for the Euler-Lagrange equation.

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 9/13

    Image Smoothing by Gradient Descent

    E(u) =∫

    (f − u)2dx + λ∫|∇u|2 dx → min.

    E(u) =∫|∇u|2 dx → min.

    Author: D. Cremers

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 10/13

    Discontinuity-preserving Smoothing

    E(u) =∫|∇u|2 dx → min.

    E(u) =∫|∇u|dx → min.

    Author: D. Cremers

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 11/13

    Discontinuity-preserving Smoothing

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 12/13

    Leonhard Euler

    Leonhard Euler (1707 – 1783)

    • Published 886 papers and books, most of these in the last20 years of his life. He is generally considered the mostinfluential mathematician of the 18th century.

    • Contributions: Euler number, Euler angle, Euler formula,Euler theorem, Euler equations (for liquids),Euler-Lagrange equations,...

    • 13 children

  • Variational Methods: AShort Intro

    Prof. Daniel Cremers

    Variational Methods

    Variational ImageSmoothing

    Euler-LagrangeEquation

    Gradient Descent

    Adaptive Smoothing

    Euler and Lagrange

    updated June 25, 2019 13/13

    Joseph-Louis Lagrange

    Joseph-Louis Lagrange (1736 – 1813)

    • born Giuseppe Lodovico Lagrangia (in Turin). Autodidact.• At the age of 19: Chair for mathematics in Turin.• Later worked in Berlin (1766-1787) and Paris (1787-1813).• 1788: La Méchanique Analytique.• 1800: Leçons sur le calcul des fonctions.

    Variational MethodsVariational Image SmoothingEuler-Lagrange EquationGradient DescentAdaptive SmoothingEuler and Lagrange

    anm0: 0.23: 0.22: 0.21: 0.20: 0.19: 0.18: 0.17: 0.16: 0.15: 0.14: 0.13: 0.12: 0.11: 0.10: 0.9: 0.8: 0.7: 0.6: 0.5: 0.4: 0.3: 0.2: 0.1: 0.0: