Learning General Audio Representations with Large-Scale Training of Patchout Audio Transformers

Khaled Koutini, Shahed Masoudian, Florian Schmid, Hamid Eghbal-zadeh, Jan Schlüter, Gerhard WidmerarXiv 2022

TL;DR

The Patchout Audio Transformer (PaSST) is a highly efficient model that learns powerful, general-purpose audio representations by pre-training on the massive AudioSet dataset. By introducing "Patchout" regularization and disentangled positional encodings, the authors created a model that outperforms traditional CNNs and previous transformers across 19 diverse audio tasks while being significantly faster and more memory-efficient to train.

What Problem Does This Paper Address?

Deep learning in audio often hits a wall: high-quality labeled data is expensive and scarce for specific niche tasks. The standard solution is "transfer learning"—taking a model pre-trained on a massive dataset like AudioSet and using it as a feature extractor.

However, the field has faced a dilemma. Convolutional Neural Networks (CNNs), the long-standing workhorse, struggle to capture long-range dependencies in audio. Transformers, which excel at these dependencies, are notoriously "data-hungry" and computationally expensive because their complexity grows quadratically with the length of the audio sequence. Furthermore, standard transformers struggle with variable-length audio inputs. This paper introduces PaSST to solve these efficiency and generalization hurdles.

Methods

The authors build upon the Vision Transformer (ViT) architecture but introduce two critical innovations:

  1. Patchout Regularization: During training, the model randomly "drops" parts of the input spectrogram patches (either randomly or in entire rows/columns). This serves two purposes: it acts as a strong regularizer (forcing the model to learn from incomplete data) and it drastically reduces the sequence length, making training much faster and less memory-intensive.
  2. Disentangled Positional Encodings: Unlike standard transformers that use a single 2D positional bias, PaSST separates time and frequency encodings. This allows the model to handle audio clips of different lengths during inference by simply cropping the time encoding, eliminating the need for complex interpolation or retraining.
The PaSST architecture highlights disentangled encodings and the Patchout mechanism.

The researchers also investigated which "level" of the model produces the best features for downstream tasks: High-level (final classification logits), Mid-level (embeddings from the transformer blocks), or Low-level (raw Mel-spectrogram features).

Datasets

  • Pre-training: The models were trained on AudioSet, a massive collection of ~2 million 10-second YouTube clips covering 527 sound classes.
  • Evaluation: To test "general-purpose" utility, the authors used the HEAR 2021 (Holistic Evaluation of Audio Representations) benchmark. This includes 19 tasks across three domains:
  • Speech: e.g., Speech Commands, emotion recognition (CREMA-D).
  • Music: e.g., pitch detection (NSynth), genre classification (GTZAN).
  • General: e.g., environmental sound (ESC-50), sound event detection (FSD50K).

Key Insights and Ideas

  • Efficiency is a Feature: Patchout isn't just a speed hack; it's a performance booster. By reducing the sequence length, PaSST-S achieves state-of-the-art results on AudioSet while being 4x faster to train than previous transformer models like AST.
  • The "Goldilocks" Feature Level: Mid-level features generally provide the best representations for downstream tasks. High-level logits are often too specialized to the 527 AudioSet classes, losing information useful for unrelated tasks like speech or music.
  • Music Needs Low-Level Detail: For tasks requiring fine-grained temporal or frequency information (like pitch estimation in the MAESTRO dataset), adding low-level Mel features to the embeddings significantly improved results.
  • Resolution Matters (to a point): Increasing the temporal resolution (using a smaller STFT hop size) helps with speech and environmental sounds but hits diminishing returns at very high resolutions (e.g., 3ms), where the computational cost outweighs the marginal gains.

Key Results

PaSST demonstrated superior performance compared to established CNN-based models like PANNs and OpenL3.

  • AudioSet Performance: PaSST-S achieved a mean Average Precision (mAP) of 0.471, outperforming both CNN14 and the original AST model.
  • Speed: As shown in the figure below, PaSST variants occupy the "sweet spot" of high performance and high training speed.
  • HEAR Benchmark: The improved PaSST version (using mid-level features and 5ms hop size) ranked among the top models in the HEAR 2021 challenge, proving its versatility across speech, music, and general audio.
Performance (mAP) vs. Training Speed. PaSST variants outperform CNNs and previous transformers while being significantly faster.

Limitations and Future Work

  • The 10-Second Ceiling: Because the model was trained on 10-second clips, the learned time encodings only cover that duration. For longer audio, the authors currently use a windowing and averaging approach. Developing native support for much longer sequences is a target for future research.
  • Complexity vs. Resolution: While higher temporal resolution helps, it leads to a quadratic increase in memory and compute. Finding more efficient ways to handle high-resolution spectrograms remains a challenge.
  • Self-Supervised Learning: This work focused on supervised pre-training. The authors suggest that combining PaSST with self-supervised objectives (which don't require labels) could further improve representation quality.

Summary updated

Abstract

The success of supervised deep learning methods is largely due to their ability to learn relevant features from raw data. Deep Neural Networks (DNNs) trained on large-scale datasets are capable of capturing a diverse set of features, and learning a representation that can generalize onto unseen tasks and datasets that are from the same domain. Hence, these models can be used as powerful feature extractors, in combination with shallower models as classifiers, for smaller tasks and datasets where the amount of training data is insufficient for learning an end-to-end model from scratch. During the past years, Convolutional Neural Networks (CNNs) have largely been the method of choice for audio processing. However, recently attention-based transformer models have demonstrated great potential in supervised settings, outperforming CNNs. In this work, we investigate the use of audio transformers trained on large-scale datasets to learn general-purpose representations. We study how the different setups in these audio transformers affect the quality of their embeddings. We experiment with the models' time resolution, extracted embedding level, and receptive fields in order to see how they affect performance on a variety of tasks and datasets, following the HEAR 2021 NeurIPS challenge evaluation setup. Our results show that representations extracted by audio transformers outperform CNN representations. Furthermore, we will show that transformers trained on Audioset can be extremely effective representation extractors for a wide range of downstream tasks.
BibTeX
@misc{koutini2022learning,
  author = {Khaled Koutini and Shahed Masoudian and Florian Schmid and Hamid Eghbal-zadeh and Jan Schlüter and Gerhard Widmer},
  title = {{Learning General Audio Representations with Large-Scale Training of Patchout Audio Transformers}},
  year = {2022},
  eprint = {2211.13956},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.13956},
}

Loading related content...

Figure