View of Emotion and Sentiment Analysis using Machine Learning

Download (0)

Full text


Emotion and Sentiment Analysis using Machine Learning

1.Kalpana G, 2. Pranav Kumar K, 3.Sudhakar J, 4. Sowndarya P

1Assistant Professor , 2,3,4 UG Scholars , Department of Computer Science and Engineering, Rajalakshmi Institute of Technology, Chennai, India.

1.[email protected], 2.[email protected], 3.[email protected],

4.[email protected]


Emotions are strong feelings, that human develop, when they are exposed to various situations, relations, and practices. These emotions are articulated with facial expressions and gestures. Machine learning solutions are widely being used to capture these emotions. This paper in particular focuses on Emotion and Sentiment detection based on Machine Learning Techniques. Facial Detection and Semantic Analysis are the key steps involved in detection of emotions. Sentiments are classified into positive (happy, excited and funny), negative (anger, disgust and sad) and neutral. The algorithms used identify the expression by plotting points on the detected human faces and compares the same with the facial expressions in the database repository. Semantic analysis, on the other hand uses algorithms to detect emotions in the language of script and audio formats, by matching keywords, affiliating them to positive or negative connotations and aggregating individual affiliations to present an overall tone.

Keywords: Machine Learning, Deep Learning, Connotation, Facial Recognition, Semantic Analysis.


Detection of human emotions, from speech, hand gestures and facial expressions, is critical in various industries. In the past, emotion detection has been implemented using IoT, Skin Conductance Sensors, EEG (Electroencephalography), and image processing.EEG works on microvolt (µV) signals of electrical activities of the brain, recorded by electrodes positioned on the scalp. Similarly, IoT devices capture images and speech signals of people, which are processed to obtain a classification score. These scores are then used for classifying the emotions. On the other hand, low-cost skin conductance sensors are capable of capturing heart rate, eye movements, facial expressions, blood pressure and temperature of an individual, eliminating the need for expensive hardware. This information can be further analyzed with New Emotion-Sensing technologies and AI programs.

As we are developing newer capabilities with Artificial Intelligence, accurate Emotion Detection is not a distant foot. Using Emotion detection in industries such as Healthcare, Marketing and Law will have an enormous impact on them. Healthcare facilities can reap the financial benefits, by applying this technology to analyze patient’s health based on real-time data collected from these algorithms and planning specific data- driven interventions. On the other hand, Emotional Marketing, a rapidly growing marketing approach, that targets an end customer’s requirement, emotional state and aspirations, involves understanding the emotions of the target audience, design the marketing strategy to appeal to their emotional states, and building a long-lasting attachment with the brand. Hence, this technique could help the business fraternity to establish an emotional


bonding between the brand and the user, reduce losses and increase their customer loyalty. As far as law industry is concerned, Emotion Detection may find a vast application in Discovery Deposition.


Emotion Detection is not an uncharted technology space. However, the accuracy of current implementations varies with several factors such as algorithms, training database, capturing usable face data etc., and a failure in any one of the above said component brings down the accuracy drastically.

Mr.M.Shamim Hossain proposed IoT based solution for emotion detection that uses IoT devices to capture the image and speech signals from the elderly and differently able patients. The recorded signals are sent through a 5G enabled framework of emotion detection module[1]. The signals from speech and images are processed separately and classification scores are assigned to the same. Further, the classification scores are aggregated to arrive at the emotion of the patient. These emotions are monitored, and the caregivers are designed to reach out to the patients if the emotion captured is Pain.

Further, M.Shamim Hossain has also proposed a mobile applications solution, in which a facial video is captured, and face detection algorithms are applied on certain frames that are selected. The Bandlet transform is realized on the face regions and the sub bands will be divided into a number of blocks. Local binary patterns are generated from the sub bands and are merged together. A Gaussian mixture model-based classifier is used to detect the emotion out of these blocks.

Abhijeet Kumar’s proposed solution was to extract the emotion from the speech signals, considering several acoustic features such as energy, Zero Crossing Rate (ZCR), fundamental frequency, Mel Frequency Cepstral Coefficients (MFCCs) etc.[2]. He then evaluated the speech using a pretrained Support Vector Machine.

Kim et al has proposed a solution in which he has used deep belief networks models to recognize emotions from audio signals[3]. The study had found that high order nonlinear relationships were more effective than linear relationships between the features for emotion detection.

Dolly Reney’s solution was to use a database to store the face data and evaluate the same with Viola-Jones face detection and KNN emotion detection algorithms[4].

The process of analysis of online movie reviews is done using SA methods in order to detect fake reviews.

SA and text classification algorithms are applied to the dataset.[5] The dataset will be split into two namely dataset version 1 and dataset version 2. Results of five different algorithms, namely Naïve Bayes, Support Vector Machine, K-Nearest Neighbors, K-Star and Decision Tree, are compared for effective sentimental analysis of movie reviews.

A Recommendation system with sentimental analysis is a widely used technique in the content marketing industries. A recommendation system with the help of Learning Automata-Based Sentiment Analysis system recommends places around a given location of the user.[6] It analyses the feedback about different places and recommends them.

An Effective e-learning system should have the right content for the right audience. Now-a-days users register for courses and they see all the syllabus and tools being taught in the course. But the developers don’t focus on the students needs. An e-learning system with user’s opinion will help the user to suggest ideas regarding the course contents and gaining practical knowledge. So, an opinion mining method is applied to improve the standard of e-learning [7]. A Hidden Markov Model along with SVM based learning method is


being used which comprises of three feature selection methods. They are MI (Mutual Information), IG(Information Gain), and CHI statistics (CHI).

Arabic language based Sentimental analysis was proposed by Rehab M. Duwairi and Islam Qarqaz. In this system, sentimental analysis is being performed for the Arabic based sentences [8]. Sentimental analysis will help in identifying the context (positive, negative or neutral) of a sentence. Dataset of tweets or comments is obtained, and three classifiers Naïve Bayes, SVM and K- Nearest Neighbor algorithms, were applied. The SVM algorithm showed the highest precision.

Social Media has become a great platform for sharing different crisis. Harvinder Jeet Kaur and Rajiv Kumar proposed a solution to perform sentiment analysis from various social media (mainly twitter) [9]. This provides different techniques which help in analyzing the social media data. A Naïve Bayes classifier is being used to build and train the model. It mainly helps in detecting various sentiments out of the voluminous comments/texts.

In order to discover, classify and find the correct context from various resources. Saumya Chaturvedi, Vimal Mishra and Nitin Mishra had made a model which helps in consolidating the views of different consumers with respect to business [10]. This helps increase the effectiveness of the marketing team.

Some of the existing methods have complex implementations, use huge training data and are expensive too.

Hence, it is evident that use of artificial intelligence, will increase the accuracy, reduce the cost and simplify the solutions implemented.



Figure 1. Working of The Emotion Detection Using Camera

We propose an Emotion Detection approach, which will record face data through camera and the same is passed through a Neural Network algorithm, which compares the face detected with the test data to assign an emotion to a given face data point. Below are the steps involved in the process.

First, the face data is extracted from the images recorded by the camera. In parallel, a database of emotions is set up with the training data. The algorithms validate incoming extracted images against the classified data and assigns a class to each of them denoting the emotion. There are several public datasets available for emotion recognition train data. FER-2013 and EmotiW are the most popular among the ones.


However, we have developed our own equally distributed train dataset of over 2000 images labelled with one of following seven emotions namely "happy", "sad", "neutral", "disgusted", "surprised", "fearful" and "angry".

Figure 2. Convolutional Neural Network Architecture for Emotion Detection Using Camera

In the next step, we choose the Neural Network algorithm that we will be using on the face data. Neural Networks algorithms are primarily classified into Convolutional Neural Networks (CNN) and Recurrent Neural Networks (RNN). In this approach, we use CNN over RNN, as they are proven to produce better results when used for image processing. A CNN with 3 CNN layers and 3 Max Pooling was observed to give the better results than various other conversations. With CNN, we create different classes denoting respective emotions, for instance, class 0 denotes anger faces, class 1 denotes disgust faces and so on, as seen in Figure 2, thus the face data points are each assigned one class at the end of the program.



Figure 3. Schematic Representation of Emotion Detection for Speech Using Neural Networks

Emotion Detection from speech is another technique which is of great interest for Law and Medical Industries. In this technique, audio signals are captured via a microphone and the same are analyzed with the help of neural networks and MFCC (Mel-Frequency Cepstral Coefficient).

As far as audio signals are concerned, there are multiple challenges in processing them such as input and output audio being of same length, frequency and duration, low or no noise etc. If the audio contains noise, the same has to be removed using low pass filters. Following this, MFCC (Mel-Frequency Cepstral Coefficient) is applied on the filtered audio for feature extraction. In parallel, training data is set up and with the help of neural network, the extracted feature (the audio after applying MCC) is compared with the train data and a specific emotion is assigned to each audio input audio data point.


The paper presented an approach to detect the emotion by using either camera or human speech, implemented via neural networks. Both are achieved with low cost hardware such as a camera and


microphones, in view of keeping the extension of the advantages to the increasing mobile phones fraternity, making Health Care, Marketing, and Law accessible without any additional cost to the consumer. With the current advancement in fitting in a wide variety of hardware in the smart watches and phones. industries could take advantage of this approach to implement low cost marketing (Marketing Industries) and continuous health monitoring systems (Health & Medicine Sectors), with completely transferring the cost of hardware to the consumer end, and them having to only contribute to continuous research and development of the algorithms.


[1] M. Shamim Hossain and Ghulam Muhammad, “Emotion-Aware Connected Healthcare Big Data Towards 5G”, IEEE Internet of Things Journal (Volume: 5, Issue: 4, Aug. 2018), page no 2399 – 2406.

[2] Nancy Semwal, Abhijeet KumarandSakthivel Narayanan, “Automatic speech emotion detection system using multi-domain acoustic feature selection and classification models”, 2017 IEEE International Conference on Identity, Security and Behavior Analysis (ISBA), Date Added to IEEE Xplore: 15 June 2017.

[3] Dolly Reney and Neeta Tripathi, “An Efficient method to Face and Emotion Detection”, 2015 Fifth International Conference on Communication Systems and Network Technologies, Date Added to IEEE Xplore:

01 October 2015.

[4] M. Shamim Hossain and Ghulam Muhammad, “An Emotion Recognition System for Mobile Applications”, 2015 Fifth International Conference on Communication Systems and Network Technologies, Date Added to IEEE Xplore: 01 October 2015.

[5] Elshrif Elmurngi and Abdelouahed Gherbi, “Detecting Fake Reviews through Sentiment Analysis Using Machine Learning Techniques”, International Journal on Advances in Systems and Measurements, vol 11 no 1

& 2, year 2018.

[6] P. Venkata Krishna, Sudip Misra, Dheeraj Joshi and Mohammad S. Obaidat, “Learning Automata Based Sentiment Analysis for recommender system on cloud”, 2013 International Conference on Computer, Information and Telecommunication Systems (CITS), Date Added to IEEE Xplore: 09 January 2014.

[7] Zied Kechaou, Mohamed Ben Ammar and Adel.M Alimi, “Improving e-learning with sentiment analysis ofusers’ opinions”, 2011 IEEE Global Engineering Education Conference (EDUCON), Date Added to IEEE Xplore: 23 May 2011.

[8] Rehab M. Duwairi and Islam Qarqaz, “Arabic Sentiment Analysis Using Supervised Classification”, 2014 International Conference on Future Internet of Things and Cloud, Date Added to IEEE Xplore: 15 December 2014.

[9] Harvinder Jeet Kaur and Rajiv Kumar, “Sentiment analysis from social media in crisis situations”,International Conference on Computing, Communication & Automation, Date Added to IEEE Xplore: 06 July 2015.

[10] Saumya Chaturvedi, Vimal Mishra and Nitin Mishra, “Sentiment analysis using machine learning for business intelligence”, 2017 IEEE International Conference on Power, Control, Signals and Instrumentation Engineering (ICPCSI).




Related subjects :