
Research on Music Emotion Analysis and Classification Algorithm Based on Artificial Intelligence Natural Language Processing
Emotion detection in music is one of the important features that enhances user experience and interaction in digital media. Experiments were conducted using the Music Information Retrieval Evaluation eXchange (MIREX ) multimodal emotion dataset, consisting of 903 t racks, with a balanced class distribution of four emotions: happy, sad, anger, and fear. Traditional methods often cannot represent the emotional characteristics of music properly. It makes the categorization of emotions impro per and inaccurate due to its limitations. These challenges have been addressed in the current research by proposing a hybrid model with a new approach towards music emotion analysis through Generalized Autoregressive Pretraining for Language Understanding ( XLNet ) combined with a redef ined Crayfish Optimization (CO) algorithm. The proposed model can detect and classify the emotional information in music effectively, whereby the integration of modern Natural Language Processing (NLP) and advanced optimization methods proves to be effecti ve. The data was split into 70% training, 15% validation, and 15% testing, with 5 -fold cross -validation to ensure robust evaluation. The proposed technique has obtained an accuracy of 92.3% ± 0.5%, precision of 93.8%, recall of 91.6%, and F1 -score of 94.2% . These results are reported as mean ± Standard Deviation (SD) over 5 cross -validation folds, showing robust statistical confidence. These scores show how the model detected complex emotional variations in music and delivered a great result compared to oth er traditional approaches. Hence, it would be very useful in applications such as emotion classification, personalized content circulation, and recommendation systems for music .
[1] Bergstra J., Bardenet R., Bengio Y., and Kégl B., “Algorithms for Hyper -Parameter Optimization, ” Ad vances in Neural Information Processing Systems , vol. 24, pp. 2546 -2554, 2011. https://papers.nips.cc/paper_files/paper/2011/file/ 86e8f7ab32cfd12577bc2619bc635690 -Paper.pdf
[2] Chen C. and Li Q., “A Multimodal Music Emotion Classification Method Based on Multi feature Combined Network Classifier, ” Mathematical Problems in Engineering , vol. 2020, pp. 1 -11, 2020. shttps://doi.org/10.1155/2020/4606027
[3] Cortiz D., “Exploring Transformers in Emotion Recognition: A Comparison of BERT, DistilBERT, RoBERTa , XLNet and ELECTRA, ” arXiv preprint , vol. arXiv:2104.02041, pp. 1 -7, 2021. https://doi.org/10.48550/arXiv.2104.02041
[4] Deng S., Wu L., Shi G., Xing L., and et al, “Learning to Compose Diversified Prompts for Image Emotion Classification, ” Computational Visual Media, vol. 10, no. 6, pp. 1169 -1183, 2024. https://doi.org/10.1007/s41095 -023 -0389 -6
[5] Deng Y. and Lin N., “Analysis and Expression of Music Emotion Based on CAD and Deep Reinforcement Learning Algorithm, ” Computer Aided Design and Appl ications Journal , vol. 21, no. 23, pp. 19 -34, 2024. doi:10.14733/cadaps.2024.S23.19 -34
[6] Federico S., Francesca C., and Stavros N., “Joint Learning of Emotions in Music and Generalized Sounds, ” arXiv preprint , vol. arXiv:2408.02009, pp. 1 -6, 2024. doi:10.485 50/arXiv.2408.02009
[7] Fong H., Kumar V., and Sudhir K., “A Theory - Based Explainable Deep Learning Architecture for Music Emotion, ” arXiv preprint , vol. arXiv:2408.07113, pp. 1 -54, 2024. DOI:10.48550/arXiv.2408.07113
[8] Gomez -Cañón J., Cano E., Eerola T., Herrer a P., and et al, “Music Emotion Recognition: Toward New, Robust Standards in Personalized and Context -Sensitive Applications, ” IEEE Signal Processing Magazine , vol. 38, no. 6, pp. 106 -114, 2021. DOI:10.1109/MSP.2021.3106232
[9] Grekow J., “Music Emotion Recogn ition Using Recurrent Neural Networks and Pretrained Models, ” Journal of Intelligent Information Systems , vol. 57, no. 3, pp. 531 -546, 2021. https://doi.org/10.1007/s10844 -021 -00658 -5
[10] Gudivaka B., “Designing AI -Assisted Music Teaching with Big Data Analysi s,” Current Science and Humanities , vol. 9, no. 4, pp. 1 -14, 2021. DOI: 10.5281/zenodo.12605388
[11] Gujar S. and Reha A., “Enhancing Accuracy and Performance in Music Mood Classification Through Fine -Tuned Machine Learning Methods, ” Commun. Appl. Nonlinear Anal. , vol. 31, no. 5s, pp. 234 -258, 2024. doi:10.52783/cana.v31.1019
[12] He N., Neural Networks for Music Emotion Recog nition and Social Tags Emotion Representation, Doctoral dissertation, 2023. http://hdl.handle.net/10453/171926
[13] Hizlisoy S., Yildirim S., and Tuf ekci Z., “Music Emotion Recognition Using Convolutional Long Short Term Memory Deep Neural Networks, ” Engineering Science and Technology, an International Journal , vol. 24, no. 3, pp. 760 -767, 2021. https://doi.org/10.1016/j.jestch.2020.10.009
[14] Kamau N., Emotion -Driven Music Recommendations: Integrating CNN and KNN for Personalized Playlists , Doctoral dissertation, Dublin Business School, 2023. https://hdl.handle.net/10788/4400
[15] Lakshmana -Kumar R., Jayanthi S., Muthua B., and Sivaparthipan C., “An Automatic Anomaly Application Detection System in Mobile Devices Using FL -HTR -DBN and SKLD -SED K means algorithms, ” Journal of Intelligent & Fuzzy Systems: Applications in Engineering and Technology , vol. 46, no. 2, pp. 3245 -3258, 2024. https://doi.org/10.3233/JIFS -233361
[16] Liu Y., Ott M., Goyal N., Du J., and et al, “RoBERTa: A Robustly Opti mized BERT Pretraining Approach, ” arXiv preprint , vol. arXiv:1907.11692, pp. 1 -13, 2019. https://doi.org/10.48550/arXiv.1907.11692
[17] Liu Z., Xu W., Zhang W., and Jiang Q., “An Emotion -Based Personalized Music Recommendation Framework for Emotion Improvement, ” Information Processing and Management. , vol. 60, no. 3, pp. 103256, 2023. doi:10.1016/j.ipm.2022.103256
[18] Liyanarachchi R., Joshi A., and Meijering E., “A Survey on Multimodal Music Emotion Recognition, ” arXiv preprint , vol. arXiv:2504.18799, pp. 1 -26, 202 5. https://doi.org/10.48550/arXiv.2504.18799
[19] Medina Y., Beltrán J., and Baldassarri S., “Emotional Classification of Music Using Neural Networks with The Mediaeval Dataset, ” Personal and Ubiquitous Computing , vol. 26, no. 4, pp. 1237 -1249, 2022. https://doi.org/10.1007/s00779 - 020 -01393 -4
[20] Moscato V., Picariello A., and Sperli G., “An Emotional Recommender System for Music, ” IEEE Intelligent Systems , vol. 36, no. 5, pp. 57 -68, 2020. DOI:10.1109/MIS.2020.3026000
[21] Naser D. and Saha G., “Influence of Mu sic Liking on EEG Based Emotion Recognition, ” Biomedical Signal Processing and Control , vol. 64, pp. 102251, 2021. https://doi.org/1 0.1016/j.bspc.2020.102251
[22] Panda R., Malheiro R., Rocha B., Oliveira A., and Paiva R., “Multi -Modal Music Emotion Recognition: A New Dataset, Methodology and Comparative Analysis, ” Proceedings of the 10 th International Symposium on Computer Music Multidisciplinary Research , Marseille, pp. 1 -13, 2013. https://api.semanticscholar.org/CorpusID:163 157292
[23] Pandeya Y. and Lee J., “Deep Learning -Based Late Fusion of Multimodal Information for Emotion Classificatio n of Music Video, ” Multimedia Tools and Applications , vol. 80, no. 2, pp. 2887 -2905, 2021. https://doi.org/10.1007/s11042 -020 -08836 -3
[24] Pandeya Y., Bhattarai B., and Lee J., “Deep - Learning -Based Multimodal Emotion Classification for Music Videos, ” Sensors , v ol. 21, no. 14, pp. 4927, 2021. https://doi.org/10.3390/s21144927
[25] Rajesh S. and Nalini N., “Musical Instrument Emotion Recognition Using Deep Recurrent Neural Network, ” Procedia Computer Science , vol. 167, pp. 16 -25, 2020, https://doi.org/10.1016/j.procs.2020.03.178
[26] Sajid S., Javed A., and Irtaza A., “An Effective Framework for Speech and Music Segregation, ” The International Arab Journal of Information Technology , vol. 17, no. 4, pp. 75 -82, 2020. DOI:10.34028/iajit/17/4/9
[27] Sams A. and Zahra A., “Multimodal Music Emotion Recognition in Indonesian S ongs Based on CNN -LSTM, XLNET Transformers, ” Bulletin of Electrical Engineering and Informatics , vol. 12, no. 1, pp. 355 -364, 2023. DOI: 10.11591/eei.v12i1.4231
[28] Sarkar R., Choudhury S., Dut ta S., Roy A., and Saha S., “Recognition of Emotion in Music Based on Deep Convolutional Neural Network, ” Multimedia Tools and Applications , vol. 79, no. 1, pp. 765 -783, 2020. https://doi.org/10.1007/s11042 -019 -08192 -x
[29] Sheykhivand S., Mousavi Z., Rezaii T., and Farzamnia A., “Recognizing Emotions Evoked by Music Using CNN -LSTM Networks on EEG Signals, ” IEEE Access , vol. 8, pp. 139332 -139345, 2020. DOI:10.1109/ACCESS.2020.3011882.
[30] Shi G., Deng S., Wang B., Feng C., and et al, “One for All: A Unified Gener ative Framework for Image Emotion Classification, ” IEEE Transactions on Circuits and Systems for Video Technology , vol. 34, no. 8, pp. 7057 -7068, 2024. DOI:10.1109/TCSVT.2023.3341840
[31] Sujeesha A., Mala J., and Rajan R., “Automatic Music Mood Classification Using Multi -Modal Attention Framework, ” Engineering Applications of Artificial Intelligence , vol. 128, pp. 107355, 2024. DOI:10.1016/j.engappai.2023.107355.
[32] Wang S., Xu C., Ding A., and Tang Z., “A Novel Emotion -Aware Hybrid Music Recommendation Method Usi ng Deep Neural Network, ” Electronics , vol. 10, no. 15, pp. 1769, 2021. https://doi.org/10.3390/electronics10151769
[33] Wang Y., “Music Composition and Emotion Recognition Using Big Data Technology and Neural Network Algorithm, ” Computational Intelligence and N euroscience , vol. 2021, pp. 1 -11, 2021. https://doi.org/10.1155/2021/5398922
[34] Wu J., “Research on Music Emotion Analysis and Dance Creation Based on Neural Network, ” Journal of Electrical Systems , vol. 20, no. 6s, pp. 575 -581, 2024.
[35] Zainab R. and Majid M., “Emotion Recognition Based on EEG Signals in Response to Bilingual Music Tracks, ” The International Arab Journal of Information Technology, vol. 18, no. 3, pp. 26 -36, 2021, DOI:10.34028/iajit/18/3/4
[36] Zhang S., Huang Z., and Lang Y., “Appli cation of Video Game Algorithm Based On Deep Q - Network Learning in Music Rhythm Teaching, ” The International Arab Journal of Information Technology , vol. 22, no. 1, pp. 124 -138, 2025. DOI:10.34028/iajit/22/1/10