Interactive Audio-text Representation for Automated Audio Captioning with Contrastive Learning

Chen Chen, Nana Hou, Yuchen Hu, Heqing Zou, Xiaofeng Qi, Eng Siong ChngarXiv 2022 · DOI

Introduction

Automated Audio Captioning (AAC) is a multimodal task that requires a model to interpret complex audio signals and generate descriptive natural language (e.g., "A dog barks while a car passes by"). Traditionally, this task is approached using an encoder-decoder framework where an audio encoder extracts features from a signal and a text decoder generates the corresponding sentence.

However, a significant bottleneck in current AAC systems is the "domain gap" or misalignment between modalities. Most audio encoders are pre-trained on purely acoustic tasks, such as sound event detection on AudioSet. While these encoders excel at identifying acoustic patterns, they often fail to capture the semantic nuances required for high-quality language generation. This paper introduces CLIP-AAC, a framework designed to bridge this gap by producing audio features that are inherently "aware" of their textual counterparts through contrastive learning.

Methodology

Dual-Head Encoder Architecture

CLIP-AAC utilizes a dual-head encoder strategy to align audio and text in a shared embedding space during the training phase:

  1. Audio-head: This component employs an ESResNeXt architecture to process log-power spectrograms. It transforms raw acoustic data into deep representations that capture the temporal and spectral characteristics of the sound.
  2. Text-head: A 12-layer Transformer is used to extract semantic features from ground-truth captions. This head is only active during the training process to guide the audio encoder.

Contrastive Learning Objective

The core innovation of CLIP-AAC is the application of a Contrastive Loss ($L_{cl}$), inspired by the CLIP (Contrastive Language-Image Pre-training) model. During training, the model calculates the cosine similarity between audio and text embeddings within a batch. The objective is to maximize the similarity between an audio clip and its specific caption (positive pairs) while minimizing the similarity between that clip and all other captions in the batch (negative pairs).

By optimizing this loss, the audio encoder learns to prioritize features that are semantically relevant to human language, effectively "pre-aligning" the audio data for the decoder.

Decoder and Training Strategy

The aligned features from the audio-head are passed to a Transformer decoder. The decoder employs cross-attention mechanisms to interact with these text-aware audio features to predict the caption word-by-word.

The model is initialized with weights from AudioCLIP, a model already pre-trained on audio, text, and images. The final training objective is a weighted combination of the Contrastive Loss (for alignment) and the standard Cross-Entropy Loss (for word prediction accuracy).

Experimental Setup

The researchers evaluated CLIP-AAC on the Clotho (v2) dataset, a standard benchmark for audio captioning. The dataset consists of:

  • Training set: 4,884 audio clips (15–30 seconds each) with 24,420 captions.
  • Test set: 1,045 audio clips with 5,225 captions. Each audio clip is paired with five unique human-annotated captions to ensure linguistic diversity and robustness in evaluation.

Results and Key Insights

CLIP-AAC demonstrated superior performance across all major NLP metrics, including BLEU, METEOR, ROUGEL, CIDEr, and SPICE.

  • State-of-the-Art Performance: The model achieved a SPIDEr score of 0.263 (the primary metric for AAC, combining CIDEr and SPICE). This significantly outperformed the GRU baseline (0.054) and the previous state-of-the-art "TL + RLSSR" model (0.246).
  • Ablation Studies: Removing the contrastive loss component led to a sharp decline in performance, confirming that the cross-modal alignment is the primary driver of the model's success.
  • Batch Size Sensitivity: The study found that larger batch sizes (up to 16) improved results. In contrastive learning, larger batches provide more "negative examples," which forces the model to learn finer distinctions between similar acoustic environments.
  • Inference Efficiency: At inference time, the text-head is discarded. The audio-head, having already learned to produce text-aware features, can generate accurate captions without needing text input, maintaining computational efficiency during deployment.

Conclusion

CLIP-AAC demonstrates that the key to improving automated audio captioning lies not just in the complexity of the decoder, but in the semantic quality of the audio representations. By using contrastive learning to bridge the sound-text gap, the model produces features that are better suited for translation into natural language. Future work may explore scaling this approach to larger, noisier datasets and investigating iterative refinement techniques to further enhance caption accuracy.

Summary updated

BibTeX
@misc{chen2022interactive,
  author = {Chen Chen and Nana Hou and Yuchen Hu and Heqing Zou and Xiaofeng Qi and Eng Siong Chng},
  title = {{Interactive Audio-text Representation for Automated Audio Captioning with Contrastive Learning}},
  year = {2022},
  eprint = {2203.15526},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.15526},
}
Figure