# Research on Music Emotion Intelligent Recognition and Classification Algorithm in Music Performance System

Authors: Chun Huang; Diao Shen
Journal: Scientific Programming
 (2021)

---

## Abstract

The music performance system works by identifying the emotional elements of music to control the lighting changes. However, if there is a recognition error, a good stage effect will not be able to create. Therefore, this paper proposes an intelligent music emotion recognition and classification algorithm in the music performance system. The first part of the algorithm is to analyze the emotional features of music, including acoustic features, melody features, and audio features. Then, the three kinds of features are combined together to form a feature vector set. In the latter part of the algorithm, it divides the feature vector set into training samples and test samples. The training samples are trained by using recognition and classification model based on the neural network. And then, the testing samples are input into the trained model, which is aiming to realize the intelligent recognition and classification of music emotion. The result shows that the kappa coefficientk values calculated by the proposed algorithm are greater than 0.75, which indicates that the recognition and classification results are consistent with the actual results, and the accuracy of recognition and classification is high. So, the research purpose is achieved.


---

## Body

## 1. Introduction

Watching entertainment programs has become one of the main leisure activities in our daily lives. When watching the program, we can often see that the lights will change with the performance of the performers, so as to render the performance scene and drive the scene atmosphere, which helps the performers to complete their performance better. The conversion of the performance lighting is mainly completed under the control of the music performance system. Namely, the control principle of the music performance system is to control the lighting by classifying and identifying the emotions contained in the performers’ music. For example, if the emotions expressed in the music are cheerful, joyful, and enthusiastic, the corresponding rhythm of lighting will change fast, and the light color will be red or other bright colors. On the contrary, if the emotional factors expressed in music are depressive and serious, the corresponding rhythm of lighting will change slowly. And, the light color will be dark blue or other deep cool colors [1]. Once the emotion recognition is wrong, it is very likely to ruin a performance. Based on the above background, music emotion recognition and classification has become the most critical part of the music performance system and the focus of researches.There are many researches on emotion recognition and classification contained in music. For example, in literature [2], Wang Jinhua, Ying Na, Zhu Chendu, and others extracted emotion strong correlation feature spectrogram through the hybrid convolution neural network model and recognized emotion in music on this basis. In literature [3], Wang Jie and Zhu Beibei took Chinese lyrics as the main object, extracted the emotional feature keywords contained in lyrics, and then calculated the similarity between words and Chinese emotional dictionary, to achieve music emotional classification. In literature [4], Li Qiang and Liu Xiaofeng constructed a probabilistic neural network model (PNN) to classify music emotion, extracted feature parameters in the process of music playing, and then input the feature parameters into the PNN model to complete emotion classification.Combined with the experience in previous researches, in order to improve the accuracy of recognition and classification, this study extracts the emotional features contained in music from multiple aspects and then constructs a multifeature space vector. Finally, the classification of music emotion is achieved by using the constructed recognition and classification model, which helps the completion of the control of lighting in the music performance system. The purpose of this study is to help performers complete stage music performance and improve the performance appeal.


## 2. Research on Music Emotion Intelligent Recognition and Classification Based on Multifeatures

A perfect music performance is not only achieved by the help of necessary musics but also the complementary scene atmosphere. In the music performance, the setting of the scene atmosphere is mainly realized by lighting, which often changes with the emotional factors expressed in the music and assists the music to create a good stage effect [5]. Based on this, in order to control the lighting in the performance, realizing the music emotion recognition is very important. Therefore, to achieve a more suitable music emotion, it is necessary to construct the music recognition and classification model and complete the research on intelligent recognition and classification of music emotion in the music performance system.


### 2.1. Analysis of the Features of Music Emotion

The realization of music emotion recognition and classification is based on music emotion features, so the extraction of music emotion features is analyzed in the former part of this study. In the previous classification of music emotions, most studies were just based on one kind of music feature. Although this kind of study can also complete the classification task, its accuracy cannot be guaranteed [6]. In order to solve the above problem, this paper analyzes all the factor features of music emotion and then combines them together into a feature vector, which will do a great help to carry out the purpose.Considering that the premise of extracting emotional features in music is to understand the composition of music, among which the music-related factors can show emotional features more obviously. It includes acoustic features, melody features, and audio features [7]. In view of these three aspects, the following content will analyze it specifically.Among them, acoustic characteristics, melodic characteristics, and audio characteristics are the general music-related factors that can show emotional characteristics more obviously [7]. According to the above analysis, the Thayer emotion model constructed mainly includes two dimensions: energy and pressure, as shown in Figure 1. The above two dimensions representing the abscissa and ordinate, respectively, correspond to Figure 1 that can reflect the measurement of standard strength. From left to right, the abscissa corresponds to emotion from happiness to sadness, and from bottom to top, the ordinate corresponds to emotion from calm to vitality.Figure 1
Thayer emotion model.Based on Figure1, the following content specifically analyzes acoustic features, melodic features, and audio features.


#### 2.1.1. Acoustic Features

Acoustic factor is the most basic component of music. Music with different emotions has different acoustic features. The basic corresponding relationship is shown in Table1 [8].Table 1
The corresponding relationship between acoustic features and music emotion.
Acoustic featuresPronunciationTone qualitySpeech speedIntensityMean pitchPitch rangeHappyNormalBreathing sound, chirping soundFast or slowHighVery highVery wideHateNormalMumble, chest voiceExtremely fastLowExtremely lowSlightly widerAngerTightBreathing soundSlightly fasterHighExtremely highVery wideSadnessVagueResonance soundSlightly slowerLowSlightly lowerSlightly narrowFearClearShrill voiceVery fastNormalExtremely highVery wide


#### 2.1.2. Melody Features

Melody is the overall beat and tune of music, which can be described by the following five characteristic parameters [9].(1) Balance Parameter Y1. Balance refers to the proportion of volume in the left and right channels. The calculation formula is as follows:(1)Y1=Pk−64127,k=1,2,…,16.In the formula,Pk represents the equilibrium value, Pk∈0∼127.(2) Volume Parameter Y2. Volume refers to the loudness of sound that can be heard by human [10]. The calculation formula is as follows:(2)Y2=V127.In the formula,Vrepresents the total volume loudness, and its range is V∈0∼127.(3) Pitch Parameter Y3. Pitch refers to the vibration frequency of the note fundamental frequency. Music with fast rhythm has fast vibration frequency; on the contrary, it has slow vibration frequency [11]. The calculation formula is as follows:(3)Y3=1127n∑i=1nPti.In the formula,Pti represents the pitch value, nrepresents the number of note fundamental frequency.(4) Average Strength Parameter Y4. Strength refers to the strength of the power generated by music. The soothing music has weak strength, while the more shocking music has strong strength [12]. The calculation formula is as follows:(4)Y4=∑i=1NUelm,iN,m=1,2,…,16.In the formula,Uelm,i represents the sound’s intensity factor; m represents the sort number of musical notes; and N indicates the total number of musical notes.(5) Energy Parameter of Musical Notes. Energy of musical notes refers to the sum of the product of the pitch and the length of a note. The calculation formula is as follows.(5)Y5=∑i=1npji×dji,j=1,2,…,16.In the formula,pji represents the pitch and length of i notes in trackj.


#### 2.1.3. Features of Audio Frequency

Audio frequency is one of the important factors in music, which affects the rhythm of music. The faster the rhythm is, the more obvious the audio is, and the happier the music emotion will be. On the contrary, the music emotion is more dull or depressed [13]. Audio features are described from two aspects, the following part is a detailed analysis.Time domain characteristics are as follows.(1) Zero Crossing Rate Zn. Zero crossing rate refers to the frequency of the audio signal waveform passing through the zero level. Generally speaking, in a piece of music, the zero crossing rate of high frequency band will be higher; otherwise, the zero crossing rate will be lower. Through this parameter, we can well distinguish between unvoiced and voiced music. Generally, unvoiced music is mostly used in cheerful music, while voiced music is often used in low and deep music [14]. The zero crossing rate is calculated as follows:(6)Zn=∑m=1Nsgnsnxm−sgnsnxm−12N.In the formula,snxm represents the sign function of audio signal of xm and N represents the effective width of the window.(2) Range Mn. Range refers to the width of the waveform vibration of the audio signal. The more passionate the music is, the greater the audio amplitude is. The more soothing the music is, the smoother the audio amplitude is. The audio amplitude is described as follows:(7)Mn=∑m=n−N−1nxmwn−m=∑m=n−N−1nxmwn−m.In the formula,wn−mrepresents the moving window function.(3) Frequency Domain Characteristics. The frequency domain characteristics of audio include two parts: spectrum centroid Rt and spectrum flux Ft. The calculation formula is as follows:(8)spectrum centroidRt=∑n=1Nqtn×n∑n=1Nqtn,spectrum fluxHt=∑n=1NStn−St−1n2.In the formula,qtn represents the amplitude of the short-time spectrum of the t frame at frequency point n and Stn and Stn−1 represents the amplitude value of the spectrum at frame t at frequency n and n−1.Based on the above three types of 14 music emotional features, the feature vector is constructed to describe the emotional factors of a part of music or a piece of music. It is described as follows:(9)U=U1,U2,U3,U1=S1,S2,S,3S4,S5,U2=Y1,Y2,Y,3Y4,Y5,U3=Zn,Mn,Ct,Ft.In the formula,U1 represents acoustic features; U2 represents the characteristics of melody; U3 represents audio features; S1 represents the speed of speech; S2represents the pitch; S3 represents strength; S4represents sound quality; and S5 stands for pronunciation.


### 2.2. Construction of Music Emotion Recognition and Classification Model

Based on the emotional features contained in the above music, this chapter uses the BP neural network to establish a recognition and classification model to realize the recognition and classification of music emotion.BP neural network is an intelligent algorithm that simulates the neural work of brain, which mainly includes three layers, and the classification processing is realized through the operation of each layer [15]. The recognition and classification model constructed by this algorithm is shown in Figure 2.Figure 2
Schematic diagram of construction and working principle of recognition and classification model.In Figure2, the model needs to be trained before practical application. The specific process is as follows: through feedforward operation of each layer, it can obtain the output result and subtract the output result from the expected result. When the difference between the two is less than the set threshold, the difference is propagated backward after training, and the process is repeated from output to input until the weight and threshold reach the optimal [16]. The purpose of the BP neural network training is to adjust and optimize the weights and thresholds of every two levels in the model. Therefore, the formula is given as follows:(1)
Connection weightwij and threshold θj between the first input layer and the second hidden layer, adjustment formula is as follows:(10)wijN+1=wijN+β⋅gjk·ciθjN+1=θjN+β⋅gjki=1,2,…,n,j=1,2,…,m,0<β<1..In the formula,gjk represents error value of the second layer; ci represents input feature vector; N represents iterations; and k represents the number of training samples.(2)
Connection weightvjt and threshold γt between the second hidden layer and the third output layer, adjustment formula is as follows:(11)vjtN+1=vjtN+α⋅ttk·yjγtN+1=γtN+α⋅ttkj=1,2,…,p,t=1,2,…,q,0<α<1..In the formula,ttk represents error value and yj represents the output value of the second layer node.After training of the model based on the BP neural network, the music emotion classification can be realized by inputting test music samples.


## 2.1. Analysis of the Features of Music Emotion

The realization of music emotion recognition and classification is based on music emotion features, so the extraction of music emotion features is analyzed in the former part of this study. In the previous classification of music emotions, most studies were just based on one kind of music feature. Although this kind of study can also complete the classification task, its accuracy cannot be guaranteed [6]. In order to solve the above problem, this paper analyzes all the factor features of music emotion and then combines them together into a feature vector, which will do a great help to carry out the purpose.Considering that the premise of extracting emotional features in music is to understand the composition of music, among which the music-related factors can show emotional features more obviously. It includes acoustic features, melody features, and audio features [7]. In view of these three aspects, the following content will analyze it specifically.Among them, acoustic characteristics, melodic characteristics, and audio characteristics are the general music-related factors that can show emotional characteristics more obviously [7]. According to the above analysis, the Thayer emotion model constructed mainly includes two dimensions: energy and pressure, as shown in Figure 1. The above two dimensions representing the abscissa and ordinate, respectively, correspond to Figure 1 that can reflect the measurement of standard strength. From left to right, the abscissa corresponds to emotion from happiness to sadness, and from bottom to top, the ordinate corresponds to emotion from calm to vitality.Figure 1
Thayer emotion model.Based on Figure1, the following content specifically analyzes acoustic features, melodic features, and audio features.


### 2.1.1. Acoustic Features

Acoustic factor is the most basic component of music. Music with different emotions has different acoustic features. The basic corresponding relationship is shown in Table1 [8].Table 1
The corresponding relationship between acoustic features and music emotion.
Acoustic featuresPronunciationTone qualitySpeech speedIntensityMean pitchPitch rangeHappyNormalBreathing sound, chirping soundFast or slowHighVery highVery wideHateNormalMumble, chest voiceExtremely fastLowExtremely lowSlightly widerAngerTightBreathing soundSlightly fasterHighExtremely highVery wideSadnessVagueResonance soundSlightly slowerLowSlightly lowerSlightly narrowFearClearShrill voiceVery fastNormalExtremely highVery wide


### 2.1.2. Melody Features

Melody is the overall beat and tune of music, which can be described by the following five characteristic parameters [9].(1) Balance Parameter Y1. Balance refers to the proportion of volume in the left and right channels. The calculation formula is as follows:(1)Y1=Pk−64127,k=1,2,…,16.In the formula,Pk represents the equilibrium value, Pk∈0∼127.(2) Volume Parameter Y2. Volume refers to the loudness of sound that can be heard by human [10]. The calculation formula is as follows:(2)Y2=V127.In the formula,Vrepresents the total volume loudness, and its range is V∈0∼127.(3) Pitch Parameter Y3. Pitch refers to the vibration frequency of the note fundamental frequency. Music with fast rhythm has fast vibration frequency; on the contrary, it has slow vibration frequency [11]. The calculation formula is as follows:(3)Y3=1127n∑i=1nPti.In the formula,Pti represents the pitch value, nrepresents the number of note fundamental frequency.(4) Average Strength Parameter Y4. Strength refers to the strength of the power generated by music. The soothing music has weak strength, while the more shocking music has strong strength [12]. The calculation formula is as follows:(4)Y4=∑i=1NUelm,iN,m=1,2,…,16.In the formula,Uelm,i represents the sound’s intensity factor; m represents the sort number of musical notes; and N indicates the total number of musical notes.(5) Energy Parameter of Musical Notes. Energy of musical notes refers to the sum of the product of the pitch and the length of a note. The calculation formula is as follows.(5)Y5=∑i=1npji×dji,j=1,2,…,16.In the formula,pji represents the pitch and length of i notes in trackj.


### 2.1.3. Features of Audio Frequency

Audio frequency is one of the important factors in music, which affects the rhythm of music. The faster the rhythm is, the more obvious the audio is, and the happier the music emotion will be. On the contrary, the music emotion is more dull or depressed [13]. Audio features are described from two aspects, the following part is a detailed analysis.Time domain characteristics are as follows.(1) Zero Crossing Rate Zn. Zero crossing rate refers to the frequency of the audio signal waveform passing through the zero level. Generally speaking, in a piece of music, the zero crossing rate of high frequency band will be higher; otherwise, the zero crossing rate will be lower. Through this parameter, we can well distinguish between unvoiced and voiced music. Generally, unvoiced music is mostly used in cheerful music, while voiced music is often used in low and deep music [14]. The zero crossing rate is calculated as follows:(6)Zn=∑m=1Nsgnsnxm−sgnsnxm−12N.In the formula,snxm represents the sign function of audio signal of xm and N represents the effective width of the window.(2) Range Mn. Range refers to the width of the waveform vibration of the audio signal. The more passionate the music is, the greater the audio amplitude is. The more soothing the music is, the smoother the audio amplitude is. The audio amplitude is described as follows:(7)Mn=∑m=n−N−1nxmwn−m=∑m=n−N−1nxmwn−m.In the formula,wn−mrepresents the moving window function.(3) Frequency Domain Characteristics. The frequency domain characteristics of audio include two parts: spectrum centroid Rt and spectrum flux Ft. The calculation formula is as follows:(8)spectrum centroidRt=∑n=1Nqtn×n∑n=1Nqtn,spectrum fluxHt=∑n=1NStn−St−1n2.In the formula,qtn represents the amplitude of the short-time spectrum of the t frame at frequency point n and Stn and Stn−1 represents the amplitude value of the spectrum at frame t at frequency n and n−1.Based on the above three types of 14 music emotional features, the feature vector is constructed to describe the emotional factors of a part of music or a piece of music. It is described as follows:(9)U=U1,U2,U3,U1=S1,S2,S,3S4,S5,U2=Y1,Y2,Y,3Y4,Y5,U3=Zn,Mn,Ct,Ft.In the formula,U1 represents acoustic features; U2 represents the characteristics of melody; U3 represents audio features; S1 represents the speed of speech; S2represents the pitch; S3 represents strength; S4represents sound quality; and S5 stands for pronunciation.


## 2.1.1. Acoustic Features

Acoustic factor is the most basic component of music. Music with different emotions has different acoustic features. The basic corresponding relationship is shown in Table1 [8].Table 1
The corresponding relationship between acoustic features and music emotion.
Acoustic featuresPronunciationTone qualitySpeech speedIntensityMean pitchPitch rangeHappyNormalBreathing sound, chirping soundFast or slowHighVery highVery wideHateNormalMumble, chest voiceExtremely fastLowExtremely lowSlightly widerAngerTightBreathing soundSlightly fasterHighExtremely highVery wideSadnessVagueResonance soundSlightly slowerLowSlightly lowerSlightly narrowFearClearShrill voiceVery fastNormalExtremely highVery wide


## 2.1.2. Melody Features

Melody is the overall beat and tune of music, which can be described by the following five characteristic parameters [9].(1) Balance Parameter Y1. Balance refers to the proportion of volume in the left and right channels. The calculation formula is as follows:(1)Y1=Pk−64127,k=1,2,…,16.In the formula,Pk represents the equilibrium value, Pk∈0∼127.(2) Volume Parameter Y2. Volume refers to the loudness of sound that can be heard by human [10]. The calculation formula is as follows:(2)Y2=V127.In the formula,Vrepresents the total volume loudness, and its range is V∈0∼127.(3) Pitch Parameter Y3. Pitch refers to the vibration frequency of the note fundamental frequency. Music with fast rhythm has fast vibration frequency; on the contrary, it has slow vibration frequency [11]. The calculation formula is as follows:(3)Y3=1127n∑i=1nPti.In the formula,Pti represents the pitch value, nrepresents the number of note fundamental frequency.(4) Average Strength Parameter Y4. Strength refers to the strength of the power generated by music. The soothing music has weak strength, while the more shocking music has strong strength [12]. The calculation formula is as follows:(4)Y4=∑i=1NUelm,iN,m=1,2,…,16.In the formula,Uelm,i represents the sound’s intensity factor; m represents the sort number of musical notes; and N indicates the total number of musical notes.(5) Energy Parameter of Musical Notes. Energy of musical notes refers to the sum of the product of the pitch and the length of a note. The calculation formula is as follows.(5)Y5=∑i=1npji×dji,j=1,2,…,16.In the formula,pji represents the pitch and length of i notes in trackj.


## 2.1.3. Features of Audio Frequency

Audio frequency is one of the important factors in music, which affects the rhythm of music. The faster the rhythm is, the more obvious the audio is, and the happier the music emotion will be. On the contrary, the music emotion is more dull or depressed [13]. Audio features are described from two aspects, the following part is a detailed analysis.Time domain characteristics are as follows.(1) Zero Crossing Rate Zn. Zero crossing rate refers to the frequency of the audio signal waveform passing through the zero level. Generally speaking, in a piece of music, the zero crossing rate of high frequency band will be higher; otherwise, the zero crossing rate will be lower. Through this parameter, we can well distinguish between unvoiced and voiced music. Generally, unvoiced music is mostly used in cheerful music, while voiced music is often used in low and deep music [14]. The zero crossing rate is calculated as follows:(6)Zn=∑m=1Nsgnsnxm−sgnsnxm−12N.In the formula,snxm represents the sign function of audio signal of xm and N represents the effective width of the window.(2) Range Mn. Range refers to the width of the waveform vibration of the audio signal. The more passionate the music is, the greater the audio amplitude is. The more soothing the music is, the smoother the audio amplitude is. The audio amplitude is described as follows:(7)Mn=∑m=n−N−1nxmwn−m=∑m=n−N−1nxmwn−m.In the formula,wn−mrepresents the moving window function.(3) Frequency Domain Characteristics. The frequency domain characteristics of audio include two parts: spectrum centroid Rt and spectrum flux Ft. The calculation formula is as follows:(8)spectrum centroidRt=∑n=1Nqtn×n∑n=1Nqtn,spectrum fluxHt=∑n=1NStn−St−1n2.In the formula,qtn represents the amplitude of the short-time spectrum of the t frame at frequency point n and Stn and Stn−1 represents the amplitude value of the spectrum at frame t at frequency n and n−1.Based on the above three types of 14 music emotional features, the feature vector is constructed to describe the emotional factors of a part of music or a piece of music. It is described as follows:(9)U=U1,U2,U3,U1=S1,S2,S,3S4,S5,U2=Y1,Y2,Y,3Y4,Y5,U3=Zn,Mn,Ct,Ft.In the formula,U1 represents acoustic features; U2 represents the characteristics of melody; U3 represents audio features; S1 represents the speed of speech; S2represents the pitch; S3 represents strength; S4represents sound quality; and S5 stands for pronunciation.


## 2.2. Construction of Music Emotion Recognition and Classification Model

Based on the emotional features contained in the above music, this chapter uses the BP neural network to establish a recognition and classification model to realize the recognition and classification of music emotion.BP neural network is an intelligent algorithm that simulates the neural work of brain, which mainly includes three layers, and the classification processing is realized through the operation of each layer [15]. The recognition and classification model constructed by this algorithm is shown in Figure 2.Figure 2
Schematic diagram of construction and working principle of recognition and classification model.In Figure2, the model needs to be trained before practical application. The specific process is as follows: through feedforward operation of each layer, it can obtain the output result and subtract the output result from the expected result. When the difference between the two is less than the set threshold, the difference is propagated backward after training, and the process is repeated from output to input until the weight and threshold reach the optimal [16]. The purpose of the BP neural network training is to adjust and optimize the weights and thresholds of every two levels in the model. Therefore, the formula is given as follows:(1)
Connection weightwij and threshold θj between the first input layer and the second hidden layer, adjustment formula is as follows:(10)wijN+1=wijN+β⋅gjk·ciθjN+1=θjN+β⋅gjki=1,2,…,n,j=1,2,…,m,0<β<1..In the formula,gjk represents error value of the second layer; ci represents input feature vector; N represents iterations; and k represents the number of training samples.(2)
Connection weightvjt and threshold γt between the second hidden layer and the third output layer, adjustment formula is as follows:(11)vjtN+1=vjtN+α⋅ttk·yjγtN+1=γtN+α⋅ttkj=1,2,…,p,t=1,2,…,q,0<α<1..In the formula,ttk represents error value and yj represents the output value of the second layer node.After training of the model based on the BP neural network, the music emotion classification can be realized by inputting test music samples.


## 3. Example Analysis

In order to test the application effect of the multifeature recognition and classification algorithm in music emotion recognition of the music performance system, the following research takes MATLAB software as the algorithm operation platform, selects specific calculation examples, and carries out simulation test and analysis.Based on the five emotions of happiness, disgust, anger, sadness, and fear in Table1, this study constructs a simulation model of music emotion recognition process in the music performance system, as shown in Figure 3.Figure 3
Simulation model.As can be seen from Figure3, the example analysis steps based on the simulation model are as follows: firstly, input different music training samples in MATLAB software, secondly classify music emotion through the BP neural network emotion classifier and then determine the music performance lighting pertinently, so as to achieve the purpose of analyzing music emotion.


### 3.1. Sample Selection

The samples selected in the test come from three emotional corpora, namely, EMO-DB, Belfast, ande NTERFACE. According to the different emotions of the selected samples, the samples can be divided into five categories, and the specific distribution of the samples is shown in Table 2.Table 2
Distribution of test samples.
Emotional styleName of music segmentFeature dimensionSample attributeJoySegment ofThe Red Head Rope455Test sampleSegment ofIt Rains on Our Love355Test sampleSegment ofCarmen784Test sampleSegment ofThe Trout232Test sampleGriefSegment ofTheme From Schindler’s List534Test sampleSegment ofButterfly Lovers454Test sampleSegment of“Pathetique”234Test sampleSegment ofFarewell545Test sampleGentlenessSegment ofLullaby215Test sampleSegment ofBlue Danube waltz313Test sampleSegment ofLittle Star534Test sampleSegment ofFor Elise341Test sampleIndignationSegment ofPolonaise132Test sampleSegment 1 ofDestinies431Test sampleSegment ofThe Internationale453Test sampleEmpty Crazy315Test sampleFearSegment ofGloomy Sunday341Test sampleSegment ofOne Missed Call345Test sampleSegment ofThirteen Pairs of Eyes422Test sampleSegment ofStep by Step244Test sample


### 3.2. Neural Network Classification Model Training

Input the training samples in Table2 above into the neural network classification and recognition model for model training. The parameters of model training are set as follows: the number of nodes in the three-layer structure is 3-32-5; the maximum training times are set to 500 times; the target of convergence accuracy is less than 0.0002; tansig function is the transfer function of the hidden layer, and purelin function is the transfer function of output layer. The training page based on Simulink is shown in Figure 4.Figure 4
Training page of neural network recognition and classification model.It can be seen from Figure4 that the convergence accuracy of the classification model based on the neural network finally stabilizes at 0.000125, meeting the convergence accuracy target (the set convergence accuracy is less than 0.0002), indicating that the performance of the constructed model meets the needs of subsequent classification and can be used in the actual music emotional intelligence classification test.


### 3.3. Recognition Results of Melody Feature

Melody is the soul of music, and interval difference is the most basic element of melody movement. Interval difference refers to the formation of different melody combinations according to the differences between the high and low tones, so that people can perceive different musical images, thoughts, and emotions. Figure5 shows five examples of interval difference statistics for music with five different emotions: happiness, sadness, tenderness, anger, and fear.Figure 5
Statistical results of interval difference.Figure5 shows statistical results of interval difference. The smaller the interval difference, the higher the percentage of data, the more interesting and relaxed the main emotion of the music. The smaller the interval difference, the more intense and depressed the main emotion of the music. The frequent occurrence of large interval difference cannot increase the fluency of music, but will cause a sudden feeling. Therefore, in the main melody of music, there are also some differences in the ratio range of the same interval difference for music with different emotions.


### 3.4. Extraction Result of Audio Features

With the acceleration of music rhythm in the music performance system, the more obvious the audio is, and the more cheerful the musical emotion is expressed. On the contrary, the musical emotion is dull or depressed, and the extraction results of audio features are shown in Figure6.Figure 6
Extraction result of audio features.According to the analysis results in Figure6, the extraction area of a music audio feature is regular under a single emotion change, but the extraction area of audio feature is irregular under different emotion changes, which is consistent with the music emotion reflected by the actual rhythm.


### 3.5. Recognition Result of Spectral Flux

Spectral flux refers to the difference mean value of the spectrum of all two adjacent audio frames, which reflects the dynamic characteristics of the music signal. The music signal includes three parts: unvoiced, voiced, and mute, which determines that the spectrum flux of music has a large range of variation. The change of performers’ performance will also cause the change of spectrum flux. Therefore, the following takes music tracks containing multiple emotions as an example and carries out the spectrum flux identification test. The test results are shown in Figure7.Figure 7
Recognition result of spectral flux.According to the analysis result in Figure7, with the different changes of music emotions in the music performance system, the output spectral density shows an irregular change trend. The main reason is that, there are many emotional expressions in a music, and the music content (such as lyrics and background ect.) will affect the expression of emotion, which further leads to the irregular change of output spectral density.


### 3.6. Algorithm Evaluation Index

The kappa coefficient is the index to evaluate the performance of the algorithms. This coefficient is usually used to evaluate the consistency between the application results and the actual results of the algorithm, and its calculation formula is as follows:(12)k=po−pe1−pe.In the formula,po represents observation consistency rate; pe represents expected consistency rate; k∈−1,1, the larger the value of K, the better the consistency is, and the closer the algorithm application result is to the actual result. Generally speaking, when k≥0.75, the recognition and classification is more accurate. If <0.4, it indicates that there is a lack of consistency, and the accuracy of recognition and classification is poor.The test samples of Table2 are tested by inputting them into the training results in Chapter 2.2, and the classification results of output recognition are shown in Figure 8.Figure 8
Classification diagram of output identification.Based on Figure8, the test results are counted according to formula (12) to calculate the kappa coefficient. The results are as follows:(13)kjoy=0.855,kgrief=0.870,kgentleness=0.912,kindignation=0.825,kfear=0.811.In the formula,k1, k2, k3, k4, and k5 represent the kappa coefficients of happiness, sadness, tenderness, anger, and fear, respectively. The kappa coefficient K values calculated by this method are all greater than 0.75, which indicates that the recognition and classification results are in agreement with the actual results, that is, the application results of algorithm are close to the actual results, and the recognition and classification accuracy is high. Then, the research purpose is achieved.


## 3.1. Sample Selection

The samples selected in the test come from three emotional corpora, namely, EMO-DB, Belfast, ande NTERFACE. According to the different emotions of the selected samples, the samples can be divided into five categories, and the specific distribution of the samples is shown in Table 2.Table 2
Distribution of test samples.
Emotional styleName of music segmentFeature dimensionSample attributeJoySegment ofThe Red Head Rope455Test sampleSegment ofIt Rains on Our Love355Test sampleSegment ofCarmen784Test sampleSegment ofThe Trout232Test sampleGriefSegment ofTheme From Schindler’s List534Test sampleSegment ofButterfly Lovers454Test sampleSegment of“Pathetique”234Test sampleSegment ofFarewell545Test sampleGentlenessSegment ofLullaby215Test sampleSegment ofBlue Danube waltz313Test sampleSegment ofLittle Star534Test sampleSegment ofFor Elise341Test sampleIndignationSegment ofPolonaise132Test sampleSegment 1 ofDestinies431Test sampleSegment ofThe Internationale453Test sampleEmpty Crazy315Test sampleFearSegment ofGloomy Sunday341Test sampleSegment ofOne Missed Call345Test sampleSegment ofThirteen Pairs of Eyes422Test sampleSegment ofStep by Step244Test sample


## 3.2. Neural Network Classification Model Training

Input the training samples in Table2 above into the neural network classification and recognition model for model training. The parameters of model training are set as follows: the number of nodes in the three-layer structure is 3-32-5; the maximum training times are set to 500 times; the target of convergence accuracy is less than 0.0002; tansig function is the transfer function of the hidden layer, and purelin function is the transfer function of output layer. The training page based on Simulink is shown in Figure 4.Figure 4
Training page of neural network recognition and classification model.It can be seen from Figure4 that the convergence accuracy of the classification model based on the neural network finally stabilizes at 0.000125, meeting the convergence accuracy target (the set convergence accuracy is less than 0.0002), indicating that the performance of the constructed model meets the needs of subsequent classification and can be used in the actual music emotional intelligence classification test.


## 3.3. Recognition Results of Melody Feature

Melody is the soul of music, and interval difference is the most basic element of melody movement. Interval difference refers to the formation of different melody combinations according to the differences between the high and low tones, so that people can perceive different musical images, thoughts, and emotions. Figure5 shows five examples of interval difference statistics for music with five different emotions: happiness, sadness, tenderness, anger, and fear.Figure 5
Statistical results of interval difference.Figure5 shows statistical results of interval difference. The smaller the interval difference, the higher the percentage of data, the more interesting and relaxed the main emotion of the music. The smaller the interval difference, the more intense and depressed the main emotion of the music. The frequent occurrence of large interval difference cannot increase the fluency of music, but will cause a sudden feeling. Therefore, in the main melody of music, there are also some differences in the ratio range of the same interval difference for music with different emotions.


## 3.4. Extraction Result of Audio Features

With the acceleration of music rhythm in the music performance system, the more obvious the audio is, and the more cheerful the musical emotion is expressed. On the contrary, the musical emotion is dull or depressed, and the extraction results of audio features are shown in Figure6.Figure 6
Extraction result of audio features.According to the analysis results in Figure6, the extraction area of a music audio feature is regular under a single emotion change, but the extraction area of audio feature is irregular under different emotion changes, which is consistent with the music emotion reflected by the actual rhythm.


## 3.5. Recognition Result of Spectral Flux

Spectral flux refers to the difference mean value of the spectrum of all two adjacent audio frames, which reflects the dynamic characteristics of the music signal. The music signal includes three parts: unvoiced, voiced, and mute, which determines that the spectrum flux of music has a large range of variation. The change of performers’ performance will also cause the change of spectrum flux. Therefore, the following takes music tracks containing multiple emotions as an example and carries out the spectrum flux identification test. The test results are shown in Figure7.Figure 7
Recognition result of spectral flux.According to the analysis result in Figure7, with the different changes of music emotions in the music performance system, the output spectral density shows an irregular change trend. The main reason is that, there are many emotional expressions in a music, and the music content (such as lyrics and background ect.) will affect the expression of emotion, which further leads to the irregular change of output spectral density.


## 3.6. Algorithm Evaluation Index

The kappa coefficient is the index to evaluate the performance of the algorithms. This coefficient is usually used to evaluate the consistency between the application results and the actual results of the algorithm, and its calculation formula is as follows:(12)k=po−pe1−pe.In the formula,po represents observation consistency rate; pe represents expected consistency rate; k∈−1,1, the larger the value of K, the better the consistency is, and the closer the algorithm application result is to the actual result. Generally speaking, when k≥0.75, the recognition and classification is more accurate. If <0.4, it indicates that there is a lack of consistency, and the accuracy of recognition and classification is poor.The test samples of Table2 are tested by inputting them into the training results in Chapter 2.2, and the classification results of output recognition are shown in Figure 8.Figure 8
Classification diagram of output identification.Based on Figure8, the test results are counted according to formula (12) to calculate the kappa coefficient. The results are as follows:(13)kjoy=0.855,kgrief=0.870,kgentleness=0.912,kindignation=0.825,kfear=0.811.In the formula,k1, k2, k3, k4, and k5 represent the kappa coefficients of happiness, sadness, tenderness, anger, and fear, respectively. The kappa coefficient K values calculated by this method are all greater than 0.75, which indicates that the recognition and classification results are in agreement with the actual results, that is, the application results of algorithm are close to the actual results, and the recognition and classification accuracy is high. Then, the research purpose is achieved.


## 4. Conclusion

In order to achieve the effect of stage performance, generally in the process of performance, the light will change with the artistic conception created by the performance under the control of the music performance system. Therefore, it can be seen that music emotion recognition is crucial to the lighting control. Based on this, this paper proposes an intelligent music emotion recognition and classification algorithm in the music performance system. The following conclusions are drawn from the study:(1)
The proposed algorithm mainly extracts emotional features from music, and then inputs them into the constructed recognition and classification model so as to clarify the emotion to be expressed in music and control the lighting.(2)
This study verifies the algorithm’s performance by an example that proves the proposed algorithm can accurately recognize the music interval difference. The extraction area of audio feature is regular, and the output spectral density shows an irregular change trend, which is consistent with the actual trend of music expression. The kappa coefficient values are greater than 0.75, indicating that the recognition and classification results are in good agreement with the actual results, and the research goal is achieved.(3)
However, this study did not apply the algorithm to the actual music performance system and lacks some practical application, which needs to be further verified and analyzed in the future.



---

*Source: 7886570-2021-11-12.xml*