Machine Learning Algorithm to Recognize Human Emotions

Machine Learning Algorithm to Recognize Human Emotions


Develop a machine learning algorithm for emotions recognition.


Intetics’s client, a UK-based wearables development company, decided to enrich the product with an emotional-response feature. The feature should allow sports fans to share their emotional reactions to sports events. For successful implementation of this feature, the client needed the team of experts who would build the machine learning algorithm for emotions recognition. The company approached Intetics with the request to fulfill the task within a strict time span.


The client has gathered data from a set of different biometric sensors, worn by fans at live sports events. Each game was described with a timeline of events coded into an XML file by the client team.

In line with that, the client provided Intetics with a list of key events within all games and suggested fans’ emotional responses to them. Having biosensors data and

time coded reactions to the events, Intetics decided to apply a supervised machine learning approach for the algorithm creation.

Before the algorithm development, Intetics implemented a visual tool for biosensors data labeling. Using the correct labels is critical for supervising machine learning issues. Labels in that context meant time intervals, where any intense emotions were expected. The biosensors data of each fan was labeled individually based on XML timecoded feed, video recordings of games and fans’ physical reactions. Using the visual tool, an operator made these labels fast and efficient.

The preprocessing of the data was the first step of the algorithm. This included data filtering and removal of some artifacts. Along with that, each filter introduced a delay in the data, called a “group delay.” This means that the output filter data was is a bit shifted against the input data, i.e. slightly delayed. Each filter had its own group delay. These delays need to be considered, because misaligned in time data may cause low results of recognition, even if the rest part of the algorithm is perfect. After all these actions, the output of each sensor got normalized and fit the range from 0 to 1.

The second step included features’ extraction and segmentation. Segmentation meant that all data from each sensor, processed at step one, was presented in short pieces of time, usually from 1 to 3 seconds. Features extraction process included the calculation of the values for each time segment and each sensor.

The third step was about dimensionality reduction. After the first and second step, the Intetics team had a big volume of data. To reduce the number of dimensions, the team applied the primary component analysis, PCA. This allowed to decrease the data amount by four times and preserve almost all info. The quality of recognition enhanced, while the computational power was reduced.

The fourth step was related to the data splitting for the training and testing purposes. That step required the specific algorithms. The data was split into two parts. 70% of it was used for training while 30% for testing.

Training was the fifth step. To train the algorithm, the Intetics team used 70% of collected data and relevant labels to teach the algorithm, which time segments were emotional and what type of emotion they related. Following this approach, the algorithm remembered segments that were characterized by emotions.

The testing of classification was the sixth step. The trained algorithm used the rest 30% of data. During the testing process, the algorithm estimated each segment and made decisions.

Often in real-world algorithm training and all previous relevant steps are performed offline, before uploading firmware into the device. Classification and all relevant steps from first are performed in real time on the device.


Working with Intetics, the Client managed to implement the algorithm that confirmed that the recognition of emotions from the data of biosensors is possible and works. The algorithm allowed to add the innovative feature to the product and thus boost the customer loyalty to the product.

Case Study

Full Version Download
Do You have any questions? Feel free to ask us Contact