Efficient Audio Captioning Transformer with Patchout and Text Guidance

Theodoris Kouzelis, Grigoris Bastas, Athanasios Katsamanis, Alexandros PotamianosarXiv 2023

Abstract

Automated audio captioning is a multi-modal translation task that aims to generate textual descriptions for a given audio clip. In this paper, we propose a full Transformer architecture that utilizes Patchout, significantly reducing computational complexity and avoiding overfitting. The caption generation is partly conditioned on textual AudioSet tags extracted by a pre-trained classification model, which is fine-tuned to maximize the semantic similarity between AudioSet labels and ground truth captions. To mitigate the data scarcity problem of Automated Audio Captioning (AAC), we introduce transfer learning from an upstream audio-related task and an enlarged in-domain dataset. Moreover, we propose a method to apply Mixup augmentation for AAC. Ablation studies investigate how Patchout and text guidance contribute to the final performance. The results show that the proposed techniques improve performance while reducing computational complexity. Our proposed method received the Judges Award at Task 6A of the DCASE Challenge 2022.

Introduction

Automated Audio Captioning (AAC) involves generating natural language descriptions for audio signals. This task is significantly more complex than simple audio classification; a model must not only identify sound events (e.g., "a dog barking") but also interpret their temporal relationships and intensities (e.g., "a dog barks loudly in the distance while a car passes by").

The field currently faces two major hurdles: data scarcity and computational complexity. High-quality datasets like Clotho are relatively small compared to those in image captioning. Furthermore, Transformers—the standard for sequence tasks—scale quadratically with input length. Since audio spectrograms can be extensive, training these models is computationally expensive and prone to overfitting. This paper presents the PACT (Patchout Audio Captioning Transformer) architecture to address these challenges.

Methodology

The PACT architecture introduces several novel components designed for efficiency and semantic accuracy:

  • PaSST Encoder with Patchout: The model utilizes the "Patchout faSt Spectrogram Transformer" (PaSST) as the encoder. This method extracts patches from the audio spectrogram but randomly drops a large portion of them (frequency bins and time frames) during training. This reduces sequence length and computational load while acting as a powerful regularizer.
  • Semantic Text Guidance: To steer the model, the authors provide guiding text via AudioSet tags. Crucially, the tagger is fine-tuned to predict labels with the highest semantic similarity to ground-truth captions, calculated using BERT embeddings.
  • Multimodal Conditioning: The Transformer decoder receives a concatenated sequence of both the audio patch embeddings and the embeddings of the predicted guiding text.
  • Embedding-Space Mixup: The authors implement Mixup by interpolating both the audio spectrograms and the caption embeddings in the latent space, forcing the model to learn more robust representations.
Overview of the PACT architecture featuring Patchout and semantic text guidance.

Experimental Setup

To overcome the small size of primary benchmarks, the researchers utilized a multi-stage transfer learning pipeline:

  1. General Pre-training: The PaSST backbone was pre-trained on ImageNet and AudioSet.
  2. In-domain Pre-training: The model was trained on an enlarged set including AudioCaps (~46,000 samples) and MACS (3,930 samples).
  3. Fine-tuning: Final optimization was performed on the Clotho v2 dataset (3,839 training clips).

Results and Discussion

The proposed system significantly outperformed the DCASE 2022 baseline across all major metrics on the Clotho evaluation split. The best-performing variant (PACT_2s) achieved a SPIDEr score of 0.296, representing a 27% improvement over the baseline.

Performance comparison of PACT variants against the baseline on the Clotho evaluation set.

Key insights from the study include:

  • Efficiency as Regularization: Dropping nearly half of the input sequence via Patchout during fine-tuning reduced complexity without losing performance. The "incomplete" sequence forced the model to learn more generalized audio features.
  • Semantic Alignment: Aligning AudioSet tags to the "vibe" of ground-truth captions using BERT made the text guidance significantly more effective at steering the decoder compared to using raw tags.

Conclusion

While PACT achieves state-of-the-art results, some limitations remain. The model relies on a frozen PaSST model for tags; errors in tagging can mislead the decoder. Future work may involve refining sampling strategies like Nucleus Sampling (top-p) to improve tag selection robustness. Despite these challenges, PACT demonstrates that combining efficient sequence processing with semantic guidance is a powerful approach for audio-to-text tasks.

Summary updated

BibTeX
@misc{kouzelis2023efficient,
  author = {Theodoris Kouzelis and Grigoris Bastas and Athanasios Katsamanis and Alexandros Potamianos},
  title = {{Efficient Audio Captioning Transformer with Patchout and Text Guidance}},
  year = {2023},
  eprint = {2304.02916},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.02916},
}
Figure