Related Experiment Video
Updated: Jun 2, 2026

Artificial Intelligence-Based System for Detecting Attention Levels in Students
Published on: December 15, 2023
Real-Time Estimation of Numerical Rating Scale (NRS) Scores Using Machine Learning-Based Facial Expression Analysis:
Kentaro Uejima1, Tsutomu Takahashi1, Miki Matsui2
1School of Pharmacy, Nihon University, Chiba, JPN.
None:
Background Accurate pain assessment is fundamental to effective cancer pain management. However, subjective scales such as the Numerical Rating Scale (NRS) have limitations in pediatric and elderly patients with impaired verbal communication. This study aimed to develop a real-time facial expression-based pipeline for NRS estimation and to evaluate its technical feasibility as a proof of concept (PoC). Methods A real-time analysis pipeline was implemented in Python (version 3.11; Python Software Foundation, Fredericksburg, VA, USA), integrating MediaPipe for facial detection and DeepFace for emotion estimation. Seven emotion probability scores extracted from 30 fps video streams were used as predictor variables to estimate NRS values using several regression models, including Random Forest (RF). Synthetic datasets generated for technical validation were evaluated using leave-one-out cross-validation (LOOCV). Performance was assessed using Spearman's rank correlation coefficient (ρ) and mean absolute error (MAE). Results In the pediatric dataset, the RF model achieved ρ = 0.7383 (p < 0.001) and MAE = 1.5195, demonstrating improved performance compared with the baseline model (ρ = 0.2765). In the elderly dataset, the RF model showed ρ = 0.7566 (p < 0.001) and MAE = 1.5760. Feature importance analysis indicated that "Fear" contributed prominently in both datasets, whereas "Neutral" also showed relatively higher importance in the elderly dataset. Conclusions This study demonstrated the technical feasibility of a real-time NRS estimation pipeline using artificial intelligence (AI)-based facial expression analysis. The findings suggest potential applicability as a complementary pain assessment approach for patients with limited verbal communication, pending future clinical validation.
