The first step to apply deep learning techniques for symbolic music understanding is to transform musical pieces (mainly in MIDI format) into sequences of predefined tokens like note pitch, note velocity, and chords. Subsequently, the sequences are fed into a neural sequence model to accomplish specific tasks. Music sequences exhibit strong correlations between adjacent elements, making them prime candidates for N-gram techniques from Natural Language Processing (NLP). Consider classical piano music: specific melodies might recur throughout a piece, with subtle variations each time. In this paper, we propose a novel method, NG-Midiformer, for understanding symbolic music sequences that leverages the N-gram approach. Our method involves first processing music pieces into word-like sequences with our proposed unsupervised compoundation, followed by using our N-gram Transformer encoder, which can effectively incorporate N-gram information to enhance the primary encoder part for better understanding of music sequences. The pre-training process on large-scale music datasets enables the model to thoroughly learn the N-gram information contained within music sequences, and subsequently apply this information for making inferences during the fine-tuning stage. Experiment on various datasets demonstrate the effectiveness of our method and achieved state-of-the-art performance on a series of music understanding downstream tasks. The code and model weights will be released at https://github.com/WouuYoauin/NG-Midiformer.
翻译:将深度学习技术应用于符号音乐理解的第一步,是将音乐作品(主要为MIDI格式)转化为由预定义记号(如音符音高、音符力度及和弦)构成的序列。随后,将这些序列输入神经序列模型以完成特定任务。音乐序列的相邻元素间存在强相关性,使其成为自然语言处理中N-gram技术的理想应用对象。以古典钢琴音乐为例:特定旋律可能在整首作品中反复出现,且每次出现均有细微变化。本文提出了一种创新方法——NG-Midiformer,通过结合N-gram方法实现符号音乐序列的理解。该方法首先利用我们提出的无监督复合策略将音乐作品处理为类似词的序列,随后采用N-gram Transformer编码器,该编码器能有效融合N-gram信息以增强主编码器对音乐序列的理解能力。在大规模音乐数据集上的预训练过程使模型能够充分学习音乐序列中包含的N-gram信息,并在微调阶段应用这些信息进行推理。多数据集实验证明了本方法的有效性,并在系列音乐理解下游任务中取得了最先进性能。代码与模型权重将于https://github.com/WouuYoauin/NG-Midiformer 公开。