SlideShare a Scribd company logo
1 of 16
Download to read offline
MACHINE LEARNING -
MOBILE VISION
-Manikanta Garikipati
WHAT COMES IN FUTURE
➤ Deeper personalisation - Personalised recommendations and less
annoying ads
➤ Neural networks running on mobile devices - Mobile may start
running machine learning tasks locally Ex: face detection, speech and other
innovations.
➤ Mobile experience automation - Automate work of different
connected apps ex: IFTT
➤ NLP will begin to make sense - In a state that it can barely beat rule
based engines. That’s an exaggeration it’s still in its infancy.
➤ Real time speech translation - If this technology continues to develop, it
could significantly improve the quality of international communication or
even eradicate language barriers.
➤ Face Detection
➤ Natural Language Processing
➤ Barcode Detection
➤ Text Detection (OCR)
What is machine learning?
Machine learning is the idea that there are generic algorithms that can
tell you something interesting about a set of data without you having to
write any custom code specific to the problem. Instead of writing code,
you feed data to the generic algorithm and it builds its own logic based
on the data.
For example:
➤ Supervised and unsupervised learning
➤ Neural Networks
➤ Stateless vs State-full model
➤ Deeplearning
➤ Convolution(small neural networks, maxpooling)
➤ Precision(true positives vs all positive guess) and recall(true positives vs
dataset)
ML Basics
FACE DETECTION
➤ Process of locating human faces in visual media(digital images or video).
➤ Once a face is detected it can be
searched for landmarks such as eyes,
nose etc..
➤ A landmark is a point of interest
within a face. The left eye, right eye,
nose base are examples of
landmarks…
➤ We can see its common usage in
cameras(they recognise faces to make
sure all of them are in focus it takes
the picture)
➤ Social networking sites like Facebook
uses it!!
HOW TO DETECT FACES?
Face Recognition is a series of several related problems:
➤ First, look at a frame and find all faces in it.
➤ Second, focus on each face and able to understand that even if a face is
turned in a weird direction or in bad lighting, it is still the same person.
As a human, your brain is wired to do all of this automatically and instantly. In
fact, humans are too good at recognising faces and end up seeing faces in
everyday objects:
STEP 1: FINDING ALL THE FACES
➤ The first step in the pipeline is going to be finding faces in a photograph
before we try to tell them apart.
➤ More reliable solutions exist these days to recognise a face in a given frame.
We are going to look at HOG(Histogram of Oriented Gradients) solution
Mobile cameras using face detection
➤ We’ll look at every single pixel in our image one at a time. For every single
pixel, we want to look at the pixels that directly surrounding it:
➤ Our goal is to figure out how dark the current pixel is compared to the
pixels directly surrounding it. Then we want to draw an arrow showing in
which direction the image is getting darker:
➤ If you repeat that process for every single pixel in the image, you end up
with every pixel being replaced by an arrow. These arrows are called
gradients and they show the flow from light to dark across the entire image:
➤ We’ll break up the image into small squares of 16x16 pixels each. In each
square, we’ll count up how many gradients point in each major direction
(how many point up, point up-right, point right, etc…). Then we’ll replace
that square in the image with the arrow directions that were the strongest.
➤ The end result is we turn the original image into a very simple
representation that captures the basic structure of a face in a simple way:
➤ To find faces in this HOG image, all we have to do is find the part of our
image that looks the most similar to a known HOG pattern that was
extracted from a bunch of other training faces:
STEP 2: POSING AND PROJECTING FACES
➤ To account for this we will warp picture so that eyes and lips are always
in sample place in image. This makes face comparison a bit easier.
➤ To do this, we are going to use an algorithm called face landmark
estimation.
➤ There are lots of ways to do this, but we are going to use the approach
invented in 2014 by Vahid Kazemi and Josephine Sullivan
➤ Now we have to deal with the problem that faces turned different
directions look totally different to a computer
➤ The basic idea is we will come up with 68 specific points (called landmarks) that exist
on every face — the top of the chin, the outside edge of each eye, the inner edge of each
eyebrow, etc. Then we will train a machine learning algorithm to be able to find these 68
specific points on any face
The 68 landmarks we will locate on every face locating the 68 face landmarks on our test image
➤ You can also use this same technique to implement your own version of Snapchat’s
real-time 3d face filters!
➤ Now that we know were the eyes and mouth are, we’ll simply rotate, scale and shear the
image so that the eyes and mouth are centered as best as possible. We won’t do any fancy
3d warps because that would introduce distortions into the image. We are only going to
use basic image transformations like rotation and scale that preserve parallel lines (called
affine transformations):
➤ Code to find landmarks: https://gist.github.com/ageitgey/ae340db3e493530d5e1f9c15292e5c74
➤ Now no matter how the face is turned, we are able to center the eyes and mouth are in
roughly the same position in the image.
Thank You!
Questions?
Further Reading
➤ https://github.com/cmusatyalab/openface
➤ https://developers.google.com/vision/face-detection-concepts
References
➤ https://cmusatyalab.github.io/openface/
➤ https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern-
face-recognition-with-deep-learning-c3cffc121d78#.red05avch

More Related Content

Similar to Machine Learning for Mobile Vision: Face Detection and Recognition

Hr salary prediction using ml
Hr salary prediction using mlHr salary prediction using ml
Hr salary prediction using mlshaiksafi1
 
Applied Computer Vision - a Deep Learning Approach
Applied Computer Vision - a Deep Learning ApproachApplied Computer Vision - a Deep Learning Approach
Applied Computer Vision - a Deep Learning ApproachJose Berengueres
 
Face detection using template matching
Face detection using template matchingFace detection using template matching
Face detection using template matchingBrijesh Borad
 
Machine Learning for Designers
Machine Learning for DesignersMachine Learning for Designers
Machine Learning for DesignersMemi Beltrame
 
Fmp Pre-Production and Planning
Fmp Pre-Production and PlanningFmp Pre-Production and Planning
Fmp Pre-Production and PlanningDanMorland
 
How Sentiment Analysis works
How Sentiment Analysis worksHow Sentiment Analysis works
How Sentiment Analysis worksCJ Jenkins
 
Ux Journey: There and back again
Ux Journey: There and back againUx Journey: There and back again
Ux Journey: There and back againSean Fallon
 
Jay Turcot - Emotion AI Developer Day 2016
Jay Turcot - Emotion AI Developer Day 2016Jay Turcot - Emotion AI Developer Day 2016
Jay Turcot - Emotion AI Developer Day 2016Affectiva
 
IRJET- ATM Security using Machine Learning
IRJET- ATM Security using Machine LearningIRJET- ATM Security using Machine Learning
IRJET- ATM Security using Machine LearningIRJET Journal
 
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...CodeOps Technologies LLP
 
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...Sana Nasar
 
Owning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic EnvironmentsOwning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic EnvironmentsFergus Roche
 
Owning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic EnvironmentsOwning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic Environmentsguestf4f7a4b38
 
Facial_Recognition_PPT.pptx
Facial_Recognition_PPT.pptxFacial_Recognition_PPT.pptx
Facial_Recognition_PPT.pptxArijeetMohanty5
 
Machine Learning for Designers
Machine Learning for DesignersMachine Learning for Designers
Machine Learning for DesignersMemi Beltrame
 

Similar to Machine Learning for Mobile Vision: Face Detection and Recognition (20)

App inventor || Face Mesh Filter Camera and detection system in AI technolog...
App inventor || Face Mesh Filter Camera and detection  system in AI technolog...App inventor || Face Mesh Filter Camera and detection  system in AI technolog...
App inventor || Face Mesh Filter Camera and detection system in AI technolog...
 
Hr salary prediction using ml
Hr salary prediction using mlHr salary prediction using ml
Hr salary prediction using ml
 
Applied Computer Vision - a Deep Learning Approach
Applied Computer Vision - a Deep Learning ApproachApplied Computer Vision - a Deep Learning Approach
Applied Computer Vision - a Deep Learning Approach
 
Face detection using template matching
Face detection using template matchingFace detection using template matching
Face detection using template matching
 
Machine Learning for Designers
Machine Learning for DesignersMachine Learning for Designers
Machine Learning for Designers
 
Fmp Pre-Production and Planning
Fmp Pre-Production and PlanningFmp Pre-Production and Planning
Fmp Pre-Production and Planning
 
How Sentiment Analysis works
How Sentiment Analysis worksHow Sentiment Analysis works
How Sentiment Analysis works
 
Ux Journey: There and back again
Ux Journey: There and back againUx Journey: There and back again
Ux Journey: There and back again
 
Jay Turcot - Emotion AI Developer Day 2016
Jay Turcot - Emotion AI Developer Day 2016Jay Turcot - Emotion AI Developer Day 2016
Jay Turcot - Emotion AI Developer Day 2016
 
IRJET- ATM Security using Machine Learning
IRJET- ATM Security using Machine LearningIRJET- ATM Security using Machine Learning
IRJET- ATM Security using Machine Learning
 
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...
Machine Learning with Azure Cognitive Services - Face Recognition and Deep Fa...
 
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...
Final Year Project - Enhancing Virtual Learning through Emotional Agents (Doc...
 
Owning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic EnvironmentsOwning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic Environments
 
Owning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic EnvironmentsOwning the Interaction in Dynamic Environments
Owning the Interaction in Dynamic Environments
 
Facial_Recognition_PPT.pptx
Facial_Recognition_PPT.pptxFacial_Recognition_PPT.pptx
Facial_Recognition_PPT.pptx
 
Beginners' guide to app design
Beginners' guide to app designBeginners' guide to app design
Beginners' guide to app design
 
Facerecognition
FacerecognitionFacerecognition
Facerecognition
 
Facerecognition
FacerecognitionFacerecognition
Facerecognition
 
Machine Learning for Designers
Machine Learning for DesignersMachine Learning for Designers
Machine Learning for Designers
 
Final year ppt
Final year pptFinal year ppt
Final year ppt
 

Recently uploaded

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Machine Learning for Mobile Vision: Face Detection and Recognition

  • 1. MACHINE LEARNING - MOBILE VISION -Manikanta Garikipati
  • 2. WHAT COMES IN FUTURE ➤ Deeper personalisation - Personalised recommendations and less annoying ads ➤ Neural networks running on mobile devices - Mobile may start running machine learning tasks locally Ex: face detection, speech and other innovations. ➤ Mobile experience automation - Automate work of different connected apps ex: IFTT ➤ NLP will begin to make sense - In a state that it can barely beat rule based engines. That’s an exaggeration it’s still in its infancy. ➤ Real time speech translation - If this technology continues to develop, it could significantly improve the quality of international communication or even eradicate language barriers.
  • 3. ➤ Face Detection ➤ Natural Language Processing ➤ Barcode Detection ➤ Text Detection (OCR) What is machine learning? Machine learning is the idea that there are generic algorithms that can tell you something interesting about a set of data without you having to write any custom code specific to the problem. Instead of writing code, you feed data to the generic algorithm and it builds its own logic based on the data. For example:
  • 4. ➤ Supervised and unsupervised learning ➤ Neural Networks ➤ Stateless vs State-full model ➤ Deeplearning ➤ Convolution(small neural networks, maxpooling) ➤ Precision(true positives vs all positive guess) and recall(true positives vs dataset) ML Basics
  • 5. FACE DETECTION ➤ Process of locating human faces in visual media(digital images or video). ➤ Once a face is detected it can be searched for landmarks such as eyes, nose etc.. ➤ A landmark is a point of interest within a face. The left eye, right eye, nose base are examples of landmarks… ➤ We can see its common usage in cameras(they recognise faces to make sure all of them are in focus it takes the picture) ➤ Social networking sites like Facebook uses it!!
  • 6. HOW TO DETECT FACES? Face Recognition is a series of several related problems: ➤ First, look at a frame and find all faces in it. ➤ Second, focus on each face and able to understand that even if a face is turned in a weird direction or in bad lighting, it is still the same person. As a human, your brain is wired to do all of this automatically and instantly. In fact, humans are too good at recognising faces and end up seeing faces in everyday objects:
  • 7. STEP 1: FINDING ALL THE FACES ➤ The first step in the pipeline is going to be finding faces in a photograph before we try to tell them apart. ➤ More reliable solutions exist these days to recognise a face in a given frame. We are going to look at HOG(Histogram of Oriented Gradients) solution Mobile cameras using face detection
  • 8. ➤ We’ll look at every single pixel in our image one at a time. For every single pixel, we want to look at the pixels that directly surrounding it:
  • 9. ➤ Our goal is to figure out how dark the current pixel is compared to the pixels directly surrounding it. Then we want to draw an arrow showing in which direction the image is getting darker: ➤ If you repeat that process for every single pixel in the image, you end up with every pixel being replaced by an arrow. These arrows are called gradients and they show the flow from light to dark across the entire image:
  • 10. ➤ We’ll break up the image into small squares of 16x16 pixels each. In each square, we’ll count up how many gradients point in each major direction (how many point up, point up-right, point right, etc…). Then we’ll replace that square in the image with the arrow directions that were the strongest. ➤ The end result is we turn the original image into a very simple representation that captures the basic structure of a face in a simple way:
  • 11. ➤ To find faces in this HOG image, all we have to do is find the part of our image that looks the most similar to a known HOG pattern that was extracted from a bunch of other training faces:
  • 12. STEP 2: POSING AND PROJECTING FACES ➤ To account for this we will warp picture so that eyes and lips are always in sample place in image. This makes face comparison a bit easier. ➤ To do this, we are going to use an algorithm called face landmark estimation. ➤ There are lots of ways to do this, but we are going to use the approach invented in 2014 by Vahid Kazemi and Josephine Sullivan ➤ Now we have to deal with the problem that faces turned different directions look totally different to a computer
  • 13. ➤ The basic idea is we will come up with 68 specific points (called landmarks) that exist on every face — the top of the chin, the outside edge of each eye, the inner edge of each eyebrow, etc. Then we will train a machine learning algorithm to be able to find these 68 specific points on any face The 68 landmarks we will locate on every face locating the 68 face landmarks on our test image ➤ You can also use this same technique to implement your own version of Snapchat’s real-time 3d face filters!
  • 14. ➤ Now that we know were the eyes and mouth are, we’ll simply rotate, scale and shear the image so that the eyes and mouth are centered as best as possible. We won’t do any fancy 3d warps because that would introduce distortions into the image. We are only going to use basic image transformations like rotation and scale that preserve parallel lines (called affine transformations): ➤ Code to find landmarks: https://gist.github.com/ageitgey/ae340db3e493530d5e1f9c15292e5c74 ➤ Now no matter how the face is turned, we are able to center the eyes and mouth are in roughly the same position in the image.
  • 16. Further Reading ➤ https://github.com/cmusatyalab/openface ➤ https://developers.google.com/vision/face-detection-concepts References ➤ https://cmusatyalab.github.io/openface/ ➤ https://medium.com/@ageitgey/machine-learning-is-fun-part-4-modern- face-recognition-with-deep-learning-c3cffc121d78#.red05avch