• P-ISSN 0974-6846 E-ISSN 0974-5645

Indian Journal of Science and Technology


Indian Journal of Science and Technology

Year: 2023, Volume: 16, Issue: 41, Pages: 3617-3626

Original Article

Emotion Detection using HOG for Crime Detection

Received Date:24 June 2023, Accepted Date:08 September 2023, Published Date:07 November 2023


Objectives: The main objective of this study is to develop an advanced emotion detection system that can contribute to crime detection and prevention efforts. By using the power of machine learning, the system aims to enhance the effectiveness in identifying potential criminal activities by analyzing emotional cues of people. Methods: The proposed method is evaluated using Facial Expression Recognition – 2013 (FER – 2013) dataset from a Kaggle data science community. It consists of 3589 training data files with 48x48 pixel grayscale images of human faces of seven different emotions classified which are centered and occupying the same amount of space. Instead of using the same algorithm for face detection and emotion classification, separate algorithms were used. Histogram Oriented Gradients (HOG) will detect the face by parameters like eyes, nose, and face edges. The image detected will first divide the image into small cells and plots histogram for each and then brings all histogram together to form feature vector. The Random Forest Algorithm will get the image detected and the random parameters of the face were taken for the voting process by averaging the constructed decision tree. The emotion is obtained by the outcome of the voting process. The addition of boosting algorithm guarantees in increasing the computational speed and accuracy of the model. Findings: The use of HOG for face detection gives the best result by capturing the face apart from all noises and background disturbances like poor light etc. The accuracy of HOG face detection module is 99.57 %. The detected face was given as input to the combination of Random Forest Algorithm and X-Gradient Boosting Algorithm for classifying the emotion. The addition of a boosting algorithm gives the maximum accuracy and minimum loss of data during emotion classification. The accuracy of the model was achieved up to 95% and loss of data below 5%. Novelty: This is the first open paper highlighting the face detection and emotion classification process with different algorithms where the process was divided as face detection, feature extraction and emotion classification.

Keywords: Facial emotion, Face detection, Feature Extraction, Dlib Histogram Oriented Gradients (HOG), Random Forest, X­Gradient Boosting, Emotion classification, Facial Expression Recognition (FER)


  1. Mohammed MG, Melhum AI. Implementation of HOG Feature Extraction with Tuned Parameters for Human Face Detection. International Journal of Machine Learning and Computing. 2020;10(5):654–661. Available from: https://doi.org/10.18178/ijmlc.2020.10.5.987
  2. Xu X, Wang X, Sun Z, Wang S. Face recognition technology based on CNN, XGBoost, model fusion and its application for safety management in power system. In: 2020 International Conference on Smart Grid and Energy Engineering, IOP Conf. Series: Earth and Environmental Science. IOP Publishing. 645:1–7.
  3. Badrulhisham NAS, Mangshor NNA. Emotion Recognition Using Convolutional Neural Network (CNN) In: The 1st International Conference on Engineering and Technology (ICoEngTech) 2021, Journal of Physics: Conference Series. Perlis, Malaysia, 15-16 March 2021. 1962:1–6.
  4. Alreshidi A, Ullah M. Facial Emotion Recognition Using Hybrid Features. Informatics. 2020;7(1):1–13. Available from: https://doi.org/10.3390/informatics7010006
  5. Liu J, Wu G, Luo Y, Qiu S, Yang S, Li W, et al. EEG-Based Emotion Classification Using a Deep Neural Network and Sparse Autoencoder. Frontiers in Systems Neuroscience. 2020;14:1–14. Available from: https://doi.org/10.3389/fnsys.2020.00043
  6. Mohan K, Seal A, Krejcar O, Yazidi A. Facial Expression Recognition Using Local Gravitational Force Descriptor-Based Deep Convolution Neural Networks. IEEE Transactions on Instrumentation and Measurement. 2021;70:1–12. Available from: https://doi.org/10.1109/TIM.2020.3031835
  7. Karnati M, Seal A, Yazidi A, Krejcar O. LieNet: A Deep Convolution Neural Network Framework for Detecting Deception. IEEE Transactions on Cognitive and Developmental Systems. 2022;14(3):971–984. Available from: https://doi.org/10.1109/TCDS.2021.3086011
  8. Karnati M, Seal A, Yazidi A, Krejcar O. FLEPNet: Feature Level Ensemble Parallel Network for Facial Expression Recognition. IEEE Transactions on Affective Computing. 2022;13(4):2058–2070. Available from: https://doi.org/10.1109/TAFFC.2022.3208309
  9. Karnati M, Seal A, Bhattacharjee D, Yazidi A, Krejcar O. Understanding Deep Learning Techniques for Recognition of Human Emotions Using Facial Expressions: A Comprehensive Survey. IEEE Transactions on Instrumentation and Measurement. 2023;72:1–31. Available from: https://doi.org/10.1109/TIM.2023.3243661
  10. Mohan K, Seal A, OK, AY. FER-net: facial expression recognition using deep neural net. Neural Computing and Applications. 2021;33:9125–9136. Available from: https://doi.org/10.1007/s00521-020-05676-y
  11. Suwarno S, Kevin K. Analysis of Face Recognition Algorithm: Dlib and OpenCV. Journal of Informatics and Telecommunication Engineering. 2020;4(1):173–184. Available from: https://ojs.uma.ac.id/index.php/jite/article/view/3865
  12. Zhong Y, Sun L, Ge C, Fan H. HOG-ESRs Face Emotion Recognition Algorithm Based on HOG Feature and ESRs Method. Symmetry. 2021;13(2):1–18. Available from: https://doi.org/10.3390/sym13020228
  13. Wang Y, Li Y, Song Y, Rong X. Facial Expression Recognition Based on Random Forest and Convolutional Neural Network. Information. 2019;10(12):1–16. Available from: https://doi.org/10.3390/info10120375
  14. Debnath T, Reza MM, Rahman A, Beheshti A, Band SS, Alinejad-Rokny H. Four-layer ConvNet to facial emotion recognition with minimal epochs and the significance of data diversity. Scientific Reports. 2022;12:1–18. Available from: https://doi.org/10.1038/s41598-022-11173-0


© 2023 Preethi et al. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Published By Indian Society for Education and Environment (iSee)


Subscribe now for latest articles and news.