Effective prediction on music therapy using hybrid SVM-ANN approach

. In this world, people are moving with lightning speed. Stress has become a usual thing we experience in our day to day routine. Some factors like work tension, emotional obstacles, brutality, etc lead to stress. Many health issues like headaches, heart problems, depression, etc and psychological issues arise in human beings due to stress. Music therapy gives qualitative results in balancing the physical and psychological issues. Music therapy is an expressive type of art therapy. There are many beneficial effects achieved through music therapy like relaxation, maintain blood pressure level, cure on medical disorders, stability in mood, and improve memory and sleep. Here we aimed to establish the main predictive factors of music listening’s relaxation and the prediction of music for music therapy using various machine learning algorithms such as Decision tree, Random Forest, Artificial Neural Network (ANN), Support Vector Machine (SVM) and hybrid of SVM - ANN algorithm. The accuracy of these different methods is critically examined with the help of the accuracy performance metric. Various factors like age, gender, education level, music choice, visual analog scale score before and after listening to music for both individual and therapist suggestions on music are considered for prediction. Our study revealed that SVM-ANN hybrid classifier performance is much better than other machine learning algorithms.


Introduction
There are several practices to balance psychological health of an individual like speech counselling, music therapy, yoga, exercise etc. But Music play a vital role in day to day life. One can hear music at any place at any time they feel. Music has the power to reduce one's mood swings and make them stable [7]. Some researchers made research in the importance of music listening. Many health issues can be addressed through music therapy. The patients those who undergo regular medication experience pain both physically and psychologically.
Faus and Matas research study is concentrated on how much ability does music helps one to regain after a stressful stimulus. Research has concluded that 20.84% of students to suffer anxiety when facing exams. usually, a person who experiences stress is subjected to many mood issues such as anxiety, lack of motivation, overwhelm, irritability, sadness [16,17]. The research applied to students who experience stress with concern to exams.
These items were arranged based on two factors such as positive affect and negative affect. They infer that listening to music should be considered as part of a complex music-based psychological intervention for anxiety and also indicate that listening to music imitating nature than any other imitating features improves a positive mood in person and reduces their negative mood after a stressful academic experience. [1,2]. Experimental study has been made in the field of listening to self chosen music after stress exposure improves mental balance [3,4]. Cancer patients may result in extensive emotional and physical suffering and music can ease symptoms and treatment side effects [13]. This is an comparative and accessibility study on effects of music therapy and music medicine interventions for psychological and physical outcomes in people with cancer. The results are obtained that music has beneficial effect to handle emotions and also have a less effect on heart rate, respiratory rate and blood level [14,15]. Music genres are considered as the top level descriptors used to organize music files [9].
The researcher Raglio made a study on predicting the effectiveness of music therapy. Here the effectiveness of music is predicted based on the positive effect, negative effect and neutral effect on people after listening to music and also the predictive factors that are associated with music is also determined. Two approaches such as individual choice of music and music based on therapeutical aims [5]. All these studies are concerned with music effects in physical and psychological beneficial aspects of human. But there is any beneficiary prediction on predicting the music for music therapy that associated with personal factors too. Maximum results prove that music has the ability to improve mental health but the music prediction is undetermined. So in our study we predict the music for music therapy on people which associated various personal factors. It helps people and therapist to determine the music and proceed with the practice and get better improvement. Various machine algorithms are implemented for prediction and a comparative analyse is carried and the best performing algorithm is chosen for the prediction.
Our study mainly concentrates on predicting the choice of music for music therapy with concern to personal factors and therapeutically aims and also make a comparative study on various machine learning algorithm such as decision tree, random forest, Support vector machine, artificial neural network, and hybrid SVM -ANN. We introduce a hybrid model to improve its accuracy in prediction whereas the disadvantage of individual model could be overcome through ensemble. From this music prediction, therapist and people can listening to music which gives better outcomes. Here personal factors like age, gender, education level, music interest, self choice of music, therapist choice of music and therapeutical aims such as Visual Analog Scale [VAS] Score before and after listening to music are considered as the attributes. Classification and prediction on music choice is processed in this study.

Aim and research hypotheses
The main aim of the present study was to use hybrid SVM -ANN classifier to investigate how personal factors like age, gender, education level, music practice, choice of music, and visual analog scale score before and after listening music can predict and classify the music choice for music therapy. And we also aim to analyze the accuracy performance of various machine learning techniques like decision tree, random forest, Artificial Neural Network, Support Vector Machine, and hybrid SVM-ANN in this prediction.

Methodology
The figure1 illustrates the proposed model of the system. The music choice for music therapy is predicted concerning various personal factors and therapeutic results and also we analyze the performance of various machine learning techniques used in our approach. The necessary attributes are identified for the research.  The figure 2 illustrates the first five instances from our dataset. For preparing a dataset we collected the information about cause and effects on music therapy from the people. We determined the attributes through the feedback from the people on what are the factors that takes determined place in music prediction. Through collection we received instances of about 2500 instances. There are ten attributes involved in the prediction they are age, gender, education level, music interest, self choice of music, therapist choice of music, visual analog scale score before and after listening to music on both preference of music. The age is an integer, gender, education, music interest, self music are categorical with possible value male, female and others, non-graduate and graduate, no or yes, music classification under class, hiphop and pop respectively. In Figure 3, the feature importance score of the features is depicted. The age attribute contributed more than any other attribute. This feature importance illustrates the important factors that are involved in the classification and prediction of music dataset. This importance feature differentiated through relative score on which feature may be most applicable to the target attribute and the vice versa on least applicable. This would be beneficial for those gather data on specific area. The data are collected from various people and loaded into a dataset. The dataset is pre-processed and used in classification algorithm. Pre-processing is the process of converting the raw data into feasible data. Here the data are converted from string data type to numeric data type. For example, gender has two choices male and female where it is converted into 0-male and 1-female in preprocessing data transformation. Now the dataset is fed into various machine learning algorithm for classification and prediction of music. In this process the dataset is randomly divided into two parts such as a training dataset and a testing dataset which is 70% and 30% respectively. Here the comparative analysis is done between the machine learning classifier algorithms such as decision tree, random forest, SVM, ANN, hybrid SVM-ANN based on their performance accuracy.

Machine Learning Techniques
Machine learning techniques are data analytic techniques that train computers to learn from experience. These algorithms learn information directly from the data. There are various machine learning techniques. Here five different algorithms were used for analysis and comparison.

Decision tree
The Decision tree classifier is supervised learning that continuously split according to a certain parameter. This classifier can be used for both regression and classification [6]. Nodes and leaves are the entities that are used to build a decision tree.
The data is split through nodes and leaves are the outcomes. The implementation of decision tree occurs in such a way like the best attribute in the dataset is placed at root and splitting process is carried further like subset contains data. This process is repeated until leaf node occurs. Decision tree can be easily visualized and can be interpreted. The decision tree algorithm can be implemented using various algorithms such as ID3, CART, CHAID, MARS etc. In this study we build the model using CART algorithm which using gini index criterion for classification. LabelEncoder() function is used to convert the string data to the numeric values. Then the x and y variables are defined with the dataset whereas y assigned to the target attribute and x assigned to remaining attributes in the dataset. Now the data is spilt into training and test data with 70% and 30% respectively. The x and y variables are also assigned in accordance with test and training data as like x_train, x_test, y_test,y_train. The model is build with gini index criteria classifier. The decision tree classifier insist features like max_depth, max_features, max_leaf_nodes, min_impurity_split, min_sample_leaf, min_weight_fraction_leaf, presort, random_state, splitter etc. After the classification, prediction y_pred is applied with x_test dataset. Missclassified samples are identified and confusion matrix is built with y_test and y_pred. At the end decision tree is visualized.

Random Forest
The Random Forest is a supervised learning classification model that consists of many decision trees. Here bagging and feature randomness are used for building the tree and the prediction is more accurate than any individual tree. This algorithm creates decision trees on data samples and finally selects the best solution from the prediction on each tree using a voting strategy. The string attributes in dataset is converted into numeric values using labelencoder(). The dataset is split into train and test dataset percentage of 70% and 30% respectively. The classifier in this model is random forest classifier which has parameters n_estimators and the random state. In this model n_estimators is assigned to 10 and random_state to 30. The classifier is set fit to the x_train, y_train variables. With the x_test variable the prediction is processed and set to y_pred in random forest model. On comparing the test and prediction variable accuracy is determined. Confusion matrix is also visualized. New instances can also be fed and results can be obtained. Finally, the model predicts the music choice for music therapy.

Support Vector Machine
Support vector machine(SVM) is supervised learning which uses data points and creates a hyperplane that separates the tags. The standard SVM is used at binary classification but it can also be used for multiclass classification with one against one approach. The one versus one approach can be implemented with C-Support Vector Classification (SVC) algorithm which is based on libsvm. The dataset is divided into train and test data with 70% and 30% respectively [8]. The mathematical formulation provides a nonparametric clustering algorithm where it does not make any assumptions and works very fine to low dimensional data. This algorithm explores the parameter space starting from low value of gamma and high value of C with no outliers occurs. Then is it iteratively decreased on gamma to look for clusters. The data points are mapped from data space to ahigh dimensional features space using the kernel function [10]. The various parameters involved in the model are C, kernel(linear), gamma, coeff, degree, verbose, function shape etc. The SVM-SVC model predicts the choice of music for music therapy. New instances can also be fed and can obtain the prediction result. Confusion matrix is built and performance of the model is obtained.

Artificial Neural Network
Artificial Neural Network (ANN) is either supervised or unsupervised learning. This algorithm is used to model complex patterns and non-linear relationships. There is no restriction on input variables. ANN has its ability to learn hidden relation is data. The training process consists of forward and backward propagation. In ANN forward propagation is the inputs are taken with multiple weights and passed through a sigmoid function to obtain neuron output. Back propagation is for error calculation. The process is iterated for many iterations. The dataset is divided into test and train data in percentage of 30% and 70% respectively. x_train, x_test, y_train, y_test parameters are used to store the test and training data for classification and prediction. The Multilayer Perceptron classifier optimizes the log-loss function using stochastic gradient descent. In the hidden layer the ith element gives the number of neurons in hidden layer. The rectified linear unit function is used as the activation function for the hidden layer and adam is used as solver for weight optimization and other parameters such as 'L2' penalty, alpha, learning rate are defined in the MLP classifier. If there is no any training loss for consecutive 10 iterations the iteration will be stopped. We can give any new instances and get the prediction of music as the result. The music choice is predicted and the confusion matrix is built which gives the performance measure of the model.

Hybrid SVM-ANN
Despite the disputes between SVM and ANN, their hybrid can prove to be the best classifier to solve problems. The hybrid machine learning could accumulate the advantages of standard algorithms and at the same time, they avoid their weaknesses to obtain the predictive target [11,12]. This hybrid technique is possible by dividing the process into two and apply it with respective algorithm. First labelencoder() is used to transform the string into numeric data. Total 9 attributes are used to classify the target attribute. Here by using the linear SVM the important features are extracted (i.e. Feature Extraction is carried out through SVM). The linearSVC uses one vs the rest strategy and the class supports both sparse and dense input to multiclass support. The parameters used in linearSVC are penalty, C value, dual. The penalty specified the norm where 'l2' is a standard one but 'l1' penalty is used in our model which leads to coefficient vectors that are sparse, the default loss function is squared_hinge, C parameter is the regularization parameter which must be positive, dual parameter is used for selecting the algorithm with correspondence to dual or primary optimization problem. In our model we prefer dual as False because our dataset has n_samples>n_features. The features are extracted and prepared to fed into the final ANN model. The extracted feature consists of 6 attributes used for classification. The extracted feature attributes are age, self-selected music choice, VAS score before and after listening to both type of music. (i.e. self choice and therapist choice) and now the extracted features in the dataset is fed into the ANN model which uses MLP classifier to predict the music preference for music therapy. The dataset is divided into test and train data in percentage of 30% and 70% respectively. x_train, x_test, y_train, y_test parameters are used to store the test and training data for classification and prediction. The Multilayer Perceptron classifier optimizes the log-loss function using stochastic gradient descent. In the hidden layer the ith element gives the number of neurons in hidden layer. The rectified linear unit function is used as the activation function for the hidden layer and adam is used as solver for weight optimization and other parameters such as 'L2' penalty, alpha, learning rate are defined in the MLP classifier. The music choice is predicted and the confusion matrix is built which gives the performance measure of the model. We can give any new instances and get the prediction of music as the result.

Result and discussion
There is a difference between the confusion matrix on binary classification and multi classification category in machine learning. Table 1 depicts the confusion matrix for multiclassification model. This illustrates the confusion matrix calculation based on three categories as such as in this study's target attribute. In our dataset there are three class labels namely, classical, hiphop and pop. There is no positive or negative classes here instead for this classification the true positive, true negative, false positive, false negative are determined for each of the classes. Actual and predicted determines the deviation in the target attributed what we expected and what we obtained. True shows that both expected and obtained result is same other false represents the deviation from expected. score. From the study results, the hybrid approach is resulted with the higher accuracy than other models.

Conclusion and Future work
This paper proposed a classification and prediction on music choice for music therapy. The classification of music includes how personal factors and therapist aims determine the music choice. This paper also deals with comparative study on machine learning algorithms like decision tree, random forest, support vector machine, artificial neural network, hybrid SVM-ANN. The importance of music therapy and its beneficiary effects on both physical and mental health is taken on this research. Combining of two model will result in better performance than individual model. Music therapist could able to select or prefer music which concern their therapeutic aims and apply it on practicing mental betterment in people.
Further improvement in this research can be applied on playing the audio files that possess music for therapy after the prediction through automation. and dance as gait rehabilitation in patients with parkinson disease: a review of evidence." Journal of geriatric psychiatry and neurology 32.