Back in 2015, Microsoft released its Emotion API (Project Oxford) which could analyze a person’s face and detect a range of feelings. While we can generally assess the emotions through a person’s facial expressions, using Microsoft’s artificial intelligence can unearth many hidden emotions that the human eye might not be able to decipher.
Making use of the Emotion API, Ammar A. Raja, a data analyst from Pakistan, has analyzed Prime Minister Nawaz Sharif’s public address to the nation following the Panama Papers revelations.
I read an article in which Ben Hubl applied Microsoft Cognitive Service Emotion API for an emotions analysis of the video of Hillary and Trump debate. I was amazed to see the accuracy of results, and the way the graphs of emotions were shown for each frame of the video.
Inspired by this, he carried out the same analysis on PM Sharif’s complete public address post Panama revelations. The observations made by the AI are rather…. interesting.
How it Works?
According to Microsoft, “the Emotion API takes a facial expression in an image as an input, and returns the confidence across a set of emotions for each face in the image, as well as bounding box for the face, using the Face API.”
The API can detect anger, contempt, disgust, fear, happiness, neutral, sadness and surprise as ratios out of 1 (Neutral is not assessed in video analysis). The AI can differentiate cross-cultural facial expressions.
With that introduction out of the way, let’s get to the main issue.
What Does the Emotion API Test Say of PM’s Address?
The Emotion API gives out numbers for its findings. As suggested by one of the pictures above, the highest emotional values were:
- Neutral – 0.42
- Anger – 0.30
- Disgust – 0.20
Happiness was nearly non-existent while Fear was on the lower side as well.
Coming down to the video analysis of the whole video, the API provides a JSON (Java Script Object Notation) file which reports the emotions for each frame of the video.
The graph below shows the average emotions from the whole video:
As expected, Anger remains the most noticeable emotional expression throughout the video followed by sadness and disgust. Pretty much what was noticed in the image, is repeated throughout the video.
A histogram of the reported values during the whole speech is shown below. It reports the emotional values for each frame of the video as it progresses.
Anger, Sadness and Disgust were the noticeable expressions initially, but these dipped as the speech moved towards the finale. Happiness also increased during the video and peaked out at the end of the speech. The rest of the emotions remained nearly the same throughout. Interestingly, as per the Emotion API, Nawaz Sharif did not feel surprised at the leaked information in the Panama Papers.
Either for academic purposes or the other, artificial intelligence has done a remarkable job at giving us a peak into what went behind that address of PM Sharif. As for Ammar, he plans on using natural language processing to use the sound to assess the emotions of the Prime Minister in the future.
So what do you think of the data here? Did it do an accurate enough job of giving us a peek at the emotions? Or do the numbers lie? Sound off in the comments below.