Detecting emotion with Machine Learning

Machine Learning is a very hot topic these days. Getting started can be fast and easy. In this video post, I walk through the steps to build a simple Universal Windows Application (UWP) that connects to the Microsoft Cognitive Services and the Emotion API.

The Microsoft Cognitive Services are a set of APIs that enable your apps to leverage powerful algorithms using just a few lines of code. They work across lots of various devices and platforms such as iOS, Android, and Windows, keep improving and are easy to set up.

 

In the demo we use the Emotion API to take a facial expression of an image, we capture as input. The API returns the confidence across a set of emotions for each face in the image, as well as a bounding box for each of the faces found in the image or stream. The emotions detected are anger, contempt, disgust, fear, happiness, neutral, sadness, and surprise. These emotions are understood to be cross-culturally and universally communicated with particular facial expressions.

The demo above is based around UWP and uses C# as the programming language. If you are looking for a NodeJS and JavaScript solution, I suggest this excellent video by Rami Sayar https://channel9.msdn.com/Events/canada/MSFTHacks/Am-I-happy-Overview-of-Cognitive-Services--the-Emotion-API

Some links of interest:

Microsoft Cognitive Services Website: https://www.microsoft.com/cognitive-services

Emotion API  Documentation: https://dev.projectoxford.ai/docs/services/5639d931ca73072154c1ce89/operations/563b31ea778daf121cc3a5fa

Cognitive Services Application Gallery: https://www.microsoft.com/cognitive-services/en-us/applications

Happy Coding!