Instrument recognition in unprocessed musical audio through transformer-based modelling
Abstract
This study focuses on identifying primary instruments in musical audio using an adapted Wav2Vec 2.0 model, initially intended for extracting speech features from raw audio. Modifications to the model's convolutional layers and transformer element were made to facilitate the recognition of instruments in complex audio mixes. The task of instrument recognition is approached as a multi-labelled classification problem. The effectiveness of the model is measured through accuracy, precision, recall, F1-score, and analysis via a confusion matrix. Key findings reveal the model's differential efficiency in recognising various instruments, with notable success in detecting violins, pianos, saxophones, and human voices. However, the model encounters difficulties in recognising instruments with a narrower dynamic range or lower volume, like the organ that may provide harmonic support, and those with scarce representation, such as the cello and clarinet. The research also indicates that while pre-separation of certain instruments like guitars may enhance recognition, it may not be necessary for others.
References
- Herrera F, et al. (2016). Multilabel classification.
- Baevski A, Zhou, H, Mohamed, A and Auli, M. (2020). Wav2vec 2.0: A Framework for Self-Supervised Learning of Speech Representations, CoRR, vol. abs/2006.11477.
- Vaswani A, et al. (2017). Attention is all you need, Advances in neural information processing systems, vol. 30.
- Juan J B, Jordi J, Ferdinand F and Perfecto H. (2012). A Comparison of Sound Segregation Techniques for Predominant Instrument Recognition in Musical Audio Signals.
- Gururani S, Sharma M and Lerch, A. (2019). An attention mechanism for musical instrument recognition.
- Solanki A and Pandey S. (2022). Music instrument recognition using deep convolutional neural networks, International Journal of Information Technology, vol. 14, no. 3, pp. 1659--1668.
- Mahanta S K, Basisth N J, Halder E, Khilji A F U R and Pakray P. (2023). Exploiting cepstral coefficients and CNN for efficient musical instrument classification, Evolving Systems, pp. 1--13.
- Dan Hendrycks K G. (2016). Bridging Nonlinearities and Stochastic Regularizers with Gaussian Error Linear Units, CoRR, vol. abs/1606.08415.
- Bosch J J, Fuhrmann F and Herrera, P. (2018). IRMAS: a dataset for instrument recognition in musical audio signals, doi: 10.5281/zenodo.1290750.
- McFee B, et al. (2015). librosa: Audio and music signal analysis in python.
- Wolf T, et al. (2019). HuggingFace's Transformers: State-of-the-art Natural Language Processing, CoRR, vol. abs/1910.03771.