Wednesday, December 1, 2010

How Facebook Face Tagging Works

Many of us use the facebook tagging feature or twitter tagging feature to tag the faces of our friends and the photo automatically reaches there profile . I was tagging my friends in a funny picture that i created . I was quiet amazed to see how well this tagging process is structured so I went out to search the mechanism of face tagging. There are some of the most tough and technical documents available which are difficult to understand so i have attached a pdf file for those who want to have complete technical knowledge. The download link is available at the end of this article . I have tried to make it a balanced article for both technical and newbie readers.
There is a point that I want to make clear . There have been various articles claiming that the facebook's tagging feature lacks uniqueness and even non faced regions can also be tagged . My simple answer to this question is that an accurate face recognizing system requires higher resources which is currently not possible to add in a web application that is not exclusively designed for face tagging. It does lack accuracy but still provides yet another popular feature that facebook holds.

The technique is divided into three steps namely:

1)Data Acquisition
2) Face Detection
3) Face Recognition


This is the most elementary process of face recognization technique in which the data is collected from the users photos and are brocken into vector image matrix to identify each pixel with a seperate notation. This helps the algorithm to recognize every portion of the image with a certain value or you can say a combination of number.The image is selected and the algorithm is invoked as soon as the user clicks the "tag this photo button"


This is the step where the complexity lies. If you have used the twitter face tagging then definetly you will find it better than the facebok because twitter automatically detects the faces that are there in the image . There is a complex algorithm that is running behind the scene that detects and selects the faces. Although  you have the option of changing the location selected by twitter and neither it is very accurate . Facebook has given this step in the hands of the users to select the face themselves which is rather a more simpler and better move.

Consider this photo(founder,Hackingalert) . When the user clicks on the photo , facebook automatically selects the region to tag by building a matrix whose size depends upon the format,resolution and size of the photo that is being tagged. Now the algorithm starts a back tracking process by providing you the name you want to tag in the photo. Once you tag the photo,the algorithm automatically generates a linked list which starts pointing to the matrix location of the area to be tagged . This linked list is stored in a seperate manner that is exclusive for your account and the photo that you are tagging.


This is an optional part i must say because facebook has removed this feature from there site because of the various complaints made by its users. This feature automatically detects a face in the photo and provides you with an option to tag  in it .Twitter is still using this technique(maybe its users are far too loyal) .
This is the most advanced part of face tagging(or you can call it automatic face recognization system).
Once a photo is uploades into any account then the algorithm divides the photo into set of vector matrix set . This process is done with every photo . Now once the vector list is created it first selects the region that most accurately detects the face in that photo .

After this the algorithm matches the selected region with every possible photo that exists either in your or in your friends account . A point to note here is that there are different algorithms used for searching the database for appropriate matching, Once an appropriate match is found out , you are suggested with a tagging option .
The process is far more complex in the background and is still under development phase . It is still not very accurate . Data shows that 6 out of 10 auto tagging options are not correct.

Development is rapid.Maybe in the coming future we may witness a rather new and better feature of sharing photos online.



  1. Can you attach corresponding technical documents

  2. hey bro a general suggestion to your blog.....not regarding dis post. y dont you keep a favicon for your blog instead of default B.....?