Comparative Analysis Of Convolutional Neural Networks, Long Short-Term Memory Networks, and Bert For Text-Based Emotion Classification

Main Article Content

Porawat Visutsak
Tanajak Tongbai
Duongduen Ongrungruaeng
Nuttiruj Phongwuttisak
Surapong Wiriya
Keun Ho Ryu

Abstract

This paper presents a detailed experimental study and comparative analysis of three popular deep learning architectures (CNN, LSTM, and BERT) for emotion classification in written messages. Using a publicly available dataset of six unique emotional states (sadness, joy, love, anger, fear, and surprise), an effective ablation study was conducted to determine optimal architectural configurations, including a sequence length of 66 tokens and an embedding size of 200. To validate the results of a comparative analysis of model performance, a bootstrap technique (30 trials) and the Wilcoxon Signed-Rank test were used to eliminate potential bias. As shown by experiments, the tuned BERT architecture (with a learning rate of 2e-5) produced the most accurate and reliable result of 93.50% in classifying emotional states from texts. Moreover, with an appropriate sequence length configuration, the LSTM network (89.92%) significantly outperformed the CNN (89.65%), confirming the need to account for long-range dependencies in emotion classification. Overall, the research results show the key importance of hyperparameter tuning and the ability to handle complex information for emotion identification.

Article Details

Section
Research Articles

References

Devlin, J.; Chang, M. W.; Lee, K.; Toutanova, K. BERT: Pre-Training of Deep Bidirectional Transformers. In Proc. NAACL-HLT; 2019; pp 4171–4186. https://doi.org/10.18653/v1/N19-1423

Sun, C.; Qiu, X.; Xu, Y.; Huang, X. Fine-Tuning BERT for Text Classification. In Chinese Comput. Linguist.; Springer: Cham, 2019; pp 194–206. https://doi.org/10.1007/978-3-030-32381-3_16

Lawan, T.; Polpinij, J.; Chan, C.; Singhakam, D.; Uttha, T.; Chotthanom, A.; Watthusin, W.; Luaphol, B.; Namee, K. Domain Adaptation in Sentiment Classification. ECTI Trans. Comput. Inf. Technol. 2025, 19, 334–349. https://doi.org/10.37936/ecti-cit.2025192.258824

Huang, P.; Zhu, H.; Zheng, L.; Wang, Y. Text Sentiment Analysis Using BERT-CNN. In Proc. NLPIR; 2022; pp 17. https://doi.org/10.1145/3508230.3508231

Demszky, D.; Dana, D.; Kurandina, E.; Jurafsky, D. GoEmotions: A Dataset of Fine-Grained Emotions. In Proc. Annu. Meet. Assoc. Comput. Linguist.; 2020; pp 4040–4054. https://doi.org/10.18653/v1/2020.acl-main.372

Saravia, E.; Liu, H. C. T.; Huang, Y. H.; Wu, J.; Chen, L. S. CARER: Contextualized Affect Representations. In Proc. Conf. Empir. Methods Nat. Lang. Process.; 2018; pp 3687–3697. https://doi.org/10.18653/v1/D18-1404

Mokhamed, T.; Harous, S.; Hussein, N.; El Barachi, M. Emoji Prediction from Arabic Text. Soc. Netw. Anal. Min. 2024, 14, 67. https://doi.org/10.1007/s13278-024-01217-w

Chandra Sekhar, J. N.; Kiran Mayee, M.; Nadagoudar, R.; Alluraiah, N. C.; Dhanamjayulu, C.; Ravikumar, K. C.; Ravi, M.; Praveenkumar, M.; Mohanty, S.; Khan, B. Classification of Tweets Using Deep Neural Networks. J. Electr. Comput. Eng. 2024, 2024, 9652424. https://doi.org/10.1155/2024/9652424

Gaafar, A. S.; Dahr, J. M.; Hamoud, A. K. Deep Learning Classification Using LSTM-RNN. Informatica 2022, 46, 21–28. https://doi.org/10.31449/inf.v46i5.3872

Atlas, L. G.; Arockiam, D.; Muthusamy, A.; Balusamy, B.; Selvarajan, S.; Al-Shehari, T.; Alsadhan, N. A. Sentiment Analysis Using BiGRU and LSTM Models. Sci. Rep. 2025, 15, 16642. https://doi.org/10.1038/s41598-025-01104-0

Balakrishnan, V.; Shi, Z.; Law, C. L.; Kamal Basha, N. Predicting Product Sentiment Ratings. J. Supercomput. 2022, 78, 7206–7226. https://doi.org/10.1007/s11227-021-04169-6

Cortiz, D. Exploring Transformers in Emotion Recognition. arXiv 2021. https://doi.org/10.48550/arXiv.2104.02041

Nanyonga, A.; Wasswa, H.; Wild, G. Aviation Safety Classification Using BERT, CNN, and LSTM. SSRN 2024, 5219984.

Abas, A. R.; Elhenawy, I.; Zidan, M.; Othman, M. BERT-CNN: A Deep Learning Model for Detecting Emotions from Text. Comput. Mater. Contin. 2022, 71, 2943–2961. https://doi.org/10.32604/cmc.2022.021671

Talaat, A. S. Sentiment Analysis Using Hybrid BERT Models. J. Big Data 2023, 10, 110. https://doi.org/10.1186/s40537-023-00781-w

Bi, X.; Zhang, T. Pedagogical Sentiment Analysis Using BERT-CNN-BiGRU. PeerJ Comput. Sci. 2024, 10, e2166. https://doi.org/10.7717/peerj-cs.2166

Khan, L.; Qazi, A.; Chang, H. T.; et al. Urdu Sentiment Analysis Using CNN-BiLSTM and BERT. Complex Intell. Syst. 2025, 11, 10. https://doi.org/10.1007/s40747-024-01631-9

Murfi, H.; Syamsyuriani, S.; Gowandi, T.; Ardaneswari, G.; Nurrohmah, S. Indonesian Sentiment Analysis Using BERT. Appl. Soft Comput. 2024, 151, 111112. https://doi.org/10.1016/j.asoc.2023.111112