Azure Face — facial recognition without machine learning knowledge

Fancy applications detecting people’s faces in photos… Probably very expensive, complicated, requiring a highly skilled team in machine learning. I don’t think it’s worth implementing in my project…

Well, not really! Let’s see a solution that can be both affordable and nearly effort-free!

What is Azure Face?

Azure Face is a service that allows detecting, recognizing, and analyzing faces from photos using AI algorithms. It’s a part of the Azure Cognitive Services family, which consists of many AI services allowing developers to implement machine learning in their applications using APIs. It does not require any knowledge of low-level machine learning. Actually, of any machine learning at all. All you need to do is provide some learning data.

Now let’s talk a little more precise about what this service allows. First of all, it detects faces on the image with their attributes, like the position of eyes, mouth, etc., gender, age, even emotions. It also allows creating private repositories of faces and then recognizes those faces on new photos that were not a part of a learning data. It can also find similar faces.

How can I use it?

There are two ways of using Azure Face. The first is a regular REST API, which can be used in all scenarios. Second is a dedicated SDK that is available for many languages (at the time of writing this article, supported languages are .NET, Python, Go, Java, Node.js, and Ruby. Also there’s a dedicated library for iOS).

Let’s cover example usage of the service to better understand how easy it is and how little expertise it requires.

Let’s assume we want to predefine a set of people and then we want to be able to detect their faces on new photos. The first step is to define our known set of people. Using the API or the SDK we can define a person. Then, we can provide learning data for each person. The more photos from different angles and with different expressions the better. But to make it work, about as much as ten photos are required. Then, having our system trained we can upload a new photo and in response from Face, we will get a list of recognized people on that photo (if any were found). At this point, it is also worth mentioning that Microsoft claims not to store the photos you use to detect faces, which are only used in the process of recognition and are removed afterward.

Is it worth it?

This whole thing sounds extremely expensive, right? Look how many matters are taken care of for us:

  • The whole infrastructure — there’s no need to install any additional software, we don’t need powerful graphical processing units, all we need to do is consume an API.
  • Time — training machine learning models is very time consuming, depending on the scale of the learning data, but it can take a very long time to get prepared. With time comes energy consumption which also is not free (especially when high-end GPU is running for a long time, trust me, the bill can be terrifying).
  • Expertise — Machine learning, especially when it comes to image processing, is a fairly complicated process that requires a high level of knowledge and experience. It might seem not worth building a whole team fairly or even get one expert, for instance just to implement an additional feature to the application that could use facial recognition.
  • Time again — there is a team, there is an infrastructure. Now the features need to be implemented. And this also takes time, no magic here. Even if some ready-to-use components are implemented, the application still needs to be deployed, tested, and so on.

Azure Face offers two pricing plans. Free and Standard. The free plan doesn’t offer SLA and is limited to a few thousand requests per month. It can be used in the development or a proof of concept. Standard plan prices are about 1 USD per 1000 transactions. As you can see, this doesn’t necessarily mean fortune, and if facial recognition is supposed to be only an additional feature of the application that won’t mean the main usage, then the pricing sounds very fair.

Pardon me, but you see… I’ve seen that face before

And now our favorite part, right? Real-life scenarios! To be honest, when it comes to facial recognition or detection, possibilities are endless. Every day we use apps that do that kind of thing. Finding people in the photo albums. Funny filters that change our eyes or add funny hats. Yay! We love that. But let’s talk about our experiences with Azure Face.

Detecting employees

We love social media! We often post photos from our office or after-hour parties. We also love privacy! We have made an app that detects our employees on photos, before posting them to social media, and notifies each of them. If they don’t wish the photo to be posted, they can reject it. All done automatically. No need to browse through all the photos we want to post and message each person separately. What a timesaver! It can even run on the free tier, we don’t post THAT much, right?
Now please spare a moment and think how much time and budget would be needed to implement that kind of solution from scratch…

Slackbot

This one was pure fun! But it gives some life to our Slack, which is nice and helps build a good atmosphere.

Every time a photo of one of our people is posted, whether it’s a selfie they sent from vacation or a photo from a conference, our bot says some nice things about that person using their name. “You are looking good today, John!”. It’s very similar usage as in the first example — we detect faces on the photo, and generate a message for known people. Almost no effort at all!

What we truly wish to point out here is that all those mechanisms, both recognition of faces and features detection (like gender, age, emotions) work well beyond expectations! We could expect that pre-trained AI to work “okay-ish” at most. Since it’s supposed to cover so many cases. But you’ve got to see that with your own eyes! It just works!

When shouldn’t I use it?

There are situations where using Azure Face might not be a great idea.

If the main feature of the application is face detecting or recognizing it might be a better idea to use a custom solution. First of all, if the detection will be done very often, after some time the bill might get large enough to reach the cost of a custom solution.

We need to keep in mind that we are limited to the provided functionality, which is very rich, but we might come to the point when we need something impossible to achieve with Face.

Azure Face has very good performance, and predictions are being executed very quickly. However we might find ourselves in a need of a solution that acts in real-time, and with API we are also limited by the bandwidth of our network.

Conclusion

Thank you very much for staying with us! We hope you’ve enjoyed your tour of the Azure Face service. Moreover, we hope that you are now convinced to use that product in your next project.
Got any more questions? Or maybe you wish to start your next project and you are looking for a team? Feel free to contact us! We are always ready to face any problem!

human-centric software design & development. check out our website: www.iteo.com