clamp2-music-retrieval-eval
CLaMP 2: Multimodal Music Information Retrieval Across 101 Languages Using Large Language Models — Shangda Wu et al. (2024) (arXiv:2410.13267, 2024)
What this evaluates
Evaluates a model's ability to classify symbolic music into genres, emotions, or composer styles, and to perform cross-modal semantic search between music scores (ABC/MIDI) and textual descriptions. It also probes multilingual retrieval capabilities by testing performance across machine-translated text queries.
Datasets
- WikiMT — total 1010; splits: test (1010)
- VGMIDI — total 204; splits: test (204)
- Pianist8 — total 411; splits: test (411)
- MidiCaps — total 1010; splits: test (1010)
Metrics
Accuracy (primary) — range: [0, 1]
- Proportion of correctly classified instances out of the total number of instances in the test set.
F1-macro — range: [0, 1]
- Unweighted mean of recall (or F1) for each class, treating all classes equally regardless of their support.
MRR (primary) — range: [0, 1]
- Mean Reciprocal Rank: average of 1/rank for the first correctly retrieved item across all queries.
HR@K — range: [0, 1]
- Hit Rate at top K: fraction of queries where the relevant item appears in the top K ranked results.
Input / output format
Input: Per instance: either a symbolic music representation (ABC notation or MIDI file) for classification, or a text query paired with a candidate music piece for semantic search.
Output: Per instance: a predicted class label (genre, emotion, or composer) for classification; or a ranked list of music-text pairs for retrieval.
Scoring recipe
def compute_metrics(predictions, gold_labels, ranked_lists=None):
if ranked_lists is None:
correct = sum(1 for p, g in zip(predictions, gold_labels) if p == g)
accuracy = correct / len(gold_labels)
f1_macro = average_f1_per_class(predictions, gold_labels)
return {'accuracy': accuracy, 'f1_macro': f1_macro}
else:
mrr_scores = []
hr_counts = {1: 0, 10: 0, 100: 0}
for ranks, gold in zip(ranked_lists, gold_labels):
rank = ranks.index(gold) + 1 if gold in ranks else len(ranks) + 1
mrr_scores.append(1.0 / rank)
for k in [1, 10, 100]:
if rank <= k:
hr_counts[k] += 1
mrr = sum(mrr_scores) / len(mrr_scores)
hr = {k: v / len(gold_labels) for k, v in hr_counts.items()}
return {'mrr': mrr, 'hr@1': hr[1], 'hr@10': hr[10], 'hr@100': hr[100]}
Common pitfalls
- Data leakage: The pre-training set includes the Lakh MIDI dataset, so the test set for MidiCaps must be carefully sampled (1,010 pieces) to avoid overlap with training data.
- Modality mismatch: Baseline models like CLaMP do not natively support MIDI, requiring conversion to ABC notation for fair comparison, which may lose performance details.
- Translation quality dependency: Multilingual retrieval results are heavily influenced by the quality of machine-translated queries, measured via BLEU scores of back-translations.
Evidence (verbatim from paper)
Table 1: Classification performance for ABC notation and MIDI was assessed across three datasets: WikiMT (1,010 pieces, 8 genres), VGMIDI (204 pieces, 4 emotions), and Pianist8 (411 pieces, 8 composers). Table 2 shows semantic search results on the WikiMT and MidiCaps benchmarks, using Mean Reciprocal Rank (MRR) and Hit Rate at Top K (HR@K) to assess model performance in retrieving and ranking relevant music-text pairs.
Citation
@misc{wu2024clamp2,
title={CLaMP 2: Multimodal Music Information Retrieval Across 101 Languages Using Large Language Models},
author={Shangda Wu et al. (2024)},
year={2024},
note={arXiv:2410.13267}
}
1---2name: clamp2-music-retrieval-eval3description: Evaluates a model's ability to classify symbolic music into genres, emotions, or composer styles, and to perform cross-modal semantic search between music scores (ABC/MIDI) and textual descriptions. It also probes multilingual retrieval capabilities by testing performance across machine-translated text queries. Use when the user wants to benchmark on WikiMT, VGMIDI, Pianist8, MidiCaps, or asks about evaluating this task. Reports Accuracy, MRR.4---56# clamp2-music-retrieval-eval78> CLaMP 2: Multimodal Music Information Retrieval Across 101 Languages Using Large Language Models — Shangda Wu et al. (2024) (arXiv:2410.13267, 2024)910## What this evaluates1112Evaluates a model's ability to classify symbolic music into genres, emotions, or composer styles, and to perform cross-modal semantic search between music scores (ABC/MIDI) and textual descriptions. It also probes multilingual retrieval capabilities by testing performance across machine-translated text queries.1314## Datasets1516- **WikiMT** — total 1010; splits: test (1010)17- **VGMIDI** — total 204; splits: test (204)18- **Pianist8** — total 411; splits: test (411)19- **MidiCaps** — total 1010; splits: test (1010)2021## Metrics2223- `Accuracy` **(primary)** — range: [0, 1]24 - Proportion of correctly classified instances out of the total number of instances in the test set.25- `F1-macro` — range: [0, 1]26 - Unweighted mean of recall (or F1) for each class, treating all classes equally regardless of their support.27- `MRR` **(primary)** — range: [0, 1]28 - Mean Reciprocal Rank: average of 1/rank for the first correctly retrieved item across all queries.29- `HR@K` — range: [0, 1]30 - Hit Rate at top K: fraction of queries where the relevant item appears in the top K ranked results.3132## Input / output format3334**Input**: Per instance: either a symbolic music representation (ABC notation or MIDI file) for classification, or a text query paired with a candidate music piece for semantic search.3536**Output**: Per instance: a predicted class label (genre, emotion, or composer) for classification; or a ranked list of music-text pairs for retrieval.3738## Scoring recipe3940```python41def compute_metrics(predictions, gold_labels, ranked_lists=None):42 if ranked_lists is None:43 correct = sum(1 for p, g in zip(predictions, gold_labels) if p == g)44 accuracy = correct / len(gold_labels)45 f1_macro = average_f1_per_class(predictions, gold_labels)46 return {'accuracy': accuracy, 'f1_macro': f1_macro}47 else:48 mrr_scores = []49 hr_counts = {1: 0, 10: 0, 100: 0}50 for ranks, gold in zip(ranked_lists, gold_labels):51 rank = ranks.index(gold) + 1 if gold in ranks else len(ranks) + 152 mrr_scores.append(1.0 / rank)53 for k in [1, 10, 100]:54 if rank <= k:55 hr_counts[k] += 156 mrr = sum(mrr_scores) / len(mrr_scores)57 hr = {k: v / len(gold_labels) for k, v in hr_counts.items()}58 return {'mrr': mrr, 'hr@1': hr[1], 'hr@10': hr[10], 'hr@100': hr[100]}59```6061## Common pitfalls6263- Data leakage: The pre-training set includes the Lakh MIDI dataset, so the test set for MidiCaps must be carefully sampled (1,010 pieces) to avoid overlap with training data.64- Modality mismatch: Baseline models like CLaMP do not natively support MIDI, requiring conversion to ABC notation for fair comparison, which may lose performance details.65- Translation quality dependency: Multilingual retrieval results are heavily influenced by the quality of machine-translated queries, measured via BLEU scores of back-translations.6667## Evidence (verbatim from paper)6869> Table 1: Classification performance for ABC notation and MIDI was assessed across three datasets: WikiMT (1,010 pieces, 8 genres), VGMIDI (204 pieces, 4 emotions), and Pianist8 (411 pieces, 8 composers). Table 2 shows semantic search results on the WikiMT and MidiCaps benchmarks, using Mean Reciprocal Rank (MRR) and Hit Rate at Top K (HR@K) to assess model performance in retrieving and ranking relevant music-text pairs.7071## Citation7273```bibtex74@misc{wu2024clamp2,75 title={CLaMP 2: Multimodal Music Information Retrieval Across 101 Languages Using Large Language Models},76 author={Shangda Wu et al. (2024)},77 year={2024},78 note={arXiv:2410.13267}79}80```8182- arXiv: 2410.13267