Skip to main content
QUICK REVIEW

[Paper Review] Lyrics-Based Music Genre Classification Using a Hierarchical Attention Network

Alexandros Tsaptsinos|arXiv (Cornell University)|Jul 14, 2017
Music and Audio ProcessingComputer Science18 citations
TL;DR

This paper proposes a hierarchical attention network (HAN) for lyrics-based music genre classification, leveraging the hierarchical structure of lyrics—words, lines, and segments—to improve classification accuracy. The HAN outperforms both traditional and simpler neural models, achieving state-of-the-art results on both 117-genre and 20-genre datasets, while also enabling interpretability through attention visualization.

ABSTRACT

Music genre classification, especially using lyrics alone, remains a challenging topic in Music Information Retrieval. In this study we apply recurrent neural network models to classify a large dataset of intact song lyrics. As lyrics exhibit a hierarchical layer structure - in which words combine to form lines, lines form segments, and segments form a complete song - we adapt a hierarchical attention network (HAN) to exploit these layers and in addition learn the importance of the words, lines, and segments. We test the model over a 117-genre dataset and a reduced 20-genre dataset. Experimental results show that the HAN outperforms both non-neural models and simpler neural models, whilst also classifying over a higher number of genres than previous research. Through the learning process we can also visualise which words or lines in a song the model believes are important to classifying the genre. As a result the HAN provides insights, from a computational perspective, into lyrical structure and language features that differentiate musical genres.

Motivation & Objective

  • To address the challenge of music genre classification using only song lyrics, a task underexplored in comparison to audio-based methods.
  • To exploit the hierarchical structure of lyrics—words forming lines, lines forming segments, and segments forming complete songs—within a deep learning framework.
  • To improve classification accuracy beyond previous neural and non-neural models, especially in high-genre scenarios.
  • To provide interpretability by visualizing which words, lines, or segments the model deems most important for genre prediction.

Proposed method

  • The study employs a hierarchical attention network (HAN) that processes lyrics at three levels: word-level, line-level, and song-level, capturing hierarchical dependencies.
  • At each level, the model uses bidirectional long short-term memory (Bi-LSTM) networks to encode sequential information and apply learned attention weights to emphasize salient features.
  • Attention mechanisms are applied separately at the word and line levels to dynamically weigh the importance of individual words and lines within a segment.
  • The model is trained on a large, intact lyrics dataset of 449,458 songs across 20 genres and 495,188 songs across 117 genres, sourced from LyricFind and mapped to iTunes genre labels.
  • The HAN is compared against non-neural models (SVM, k-NN, Naïve Bayes) and simpler neural models (LSTM), with performance evaluated using accuracy.
  • Visualization of attention weights allows interpretation of which words or lines the model deems most indicative of a given genre.

Experimental results

Research questions

  • RQ1Can a hierarchical attention network effectively model the multi-level structure of song lyrics to improve genre classification accuracy?
  • RQ2How does the HAN's performance compare to non-neural and simpler neural models in lyrics-only genre classification?
  • RQ3What linguistic and structural features in lyrics does the model learn to be most indicative of specific music genres?
  • RQ4Can the attention mechanism in the HAN provide meaningful interpretability by highlighting genre-discriminative words or lines?
  • RQ5Does the model generalize well across a large number of genres, including those with sparse representation?

Key findings

  • The HAN achieved state-of-the-art accuracy in lyrics-only music genre classification, outperforming both traditional machine learning models and simpler neural networks.
  • On the 20-genre dataset, the HAN achieved higher accuracy than any previously reported model for lyrics-only classification, with performance significantly surpassing non-neural baselines.
  • The model demonstrated robustness in high-dimensional genre spaces, successfully classifying over 100 genres, which is a notable advancement compared to prior work limited to 10 or fewer genres.
  • Attention visualization revealed that the model correctly identified genre-discriminative words and lines in many cases, such as recognizing Spanish lyrics as indicative of Latin genres.
  • In some cases, the model misclassified songs due to generic or ambiguous lyrics—e.g., a Hip-Hop/Rap song was misclassified as Pop—highlighting limitations in handling stylistic ambiguity.
  • The HAN outperformed both LSTM and non-neural models, with the highest accuracy achieved on the 20-genre dataset, indicating the effectiveness of hierarchical attention in modeling lyrical structure.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.