Quantifying pain: An AI-driven approach to detecting pain levels via facial expressions

Main Article Content

Abeer A. Mohamad ALSHIHA

abeer.allaf@uomosul.edu.iq

https://orcid.org/0000-0002-7545-8919

Abstract

The automatic recognition of pain intensity from facial expression has great potential to enhance the objective and non-invasive assessment of pain. In this study, we explore supervised learning methods based on deep learning for the intensity classification of facial pain in 16 different levels. Three CNN architectures (EfficientNetB0, MobileNetV2, Small CNN) were tested to compare pretrained and task specific approaches to fine-grained pain classification. After suitable face image preprocessing and data augmentation, the models were trained and tested on facial images. The following metrics were used to evaluate the performance: accuracy, balanced accuracy, precision, recall, F1-score, specificity, Cohen’s kappa, Matthews’s correlation coefficient and log loss. EfficientNetB0 had the highest accuracy (98.00%), balanced accuracy (97.61%), precision (97.88%), recall (97.61%) and F1 score (97.74%). The MobileNetV2 reached the accuracy of 95.00% and F1 score of 94.61% while the Small CNN reached the accuracy of 88.00% and F1 score of 87.37%. The efficientNetB0 also had the smallest log loss with 0.0683. The results show that deep learning is a viable approach to fine-grained pain-intensity classification on faces, and that state-of-the-art architectures can be used to discriminate between different pain-levels. External validation and access to more subject diversity and temporal facial information should be investigated further to evaluate robustness in practical and clinical settings.

Keywords:

artificial intelligence, facial recognition, transfer learning, pain assessment, deep learning

Sustainable Development Goal (SDG)

  • Good health and well-being

References

Article Details

ALSHIHA, A. A. M. (2026). Quantifying pain: An AI-driven approach to detecting pain levels via facial expressions. Applied Computer Science, 22(1). https://doi.org/10.35784/acs_7747