1 / 25

Face Detection and Classification on Mobile Devices

Face Detection and Classification on Mobile Devices. Igor Markov. Agenda. Introduction Algorithms The project Free frameworks. 2. What is face detection for?. Camera focusing Tagging faces on photos Marketing studies Surveillance Special effects (Augmented Reality) Robotics. 3.

defelice
Download Presentation

Face Detection and Classification on Mobile Devices

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Face Detection and Classification on Mobile Devices Igor Markov

  2. Agenda • Introduction • Algorithms • The project • Free frameworks 2

  3. What is face detection for? • Camera focusing • Tagging faces on photos • Marketing studies • Surveillance • Special effects (Augmented Reality) • Robotics 3

  4. On mobile devices? • The same thing. 4

  5. Face classification • Gender • Age • Emotion • Ethnic group 5

  6. Face tracking • Is this the same person in the next video frame? 6

  7. Traditional algorithms • Search for eyes, nose, mouth, etc • Estimate relative positions of these points • ... or, comparison with templates • Eigenfaces • Linear Discriminate Analysis • Elastic Bunch Graph Matching • Multilinear Subspace Learning • Dynamic link matching 7

  8. Viola–Jones Object Detection Framework • Proposed in 2001 by Paul Viola and Michael Jones • Real-time enough • A face can be rotated by angle up to 30° • Good for embedded solutions • Learning is rather slow 8

  9. Sub-window • Size is 24×24 • Moves through all possible positions 9

  10. Haar-like features • The light part is added • The dark part is subtracted 10

  11. Haar Feature Example 11

  12. Integral Image 12

  13. Classifiers Cascade 13

  14. Learning: Photo Set • At&T Facedatabase • Yale Facedatabase A • Extended Yale Facedatabase B • FERET 14

  15. Machine Learning • Boosting • AdaBoost 15

  16. Classification • Learning: AdaBoost • Classifications: Local Binary Patterns, EigenFaces, etc. ? ? 16

  17. Use Case • Face detection and classification for marketing study • Video stream from a camera, real time • Using Android phone • High performance 17

  18. Generic scheme on Android • Scheme - camera, native, overlays 18

  19. Optimizations • Avoid large data copying • double ➙ int • Early exit from loops • Parallelization • SIMD 19

  20. Parallel Detection • Thread pool (max threads = CPU cores number) • For each possible sub-window size: • Put a task to the thread pool • Wait for results 20

  21. NEON code loop: vldmia %0!, {%%d8, %%d9} //q4 <- data[i][j] vldmia %3!, {%%d28, %%d29} //q14 <- integral_fi[i-1][j] vldmia %5!, {%%d30, %%d31} //q15 <- sq_integral_fi[i-1][j] vmul.f32 %%q5, %%q4, %%q4 //q5 <- data^2 vmov %%d1, %%d8 // q0[2-3] <- q4[0-1] vadd.f32 %%q4, %%q0 vext.32 %%d3, %%d8, %%d9, #1 // q1[2-3] <- q4[1-2] vmov %%s5, %%s16 // q1[1] <- q4[0] vadd.f32 %%q4, %%q1 //data is summed in q4 vmov %%d5, %%d10 // q2[2-3] <- q5[0-1] vadd.f32 %%q5, %%q2 vext.32 %%d7, %%d10, %%d11, #1 // q3[2-3] <- q5[1-2] vmov %%s13, %%s20 // q3[1] <- q5[0] 21

  22. Public Frameworks • OpenCV (FaceRecognizer) • Android SDK (Camera Face Listener) • iOS SDK (Core Image) • Lots of them (facedetection.com) 22

  23. OpenCV • Open source • C++ • Many useful algorithms and primitives FaceRecognizer model = createEigenFaceRecognizer(); .... int predictedLabel = model->predict(testSample); 23

  24. Android SDK Face Detection class MyFaceDetectionListener implements Camera.FaceDetectionListener { public voidonFaceDetection(Face[] faces, Camera camera) { int i = 0; for (Face face : faces) {             Log.i("FD", "face detected: " + (++i) + " of " + faces.length + "X: " + faces.rect.centerX() + "Y: " + faces.rect.centerY());         }     } } 24

  25. iOS Core Image CIContext *context = [CIContext contextWithOptions:nil]; NSDictionary *opts = @{ CIDetectorAccuracy : CIDetectorAccuracyHigh }; CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace context:context options:opts]; opts = @{ CIDetectorImageOrientation : [[myImage properties] valueForKey:kCGImagePropertyOrientation] }; NSArray *features = [detector featuresInImage:myImage options:opts]; 25

More Related