MUSICAL GENRE CLASSIFICATION

Taylor Campbell and James Oakley

Table of Contents

1 INTRODUCTION

For someone well acquainted with a historically significant body of musical work, telling a Bach fugue from a Mozart piano sonata is the work of a moment's listening. The act on the part of the human is almost without thought. The instruments used, the chords employed, the specific melodic devices, and so on trigger identifications in the human brain. Our goal is to allow machines the same ease of classification. We will focus on classifying pieces of music in their symbol representation (we will be using MIDI files) rather than in their auditory representation. This avoids the complexities of digital audio processing and essentially attempting to reverse engineer notes and instruments from digitally encoded frequencies. As well as performing the work of a human in classifying musical pieces, we are also interested to see what classifications unsupervised learning may come up with

2 FOCUS OF EXAMINATION

Unlike most prior work in this area, we focus mainly on music which was created before 1900. The twentieth century was a time of musical explosion, and the works of a single composer or band often did not fall within a single genre. Indeed, a single work often spanned multiple genres. While classifying music of the twentieth century is certainly an important problem for music sales and recommendation services, we choose to focus on the problem which has received less attention – classifying older music which is more likely to uphold certain strict forms. Additionally, working with older music avoids copyright issues.

Our goal then is to find an appropriate model and an appropriate feature vector for correctly identifying the genre of each of a collection of works. Previous research into this area has yielded techniques for extracting as many as 160 features from a piece of music 1. We wish to evaluate the effect that each of a variety of features (drawing from prior work and from other features we may view as important) has on the genre predictions made. As humans do by no means evaluate anywhere near 160 data points when classifying the genre of a piece of music, so there must be features which are significantly more important than others, and we aim to find these.

3 DATASET

The Mutopia Project 2 has a very large collection of freely available MIDI files with metadata about their composers and styles. We have collected from it 1666 musical works by 270 different composers in 13 different styles.

4 FEATURES

We parse MIDI files with PythonMIDI 3 and extract features. We have implemented extractors for the following features:

5 ALGORITHMS and PERFORMANCE

We have implemented k-nearest-neighbor classification and have partially written code for classification by feed-forward neural networks. We may also experiment with other classification algorithms.

kNN with 5-fold cross validation currently gives us the following result for classifying pieces as romantic, classical, baroque, or hymn:

As is shown, we do significantly better than blind or biased (biased based on the number of samples of a particular style) guessing. We do not, however, do quite as well as we had hoped, since we had hoped to equal results achieved by prior work, such as 4. They achieved results of 85%-99% correct classification; however, they used up to 100 features, many more than we do, so we hope that with added features we can see the same performance. Also, we currently use a euclidean distance function, which handles boolean features poorly and is not tuned to the relative importance of features for classification. Correcting this should also yield a gain over this initial performance. We have not yet been able to achieve satisfactory performance classifying composers.

6 RELATED WORK

There has been a reasonable degree of work in this domain already. Basili et al perform an evaluation similar to ours except that they consider only a few genres and consider more modern music 5. McKay and Fujinaga introduce classification systems which make use of a large number of features extracted from MIDI files and theorize about what makes a good feature 4 1. They do not, however, present any experimental determination of the importance of various features and they do not consider a dataset similar to ours. Very recently, Mostafa and Billor used neural networks to cluster and identify genre of songs 6. They focused only on three genres, however and did not use such a large corpus of music.

7 TIMELINE

8 REFERENCES

1 Cory McKay and Ichiro Fujinaga. "Style-independent computer-assisted exploratory analysis of large music collections". Journal of Interdisciplinary Music Studies 1 (1): 63–85. 2007.

2 http://www.mutopiaproject.org

3 http://sourceforge.net/projects/pymidi

4 Cory McKay and Ichiro Fujinaga. "Automatic Genre Classification Using Large High-Level Musical Feature Sets". In Proceedings of the International Converence on Music Information Retrieval, 2004.

5 Mohamed M. Mostafa, Nedret Billor. "Recognition of Western Style Musical Genres Using Machine Learning Techniques". Expert Systems with Applications, Volume 36, Issue 8, October 2009, Pages 11378-11389.

6 Roberto Basili, Alfredo Serafini, and Stellato Armando. "Classification Of Musical Genre: A Machine Learning Approach". In Proceedings of the International Conference on Music Information Retrieval (ISMIR), Barcelona, Spain, October 2004.

Date: 2010-05-12 19:22:38 EDT

HTML generated by org-mode 6.21b in emacs 23