Fabien Pierre. University of Lorraine (France), LORIA, INRIA team - - PowerPoint PPT Presentation

fabien pierre
SMART_READER_LITE
LIVE PREVIEW

Fabien Pierre. University of Lorraine (France), LORIA, INRIA team - - PowerPoint PPT Presentation

Coupling Variational Method with CNN for Image Colorization Fabien Pierre. University of Lorraine (France), LORIA, INRIA team MAGRIT. Variational methods and optimization in imaging. To the memory of our dear friend and colleague Mila Nikolova


slide-1
SLIDE 1

Coupling Variational Method with CNN for Image Colorization

Fabien Pierre.

University of Lorraine (France), LORIA, INRIA team MAGRIT. Variational methods and optimization in imaging. To the memory of our dear friend and colleague Mila Nikolova 2019.02.04 Joint work with : Marie-Odile Berger and Thomas Mouzon.

1 / 31

slide-2
SLIDE 2

General problem of colorization

Input. Output.

2 / 31

slide-3
SLIDE 3

The YUV color space

Definition of the gray-scale channel from RGB :

Y = 0.299R + 0.587G + 0.114B.

Chrominance channel :

U and V , enable to recover the RGB image ; invertible linear map between YUV and RGB.

Challenge.

Recovering an RGB image from the luminance channel alone is an ill-posed problem and requires additional chrominance information.

3 / 31

slide-4
SLIDE 4

The manual colorization

Two approaches :

fully manual (polygonal masks) ; automatic diffusion.

Input Levin et al. SIGGRAPH 2004. Colorization with masks

4 / 31

slide-5
SLIDE 5

The manual colorization

5 / 31

slide-6
SLIDE 6

Exemplar-based colorization

Research of the "closest" patch. Extract the color.

Source Target

Welsch et al. 2002.

6 / 31

slide-7
SLIDE 7

Exemplar-based colorization

Gupta et al. 2012.

7 / 31

slide-8
SLIDE 8

Exemplar-based colorization

Compute Φ Use Φ YUV decomposition YUV inversion Source image Luminance Source UV Chrominance Target image Mapped UV Chrominance Colorized image

Persch et al. 2017.

8 / 31

slide-9
SLIDE 9

Image database-based colorization

Authors Color space Structure of the network Data base Cost function

  • G. Larsson et al. 2006

HCL VGG ImageNet Cross Entropy

  • R. Zhang et al. 2016

Lab VGG ImageNet Cross Entropy

  • S. Iizuka et al. 2016

Lab U-Net + Classifier MIT Places L2 + Cross Entropy

  • S. Guadarrama et al.2017

YCbCr Pixel CNN ImageNet L1 + Cross Entropy

  • Y. Cao et al. 2017

YUV cGAN LSUN Adv

  • A. Royer et al. 2017

Lab Pixel CNN ImageNet CIFAR10 Cross Entropy

  • A. Deshpande et al.2017

Lab VAE + MDN ImageNet MD

  • F. Baldassarre et al.2017

Lab U-Net + Classifier ImageNet L2

  • R. Zhang et al. 2017

Lab U-Net + LHN + GHN ImageNet Huber Loss

  • P. Isola et al. 2017

Lab cGAN ImageNet L1

  • Y. Xiao et al. 2018

Lab U-Net + LHN + GHN MIT Places Huber Loss

  • Z. Su et al. 2018

YUV VGG MIT Places L1 + L2

  • K. Nazeri et al. 2018

Lab cGAN MIT Places CIFAR10 L1 9 / 31

slide-10
SLIDE 10

Lack of regularization with CNN

Target (input) Result of Zhang et al., 2016 Our model

Limitation of Zhang et al., 2016.

halo effects ; mixing of colors. Based on a variational model, our method is able to remove such artifacts.

10 / 31

slide-11
SLIDE 11

Naive approach

CNN method Zhang et al, 2016 TV-L2 color post-processing

Too simple ! !

11 / 31

slide-12
SLIDE 12

CNN of Zhang et al., 2016

Lightness Downsampling 256x256 1 64 64x64 32x32 256 32x32 512 32x32 512 32x32 512 32x32 512 64x64 256

Pixel-wise color distribution over 313 colors. u* : chromaticity RGB image

64x64 313

Lab2RGB

Annealed mean.

This CNN computes color distribution on each pixel.

12 / 31

slide-13
SLIDE 13

CNN of Zhang et al., 2016

Set of the “labels”.

13 / 31

slide-14
SLIDE 14

CNN of Zhang et al., 2016

Definition of annealed-mean

w∗

i =

exp(log(wi)/T)

  • j exp(log(wj)/T)

14 / 31

slide-15
SLIDE 15

CNN of Zhang et al., 2016

Lightness Downsampling 256x256 1 64 64x64 32x32 256 32x32 512 32x32 512 32x32 512 32x32 512 64x64 256

Pixel-wise color distribution over 313 colors.

(u*, w*)=argmin F(u,w)

Upsampling w* : binary Pixel- wise color distribution. u* : chromaticity RGB image Initialize

64x64 313

Lab2RGB

A CNN computes color distribution on each pixel that feeds a variational method.

15 / 31

slide-16
SLIDE 16

Coupled total variation

Inspired of Pierre et al. 2015 SIAM journal of Imaging Sciences.

Color regularization.

ˆ u = ( ˆ U, ˆ V ) = argmin(U,V ) TVYdata(U, V )+ α

|U(x) − Udata(x)|2 + |V (x) − Vdata(x)|2dx, with TVYdata(U, V ) :=

  • γ|∇Ydata|2 + |∇U|2 + |∇V |2 dx.

16 / 31

slide-17
SLIDE 17

1D interpretation

TVYdata =

  • γa2 + b2

≤ TVYdata =

  • γa2 +

√ b2

17 / 31

slide-18
SLIDE 18

Chrominance inpainting

ˆ u = ( ˆ U, ˆ V ) = argmin(U,V ) TVYdata(U, V )+ α

M

  • |U(x) − Udata(x)|2 + |V (x) − Vdata(x)|2

dx, with TVYdata(U, V ) :=

  • γ|∇Ydata|2 + |∇U|2 + |∇V |2 dx.

M a mask, and (Udata, Vdata) some color scribbles given by the user.

Scribbles No coupling. With coupling.

18 / 31

slide-19
SLIDE 19

Intuition about coupling

Scribbles. γ = 0. γ = 1. γ = 10.

Parameter influence.

γ small : chrominance contours have low perimeters.

19 / 31

slide-20
SLIDE 20

Variational model for color regularization

Let us minimize the following functional with respect to (u, w) : F(u, w) := TVC(u) + λ 2

C

  • i=1

wiu(x) − ci(x)2

2 dx

+ χR(u(x)) + χ∆(w(x)) . (1) The central part of this model is based on the term

C

  • i=1

wi(x)u(x) − ci(x)2

2 dx.

(2)

20 / 31

slide-21
SLIDE 21

Variational model for color regularization

Assume that u∗ is a uniform real-valued random variable over the set [0, 255]2. Let us denote E the canonical basis of RC. The set of minimizers of

C

  • i=1

wiu∗ − ci2

2 + χ∆(w)

(3) is reduced to a point w∗(u∗) almost everywhere (a.e.). Moreover, the one of :

C

  • i=1

wiu∗ − ci2

2 + χE(w)

(4) is reduced to a point w∗∗(u∗) a.e.. When these two minimizers are unique then w∗∗(u∗) = w∗(u∗).

21 / 31

slide-22
SLIDE 22

Minimization algorithm

Primal-dual algorithm inspired by Chambolle and Pock 2011.

1: u0 ← C

i=1 wn+1

ci

2: for n > 0 do 3:

pn+1 ← PB (pn + σ∇un)

4:

wn+1 ← P∆

  • wn − ρλ(un+1 − ci2

2)i

  • 5:

un+1 ← PR   un + τ

  • div(pn+1) + λ C

i=1 wn+1 i

ci

  • 1 + τλ

 

6:

un+1 ← 2un+1 − un Parameters ρ, τ and σ are the time steps. No proof of convergence

22 / 31

slide-23
SLIDE 23

Regularize the regularizer

Smoothing of the regularizer for a convergent numerical scheme (Tan, Pierre and Nikolova, preprint 2018).

Introducing some regularity for the total variation : TVYdata(U, V ) :=

  • max {1, γ|∇Ydata|2} + |∇U|2 + |∇V |2 dx.

23 / 31

slide-24
SLIDE 24

Minimization algorithm

Inertial Bregman-based proximal gradient descent for image colorization

1: u0 ← C

i=1 wn+1

ci

2: u1 ← u0 3: for n > 0 do 4:

un ← 2un − un−1

5:

ˆ un ← 2un − un−1

6:

un+1 ← PR

  • ˆ

un − τ∇ TVC(un) + τλ C

i=1 wn+1 i

ci 1 + τλ

  • 7:

wn+1 ← wn

i exp

  • −σλ C

j=1 un+1 − cj2 2

  • C

i=1 wn i exp

  • −σλ C

j=1 un+1 − cj2 2

  • Convergence guaranteed.

No need of projection onto simplex.

24 / 31

slide-25
SLIDE 25

Energy comparison

200 400 600 800 1000 1.6 1.65 1.7 1.75 1.8 1.85 1.9 10 7 250 300 350 400 450 500 550 600 650 1.604 1.6045 1.605 1.6055 1.606 1.6065 1.607 1.6075 1.608 1.6085 1.609 10 7

Energy Zoom (yellow : ASAP, Primal-dual : red)

0.2 0.4 0.6 0.8 1 1 2 3 4 5 6 10 5 0.2 0.4 0.6 0.8 1 1.2 1 2 3 4 5 6 7 10 5

Weights, n=500 (ASAP) Weights, n=500 (Primal-dual)

25 / 31

slide-26
SLIDE 26

Original image Zhang et al. 2016 Our result

0.2 0.4 0.6 0.8 1 0.02 0.04 0.06 0.08 0.1 0.12 Zhang et al. 2016 Ours

Results of Zhang et al. 2016 vs our (histogram of the saturation). Average of saturation : our=0.4228 ; Zhang et al.=0.3802.

26 / 31

slide-27
SLIDE 27

Halo removal

Target (input) Result of Zhang et al. 2016 Our model

Toy example

proof of concept ; ability to remove the halo effects of Zhang et al. 2016.

27 / 31

slide-28
SLIDE 28

Target (input) Result of Zhang et al. 2016 Our model

28 / 31

slide-29
SLIDE 29

Target (input) Result of Zhang et al. 2016 Our model

29 / 31

slide-30
SLIDE 30

Limitation.

The results depend on the database.

Zhang et al. ECCV 2016, ImageNet (1.3 millions images) Larsson et al. ECCV 2016, ImageNet Iizuka et al. SIGGRAPH, 2016, Places (2.5 mil- lions images)

30 / 31

slide-31
SLIDE 31

Conclusion and future works :

Conclusion :

system able to colorize images without user intervention ; coupling of CNN and variational model.

Further improvement :

convergence for standard total variation with primal-dual approach and biconvex functions ; debiasing of the results.

31 / 31

slide-32
SLIDE 32

Coupling Variational Method with CNN for Image Colorization

Fabien Pierre.

University of Lorraine (France), LORIA, INRIA team MAGRIT. Variational methods and optimization in imaging. To the memory of our dear friend and colleague Mila Nikolova 2019.02.04

Many thanks for your attention.

31 / 31