1. Face detection in android
media apps
Adding more value to applications
Hackathon, Mobile Day
Endava
24.06.2013
2. • Face detection/recognition – what’s all about?
• Pioneers in face recognition
• Add value to your media apps
• What we want to…
• Tools & technologies
• How it’s all mixed up?
• How all things work together?
• How can we make it work?
• Some facts
• Don’t forget about privacy
• Q&A
Highlights
2
3. IN YOUR ZONE
Face detection/recognition – what’s all about?
3
•Face detection
• Definition
• Use cases
•Face recognition
•Definition
•Use cases
4. IN YOUR ZONE
Pioneers in face recognition
4
•Marker points (position of eyes, ears, nose)
•Kanade, T. (November 1973) - Euclidean distance between feature vectors of a probe and reference image
•Eigenfaces – Turk, M. & Pentland, A. – a holistic approach to face recognition
•Fisherfaces – Belhumeur, P. N., Hespanha, J., and Kriegman, D. (1997) - Eigenfaces vs. Fisherfaces
•Local feature extraction:
• Gabor Wavelets – Wiskott, L., Fellous, J., Krüger, N., Malsburg, C. (1997)
• Discrete Cosinus Transform – Messer, K. (2006
• Local Binary Patterns – Ahonen, T., Hadid, A., and Pietikainen, M. (2004)
5. IN YOUR ZONE
Add value to your media apps
5
•Face tagging in social media
•Sharing – open new ways to share
6. IN YOUR ZONE
Add value to your media apps
6
•Android Device lock, specific applications face authorization
•Determining friends in video clips
7. IN YOUR ZONE
What we want to…
7
•Detect faces in a specific image
•Recognize a tagged contact in Android Media library
11. IN YOUR ZONE
How can we make it work?
11
Mat imgGray = imread(originalImageName, CV_LOAD_IMAGE_GRAYSCALE);
CascadeClassifier face_cascade;
if(face_cascade.load(cascadeFilePath)){
face_cascade.detectMultiScale(loadedImageData, faces);
}
Ptr<FaceRecognizer> recognizer = createLBPHFaceRecognizer();
//training model
recognizer->train(images, labels);
//face prediction
recognizer->predict(scalledFace, predicted_label, predicted_confidence);
Face detection
Face detection
Face recognition
12. IN YOUR ZONE
Some facts about face recognition
12
0.00
5.00
10.00
15.00
20.00
25.00
30.00
35.00
40.00
45.00
50.00
14 faces 25 faces 40 faces
PERCENTAGE
RECOGNITION RATIO
Local Binary Paths Histogram (LBPH) FisherFaces EigenFaces
13. IN YOUR ZONE
Don’t forget about privacy
13
•Make use of privacy policies and/or disclaimers
Privacy matters to me!!!
That’s why I’m using
privacy visor…
15. IN YOUR ZONE
That’s it…
15
Vasile Chelban | Android Developer
thank you
http://opencv.org/platforms/android.html
http://developer.android.com/tools/sdk/ndk/index.html
http://developer.android.com/sdk/index.html
Editor's Notes
Face detection is a computer technology that determines the locations and sizes of human faces in arbitrary (digital) images. It detects facial features and ignores anything else, such as buildings, trees and bodies. Early face-detection algorithms focused on the detection of frontal human faces, whereas newer algorithms attempt to solve the more general and difficult problem of multi-view face detection. That is, the detection of faces that are either rotated along the axis from the face to the observer (in-plane rotation), or rotated along the vertical or left-right axis (out-of-plane rotation), or both. The newer algorithms take into account variations in the image or video by factors such as face appearance, lighting, and pose.Face detection is used in:biometrics, often as a part of (or together with) a facial recognition system. video surveillance, human computer interface and image database management. Some recent digital cameras use face detection for autofocus. researches in the area of energy conservation.Face recognition is an easy task for humans. Experiments in [Tu06] have shown, that even one to three day old babies are able to distinguish between known faces. So how hard could it be for a computer? It was shown by David Hubel and Torsten Wiesel, that our brain has specialized nerve cells responding to specific local features of a scene, such as lines, edges, angles or movement.Since we don’t see the world as scattered pieces, our visual cortex must somehow combine the different sources of information into useful patternsAutomatic face recognition is all about extracting those meaningful features from an image, putting them into a useful representation and performing some kind of classification on them.Skin texture analysisFace recognition uses:The London Borough of Newham, in the UK, previously trialed a facial recognition system built into their borough-wide CCTV system.The German Federal Police use a facial recognition system to allow voluntary subscribers to pass fully automated border controls at Frankfurt Rhein-Main international airport.Recognition systems are also used by casinos to catch card counters and other blacklisted individuals.The Australian Customs Service has an automated border processing system called SmartGate that uses facial recognition. The system compares the face of the individual with the image in the e-passport microchip, certifying that the holder of the passport is the rightful owner.U.S. Department of State operates one of the largest face recognition systems in the world with over 75 million photographs that is actively used for visa processing.Because of certain limitations of fingerprint recognition systems, nowadays facial recognition systems are finding market penetration as Attendance monitoring alternatives.
Face recognition based on the geometric features of a face is probably the most intuitive approach to face recognition. Kanade T. - Marker pointswere used to build a feature vector (distance between the points, angle between them, ...). Such a method is robust against changes in illumination by its nature, but has a huge drawback: the accurate registration of the marker points is complicated, even with state of the art algorithms.Eigenfaces - Turk, M. & Pentland, A. – A facial image is a point from a high-dimensional image space and a lower-dimensional representation is found, where classification becomes easy. Principal Component Analysis – it doesn’t take any class labels into account. If the variance is generated from external sources, let it be light, the axes with maximum variance do not necessarily contain any discriminative information at all, hence a classification becomes impossible.Fisherfaces - Belhumeur, P. N., Hespanha, J., and Kriegman, D. – a class-specific projection with a Linear Discriminant Analysis was applied to face recognition.The basic idea was to minimize the variance within a class, while maximizing the variance between the classes at the same time.To avoid the high-dimensionality of the input data only local regions of an image are described, the extracted features are (hopefully) more robust against partial occlusion, illumation and small sample size.Algorithms used for a local feature extraction:Gabor Wavelets– Wiskott, L., Fellous, J., Krüger, N., Malsburg, C. (1997) – Face Recognition By Elastic Bunch Graph Matching.Discrete Cosinus Transform – Messer, K. (2006) – Performance Characterisation of Face Recognition Algorithms and Their Sensitivity to Severe Illumination ChangesLocal Binary Patterns – Ahonen, T., Hadid, A., and Pietikainen, M. (2004) – Face Recognition with Local Binary PatternsIt’s still an open research question what’s the best way to preserve spatial information when applying a local feature extraction, because spatial information is potentially useful information.
A professor at Tokyo’s National Institute of Informatics recently created a stocky pair of glasses that will conceal the face of an individual from facial recognition software. Using a small array of near-infrared LED lights that are invisible to the human eye, Associate Professor Isao Echizen’s goggles fool detection software by creating virtual noise in a surveillance camera’s imaging sensor, disrupting readings on normal facial features.