Recognizing whose face it is in iOS Swift

Viewed 3905

I'm trying to research about face recognition. But not just "recognizing that there's a face feature on the video" but also "recognizing whose face it is", on iOS Swift language. So far, the resource I get on the internet about this is only detecting, not truly face recognition (which I suspect there must be some kind of machine learning training and database to store all those training results for future recognition), like this tutorial using Vision framework, or this tutorial about face features, but none of them has machine learning. This tutorial talks about machine learning framework, OpenML, but no details whatsoever.

I did find a promising article about face recognition using Local Binary Patterns Histograms, even though the recognition part is very short, but it didn't say anything about where the data model stored, or whether I can send the "trained data" to the server to be integrated with the training data already in the server. And then there also that rumor of OpenCV being native on C++, and only can be implemented in Objective C++ and not on Swift?

To have a centralized face recognition database (by which a device train to recognize a face, upload the result to the server, and then another device can use that information to recognize the face earlier), I suspect the training is done on the client side (iOS), but the recognition is done on the server side (the device detect a face, upload a cropped image of that face to the server, and the server do a facial recognition on that image). Is that correct? Or is it more possible and practical to download all the server training data to the device, and then use that to do face recognition on the client? Or all the training and recognizing are done on the server?

This all is only in my head, but I actually don't know where to start looking for for my use case. I feel like the one that has to train and store model and do all the recognition is the server, where the client just only sent the detected face.

1 Answers

What you're talking about, if I understand it correctly, is that you're looking for FaceID. Unfortunately, Apple only gives this feature to developers as a means to authenticate the user and not recognize the face, per se. What you can do is take a picture of the face in the app; create a machine learning model with Apple's CoreML framework and train the model to recognize faces. But the problem with this is that you'd have to virtually train the model with every face, which is not possible. If you're keen, you can write your own algorithm for face recognition and analyze the taken picture with your model. For this, you'd need a really large amount of data.

Edits

Explore the following links. Maybe they can help.

https://gorillalogic.com/blog/how-to-build-a-face-recognition-app-in-ios-using-coreml-and-turi-create-part-1/

https://blog.usejournal.com/humanizing-your-ios-application-with-face-detection-api-kairos-60f64d4b68f7

Keep in mind, however, that these will not be secure like FaceID is. They can easily be spoofed.

Related