Was Ranbir able to Convince AI for his looks in Sanju ?

Giscle
Giscle
Published in
7 min readJul 8, 2018

Ranbir impresed everyone for his looks, acting and body language many of were convince that Ranbir is look like Sanjay Dutt. We though of asking same question from AI and build facial recognition of Sanjay Dutt and Ranbir. The Answer of AI was really surprising. Read full blog to know what AI think of Ranbir Looks in Sanju.

Ranbir Looks in Sanju Teaser (Source: FoxStart India)

The movie Sanju which was in the news for many reasons, first because the movie is based on one of the most controversial movie Star Sanjay Dutt, the blockbuster Director Mr. Raju Hirani and Super Start Ranbir’s acting. The movie was making social media fame for the Ranbir look and on many scenes, we were 100% convinced that he is Sanjay Dutt only. After the movie released and apart from all the box office collection Ranbir look and his acting were the most attractive part for audience. We have seen many fan videos which were not ready to consider the fact that there was Ranbir Kapoor in the movie. We were knowing this that the actor who was playing the lead in Sanju is Ranbir but AI was not knowing. And that’s why we thought of letting AI decide weather Ranbir Kapoor was able to convince AI that he was Sanjay Dutt.

Before starting the models work let’s talk about what is facial recognition?

Facial Recognition is a process of Computer Vision which teaches a computer to recognize the face of a known person from thousands. We as a human can see the human and through his name we remember and recall them among thousands. A camera function as similar to the eye (Of course there are some differences as well but work function are almost same)in that case can we make camera recognize someone with his/her name? face detection in modern smartphone camera is a common feature now. We have tried to recognize face too.

There are so many different methods available by which we can do facial recognition but we wanted to use a methods which should be real-time with accuracy upto 100%. We are not going to talk about facial recognition process in detail but you can refer this blog.

The entire work was separated into 5 steps:

Step-1 Building Facial Recognition of Ranbir and test with his old files movies.

We extracted 250 images from the web and started building the facial recognition of Ranbir. The images which we had used in our training dataset includes different sets such as Ranbir in clean save, Ranbir with bread, different ages of Ranbir etc. You can also see the different types of Ranbir images which we had used in our model for training. More interesting part is we did not used even a single image of Ranbir from Sanju’s look

Some of Ranbir training dataset images.

Once the model was ready we tested the model with his old movie and we were able to achieve 96.5% accuracy which was satisfactory for us. You can see the tested video. The Ranbir facial recognition was able to recognize Ranbir in every frames.

Ranbir facial detection on Tamasha Movie. (Source)

Step-2 Building facial Recognition of Sanjay Dutt and test with his old movies.

The same process we repeated for Sanjay Dutt as well. Since Sanjay Dutt has more number of looks then Ranbir we were facing problem in collecting the right dataset. But as we were knowing we have to make changes in the parameters we started with those 400 images. You can see those images which we have used in training Sanjay Dutt facial recognition.

Some of Sanjay Dutt images from training dataset.

Once the model was ready we tested the Sanjay Dutt model on his old movie, we were not able to achieve the accuracy which we were looking for but the model was working fine for most of the part.

Sanjau Dutt facial Recognition on Baba Bolta h Song (Video Source: Tseries Music)

Based on both of this input we make some changes in both the facial recognition to improve the model accuracy. Specially Sanjay Dutt facial recognition model accurate was bit low. After parameter modifications, we were impressed with our model. Finally we put some threshold value to gain more confidence.

Sanjay Dutt facial Recognition after improving the accuracy.

Step-3 Testing the Ranbir and Sanjay Dutt facial recognition on “Baba bolta hai bas ho Gaya” Song.

Since Sanjay Dutt and Ranbir, both the facial recognition were working really fine on the separate video we wanted to test both the recognition on the same video on both the Actor. And “Bana Bolta h” song was suitable for us. The test result of both the actors on the video was close to 96% accurate which were kind of relief. Since this recognition was like a validation for our models. You can see the video.

Sanjay Dutt and Ranbir facial recognition on “Baba Bolta h” Song (Video Source: Tseries Music)

Now we were quite excited because both the actor facial recognition was working really fine on “Baba Bolta hai” song. And the questions which we had in our mind was whether Ranbir will able to convince AI that he is Sanjay Dutt, not Ranbir in Sanju movie.

Step -4 Testing both the actor models on the Sanju Movie teaser.

Before testing the Facial recognition we tested the Ranbir facial recognition on a few of the iconic scene and found model were able to recognize Ranbir with the good number of confidence.

Model was able to recognize Ranbir Kapoor on epic Sanju movie jail scene which convienced many that Ranbir is look like Sanjay Dutt.

But at the same time, we had some doubt what if the Sanjay Dutt facial recognition able to detect Ranbir as Sanjay Dutt in Sanju movie ?There was some confusion so we thought of applying both the actor facial recognition on some of Sanju movie epic scene which convince many that Ranbir was look like Sanjay Dutt.

When we applied Sanjay Dutt facial Recognition on Sanju movie jail scene on Ranbir, model was not able to recognize Ranbir as Sanjay Dutt.
When we applied both recognition on famous Munna Bhai Class scene, model was able to recognise both Ranbir and Sanjay Dutt.

At till this point AI was able to recognize both the actors separately which were good but we wanted to confirm the model from every aspect. So as final verification we applied both the actor facial recognition on the Sanju Teaser and the result were simply amazing except on some point model was not able to detect Ranbir and it was coming unknown.

Source: FoxStart India

Why Ranbir face detection of Sanju looks were big deal ?

As we mentioned, we had not used a single image from Sanju movie to train Ranbir facial recognition. And to achieve Sanjay Dutt looks in Sanju movie makers used lot’s of materials on Ranbir face (You can see in the picture). In another words all the facial features of Ranbir model was actually covered by those materials and still AI was able to recognize Ranbir with high confidence. That’s why it was a big deal because the facial recognition of Ranbir on Sanju movie raise a question of method AI used for facial recognition.

Materials used on Ranbir face to achieved Sanjay Dutt looks in Sanju (Source: FoxStart India)

Further Improvements :
The model sometimes fails in recognizing the face if there is more brightness or some other conditions. This can be eliminated by some of the techniques in computer vision like gamma correction, image enhancements like contrast stretching ,Intensity transformation, spatial filtering etc.

Conclusion:

On one side where many people were convinced that it’s not Ranbir, Sanjay Dutt is the actor in Sanju movie but AI was not convinced. This is also proving the point AI is actually more powerful than humans because AI has no emotion and it does the assigned work without considering any fact. If we try to understand this we all knew that in Sanju movie it’s Ranbir but the level of preparation was so high and of course human emotions as well that we were convinced that he is Sanjay Dutt but for AI nothing matters. In other words, AI is a kind of Psycho who don’t think anything before applying knowledge and it finishes its work without considering anything else. The only limitation (or a challenge?) to AI is it needs hell lot of data. i.e even a kid looks someone for 10–15 times it can identify or recognize the person or any object.

PS: Our Computer Vision APIsand SDK will be available soon. And if you want to use for your business, please fill this form: http://bit.ly/2Nzm0j5. For any queries email us info@giscle.com

Note: All the video and image content used in the blog, belong to the respective owners, Giscle has only used this to demonstrate the facial recognition model.

The work has been done by Parth Patel. He sacrifice his Saturday Night and entire Sunday :). Would you like to join our team, let us know at passion@giscle.com

--

--

Giscle
Giscle
Editor for

Computer Vision platform offering three core vision services (Detection, Recognition and Analysis) in the form of easy to integrate APIs and SDKs.