High Quality Image Compression Using PDE-Based Inpainting with - - PowerPoint PPT Presentation

high quality image compression
SMART_READER_LITE
LIVE PREVIEW

High Quality Image Compression Using PDE-Based Inpainting with - - PowerPoint PPT Presentation

2016 SIAM Conference on Imaging Science Albuquerque, May 23 May 26 High Quality Image Compression Using PDE-Based Inpainting with Optimal Data Laurent Hoeltgen hoeltgen@b-tu.de Chair for Applied Mathematics Brandenburg Technical


slide-1
SLIDE 1

2016 SIAM Conference on Imaging Science Albuquerque, May 23 – May 26

High Quality Image Compression

Using PDE-Based Inpainting with Optimal Data Laurent Hoeltgen

hoeltgen@b-tu.de

Chair for Applied Mathematics Brandenburg Technical University Cottbus - Senftenberg

May 23, 2016

This work is licensed under a Creative Commons “Attribution-ShareAlike 4.0 International” license.

slide-2
SLIDE 2

Motivation

PDE-Based Image Compression

alternative to transform based approaches has 3 important pillars each requires advanced optimisation

slide-3
SLIDE 3

Motivation

PDE-Based Image Compression

alternative to transform based approaches has 3 important pillars each requires advanced optimisation

Data Selection

slide-4
SLIDE 4

Motivation

PDE-Based Image Compression

alternative to transform based approaches has 3 important pillars each requires advanced optimisation

Data Selection Data Storage

slide-5
SLIDE 5

Motivation

PDE-Based Image Compression

alternative to transform based approaches has 3 important pillars each requires advanced optimisation

Data Selection Data Storage Data Reconstruction

slide-6
SLIDE 6

Motivation

PDE-Based Image Compression

alternative to transform based approaches has 3 important pillars each requires advanced optimisation

Data Selection Data Storage Data Reconstruction Image Compression

slide-7
SLIDE 7

Outlook

  • Data Reconstruction

PDE-Based Image Inpainting

  • Data Selection

Optimal Data Locations Optimal Data Values

  • Data Storage
  • Summary and Conclusion
slide-8
SLIDE 8

Data Reconstruction (1)

Data Reconstruction

We could use any diffusion type PDE. However, we want it to be:

simple to analyse

linear, parameter free, ...

applicable for any domain and codomain

no restriction on image type, size, quantisation, ...

fast to carry out

Laplace interpolation fulfils all these requirements.

slide-9
SLIDE 9

Data Reconstruction (2)

Laplace Interpolation for Image Inpainting

consider Laplace equation with mixed boundary conditions:

Ω ΩK ΩK ∂Ω 8 > < > : −∆u = 0,

  • n Ω

u = g,

  • n ΩK

∂nu = 0,

  • n ∂Ω

ΩK: represents known data Ω \ ΩK: region to be inpainted (i.e. missing data) image reconstructions given as solutions u

slide-10
SLIDE 10

Data Selection (1)

Finding Optimal Interpolation Data

brute force search of optimal pixel locations is impossible 105600 ways to choose 5% of data from 0.07 megapixel image for comparison:

1023 × =

slide-11
SLIDE 11

Data Selection (2)

Alternatives

search space reduction with binary trees

(Galić et al. 2005, Schmaltz et al. 2009)

analytical derivation

(Belhachmi et al. 2008)

probabilistic search methods

(Mainberger et al. 2012)

stochastic optimisation on binary trees

(Peter et al. 2015)

regularisation and optimal control models

(Hoeltgen et al., 2013)

slide-12
SLIDE 12

Data Selection (3)

Search Space Reduction with Binary Trees

iteratively refine block-wise decomposition a block is split if error is too large interpret refinements as nodes of a binary tree

Evaluation: average reconstruction quality run times of few seconds at most storing data locations is extremely cheap

slide-13
SLIDE 13

Data Selection (4)

Binary Tree Representation

1 2 4 5 6 7 3

slide-14
SLIDE 14

Data Selection (4)

Binary Tree Representation

1 1 2 4 5 6 7 3

slide-15
SLIDE 15

Data Selection (4)

Binary Tree Representation

1 2 3 1 2 4 5 6 7 3

slide-16
SLIDE 16

Data Selection (4)

Binary Tree Representation

1 2 3 4 5 2 1 2 4 5 6 7 3

slide-17
SLIDE 17

Data Selection (4)

Binary Tree Representation

1 2 3 4 5 2 6 7 2 5 1 2 4 5 6 7 3

slide-18
SLIDE 18

Data Selection (5)

Example

slide-19
SLIDE 19

Data Selection (6)

Analytical Derivation

derive optimality conditions in Sobolev spaces

density of optimal data proportional to Laplacian magnitude

apply dithering to get discrete distribution

works best with electrostatic halftoning

(Schmaltz et al. 2010)

Floyd Steinberg is a faster alternative

Evaluation: average reconstruction quality capable of real time processing (30 fps) reconstruction data difficult to store

slide-20
SLIDE 20

Data Selection (7)

Example

slide-21
SLIDE 21

Data Selection (7)

Example

slide-22
SLIDE 22

Data Selection (8)

Probabilistic Search Methods

iteratively test importance of random subsets of pixels

discard unimportant pixels shuffle remaining candidates

similarities to genetic algorithms and simulated annealing works for any PDE, but only in discrete settings

Evaluation: very good reconstruction quality extremely slow: run times of days to weeks reconstruction data difficult to store

slide-23
SLIDE 23

Data Selection (9)

Example

slide-24
SLIDE 24

Data Selection (10)

Laplace Interpolation (Reminder)

Ω ΩK ΩK ∂Ω 8 > < > : −∆u = 0,

  • n Ω \ ΩK

u = g,

  • n ΩK

∂nu = 0,

  • n ∂Ω

can be rewritten as ( c (u − g) + (1 − c) (−∆)u = 0,

  • n Ω

∂nu = 0,

  • n ∂Ω

with c ≡ 1 on ΩK and c ≡ 0 on Ω \ ΩK

slide-25
SLIDE 25

Data Selection (11)

Regularisation and Optimal Control Models

PDE makes also sense if c : Ω → R (≈ regularisation)

  • ptimal non-binary and sparse masks c given by

arg min

u, c

Z

1 2 (u − g)2 + λ|c| + ε 2|c|2 dx ff subject to: ( c (u − g) + (1 − c)(−∆)u = 0,

  • n Ω

∂nu = 0,

  • n ∂Ω

Evaluation: highest quality of all presented methods slow: run times of hours to days reconstruction data difficult to store

slide-26
SLIDE 26

Data Selection (12)

Example

slide-27
SLIDE 27

Data Selection (13)

Tonal Optimisation

  • ptimal pixel values necessary to maximise quality

quantisation to n ≪ 256 colours essential for compression

best number of colours hard to determine

  • ften 30% less memory needed
  • ptimisation criteria should take file size into account

hard to predict

slide-28
SLIDE 28

Data Selection (14)

Continuous Tonal Optimisation

  • ptimise values in R

Mainberger et al. (2011): least squares model Hoeltgen et al. (2015): equivalence to mask optimisation

  • ptimal non-binary masks c equivalent to
  • ptimal colours in R with binary masks!

maximises reconstruction quality storage of colour values in R is very expensive

slide-29
SLIDE 29

Data Selection (15)

Discrete Tonal Optimisation

Schmaltz et al. (2009) iteratively optimise colour mapping

uniform distribution of colours necessary very slow number of colours fixed beforehand excellent quality

Extension to take file size into account by Peter (2014) k-means based alternative by Hoeltgen et al. (2016)

arbitrary distribution of colours possible much faster allows optimisation of quantisation levels doesn’t consider file size

slide-30
SLIDE 30

Data Selection (16)

Discrete/Continuous Tonal Optimisation

apply K-means on colour values from mask locations

10 15 20 25 30 35 46 48 50 52 number of clusters mean squared error K-means

  • riginal data

K-means 30 colours outperforms original data (170 colours)

  • ptimal quantisation found with silhouette statistics
slide-31
SLIDE 31

Data Storage (1)

Flexible Codec Design

depending on the application:

  • 1. preserve quality at the expense of larger file size

arbitrary mask positions tonal optimisation of data and binarisation of mask

  • 2. sacrifice accuracy to maximise compression rate

use binary tree representation for mask tonal optimisation

slide-32
SLIDE 32

Data Storage (2)

Image Encoding and Decoding

Encoding:

  • 1. computation of a binary mask (any strategy)
  • 2. computation of optimal grey values (with quantisation)
  • 3. encoding of all the data in a container file
  • 4. application of a high performing entropy coder (PAQ)

Decoding:

reverse order with additional final inpainting can be done in real time (30 fps) (Baum 2013)

independent from chosen optimisation strategies!

slide-33
SLIDE 33

Data Storage (3)

Comparison to JPEG and JPEG 2000

10 : 1 15 : 1 20 : 1 10 20 30 compression rate mean squared error exact mask tree mask JPEG JPEG 2000

slide-34
SLIDE 34

Data Storage (3)

Comparison to JPEG and JPEG 2000

10 : 1 15 : 1 20 : 1 10 20 30 compression rate mean squared error exact mask tree mask JPEG JPEG 2000

slide-35
SLIDE 35

Data Storage (3)

Comparison to JPEG and JPEG 2000

10 : 1 15 : 1 20 : 1 10 20 30 compression rate mean squared error exact mask tree mask JPEG JPEG 2000

slide-36
SLIDE 36

Summary and Conclusion

Take Home Message

PDE-based compression is a viable alternative:

applicable to any data (images, videos, hyper-spectral, ...) user friendly (single parameter for quality setting) well suited if encoding time does not matter mathematically well founded

slide-37
SLIDE 37

Thank You

Thank you very much for your attention!

More information at:

http://www-user.tu-cottbus.de/~hoeltgen/

slide-38
SLIDE 38

References

Laurent Hoeltgen and Michael Breuß. “Efficient Co-Domain Quantisation for PDE-based Image Compression”. Proceedings

  • f the Conference Algoritmy. 2016.

Pascal Peter et al. “Evaluating the True Potential of Diffusion-based Inpainting in a Compression Context”. Signal Processing: Image Communication (2016). Laurent Hoeltgen and Joachim Weickert. “Why Does Non-binary Mask Optimisation Work for Diffusion-based Image Compression?” Energy Minimization Methods in Computer Vision and Pattern Recognition. 2015. Kevin Baum. “GPGPU Supported Diffusion-based Naive Video Compression”. Master’s Thesis. Saarland University, 2013.

slide-39
SLIDE 39

References

Laurent Hoeltgen, Simon Setzer, and Joachim Weickert. “An Optimal Control Approach to Find Sparse Data for Laplace Interpolation”. Energy Minimization Methods in Computer Vision and Pattern Recognition. 2013. Markus Mainberger et al. “Optimising Spatial and Tonal Data for Homogeneous Diffusion Inpainting”. Scale Space and Variational Methods in Computer Vision. 2012.

  • Z. Belhachmi et al. “How to Choose Interpolation Data in

Images”. SIAM Journal on Applied Mathematics (2009). Christian Schmaltz, Joachim Weickert, and Andres Bruhn. “Beating the Quality of JPEG 2000 with Anisotropic Diffusion”. Pattern Recognition. 2009.

slide-40
SLIDE 40

References

Irena Galic et al. “Towards PDE-based Image Compression”. Variational, Geometric, and Level Set Methods in Computer Vision. 2005.

slide-41
SLIDE 41

Related Work

Previous findings on PDE-Based inpainting and compression:

Contour-based reconstructions (Carlsson 1988) Wavelet decompositions with TV (Chan et al. 2001) Adaptive triangulations with Splines (Demaret et al. 2004) Toppoints in scale space (Kanter et al. 2005) Laplacian approximations for elevation maps (Xie et al. 2006) Spline based representations (Orzan et al. 2008) Bilevel optimisation (Chen et al. 2014)

slide-42
SLIDE 42

Properties of Discretised PDE

Standard finite difference schemes in 2D for c (u − g) + (1 − c) (−∆)u = 0,

  • n Ω

∂nu = 0,

  • n ∂Ω

yield a linear system of equations. The system matrix has the following properties:

  • 1. All eigenvalues are real if c is bounded by 1.
  • 2. Matrix is invertible if c maps to

ˆ 0, 8

7

˜ .

  • 3. Solutions obey max-min principle if c maps to [0, 1].

Generalisation of Mainberger et al. (2011) to the non-binary case.

slide-43
SLIDE 43

PDE-Based Inpainting with Sparse Data (5%)

reconstruction quality depends on data selection

slide-44
SLIDE 44

PDE-Based Inpainting with Sparse Data (5%)

reconstruction quality depends on data selection

slide-45
SLIDE 45

PDE-Based Inpainting with Sparse Data (5%)

reconstruction quality depends on data selection

slide-46
SLIDE 46

Binary Tree Coding

1 1 1 1 1 1 1 1 1 Binary encoding = 0 1 1 1 | {z }

Level 3

0 0 1 0 1 1 | {z }

Level 4

Range Coding: {3, 4}

slide-47
SLIDE 47

Interpretation of the Optimal Control Model

arg min

u, c

Z

1 2 (u − g)2 + λ|c| + ε 2|c|2 dx ff

energy reflects trade-off between accuracy and sparsity

  • bjectives cannot be fulfilled simultaneously

data term enforces accuracy sparsity term prefers sparse masks

λ steers sparsity of interpolation data

small, positive λ: many data points, good reconstruction large, positive λ: few data points, bad reconstruction

slide-48
SLIDE 48

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c Reconstruction by piecewise linear inerpolation in 1D.

slide-49
SLIDE 49

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.45

slide-50
SLIDE 50

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.43

slide-51
SLIDE 51

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.41

slide-52
SLIDE 52

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.39

slide-53
SLIDE 53

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.37

slide-54
SLIDE 54

Benefits of a Non-Binary Mask c

Finding binary masks is a non-convex, combinatorial task. Non-binary masks allow better fits to the data. 1 4 1 2 3 4

1

4 3

  • riginal

reconstruction mask c L2 Error: 0.34

slide-55
SLIDE 55

A Solution Strategy

Linearise constraint to handle non-convexity:

T(u, c) := c (u − g) + (1 − c)(−∆)u T(u, c) ≈ T(uk, ck) + DuT(uk, ck)(u − uk) + DcT(uk, ck)(c − ck)

Add proximal term and solve iteratively

arg min

u, c

Z

1 2 (u − g)2 + λ|c| + ε 2|c|2 + µ 2 “ u − uk”2 + µ 2 “ c − ck”2 dx ff T(uk, ck)+DuT(uk, ck)(u−uk)+DcT(uk, ck)(c−ck) = 0 until fixed point is reached.

slide-56
SLIDE 56

Algorithmic Details

approach is similar to

LCL algorithm (Murthagh et al. 1982), EM/MM method (Orthega et al. 1970).

Linearised problem is convex and easier to solve. Derivation of the conjugate dual problem is possible.

unconstrained convex optimisation problem solvable via gradient descent may yield more accurate solutions and faster convergence

slide-57
SLIDE 57

Theoretical Findings

algorithm yields several interesting results:

  • 1. energy decreasing as long as:

1 2 “ uk+1 − g2

2 − uk − g2 2

” 6 λ “ ck+11 − ck1 ” + ε 2 “ ck+12

2 − ck2 2

” gain in sparsity must outweigh loss in accuracy

  • 2. fixed-points fulfil necessary optimality conditions:

u − g − DuT(u, c)⊤p = 0 λ∂ (·1) (c) + εc + DcT(u, c) p ∋ 0 T(u, c) = 0

slide-58
SLIDE 58

Evolution of the Iterates

100 200 300 400 500 600 700 Iteration energy mean squared error

slide-59
SLIDE 59

Evolution of the Iterates

100 200 300 400 500 600 700 Iteration energy mean squared error

slide-60
SLIDE 60

Evolution of the Iterates

100 200 300 400 500 600 700 Iteration energy mean squared error

slide-61
SLIDE 61

Evolution of the Iterates

100 200 300 400 500 600 700 Iteration energy mean squared error

slide-62
SLIDE 62

The Inpainting Operator

standard finite difference schemes in 2D for c (u − g) + (1 − c) (−∆)u = 0,

  • n Ω

∂nu = 0,

  • n ∂Ω

yield a linear system diag(c) + (1 − diag(c)) (−∆) | {z }

=:A(c)

u = diag(c)g the matrix M(c) := A(c)−1diag(c) is called inpainting operator

slide-63
SLIDE 63

Continuous Tonal Optimisation

let mask c be fixed and M(c) the inpainting operator. Mainberger et al. (2012) suggest to optimise the grey values g: Continuous Tonal Optimisation f = arg min

x∈Rn

1 2M (c) x − g2

2

ff

linear least squares problem efficient solvers exist

LSQR (Paige & Saunders, 1982) based solver for CPUs primal dual (Chambolle & Pock, 2011) solver for GPUs

slide-64
SLIDE 64

Mask VS. Grey Value Optimisation

Optimising grey values and mask values can give the same results.

1 2

1

4 3

Mask Value Optimisation

1 2

1

4 3

Grey Value Optimisation

slide-65
SLIDE 65

An Equivalence Result

complex relationship between inpainting data g and mask c:

c (u − g) + (1 − c)(−∆)u = 0,

  • n Ω

∂nu = 0,

  • n ∂Ω

Important: mask locations coincide with data locations.

Equivalent Data Optimisation If mask positions are fixed by set K: mask value optimisation is equivalent to grey value optimisation min

ci, i∈K

n M (c) g − g2

2

  • = min

xi, i∈K

n M (¯ c) x − g2

2

  • with ¯

c being binary mask for K.