International Conference on Intelligent Computational Systems (ICICS'2012) Jan. 7-8, 2012 Dubai

Artificial Neural Network (ANN) Approach for an Intelligent System: A Case Study in Carnatic Classical Music (CCM)

Prof. Dr. P. K. Srimani and Y. G. Parimala

crucial for the purpose. Abstract—ANNs are invaluable in cognitive studies of Particular care has been taken to set up the same. In intelligent, knowledge- based systems. The immense features addition a sensitivity analysis of the input data has been of ANN makes it very attractive for a wide range of made to study the effects of variation in the various applications. In the present paper a unique ANN approach for inputs on the expected output values. The experimental studying cognitive aspects of CCM has been undertaken for a typical case of ‘tonic- shifting’ CCM uses a heptatonic scale of results are presented and discussed. seven notes – S,R,G,M,P,D, N. Variants in notes result in 72 heptatonic scales.‘Tonic-shift’.is a phenomenon where staying II. ARTIFICIAL NEURAL NETWORKS AND in the domain of an original scale, new scales are obtained by COGNITION shifting the base pitch from S to other notes of the original ANNs have massive parallelism, high connectivity, . This was studied using Multilayer percepteron(MLP) and linear regression(LR), varying number of hidden layers, which tries to emulate the Biological neurons and their processing conditions, learning algorithms. Input data was synapses. NNs are especially useful for classification frequencies in each heptatonic scale before and after tonic and function approximation/mapping problems. The shifting. 100% accurate results were obtained. Sensitivity networks use Input/Out put layers and none or few analysis was performed to study effects of inputs on results. hidden layers (HLs). Every hidden and output unit has its own bias term Learning algorithms can be supervised Keywords— Cognitive, Heptatonic, Multi-layer or unsupervised. In supervised learning, the correct Percepteron, Tonic shift. results (desired outputs) are known and are given to the NN during training so that the NN can adjust its weights I. INTRODUCTION to try match its outputs to the target values. After OR the first time in literature, ANN approach has training, NN is tested by giving only input values, to see F been used to study the tonic-shift(TS) phenomenon how closely it predicts target values. LM, Momentum in CCM. Some of the previous pioneering work on TS Step are common learning algorithms. Performances of are found in some papers [11]-[15]. Recently, “Pattern different network topologies can be compared by recognition and unique Raga classification and evaluating the error function. Various networks are identification using artificial network” was studied by trained by minimization of an appropriate error function the authors[15]. Scales() in CCM are theoretically defined with respect to a training data set. Performance infinite and the complex phenomenon of TS needs of networks are compared by evaluating the error extensive research. Hence a new dimension of approach function using an independent cross- validation(CV) set. has been considered using ANN which throws new light Network having smallest error with respect to CV set is on both the concerned case study as well as the selected (hold out method). Performance of the selected performances of different networks in such studies. network is confirmed using a third independent set of ANN can have various architectures, which require data called a test set to avoid overfitting [1]-[5]. different types of algorithms [1], [2]. In the present paper we have chosen MLP and LR networks. The A. Multilayer Percepteron )MLP) cases of one or two hidden layers, using batch and MLP has one or more HLs with a linear combination online processing, and Levenberg-Marquardt (LM) or function is the inner product of inputs,weights and a momentum algorithms have been investigated in detail. bias. Activation function is logistic or tanh function. Proper setting of input data and expected results is very Inputs are fully connected to the first HL, each HL is fully connected to the next, and the last HL is fully Prof. Dr. P. K. Srimani, F.N.A.Sc is with R&D (CS), Bangalore, connected to the outputs. MLPs use supervised learning INDIA; As Director; Y. G. Parimala, M.E.(Canada), (Ph.D) is with City Engg College, or backpropagation. Designing and training an MLP VTU, Bangalore, INDIA Phone:9341212972, (e-mail: requires i) selecting number of HLs, ii) number of [email protected]).

101 International Conference on Intelligent Computational Systems (ICICS'2012) Jan. 7-8, 2012 Dubai neurons to be used in each HL, iii)avoiding local ascending order of frequencies. It is not equitempered minima, iv)converging to an optimal solution in a scale like the Western, since notes have varying ratios reasonable period of time, v)validating NN to test for with their successive notes. Two notes S and P are overfitting. MLPs are used in classification problems, inherently stable with no variants. The remaining 5 in fitness approximations[3],[4]. notes R,G,M,D,N have variants. M has 2 variants -M1 and M2. They result in 12 semitones as shown in B. Linear-Regression TABLE I. These details have been discussed by the Linear regression assumes that expected value of the authors in previous papers [13]-[15] output given an input, is linear. BAYES rule is used to Delineation of the 7 notes in a particular flow, with S obtain posterior distribution for given data. Maximum- as the base pitch gives the melodious expressions called likelihood estimation helps in predictions [3]-[5]. RAGA, which depends on creativity and proficiency of the musician. In CCM a full scale (heptatonic) [9] –[15] III. TONIC-SHIFT-PROPERTY consists of all the 7 notes in both ascending and CCM is a highly scientific and evolved form of descending called a ‘melakartha’(‘Janaka’) raga if i)all classical music which uses a heptatonic scale of seven the 7 notes in ascending and descending are identical notes symbolically given as S,R,G,M,P,D,N in TABLE I RELATIVE FREQUENCIES OF THE 12 SEMITONES [6]-[8],[15] S R1 R2 G2 G3 M1 M2 P D1 D2 N2 N3 1 256/243 9/8 192/162 81/64 4/3 729/512 3/2 128/81 27/16 16/9 243/128

ii)frequencies occur in order. Exactly 72 such scales shifted to every note present in a given scale. The new are possible. They are given characteristic names and scales generated were verified to evaluate if a new valid are serially arranged in a table. This is found extensively raga was obtained. Since there are 72 scales, TS to in literature and in previous papers of the authors[6]-[8], remaining 6 notes of each scale theoretically gives 432 [13]-[15]. Beauty of a raga delineation takes a new combinations. But only 122 of these are valid scales. dimension when performer sings or plays another raga Hence a total of 194 exemplars were used as inputs. by staying in the domain of the original raga. This is 100% accurate results were obtained with MLP and LR possible by temporarily shifting the reference note to a models,using LM and momentum learning, 2 HLs. new note existing in the original raga. Hence all the Sensitivity analysis was performed to study the effects of remaining semitones will take different relative values the inputs on target values. MLP used here was hetero- leading to a new raga. This is called ‘tonic-shift’. Every associative, supervised learning since correct results such shift may not give a new raga. For eg 29th (desired outputs) were known, so that during training the melakartha raga called ‘DhiraShankarabharana’. has NN could adjust its weights to match its outputs to the scale S, R2,G3,M1,P,D2, N3., i.e., relative target values. After training, NN was tested giving only frequencies are 1 9/8 81/64 4/3 3/2 27/16 and 243/128. input values LR method allows user to test a network on Shifting reference from S to R2 makes the frequency a chosen data set Best network weights were used to ratios of R2, G3, M1,P,D2,N3 and upper octave S,=1, minimise CV error. 9/8 192/162 4/3 3/2 27/16 and 16/9 respectively. This corresponds to another new raga (the 22nd raga ‘’). Continuing the process of shifting to various notes give raise to 4 other ragas using G3, M1, P and D2 as reference, [11]. When reference is shifted to N3, relative frequencies give rise to both M1 and M2 in the new scale which does not correspond to any valid scale. Fig 1 Multilayer Percepteron (MLP) model IV. FORMULATION OF THE PROBLEM V. EXPERIMENTS AND RESULTS CCM being highly scientific, shows very interesting phenomena which are intriguing researchers from a The present paper concerns with the study of an long time. One such phenomenon known as modal tonic intelligent system to analyse the performance of MLP shifting exhibited by ragas of CCM have been and LR for a classification and regression problem. A investigated in the present paper using ANN. MLP and case study was taken up to study the unique LR models were constructed using inputs of frequencies phenomenon of tonic shifts in CCM. Input data present in all possible heptatonic ragas of CCM. consisted of relative frequency ratios of the notes in Applying TS on them, frequencies of the base pitch was heptatonic scales and their TS. MLP neural network was constructed with one and two HLs and studied for

102 International Conference on Intelligent Computational Systems (ICICS'2012) Jan. 7-8, 2012 Dubai online/batch processing. LM and momentum learning network, MLP-2-O-M is also shown. Very good rules were used. About 194 exemplars were used out of correlation was obtained for this network Highest which 70% was used for training,10% for (CV), 20% for accuracy of 97-100% was obtained for LR-0-B-L/MLP- testing. 1000 epochs ( iterations) were used. 2-O-M NNs. Classification and Regression reports were generated. A sensitivity analysis (SA) was performed on the These results are shown in TABLES II,III and results. SA is a valid tools for characterizing fig.2.Regression gave a plot of network output and uncertainty associated with a model. It orders by desired output for each value and correlation importance the strength and relevance of inputs to coefficient. Classification Report gave the mean- determine the variation in output. In the present study squared error (MSE), normalized mean-squared error SA gives an idea of strengths of input data for each (NMSE), mean absolute error (MAE), minimum note to assess expected variations in predicted output as absolute error, maximum absolute error (MAE), shown in fig 2e. Input for notes M1/M2 show highest correlation coefficient (r) for each output. and percent sensitivity, indicating that they have maximum effect on correct for each class. Bread boards generated for each outputs. Small variations in their values are crucial for model are shown. Increasing number of HLs show an performance of the network [10]. TABLE V shows all improvement in performance, as seen in plots for MLP- possible TS in the 72 scales. 1-B-L and MLP-2_B-L. Plots for best performing TABLE II REGRESSION REPORT USING VARIOUS NETWORK TOPOLOGIES-SUMMARY OF ALL NETWORKS Performance Metrics Training Cross-validation Testing Model Name MSE MAE MSE MAE MSE MAE MLP-1-O-M (Multilayer Perceptron) 0.004466 0.05539 0.028609 0.100654 0.030667 0.081701 LR-0-B-M (Linear Regression) 0.074342 0.25253 0.08359 0.265459 0.086609 0.265801 LR-0-B-L (Linear Regression) 0.017625 0.08905 0.011751 0.099399 0.052861 0.121614 MLP-1-B-L (Multilayer Perceptron) 0.002388 0.046033 0.002112 0.041999 0.030918 0.073661 MLP-2-B-L (Multilayer Perceptron) 0.004354 0.046472 0.002721 0.045646 0.026967 0.062999 MLP-1-B-M (Multilayer Perceptron) 0.005839 0.05309 0.001913 0.039991 0.030269 0.073234 MLP-2-O-M (Multilayer Perceptron) 0.015354 0.069904 0.007904 0.072239 0.02634 0.077103 MLP-2-B-M (Multilayer Perceptron) 0.207242 0.451186 0.213545 0.458311 0.20321 0.447374

Summary of Best-Performing Networks- MLP-2-O-M Training Cross-validation Testing # of Rows 136 19 39 MSE 0.015354 0.007904 0.02634 Correlation (r) 0.973435 0.997207 0.942989 Min Absolute Error 0.000303 0.002822 0.000691 Max Absolute Error 0.887739 0.183166 0.904622 Mean Absolute Error (MAE) 0.069904 0.072239 0.077103 TABLE III CLASSIFICATION REPORT USING VARIOUS NETWORK TOPOLOGIES-SUMMARY OF ALL NETWORKS Performance Metrics Training Cross-validation Testing Model Name MSE Correct MSE Correct MSE Correct MLP-1-O-M (Multilayer Perceptron) 0.003094 80.88% 0.001995 73.68% 0.029044 74.36% LR-0-B-M (Linear Regression) 0.070432 98.53% 0.07918 94.74% 0.081829 97.44% LR-0-B-L (Linear Regression) 0.017624 96.32% 0.011717 100.00% 0.052879 97.44% MLP-1-B-L (Multilayer Perceptron) 0.00374 55.15% 0.007399 78.95% 0.02764 51.28% MLP-2-B-L (Multilayer Perceptron) 0.00601 86.76% 0.0066 89.47% 0.055379 89.74% MLP-1-B-M (Multilayer Perceptron) 0.009176 72.06% 0.001234 84.21% 0.026362 69.23% MLP-2-O-M (Multilayer Perceptron) 0.016996 97.79% 0.004342 100.00% 0.019787 97.44% MLP-2-B-M (Multilayer Perceptron) 0.15209 86.03% 0.163527 84.21% 0.132283 97.44%

Summary of Best-Performing Networks- LR-0-B-L Training Cross-validation Testing # of Rows 136 19 39 MSE 0.017624 0.011717 0.052879 Correlation (r) 0.963125 0.980887 0.903951 # Correct 131 19 38

103 International Conference on Intelligent Computational Systems (ICICS'2012) Jan. 7-8, 2012 Dubai

# Incorrect 5 0 1 % Correct 96.32% 100.00% 97.44%

MSE versus Epoch

1 0.9 0.8 Cross 0.7 Best Networks Training Validation 0.6 Training MSE 0.5 Epoch # 887 137

MSE Cross Validation MSE 0.4 0.3 Minimum MSE 0.042847265 0.084010713 0.2 Final MSE 0.042847265 0.131476245 0.1 0 1 6 11 16 21 26 31 36 41 46 51 56 61 Epoch

Cross Best Networks Training Validation c) Epoch # 61 31 Minimum MSE 0.006172173 0.026682953 Final MSE 0.006172173 0.031613549

a) d)

MSE versus Epoch Sensitivity About the Mean

0.9 0.6 0.8 0.7 0.5 0.6 0.5 Training MSE 0.4

MSE 0.4 Cross Validation MSE 0.3 0.3

0.2 Sensitivity 0.2 0.1 0 0.1 1 100 199 298 397 496 595 694 793 892 991 Epoch 0 SRGMPDN Best Cross Input Name Networks Training Validation Epoch # 350 160 e) Min. MSE 0.044682549 0.102420782 M1 Final MSE 0.044682549 0.114473965

M2

SETS of 6 b) Ragas Locations MSE versus Epoch within 0.9 0.8 the sets 0.7 0.6 0.5 Training MSE

MSE 0.4 Cross Validation MSE 0.3 0.2 0.1 0 1 100 199 298 397 496 595 694 793 892 991 Epoch

Fig 2 Testing On Individual Network Topologies a) MLP-1-B-L b) MLP-2-B-L c) MLP-2-O-Md) LR-0-B-L e) Sensitivity Analysis (Bread boards for the networks are shown)

104 International Conference on Intelligent Computational Systems (ICICS'2012) Jan. 7-8, 2012 Dubai

TABLE IV ALL POSSIBLE TONIC SHIFTS ON THE 72 HEPTATONIC SCALES

RAGA NO R G M P D N RAGA NO R G M P D N 1 51 0 0 0 0 0 sAlaga 37 0 0 0 0 0 0 2 53 0 19 0 0 0 jalArnava 38 0 0 0 0 0 0 ganamurthi 3 54 0 55 0 0 0 JAlavarAli 39 0 0 0 0 0 0 vanaspathi 4 0 0 25 0 0 0 navanIta 40 0 0 0 0 0 0 manavathi 5 0 0 61 0 0 0 41 0 0 0 0 0 0 tanarupi 6 0 0 0 0 0 0 Raghupriya 42 0 0 0 0 0 0 7 63 0 0 0 17 0 gavAmbhodi 43 0 0 0 0 18 0 hanumathodi 8 65 28 20 0 29 22 44 0 34 0 0 30 0 9 66 0 56 0 35 0 45 0 0 0 0 36 0 10 0 64 26 0 0 23 shadvidhamArgini 46 0 70 0 0 0 0 11 0 0 62 0 0 0 suvarNAngi 47 0 0 0 0 0 0 12 0 0 0 0 0 0 48 0 0 0 0 0 0 13 69 0 0 0 0 0 dhavalAmbari 49 0 0 0 0 0 0 vakulabharana 14 71 0 21 0 0 58 nAmanArAyani 50 0 0 0 0 0 0 15 72 0 57 0 0 0 kAmavardhini 51 0 0 0 0 0 1 chakravaka 16 0 0 27 0 0 59 ramamanohari 52 0 0 0 0 0 0 suryakantha 17 0 7 63 0 0 0 53 0 19 0 0 0 2 hATakambhari 18 0 43 0 0 0 0 vishvambari 54 0 55 0 0 0 3 jhenkaradhwani 19 0 0 0 2 53 0 shyAmalAngi 55 0 0 0 3 54 0 20 0 29 22 8 65 28 56 0 35 0 9 66 0 21 0 0 58 14 71 0 simhEndramadhyama 57 0 0 0 15 72 0 kharaharapriya 22 8 65 28 20 0 29 58 14 71 0 21 0 0 gowrimanohari 23 10 0 64 26 0 0 hEmavathi 59 16 0 0 27 0 0 varunapriya 24 0 0 0 32 0 0 nIthimathi 60 0 0 0 33 0 0 mAraranjini 25 0 0 0 4 0 0 kAnthAmani 61 0 0 0 5 0 0 chArukeshi 26 0 0 23 10 0 64 62 0 0 0 11 0 0 27 0 0 59 16 0 0 lathAngi 63 0 0 0 17 0 7 harikAmboji 28 20 0 29 22 8 65 64 26 23 0 0 10 0 DhIrashankarabharana 29 22 8 65 28 20 0 mEchakalyAni 65 28 20 0 29 22 8 30 0 44 0 34 0 0 66 0 56 0 35 0 9 31 0 0 0 0 0 0 67 0 0 0 0 0 0 32 0 0 24 0 0 0 jyotiswarUpini 68 0 0 0 0 0 0 gAngeyabhushini 33 0 0 60 0 0 0 dhAthuvardhini 69 0 0 0 0 0 13 vAgadhiswari 34 0 0 30 0 44 0 nAsikabhushini 70 0 0 0 0 46 0 35 0 9 66 0 56 0 kOsala 71 0 21 0 0 58 14 36 0 45 0 0 0 0 72 0 57 0 0 0 15

[6] Venkatamakhi, “Chaturdandi Prakashike”, Tr.by Satyanarayana, R., VI. CONCLUSIONS Bangalore University, 1978 [7] Ramaratnam,V. “Sangeetha Deepike”, D.V.K.Murthy, Mysore, 2000 A unique ANN approach was used in CCM to study the [8] Raja Rao, L. “Sangita Shastra Chandrike, Sri Srinivasa Sangita phenomenon of tonic shifting using MLP and LR with 1or Kalasale, Bangalore, 1975 [9] Edwin H.Barton, “A text Book on Sound”, Macmillian and Co., 2 HLs, online/batch processing. 97-100% accuracies were London, 1932 obtained with MLP with 2 HLs and LR with 1 HL and [10] Srimani,P.K.’ Innovative computational techniques applied to momentum learning rule. Sensitivity analysis gave useful Ancient Indian Sciences’, Proc., Int.Conf., Systems, Informatics and cybernetics, PENTAGRAM, Hyderabad, 2007 information on the sensitivity of output variations for [11] Srimani P.K. ‘A novel mathematical approach to pattern recognition different input data. Regression and classification reports in ’, Proc. Nat.Conf. Appl.Engg and Tech, SJCIT, were obtained indicating best networks, least errors. A India, 2001 [12] Srimani,P.K. ‘Computerisation of Tonic shift process (s/w)’, J.I.I.Sc., consolidated table of all possible TS in the 72 heptatonic Bangalore, 1972,1976 scales was generated. [13] Srimani P.K., ‘Mathematical Modelling and Computerisation for Learning Models in S.Classical Music-Advanced Pattern Recognition, Proc.World Conf, India, 1997 ACKNOWLEDGMENT [14] Srimani P.K.and Parimala Y.G., ‘Pattern Recognition and a unique One of the authors (second author) is highly thankful to Raga Classification and Identification tool using Aritificial Neural Rayalaseema University for the facilities provided for networks’, Selected for presentation at Int.Conf. of IETAN, Jaipur [15] Srimani,P.K., ‘ A modern mathematical approach to pattern conducting the research. recognition in Vedas and Carnatic Classical Music’, Proc. World Conf.Ved.Sci.Vig.Bharathi, Bangalore,2004 REFERENCES

[1] Bishop, C.M., Neural Networks for Pattern Recognition, Oxford: Oxford University Press., 1995 [2] Haykin, S. , Neural Networks: A Comprehensive Foundation, NY: Macmillan., 1994 [3] Judd, J.S. Neural Network Design and the Complexity of Learning, Cambridge, MA: The MIT Press. 1990 [4] Hagan, T.M., Demuth,H.B., Beale, M. “Neural Network Design”, Cengage Learning India, 1996 [5] Pinkus, A. "Approximation theory of the MLP model in neural networks," Acta Numerica, 8, 143-196, 1999

105