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.
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.
Source: https://www.kaggle.com/datasets/noamsegal/affectnet-training-data
- Python 3.x, OpenCV 3 or 4, Tensorflow, TFlearn, Keras
- 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
- 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
- Install the required dependencies.
- 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')
- Run demo.py on your IDE or run on CMD (Terminal) with:
python demo.py
- The system will display the video feed with detected faces and recognized emotions.
- Press the
q
key on keyboard to quit the application.
Detect From Picture
Detect 2 Emotions, From Picture and Human Face
Source: https://youtu.be/xBfPaHDOllo
Mata Kuliah Pengantar Pemrosesan Data Multimedia
Program Studi Informatika
Universitas Udayana
Tahun Ajaran 2023/2024