Few-Shot Drum Transcription in Polyphonic Music

Yu Wang, Justin Salamon, Mark Cartwright, Nicholas J. Bryan, Juan Pablo Bello

This paper, presented at ISMIR 2020, introduces a flexible new way to handle one of the trickiest tasks in music information retrieval: transcribing drums in complex, polyphonic recordings.

TL;DR

The authors propose a "few-shot" learning approach to drum transcription that allows a model to recognize any percussion instrument—even those never seen during training—given just a few user-provided examples. By using Prototypical Networks, they match state-of-the-art performance on standard drum kits while enabling "open-vocabulary" transcription for rare or fine-grained instruments.

What Problem Does This Paper Address?

Automatic Drum Transcription (ADT) is the process of converting audio into a symbolic format (like MIDI). Most existing ADT systems are "closed-set": they are trained to recognize a fixed, small vocabulary of sounds—typically just the bass drum, snare, and hi-hat.

This leads to three major issues:

  1. Out-of-vocabulary (OOV) failure: If a song features a cowbell, maracas, or a non-Western percussion instrument, a standard model simply cannot "see" it.
  2. Granularity mismatch: Models often group all "toms" together, even if a producer needs to distinguish between high, mid, and low floor toms.
  3. Generalization: Supervised models often struggle with the massive variety of drum sounds across different genres (e.g., a jazz snare vs. an 808 snare).

Methods

The researchers shift the paradigm from standard classification to metric learning. Instead of teaching a model to say "this is a snare," they teach it to say "these two sounds are similar."

The Prototypical Network

The core of the system is a Prototypical Network. During training, the model learns to project audio snippets into a high-dimensional embedding space where similar sounds cluster together.

At inference time, the system uses a search-by-example workflow:

  1. A user selects a few (e.g., five) target examples of a specific drum sound within a track.
  2. The model calculates a "prototype" (the mean embedding) for these examples.
  3. The model then scans the rest of the track, calculating the distance between every audio frame and that prototype to generate a likelihood curve.
  4. Finally, peak-picking is used to identify the exact onset times.
Figure 1. Few-shot drum transcription. We input a music recording and one or more target example sounds into our trained model, output the likelihood of the selected event over time, and then post-process to generate onset times per percussion instrument.

The backbone of this system is a 4-block Convolutional Neural Network (CNN) that transforms log-Mel-spectrograms into 1024-dimensional embeddings.

Figure 2. Our backbone prototypical network embedding model architecture.

Datasets

  • Training: Slakh2100, a massive synthetic dataset (145 hours) synthesized from MIDI. It provides a diverse range of 282 percussion classes, essential for teaching the model a general sense of "percussiveness."
  • Evaluation: The model was tested on three real-world datasets:
  • ENST-Drums: Standard studio recordings.
  • MDB-Drums: Fully produced tracks with fine-grained annotations.
  • RBMA13: A particularly difficult set of electronic and diverse music tracks known for high intra-class variation.

Key Insights and Ideas

  • Adaptation over Generalization: Traditional models try to learn what every snare drum in the world sounds like. This few-shot approach only cares what the snare drum in this specific track sounds like. By anchoring the detection to user-provided examples from the same recording, the model becomes much more robust to stylistic variations.
  • The Polyphony Mismatch: A fascinating finding was how the "business" of the audio affects performance. If a user picks a "clean" target example (where only the drum is playing), the model is great at finding other clean hits but struggles when other instruments overlap. Conversely, picking "busy" examples helps find overlaps but increases false positives.
  • Zero-Shot to Few-Shot: The model successfully transcribed instruments like Maracas that were completely absent from the training data, proving that the embedding space captures fundamental acoustic properties of percussion.

Key Results

  • Matching the SOTA: In a fixed 18-class vocabulary test, the few-shot model performed comparably to a state-of-the-art supervised CRNN.
  • Outperforming on Hard Data: On the diverse RBMA13 dataset, the few-shot model significantly outperformed the supervised baseline (Macro F-measure of 0.81 vs 0.64*). This suggests that the "search-by-example" approach is superior for genres with unconventional drum sounds.
  • Open Vocabulary: The model maintained high performance even when the vocabulary was expanded to include all 21+ classes in the test sets, a task the baseline model literally cannot perform.
Figure 3. F-measure for each percussion instrument in the RBMA13 dataset. (Left) Under 18-class vocabulary. (Right) Under all 21 classes. For each instrument, we show the metrics computed with target examples included (dark bar) and excluded (light bar).

Limitations and Future Work

The primary limitation is the human-in-the-loop requirement. While traditional ADT is fully automatic, this system requires a user to manually label a few hits.

Future work aims to:

  • Automate Example Selection: Can the model suggest which hits the user should label to get the best results?
  • Polyphony Robustness: As shown in the breakdown below, performance varies wildly based on the polyphony of the target and query. Improving the model's ability to "de-mix" these embeddings is a clear next step.
Figure 4. Break down F-measure by polyphony in both target and query examples.

Summary updated

BibTeX
@inproceedings{wang2020few,
  author = {Yu Wang and Justin Salamon and Mark Cartwright and Nicholas J. Bryan and Juan Pablo Bello},
  title = {{Few-Shot Drum Transcription in Polyphonic Music}},
  booktitle = {ISMIR},
  year = {2020},
}
Figure