Melodic Phrase Attention Network for Symbolic Data-based Music Genre Classification (Student Abstract)

Li Li, Rui Zhang, Zhenyu WangAAAI 2021 · DOI

Abstract

Music genre classification has traditionally relied on raw audio or hand-crafted features from symbolic data. We present the Melodic Phrase Attention Network (MPAN), a deep learning model designed to classify music genres using symbolic MIDI data. MPAN utilizes an automated representation learning approach and a phrase-level attention mechanism to capture the hierarchical structure of music. Our results on large-scale datasets show that MPAN significantly outperforms traditional SVM-based methods and standard neural network architectures, achieving state-of-the-art performance.

Introduction

While music genre classification is a mature field in audio signal processing, research utilizing symbolic data—such as MIDI files—remains relatively sparse. Most existing symbolic classifiers depend on manually engineered features, which are often labor-intensive to extract and fail to capture the nuanced hierarchical relationships within a composition. Traditional models like Support Vector Machines (SVMs) often treat musical features as flat data points, ignoring the fact that music is composed of phrases with varying degrees of importance to genre identity. The authors aim to move away from manual engineering toward an automated, phrase-aware deep learning approach.

Methodology

The MPAN architecture addresses these limitations through a three-stage pipeline:

  1. Representation Learning: Musical slices are treated as "words" in a sequence. Using a word2vec-inspired approach, these slices are converted into vectorized representations based on their contextual relationships within a large corpus.
  2. Melody Segmentation: Compositions are divided into distinct melodic phrases using a "musical energy" method, which considers variables such as PitchArea, VolumeArea, MelodyArea, and SoundArea.
  3. The MPAN Architecture:
    • Melodic Phrase Encoder: A 1D Convolutional Neural Network (CNN) extracts local patterns from segmented phrases, producing a vector for each.
  4. Melodic Phrase Attention: These vectors are processed by a Gated Recurrent Unit (GRU). An attention mechanism then assigns weights to each phrase, identifying the most "genre-defining" motifs.
  5. Classification: A Softmax layer predicts the final genre label based on the weighted sum of phrase representations.
The MPAN architecture, featuring the Melodic Phrase Encoder and Melodic Phrase Attention layers.

Experimental Setup

The model was evaluated on two substantial symbolic music datasets:

  • Tagtraum Genre Annotations (TAGA): Comprising 21,353 MIDI files across 15 genres.
  • MSD Allmusic Top Genre (MASD): Comprising 24,623 MIDI files across 25 genres.

Results

The MPAN model demonstrated a substantial performance leap over both traditional baselines and standard deep learning models. On the TAGA dataset, MPAN achieved an accuracy of 0.796, nearly doubling the performance of the Musical Feature-SVM baseline (0.409). On the MASD dataset, it reached 0.508 accuracy, outperforming the previous state-of-the-art "Sia-2" model.

Performance comparison of MPAN against baseline models on TAGT and MASD datasets.

The application of attention to phrases proved critical. By allowing the model to focus on specific "hooks" or motifs while ignoring generic transitions, MPAN captures the essence of a genre more effectively than flat feature sets. Qualitative analysis also showed that MPAN improved accuracy across almost every individual genre label compared to baseline models.

Conclusion

MPAN represents a significant step forward in symbolic music classification by moving away from manual feature engineering toward an end-to-end, phrase-aware deep learning approach. While symbolic music data is less abundant than audio, this approach offers computational efficiency and a focus on pure composition. Future work will focus on incorporating additional musical features and refining the network architecture to better align with music-theoretical principles.

Summary updated

BibTeX
@inproceedings{li2021melodic,
  author = {Li Li and Rui Zhang and Zhenyu Wang},
  title = {{Melodic Phrase Attention Network for Symbolic Data-based Music Genre Classification (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i18.17909},
}
Figure