1
Hi all !!
Real Time Face Detection
Systems Using Viola Johns
Algorithm
-Sreerag Sreenath
Sec A
Final Year B.Tech ECE
January 24 , 2017
Face Detection
3
Basic idea: slide a window across image and evaluate a face model at every
location of a given image
Overview
• Robust – very high Detection Rate (True-Positive Rate) & very low False-
Positive Rate… always.
• Real Time – For practical applications at least 2 frames per second must be
processed.
• Face Detection – not recognition. The goal is to distinguish faces from non-
faces (face detection is the first step in the identification process)
4
So how does the algo work?
5
Problems…..?
• How to define a feature?
-- Edge Detection to Haar features
• How to calculate area fast?
-- Integral Image
6
Steps in Voila Jones Face Detection
Algorithm
Haars
Features
Integral
Image
Adaboost Cascading
7
Basic Introduction to edge detection
Output image(right) has high intensity at pixels where the convolution kernel
pixel pattern matched perfectly with the input image
8
Haar Features
9
• Haar features are similar to these convolution kernels which are used to
detect the presence of that feature in the given image.
• Each feature results in a single value which is calculated by subtracting the
sum of pixels under white rectangle from the sum of pixels under black
Haar Features
10
• Viola Jones algorithm uses a 24x24 window as the base window size to
start evaluating these features in any given image.
• If we consider all the possible parameters of the haars features like position,
scale and type we will end up calculating about 160,000+ features in this
window.
Integral Window
11
• In an integral image the value at pixel(x,y) is the sum of pixels above and to
the left of (x,y)
• Integral image allows for the calculation of sum of all pixels inside any given
rectangle using only four values at the Conner of the rectangle.
Adaboost
12
• As stated previously there can be 160,000+ feature values within a detector
at 24x24 base resolution which needs to be calculated. But it is to be
understood that only few set of features will be useful among all these
features to identify a face .
Adaboost
13
• As Adaboost is a machine learning algorithm which helps in finding the best
among all these 160,000+ features. After these features are found, a
weighted combination of all these features in used in evaluating and
deciding any given window or not. Their accuracy can also be low more than
50 percent (better than random guessing)
• These best features are called as weak classifiers. Adaboost constructs a
strong classifier as a linear combination of these weak classifiers
Cascading
14
• The basic principle of the Viola-Jones face detection algorithm is to scan the
detector many times through the same image – each time with a new size.
• Even if an image should contain one or more faces it is obvious that an
excessive large amount of the evaluated sub-window would still be
negatives (non-faces).
• So the algorithm should concentrate on discarding non-faces quickly and
spend more time on the probable face regions
• Hence a single strong classifier formed out of linear combination of all best
features is not a good to evaluate on each window because of
computational cost
Cascading
15
• Therefore a cascade classifiers is used which is composed of stages each
containing a strong classifiers. So all the features are grouped into several
stages where each stage has certain number of features.
• The job of each stage is used to determine wheatear a given sub-window is
defiantly not a face or may be a face. A given sub window is immediately
discarded as not a face if it fails in any of the stage
Image Classification Process Video
16
Now the training to an XML file
17
Haars Cascade File
18
Face Detection Test
19
Sample detected Images
20
Further Improved Algorithms
21
• There have been a lot of research and development in object detection
algorithms since then. Feature Point detection, Bag-of-Words
models, Histogram-of-oriented gradients (HOG), Deformable Parts
Models, Exemplar models, etc. are some modern techniques that have been
used to great success. Deep learning (convolutional neural networks) is the
absolute state-of-the-art technique for object detection and has produced
great strides in the field.
• There are a lot of great papers and cutting-edge research. For example,
consider Facebook's DeepFace face recognition algorithm, DeepFace had
produced a face recognition accuracy of 97.35% on the Labelled Faces in
the Wild dataset, which is quite near human-level performance (97.53%)! So
yes, modern and state-of-the-art algorithms hold a lot of promise.
Thank You
22

Face detection system design seminar

  • 1.
  • 2.
    Real Time FaceDetection Systems Using Viola Johns Algorithm -Sreerag Sreenath Sec A Final Year B.Tech ECE January 24 , 2017
  • 3.
    Face Detection 3 Basic idea:slide a window across image and evaluate a face model at every location of a given image
  • 4.
    Overview • Robust –very high Detection Rate (True-Positive Rate) & very low False- Positive Rate… always. • Real Time – For practical applications at least 2 frames per second must be processed. • Face Detection – not recognition. The goal is to distinguish faces from non- faces (face detection is the first step in the identification process) 4
  • 5.
    So how doesthe algo work? 5
  • 6.
    Problems…..? • How todefine a feature? -- Edge Detection to Haar features • How to calculate area fast? -- Integral Image 6
  • 7.
    Steps in VoilaJones Face Detection Algorithm Haars Features Integral Image Adaboost Cascading 7
  • 8.
    Basic Introduction toedge detection Output image(right) has high intensity at pixels where the convolution kernel pixel pattern matched perfectly with the input image 8
  • 9.
    Haar Features 9 • Haarfeatures are similar to these convolution kernels which are used to detect the presence of that feature in the given image. • Each feature results in a single value which is calculated by subtracting the sum of pixels under white rectangle from the sum of pixels under black
  • 10.
    Haar Features 10 • ViolaJones algorithm uses a 24x24 window as the base window size to start evaluating these features in any given image. • If we consider all the possible parameters of the haars features like position, scale and type we will end up calculating about 160,000+ features in this window.
  • 11.
    Integral Window 11 • Inan integral image the value at pixel(x,y) is the sum of pixels above and to the left of (x,y) • Integral image allows for the calculation of sum of all pixels inside any given rectangle using only four values at the Conner of the rectangle.
  • 12.
    Adaboost 12 • As statedpreviously there can be 160,000+ feature values within a detector at 24x24 base resolution which needs to be calculated. But it is to be understood that only few set of features will be useful among all these features to identify a face .
  • 13.
    Adaboost 13 • As Adaboostis a machine learning algorithm which helps in finding the best among all these 160,000+ features. After these features are found, a weighted combination of all these features in used in evaluating and deciding any given window or not. Their accuracy can also be low more than 50 percent (better than random guessing) • These best features are called as weak classifiers. Adaboost constructs a strong classifier as a linear combination of these weak classifiers
  • 14.
    Cascading 14 • The basicprinciple of the Viola-Jones face detection algorithm is to scan the detector many times through the same image – each time with a new size. • Even if an image should contain one or more faces it is obvious that an excessive large amount of the evaluated sub-window would still be negatives (non-faces). • So the algorithm should concentrate on discarding non-faces quickly and spend more time on the probable face regions • Hence a single strong classifier formed out of linear combination of all best features is not a good to evaluate on each window because of computational cost
  • 15.
    Cascading 15 • Therefore acascade classifiers is used which is composed of stages each containing a strong classifiers. So all the features are grouped into several stages where each stage has certain number of features. • The job of each stage is used to determine wheatear a given sub-window is defiantly not a face or may be a face. A given sub window is immediately discarded as not a face if it fails in any of the stage
  • 16.
  • 17.
    Now the trainingto an XML file 17
  • 18.
  • 19.
  • 20.
  • 21.
    Further Improved Algorithms 21 •There have been a lot of research and development in object detection algorithms since then. Feature Point detection, Bag-of-Words models, Histogram-of-oriented gradients (HOG), Deformable Parts Models, Exemplar models, etc. are some modern techniques that have been used to great success. Deep learning (convolutional neural networks) is the absolute state-of-the-art technique for object detection and has produced great strides in the field. • There are a lot of great papers and cutting-edge research. For example, consider Facebook's DeepFace face recognition algorithm, DeepFace had produced a face recognition accuracy of 97.35% on the Labelled Faces in the Wild dataset, which is quite near human-level performance (97.53%)! So yes, modern and state-of-the-art algorithms hold a lot of promise.
  • 22.

Editor's Notes

  • #2 Have you guys every used any of these image filters before? Maybe snapchat, maybe facebook messenger? And many more But have you ever wondered how they work that too so fast and efficient?
  • #3 Good evening Sir and my dear friends Today I will be taking the seminar of the topic Real time Face detection systems, My name is Sreerag Sreenath, Final year Btech bearing the roll number 134153 So first lets get to the basics.
  • #4 Tell how is it different from face recognition