Skip to main content

Comparison of Convolutional Neural Networks and K-Nearest Neighbors for Music Instrument Recognition

  • Chapter
  • First Online:
Advances in Speech and Music Technology

Part of the book series: Signals and Communication Technology ((SCT))

  • 774 Accesses

Abstract

Music instrument recognition is one of the main tasks of music information retrieval. Identification of instruments present in an audio track provides information about the composition of music. Music instrument recognition in polyphonic music is a challenging task. Existing approaches use temporal, spectral, and perceptual feature extraction techniques to perform music instrument recognition. In the proposed work, a convolutional neural network and k-nearest neighbor classifier framework are implemented to identify the musical instrument present in a monophonic audio file, and the performance of the two models is compared. The model is trained on the London Philharmonic Orchestra dataset which consists of six different classes of musical instruments. Mel spectrogram representation is used to extract features for the convolutional neural network model. For k-nearest neighbors, the Mel-frequency cepstral coefficient’s feature vectors are calculated to perform classification. This approach only works for monophonic music and cannot be used for polyphonic music. The model helps to label the unlabelled audio files so that manual annotation can be avoided. The model performed well with excellent result of 99.17% accuracy for the convolutional neural network and 97% accuracy for the k-nearest neighbor architecture.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 139.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 179.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 179.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Essid, S., Richard, G., & David, B,(2005), “Instrument recognition in polyphonic music based on automatic taxonomies,” in IEEE Transactions on Audio, Speech, and Language Processing, vol. 14, no. 1, pp. 68–80.

    Article  Google Scholar 

  2. Pham, J., Woodford, T. and Lam, J.(2009), Classification of Musical Instruments by Sound.

    Google Scholar 

  3. Mustafa Sarimollaoglu, Coskun Bayrak, (2006),” Musical Instrument Classification Using Neural Networks,”, Proceedings of the 5th WSEAS International Conference on Signal Processing, Istanbul, Turkey, pp. 151–154.

    Google Scholar 

  4. Prabhjyot Singh, Dnyaneshwar Bachhav, Omkar Joshi, Nita Patil,(2019),“Musical Instrument Recognition using CNN and SVM,” in International Research Journal of Engineering and Technology (IRJET),vol. 06, no.3, pp. 1487–1491.

    Google Scholar 

  5. IRMAS Dataset, https://www.upf.edu/web/mtg/irmas. Last accessed 12 Sept 2021

  6. Haidar-Ahmad, Lara.(2019),“Music and instrument classification using deep learning technics”, Recall, 67(37.00), pp.80–00.

    Google Scholar 

  7. IOWA Dataset, http://theremin.music.uiowa.edu/MIS.html. Last accessed 12 Sept 2021

  8. Y. Han, J. Kim and K. Lee,(2017), “Deep Convolutional Neural Networks for Predominant Instrument Recognition in Polyphonic Music,” in IEEE/ACM Transactions on Audio, Speech, and Language Processing, vol. 25, no. 1, pp. 208–221.

    Google Scholar 

  9. Mahanta, S.K., Khilji, A.F.U.R. and Pakray, P.,(2021),” Deep Neural Network for Musical Instrument Recognition Using MFCCs,” in Journal Computación y Sistemas, vol 25, no 2, pp. 351–360.

    Google Scholar 

  10. Hing, D.S. and Settle, C.J.(2020), Detecting and Classifying Musical Instruments with Convolutional Neural Networks.

    Google Scholar 

  11. Yun, M. and Bi, J.(2018), Deep Learning for Musical Instrument Recognition.

    Google Scholar 

  12. Liu, J., Xie, L., (2010),“SVM -based automatic classification of musical instruments,” in International Conference on Intelligent Computation Technology and Automation, vol. 3, pp. 669–673.

    Google Scholar 

  13. Prabavathy, S., Rathikarani, V.,Dhanalakshmi, P., “Classification of Musical Instruments using SVM and KNN,” in International Journal of Innovative Technology and Exploring Engineering (IJITEE), vol. 9, no. 7,pp.2278–3075.

    Google Scholar 

  14. Anhari, A.K.,(2020),” Learning multi-instrument classification with partial labels,”, arXiv preprint arXiv:2001.08864.

    Google Scholar 

  15. Philharmoic Dataset, https://philharmonia.co.uk/. Last accessed 12 Sept 2021

  16. A. Kratimenos, K. Avramidis, C. Garoufis, A. Zlatintsi, P. Maragos, (2020) ,“Augmentation Methods on Monophonic Audio for Instrument Classification in Polyphonic Music,” in 28th European Signal Processing Conference (EUSIPCO), pp. 156–160.

    Google Scholar 

  17. A. Eronen and A. Klapuri,(2000), “Musical instrument recognition using cepstral coefficients and temporal features,” in IEEE International Conference on Acoustics, Speech, and Signal Processing. Proceedings, vol.2, pp. II753-II756.

    Google Scholar 

  18. Patil S.R., Machale S.J.,(2020),“Indian Musical Instrument Recognition Using Gaussian Mixture Model,” in Techno-societal 2018, Springer, Cham, (pp. 51–57).

    Google Scholar 

  19. A. Ghosh, A. Pal, D. Sil, S. Palit,(2018), “Music Instrument Identification Based on a 2-D Representation,” in International Conference on Electrical, Electronics, Communication, Computer, and Optimization Techniques (ICEECCOT), pp. 509–513.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Cite this chapter

Dhivya, S., Mohandas, P. (2023). Comparison of Convolutional Neural Networks and K-Nearest Neighbors for Music Instrument Recognition. In: Biswas, A., Wennekes, E., Wieczorkowska, A., Laskar, R.H. (eds) Advances in Speech and Music Technology. Signals and Communication Technology. Springer, Cham. https://doi.org/10.1007/978-3-031-18444-4_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-18444-4_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-18443-7

  • Online ISBN: 978-3-031-18444-4

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics