













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Facial Expression conveys non-verbal cues, which plays an important role in interpersonal relations. The Facial Expression Recognition system is the process of identifying the emotional state of a person. In this system captured image is compared with the trained dataset available in database and then emotional state of the image will be displayed. This system is based on image processing and machine learning. For designing a robust facial feature descriptor, we apply the Local Binary Patt
Typology: Lab Reports
1 / 21
This page cannot be seen from the preview
Don't miss anything!














i
ii
Submitted to - Department of Computer Science and Engineering Bangladesh University of Business and Technology (BUBT), Dhaka In partial fulfillment of requirements For the Facial Expression App
Mr. Md. Shahiduzzaman
iv Supervisor’s Recommendation
Mr. Md. Shahiduzzaman Department of Computer Science and Engineering (CSE) Assistant Professor (Supervisor) Date:
v LETTER OF APPROVAL This is to certify that the project prepared by Abdur Rahim (15), Nur Islam (17), Fahmida Akhter (21), Sumaiya Islam (44) and Rasel Mia (46) entitled “FACIAL EXPRESSION RECOGNITION SYSTEM” in partial fulfillment of the requirements for the degree of B.Sc. in Computer Science and Information Technology has been well studied. In our opinion it is satisfactory in the scope and quality as a project for the required degree. ………………............................ ………………........................... Bangladesh University of Business and Technology (BUBT) Mr. Md. Shahiduzzaman and Information Technology Department of Computer Science and Information Technology (Chairman) (Supervisor) ………………............................ ………………............................ (Internal Examiner) (External Examiner)
vii ABSTRACT
viii List of Figures: Figure 1: Applying face detection with OpenCV Haar cascades................................................... 4 Figure 2: The seven expressions from one subject ................................................................ 4 Figure 3 : System Diagram ................................................................................................. 6 Figure 4 : Flowchart of Face Emotion ......................................................................................... 7 Figure 5 : Experimental Demonstration from Image File................................................................ 1 0 Figure 6 : Experimental Demonstration from Camera ...............................................................
1
A Facial expression is the visible manifestation of the affective state, cognitive activity, intention, personality and psychopathology of a person and plays a communicative role in interpersonal relations. It have been studied for a long period of time and obtaining the progress recent decades. Though much progress has been made, recognizing facial expression with a high accuracy remains to be difficult due to the complexity and varieties of facial expressions. Generally human beings can convey intentions and emotions through nonverbal ways such as gestures, facial expressions and involuntary languages. This system can be significantly useful, nonverbal way for people to communicate with each other. The important thing is how fluently the system detects or extracts the facial expression from image. The system is growing attention because this could be widely used in many fields like lie detection, medical assessment and human computer interface. The Facial Action Coding System (FACS), which was proposed in 1978 by Ekman and refined in 2002, is a very popular facial expression analysis tool. On a day-to-day basics humans commonly recognize emotions by characteristic features, displayed as a part of a facial expression. For instance, happiness is undeniably associated with a smile or an upward movement of the corners of the lips. Similarly other emotions are characterized by other deformations typical to a particular expression. Research into automatic recognition of facial expressions addresses the problems surrounding there presentation and categorization of static or dynamic characteristics of these deformations of face pigmentation. The system classifies facial expression of the same person into the basic emotions namely anger, disgust, fear, happiness, sadness and surprise. The main purpose of this system inefficient interaction between human beings and machines using eye gaze, facial expressions, cognitive modeling etc. Here, detection and classification of facial.
3
2.1. Planning In planning phase study of reliable and effective algorithms is done. On the other hand, data were collected and were preprocessed for more fine and accurate results. Since huge amount of data were needed for better accuracy, we have collected the data surfing the internet. Since, we are new to this project we have decided to use local binary pattern algorithm for feature extraction and support vector machine for training the dataset. We have decided to implement these algorithms by using OpenCV framework. 2.2. Literature Reviews Research in the fields of face detection and tracking has been very active and there is exhaustive literature available on the same. The major challenge that the researchers’ facies the non-availability of spontaneous expression data. Capturing spontaneous expressions on images and video is one of the biggest challenges ahead. Many attempts have been made to recognize facial expressions, facial feature representation and classifier problem. 2.3. Data collection Some of the public databases to evaluate the facial expression recognition algorithms are: 2.3.1. Pre-trained face detection model by Haar Cascade What is Haar Cascade, and how it works? Haar Cascade is a feature-based object detection algorithm to detect objects from images. A cascade function is trained on lots of positive and negative images for detection. The algorithm does not require extensive computation and can run in real-time. We can train our own cascade function for custom objects like animals, cars, bikes, etc. Haar Cascade can’t be used for face recognition since it only identifies the matching shape and size. Haar cascade uses the cascade function and cascading window. It tries to calculate features for every window and classify positive and negative. If the window could be a part of an object, then positive, else, negative. For more in-depth knowledge of its working,
4 Figure 1: Applying face detection with OpenCV Haar cascades. 2.3. 2. Pre-trained face detection model by keras model.h The .h5 file extension typically refers to a file format used to store a Keras model. Keras is a popular open-source deep learning library for Python that provides a high-level interface for building and training neural networks. When you build and train a Keras model, the resulting model is typically saved to a file with the .h5 extension. The .h5 file format is based on the Hierarchical Data Format version 5 (HDF5) and provides a way to store and organize large amounts of numerical data and metadata. The .h5 file contains the architecture of the neural network model as well as the trained weights and biases of the model. This allows the trained model to be easily reloaded and used for inference on new data without having to retrain the model. Figure 2: Applying emotion detection with mode.h
6
3.1. System Design System design shows the overall design of system. In this section we discuss in detail the design aspects of the system: 3.1.1 System Diagram Figure 3: System Diagram.
7 3.1.2. System Flowchart Figure 4 : Flowchart of Face Emotion. 3.2. Phases in Facial Expression Recognition The facial expression recognition system is trained using supervised learning approach in which it takes images of different facial expressions. The system includes the training and testing phase followed by image acquisition, face detection, image preprocessing, feature extraction and classification. Face detection and feature extraction are carried out from face images and then classified into six classes belonging to six basic expressions which are outlined below: 3.2.1 Image Acquisition Images used for facial expression recognition are static images or image sequences. Images of face can be captured using camera.
9
4.1. Implementation Tools 4.1.1. Programming Language and Coding Tools a) Python Python is a general-purpose, versatile, and powerful programming language. It’s a great first language because Python code is concise and easy to read. Whatever you want to do, python can do it. From web development to machine learning to data science, Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured, object-oriented and functional programming. b) Thonny IDE For Python Easy to get started. Thonny comes with Python 3.10 built in, so just one simple installer is needed and you're ready to learn programming. (You can also use a separate Python installation, if necessary.) The initial user interface is stripped of all features that may distract beginners. If you use small steps, then you can even see how Python evaluates your expressions. You can think of this light-blue box as a piece of paper where Python replaces subexpressions with their values, piece-by-piece. 4.1.2. Library a) OpenCV OpenCV (Open-Source Computer Vision Library) is an open-source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. The library has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, extract 3Dmodels of objects, produce 3D point clouds from stereo cameras, stitch images together to produce a high-resolution image of an entire scene, find similar images from an image database, remove red eyes from images taken using flash, follow eye movements, recognize scenery. c) Keras Keras is an API designed for human beings, not machines. Keras follows best practices for reducing cognitive load: it offers consistent & simple APIs; it minimizes the number.
10
The aim of this project work is to develop a complete facial expression recognition system. Two datasets, haar Cascade Classifier and Model.h5 were used for the experimentations. First of all, system was trained using different random samples in each dataset by supervised learning. In each datasets the data were partitioned into two parts for training and testing. Every dataset have completely different samples which are selected randomly in uniform manner from the pool of given dataset. The confusion and accuracy evaluation results of haar Cascade Classifier and Model.h5 datasets
6 .Experimental Demonstration 6 .1 Experimental Demonstration from Image File Figure 5 : Experimental Demonstration from Image File