https://doi.org/10.31449/inf.v47i10.5407 Informatica 47 (2023) 103 –108 103 Study on the Effect of Decompression Music on Anxiety Patients Based on Emotion Classification Algorithm Dan Zhang Art College, Shandong University of Aeronautics, Binzhou, Shandong 256600, China E-mail: z3d5hf@yeah.net Keywords: emotion classification algorithm, music therapy, anxiety, efficacy Received: November 8, 2023 The relief of anxiety is important for physical health. This paper briefly introduces music therapy and the multimodal fusion-based emotion classification algorithm used to accurately select appropriate emotion music for music therapy. Afterwards, the algorithm was first tested in an experiment, and then the efficacy of music therapy was tested with 80 contemporaneous anxiety patients from XX Hospital in Binzhou City, Shandong Province. The results showed that the multimodal fusion-based music emotion classification algorithm was sufficiently accurate; conventional medication and care were also effective in relieving the anxiety symptoms, but music therapy further alleviated patients’ anxiety. Povzetek: Opisana sta glasbena terapija in algoritem za klasifikacijo čustev, oboje testirano na anksioznih pacientih. 1 Introduction In today's fast-paced life, anxiety and stress have become common problems faced by many people. If these problems are not addressed or alleviated in a timely manner, over time, the negative effects caused by psychological problems will gradually affect physiological state [1]. Generally, anxiety and stress can be relieved by self-regulation of one ’s psychological state or distraction by other things without serious effects, but when anxiety cannot be relieved autonomously, it may develop into a mental illness. While medication can treat anxiety [2], it only relieves physical symptoms and has side effects. In addition to medication, music can also be used as a non-pharmacological treatment in the process of anxiety treatment. Music uses its own specific rhythm to help anxiety patients relax and relieve anxiety in the treatment process [3]. By using the music emotion classification algorithm, an intelligent algorithm, therapists can more accurately select emotionally appropriate music to achieve better treatment outcomes. This paper briefly introduced music therapy and the multimodal fusion-based emotion classification algorithm used to accurately select emotionally appropriate music in music therapy. The multimodal fusion-based emotion classification algorithm was first tested in an experiment, followed by a test of the efficacy of music therapy with 80 contemporaneous anxiety patients from XX Hospital in Binzhou City, Shandong Province. In previous studies, music therapy has been examined for its therapeutic effects on mental disorders. This article takes a perspective of selecting appropriate therapeutic music and utilizes an emotion classification algorithm to choose suitable music for treating anxiety. By employing this algorithm, it aims to enhance the treatment effectiveness by selecting music that is better suited for patients. 2 Related works Authors Main content Results Lu et al. They investigated the efficacy of music therapy on sleep disorders in patients with schizophrenia. The music therapy was effective in treating sleep disorders in patients with schizophrenia. Zhao [5] They proposed an optimized restricted Boltzmann machine (RBM) feature extraction model combined with a softmax classification algorithm to detect electroencephalogram changes in children with autism spectrum disorder during music therapy. They validated the accuracy of the algorithm through experiments. Chen et al. [6] They investigated the effects of group music therapy on improving anxiety and self- esteem in Chinese prisoners. The group music therapy appeared to be effective in improving anxiety and self-esteem, and was most beneficial for prisoners who were young or less educated. 104 Informatica 47 (2023) 103 –108 D. Zhang 3 Music therapy Routinely, anxiety gradually subsides without serious consequences as long as it is regulated by the autonomy of the psychological state, but there are also cases where stress or other factors lead to anxiety that cannot be relieved in time and eventually affects physiological health. In such cases, anxiety is no longer a conventional negative emotion [7], but rather a real psychological disease that requires external interventions for treatment. While medication serves as a natural form of anxiety treatment, it can only suppress the physiological symptoms presented and address the symptoms rather than the underlying cause; moreover, medication may also have side effects [8]. In addition to medication, music can also be used as a non-pharmacological approach to treating anxiety disorders [9]. Common music therapies include listening to music therapy, performing music therapy, and combined music and sports therapy. In listening to music therapy, the therapist selects appropriate music and musical rhythms to influence the patient's mood and behavior, resulting in stress reduction, pain relief, and improved sleep. On the other hand, performing music therapy allows patients to play instruments or sing to promote physical and mental health through musical activities. Combined music and exercise therapy allows patients to exercise with music to relax and adapt physically and mentally at the same time. 4 Music emotion classification algorithm A brief introduction to music therapy was given earlier. The therapeutic principle of this treatment is to use the rhythmic melody and other characteristics of music to guide the relaxation of the patient's physical and mental state [10], thus interfering with negative psychological states. Regardless of the type of music therapy, the choice of music is very important in the process of treating patients. The therapist must select music that contains appropriate emotional states according to the patient's emotional state. For the therapist, an intelligent algorithm such as the music emotion classification algorithm can help therapists better understand the emotional characteristics of the music and thus make a more accurate selection. Input music video Preprocessing Feature extraction Audio emotion classifier Input music lyrics Preprocessing Text vectorization Lyrics emotion classifier Classification result fusion Music emotion classification results Figure 1: Basic flow of multimodal fusion-based music emotion classification algorithm. Figure 1 shows the basic flow of the multimodal fusion- based music emotion classification algorithm. In this paper, the Hevner emotion ring model is used for classifying music emotions, and there are eight emotion types. The specific steps of the algorithm are shown below. ① The audio of the music and the corresponding lyrics are input respectively [11]. ② The audio and lyrics are preprocessed separately. ③ Features are extracted from the audio and lyrics using Mel-frequency cepstral coefficient (MFCC) and Word2vec, respectively [12]. The extraction formula of MFCC feature is:                          =       + = =          +  +   − − − − + − +   − − − − − + − − −  =         • = =  =     − = − = − = − = − L l M m l m S l c k H m f k m f k m f m f m f m f m f k m f m f k m f m f m f m f m f m f k m f k k H k H P m S k Y P e n y k Y M m M m m m N k m N n N kn j , , 3 , 2 , 1 2 ) 1 2 ( cos ) ( ) ( 1 ) ( ) 1 ( 0 ) 1 ( ) ( )) 1 ( ) ( ))( 1 ( ) 1 ( ( ) ) 1 ( ( 2 ) ( ) 1 ( )) 1 ( ) ( ))( 1 ( ) 1 ( ( )) 1 ( ( 2 ) 1 ( 0 ) ( ) ( ) ( ln ) ( ) ( ) ( ) ( ) ( 1 1 1 0 1 0 2 1 0 2      ,(1) where ) (k Y refers to the frequency domain signal after FFT [11], ) (n y refers to the original time domain signal, k refers to the number of sampling point, n refers to the time sampling point of the time domain signal, ) (  P is the instantaneous energy of ) (k Y , ) (k H m is the frequency response of a triangular filter, m is the serial number of a triangular filter in a group composing of M filters, ) (m f is the central frequency of the m -th triangular filter in a group, ) (l c is the L -order MFCC feature parameter, and ) (m S is the energy spectrum function of the frequency domain signal after filtering processing. ④ An audio emotion classifier and a lyrics emotion classifier are used for emotion recognition, respectively. The audio emotion classifier performs emotion recognition on the Mel inverse spectrogram of the audio features, so a convolutional neural network (CNN) suitable for image recognition is used. When performing emotion recognition on audio, the CNN first performs convolutional computation on the Mel inverse spectrogram using convolutional kernels in the convolutional layer. It then compresses the convolutional feature map in the pooling layer. The formula of the convolutional computation is: ) ( 1 i i i i B W O f O +  = − , (2) where i O and 1 − i O are the feature maps output from the i -th and 1 − i -th layers, i W is the weight in the i -th layer structure, i B the bias in the i -th layer structure, and ) (  f is the activation function. Convolution and pooling Study on the Effect of Decompression Music on Anxiety … Informatica 47 (2023) 103 –108 105 in the CNN can be repeated as required, and the final convolutional feature maps will be computed in the fully connected layer to obtain the emotion recognition results. The lyrics emotion classifier performs emotion recognition on vectorized lyrics text using long short-term memory (LSTM) suitable for sequence information recognition [13]. ⑤ After obtaining the emotion recognition results of the music using the audio emotion classifier and the lyrics emotion classifier [14], the results are weighted and fused according to the ratio of the weights that the two classifiers have. Finally, the overall emotion classification results of the music are obtained. 5 Example analysis 5.1 Experimental environment Before testing the efficacy of music therapy using an emotion classification algorithm, the proposed multimodal fusion-based emotion classification algorithm was first tested to verify its effectiveness. The validation of the emotion classification algorithm was performed on a server in the laboratory. 5.2 Experimental data Music and corresponding lyrics were crawled by a crawler program from the song lists of different emotion classifications on the NetEase Cloud platform for conducting the simulation experiments on the emotion classification algorithm. There were 12 emotion classifications in the song lists on the platform, and 50 songs were crawled from each song list. In total, 600 pieces of music and their corresponding lyrics were collected. The emotion classification of music in the NetEase Cloud platform is for user experience, and the emotion boundary between some song lists is relatively blurred, which is not conducive to the selection of music emotions in music therapy. Therefore, this paper used the Hevner emotion ring model to organize and summarize the crawled music. The music waveforms of some of these emotions are shown in Figure 2, from which it can be seen that there were obvious differences between the music waveforms of the two emotions. Figure 2: Music waveform diagrams of some emotions. 5.3 Test items (1) Testing of a multimodal fusion-based emotion classification algorithm The parameters of the CNN as an audio emotion classifier in the multimodal fusion-based sentiment classification algorithm are shown below. The number of convolutional layers was set to 4, with 32 convolutional kernels of 2 2  in each layer, and the sigmoid activation function was used. After every two convolutional layers, there was one pooling layer, and the mean pooling with a 3 3  pooling frame was used. The parameters of the LSTM as a lyrics emotion classifier are as follows. The number of dimensions of Word2vec vectorization was set to 200. Two hidden layers were used, with 512 nodes in each hidden layer, and the sigmoid function was used as the activation function. In addition to the above emotion classification algorithm, two unimodal emotion classification algorithms were tested as a comparison. (2) Testing of the efficacy of music therapy using emotion classification algorithms Eighty contemporaneous anxiety patients were selected from XX Hospital in Binzhou City, Shandong Province. All selected patients voluntarily participated in the test and signed an informed consent form. The patients were divided into two groups, the control group and the test group, and there was no significant difference between the two groups. The criteria for selection were meeting the diagnostic criteria for anxiety disorder, over 18 years old, being voluntarily participated in the test and signed an informed consent form. The exclusion criteria were intellectual disabilities, language barriers, severe systemic diseases, and severe organ dysfunction. Patients in both groups received conventional medication and conventional nursing interventions during the test process. The nursing interventions included education on medical knowledge related to anxiety disorders, rational use of medication, guidance on diet and rest, as well as the development and implementation of exercise training. The test group received additional music therapy, which was performed as follows. ① The therapist was required to conduct one-on-one treatment under the premise of gaining the patient's trust. During the treatment process, the therapist was required to fully understand the patient's condition and emotional characteristics. Before formally applying music therapy, the therapist was required to communicate with the patient for 15-20 minutes to guide the patient to express the negative emotions, providing part of the basis for the subsequent music selection. ② When music therapy was formally administered, the therapist selected the appropriate music for the patient based on the emotions previously expressed by the patient, combined with the emotion recognition results of the music to be selected by the emotion classification algorithm, and adjusted the patient's physical and mental state to a positive and optimistic state through music. The music therapy interventions for the patients were performed three times a week, with each session lasting one hour. The treatment lasted for six weeks in both the control and test groups. In addition, anxiety levels of patients in both groups were assessed before and after the treatment using the Self-Rating Anxiety Scale; psychiatric symptoms were assessed using the Psychiatric Assessment Scale. Finally, SPSS software [15] was used 106 Informatica 47 (2023) 103 –108 D. Zhang for data statistics. The t-test was used to detect the differences between the two groups. 5.4 Test results Figure 3 shows the emotion recognition accuracy test results of the three emotion classification algorithms. From Figure 3, it can be seen that the classification accuracy of the same emotion classification algorithm was similar for music with different emotions; for music with the same emotion, the multimodal fusion (CNN+LSTM)- based emotion classification algorithm had the highest recognition accuracy among the three emotion classification algorithms, the LSTM-based algorithm for music lyrics was the second, and the CNN-based algorithm for music audio was slightly lower than the LSTM-based algorithm. Figure 3: Recognition accuracy of three emotion classification algorithms. Table 1 shows the anxiety scores of the control and test groups before and after the treatment. As can be seen from Table 1, before the treatment, the anxiety scores of both the control group and the test group were above 50, i.e., both suffered from anxiety disorders, and the difference between the two groups was not significant. After the treatment, the anxiety score of the control group decreased to below 50, and there was a significant difference compared to pre-treatment; the anxiety score of the test group decreased significantly compared to pre-treatment, their anxiety scores were below 50, i.e., the anxiety symptoms were significantly reduced, and the score was significantly lower compared to the control group. Table 1: Anxiety level of patients in both groups. Before treatment After treatment P value Control group 59.68 ± 5.24 49.68 ± 4.25 0.002 Test group 59.63 ± 4.57 37.21 ± 2.56 0.001 P value 0.923 0.002 Table 2 shows the results of the psychiatric assessment before and after the treatment in the control and test groups. As can be seen from Table 2, there was no significant difference in the scores on the same psychiatric assessment dimensions between the control and test groups before the treatment, and both maintained relatively high scores. After the treatment, there was a significant decrease in the scores of the control and test groups on all five assessment dimensions, indicating that the treatment modalities received by both groups were effective. When comparing the scores of the two groups on the same dimensions, it can be seen that the score of the test group was significantly lower. Table 2: Results of psychiatric assessment in both groups before and after treatment. Psychiat ric assessm ent dimensi ons Group Before treatmen t After treatmen t P value Anxiety and depressi on Control group 6.13 ± 1.11 5.03 ± 1.13 0.000 Test group 6.11 ± 1.02 3.25 ± 1.14 0.001 P value 0.689 0.000 Thought disorder s Control group 6.89 ± 1.24 5.12 ± 1.11 0.002 Test group 6.78 ± 1.13 3.14 ± 1.47 0.000 P value 0.788 0.001 Lack of vitality Control group 6.32 ± 1.41 5.11 ± 1.23 0.001 Test group 6.22 ± 1.36 3.05 ± 1.57 0.000 P value 0.874 0.001 Activati on Control group 6.35 ± 1.53 5.24 ± 1.63 0.002 Test group 6.33 ± 1.44 3.07 ± 1.21 0.001 P value 0.845 0.000 Hostility and suspicio n Control group 6.58 ± 1.11 5.16 ± 1.25 0.001 Test group 6.55 ± 1.37 3.11 ± 1.14 0.000 P value 0.748 0.001 6 Discussion Under the pressure of fast-paced life, people tend to be more prone to anxiety. In general, anxiety can be relieved through psychological self-regulation, but sometimes anxiety cannot be relieved in time due to stress or other factors and eventually induces a mental illness such as anxiety disorder, which interferes with normal life. In this case, it is necessary to intervene using external means. Medication is a common treatment, but it is not a cure and has side effects. Music can also be used to treat anxiety disorders. In the process of using music therapy, the therapist must choose music that contains the right emotions according to the patient's current mood in order to regulate their negative emotions. Therefore, it is Study on the Effect of Decompression Music on Anxiety … Informatica 47 (2023) 103 –108 107 important to accurately identify and select the emotions contained in the music. In this paper, a multimodal fusion- based algorithm for emotion classification was used to identify the emotions in music and assist therapists in selecting the music with appropriate emotion. In the subsequent experiments, the performance of the multimodal fusion-based emotion classification algorithm was verified by comparing it with the CNN-based audio emotion classification algorithm and the LSTM-based lyric emotion algorithm. Multimodal fusion recognized music emotion as a whole from both audio and lyrics perspectives, so it had a better recognition performance than the other two one-sided algorithms. After validating the accuracy of the emotion classification algorithm, the efficacy of music therapy was tested on 80 patients with anxiety. They were divided into a control group and a test group, both of which received the same conventional medication and care during the treatment cycle. However, only the test group received additional music therapy. Anxiety and psychiatric assessments were conducted before and after treatment in both groups. The final results showed that conventional medication and care were effective in relieving anxiety, but the test group receiving music therapy had better anxiety relief and more significant results. The reasons are as follows. Conventional medication and nursing care can suppress the surface anxiety symptoms, and the requirement for sufficient exercise during the care process facilitated adjustment of psychological state through physiological changes. Therefore, the control group, which only received conventional treatment, experienced significant relief of anxiety after treatment. In the test group, music therapy was added. The audio and rhythm of music could resonate with the body cells of patients and stimulate their cerebral cortex to indirectly regulate and control emotions. At the same time, music could also divert patients' attention away from negative thoughts and relieving their anxiety at a psychological level. Compared to the studies mentioned earlier regarding music therapy, which mostly focused on examining the therapeutic effects of music therapy on mental disorders such as depression and anxiety, this article instead emphasized how to select appropriate music for treating anxiety. When classifying and identifying the emotions contained in music, it is not like traditional recognition methods that only distinguish the emotions of music based on audio or lyrical text. Instead, it combined the audio and lyrical text of the music, using CNN to recognize the audio and LSTM to recognize the lyrical text. Then, a weighted combination of both recognition results was used to obtain the final result. This paper utilized multimodal features such as audio and text to classify and recognize the emotions in music, thereby providing appropriate emotional music tailored to patients' actual experiences. Furthermore, this study examined the effectiveness of the proposed algorithm in music therapy specifically for anxiety patients, offering valuable insights for enhancing the efficacy of music therapy. The limitation of this study lies in the insufficient diversity and quantity of samples used to train the emotion classification algorithm, which can easily lead to overfitting. Therefore, future research directions include expanding the range and number of samples to further enhance the recognition performance of the emotion classification algorithm for music, thus better assisting music therapy. 7 Conclusion This paper briefly introduces music therapy and the multimodal fusion-based emotion classification algorithm used to accurately select music with appropriate emotions for music therapy. Then, the multimodal fusion-based emotion classification algorithm was tested in an experiment, and the efficacy of music therapy was tested on 80 contemporaneous anxiety patients from XX Hospital in Binzhou City, Shandong Province.The following results were obtained. (1) The multimodal fusion-based (CNN+LSTM-based) emotion classification algorithm had the highest recognition accuracy, the LSTM-based music lyrics emotion classification algorithm was the second, and the CNN-based music audio emotion classification algorithm was slightly lower than the LSTM-based algorithm. (2) Both the control and test groups showed significant relief from anxiety after treatment, and the test group that additionally received music therapy showed greater relief. (3) After the treatment, psychiatric scores were significantly reduced in both the control and test groups, with a more significant reduction in the test group. 8 References [1] Eseadi C, Ngwu M O (2023). Significance of music therapy in treating depression and anxiety disorders among people with cancer. World Journal of Clinical Oncology: English Edition, 14, pp. 69-80. https://doi.org/10.5306/wjco.v14.i2.69 [2] Mayer-Ferbas J, Gassner L (2021). PP90 Effectiveness of Music Therapy for Autism Spectrum Disorder, Dementia, Depression, Insomnia, And Schizophrenia. International Journal of Technology Assessment in Health Care, 37, pp. 18- 18. https://doi.org/10.1017/S0266462321001094 [3] Chow R, Bergner R, Prsic E (2021). Music therapy effectiveness by duration in patients with cancer: a meta-regression. Supportive and Palliative Care, 13, pp. 117-120. https://doi.org/10.1136/bmjspcare- 2021-003163 [4] Lu M J, Chen W Y, Li D J (2022). Efficacy of music therapy and predictors of sleep disturbance among patients with chronic schizophrenia: A prospective study. Archives of Psychiatric Nursing, 40, pp. 1-7. https://doi.org/10.1016/j.apnu.2022.04.001 [5] Zhao N (2021). Intelligent System of Somatosensory Music Therapy Information Feedback in Deep Learning Environment. Complexity, 2021, pp. 1-11. https://doi.org/10.1155/2021/9935504 [6] Chen X J, Hannibal N, Gold C (2016). Randomized Trial of Group Music Therapy with Chinese 108 Informatica 47 (2023) 103 –108 D. Zhang Prisoners: Impact on Anxiety, Depression, and Self- Esteem. International Journal of Offender Therapy & Comparative Criminology, 60, pp. 1064-1081. https://doi.org/10.1177/0306624X15572795 [7] Monsalve-Duarte S, Betancourt-Zapata W, Suarez- Canon N, Maya R, Salgado-Vasco A, Prieto-Garces S, Marín-Sánchez J, Gómez-Ortega V, Valderrama, Ettenberger M (2022). Music therapy and music medicine interventions with adult burn patients: A systematic review and meta-analysis. Burns: Including Thermal Injury, 48, pp. 510-521. https://doi.org/10.1016/j.burns.2021.11.002 [8] Sun B, Tian F, Jia M (2019). Emotion recognition method of Tibetan micro-blog text based on sentiment dictionary. Journal of Physics: Conference Series, 1314, pp. 1-6. https://doi.org/10.1088/1742-6596/1314/1/012182 [9] Adarsh S R (2019). Enhancement of text-based emotion recognition performances using word clusters. International Journal of Research - GRANTHAALAYAH, 7, pp. 238-250. https://doi.org/10.29121/granthaalayah.v7.i1.2019.1 051 [10] Thakur P, Shrivastava R (2018). A Review on Text Based Emotion Recognition System. International Journal of Advanced Trends in Computer Science and Engineering, 7, pp. 67-71. https://doi.org/10.30534/ijatcse/2018/01752018 [11] Gao Y, Xu A, Hu J H, Cheng T H (2017). Incorporating association rule networks in feature category-weighted naive Bayes model to support weaning decision making. Decision Support Systems, 96, pp. 27-38. https://doi.org/10.1016/j.dss.2017.01.007 [12] Xiao S, Hu Y, Han J, Zhou R, Wen J (2016). Bayesian Networks-based Association Rules and Knowledge Reuse in Maintenance Decision-Making of Industrial Product-Service Systems. Procedia CIRP, 47, pp. 198-203. https://doi.org/10.1016/j.procir.2016.03.046 [13] Rao W, Zhu L, Pan S, Yang P, Qiao J (2019). Bayesian Network and Association Rules-based Transformer Oil Temperature Prediction. Journal of Physics Conference, 1314, pp. 1-8. https://doi.org/10.1088/1742-6596/1314/1/012066 [14] Alswaidan N, Menai M (2020). Hybrid Feature Model for Emotion Recognition in Arabic Text. IEEE Access, 4, pp. 1-12. https://doi.org/10.1109/ACCESS.2020.2975906 [15] Kiruthika S, Priyan V V (2021). Detection of Online Fake Reviews Based on Text Emotion. Journal of Physics: Conference Series, 1916, pp. 1-8. https://doi.org/10.1088/1742-6596/1916/1/012153