66
Face Detection Vikas.Chandrakant.Raykar Prithu Sinha University of Maryland,CollegePark

Vikas.Chandrakant.Raykar Prithu Sinha University of

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Vikas.Chandrakant.Raykar Prithu Sinha University of

Face Detection

Vikas.Chandrakant.RaykarPrithu SinhaUniversity of Maryland,CollegePark

Page 2: Vikas.Chandrakant.Raykar Prithu Sinha University of

Goal

To detect and localize human faces in any given grayscale/color image.Challenges: Invariant to

different illumination conditionsposecamera orientation

Page 3: Vikas.Chandrakant.Raykar Prithu Sinha University of

Applications

Face Detection is the first crucial step in face recognition, face tracking, pose estimation and expression recognition.SurveillanceVideo indexing/summarization, especially for new broadcasts and videos.

Page 4: Vikas.Chandrakant.Raykar Prithu Sinha University of

Important Survey papers

Ming-Hsuan Yang, David J. Kriegman, Narendra Ahuja, "Detecting Faces in Images: A Survey" in IEEE Transactions on Pattern Analysis and Machine Intelligence (January 2002), Vol. 24, No. 1

Henry A. Rowley, Shumeet Baluja, Takeo Kanade, "Neural Network-Based Face Detection" in IEEE Transactions on Pattern Analysis and Machine Intelligence (January 1998), Vol. 20, No. 1

Page 5: Vikas.Chandrakant.Raykar Prithu Sinha University of

Two Approaches:

Feature basedNo training requiredImage basedFormulate as a two class problem face vs nonface.Difficulty in getting all nonfaces

Page 6: Vikas.Chandrakant.Raykar Prithu Sinha University of

Database

CBCL Face Database #1(MIT Center For Biological and Computation Learning)

Training set : 2,429 faces, 4,548 non-facesTest set : 472 faces, 23,573 non-faces19X19 grayscale images as pgm filesTest set both frontal as well as non frontal and rotated faces.

http://www.ai.mit.edu/projects/cbcl

Page 7: Vikas.Chandrakant.Raykar Prithu Sinha University of

Training face database

Page 8: Vikas.Chandrakant.Raykar Prithu Sinha University of

Training nonface database

Page 9: Vikas.Chandrakant.Raykar Prithu Sinha University of

Test Face database

Page 10: Vikas.Chandrakant.Raykar Prithu Sinha University of

Test nonface database

Page 11: Vikas.Chandrakant.Raykar Prithu Sinha University of

Evaluation criterion

Pd Detection probabilityPf False alarm (a nonface detected as a face)

Pe Error probabilityPe=0.5*(Pf+(1-Pd)Ideally require high Pd and low PfCompromise between Pd and Pf

Page 12: Vikas.Chandrakant.Raykar Prithu Sinha University of

Our ApproachPreprocessing

Feature selection (entire image,PCA,KPCA)Training (NN)Classification (NN,KNN)

Discriminant Analysis(LDA,KLDA,BDA,KBDA)

Adaboost

Color based approaches

Page 13: Vikas.Chandrakant.Raykar Prithu Sinha University of

Preprocessing

Database has already cropped imagesLighting Compensation Subtract the best linear approximation of the image

Histogram equalization to improve contrast

Page 14: Vikas.Chandrakant.Raykar Prithu Sinha University of

Example

Page 15: Vikas.Chandrakant.Raykar Prithu Sinha University of

Neural Network

Vectorize the image and use the 361 element vector as an input to the NN3 layer network ( h hidden units )One output unit(1 face/ -1 nonface)sigmoid activation functionTraining : Gradient descent with momentum

Page 16: Vikas.Chandrakant.Raykar Prithu Sinha University of

Results

Trained using 2,429 faces 4,548 non-faces Tested on 472 faces and 472 nonfacesH=25 hidden units500 epochs(rate=0.1 momentum=0.8)

Page 17: Vikas.Chandrakant.Raykar Prithu Sinha University of

ROC-varying the threshold

Page 18: Vikas.Chandrakant.Raykar Prithu Sinha University of

Comments

The network is biased towards nonfacessince the number of nonfaces is more.We can get better detection probability is the number of faces is more than the number of nonfaces used in training. However the false alarm increases.We want high detection probability as we can reduce false alarms by certain heuristics.

Page 19: Vikas.Chandrakant.Raykar Prithu Sinha University of
Page 20: Vikas.Chandrakant.Raykar Prithu Sinha University of

Effect of num of hidden layers

Page 21: Vikas.Chandrakant.Raykar Prithu Sinha University of

Principal Component Analysis (PCA)

Subtract the mean Compute the scatter matrixFind the eigen values and their corresponding eigen vectorsSelect c largest to capture the desired varianceUse the projections on the eigenvectorsDid PCA only on the faces

Page 22: Vikas.Chandrakant.Raykar Prithu Sinha University of

Eigen Faces

Page 23: Vikas.Chandrakant.Raykar Prithu Sinha University of

Percentage of variance captured

Page 24: Vikas.Chandrakant.Raykar Prithu Sinha University of

First three principal components

Page 25: Vikas.Chandrakant.Raykar Prithu Sinha University of

Classification based on PC’s

K Nearest Neighbour(KNN)100 components to capture 95% of the varianceClassification based on one nearest neighbour

Train a Neural network

Page 26: Vikas.Chandrakant.Raykar Prithu Sinha University of

Results

0.20250.09380.6897PCA NN

0.21020.08280.6624PCA KNN

PePfPdThreshold= 01000 faces1000 nonfaces

Page 27: Vikas.Chandrakant.Raykar Prithu Sinha University of

PCA KNN vs PCA NN

PCA KNN Need to store all the training samples and compare with the test image. Can also use the mean face and nonfaceHowever PCA NN gives better results than PCA KNN

Page 28: Vikas.Chandrakant.Raykar Prithu Sinha University of

Kernel PCA

PCA is linearUses only second order statisticsCan do PCA in feature spaceExpress dot product in feature space in terms of kernel functions in the input space

Page 29: Vikas.Chandrakant.Raykar Prithu Sinha University of

Kernels used

Gaussian

Polynomial

Page 30: Vikas.Chandrakant.Raykar Prithu Sinha University of

Percentage of Variance captured(poly 2 kernel)

Page 31: Vikas.Chandrakant.Raykar Prithu Sinha University of

First three KPC’s

Page 32: Vikas.Chandrakant.Raykar Prithu Sinha University of

Results

KPCA NN

KPCA KNN

PePfPd

Page 33: Vikas.Chandrakant.Raykar Prithu Sinha University of

PCA vs KPCA

KPCA-NN

KPCA-KNN

0.20250.09380.6897PCA-NN

0.21020.08280.6624PCA-KNN

PePfPd

Page 34: Vikas.Chandrakant.Raykar Prithu Sinha University of

Comments

KPCA gives lower performance than PCA(???)KPCA is computationally more intensive

Page 35: Vikas.Chandrakant.Raykar Prithu Sinha University of

Linear Discriminant Analysis

PCA is unsupervised..so features found by PCA need not be discriminating among the classesLDA finds the direction which maximizes the distance between the projected means and minimizes the within class scatter

Page 36: Vikas.Chandrakant.Raykar Prithu Sinha University of

LDA

Equations

Page 37: Vikas.Chandrakant.Raykar Prithu Sinha University of

Projections-LDA

Page 38: Vikas.Chandrakant.Raykar Prithu Sinha University of

KLDA

LDA in feature spaceUse kernels to compute the dot products

Page 39: Vikas.Chandrakant.Raykar Prithu Sinha University of

Projections(

Page 40: Vikas.Chandrakant.Raykar Prithu Sinha University of

LDA vs KLDA

KLDA-POLY

KLDA-GAUS

0.37790.12740.3715LDA

PePfPd

Page 41: Vikas.Chandrakant.Raykar Prithu Sinha University of

Biased Discriminant Analysis BDA

Push all the nonfaces as far away from the faceMinimize the within class scatter for face only

Page 42: Vikas.Chandrakant.Raykar Prithu Sinha University of

Projections

Page 43: Vikas.Chandrakant.Raykar Prithu Sinha University of

KBDA

BDA if feature spaceUsed Gaussian and second degree polynomial kernels

Page 44: Vikas.Chandrakant.Raykar Prithu Sinha University of

BDA/KBDA

KBDAgaus

KBDA poly2

0.6BDA

PePdPf

Page 45: Vikas.Chandrakant.Raykar Prithu Sinha University of

LDA/BDA/KLDA/KBDA

Page 46: Vikas.Chandrakant.Raykar Prithu Sinha University of

Adaboost

Page 47: Vikas.Chandrakant.Raykar Prithu Sinha University of

Comparison of all methods

Used 1000 faces and 1000 nonfaces fortraining472 faces and 472 nonfaces for testingFor NN based methods threshold was set to zero

Page 48: Vikas.Chandrakant.Raykar Prithu Sinha University of

00.10.20.30.40.50.60.70.80.91

LDA

KLDA

PO

LY2

NN

(h=2

5)K

PCA

KN

N P

OLY

2K

PCA

NN

PO

LY2

KLD

A G

AU

SPC

A K

NN

PCA

NN

BD

A

KB

DA

GA

US

KB

DA

PO

LY2

Detection Probability

Page 49: Vikas.Chandrakant.Raykar Prithu Sinha University of

0

0.1

0.2

0.3

0.4

0.5

0.6

KLD

A P

OLY

2K

LDA

GA

US

NN(h

=25)

PCA

KNN

PCA

NN

LDA

KPC

A K

NN

PO

LY2

KPC

A N

N P

OLY

2B

DA

KB

DA

GAU

SK

BD

A P

OLY

2

False Alarm

Page 50: Vikas.Chandrakant.Raykar Prithu Sinha University of

00.050.10.150.20.250.30.350.4

PCA

NN

PCA

KN

NK

LDA

GA

US

NN

(h=2

5)K

LDA

PO

LY2

KB

DA

GA

US

KPC

A K

NN

PO

LY2

KB

DA

PO

LY2

KPC

A N

N P

OLY

2B

DA

LDA

Error Probability

Page 51: Vikas.Chandrakant.Raykar Prithu Sinha University of

Conclusions

Page 52: Vikas.Chandrakant.Raykar Prithu Sinha University of

Detecting faces in the entire image

A 19 x 19 window is slid over the entire image and the windowed image data is sent as a vector to the detectorTo detect faces of different sizes the scanning is repeated for successively smaller scales of the image by downsampling (typically by 1.2 to 1.4)

Page 53: Vikas.Chandrakant.Raykar Prithu Sinha University of

Output of the detector

Page 54: Vikas.Chandrakant.Raykar Prithu Sinha University of

Reducing false alarm

Multiple detections in areas of the image where there is a face, and false detections only appear in a single position.Can be used to significantly reduce false alarm Assuming faces do not overlap multiple detections in the image can be assumed to be a measure of high confidence that the detected area to be a face.

Page 55: Vikas.Chandrakant.Raykar Prithu Sinha University of

Consensus-voting scheme

For each scale of the image, retain information about the number of times each pixel overlapped due to multiple detections.Process the image for all scales possible, we added all the vote matrices to give the final vote matrixThreshold the final vote matrix

Page 56: Vikas.Chandrakant.Raykar Prithu Sinha University of

After Consensus voting

Page 57: Vikas.Chandrakant.Raykar Prithu Sinha University of

After Thresholding

Page 58: Vikas.Chandrakant.Raykar Prithu Sinha University of

Find Connected components and their bounding box

Page 59: Vikas.Chandrakant.Raykar Prithu Sinha University of

Sample results

Page 60: Vikas.Chandrakant.Raykar Prithu Sinha University of

Why not use color info….?

Detect skin regions.In an 8x8 block if the number of skin pixels is less than 32 eliminate the skin region.Find all the connected components and label them as face.

Page 61: Vikas.Chandrakant.Raykar Prithu Sinha University of

Color based face detection

Page 62: Vikas.Chandrakant.Raykar Prithu Sinha University of

How to detect skin regions?

RGB to Y Cb CrGet the joint distribution of Cb and Crfor skinUnder normal illuminations skin color occupy small regions of the color space77<Cb<127 133<Cr<173

Page 63: Vikas.Chandrakant.Raykar Prithu Sinha University of

Sample Results

Page 64: Vikas.Chandrakant.Raykar Prithu Sinha University of

Eliminate false detections

Use aspect ratioSearch for face like featuresUse other detectors to validate face or notUse different color distribution models for different illumination conditions (indoor/outdoor)Ideal for real time applications where we have one camera and the color distribution model for that camera can be found

Page 65: Vikas.Chandrakant.Raykar Prithu Sinha University of

Sample result

Page 66: Vikas.Chandrakant.Raykar Prithu Sinha University of