MelodySim: Measuring Melody-aware Music Similarity for Plagiarism Detection

Tongyu Lu, Charlotta-Marlena Geist, Jan Melechovský, Abhinaba Roy, Dorien Herremans · DOI

Introduction

The rapid advancement of generative AI models like Suno and Udio has introduced significant legal and ethical challenges regarding music plagiarism. Proving that an AI-generated track has "borrowed" from a human artist is difficult because traditional detection methods are often insufficient. Symbolic methods require MIDI files that are rarely available for recorded music, while audio fingerprinting only identifies exact samples or near-identical copies.

In music law, melody is the primary factor in copyright disputes. If a melody is stolen but the instrumentation, tempo, or texture is altered, traditional tools often fail. MelodySim addresses this gap by providing a framework and dataset designed to detect melody-aware similarity in raw audio, even when significant stylistic transformations have occurred.

Methodology

The researchers developed a two-pronged approach involving a specialized data augmentation pipeline and a deep learning architecture based on triplet loss.

The Augmentation Pipeline

To train a model to recognize the same melody across different musical "outfits," the team created a pipeline that modifies MIDI files using music theory-informed techniques. These include note splitting, chord inversions, and re-instrumentation. These modified MIDI files are then synthesized into audio, where further signal-level augmentations like pitch shifting and tempo warping are applied.

The MIDI and Audio augmentation pipeline used to create the MelodySim dataset.

The Triplet Neural Network (TNN)

The core of the system is a specialized neural network designed to map audio segments into a shared embedding space where similar melodies are clustered together.

  • Encoder: The model utilizes MERT-v1-95M, a powerful self-supervised model for acoustic music understanding.
  • Architecture: MERT features are processed through a 1D ResNet to generate "melody-aware" embeddings.
  • Training Strategy: The model is trained using triplet loss, comparing an "anchor" segment to a "positive" (same melody, different style) and a "negative" (different song) segment. The goal is to minimize the distance between the anchor and positive while maximizing the distance to the negative.
  • Classifier Head: A binary classifier predicts "same" or "different" based on embedding differences, utilizing a "stop gradient" trick to preserve the integrity of the embedding space.
The Triplet Neural Network architecture for training and inference.

Datasets

The study introduces and utilizes two primary datasets:

  1. MelodySim (New): Built on the Slakh2100 MIDI dataset, this benchmark contains 1,568 instrumental songs with three variations each, totaling 6,272 audio files.
  2. MCIC (Music Copyright Infringement Cases): A real-world dataset of song pairs from 116 actual court cases, used to test the model's generalization to "in-the-wild" legal disputes.

Key Results and Insights

  • High Accuracy: On the MelodySim test set, the model achieved a weighted F1-score of 0.98, significantly outperforming traditional baselines like Dynamic Time Warping (DTW).
  • Real-World Generalization: When tested on the MCIC dataset, the model achieved an F1-score of 0.73. While lower than the synthetic results, it still outperformed all DTW-based baselines, proving that synthetic training can translate to real-world legal scenarios.
  • Human Validation: A user study confirmed that the synthetic "positive" pairs were perceived by humans as having high melodic similarity, validating the augmentation pipeline's effectiveness.
  • Visual Evidence: By analyzing 10-second segments, the model generates a similarity matrix that can highlight specific regions of overlap, providing a visual tool potentially useful in courtroom settings.

Limitations and Future Work

While MelodySim represents a significant step forward, several challenges remain. The current dataset is exclusively instrumental; incorporating vocal melodies is a high priority for future research. Additionally, the model currently struggles with complex intra-song variations (e.g., verse vs. chorus) and very noisy real-world audio. Future iterations will also explore more sophisticated learned aggregation methods to replace the current simple threshold-based decision making for song-level verdicts.

Summary updated

BibTeX
@misc{lu2025melodysim,
  author = {Tongyu Lu and Charlotta-Marlena Geist and Jan Melechovský and Abhinaba Roy and Dorien Herremans},
  title = {{MelodySim: Measuring Melody-aware Music Similarity for Plagiarism Detection}},
  year = {2025},
  eprint = {2505.20979},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.20979},
}
Figure