Howard-149/Beyond-Audio-Visual

0

stars

1

commits

Python

primary language

Aug 4, 2026

updated

Browse cluster: Multimodal Emotion Recognition

README

Multimodal Emotion Recognition (EmoMV)

Code for multimodal emotion recognition on user-generated music videos (EmoMV), combining audio, video (face), lyrics, and comments.

Scope of this repo: you prepare the data; we provide feature extractors, the unified embedding/CSV formats, and the multimodal trainer.

python multimodal_classifier.py --mode train ...

This repository supports the Interspeech 2026 work Beyond Audio-Visual: Unlocking the Value of Metadata for Emotion Recognition in User-Generated Content.

What this repo does / does not ship

We shipWe do not ship
Feature extractors (MER/, VER/, TER/)Raw videos, lyrics dumps, comment scrapes
Format specs (CSV_MANIFEST_SPECIFICATION.md, EMBEDDING_FORMAT.md)Download / scrape / get_* collectors
multimodal_classifier.py + models/Precomputed .pt features (gitignored)

Assume train/val/test media (and optional lyrics/comment text) are already on disk with labels. Then run extractors → manifests → train.

Environments (two are enough)

pip install -e . only registers local packages for imports — it does not install third-party deps. Run it once inside each env.

EnvHow to installUse for
VER (conda)conda env create -f VER/environment.ymlconda activate VERVideo extraction; training / eval (multimodal_classifier.py)
MER (pip)Python ≥3.10 + pip install -r MER/requirements.txtAudio extraction; lyrics/comments text embedding (TER/)
# --- Env 1: VER (video + train) ---
conda env create -f VER/environment.yml
conda activate VER
cd /path/to/ER && pip install -e .
python VER/extract_EmoMV.py ...
python multimodal_classifier.py --mode train ...

# --- Env 2: MER (audio + text embeddings) ---
conda create -n MER python=3.10 -y && conda activate MER
cd /path/to/ER
pip install -r MER/requirements.txt && pip install -e .
python MER/extract_EmoMV.py ...
python TER/text_embedding_extract.py ...
python TER/extract_comment_embeddings.py ...

Notes:

  • VER includes torch / pandas / wandb plus the face stack (dlib, emotiefflib, opencv, …). Using it for training avoids a third env.
  • MER is for HuggingFace audio/text (torchaudio, transformers). Face extraction will not work there.

Preparing your data

Bring your own splits. Extractors and the trainer only need consistent keys (clip ids) and labels.

Raw inputs (before extraction)

ModalityPrepareNotes
AudioPer-clip audio (or extractable from video) + labelEmoMV-style annotation CSV + --data_root for MER/extract_EmoMV.py
VideoPer-clip video files under a media root + labelsVER/extract_EmoMV.py --input-base … discovers train/val/test
LyricsPer-clip text (e.g. JSON/file) listed in text_{split}.csv with columns key, lyrics_path, text_labelThen TER/text_embedding_extract.py
CommentsPer-clip JSON with comments[].text + labelsThen TER/extract_comment_embeddings.py

EmoMV emotion labels (5-way): exciting, fear, tense, sad, relax (indices 0–4).

After extraction — CSV manifests the trainer reads

ModalityColumns
Audiokey,feature_path,audio_label
Videokey,feature_path,video_label
Lyrics / commentskey,feature_path,text_label (or lyrics_label / comments_label)

.pt files use EmbeddingSchema v1 (utils/embedding_schema.py). Full details:

ModalityExtractorEnvExample feature root
VideoVER/extract_EmoMV.pyVERVER/EmoMV_mean_features_-1_10/Dataset1/
AudioMER/extract_EmoMV.pyMERMER/EmoMV_features/mert/Dataset1/
Lyrics / commentsTER/text_embedding_extract.py, TER/extract_comment_embeddings.pyMERTER/csvs/, TER/comment_features/

Quick start (classifier)

Features already extracted; activate VER:

conda activate VER
pip install -e .   # once per env

python multimodal_classifier.py --mode train \
  --video-root-dir VER/EmoMV_features_-1_10/Dataset1 \
  --audio-root-dir MER/EmoMV_features/mert/Dataset1 \
  --lyrics-root-dir TER/csvs \
  --comments-root-dir TER/comment_features \
  --fusion-type late_concat \
  --output-base outputs/multimodal_avt \
  --batch-size 16 --epochs 50 --allow-missing

Useful flags:

  • --fusion-typelate_concat, cross_attention_mean, video_query_cross_attention, or unimodal audio_only / video_only / lyrics_only / comments_only
  • --no-video / --no-audio / … — ablations
  • --cross-attn-q/k/v — query / key / value modalities
  • --use-wandb — Weights & Biases

Audio-only baseline:

python multimodal_classifier.py --mode train \
  --fusion-type audio_only \
  --audio-root-dir MER/EmoMV_features/mert/Dataset1 \
  --video-root-dir VER/EmoMV_features_-1_10/Dataset1 \
  --allow-missing --output-base outputs/audio_only \
  --batch-size 16 --epochs 50

More examples: docstring at the top of multimodal_classifier.py.

python test_fusion_api.py   # fusion unit tests, no data needed

Repository layout

multimodal_classifier.py   # ★ main train / eval entry
models/                    # encoders + fusion
data/multimodal.py         # join modalities by key
utils/embedding_schema.py  # EmbeddingSchema v1
VER/                       # video extraction (+ environment.yml)
MER/                       # audio extraction (+ requirements.txt)
TER/                       # lyrics / comment embedding extraction
moede/                     # optional MoEDE face experts (--model-name moede)
scripts/analyze_best_results.py
CSV_MANIFEST_SPECIFICATION.md
EMBEDDING_FORMAT.md

Pipeline (assuming data is ready)

  1. Audio (MER env) — MER/extract_EmoMV.py
  2. Video (VER env) — VER/extract_EmoMV.py
  3. Text (MER env) — TER/text_embedding_extract.py / TER/extract_comment_embeddings.py on your prepared text files
  4. Train (VER env) — multimodal_classifier.py

Citation

If you use this code, please cite the associated Interspeech 2026 paper:

Beyond Audio-Visual: Unlocking the Value of Metadata for Emotion Recognition in User-Generated Content.

Contributors

Howard-149

1 commits

Howard-149/Beyond-Audio-Visual

0

stars

1

commits

Python

primary language

Aug 4, 2026

updated

Browse cluster: Multimodal Emotion Recognition

README

Multimodal Emotion Recognition (EmoMV)

Code for multimodal emotion recognition on user-generated music videos (EmoMV), combining audio, video (face), lyrics, and comments.

Scope of this repo: you prepare the data; we provide feature extractors, the unified embedding/CSV formats, and the multimodal trainer.

python multimodal_classifier.py --mode train ...

This repository supports the Interspeech 2026 work Beyond Audio-Visual: Unlocking the Value of Metadata for Emotion Recognition in User-Generated Content.

What this repo does / does not ship

We shipWe do not ship
Feature extractors (MER/, VER/, TER/)Raw videos, lyrics dumps, comment scrapes
Format specs (CSV_MANIFEST_SPECIFICATION.md, EMBEDDING_FORMAT.md)Download / scrape / get_* collectors
multimodal_classifier.py + models/Precomputed .pt features (gitignored)

Assume train/val/test media (and optional lyrics/comment text) are already on disk with labels. Then run extractors → manifests → train.

Environments (two are enough)

pip install -e . only registers local packages for imports — it does not install third-party deps. Run it once inside each env.

EnvHow to installUse for
VER (conda)conda env create -f VER/environment.ymlconda activate VERVideo extraction; training / eval (multimodal_classifier.py)
MER (pip)Python ≥3.10 + pip install -r MER/requirements.txtAudio extraction; lyrics/comments text embedding (TER/)
# --- Env 1: VER (video + train) ---
conda env create -f VER/environment.yml
conda activate VER
cd /path/to/ER && pip install -e .
python VER/extract_EmoMV.py ...
python multimodal_classifier.py --mode train ...

# --- Env 2: MER (audio + text embeddings) ---
conda create -n MER python=3.10 -y && conda activate MER
cd /path/to/ER
pip install -r MER/requirements.txt && pip install -e .
python MER/extract_EmoMV.py ...
python TER/text_embedding_extract.py ...
python TER/extract_comment_embeddings.py ...

Notes:

  • VER includes torch / pandas / wandb plus the face stack (dlib, emotiefflib, opencv, …). Using it for training avoids a third env.
  • MER is for HuggingFace audio/text (torchaudio, transformers). Face extraction will not work there.

Preparing your data

Bring your own splits. Extractors and the trainer only need consistent keys (clip ids) and labels.

Raw inputs (before extraction)

ModalityPrepareNotes
AudioPer-clip audio (or extractable from video) + labelEmoMV-style annotation CSV + --data_root for MER/extract_EmoMV.py
VideoPer-clip video files under a media root + labelsVER/extract_EmoMV.py --input-base … discovers train/val/test
LyricsPer-clip text (e.g. JSON/file) listed in text_{split}.csv with columns key, lyrics_path, text_labelThen TER/text_embedding_extract.py
CommentsPer-clip JSON with comments[].text + labelsThen TER/extract_comment_embeddings.py

EmoMV emotion labels (5-way): exciting, fear, tense, sad, relax (indices 0–4).

After extraction — CSV manifests the trainer reads

ModalityColumns
Audiokey,feature_path,audio_label
Videokey,feature_path,video_label
Lyrics / commentskey,feature_path,text_label (or lyrics_label / comments_label)

.pt files use EmbeddingSchema v1 (utils/embedding_schema.py). Full details:

ModalityExtractorEnvExample feature root
VideoVER/extract_EmoMV.pyVERVER/EmoMV_mean_features_-1_10/Dataset1/
AudioMER/extract_EmoMV.pyMERMER/EmoMV_features/mert/Dataset1/
Lyrics / commentsTER/text_embedding_extract.py, TER/extract_comment_embeddings.pyMERTER/csvs/, TER/comment_features/

Quick start (classifier)

Features already extracted; activate VER:

conda activate VER
pip install -e .   # once per env

python multimodal_classifier.py --mode train \
  --video-root-dir VER/EmoMV_features_-1_10/Dataset1 \
  --audio-root-dir MER/EmoMV_features/mert/Dataset1 \
  --lyrics-root-dir TER/csvs \
  --comments-root-dir TER/comment_features \
  --fusion-type late_concat \
  --output-base outputs/multimodal_avt \
  --batch-size 16 --epochs 50 --allow-missing

Useful flags:

  • --fusion-typelate_concat, cross_attention_mean, video_query_cross_attention, or unimodal audio_only / video_only / lyrics_only / comments_only
  • --no-video / --no-audio / … — ablations
  • --cross-attn-q/k/v — query / key / value modalities
  • --use-wandb — Weights & Biases

Audio-only baseline:

python multimodal_classifier.py --mode train \
  --fusion-type audio_only \
  --audio-root-dir MER/EmoMV_features/mert/Dataset1 \
  --video-root-dir VER/EmoMV_features_-1_10/Dataset1 \
  --allow-missing --output-base outputs/audio_only \
  --batch-size 16 --epochs 50

More examples: docstring at the top of multimodal_classifier.py.

python test_fusion_api.py   # fusion unit tests, no data needed

Repository layout

multimodal_classifier.py   # ★ main train / eval entry
models/                    # encoders + fusion
data/multimodal.py         # join modalities by key
utils/embedding_schema.py  # EmbeddingSchema v1
VER/                       # video extraction (+ environment.yml)
MER/                       # audio extraction (+ requirements.txt)
TER/                       # lyrics / comment embedding extraction
moede/                     # optional MoEDE face experts (--model-name moede)
scripts/analyze_best_results.py
CSV_MANIFEST_SPECIFICATION.md
EMBEDDING_FORMAT.md

Pipeline (assuming data is ready)

  1. Audio (MER env) — MER/extract_EmoMV.py
  2. Video (VER env) — VER/extract_EmoMV.py
  3. Text (MER env) — TER/text_embedding_extract.py / TER/extract_comment_embeddings.py on your prepared text files
  4. Train (VER env) — multimodal_classifier.py

Citation

If you use this code, please cite the associated Interspeech 2026 paper:

Beyond Audio-Visual: Unlocking the Value of Metadata for Emotion Recognition in User-Generated Content.

Contributors

Howard-149

1 commits

Languages

Python

100.0%