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/CinqueOrigin/NG-Midiformer.
翻译:将深度学习技术应用于符号音乐理解的首要步骤,是将音乐作品(主要为MIDI格式)转换为预定义标记序列,如音符音高、音符力度及和弦等。随后,这些序列被输入到神经序列模型中以完成特定任务。音乐序列中相邻元素间存在强相关性,这使其成为自然语言处理(NLP)中N-gram技术的理想应用对象。以古典钢琴音乐为例:特定旋律可能在整首作品中反复出现,且每次出现都带有细微变化。本文提出了一种新颖方法——NG-Midiformer,用于理解符号音乐序列。该方法采用N-gram技术,首先通过我们提出的无监督复合方法将音乐作品处理成类似单词的序列,随后使用我们的N-gram Transformer编码器有效融合N-gram信息,以增强主编码器对音乐序列的理解能力。在大规模音乐数据集上的预训练过程使模型能够充分学习音乐序列中蕴含的N-gram信息,并在微调阶段利用这些信息进行推理。在多个数据集上的实验证明了我们方法的有效性,并在多项音乐理解下游任务中取得了最先进性能。代码与模型权重将在https://github.com/CinqueOrigin/NG-Midiformer 公开发布。