A Transformer-based Audio Captioning Model with Keyword Estimation

Yuma Koizumi, Ryo Masumura, Kyosuke Nishida, Masahiro Yasuda, Shoichiro Saito

TL;DR

TRACKE is a novel Transformer-based model for automated audio captioning that simultaneously predicts descriptive keywords and generates natural language descriptions from audio. By predicting keywords like "bird" or "machine" directly from the sound, it guides the text generation process and significantly reduces the ambiguity of word choices, achieving state-of-the-art performance on standard benchmarks.

What Problem Does This Paper Address?

Automated Audio Captioning (AAC) involves translating environmental sounds into textual descriptions. Unlike Automatic Speech Recognition (ASR), where sounds map almost one-to-one to phonemes and words, AAC suffers from word-selection indeterminacy. A single acoustic event (e.g., a car passing) can be validly described using many different words, such as \{car, automobile, vehicle, wheels\} or \{road, street, highway\}.

This combinatorial explosion of possible descriptions makes training AAC models incredibly difficult. While prior methods relied on human-provided metadata or keywords to narrow down the vocabulary space, this isn't practical for real-world applications like smart speakers where a user cannot provide keywords in advance. This paper tackles the challenge of generating accurate captions without requiring pre-defined keyword inputs.

Methods

The authors introduce TRACKE (Transformer-based audio-captioning model with Keyword Estimation), marking the first application of the Transformer architecture to the AAC task.

The model architecture consists of three main components:

  1. Audio & Text Embeddings: Audio features are extracted using a pre-trained VGGish network, while text tokens are embedded using fastText.
  2. Keyword-Estimation Branch: TRACKE's encoder includes a specialized branch that performs weakly supervised polyphonic Acoustic Event Detection (AED). It estimates the probability of specific keywords occurring at each time frame and uses global max pooling to aggregate these predictions across the entire audio clip, selecting the top-$K$ most likely keywords.
  3. Keyword-Conditioned Decoder: The estimated keywords are embedded and concatenated with the encoder's audio features. The Transformer decoder then uses multi-head attention to look at both the acoustic features and the predicted keywords simultaneously, guiding word selection during caption generation.

The entire system is trained end-to-end with a joint loss function that minimizes both caption generation error (cross-entropy) and keyword estimation error (weighted binary cross-entropy).

Architecture of TRACKE and its keyword-estimation branch

Datasets

The model was evaluated on the Clotho dataset, which was featured as the standard benchmark for the DCASE 2020 Challenge Task 6. The dataset consists of audio clips sourced from the Freesound platform:

  • Development/Training split: 2,893 audio clips (each with 5 ground-truth captions).
  • Evaluation/Testing split: 1,045 audio clips (each with 5 ground-truth captions).

Key Insights and Ideas

  • Explicit Bottlenecks Tame Ambiguity: While previous models used deep acoustic features to implicitly capture scene context, TRACKE explicitly predicts discrete keywords. This explicit bottleneck acts as a powerful regularizer that tames the word-selection indeterminacy problem.
  • Exploiting Real-World Co-occurrence: Interestingly, the keyword branch learns implicit real-world relationships rather than just acoustic mappings. For instance, when evaluating a door opening/closing sound, the model assigns a high probability to the keyword "person", even if no human sounds (like speech or footsteps) are present in the audio. It successfully leverages the learned co-occurrence that doors are typically operated by humans.
  • The "Just Right" Keyword Count: Predicting too many keywords ($K=10$ vs $K=5$) actually degrades performance, reverting the model back to standard Transformer levels. This confirms that a concise, accurate set of keywords is crucial for effectively restricting the text generation search space.

Key Results

TRACKE achieved state-of-the-art performance on the Clotho dataset, outperforming the DCASE 2020 baseline and standard sequence-to-sequence models across all major evaluation metrics (including BLEU, CIDEr, METEOR, ROUGE-L, SPICE, and SPIDEr).

  • SPIDEr Score: TRACKE scored 17.7, compared to the DCASE baseline of 5.4, a standard LSTM approach (15.6), and a keyword-less Transformer (16.2).
  • Close to Oracle Performance: TRACKE achieved 97.4% of the ROUGE-L performance of an "Oracle" system supplied with manual, human-annotated keywords, proving its viability as a fully automated system.
Examples of TRACKE outputs, spectrograms, and attention matrices

Limitations and Future Work

  • Keyword Accuracy Bottleneck: The keyword estimation accuracy currently sits at 48.1%. Improving this sub-task is the most direct path to boosting overall captioning quality.
  • Fixed Keyword Count: The model relies on a fixed hyperparameter $K$ for the number of predicted keywords. In reality, some audio clips contain many distinct events while others contain only one. Dynamically estimating $K$ from the audio remains an open challenge.
  • Data Scarcity: Transformers thrive on massive datasets. The Clotho dataset is relatively small compared to machine translation datasets (which often feature millions of sentences), meaning the full potential of the Transformer architecture in AAC remains to be unlocked with larger-scale data.

Summary updated

BibTeX
@inproceedings{koizumi2020transformer,
  author = {Yuma Koizumi and Ryo Masumura and Kyosuke Nishida and Masahiro Yasuda and Shoichiro Saito},
  title = {{A Transformer-based Audio Captioning Model with Keyword Estimation}},
  booktitle = {Interspeech},
  year = {2020},
  doi = {10.21437/interspeech.2020-2087},
}
Figure