Foleygen: Visually-Guided Audio Generation

Xinhao Mei, Varun Nagaraja, Gaël Le Lan, Zhaoheng Ni, Ernie Chang, Yangyang Shi, Vikas Chandra

TL;DR

FoleyGen is a state-of-the-art video-to-audio (V2A) generation system that uses a Transformer-based language modeling approach to create realistic, synchronized soundscapes for open-domain videos. By leveraging neural audio codecs (EnCodec) and optimized visual attention mechanisms, it significantly outperforms previous models in both objective audio quality and human-perceived relevance.

What Problem Does This Paper Address?

In the film industry, "Foley artists" create ambient sounds and sound effects to match the action on screen. Automating this—known as Video-to-Audio (V2A) generation—is notoriously difficult for three main reasons:

  1. High Dimensionality: Both video and audio contain massive amounts of data that must be processed simultaneously.
  2. Temporal Synchronization: A footstep or a glass breaking must happen at the exact millisecond the visual action occurs.
  3. Visual Irrelevance: Real-world videos often feature sounds from objects that aren't actually visible (e.g., a bird chirping off-screen), making it hard for a model to know what to "hear" based only on what it "sees."

Previous attempts often relied on spectrograms (which lose quality during conversion) or were limited to specific categories like "indoor scenes." FoleyGen aims to solve these issues for "open-domain" video—meaning any video, anywhere.

Methods

FoleyGen adopts a language modeling paradigm, treating audio generation like a text-prediction task. Its architecture consists of three main pillars:

  • Neural Audio Codec (EnCodec): Instead of using messy spectrograms, the researchers used EnCodec to compress raw audio waveforms into discrete "tokens." This allows the model to work with a "vocabulary" of sounds and reconstruct high-fidelity audio without needing a separate vocoder.
  • Visual Encoder: The model uses a pretrained visual backbone (like CLIP or ImageBind) to extract features from video frames. These features act as the "prompt" for the audio generation.
  • Transformer Decoder: This is the brain of the system. It takes the visual features and predicts the sequence of audio tokens. To handle multiple streams of audio data efficiently, it uses a "delay pattern" (originally seen in MusicGen) to process tokens in parallel.

The Attention Experiments

The authors specifically experimented with how the model "looks" at the video while generating sound:

  • All-Frame Attention: The model can look at all video frames (past and future) to generate any given audio token.
  • Causal Attention: The model only looks at video frames that occurred at or before the current audio timestamp.
  • Frame-Specific Attention: The model is forced to look only at the video frame happening at that exact moment.

Datasets

The researchers used VGGSound, a massive dataset containing roughly 200,000 10-second YouTube clips covering a vast range of audio-visual categories. After accounting for deleted videos, they trained on approximately 160,000 samples and tested on 13,000.

Key Insights and Ideas

  • Global Context Wins: Surprisingly, All-Frame Attention performed the best. While one might think "Frame-Specific" attention would force better synchronization, the model actually benefits from seeing the "big picture" of the video to understand the context of the sound it should produce.
  • Multi-modal Pretraining is Key: Visual encoders trained on both images and text (like CLIP) or multiple modalities (like ImageBind) performed better than those trained on video alone (like VideoMAE). This suggests that a semantic understanding of the world helps the model "guess" the right sounds.
  • Codec Efficiency: By using EnCodec, the model avoids the "fidelity loss" common in older systems that converted audio to images (spectrograms) and back. This leads to much crisper, more realistic audio.

Key Results

FoleyGen represents a massive leap over previous state-of-the-art models like SpecVQGAN and IM2WAV:

  • Fréchet Audio Distance (FAD): FoleyGen achieved a score of 1.65, a dramatic improvement over IM2WAV’s 6.41 (lower is better, indicating the generated audio is closer to real-world distributions).
  • Human Evaluation: In "Overall Quality" (OVR) tests, human listeners preferred FoleyGen's output 77.7% of the time, compared to just 16.7% for the previous best system.
  • Relevance: The "ImageBind Score" (which measures how well the audio matches the video semantically) was significantly higher for FoleyGen, confirming the sounds aren't just high-quality, but also "correct" for the scene.

Limitations and Future Work

Despite the progress, the authors note that temporal alignment remains a "persistent challenge." While FoleyGen is better than its predecessors, humans are incredibly sensitive to audio-visual lag. Sometimes the model still fails to capture very fast, prominent actions (like a quick snap or a specific click).

Future research will likely focus on "temporal cohesion"—finding new ways to "lock" the audio tokens to specific visual triggers even more tightly than current attention mechanisms allow.

Summary updated

BibTeX
@inproceedings{mei2024foleygen,
  author = {Xinhao Mei and Varun Nagaraja and Gaël Le Lan and Zhaoheng Ni and Ernie Chang and Yangyang Shi and Vikas Chandra},
  title = {{Foleygen: Visually-Guided Audio Generation}},
  booktitle = {MLSP},
  year = {2024},
  url = {https://openreview.net/forum?id=s8N7oTDUmD},
}
Figure