Musical Instrument Identification Using Machine Learning
DOI:
https://doi.org/10.47611/jsrhs.v13i2.6813Keywords:
instrumentidentification, music, instrument, classification, knearestneighbors, machinelearning, AI, frequency, harmonicfrequency, fastfouriertransform, principalcomponentanalysis, viola, ukulele, piano, pythonAbstract
Music is a beautiful form of expression that is universally understood. In fact, people across all cultural backgrounds, even those without extensive exposure to musical education, can easily recognize the unique sounds of different instruments. This paper explores the use of machine learning to identify various instruments. The scope of this project focuses on audio recordings with one instrument playing one pitch, and the specific instruments in this study were viola, piano, and ukulele. This paper analyzes ways to quantify the differences in sounds of instruments using the harmonic frequency content apparent in spectrograms. It proposes the use of a simple but efficient K-Nearest-Neighbors machine learning algorithm. The results achieved 80% accuracy; using a larger dataset and using convolutional neural networks could improve accuracy of classification. The machine learning algorithm can be applied to the broader world of sound classification, and it can eventually surpass a human’s ability at identifying sounds (e.g. telling apart viola from violin, which the average human cannot do). There are numerous real-world applications for musical instrument recognition. It can enable automatic sorting and searching of massive musical collections with ease, which could be useful to streaming platforms that provide personalized recommendations to their users.
Downloads
References or Bibliography
Parncutt, R., et al. “Review of the Science and Psychology of Music Performance: Creative Strategies for Teaching and Learning.” Bulletin of the Council for Research in Music Education, no. 160, 2004, pp. 76–86, www.jstor.org/stable/40319221.
Saldanha, E. L., and John F. Corso. “Timbre Cues and the Identification of Musical Instruments.” The Journal of the Acoustical Society of America, vol. 36, no. 11, Nov. 1964, pp. 2021–2026, https://doi.org/10.1121/1.1919317.
“On the Relevance of Spectral Features for Instrument Classification | IEEE Conference Publication | IEEE Xplore.” Ieeexplore.ieee.org, ieeexplore.ieee.org/abstract/document/4217451.
Weisstein, Eric W. “Fast Fourier Transform.” Mathworld.wolfram.com, mathworld.wolfram.com/FastFourierTransform.html.
“Comparison of Features for Musical Instrument Recognition | IEEE Conference Publication | IEEE Xplore.” Ieeexplore.ieee.org, ieeexplore.ieee.org/abstract/document/969532.
Kramer, Oliver. “K-Nearest Neighbors.” Dimensionality Reduction with Unsupervised Nearest Neighbors, vol. 51, 2013, pp. 13–23, https://doi.org/10.1007/978-3-642-38652-7_2.
Chérifa Boucetta, et al. “Improved Euclidean Distance in the K Nearest Neighbors Method.” Communications in Computer and Information Science, 1 Jan. 2023, pp. 315–324, https://doi.org/10.1007/978-3-031-40852-6_17.
Wang, Jigang, et al. “Neighborhood Size Selection in the K-Nearest-Neighbor Rule Using Statistical Confidence.” Pattern Recognition, vol. 39, no. 3, Mar. 2006, pp. 417–423, https://doi.org/10.1016/j.patcog.2005.08.009.
Anava, Oren, and Kfir Levy. “KAst -Nearest Neighbors: From Global to Local.” Neural Information Processing Systems, Curran Associates, Inc., 2016, proceedings.neurips.cc/paper/2016/hash/2c6ae45a3e88aee548c0714fad7f8269-Abstract.html.
Shlens, Jonathon. “A Tutorial on Principal Component Analysis.” ArXiv:1404.1100 [Cs, Stat], 3 Apr. 2014, arxiv.org/abs/1404.1100.
Chipman, Hugh A., and Hong Gu. “Interpretable Dimension Reduction.” Journal of Applied Statistics, vol. 32, no. 9, Nov. 2005, pp. 969–987, https://doi.org/10.1080/02664760500168648.
Published
How to Cite
Issue
Section
Copyright (c) 2024 Evelyn Ding; Emily Sharma
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Copyright holder(s) granted JSR a perpetual, non-exclusive license to distriute & display this article.