Rapid Facial Feature Detection in iOS Instructor - Simon Lucey - - PowerPoint PPT Presentation

rapid facial feature detection in ios
SMART_READER_LITE
LIVE PREVIEW

Rapid Facial Feature Detection in iOS Instructor - Simon Lucey - - PowerPoint PPT Presentation

Rapid Facial Feature Detection in iOS Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps Today Facial Feature Detection in iOS. Active Appearance Models. Face Detection Face Detection in iOS In iOS face detection


slide-1
SLIDE 1

Rapid Facial Feature Detection in iOS

Instructor - Simon Lucey

16-423 - Designing Computer Vision Apps

slide-2
SLIDE 2

Today

  • Facial Feature Detection in iOS.
  • Active Appearance Models.
slide-3
SLIDE 3

Face Detection

slide-4
SLIDE 4

Face Detection in iOS

  • In iOS face detection comes built in, and can be performed

much more efficiently than standard OpenCV.

  • Utilizes the QuartzCore and CoreImage frameworks within

the project.

slide-5
SLIDE 5

Face Detection in iOS

  • In iOS face detection comes built in, and can be performed

much more efficiently than standard OpenCV.

  • Utilizes the QuartzCore and CoreImage frameworks within

the project.

slide-6
SLIDE 6

Facial Feature Detection

slide-7
SLIDE 7

CIFaceFeature

slide-8
SLIDE 8

CIFaceFeature

slide-9
SLIDE 9

CIFaceFeature Example

  • We are now going to demonstrate a simple example of face

detection in iOS.

  • On your browser please go to the address,

https://github.com/slucey-cs-cmu-edu/CIFaceFeature_Lena

  • Or better yet, if you have git installed you can type from the

command line. $ git clone https://github.com/slucey-cs-cmu-edu/CIFaceFeature_Lena.git

slide-10
SLIDE 10

CIFaceFeature Example

slide-11
SLIDE 11

CIFaceFeature Example

slide-12
SLIDE 12

CIFaceFeature Example

slide-13
SLIDE 13

CIFaceFeature Example

slide-14
SLIDE 14

CIFaceFeature Example

slide-15
SLIDE 15

CIFaceFeature Example

slide-16
SLIDE 16

Smerk and GPUImage

  • Recently, an extension to GPUImage was proposed to allow

for the utilization of iOS face detection within iOS.

  • Called “Smerk” - GitHub project page can be found at:-

https://github.com/MattFoley/Smerk

slide-17
SLIDE 17

Smerk and GPUImage

  • Recently, an extension to GPUImage was proposed to allow

for the utilization of iOS face detection within iOS.

  • Called “Smerk” - GitHub project page can be found at:-

https://github.com/MattFoley/Smerk

slide-18
SLIDE 18

Smerk Example

  • We are now going to demonstrate how we can perform real-

time face tracking through GPUImage.

  • On your browser please go to the address,

https://github.com/slucey-cs-cmu-edu/Smerk_Example

  • Or better yet, if you have git installed you can type from the

command line. $ git clone https://github.com/slucey-cs-cmu-edu/Smerk_Example.git

slide-19
SLIDE 19

Smerk Example

slide-20
SLIDE 20

Smerk Example

slide-21
SLIDE 21

Smerk Example

slide-22
SLIDE 22

Smerk Example

slide-23
SLIDE 23

Smerk Example

slide-24
SLIDE 24

Smerk Example

slide-25
SLIDE 25

Smerk Example

slide-26
SLIDE 26

Smerk Example

slide-27
SLIDE 27

Smerk Example

slide-28
SLIDE 28

Smerk Example

slide-29
SLIDE 29

Today

  • Facial Feature Detection in iOS.
  • Active Appearance Models.
slide-30
SLIDE 30

translation rotation aspect affine perspective cylindrical

Rigid Warps

  • Up until now, we have been limited to dealing with objects

that lie conveniently within a rectangle.

  • These objects can only deform rigidly,

18

slide-31
SLIDE 31

Non-Rigid Warps

  • What happens if I want to deal with non-rigid warps,

19

(Szeliski and Fleet)

slide-32
SLIDE 32

Non-Rigid Warps

  • What happens if I want to deal with non-rigid warps,

19

(Szeliski and Fleet)

slide-33
SLIDE 33

Active Appearance Models

  • Introduced by Cootes and Taylor in 1998
  • Example of class of deformable models which also includes

Active Blobs (Sclaroff and Isidoror), Active Shape Models (Cootes and Taylor) and Morphable Models (Blanz and Vetter)

  • Used successfully on faces, hands, and in medical imaging

20

(Matthews and Gross)

slide-34
SLIDE 34

Active Appearance Models

  • Separately model object shape and appearance

Appearance Shape

AAM

21

(Matthews and Gross)

slide-35
SLIDE 35

Active Appearance Models

  • Separately model object shape and appearance

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters

AAM

21

(Matthews and Gross)

slide-36
SLIDE 36

Active Appearance Models

  • Separately model object shape and appearance

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

21

(Matthews and Gross)

slide-37
SLIDE 37

Modeling

Active Appearance Models

  • Separately model object shape and appearance

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

21

(Matthews and Gross)

slide-38
SLIDE 38

Fitting Modeling

Active Appearance Models

  • Separately model object shape and appearance

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

21

(Matthews and Gross)

slide-39
SLIDE 39

Active Appearance Models

22

(Matthews and Gross)

slide-40
SLIDE 40

Active Appearance Models

22

(Matthews and Gross)

slide-41
SLIDE 41

AAM Overview

  • How do you build an AAM?
  • How do you fit an AAM to an image?
  • What is the general approach?
  • How can we do it efficiently?
  • Extensions

23

(Matthews and Gross)

slide-42
SLIDE 42

Model Building - Definition

  • Define a set of landmarks on a face that can be reliably

located in an image

  • Still open questions:
  • How many landmarks, which landmarks

24

(Matthews and Gross)

slide-43
SLIDE 43

Model Building - Definition

  • Define a set of landmarks on a face that can be reliably

located in an image

  • Still open questions:
  • How many landmarks, which landmarks

24

(Matthews and Gross)

slide-44
SLIDE 44

Model Building - Labeling

(x1, y1, x2, y2, . . . , xn, yn)

Manually label lots and lots of data

25

(Matthews and Gross)

slide-45
SLIDE 45
  • Various sources of shape variations between individual

images

  • Identity
  • Facial expression
  • Position in the image

Model Building - Shape

26

(Matthews and Gross)

slide-46
SLIDE 46

Don’t Care!

  • Various sources of shape variations between individual

images

  • Identity
  • Facial expression
  • Position in the image

Model Building - Shape

26

(Matthews and Gross)

slide-47
SLIDE 47
  • Procrustes analysis
  • Removes variation due to predetermined shape transformation

Shape Alignment

27

(Matthews and Gross)

slide-48
SLIDE 48
  • Procrustes analysis
  • Removes variation due to predetermined shape transformation

Shape Alignment

27

(Matthews and Gross)

slide-49
SLIDE 49
  • Procrustes analysis
  • Removes variation due to predetermined shape transformation

Shape Alignment

27

(Matthews and Gross)

slide-50
SLIDE 50

Building a Shape Model

Input Shape Basis Parameters =

28

(Matthews and Gross)

slide-51
SLIDE 51

Principal Component Analysis

Building a Shape Model

Input Shape Basis Parameters =

28

(Matthews and Gross)

slide-52
SLIDE 52

PCA on Appearance

Original

29

(Matthews and Gross)

slide-53
SLIDE 53

PCA on Appearance

Original Full

29

(Matthews and Gross)

slide-54
SLIDE 54

PCA on Appearance

Original Full 20 dim.

29

(Matthews and Gross)

slide-55
SLIDE 55

PCA on Appearance

Original Full 20 dim. 10 dim.

29

(Matthews and Gross)

slide-56
SLIDE 56

PCA Shape Model

  • Input: 


Bunch of aligned face shapes

  • Output


Mean shape and the direction of the largest variations (eigenvectors)

30

(Matthews and Gross)

slide-57
SLIDE 57

PCA Shape Model

  • Input: 


Bunch of aligned face shapes

  • Output


Mean shape and the direction of the largest variations (eigenvectors)

30

(Matthews and Gross)

slide-58
SLIDE 58

p = [p1, p2, . . . , pK]T

PCA Shape Model

s0 Mean Face First 3 Shape Modes s1 s2 s3

Shape Model Shape Parameters

31

(Matthews and Gross)

W(z; p) = s0 +

K

  • k=1

pksk

slide-59
SLIDE 59

Construction of Appearance Model

Warp to mean shape

s0

PCA on Appearance

32

(Matthews and Gross)

slide-60
SLIDE 60

PCA Appearance Model

  • Input:


Bunch of shape normalized textures

  • Output:


Mean appearance and appearance eigenvectors

33

(Matthews and Gross)

slide-61
SLIDE 61

PCA Appearance Model

  • Input:


Bunch of shape normalized textures

  • Output:


Mean appearance and appearance eigenvectors

33

(Matthews and Gross)

slide-62
SLIDE 62

AAM Appearance Model

A0(u) Mean Face First 3 Appearance Modes A1(u) A2(u) A3(u)

A(u) = A0(u) +

m

  • i=1

λiAi(u) (λ1, λ2, . . . , λn)T

Appearance Model Appearance Parameters

34

(Matthews and Gross)

A0(z)

A1(z)

A2(z)

A3(z)

T(z) = A0(z) +

M

  • m=1

λiAm(z)

slide-63
SLIDE 63

AAM Model Building Overview

Procrustes Procrustes

PCA PCA Shape Modes

s0 s1 s2

Appearance Modes

A0 A1 A2

35

slide-64
SLIDE 64

AAM Model Building Overview

Procrustes Procrustes

PCA PCA Shape Modes

s0 s1 s2

Appearance Modes

A0 A1 A2

35

slide-65
SLIDE 65

Model Instantiation

36

(Matthews and Gross)

W(z; p)

T(z)

A0(z) 3559A1(z)

351A2(z) 256A3(z)

slide-66
SLIDE 66

Model Instantiation

36

(Matthews and Gross)

W(z; p)

T(z)

A0(z) 3559A1(z)

351A2(z) 256A3(z)

T(W(z; p))

z

slide-67
SLIDE 67

T(W(z; p))

W(z; p) = s0 +

K

  • k=1

pksk

Model Instantiation

Warp

37

(Matthews and Gross)

T(z) = A0(z) +

M

  • m=1

λiAm(z)

slide-68
SLIDE 68

T(W(z; p))

W(z; p) = s0 +

K

  • k=1

pksk

Model Instantiation

Warp

Source Image

2D Similarity Transform

37

(Matthews and Gross)

T(z) = A0(z) +

M

  • m=1

λiAm(z)

slide-69
SLIDE 69

A Parameterized Face

38

(Matthews and Gross)

slide-70
SLIDE 70

A Parameterized Face

38

(Matthews and Gross)

slide-71
SLIDE 71

Things to Note

  • AAMs are linear models
  • Efficiently capture non-rigid face deformations
  • AAMs are entirely data-driven
  • No “face constraints”
  • We discussed independent AAMs. “Combined” AAMs add

an additional PCA on the combined shape and appearance parameters.

39

(Matthews and Gross)

slide-72
SLIDE 72

Hand AAM

40

(Matthews and Gross)

slide-73
SLIDE 73

Hand AAM

40

(Matthews and Gross)

slide-74
SLIDE 74

Things to Note

  • AAMs are linear models
  • Efficiently capture non-rigid face deformations
  • AAMs are entirely data-driven
  • No “face constraints”
  • We discussed independent AAMs. “Combined” AAMs add

an additional PCA on the combined shape and appearance parameters.

41

(Matthews and Gross)

slide-75
SLIDE 75

Active Appearance Models

Appearance Shape

AAM

Determine the best model parameters to reconstruct the image

42

(Matthews and Gross)

slide-76
SLIDE 76

Active Appearance Models

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters

AAM

Determine the best model parameters to reconstruct the image

42

(Matthews and Gross)

slide-77
SLIDE 77

Active Appearance Models

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

Determine the best model parameters to reconstruct the image

42

(Matthews and Gross)

slide-78
SLIDE 78

Modeling

Active Appearance Models

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

Determine the best model parameters to reconstruct the image

42

(Matthews and Gross)

slide-79
SLIDE 79

Fitting Modeling

Active Appearance Models

Appearance Shape 0.12

  • 0.34

6.78

  • 12.2

0.01

Parameters Image

AAM

Determine the best model parameters to reconstruct the image

42

(Matthews and Gross)

slide-80
SLIDE 80

arg min

∆λ,∆p ||T(z) + A∆λ − I(W(z; p)) − J∆p||2

∂W(z; p) ∂p

T

= [s1, . . . , sK]

AAM - Fitting “Simultaneous”

  • Now that we have defined an AAM, how should do the fitting?
  • Turns out, we can still use the “simultaneous” extension of the

LK algorithm,

  • where,

43

J = ∂I(W(z; p) ∂W(z; p)

T ∂W(z; p)

∂p

T

slide-81
SLIDE 81
  • Even faster if we use the inverse composition (IC) extension

as well as “projecting out” the appearance,

  • where,

arg min

∆p ||T(z) + Jic∆p − I(W(z; p))||2

null(A)

AAM - Fitting “Inverse Composition”

44

Jic = ∂T(W(z; 0) ∂W(z; 0)

T ∂W(z; 0)

∂p

T

∂W(z; 0) ∂p

T

= [s1, . . . , sK]

slide-82
SLIDE 82

IC AAM Fitting

  • Runs at 230 Hz on a 3.2GHz PC

Input Shape Overlaid Rendered Model Instance Overlaid Model Instance

45

(Matthews and Gross)

slide-83
SLIDE 83

IC AAM Fitting

  • Runs at 230 Hz on a 3.2GHz PC

Input Shape Overlaid Rendered Model Instance Overlaid Model Instance

45

(Matthews and Gross)

slide-84
SLIDE 84

Why We Need High Speed?

Re-initialize model multiple times if tracking fails and still track in real time

46

(Matthews and Gross)

slide-85
SLIDE 85

Why We Need High Speed?

Re-initialize model multiple times if tracking fails and still track in real time

46

(Matthews and Gross)

slide-86
SLIDE 86

Not All Is Peachy

Original model does not handle occlusion well

47

(Matthews and Gross)

slide-87
SLIDE 87

Not All Is Peachy

Original model does not handle occlusion well

47

(Matthews and Gross)

slide-88
SLIDE 88
  • To handle occlusions we can employ the robust error function,
  • where,

∂W(z; p) ∂p

T

= [s1, . . . , sK]

AAM - Fitting “Robust Error Function”

48

J = ∂I(W(z; p) ∂W(z; p)

T ∂W(z; p)

∂p

T

arg min

∆λ,∆p η(T(z) + A∆λ − I(W(z; p)) − J∆p)

slide-89
SLIDE 89

AAMs with Occlusion Modeling

49

(Matthews and Gross)

slide-90
SLIDE 90

AAMs with Occlusion Modeling

49

(Matthews and Gross)

slide-91
SLIDE 91

Applications

  • User Interfaces:
  • Mouse replacement
  • Automotive: Windshield Displays, Smart Airbags
  • Face Recognition:
  • Pose Normalization
  • Lipreading/Audio-Visual Speech Recognition
  • Rendering and Animation:
  • Low-Bandwidth Video Conferencing
  • Audio-Visual Speech Synthesis

50

(Matthews and Gross)

slide-92
SLIDE 92

User Interfaces: Head Pose

  • Mouse replacement

51

(Matthews and Gross)

slide-93
SLIDE 93

User Interfaces: Head Pose

  • Mouse replacement

51

(Matthews and Gross)

slide-94
SLIDE 94

User Interfaces: Gaze Tracking

Driver Camera Exterior View Camera

52

(Matthews and Gross)

slide-95
SLIDE 95

User Interfaces: Gaze Tracking

Driver Camera Exterior View Camera

52

(Matthews and Gross)

slide-96
SLIDE 96

Face Recognition: Pose Normalization

53

(Matthews and Gross)

slide-97
SLIDE 97

Face Recognition: Pose Normalization

53

(Matthews and Gross)

slide-98
SLIDE 98

Animation Generation

54

(Matthews and Gross)

slide-99
SLIDE 99

Animation Generation

54

(Matthews and Gross)

slide-100
SLIDE 100

Audio-Visual Speech Synthesis

Jingle Bells, Jingle Bells, Jingle All the Way, ...

55

(Matthews and Gross)

slide-101
SLIDE 101

Audio-Visual Speech Synthesis

Jingle Bells, Jingle Bells, Jingle All the Way, ...

55

(Matthews and Gross)