The Piano, Tabla and Violin Identifier

Our very first machine learning project was extremely simple – a basic music identifier which was meant to familiarize us with machine learning in general. This identifier was initially meant to simply decide whether a piece of music contained a tabla or not, but we later on expanded it to include the violin and the piano as well. Our classifier quickly started to recognize and sort various excerpts of music, to our great surprise and pleasure, in spite of having an extremely small training data base.

A More Technical Perspective

This model closely echoing the perception of the human ear, and their being the primary featureused MFCCs largely due to their echoing the perception of the human ear quite closely, and their being the primary feature being used nowadays for audio classification. It was also a Sequential model due to these models being the most commonly used ones and being the simplest to understand, as they have a plain stack of layers. We made this identifier using Tensorflow, and largely borrowed from the code over here due to its being for a similar classification problem.

Its dataset was compiled from YouTube videos, with Muneeb writing code to download and slice them. We had an equal distribution from all three categories, with there being sixty audio files in total, all of which featured a sole instrument playing. We then extracted forty MFCC features from each file, and used a Tensorflow Sequential model with one hidden layer to process the data. This model had training and dev accuracies of 1.

This model represented a big step forward for us, as it was our very first machine learning project. It is hard to over-emphasize just how important it was to us to be able to actually see the concepts we had studied in action for the first time ever. We now had a taste of what machine learning actually was about – and we wanted more.


Save the Sitar is a website dedicated to promoting and preserving Pakistan’s classical music. Join our growing community to help further our cause!

Follow Save the Sitar!

Get new content delivered directly to your inbox.

We’re on social media!

Leave a comment