Video2Music: Suitable Music Generation from Videos using an Affective Multimodal Transformer model

Jaeyong Kang, Soujanya Poria, Dorien Herremans · DOI

Abstract

Generating background music that aligns with the visual and emotional narrative of a video remains a significant challenge in AI. This paper introduces Video2Music, a framework designed to generate synchronized background music by leveraging an Affective Multimodal Transformer (AMT). By utilizing a novel Affective Matching Loss and the newly curated MuVi-Sync dataset, the system ensures that generated chord sequences and performance dynamics (loudness and density) are semantically and emotionally coherent with the input video.

Introduction

Finding suitable royalty-free music for video content is often a tedious manual process. While generative AI for music has advanced, most models are "video-blind," failing to synchronize musical tempo, mood, and structural cuts with visual content. Existing multimodal approaches often lack a deep understanding of affective alignment—the emotional resonance between sound and image. Furthermore, the field suffers from a scarcity of high-quality, synchronized datasets pairing video with symbolic music representations like MIDI. Video2Music addresses these gaps by explicitly modeling the emotional "flow" of video to guide music generation.

Methods

The Video2Music framework operates through a multi-stage pipeline encompassing feature extraction, sequence generation, and performance modeling.

Feature Extraction and Dataset

The system extracts four primary visual features from video frames:

  • Semantic: Scene understanding via CLIP.
  • Motion: Energy levels calculated from RGB frame differences.
  • Scene Offsets: Structural detection of video cuts.
  • Emotion: Mood classification (e.g., exciting, sad, relaxing) using CLIP probabilities.

Training is conducted on MuVi-Sync, a curated dataset of 748 professionally synchronized music videos, annotated with transcribed chords, keys, and MIDI files.

Affective Multimodal Transformer (AMT)

The core architecture is an encoder-decoder Transformer. The encoder processes extracted video features, while the decoder generates chord sequences. A key innovation is the Affective Matching Loss, which penalizes the model for predicting chords that do not align with the video's emotional label (e.g., predicting a major chord for a "sad" scene), based on established music psychology mappings.

Post-Processing and Performance

To transform static chords into expressive music, a bi-directional Gated Recurrent Unit (bi-GRU) regression model estimates note density and loudness based on visual features. These parameters control the final MIDI arpeggiation, ensuring the "performance" matches the visual energy (e.g., faster arpeggios for high-motion scenes).

Overview of the Video2Music framework, illustrating the training, inference, and post-processing phases.

Results

Video2Music was evaluated against standard Transformers and video-agnostic Music Transformers.

  • Objective Metrics: The AMT model achieved a Hits@3 score of 0.7722, outperforming the baseline Music Transformer (0.7303).
  • Affective Alignment: The Affective Matching Loss significantly improved emotional consistency, reducing the mismatch score from 1.8795 to 0.4662.
  • Subjective Evaluation: In a user study (n=21), Video2Music received higher ratings for Overall Music Quality (4.2/7) and Music-Video Correspondence (3.6/7) compared to baseline models.

Discussion and Conclusion

The success of Video2Music highlights the importance of using emotion as a bridge between visual and auditory modalities. By focusing on chord progressions rather than raw MIDI, the model maintains harmonic coherence despite noise in transcription data. However, limitations remain, such as the lack of lead melodies and occasional repetitiveness in arpeggiation. Future work will explore direct audio generation and multi-track synthesis (drums, bass, melody) to create richer, more complex soundtracks.

Summary updated

BibTeX
@article{kang2024video,
  author = {Jaeyong Kang and Soujanya Poria and Dorien Herremans},
  title = {{Video2Music: Suitable Music Generation from Videos using an Affective Multimodal Transformer model}},
  journal = {Expert Systems with Applications},
  year = {2024},
  doi = {10.1016/j.eswa.2024.123640},
}
Figure