Style/Content separation

98
yle/Content separatio Evgeniy Bart, Dan Levi April 13, 2003

description

Style/Content separation. Evgeniy Bart, Dan Levi. April 13, 2003. Artistic styles. Photograph. Artistic styles. Impressionist. Artistic styles. Expressionist. Artistic styles. Pointillist. Photographic styles. *Pictures by Aya Aner-Wolf. Content. Style. Fonts. Faces. - PowerPoint PPT Presentation

Transcript of Style/Content separation

Page 1: Style/Content separation

Style/Content separation

Evgeniy Bart, Dan Levi

April 13, 2003

Page 2: Style/Content separation

Artistic stylesPhotograph

Page 3: Style/Content separation

Artistic stylesImpressionist

Page 4: Style/Content separation

Artistic stylesExpressionist

Page 5: Style/Content separation

Artistic stylesPointillist

Page 6: Style/Content separation

Photographic styles

*Pictures by Aya Aner-Wolf

Page 7: Style/Content separation

Fonts

A B C D E

A B C D E

A B C D EA B C D E

Sty

leContent

Page 8: Style/Content separation

Faces

*Images from FERET database

Page 9: Style/Content separation

TasksExtrapolation:

• Extrapolation of familiar style to new content

Page 10: Style/Content separation

TasksExtrapolation:

• Extrapolation of familiar content to new style

Page 11: Style/Content separation

TasksTranslation:

Page 12: Style/Content separation

Task specification by analogy

:

: ?Image analogies, Hertzmann et al.

Page 13: Style/Content separation

Wei

&L

evoy

Ash

ikhm

in

Page 14: Style/Content separation

Region growing

Somewhat similarto quilting

*Picture from presentation by Tal and Zeev

Page 15: Style/Content separation

Region growing

Page 16: Style/Content separation

Combining the two …

:

:

Page 17: Style/Content separation

… hierarchically

:

:

Page 18: Style/Content separation

… hierarchically

:

:

Page 19: Style/Content separation

… hierarchically

:

:

Page 20: Style/Content separation

...2

2

aaaaaaaaaa

aaaaaadd AWL

Selecting best match

Page 21: Style/Content separation

Arbitrating

?

yes no

Use Wei&Levoy value

Use Ashikhmin value

AWL dd

Page 22: Style/Content separation

Arbitrating

?

yes no

Use Wei&Levoy value

Use Ashikhmin value

AWL dd )1(

Page 23: Style/Content separation

Arbitrating

AWLldd )

21(

1

?

yes no

Use Wei&Levoy value

Use Ashikhmin value

Page 24: Style/Content separation

:

:

Results – artistic filters

Page 25: Style/Content separation

:

:

Results – artistic filters

Page 26: Style/Content separation

:

:

Results – artistic filters

Page 27: Style/Content separation

Super-resolution

:

Training 1

Page 28: Style/Content separation

Super-resolution

:

Training 2

Page 29: Style/Content separation

Super-resolution

:

Training 3

Page 30: Style/Content separation

Super-resolutionResults

:

Page 31: Style/Content separation

Super-resolutionResults

:

Page 32: Style/Content separation

A lonely pine is standing In the North where high winds blow.He sleeps; and the whitest blanket wraps him in ice and snow.

He dreams - dreams of a palm-tree that far in an Orient landLanguishes, lonely and drooping, Upon the burning sand.

H. Heine, translated by L. Untermeyer

Page 33: Style/Content separation

Texture by numbers

:

:

Page 34: Style/Content separation

ParametersannEpsilon: [float] = 1.000000ashLastLevel: [bool] = falsebiasPenalty: [float] = 0.000000cheesyBoundaries: [bool] = truecoherenceEps: [float] = 5.000000coherencePow: [float] = 2.000000createSrcLocHisto: [bool] = falsedecayWeight: [double] = 0.000000filterColorspace: [enum] = {Lab, Luv, RGB, XYZ}filterMM: [string] = (none!)filterModeMask: [string] = (none!)filterProcedure: [enum] = {Copy, Synthesize}filteredFeatureType: [enum] = {Difference, Raw}filteredPyramidType: [enum] = {Gaussian,

Laplacian}finalSourceFac: [float] = -1.000000gainPenalty: [float] = 0.000000heurAnnEpsilon: [float] = 1.000000heurMaxTSVQDepth [int] = 7histogramEq: [bool] = falselevelWeighting: [float] = 1.000000matchBtoA: [bool] = falsematchGrayHistogram: [bool] = falsematchMeanVariance: [bool] = falsemaxTSVQDepth: [int] = 20maxTSVQError: [float] = 0.000000modeMaskWeight: [float] = 0.010000neighborhoodWidth: [int] = 5

pyramidType: [enum] = {Gaussian, Laplacian, Steerable}samplerEpsilon: [float] = 0.100000searchMethod: [enum] = {ANN, Ash, HeurANN, HeurTSVQ,

Image, MLP, TSVQ, TSVQR, Vector}sourceColorspace: [enum] = {Lab, Luv, RGB, XYZ}srcWeight: [float] = 1.000000targetMM: [string] = (none!)targetModeMask: [string] = (none!)useBias: [bool] = falseuseFilter: [bool] = trueuseFilterModeMask: [bool] = falseuseGain: [bool] = falseuseInterface: [bool] = trueuseRandomStart: [bool] = trueuseSigmoidalDecay: [bool] = falseuseSplineWeights: [bool] = trueuseTargetModeMask: [bool] = falseuseYIQ: [bool] = falsenumHiddenNeurons: [int] = 20numLevels: [int] = 2numPasses: [int] = 1numTSVQBacktracks: [int] = 8onePixelSource: [bool] = falseoneway: [bool] = falsepyramidHeight: [int] = 4

Page 35: Style/Content separation

3D rotation

:

:

Page 36: Style/Content separation

3D rotation

:

:

Page 37: Style/Content separation

3D rotation

:

:

Page 38: Style/Content separation

3D rotation

:

:

Page 39: Style/Content separation

3D rotation

:

:

Page 40: Style/Content separation

What went wrong?

There is some structure, but not simple correspondence

Need more knowledge about objects

Page 41: Style/Content separation

Rectangular parallelepipeds(cuboids)

Page 42: Style/Content separation

24

Representation by 3D point coordinates

Linear classes, Vetter&Poggio

Page 43: Style/Content separation

May combine linearly

+ =

24

2

1

x

x

x

+

24

2

1

y

y

y

24

2

1

z

z

z

=

Page 44: Style/Content separation

Only 3 dimensions

+1 2 3+ =

=Call it linear class

Page 45: Style/Content separation

d

iiiBX

1

Linear operators

)3( d

• Linear operator L

d

iii BLXL

1

)(

Page 46: Style/Content separation

Example: rotation

+1 2 3+ =

=

Page 47: Style/Content separation

d

iiiBX

1

Rotation

d

i

rii

r BX1

If

Then

Page 48: Style/Content separation

Example: projection

+1 2 3+ =

=

Page 49: Style/Content separation

d

iiiBX

1

Projection

d

iiibx

1

If

Then

Page 50: Style/Content separation

Example: projection + rotation

+1 2 3+ =

=

Page 51: Style/Content separation

d

iiiBX

1

Rotation + projection

d

i

rii

r bx1

If

Then

But also

d

iiibx

1

We may work entirely in 2D domain!

Page 52: Style/Content separation

+1 2 3+

Working in 2D

:

:

+1 2 3+

Page 53: Style/Content separation

Results

:

:

Page 54: Style/Content separation

Results

:

:

Page 55: Style/Content separation

Can we apply this idea to faces?• Linear class assumption:

• Object may be represented as linear combination of other (similar) objects

+12

3+ =

• Use raw images as basis• Reconstruction quality will be poor• PCA reconstruction is much better• Can we use PCA?

Page 56: Style/Content separation

+1 2 3+

Using linear classes

:

:

+1 2 3+

Page 57: Style/Content separation

Using linear classes

• Eigenfaces do not correspond

• Cannot use the same coefficients

Page 58: Style/Content separation

So far: Solving Specific Tasks (Image analogies), Linear Classes

Learn InteractionGeneralize To

New Examples

Goal : General Style/Content Framework

Page 59: Style/Content separation

Goal : General Style/Content Framework1

b . . . . . . . . . . . . . . . . . . C

b1a

Sa

. . . . . . . .

),(cs

sc baFy

cb

sa

Page 60: Style/Content separation

Motivation : Linear Models

• Faces Images Form A linear subspace• Illumination variations (of same face) can be modeled

by a low-dimensional linear space (Hallinan ‘94)

Eigenvector Basis

Reconstruct

faces

Model: Linear In Style And In Content

eigenfaces (Turk , Pentland ‘91)

Page 61: Style/Content separation

Bilinear Models (Tenenbaum, Freeman 2000,97)

VyUx ,

is bilinear if :

f

WVUf :

Linear in x

),(),(

),(),(),( 2121

yxfyxf

yxfyxfyxxf

Linear in y

),(),(

),(),(),( 2121

yxfyxf

yxfyxfyyxf

y constant

yf WWU )(

Page 62: Style/Content separation

Bilinear Forms : Examplex,y∈Real f(x,y) = xy

Bilinear Forms To Model Style And Content

2 Models : Symmetric , And Asymmetric

Page 63: Style/Content separation

K

Image inStyle s Content c

Style vector

I

J

Content vector

IXJ

InteractionMatrix

Symmetric Bilinear Model

),(cssc

baFy

scy

sckyk

ck

sbWa

Page 64: Style/Content separation

K

Image inStyle s Content c

J

Content vector

Symmetric Bilinear Model

scky

cb

Pixel Style vector

J

s

ka

),(cssc

baFy c

s bA

Style Matrix

Asscy

JXK

Page 65: Style/Content separation

Symmetric Bilinear Model

ijkc

jji

si

ck

ssck WbabWay

,

: basis vectors JjIiijw ..1,..1

ijc

jji

si

scwbay

,

Page 66: Style/Content separation

Toy Example: Symmetric Model• Images:

cb

• Style: Color Content: Shape

(0,0,1,1) (2,2,2,0) (0,3,0,3)

Content:

(0,0,1,1) (1,0,1,0) (0,1,1,1)

Style:

1

2

3

sa

ijw

ijc

jji

si

scwbay

,

Page 67: Style/Content separation

Face Example - SymmetricStyle: Pose , Content: Person

Page 68: Style/Content separation

K

Image inStyle s Content c

Style vector

I

J

Content vector

IXJ

InteractionMatrix

Asymmetric Bilinear Model

scky

k

ck

sbWa Wk

s

Page 69: Style/Content separation

K

Image inStyle s Content c

J

Content vector

Asymmetric Bilinear Model

scky

cb

Pixel Style vector

J

s

ka

Style Matrix

Asscy

JXK

As:ContentImages

Page 70: Style/Content separation

K

Image inStyle s Content c

J

Content vector

Asymmetric Bilinear Model

cb

scy

J

c

ssc

bAy

Page 71: Style/Content separation

Asymmetric Bilinear Model

………

J

s

jj

cj ab

K

Image inStyle s Content c

scy

A style specific basis

Mixed by content

coefficients

sa1

s

Ja

c

ssc

bAy

Page 72: Style/Content separation

Content:

(0,0,1,1) (1,0,1,0) (0,1,1,1)

Toy Example: Asymmetric Model

cb

s

jaStyle:

s

jj

cj

scaby

Page 73: Style/Content separation

Face Example - AsymmetricStyle: Pose , Content: Person

Page 74: Style/Content separation

Training

PersonIl

lum

inat

ion

Style Content Image Matrix:

Page 75: Style/Content separation

Training – Model Fitting• Problem : Given {ysc

(t)}t = 1..T find model parameters • Error Minimization: Asymmetric:

• Closed SVD solution or Quasi-Newton methods • As, bc

• Free parameter: J – content vector dimension.

Symmetric:

• Iterative solution using SVD • as, Wk, bc

Page 76: Style/Content separation

Content:

person

Style:

illumination

Translation - Faces

Asymmetric Model Cannot handle translation!

Page 77: Style/Content separation

• Problem: C = 23 (faces), S = 3 (illuminations)• Training : Fit a symmetric model using iterative

SVD with I = S , J = C as, Wk, bc

• Generalization: find as`, bc` that minimize

E* = k| yks`c`- as`Wkbc` |2

• Alternating Iterative Linear Solution

• Translation : Produce as`Wkbc , asWkbc` for each s and c.

Translation – Symmetric Model

Page 78: Style/Content separation

Translation - Results

Page 79: Style/Content separation

Extrapolation Content: Letter , Style: Font

• Main Problem : Image Representation

• Linear combinations of letters should look like a letter.

Page 80: Style/Content separation

ADisplacement

Vector

Warp Map

Page 81: Style/Content separation

Coulomb Warp Map• For unique mapping:

physical model of electrostatic forces.

•Linear combination of letters looks like a letter

Page 82: Style/Content separation

Extrapolation Scheme

• Fit An Asymmetric bilinear model• S = 5 training fonts (styles) ,

C = 62 characters (content) , K=2888 data dim.• closed-form SVD As, bc

• C={c1,…,cM} letters in a new style s’ find best fitting As’

• Minimize : E* = c║ys’c - As’ bc║ ∂E*/ ∂ As’ = 0 Set J High(~60)• Overfitting on Test Data

(173,280 degrees of freedom!)

Page 83: Style/Content separation

Constraint: Close To Symmetric

• AOLC = sαsAs (Optimal Linear Combination)

• αs - style parameters (symmetric)

• Minimize:

E* = c║ys’c - As’ bc║ + λ║ As’ - AOLC ║ • ∂E*/ ∂ As’ = 0 • Extrapolate missing letters by: ys’c = As’ bc

Page 84: Style/Content separation

Results

Page 85: Style/Content separation

Symmetric vs. Aymmetric• Can reduce

dimensionality of factors

• Learns the structure of factor interactions : handles translation

• More Flexible• Too flexible:

overfitting• Cannot handle

translation

Can be overcome by combining both

Page 86: Style/Content separation

Bilinear Models (Tenenbaum, Freeman 2000,97)

• General framework for two factor problems• Explicit parameterized representations of each

factor and their interaction• Natural generalization for extrapolation and

translation tasks• Fast algorithms (SVD)

Pros:

Cons:•Assumes Linearity In Each Factor

• Find Clever Input Representations• Decompose To Sub Problems

Page 87: Style/Content separation

Example-Based Style Synthesis( Ido Drori Hezi Yeshurun Daniel Cohen-Or 03)

Page 88: Style/Content separation

Algorithm Outline1.Divide Image To Overlapping Tiles

Page 89: Style/Content separation

Algorithm Outline1.Divide Image To Overlapping Tiles

2. Find Best Match In Each Scene

Page 90: Style/Content separation

Algorithm Outline1.Divide Image To Overlapping Tiles

2. Find Best Match In Each Scene

3.Synthesize tilesBy Bilinear Model

Page 91: Style/Content separation

Algorithm Outline1.Divide Image To Overlapping Tiles

2. Find Best Match In Each Scene

3.Synthesize tilesBy Bilinear Model

4. Image Quilting

Page 92: Style/Content separation

Algorithm Outline1.Decompose

Image To Tiles

2. Find Best Match In Each Scene

3.Synthesize tilesBy Bilinear Model

4. Image Quilting

5. Image Analogies

Page 93: Style/Content separation

Create Gaussian Pyramids For ExamplesAnd Input Images

Apply Algorithm To Each Level From Coarse To Fine

Page 94: Style/Content separation

Finding Best Matching Fragment

Similar Geometry Agreeing Boundaries

Vsearch = ( , , , , , )Gradient Laplacian

Luminance

For Each Training Scene : Create V In every Position And Orientation

Search For Nearest Neighbor

Page 95: Style/Content separation
Page 96: Style/Content separation
Page 97: Style/Content separation
Page 98: Style/Content separation