UPDF AI

Interpretable Emotion Detection in Social Media Using Deep Learning and Transformer-Based Models

Shamyla Firdoos,Muhammad Sheraz Ul Hassan,Ali Imran Cheema,Muhammad Ahmed

2026 · DOI: 10.1109/DataSciMI67380.2026.11523984
0 Citations

Abstract

The detection of emotions in social media has emerged as an important task to understand opinion of the people, improve human-computer interaction, and assist in healthcare, marketing, and education. This paper explores the use of deep learning and transformer-based models to detect multi-class emotions, focusing on post-hoc interpretability. We used GPT-based data augmentation to balance the distribution of classes using a Kaggle dataset of 34,792 text samples in 8 emotions, increasing the dataset to 64,085 samples after augmentation. Classical RNN models (RNN, LSTM, GRU, BiLSTM, BiGRU) were used as well as transformer models (BERT, ALBERT, RoBERTa, DeRoBERTa, BERTweet, etc.). Findings indicate that despite the high accuracy (0.7655) achieved by BiLSTM among the RNN models, transformer models always performed better with BERTweet being the best performing model (Accuracy = 0.8367, F1 = 0.8376) following augmentation. To introduce transparency, the LIME framework was incorporated, which can be interpreted by emphasizing the words that had an impact on each prediction. Overall, this study contributes by combining performance and interpretability, positioning BERTweet with augmentation and XAI as an effective solution for emotion detection in social media contexts. Future research will be aimed at expanding the research to multilingual and multimodal emotion detection to make the research more applicable to the real world.