Papers
Topics
Authors
Recent
Search
2000 character limit reached

Euler's Elastica Inpainting

Updated 18 January 2026
  • The paper introduces a variational approach that minimizes an energy functional combining total variation and curvature to restore grey-value images.
  • It leverages a deep energy framework and deep image prior, reparameterizing the image via a CNN to overcome numerical and artifact challenges.
  • Empirical evaluations show efficient inpainting with sharp, rotation-invariant edge completion, outperforming traditional fourth-order PDE solvers in speed and robustness.

Euler’s elastica-based inpainting is a variational approach for image restoration that reconstructs missing or corrupted regions of a grey-value image by minimizing an energy functional dependent on both total variation and level-line curvature. This model is particularly suited for shape completion tasks, producing results with sharp edges and high rotation invariance. While the classical Euler’s elastica inpainting involves solving a singular, anisotropic, and nonlinear fourth-order PDE—posing significant numerical challenges—recent advances propose leveraging neural algorithms, specifically incorporating deep energy and deep image prior frameworks. This CNN-based method achieves efficient, unsupervised inpainting with simple discretization, robust performance, and GPU parallelizability (Schrader et al., 2022).

1. Variational Formulation of Euler’s Elastica Inpainting

Let u:ΩRu : \Omega \to \mathbb{R} be the grey-value image, known on a set KΩK \subset \Omega and to be reconstructed on ΩK\Omega \setminus K. The elastica energy functional is given by

E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy

where u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}, and the level-line curvature is defined as κ=div(u/u)\kappa = \operatorname{div}(\nabla u/|\nabla u|). The weights α,β0\alpha,\beta \ge 0 control the relative influence of total variation and curvature. Specific parameter settings recover special cases:

  • α=1,β=0\alpha=1,\,\beta=0: Total variation (TV) inpainting
  • α=0,β=1\alpha=0,\,\beta=1: Pure curvature minimization

In practice, α=b\alpha = b, KΩK \subset \Omega0, with KΩK \subset \Omega1 chosen via cross-validation on mean absolute error (MAE).

2. Gradient Flow and Computational Challenges

Minimizing KΩK \subset \Omega2 subject to KΩK \subset \Omega3 leads to a highly nonlinear PDE stemming from its Euler–Lagrange equation, with principal terms involving up to fourth-order derivatives. To regularize the functional near singularities, a small parameter KΩK \subset \Omega4 is introduced, yielding KΩK \subset \Omega5. The corresponding gradient flow reads:

KΩK \subset \Omega6

where KΩK \subset \Omega7 projects onto the level-line direction. Boundary conditions are Dirichlet on KΩK \subset \Omega8 (KΩK \subset \Omega9), with optional Neumann conditions on ΩK\Omega \setminus K0. The system’s singular, anisotropic, fourth-order nature necessitates careful numerical treatment.

3. Discretization via Finite Differences

The function ΩK\Omega \setminus K1 is placed on a uniform grid (spacing ΩK\Omega \setminus K2), using 3×3 binomial-weighted central difference stencils for derivatives, exhibiting strong rotation invariance. For each pixel ΩK\Omega \setminus K3:

  • ΩK\Omega \setminus K4
  • ΩK\Omega \setminus K5

The discrete energy is

ΩK\Omega \setminus K6

where ΩK\Omega \setminus K7 is the binary mask indicating known regions.

4. Deep Energy and Deep Image Prior Methodology

Instead of explicit time-stepping of the PDE, ΩK\Omega \setminus K8 serves as the neural network loss function within a “deep energy” framework. Using autodiff, gradients are computed efficiently, and optimization proceeds via

ΩK\Omega \setminus K9

Direct minimization of E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy0 can introduce high-frequency checkerboard artifacts due to the stencils’ structure. To suppress such spurious oscillations, a “deep image prior” approach is implemented: the image is reparameterized as E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy1, where E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy2 is a neural network mapping the mask E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy3, known values E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy4, and (optionally) noise to the restored image. The minimized functional becomes E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy5, biasing reconstructions toward natural images and mitigating grid artifacts.

5. Network Architecture and Optimization Protocol

The architecture is a gated U-net with skip connections, typically featuring three to four scales and two convolutional layers per scale. The channel dimensionality starts at approximately 28 and doubles per down-sampling stage. On the coarsest scale, dilated convolutions support large-gap completion, and a gating mechanism (cf. Yu et al., 2019) enables handling of free-form masks. Activation functions are ReLU. Inputs consist of:

  • The binary mask (E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy6)
  • Known image values (E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy7)
  • Random noise in the unknown region

Optimization employs Adam with typical learning rates E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy8 (natural images) or E[u]=ΩK(α+βκ2)udxdyE[u] = \int_{\Omega \setminus K} (\alpha + \beta \kappa^2) |\nabla u|\, dx\,dy9 (shape tasks), subject to staged decreases. Masked regions initialize with uniform u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}0 noise. Regularization u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}1 is set in u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}2; parameter u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}3 for elastica balance is selected via cross-validation on MAE. Training proceeds for 6–7k iterations for u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}4 images (natural scenes) or up to 60k iterations (shape completion). Early stopping is triggered at the MAE minimum on the known mask to suppress checkerboarding artifacts.

6. Empirical Evaluation and Comparative Analysis

Natural-Image Inpainting

  • Data: “trui,” “peppers” (u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}5), random u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}6 known-pixel masks.
  • Metrics: Mean absolute error (MAE) w.r.t. ground truth.
  • Observations: After 6,000 iterations, MAE u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}7. Prolonged optimization further decreases u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}8 but increases MAE and can produce checkerboards. Energy and MAE drop rapidly in early iterations.

Shape-Completion

  • Geometries: Straight-edge stars, circular stars, Kanizsa triangles (128–400 px), large missing regions (u=ux2+uy2|\nabla u| = \sqrt{u_x^2 + u_y^2}9 px).
  • Rotation consistency: High rotation invariance ensured by stencil design.
  • Comparative performance:
    • Augmented Lagrangian (Tai et al., 2011): 78 s (CPU, κ=div(u/u)\kappa = \operatorname{div}(\nabla u/|\nabla u|)0, 60% mask)
    • ADMM (Yashtini & Kang, 2016): 854 s (CPU, κ=div(u/u)\kappa = \operatorname{div}(\nabla u/|\nabla u|)1, 20% mask)
    • TSC lifting (Chambolle & Pock, 2019): similar visual quality.
    • Present approach: 49 s (GPU, GTX1080, κ=div(u/u)\kappa = \operatorname{div}(\nabla u/|\nabla u|)2, 6,000 iters).
  • All scenarios yield sharp edge completion, effective gap closure, and clear rotation invariance.

7. Computational Efficiency and Methodological Advantages

Traditional elastica solvers require discretizing and iteratively solving a fourth-order PDE, often resulting in complex, sequentially limited algorithms. The CNN-based deep energy method discretizes only up to second-order derivatives. It leverages backpropagation and GPU computation for parallelizable, highly optimized optimization steps. The approach is unsupervised, requiring neither ground-truth images nor pre-trained weights—every inpainting instance is solved directly. This ensures simplicity, high population transferability, and efficient deployment, while maintaining competitive or superior quality compared to classical and state-of-the-art elastica solvers (Schrader et al., 2022).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Euler's Elastica-Based Inpainting.