Research Article

Music Genre Classification Based on Convolutional Neural Networks and Transformer

Jingdong Chen*
School of Telecommunications Engineering, Xidian University, Xi'an, Shanxi Province, China, 710126

* Corresponding author: [email protected]

Abstract

With the proliferation of the Internet, an increasing number of people have grown accustomed to enjoying music on music streaming software. For music players, classifying the genres of newly released songs, which are emerging in an explosive manner every day, has become a challenging task. This paper aims to explore how to efficiently and accurately classify new songs, focusing on the application of currently popular artificial intelligence algorithms. By comparing data from multiple music streaming platforms with high daily activity, this paper analyzes the performance of different algorithms in music genre classification. The results demonstrate that the two algorithms based on Convolutional Neural Networks (CNN) and Transformer both perform excellently in terms of accuracy and efficiency, and can effectively achieve precise classification of music genres. This research not only provides technical support for music streaming services but also lays a foundation for future research in related fields.

Keywords: CNN; Transformer; Feature Extraction; Genre Recognition
Published: August 5, 2025
DOI: 10.54254/2755-2721/2025.BJ25786
Volume: ACE Vol.177
pp. 131-138
Download PDF

References

  1. Dieleman, S., & Schrauwen, B. (2014). End-to-end learning for music audio tagging using convolutional neural networks. ISMIR.
  2. Hershey, S., Chaudhuri, S., Ellis, D. P. W., Gemmeke, J. F., Jansen, A., Moore, R. C., … & Wilson, K. (2017). CNN Architectures for Large-Scale Audio Classification. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). DOI: 10.1109/ICASSP.2017.7952131
  3. Choi, K., Fazekas, G., Sandler, M., & Cho, K. (2016). Convolutional Recurrent Neural Networks for Music Classification. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). DOI: 10.1109/ICASSP.2016.7471669
  4. Huang, C.-Z. A., Vaswani, A., Uszkoreit, J., Simon, I., Hawthorne, C., Shazeer, N., … & Eck, D. (2018). Music Transformer: Generating Music with Long-Term Structure. International Conference on Learning Representations (ICLR 2019). DOI: 10.48550/arXiv.1809.04281
  5. Nagathil Anil, Martin Rainer. (2013). Evaluation of spectral transforms for music signal analysis. IEEE Workshop on Applications of Signal Processing to Audio and Acoustics.
  6. Bello, J. P., Chew, E., & Turnbull, D. (2008). ISMIR 2008: Proceedings of the 9th International Conference of Music Information Retrieval.
  7. Li, F., Guo, S., Han, F., Zhao, J., & Shen, F. (2024). Multi-scale dilated convolution network for long - term time series forecasting. arXiv preprint arXiv: 2405.05499.
  8. Kaiser, L., Gomez, A. N., & Chollet, F. (2017). Depthwise separable convolutions for neural machine translation. arXiv preprint arXiv: 1706.03059.
  9. Aguilera-Martos, I., Herrera - Poyatos, A., Luengo, J., & Herrera, F. (2024). Local attention mechanism: Boosting the Transformer architecture for long-sequence time series forecasting. arXiv preprint arXiv: 2410.03805.
  10. Ho, J., & Kalchbrenner, N. (2019). Axial attention in multidimensional transformers. arXiv preprint arXiv: 1912.12180.
  11. Zeng, M., Tan, X., Wang, R., Ju, Z. Q., Qin, T., & Liu, T. Y. (2021). MusicBERT: Symbolic music understanding with large - scale pre-training. Findings of the Association for Computational Linguistics: ACL - IJCNLP 2021, 791 - 800.
  12. Cai, Y., Liu, Y., Zhang, Z., & Shi, J. Q. (2023). CLAP: Isolating content from style through contrastive learning with augmented prompts. arXiv preprint arXiv: 2311.16445.
  13. Sharma, G., Srinivasamurthy, A., Gulati, S., & Serra, X. (2022). ACRNN: Attention-based Convolutional Recurrent Neural Network for Indian Classical Music Classification. Proceedings of the 23rd International Society for Music Information Retrieval Conference (ISMIR). DOI: 10.5281/zenodo.7316143
  14. Saudi, A. S., Khalil, M. I., & Abbas, H. M. (2019). Improved features and dynamic stream weight adaption for robust audio-visual speech recognition framework. Digital Signal Processing, 89, 17-29.
  15. Yuan Gong, Yu-An Chung, James Glass. (2021). AST: Audio Spectrogram Transformer Interspeech. DOI: 10.21437/Interspeech.2021-698
  16. Jouppi, N., Kurian, G., Li, S., Ma, P., Nagarajan, R., Nai, L., ... & Patterson, D. A. (2023, June). Tpu v4: An optically reconfigurable supercomputer for machine learning with hardware support for embeddings. In Proceedings of the 50th annual international symposium on computer architecture (pp. 1-14).
  17. Park, J. H., & cho, k. (2020). Large-scale self-supervised learning for music representation. In International Conference on Learning Representations (ICLR).
  18. Finn, C., Abbeel, P., & Levine, S. (2017). Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML) (pp. 1126 - 1135). PMLR.
  19. Tzanetakis, G., & Cook, P. R. (2002). Musical genre classification of audio signals. IEEE Transactions on Speech and Audio Processing, 10(5), 293-302.
  20. Chen, S., Wu, Y., Wang, C., Liu, S., Tompkins, D., Chen, Z., Che, W., Yu, X. Z., & Wei, F. (2023). BEATs: Audio pre-training with acoustic tokenizers. Proceedings of the 40th International Conference on Machine Learning, 202, 5178 - 5193.
  21. Elizalde, B., Deshmukh, S., Al Ismail, M., & Wang, H. (2022). CLAP: Learning audio concepts from natural language supervision. arXiv preprint arXiv: 2206.04769.