Skip to main content
QUICK REVIEW

[Paper Review] BERT-like Pre-training for Symbolic Piano Music Classification Tasks

Yi-Hui Chou, I‐Chun Chen|arXiv (Cornell University)|Jul 12, 2021
Music and Audio ProcessingComputer Science70 references18 citations
TL;DR

This paper introduces MidiBERT-Piano, a 12-layer Transformer model pre-trained via masked language modeling on 4,166 polyphonic piano MIDI files to improve symbolic music understanding. It achieves state-of-the-art performance on four downstream tasks—melody extraction, velocity prediction, composer classification, and emotion classification—outperforming RNN baselines with less than 10 fine-tuning epochs, even when pre-training data excludes downstream task labels.

ABSTRACT

This article presents a benchmark study of symbolic piano music classification using the masked language modelling approach of the Bidirectional Encoder Representations from Transformers (BERT). Specifically, we consider two types of MIDI data: MIDI scores, which are musical scores rendered directly into MIDI with no dynamics and precisely aligned with the metrical grid notated by its composer and MIDI performances, which are MIDI encodings of human performances of musical scoresheets. With five public-domain datasets of single-track piano MIDI files, we pre-train two 12-layer Transformer models using the BERT approach, one for MIDI scores and the other for MIDI performances, and fine-tune them for four downstream classification tasks. These include two note-level classification tasks (melody extraction and velocity prediction) and two sequence-level classification tasks (style classification and emotion classification). Our evaluation shows that the BERT approach leads to higher classification accuracy than recurrent neural network (RNN)-based baselines.

Motivation & Objective

  • To address the scarcity of labeled data in symbolic music understanding by leveraging large-scale self-supervised pre-training.
  • To adapt the BERT-like masked language modeling approach to symbolic music represented as MIDI tokens.
  • To evaluate the effectiveness of pre-training on diverse symbolic music classification tasks with limited labeled data.
  • To investigate the impact of pre-training data composition, model fine-tuning strategies, and architectural choices on downstream performance.
  • To establish a publicly available benchmark for symbolic music understanding using pre-trained Transformers.

Proposed method

  • Pre-train a 12-layer Transformer model using masked language modeling (MLM) on 4,166 polyphonic piano MIDI files from five public datasets.
  • Represent MIDI events as discrete tokens using a learned tokenization scheme, treating symbolic music as a 'language' for sequence modeling.
  • Fine-tune the pre-trained model on four downstream tasks: note-level (melody extraction, velocity prediction) and sequence-level (composer classification, emotion classification).
  • Apply ablation studies to evaluate the effect of excluding downstream task data from pre-training, freezing self-attention layers, and removing pre-training.
  • Use a classifier head on the [CLS] token representation for sequence-level tasks and token-wise prediction heads for note-level tasks.
  • Train with cross-entropy loss and optimize using AdamW with learning rate scheduling and weight decay.

Experimental results

Research questions

  • RQ1Can BERT-like pre-training with masked language modeling improve performance on symbolic music classification tasks with limited labeled data?
  • RQ2How does pre-training on data that excludes the downstream task's labeled data affect model generalization?
  • RQ3Does freezing the self-attention layers during fine-tuning degrade performance, and what does this imply about knowledge transfer?
  • RQ4How sensitive is performance to the composition of the pre-training corpus, especially when excluding data from downstream tasks?
  • RQ5Can a single pre-trained model effectively transfer knowledge across diverse symbolic music understanding tasks, including both note-level and sequence-level classification?

Key findings

  • The MidiBERT-Piano model achieves 96.37% accuracy on melody extraction, significantly outperforming the RNN baseline (88.66%) with less than 10 fine-tuning epochs.
  • For velocity prediction, the model reaches 51.63% accuracy, a 7.86% improvement over the RNN baseline (43.77%), demonstrating strong performance on fine-grained note-level tasks.
  • Composer classification reaches 78.57% accuracy, which drops to 58.73% when pre-training excludes data from the Pianist8 dataset, indicating genre coverage is critical for sequence-level tasks.
  • Freezing the self-attention layers during fine-tuning reduces performance across all tasks, suggesting that full fine-tuning is necessary for optimal knowledge transfer.
  • Pre-training without any downstream task data still yields strong performance, showing that the pre-trained model captures generalizable musical representations.
  • The model with no pre-training performs worse than RNN baselines on three of four tasks, highlighting the necessity of pre-training for effective transfer learning in low-data regimes.

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.