Euler's Elastica Inpainting
- 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 be the grey-value image, known on a set and to be reconstructed on . The elastica energy functional is given by
where , and the level-line curvature is defined as . The weights control the relative influence of total variation and curvature. Specific parameter settings recover special cases:
- : Total variation (TV) inpainting
- : Pure curvature minimization
In practice, , 0, with 1 chosen via cross-validation on mean absolute error (MAE).
2. Gradient Flow and Computational Challenges
Minimizing 2 subject to 3 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 4 is introduced, yielding 5. The corresponding gradient flow reads:
6
where 7 projects onto the level-line direction. Boundary conditions are Dirichlet on 8 (9), with optional Neumann conditions on 0. The system’s singular, anisotropic, fourth-order nature necessitates careful numerical treatment.
3. Discretization via Finite Differences
The function 1 is placed on a uniform grid (spacing 2), using 3×3 binomial-weighted central difference stencils for derivatives, exhibiting strong rotation invariance. For each pixel 3:
- 4
- 5
The discrete energy is
6
where 7 is the binary mask indicating known regions.
4. Deep Energy and Deep Image Prior Methodology
Instead of explicit time-stepping of the PDE, 8 serves as the neural network loss function within a “deep energy” framework. Using autodiff, gradients are computed efficiently, and optimization proceeds via
9
Direct minimization of 0 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 1, where 2 is a neural network mapping the mask 3, known values 4, and (optionally) noise to the restored image. The minimized functional becomes 5, 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 (6)
- Known image values (7)
- Random noise in the unknown region
Optimization employs Adam with typical learning rates 8 (natural images) or 9 (shape tasks), subject to staged decreases. Masked regions initialize with uniform 0 noise. Regularization 1 is set in 2; parameter 3 for elastica balance is selected via cross-validation on MAE. Training proceeds for 6–7k iterations for 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” (5), random 6 known-pixel masks.
- Metrics: Mean absolute error (MAE) w.r.t. ground truth.
- Observations: After 6,000 iterations, MAE 7. Prolonged optimization further decreases 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 (9 px).
- Rotation consistency: High rotation invariance ensured by stencil design.
- Comparative performance:
- 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).