classification of irish and scandinavian folk music by dance...

1
Classification of Irish and Scandinavian Folk Music by Dance Type Elliot Kermit-Canfield & Irán Román Center for Computer Research in Music and Acoustics, Stanford University Data Preparation T: V\"astg\"ota polska O: Sweden R: hambo-polska Z: 2009 John Chambers <jc:trillian.mit.edu> S: handwritten MS by JC from the 1970s M: 3/4 L: 1/8 K: D |: A>B AG F>A | d>f a2 f2 | f{gf}e/f/ ge c>e |d>e f2 d2 :| ABC Notation Western Music Notation 1. Remove Grace Notes K: D |: A>B AG F>A | d>f a2 f2 | f e/f/ ge c>e |d>e f2 d2 :| 2. Transpose to C K: C |: G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 :| 3. Expand Repeats K: C | G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 | | G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 | Translation from ABC to Western Music Notation Transcription from Music Notation to ABC Format Abstract For centuries, western cultures have written folk songs down. In the 21st century, this has resulted in large databases of music from all around the world. We have built, trained, and tested classifiers on Irish and Scandinavian dance music using songs encoded in symbolic representation (ABC format) downloaded from John Chamber’s online folk-song database. These tunes were sorted by dance type: Reel, Jig, Hambo, Pols, and Hornpipe. Raw data was preprocessed to be in the same key, have no ornaments, and no abbreviations. Features extracted were standardized to have zero mean and unit variance. Extra trees classification and variance thresholding allowed us to reduce feature dimensionality to 23. We classified our data using Support Vector Machines (SVM), Logistic Regression, Naïve Bayes, and K-means Clustering. We evaluated these classification algorithms using leave-one- out cross validation, trained on 80 percent of the data, and tested on 20 percent. Our SVM classification methods turned out to be the most accurate with less than 10% training and testing error. References 1. Chai, W., & Vercoe, B. (2001, June). Folk music classification using hidden Markov models. In Proceedings of International Conference on Artificial Intelligence (Vol. 6, No. 6.4). sn. 2. Cuthbert, M. S., Ariza, C., & Friedland, L. (2011). Feature Extraction and Machine Learning on Symbolic Music using the music21 Toolkit. In ISMIR (pp. 387-392). 3. Doraisamy, S., Golzari, S., Mohd, N., Sulaiman, M. N., & Udzir, N. I. (2008, September). A Study on Feature Selection and Classification Techniques for Automatic Genre Classification of Traditional Malay Music. In ISMIR (pp. 331-336). 4. Lomax, A.. (1956). Folk Song Style: Notes on a Systematic Approach to the Study of Folk Song. Journal of the International Folk Music Council, 8, 48–50. 5. McKay, C., & Fujinaga, I. (2006). jSymbolic: A feature extractor for MIDI files. In Proceedings of the International Computer Music Conference (pp. 302-5). 6. McKay, C., & Fujinaga, I. (2004, October). Automatic Genre Classification Using Large High-Level Musical Feature Sets. In ISMIR (Vol. 2004, pp. 525-530). Dance Classification Algorithm Test Accuracy Table 1. Each line represents the accuracy on a 22-sample test set withheld from the 40-sample training set. All algorithms were validated using leave-one-out cross- validation (except K-means clustering, for which f1 score was the validation metric). The average training accuracy for each classification algorithm was: linear SVM, 0.91; RBF SVM, 0.93; K-means clustering, 0.85; Logistic Regression, 0.91; Naïve Bayes, 0.90. Feature Selection A B Figure 1. We identified 55 melodic and 10 rhythmic features describing the songs in our dataset. We extracted these features from our song corpus using tools for musical feature extraction from Music21. Above we show the training rate before (A) and after (B) feature selection. Conclusion and Next Steps Clearly, the classification algorithms have a long way to come. Dance types that are more dissimilar, such as Hornpipe vs Jig, are easy to classify. However, classification of dances that are similar in meter and style, such as Reel vs Hornpipe, turned out to be no better than chance. Our results suggest that we can write new feature extraction methods that take advantage of mesoscale qualities in our data. These qualities could include phrase and sub phrase quantifiers, form decoders, and N- gram identification of rhythmic and melodic motives. Finally, we can expand our classification methods to include unsupervised learning algorithms and neural networks. A Figure 2. Output of various classification algorithms, plotted in the first two Principal Components of the training data. Gray circles represent the training data; and white circles represent the test data. Background colors show the decision boundary. Data is correctly classified when its color matches the background color. In SVM plots, golden circles surround the support vectors. Crosses mark the centroids of K- means. (A) Output of SVM with linear kernel for Hornpipe vs. Jig. The data separates well. (B) Output of K-means, Naïve Bayes, Logistic Regression, and SVM with RBF Kernel for Hornpipe vs. Jig. Note the RBF kernel overfits the data and K-means gives an incorrect decision boundary. (C) Output of Naïve Bayes for Hambo vs Pols, and SVM with 3rd Order Polynomial Kernel for Hornpipe vs Reel. In these cases, the data does not separate well. B C Legend: Training Example Test Point Support Vector Class Centroids X X

Upload: others

Post on 03-Mar-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Classification of Irish and Scandinavian Folk Music by Dance Typecs229.stanford.edu/proj2015/126_poster.pdf · qualities could include phrase and sub phrase quantifiers, form decoders,

Classification of Irish and Scandinavian Folk Music by Dance TypeElliot Kermit-Canfield & Irán Román

Center for Computer Research in Music and Acoustics, Stanford University

Data Preparation

T: V\"astg\"ota polska O: Sweden R: hambo-polska Z: 2009 John Chambers <jc:trillian.mit.edu> S: handwritten MS by JC from the 1970s M: 3/4 L: 1/8 K: D |: A>B AG F>A | d>f a2 f2 | f{gf}e/f/ ge c>e |d>e f2 d2 :|

ABC Notation

Western Music Notation

1. Remove Grace NotesK: D |: A>B AG F>A | d>f a2 f2 | f e/f/ ge c>e |d>e f2 d2 :|

2. Transpose to CK: C |: G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 :|

3. Expand RepeatsK: C | G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 | | G>A GF E>G | c>e g2 e2 | e d/e/ fd B>d |c>d e2 c2 |

Translation from ABC to Western Music Notation

Transcription from Music Notation to ABC Format

AbstractFor centuries, western cultures have written folk songs down. In the 21st century, this has resulted in large databases of music from all around the world. We have built, trained, and tested classifiers on Irish and Scandinavian dance music using songs encoded in symbolic representation (ABC format) downloaded from John Chamber’s online folk-song database. These tunes were sorted by dance type: Reel, Jig, Hambo, Pols, and Hornpipe. Raw data was preprocessed to be in the same key, have no ornaments, and no abbreviations. Features extracted were standardized to have zero mean and unit variance. Extra trees classification and variance thresholding allowed us to reduce feature dimensionality to 23. We classified our data using Support Vector Machines (SVM), Logistic Regression, Naïve Bayes, and K-means Clustering. We evaluated these classification algorithms using leave-one-out cross validation, trained on 80 percent of the data, and tested on 20 percent. Our SVM classification methods turned out to be the most accurate with less than 10% training and testing error.

References1. Chai, W., & Vercoe, B. (2001, June). Folk music classification using hidden Markov models. In Proceedings of

International Conference on Artificial Intelligence (Vol. 6, No. 6.4). sn. 2. Cuthbert, M. S., Ariza, C., & Friedland, L. (2011). Feature Extraction and Machine Learning on Symbolic Music

using the music21 Toolkit. In ISMIR (pp. 387-392). 3. Doraisamy, S., Golzari, S., Mohd, N., Sulaiman, M. N., & Udzir, N. I. (2008, September). A Study on Feature

Selection and Classification Techniques for Automatic Genre Classification of Traditional Malay Music. In ISMIR (pp. 331-336).

4. Lomax, A.. (1956). Folk Song Style: Notes on a Systematic Approach to the Study of Folk Song. Journal of the International Folk Music Council, 8, 48–50.

5. McKay, C., & Fujinaga, I. (2006). jSymbolic: A feature extractor for MIDI files. In Proceedings of the International Computer Music Conference (pp. 302-5).

6. McKay, C., & Fujinaga, I. (2004, October). Automatic Genre Classification Using Large High-Level Musical Feature Sets. In ISMIR (Vol. 2004, pp. 525-530).

Dance Classification

Algorithm Test Accuracy

Table 1. Each line represents the accuracy on a 22-sample test set withheld from the 40-sample training set. All algorithms were validated using leave-one-out cross-validation (except K-means clustering, for which f1 score was the validation metric). The average training accuracy for each classification algorithm was: linear SVM, 0.91; RBF SVM, 0.93; K-means clustering, 0.85; Logistic Regression, 0.91; Naïve Bayes, 0.90.

Feature SelectionA B

Figure 1. We identified 55 melodic and 10 rhythmic features describing the songs in our dataset. We extracted these features from our song corpus using tools for musical feature extraction from Music21. Above we show the training rate before (A) and after (B) feature selection.

Conclusion and Next StepsClearly, the classification algorithms have a long way to come. Dance types that are more dissimilar, such as Hornpipe vs Jig, are easy to classify. However, classification of dances that are similar in meter and style, such as Reel vs Hornpipe, turned out to be no better than chance. Our results suggest that we can write new feature extraction methods that take advantage of mesoscale qualities in our data. These qualities could include phrase and sub phrase quantifiers, form decoders, and N-gram identification of rhythmic and melodic motives. Finally, we can expand our classification methods to include unsupervised learning algorithms and neural networks.

AFigure 2. Output of various classification algorithms, plotted in the first two Principal Components of the training data. Gray circles represent the training data; and white circles represent the test data. Background colors show the decision boundary. Data is correctly classified when its color matches the background color. In SVM p lo t s , go lden c i r c l es surround the support vectors. Crosses mark the centroids of K-means. (A) Output of SVM with linear kernel for Hornpipe vs. Jig. The data separates well. (B) Output of K-means, Naïve Bayes, Logistic Regression, and SVM with RBF Kernel for Hornpipe vs. Jig. Note the RBF kernel overfits the data and K-means gives an incorrect decision boundary. (C) Output of Naïve Bayes for Hambo vs Pols, and SVM with 3rd Order Polynomial Kernel for Hornpipe vs Reel. In these cases, the data does not separate well.

B C

Legend:Training Example Test Point Support Vector

Class Centroids

XX