A Hybrid CNN–Swin Transformer Model for Emotion Recognition from Facial Expressions in Real-World Contexts
摘要
Facial expressions are a universal and intuitive way for people to communicate emotions. However, recognising those emotions accurately in real-world settings–where lighting changes, faces are partially hidden, head movements occur, cultural differences exist, and expressions vary considerably across individuals due to factors such as gender and age–remains a major challenge. This work introduces a new deep learning system designed to handle these difficulties. The proposed approach combines the strengths of two advanced AI models: a custom Convolutional Neural Network (CNN) that focuses on extracting fine facial details, and a Swin Transformer that captures the broader context and relationships across the face. To enhance performance and ensure good generalisation, we implemented a smart preprocessing pipeline that includes targeted data augmentation and class balancing techniques to handle uneven emotion distributions in the training data. The system was tested on two widely-used datasets, FER2013 and CK+, achieving impressive accuracy scores of 83.63% and 93.48%, respectively outperforming many existing methods.