SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Emotion Detection
Using AI
How Emotion Detection can change the future
BY-ARYAN TRISAL
In this Presentation
Here's what we have covered:
Introduction
Problems Faced
Solutions
Need for the proposed system
Implementation
Code
Future Scope
Introduction
Facial expression is an essential part of
communication. For this reason, the issue of
human emotions evaluation using a computer is a
very interesting topic, which has gained more and
more attention in recent years. It is mainly related
to the possibility of applying facial expression
recognition in many fields such as HCI, video
games, virtual reality, and analysing customer
satisfaction etc. Emotion’s determination
(recognition process) is often performed in 3 basic
phases: face detection, facial features extraction,
and last stage - expression classification.
Facial emotion
recognition is a
complex task and
the machine
learning approach
to recognize faces
requires several
steps to perform
it, some are:
Feature selection: This stage refers to attribute
selection for the training of the machine learning
algorithm. The process includes the selection of
predictors for construction of the learning system
Feature classification: When it comes to
supervised learning algorithms, classification
consists of two stages. Training and classification,
where training helps in discovering which features
are helpful in classification.
Feature extraction:Machine learning requires
numerical data for learning and training. During
feature extraction, processing is done to
transform arbitrary data, text or images, to gather
the numerical data
Classifiers:This is the final step in this process.
Based on the inference from the features, the
algorithm performs data classification.
Problems Faced
Technical challenges
Emotion recognition shares a lot of challenges with detecting moving
objects in the video identifying an object, continuous detection,
incomplete or unpredictable actions, etc.
Data augmentation
As with any machine learning and deep learning algorithms, ER solutions
require a lot of training data. This data must include videos at various
frame rates, from various angles, with various backgrounds, with people
of different genders, nationalities, and races, etc.
Solutions
1.Create your own dataset: This is the most
expensive and time-consuming way, but you’ll end
up with a dataset perfectly suited for your task.
2.Combine several datasets: You can cross-check
the performance of your solution on several other
datasets.
3.Modify the data as you go: Some researchers
suggest editing videos that you’ve already used:
crop them, change the lighting, slow them down,
speed them up, add noise, etc.
Need for the proposed system
Detecting emotions with technology is quite a challenging task, yet one where machine
learning algorithms have shown great promise. By using Facial Emotion Detection,
businesses can process images, and videos in real-time for monitoring video feeds or
automating video analytics, thus saving costs and making life better for their users. Some
examples are given below:
Emotion recognition in video game testing
Automotive industry and emotion recognition
Emotion recognition in Health Care
Implementation
Tools and Libraries used
OpenCV
OpenCV is the library we
will be using for image
transformation functions
such as converting the
image to grayscale
Deep Learning
Deep learning is a subset
of machine learning in
artificial intelligence that
has networks capable of
learning unsupervised from
data that is unstructured
or unlabelled
NumPy
NumPy is a library for the
Python programming
language, adding support
for large, multi-
dimensional arrays
Keras
Keras is an open-source
software library that
provides a Python
interface for artificial
neural networks.
Python
Python is a powerful
scripting language and is
very useful for solving
statistical problems
involving machine learning
algorithms
CODE
from keras.models import load_model
from time import sleep
from keras.preprocessing.image import img_to_array
from keras.preprocessing import image
import cv2
import numpy as np
face_classifier =
cv2.CascadeClassifier('./haarcascade_frontalface_default.xml')
classifier =load_model('./Emotion_Detection.h5')
class_labels = ['Angry','Happy','Neutral',]
cap = cv2.VideoCapture(0)
while True:
# Grab a single frame of video
ret, frame = cap.read()
labels = []
gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY)
faces = face_classifier.detectMultiScale(gray,1.3,5)
for (x,y,w,h) in faces:
cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2)
roi_gray = gray[y:y+h,x:x+w]
roi_gray = cv2.resize(roi_gray,(48,48),interpolation=cv2.INTER_AREA)
if np.sum([roi_gray])!=0:
roi = roi_gray.astype('float')/255.0
roi = img_to_array(roi)
roi = np.expand_dims(roi,axis=0)
# make a prediction on the ROI, then lookup the class
preds = classifier.predict(roi)[0]
print("nprediction = ",preds)
label=class_labels[preds.argmax()]
print("nprediction max = ",preds.argmax())
print("nlabel = ",label)
label_position = (x,y)
cv2.putText(frame,label,label_position,cv2.FONT_HERSHEY_SIMPLEX,2,
(0,255,0),3)
else:
cv2.putText(frame,'No Face Found',
(20,60),cv2.FONT_HERSHEY_SIMPLEX,2,(0,255,0),3)
print("nn")
cv2.imshow('Emotion Detector',frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release() cv2.destroyAllWindows()
FUTURE SCOPE
Automotive Safety and Research Systems:
For the safety of the driver and passengers by recognizing the facial expression of the driver.
Medical Research into Autism:
Ability to read the facial expression of people with autism and finding the best solutions for
them.
Market Research:
Facial expression marketing to help get the necessary information regarding respective
trends.
Pay-per-Laugh:
Faced with rising ticket prices and declining audiences in 2014, a Spanish theatre
experimented with charging audiences 30 cents a laugh for its comedy shows, installing
emotion recognition cameras in front of each seat, and fixing a ceiling of 24 euros per
customer for the more successful events.
EMOTION DETECTION USING AI

More Related Content

PPTX
Facial Emotion Recognition: A Deep Learning approach
PDF
Facial emotion recognition
PPTX
Facial Expression Recognition System using Deep Convolutional Neural Networks.
PPTX
Facial emotion detection on babies' emotional face using Deep Learning.
PPTX
Academic Writing
PPTX
Spring Framework
PDF
Speech emotion recognition
PPTX
HUMAN EMOTION RECOGNIITION SYSTEM
Facial Emotion Recognition: A Deep Learning approach
Facial emotion recognition
Facial Expression Recognition System using Deep Convolutional Neural Networks.
Facial emotion detection on babies' emotional face using Deep Learning.
Academic Writing
Spring Framework
Speech emotion recognition
HUMAN EMOTION RECOGNIITION SYSTEM

What's hot (20)

PPTX
Emotion recognition using image processing in deep learning
PPTX
Emotion recognition
PDF
Human Emotion Recognition
PDF
Emotion detection using cnn.pptx
PPT
Face Detection and Recognition System
PPTX
Face recognition attendance system
PPTX
Facel expression recognition
PPTX
Face recognition technology
PPTX
Attendance system based on face recognition using python by Raihan Sikdar
PPT
Face detection ppt
PPT
Face recognition ppt
PPTX
Hand Gesture Recognition Applications
PPTX
Facial emotion recognition
PDF
Human Emotion Recognition using Machine Learning
PDF
Sentiment Analysis of Twitter Data
PDF
Deep Learning For Speech Recognition
PPTX
Image compression models
PPTX
Attendance Management System using Face Recognition
PPTX
SPEECH BASED EMOTION RECOGNITION USING VOICE
PPT
Sign language translator ieee power point
Emotion recognition using image processing in deep learning
Emotion recognition
Human Emotion Recognition
Emotion detection using cnn.pptx
Face Detection and Recognition System
Face recognition attendance system
Facel expression recognition
Face recognition technology
Attendance system based on face recognition using python by Raihan Sikdar
Face detection ppt
Face recognition ppt
Hand Gesture Recognition Applications
Facial emotion recognition
Human Emotion Recognition using Machine Learning
Sentiment Analysis of Twitter Data
Deep Learning For Speech Recognition
Image compression models
Attendance Management System using Face Recognition
SPEECH BASED EMOTION RECOGNITION USING VOICE
Sign language translator ieee power point
Ad

Similar to EMOTION DETECTION USING AI (20)

PPTX
presentation of emotional detection system with ai.pptx
PPTX
Machine Learning AND Deep Learning for OpenPOWER
DOCX
Face Recognition Home Security System
PPTX
Facial expression recognition projc 2 (3) (1)
PPTX
Face Scope.pptx
PDF
A guide to Face Detection in Python.pdf
PPTX
AI-ML-Virtual-Internship on new technology
PPTX
Machine Learning Contents.pptx
PDF
Deep learning and its problem types
PPTX
PPT TENSORFLOW about and introduction and its working
PDF
Machine Learning for Designers - DX Meetup Basel
PDF
What Is Computer Vision as a Service? (Only Guide You Need)
PDF
Emotion Detection Using Facial Expression Recognition to Assist the Visually ...
DOCX
Hrms industrial training report
DOCX
AI NOTES.docx
PPTX
Final Report on Optical Character Recognition
PPTX
Hyf azure ml_1
PPTX
face_detection_att.pptx
PDF
IRJET - Cognitive based Emotion Analysis of a Child Reading a Book
PPTX
Machine learning_ Replicating Human Brain
presentation of emotional detection system with ai.pptx
Machine Learning AND Deep Learning for OpenPOWER
Face Recognition Home Security System
Facial expression recognition projc 2 (3) (1)
Face Scope.pptx
A guide to Face Detection in Python.pdf
AI-ML-Virtual-Internship on new technology
Machine Learning Contents.pptx
Deep learning and its problem types
PPT TENSORFLOW about and introduction and its working
Machine Learning for Designers - DX Meetup Basel
What Is Computer Vision as a Service? (Only Guide You Need)
Emotion Detection Using Facial Expression Recognition to Assist the Visually ...
Hrms industrial training report
AI NOTES.docx
Final Report on Optical Character Recognition
Hyf azure ml_1
face_detection_att.pptx
IRJET - Cognitive based Emotion Analysis of a Child Reading a Book
Machine learning_ Replicating Human Brain
Ad

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
PPT on Performance Review to get promotions
PPTX
Welding lecture in detail for understanding
PPT
Project quality management in manufacturing
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Geodesy 1.pptx...............................................
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
Well-logging-methods_new................
PPT
Mechanical Engineering MATERIALS Selection
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPT on Performance Review to get promotions
Welding lecture in detail for understanding
Project quality management in manufacturing
Lesson 3_Tessellation.pptx finite Mathematics
UNIT 4 Total Quality Management .pptx
Geodesy 1.pptx...............................................
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
OOP with Java - Java Introduction (Basics)
CH1 Production IntroductoryConcepts.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
additive manufacturing of ss316l using mig welding
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Well-logging-methods_new................
Mechanical Engineering MATERIALS Selection
bas. eng. economics group 4 presentation 1.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Operating System & Kernel Study Guide-1 - converted.pdf

EMOTION DETECTION USING AI

  • 1. Emotion Detection Using AI How Emotion Detection can change the future BY-ARYAN TRISAL
  • 2. In this Presentation Here's what we have covered: Introduction Problems Faced Solutions Need for the proposed system Implementation Code Future Scope
  • 3. Introduction Facial expression is an essential part of communication. For this reason, the issue of human emotions evaluation using a computer is a very interesting topic, which has gained more and more attention in recent years. It is mainly related to the possibility of applying facial expression recognition in many fields such as HCI, video games, virtual reality, and analysing customer satisfaction etc. Emotion’s determination (recognition process) is often performed in 3 basic phases: face detection, facial features extraction, and last stage - expression classification.
  • 4. Facial emotion recognition is a complex task and the machine learning approach to recognize faces requires several steps to perform it, some are: Feature selection: This stage refers to attribute selection for the training of the machine learning algorithm. The process includes the selection of predictors for construction of the learning system Feature classification: When it comes to supervised learning algorithms, classification consists of two stages. Training and classification, where training helps in discovering which features are helpful in classification. Feature extraction:Machine learning requires numerical data for learning and training. During feature extraction, processing is done to transform arbitrary data, text or images, to gather the numerical data Classifiers:This is the final step in this process. Based on the inference from the features, the algorithm performs data classification.
  • 5. Problems Faced Technical challenges Emotion recognition shares a lot of challenges with detecting moving objects in the video identifying an object, continuous detection, incomplete or unpredictable actions, etc. Data augmentation As with any machine learning and deep learning algorithms, ER solutions require a lot of training data. This data must include videos at various frame rates, from various angles, with various backgrounds, with people of different genders, nationalities, and races, etc.
  • 6. Solutions 1.Create your own dataset: This is the most expensive and time-consuming way, but you’ll end up with a dataset perfectly suited for your task. 2.Combine several datasets: You can cross-check the performance of your solution on several other datasets. 3.Modify the data as you go: Some researchers suggest editing videos that you’ve already used: crop them, change the lighting, slow them down, speed them up, add noise, etc.
  • 7. Need for the proposed system Detecting emotions with technology is quite a challenging task, yet one where machine learning algorithms have shown great promise. By using Facial Emotion Detection, businesses can process images, and videos in real-time for monitoring video feeds or automating video analytics, thus saving costs and making life better for their users. Some examples are given below: Emotion recognition in video game testing Automotive industry and emotion recognition Emotion recognition in Health Care
  • 8. Implementation Tools and Libraries used OpenCV OpenCV is the library we will be using for image transformation functions such as converting the image to grayscale Deep Learning Deep learning is a subset of machine learning in artificial intelligence that has networks capable of learning unsupervised from data that is unstructured or unlabelled NumPy NumPy is a library for the Python programming language, adding support for large, multi- dimensional arrays Keras Keras is an open-source software library that provides a Python interface for artificial neural networks. Python Python is a powerful scripting language and is very useful for solving statistical problems involving machine learning algorithms
  • 9. CODE from keras.models import load_model from time import sleep from keras.preprocessing.image import img_to_array from keras.preprocessing import image import cv2 import numpy as np face_classifier = cv2.CascadeClassifier('./haarcascade_frontalface_default.xml') classifier =load_model('./Emotion_Detection.h5') class_labels = ['Angry','Happy','Neutral',] cap = cv2.VideoCapture(0) while True: # Grab a single frame of video ret, frame = cap.read() labels = [] gray = cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) faces = face_classifier.detectMultiScale(gray,1.3,5) for (x,y,w,h) in faces: cv2.rectangle(frame,(x,y),(x+w,y+h),(255,0,0),2) roi_gray = gray[y:y+h,x:x+w] roi_gray = cv2.resize(roi_gray,(48,48),interpolation=cv2.INTER_AREA) if np.sum([roi_gray])!=0: roi = roi_gray.astype('float')/255.0 roi = img_to_array(roi) roi = np.expand_dims(roi,axis=0) # make a prediction on the ROI, then lookup the class preds = classifier.predict(roi)[0] print("nprediction = ",preds) label=class_labels[preds.argmax()] print("nprediction max = ",preds.argmax()) print("nlabel = ",label) label_position = (x,y) cv2.putText(frame,label,label_position,cv2.FONT_HERSHEY_SIMPLEX,2, (0,255,0),3) else: cv2.putText(frame,'No Face Found', (20,60),cv2.FONT_HERSHEY_SIMPLEX,2,(0,255,0),3) print("nn") cv2.imshow('Emotion Detector',frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()
  • 10. FUTURE SCOPE Automotive Safety and Research Systems: For the safety of the driver and passengers by recognizing the facial expression of the driver. Medical Research into Autism: Ability to read the facial expression of people with autism and finding the best solutions for them. Market Research: Facial expression marketing to help get the necessary information regarding respective trends. Pay-per-Laugh: Faced with rising ticket prices and declining audiences in 2014, a Spanish theatre experimented with charging audiences 30 cents a laugh for its comedy shows, installing emotion recognition cameras in front of each seat, and fixing a ceiling of 24 euros per customer for the more successful events.