Programming learning requires repeated problem-solving processes that may influence students’ affective states. However, these changes are difficult to continuously observe through manual observation or self-reporting. This study develops a YOLOv13n-based Facial Emotion Recognition system to detect four affective states—engagement, confusion, frustration, and boredom—in real time and integrate the detected results with learning activities in a web-based application. Detection is performed while students read learning modules and complete assessments through multiple-choice quizzes or interactive coding exercises. The model was fine-tuned using a combined dataset of 1,660 images, consisting of 953 images from Roboflow Universe and 707 hard samples, with stratified training, validation, and testing splits of 80:10:10. Evaluation on 173 test images achieved a precision of 0.994, recall of 0.982, F1-score of 0.988, mAP@0.5 of 0.994, and mAP@0.5:0.95 of 0.982, with an inference time of 6.2 ms per image. The application of confidence filtering, sliding window, and majority voting reduced label changes by 77.20%, improving temporal stability. Black-box testing across 27 scenarios confirmed that all application functions operated as designed. The system provides descriptive indicators rather than psychological diagnosis, demonstrating potential for monitoring affective expression patterns during programming learning.
Copyrights © 2026