Skip to content

This project implements a real-time face emotion recognition system using Gray-Level Co-Occurrence Matrix (GLCM) for feature extraction and an Artificial Neural Network (ANN) for classification. The system can identify various emotional states from facial expressions in real-time.

License

Notifications You must be signed in to change notification settings

mdprana/Realtime-Face-Emotion-Recognition-Using-GLCM-and-ANN

Repository files navigation

Realtime Face Emotion Recognition

Our GitHub repository houses a cutting-edge project titled "Realtime Face Emotion Recognition System with GLCM and Artificial Neural Networks (ANN)"—a groundbreaking exploration into real-time emotion analysis. Leveraging the power of Gray-Level Co-occurrence Matrix (GLCM) and the versatility of Artificial Neural Networks (ANN), this project aims to revolutionize emotion recognition technology.

Emotions play a pivotal role in human communication and interaction. Understanding and interpreting emotions accurately in real-time scenarios is a challenging task with significant implications across various domains, including human-computer interaction, healthcare, and entertainment.

The core of our project lies in the utilization of GLCM, a texture analysis technique, which captures spatial dependencies within images. By extracting texture features from facial images, we can discern subtle patterns indicative of different emotions. This allows our system to robustly analyze facial expressions and infer underlying emotions with remarkable precision.

Overview

This is a Python 3 based project to display facial expressions (happy, sad, anger, fear, disgust, surprise, neutral, contempt) by performing fast & accurate face detection with OpenCV using a pre-trained neural networks face detector model shipped with the library.

The model is trained on the AffectNet dataset which was published on kaggle. This dataset consists of 29042 RGB pictures, 96x96 sized face images with 8 emotions - angry, disgusted, fearful, happy, neutral, sad, surprise, and contempt.

Dataset

Source: https://www.kaggle.com/datasets/noamsegal/affectnet-training-data

Dependencies

  1. Python 3.x, OpenCV 3 or 4, Tensorflow, TFlearn, Keras
  2. Open terminal and enter the file path to the desired directory and install the following libraries
    • pip install numpy
    • pip install opencv-python
    • pip install tensorflow
    • pip install tflearn
    • pip install keras
    • pip install pandas
    • pip install seaborn
    • pip install matplotlib
    • pip install scikit-image
    • pip install scikit-learn
    • pip install pillow
    • pip install keras-tuner
    • pip install joblib

Usage

  1. Clone the repository.
    git clone https://github.com/mdprana/Realtime-Face-Emotion-Recognition-Using-GLCM-and-ANN.git
    cd Realtime-Face-Emotion-Recognition-Using-GLCM-and-ANN
  2. Install the required dependencies.
  3. Adjust model and haarcascade file location in demo.py with your path location (if required).
    model = tf.keras.models.load_model('...yourpath/model/model.h5')
    scale = load('...yourpath/model/scaling.pkl')
    label = load('...yourpath/model/label.pkl')
    face_cascade = cv2.CascadeClassifier('...yourpath/haarcascade_frontalface_default.xml')
    eye_cascade = cv2.CascadeClassifier('...yourpath/haarcascade_eye.xml')
    mouth_cascade = cv2.CascadeClassifier('...yourpath/haarcascade_smile.xml')
  4. Run demo.py on your IDE or run on CMD (Terminal) with:
    python demo.py
  5. The system will display the video feed with detected faces and recognized emotions.
  6. Press the q key on keyboard to quit the application.

Realtime Demo Preview

Picture1 Picture2

Detect From Picture

Picture3

Detect 2 Emotions, From Picture and Human Face

Picture4

YouTube

Video Demo Source: https://youtu.be/xBfPaHDOllo



Mata Kuliah Pengantar Pemrosesan Data Multimedia
Program Studi Informatika

Universitas Udayana
Tahun Ajaran 2023/2024

About

This project implements a real-time face emotion recognition system using Gray-Level Co-Occurrence Matrix (GLCM) for feature extraction and an Artificial Neural Network (ANN) for classification. The system can identify various emotional states from facial expressions in real-time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published