Image Recognition and Face Detection

[This article was first published on Florian Teschner, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Image recognition and face detection has been around for some years. However, usage and adoption was limited due to quality and ease of development. With the release of Microsoft’s Project Oxford, the accessibility to such tools has massively improved. Their simple to use REST API provides an excellent opportunity for the average developer to augment their apps with fancy -state of the art- machine learning features.

To give you an example how this looks like:

Detecting Arnold Schwarzenegger

The API detects two faces (correct), one male one female (correct), the male face smiles (correct), the female face does not (correct). It also provides an age guess for Maria Shriver(36) and Arnold Schwarzenegger(48). As I don’t know when the photo was taken, it is hard to judge the accuracy. However, I assume that the guess is too low.

Let’s take a look at a more complex example; the German government.

Detecting German Government

Even though the images are pretty small, and faces are tilted in different ways the API does a good job at identifying faces, emotions, gender and ages.

In case you want to try it yourself, head over to my minimalistic implementation; provide an url of an image (with faces) and hit “classify”.

For the interested coder, I compiled a small R package Roxford providing access to the API. Please read the short installation guide.

To sum up; giving the complexity of image/face detection, I find it pretty amazing (and scary!) how easy it is. As faces get unique IDs, the API also provides functionality to label individuals in a large image library.

To leave a comment for the author, please follow the link and comment on their blog: Florian Teschner. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)