Emotion Detection Using Machine Learning in Python
Emotion Detection Using Machine Learning in Python
https://doi.org/10.22214/ijraset.2022.43108
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue V May 2022- Available at www.ijraset.com
Abstract: In this project emotion detection using its facial expressions will be detected. It can be derived from the live feed
via system’s camera or any pre-existing image available in the memory. Emotions possessed by humans can be detect by
machine and has a vast scope of study in the computer vision industry upon which several research have already been done.
The work has been implemented using Anaconda (Jupyter Notebook) (3.10), Open-Source Computer Vision Library
(OpenCV) and NumPy. The code check the video (testing dataset) is being compared to training dataset and thus emotion is
predicted. The objective of this paper is to develop a system which can analyze the image and run time video and predict the
expression of the person. The study proves that this project and code is workable and produces valid results.in this project
we have make change to the accuracy of the running project by using the different models of python and deep learning.
Keywords: Face Recognition, Image Processing, Computer Vision, Emotion Detection, OpenCV, numpy, mobilenet version
A. Average Method
In this method, the mean is given for the three colors i.e., Red, Blue & Green present in a color image. Thus, we have
Grayscale= (R+G+B)/3;
But sometime it happens that instead of the grayscale image we get the black image. This is because we have converted the image
we get 33% each of Red, Blue & Green.
For solving the problem in first method we use a another method called Weighted Method or Luminosity Method.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 3335
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue V May 2022- Available at www.ijraset.com
4) T Canli, JE Desmond, Z Zhao, G Glover… - …, 1998 - journals.lww.com CURRENT brain models of emotion processing
hypothesize that positive (or approach-related) emotions are lateralized towards the left hemisphere, whereas negative (or
withdrawal-related) emotions are lateralized towards the right hemisphere.
5) G Chanel, J Kronegg, D Grandjean, T Pun - International workshop on …, 2006 – Springer The arousal dimension of human
emotions is assessed from two different physiological sources: peripheral signals and electroencephalographic (EEG) signals
from the brain.
6) P Ekman - Handbook of cognition and emotion, 1999 - books.google.com In this chapter I consolidate my previous writings
about basic emotions (Ekman, 1984, 1992a, 1992b) and introduce a few changes in my thinking.
7) D Grocke, T Wigram - 2006 - books.google.com This practical book describes the specific use of receptive (listening) methods
and techniques in music therapy clinical practice and research, including relaxation with music for children and adults, the use
of visualisation and imagery, music and collage, song-lyric discussion, vibroacoustic applications, music and movement
techniques, and other forms of aesthetic listening to music.
IV. STEPS INVOLVED IN INSTALLING PYTHON 2.7 AND THE NECESSARY PACKAGES
Let’s begin with a sample of image in either .jpg or .png format and apply the method of image processing to detect emotion out of
the subject in the sample image. (The word ‘Subject’ refers to any living being out of which emotions can be extracted).
A. Importing Libraries
For successful implementation of this project, the following packages of Python 2.7 must be downloaded and installed: Python
2.7.x, NumPy, Glob and Random. Python will be installed in the default location, C drive in this case. Open Python IDLE, import
all the packages and start working.
B. NumPy
NumPy is one of the libraries of Python which is used for complex technical evaluation. It is used for implementation of
multidimensional arrays which consists of various mathematical formulas to process.
The array declared in a program has a dimension which is called as axis.
The number of axis present in an array is known as rank
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 3336
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue V May 2022- Available at www.ijraset.com
C. Glob
Based on the guidelines specified by Unix Shell, the Glob module perceives the pattern and with reference to it, generates a file. It
generates full path name.
Wildcards
These wildcards are used to perform various operations on files or a part of directory. There are various wildcards [5] which are
functional out of which only two are useful: -
D. Random
Random Module picks or chooses a random number or an element from a given list of elements. This module supports those
functions which provide access to such operations.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 3337
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue V May 2022- Available at www.ijraset.com
VII. CONCLUSION
1) The expected output of this project is that the accuracy of the project to capture facial The expression of a person using some
tools of AI like python, machine learning, CNN, open cv etc.
2) The main purpose of this project is to make significant contribution to the environment and help people to recognise the human
facial expression which can be easily understand the human feelings
3) Deep learning classification has been successfully applied to many EEG tasks, including motor imagery, seizure detection,
mental workload, sleep stage scoring, event related potential, and emotion recognition tasks. The design of these deep learning
studies varied significantly over the input formulization and network design.
4) Several public datasets were analysed in multiple studies, which allowed us to directly compare classification performances
based on their design. Generally, CNN’s, RNN’s, and DBN’s outperformed other types of deep networks, such as SAE’s and
MLPNN’s
5) Hybrid designs incorporating convolutional layers with recurrent layers or restricted Boltzmann machines showed promise in
classification accuracy and transfer learning when compared against standard designs.
6) We recommend to check more in-depth research of these particularly the number and arrangement of different layers including
RBM’s, recurrent layers, convolutional layers, and fully connected layers.
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 3338
International Journal for Research in Applied Science & Engineering Technology (IJRASET)
ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.538
Volume 10 Issue V May 2022- Available at www.ijraset.com
REFERENCES
[1] Murugappan, M., Rizon, M., Nagarajan, R., Yaacob, S., Zunaidi, I., Hazry, D.: getting scheme for human emotion detection using EEG. In: International
Symposium on Information Technology, ITSim 2008, vol. 2 (2008)
[2] Plutchik, R.: Emotions and life: perspectives from psychology, biology, and evolution, 1st edn. American Psychological Association, Washington, DC (2003)
[3] Petrantonakis, P.C., Hadjileontiadis, L.J.: Emotion recognition from images using higher order crossings. IEEE Transactions on Information Technology in
Biomedicine 14(2), 186–197 (2010)
[4] Canli, T., Desmond, J.E., Zhao, Z., Glover, G., Gabrieli, J.D.E.: Hemispheric asymmetry for emotional stimuli detected with fMRI. NeuroReport 9(14), 3233–
3239 (1998)
[5] Chanel, G., Kronegg, J., Grandjean, D., Pun, T.: Emotion assessment: Arousal evaluation using EEG’s and peripheral physiological signals (2006)
[6] Ekman, P.: Basic emotions. In: Dalgleish, T., Power, M. (eds.) Handbook of Cognition and Emotion. Wiley, New York (1999)
[7] Grocke, D.E., Wigram, T.: Receptive Methods in Music Therapy: Techniques and Clinical Applications for Music Therapy Clinicians, Educators and Students,
1st edn. Jessica Kingsley Publishers (2007)
©IJRASET: All Rights are Reserved | SJ Impact Factor 7.538 | ISRA Journal Impact Factor 7.894 | 3339