You are on page 1of 6

ISSN: 2319-345X

www.ijmrbs.com
Vol. 12, Issue. 3,July 2023

EMOTION DETECTION USING MACHINE LEARNING


1 HARISH KUMAR GOPADI,2 DEEPTI SMARIKA,3 DEEKSHA,4 SAKSHI AGARWAL,5 MANASWINI

ABSTRACT: A human-computer interaction system for an automatic face recognition or


facial expression recognition has attracted increasing attention from researchers in
psychology, computer science, linguistics, neuroscience, and related disciplines. In this paper,
an Automatic Facial Expression Recognition System (AFERS) has been proposed. The
proposed method has three stages: (a) face detection, (b) feature extraction and (c) facial
expression recognition. The first phase of face detection involves skin color detection using
YCbCr color model, lighting compensation for getting uniformity on face and morphological
operations for retaining the required face portion. The output of the first phase is used for
extracting facial features like eyes, nose, and mouth using AAM (Active Appearance Model)
method. The third stage, automatic facial expression recognition, involves simple. Euclidean
Distance method. In this method, the Euclidean distance between the feature points of the
training images and that of the query image is compared. Based on minimum Euclidean
distance, output image expression is decided. True recognition rate for this method is around
90% - 95%. Further modification of this method is done using Artificial Neuro-Fuzzy
Inference System (ANFIS). This non-linear recognition system gives recognition rate of
around 100% which is acceptable compared to other methods.

Keywords: Facial expression recognition (FER), multimodal sensor data, emotional


expression recognition, spontaneous expression, real-world conditions

INTRODUCTION
Facial expression recognition (FER) has difficulty in accurately extracting the
been dramatically developed in recent useful emotional features. These features
years, thanks to the advancements in are often represented in different forms,
related fields, especially machine learning, such as static, dynamic, point-based
image processing and human cognition. geometric or region-based appearance.
Accordingly, the impact and potential acial movement features, which include
usage of automatic FER have been feature position and shape changes, are
growing in a wide range of applications, generally caused by the movements of
including humancomputer interaction, facial elements and muscles during the
robot control and driver state surveillance. course of emotional expression. The facial
However, to date, robust recognition of elements, especially key elements, will
facial expressions from images and videos constantly change their positions when
is still a challenging task (1)due to the subjects are expressing emotions.

1 ASSISTANT PROFESSOR, DEPARTMENT OF ECE, MALLA REDDY ENGINEERING COLLEGE FOR WOMEN,
HYDERABAD
2,3,4&5 UGSCHOLAR, DEPARTMENT OF ECE, MALLA REDDY ENGINEERING COLLEGE FOR WOMEN, HYDERABAD
As a consequence, the same feature in populations. Nonetheless, with respect to
different images usually has different facial expressions, there have been
positions. In some cases, the shape of the discrepant findings of the studies so far.
feature may also be distorted due to the The purpose of this article is to review the
subtle facial muscle movements. For topic of emotion(3), emotional facial
example, the mouth in the first two images expressions since ancient ages, to
in presents different shapes from that in emphasize the strengths and weaknesses of
the third image. Therefore, for any feature the related studies, to compare their results
representing a certain emotion, the and to pay attention to this novel issue for
geometric-based position and appearance- Turkey. In 1884, William James proposed
based shape normally changes from one the first important physiological theory of
image to another image in image emotion. James argued that emotion is
databases, as well as in videos. This kind rooted in the bodily experience. According
of movement features represents a rich to him, first, we perceive the object then
pool of both static and dynamic bodily response occurs and lastly
characteristics of expressions, which play a emotional arousal appears (Kowalski and
critical role for FER. The vast majority of Westen 2005 p347). For instance, when we
the past work on FER does not take the see a stimulus such as a bear, we have a
dynamics of facial expressions into ponding heart, we begin to run and than
account. Some efforts have been made on we fear. We do not run because of fear, we
capturing and utilizing facial movement fear because of running. When his Danish
features, and almost all of them are video- colleague Carl Lange independently
based. These efforts try to adopt either proposed a similar view in 1885, since
geometric features of the tracked facial then this theory has been known as James-
points (e.g. shape vectors, facial animation Lange theory of emotions (Kowalski and
parameters, distance and angular, and Westen 2005 p348, Candland et al 1977
trajectories), or appearance difference p87). Walter B. Cannon (1927-1931)
between holistic facial regions in proposed an alternative theory suggesting
consequent frames (e.g. optical flow, and that emotions are cognitive rather than
differential-AAM), or texture and motion physiological state of arousal. He
changes in local facial regions (e.g. surface perceived the sequence of events as
deformation, motion units, spatiotemporal external stimulation followed by neural
descriptors, animation units, and pixel processing followed by physiological
difference). Although achieved promising reactions. Philip Bard expanded Cannon’s
results, these approaches often require theory by showing the thalamic structures
accurate location and tracking of facial for the expression of emotion; this general
points, which remains problem. theoretical position came to be referred to
LITERATURE REVIEW Understanding as the “Cannon-Bard Theory”. This novel
emotional facial expressions accurately is theory included that emotion-inducing
one of the determinants in the quality of stimuli simultaneously elicit both an
interpersonal relationships. The more one emotional experience, such as fear, and
reads another’s emotions correctly, the bodily responses such as sweating
more one is included to such interactions. (Candland et al. 1977 p87-88, Kowalski
The problems in social interactions are and Westen 2005 p348). The study
shown in some psychopathological investigated the recognition of
disorders may be partly related to standardized facial expressions of emotion
difficulties in the recognition of facial (anger, fear, disgust, happiness, sadness,
expressions(2). Such deficits have been surprise) at a perceptual level (experiment
demonstrated in various clinical 1) and at a semantic level (experiments 2
and 3) in children with autism (N = 20) by alternating template matching and max
and normally developing children (N = pooling operations. We refine the approach
20). Results revealed that children with in several biologically plausible ways,
autism were as able as controls to using simple versions of sparsification and
recognize all six emotions with different lateral inhibition. We demonstrate the
intensity levels, and that they made the value of retaining some position and scale
same type of errors(4). These negative information above the intermediate feature
findings are discussed in relation to (1) level. Using feature selection we arrive at a
previous data showing specific impairment model that performs better with fewer
in autism in recognizing the belief-based features. Our final model is tested on the
expression of surprise, (2) previous data Caltech 101 object categories and the
showing specific impairment in autism in UIUC car localization task, in both cases
recognizing fear, and (3) the convergence achieving state-of-the-art performance.
of findings that individuals with autism, The results strengthen the case for using
like patients with amygdala damage, pass a this class of model in computer vision. The
basic emotions recognition test but fail to problem of recognizing multiple object
recognize more complex stimuli involving classes in natural images has proven to be
the perception of faces or part of faces. a difficult challenge for computer vision.
Since Kanner’s (1943) original clinical Given the vastly superior performance of
account of children with autism first human vision on this task, it is reasonable
described their profound lack of affective to look to biology for inspiration. In fact,
contact with other people, psychologists recent work by Serre,Wolf, and Poggio has
have been evaluating the social and shown that a computational model based
affective impairments in autism. The on our knowledge of visual cortex can be
empirical research on affective impairment competitive with the best existing
of children and adults with autism is wide computer vision systems on some of the
and varied so that it is not surprising that standard recognition datasets. Our paper
the findings are extremely mixed. builds on their approach by incorporating
Hypotheses of a general affective deficit some additional biologically-motivated
(Hobson, 1986a; 1986b; Hobson et al., properties, including sparsification of
1988), and a selective emotion recognition features, lateral inhibition, and feature
deficit (Baron-Cohen et al., 1999; Howard localization. We show that these
et al., 2000) have been explored. In modifications further improve recognition
addition, the theory of mind (ToM) deficit performance, strengthening our
account of autism allowed investigations understanding of the computational
of selective emotion processing constraints facing both biological and
impairment by contrasting recognition computer vision systems
tasks that do and do not necessitate the ANALYSIS AND DESIGN OF THE
ability to represent mental states (Baron- APPLICATION
Cohen et al., 1993). The present A. EXISTING WORK AFERS has three
investigations attempt to replicate and main steps
extend these findings with children with 1. To detect a face from a given input
autism. We apply a biologically inspired image or video,
model of visual object recognition to the 2. Extract facial features such as eyes,
multiclass object categorization nose, and mouth from the detected face
problem.Our model modifies that of Serre, 3. Divide facial expressions into different
Wolf, and Poggio. As in that work, we first categories such as happiness, anger,
apply Gabor filters at all positions and sadness, fear, disgust and surprise. Face
scales; feature complexity and detection is a special case of object
position/scale invariance are then built up detection. It also involves illumination
compensation algorithms and spaces. Transforming from RGB into any
morphological operations to maintain the of these spaces is a straight forward linear
face of the input image. transformation
B. Drawbacks: The system plays a 1. Face detection,
communicative role in interpersonal 2. Feature extraction and
relations because they can reveal the 3. Facial expression recognition.
affective state, cumulative activity, The first phase of face detection involves
personality, intention and psychological skin color detection using YCbCr color
state of a person. The proposed system model, lighting compensation for getting
consists of three modules. The face uniformity on face and morphological
detection module is based on image operations for retaining the required face
segmentation technique where the given portion
image is converted into a binary image and SYSTEM IMPLEMENTATION
further used for face detection. A. Skin Color Segmentation: For skin
C. Proposed Work: To improve the color segmentation, first we contrast the
recognition rate of the system, further image. Then we perform skin color
modification in the third phase is done segmentation.
using Artificial Neuro-Fuzzy Inference B. Face Detection: For face detection, first
System (ANFIS). In this method, the static we convert binary image from RGB
images as well as video input can be given image. For converting binary image, we
for testing the expressions. Here, neuro- calculate the average value of RGB for
fuzzy based automatic facial expression each pixel and if the average value is
recognition system to recognize the human below than 110, we replace it by black
facial expressions like happy, fear, sad, pixel and otherwise we replace it by white
angry, disgust and surprise has been pixel. By this method, we get a binary
proposed. Initially a video showing image from RGB image
different expressions is framed into C. Eyes Detection: For eyes detection, we
different images. Then the sequence of convert the RGB face to the binary face.
selected images is stored in a database Now, we consider the face width by W. We
folder. Using AAM method, the features of scan from the W/4 to (W-W/4) to find the
all the images are located & stored in the middle position of the two eyes. The
form of .ASF files. Then a mean shape is highest white continuous pixel along the
created for all the images in data folder. height between the ranges is the middle
The change in the AAM shape model position of the two eyes.
according to the change in facial D. Apply Bezier Curve: In the lip box and
expressions measures the distance or the the lip and may be some part of nose. So,
difference (6)between Neutral and other around the box there is skin color or the
facial expressions. These values are stored skin. So, we convert the skin pixel to white
in a .MA T file & a specific value is pixel and other pixel as black. We also find
assigned for each individual expression for those pixels which are similar to skin
training the ANFIS. These difference pixels and convert them to white pixel.
values are then given as input to the Here, if two pixels RGB values difference
ANFIS (Artificial Neuro-Fuzzy Inference is less than or equal 10, then we called
System). Using the ANFIS tool available them similar pixel. Here, we use histogram
in Mat lab, the system is trained for the for finding the distance between the lower
different images and their video input average RGB value and higher average
sequences for different expressions. RGB value.
D. Advantages: One advantage of using E. Database and Training: In our database,
these color spaces is that most video media there are two tables. One table “Person” is
are already encoded using these color for storing the name of people and their
index of 4 kinds of emotion which are 1. Eldar, C. Yonina, “Compressed sensing:
stored in other table “Position”. In the theory and applications,” Cambridge
“Position” table, for each index, there are 6 University, 2012.
control points for lip Bezier curve, 6 2. Solomon, Chris, Fundamentals of
control points for left eye Bezier curve, 6 Digital Image Processing: A practical
control points for right eye Bezier curve, approach with examples in Matlab. John
lip height and width, left eye height and Wiley & Sons, 2011.
width and right eye height and width. So, 3. Parkhi, Omkar M., Andrea Vedaldi, and
by this method, the program learns the Andrew Zisserman. "Deep face
emotion of the people. recognition." In bmvc, vol. 1, no. 3, p. 6.
F. Emotion Detection: For emotion 2015.
detection of an image, we have to find the 4. Grafsgaard, Joseph, Joseph B. Wiggins.
Bezier curve of the lip, left eye and right "Automatically recognizing facial
eye. Then we convert each width of the expression: Predicting engagement and
Bezier curve to 100 and height according frustration." In Educational Data Mining
to its width. If the person’s emotion 2013.
information is available in the database, 5. Moridis, Christos N., and Anastasios.
then the program will match which "Affective learning: Empathetic agents
emotion’s height is nearest the current with emotional facial and tone of voice
height and the program will give the expressions." IEEE Transactions on
nearest emotion as output. Affective Computing, vol. 3, pp. 260-
CONCLUSION & FUTURE 272,2012.
ENHANCEMENT This paper had 6. Brodny, Grzegorz, AgataKołakowska,
discussed about the efforts of the different Agnieszka Landowska, MariuszSzwoch,
researchers, with the effort made to WioletaSzwoch, and Michał R. Wróbel.
include as many references as possible "Comparison of selected off-the-shelf
from recent years. Based on reviews, the solutions for emotion recognition based on
paper had out some of the issues a raised facial expressions." In 2016 9th ICHSI,
towards facial expression recognition, IEEE. pp. 397-404, 2016. 7. H. Ding, S.K.
using different techniques for face Zhou, “Facenet2expnet: Regularizing a
detection, feature extraction, analysis and deep face recognition net for expression
classification methods. The paper gives recognition,” In Automatic Face & Gesture
detailed information about existing Recognition (FG 2017), 2017 12th IEEE
techniques in all the stages of Facial International Conference pp. 118-
Expression Recognition FERs. The paper 126,2017.
is very useful to both old and upcoming 8. Y. Wu, T. Hassner, K. Kim, “Facial
researchers in the field of FER, it presents landmark detection with tweaked
detail information about existing convolutional neural networks,” IEEE
techniques in all stages of that field to Transactions on Pattern Analysis and
reinforcement their understanding of Machine Intelligence, 2017
current trends and assist their future
research prospects and directions. Further,
the paper discussed about various
techniques of their technology, merits and
demerits which improves the performance
of Facial Expression Recognition in image
processing.
REFERENCES

You might also like